(function($) {
/*!
* Bootstrap-select v1.13.2 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2018 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
! function(e, t) {
void 0 === e && void 0 !== window && (e = window), "function" == typeof define && define.amd ? define(["jquery"], function(e) {
return t(e)
}) : "object" == typeof module && module.exports ? module.exports = t(require("jquery")) : t(e.jQuery)
}(this, function(e) {
! function(F) {
"use strict";
var e, a, t, i = document.createElement("_");
if (i.classList.toggle("c3", !1), i.classList.contains("c3")) {
var s = DOMTokenList.prototype.toggle;
DOMTokenList.prototype.toggle = function(e, t) {
return 1 in arguments && !this.contains(e) == !t ? t : s.call(this, e)
}
}
function S(e) {
var t, i = [],
s = e && e.options;
if (e.multiple)
for (var n = 0, o = s.length; n < o; n++)(t = s[n]).selected && i.push(t.value || t.text);
else i = e.value;
return i
}
String.prototype.startsWith || (e = function() {
try {
var e = {},
t = Object.defineProperty,
i = t(e, e, e) && t
} catch (e) {}
return i
}(), a = {}.toString, t = function(e) {
if (null == this) throw new TypeError;
var t = String(this);
if (e && "[object RegExp]" == a.call(e)) throw new TypeError;
var i = t.length,
s = String(e),
n = s.length,
o = 1 < arguments.length ? arguments[1] : void 0,
l = o ? Number(o) : 0;
l != l && (l = 0);
var r = Math.min(Math.max(l, 0), i);
if (i < n + r) return !1;
for (var c = -1; ++c < n;)
if (t.charCodeAt(r + c) != s.charCodeAt(c)) return !1;
return !0
}, e ? e(String.prototype, "startsWith", {
value: t,
configurable: !0,
writable: !0
}) : String.prototype.startsWith = t), Object.keys || (Object.keys = function(e, t, i) {
for (t in i = [], e) i.hasOwnProperty.call(e, t) && i.push(t);
return i
});
var n = {
useDefault: !1,
_set: F.valHooks.select.set
};
F.valHooks.select.set = function(e, t) {
return t && !n.useDefault && F(e).data("selected", !0), n._set.apply(this, arguments)
};
var y = null,
o = function() {
try {
return new Event("change"), !0
} catch (e) {
return !1
}
}();
function $(e, t, i, s) {
for (var n = ["content", "subtext", "tokens"], o = !1, l = 0; l < n.length; l++) {
var r = n[l],
c = e[r];
if (c && (c = c.toString(), "content" === r && (c = c.replace(/<[^>]+>/g, "")), s && (c = d(c)), c = c.toUpperCase(), o = "contains" === i ? 0 <= c.indexOf(t) : c.startsWith(t))) break
}
return o
}
function O(e) {
return parseInt(e, 10) || 0
}
function d(e) {
return F.each([{
re: /[\xC0-\xC6]/g,
ch: "A"
}, {
re: /[\xE0-\xE6]/g,
ch: "a"
}, {
re: /[\xC8-\xCB]/g,
ch: "E"
}, {
re: /[\xE8-\xEB]/g,
ch: "e"
}, {
re: /[\xCC-\xCF]/g,
ch: "I"
}, {
re: /[\xEC-\xEF]/g,
ch: "i"
}, {
re: /[\xD2-\xD6]/g,
ch: "O"
}, {
re: /[\xF2-\xF6]/g,
ch: "o"
}, {
re: /[\xD9-\xDC]/g,
ch: "U"
}, {
re: /[\xF9-\xFC]/g,
ch: "u"
}, {
re: /[\xC7-\xE7]/g,
ch: "c"
}, {
re: /[\xD1]/g,
ch: "N"
}, {
re: /[\xF1]/g,
ch: "n"
}], function() {
e = e ? e.replace(this.re, this.ch) : ""
}), e
}
F.fn.triggerNative = function(e) {
var t, i = this[0];
i.dispatchEvent ? (o ? t = new Event(e, {
bubbles: !0
}) : (t = document.createEvent("Event")).initEvent(e, !0, !1), i.dispatchEvent(t)) : i.fireEvent ? ((t = document.createEventObject()).eventType = e, i.fireEvent("on" + e, t)) : this.trigger(e)
};
var l = function(t) {
var i = function(e) {
return t[e]
},
e = "(?:" + Object.keys(t).join("|") + ")",
s = RegExp(e),
n = RegExp(e, "g");
return function(e) {
return e = null == e ? "" : "" + e, s.test(e) ? e.replace(n, i) : e
}
},
G = l({
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"`": "`"
}),
f = l({
"&": "&",
"<": "<",
">": ">",
""": '"',
"'": "'",
"`": "`"
}),
E = {
32: " ",
48: "0",
49: "1",
50: "2",
51: "3",
52: "4",
53: "5",
54: "6",
55: "7",
56: "8",
57: "9",
59: ";",
65: "A",
66: "B",
67: "C",
68: "D",
69: "E",
70: "F",
71: "G",
72: "H",
73: "I",
74: "J",
75: "K",
76: "L",
77: "M",
78: "N",
79: "O",
80: "P",
81: "Q",
82: "R",
83: "S",
84: "T",
85: "U",
86: "V",
87: "W",
88: "X",
89: "Y",
90: "Z",
96: "0",
97: "1",
98: "2",
99: "3",
100: "4",
101: "5",
102: "6",
103: "7",
104: "8",
105: "9"
},
C = 27,
z = 13,
T = 32,
D = 9,
H = 38,
L = 40,
_ = {
success: !1,
major: "3"
};
try {
_.full = (F.fn.dropdown.Constructor.VERSION || "").split(" ")[0].split("."), _.major = _.full[0], _.success = !0
} catch (e) {
console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.", e)
}
var q = {
DISABLED: "disabled",
DIVIDER: "divider",
SHOW: "open",
DROPUP: "dropup",
MENU: "dropdown-menu",
MENURIGHT: "dropdown-menu-right",
MENULEFT: "dropdown-menu-left",
BUTTONCLASS: "btn-default",
POPOVERHEADER: "popover-title"
},
N = {
MENU: "." + q.MENU
};
"4" === _.major && (q.DIVIDER = "dropdown-divider", q.SHOW = "show", q.BUTTONCLASS = "btn-light", q.POPOVERHEADER = "popover-header");
var A = new RegExp(H + "|" + L),
P = new RegExp("^" + D + "$|" + C),
c = (new RegExp(z + "|" + T), function(e, t) {
var i = this;
n.useDefault || (F.valHooks.select.set = n._set, n.useDefault = !0), this.$element = F(e), this.$newElement = null, this.$button = null, this.$menu = null, this.options = t, this.selectpicker = {
main: {
map: {
newIndex: {},
originalIndex: {}
}
},
current: {
map: {}
},
search: {
map: {}
},
view: {},
keydown: {
keyHistory: "",
resetKeyHistory: {
start: function() {
return setTimeout(function() {
i.selectpicker.keydown.keyHistory = ""
}, 800)
}
}
}
}, null === this.options.title && (this.options.title = this.$element.attr("title"));
var s = this.options.windowPadding;
"number" == typeof s && (this.options.windowPadding = [s, s, s, s]), this.val = c.prototype.val, this.render = c.prototype.render, this.refresh = c.prototype.refresh, this.setStyle = c.prototype.setStyle, this.selectAll = c.prototype.selectAll, this.deselectAll = c.prototype.deselectAll, this.destroy = c.prototype.destroy, this.remove = c.prototype.remove, this.show = c.prototype.show, this.hide = c.prototype.hide, this.init()
});
function r(e) {
var o, l = arguments,
r = e;
if ([].shift.apply(l), !_.success) {
try {
_.full = (F.fn.dropdown.Constructor.VERSION || "").split(" ")[0].split(".")
} catch (e) {
_.full = c.BootstrapVersion.split(" ")[0].split(".")
}
_.major = _.full[0], _.success = !0, "4" === _.major && (q.DIVIDER = "dropdown-divider", q.SHOW = "show", q.BUTTONCLASS = "btn-light", c.DEFAULTS.style = q.BUTTONCLASS = "btn-light", q.POPOVERHEADER = "popover-header")
}
var t = this.each(function() {
var e = F(this);
if (e.is("select")) {
var t = e.data("selectpicker"),
i = "object" == typeof r && r;
if (t) {
if (i)
for (var s in i) i.hasOwnProperty(s) && (t.options[s] = i[s])
} else {
var n = F.extend({}, c.DEFAULTS, F.fn.selectpicker.defaults || {}, e.data(), i);
n.template = F.extend({}, c.DEFAULTS.template, F.fn.selectpicker.defaults ? F.fn.selectpicker.defaults.template : {}, e.data().template, i.template), e.data("selectpicker", t = new c(this, n))
}
"string" == typeof r && (o = t[r] instanceof Function ? t[r].apply(t, l) : t.options[r])
}
});
return void 0 !== o ? o : t
}
c.VERSION = "1.13.2", c.BootstrapVersion = _.major, c.DEFAULTS = {
noneSelectedText: "Nothing selected",
noneResultsText: "No results matched {0}",
countSelectedText: function(e, t) {
return 1 == e ? "{0} item selected" : "{0} items selected"
},
maxOptionsText: function(e, t) {
return [1 == e ? "Limit reached ({n} item max)" : "Limit reached ({n} items max)", 1 == t ? "Group limit reached ({n} item max)" : "Group limit reached ({n} items max)"]
},
selectAllText: "Select All",
deselectAllText: "Deselect All",
doneButton: !1,
doneButtonText: "Close",
multipleSeparator: ", ",
styleBase: "btn",
style: q.BUTTONCLASS,
size: 20,
title: null,
selectedTextFormat: "values",
width: !1,
container: !1,
hideDisabled: !1,
showSubtext: !1,
showIcon: !0,
showContent: !0,
dropupAuto: !1,
header: !1,
liveSearch: !1,
liveSearchPlaceholder: null,
liveSearchNormalize: !1,
liveSearchStyle: "contains",
actionsBox: !1,
iconBase: "glyphicon",
tickIcon: "glyphicon-ok",
showTick: !1,
template: {
caret: ' '
},
maxOptions: !1,
mobile: !1,
selectOnTab: !1,
dropdownAlignRight: !1,
windowPadding: 100,
virtualScroll: 300,
display: !1
}, "4" === _.major && (c.DEFAULTS.style = "btn-light", c.DEFAULTS.iconBase = "", c.DEFAULTS.tickIcon = "bs-ok-default"), c.prototype = {
constructor: c,
init: function() {
var i = this,
e = this.$element.attr("id");
this.$element.addClass("bs-select-hidden"), this.multiple = this.$element.prop("multiple"), this.autofocus = this.$element.prop("autofocus"), this.$newElement = this.createDropdown(), this.createLi(), this.$element.after(this.$newElement).prependTo(this.$newElement), this.$button = this.$newElement.children("button"), this.$menu = this.$newElement.children(N.MENU), this.$menuInner = this.$menu.children(".inner"), this.$searchbox = this.$menu.find("input"), this.$element.removeClass("bs-select-hidden"), !0 === this.options.dropdownAlignRight && this.$menu.addClass(q.MENURIGHT), void 0 !== e && this.$button.attr("data-id", e), this.checkDisabled(), this.clickListener(), this.options.liveSearch && this.liveSearchListener(), this.render(), this.setStyle(), this.setWidth(), this.options.container ? this.selectPosition() : this.$element.on("hide.bs.select", function() {
if (i.isVirtual()) {
var e = i.$menuInner[0],
t = e.firstChild.cloneNode(!1);
e.replaceChild(t, e.firstChild), e.scrollTop = 0
}
}), this.$menu.data("this", this), this.$newElement.data("this", this), this.options.mobile && this.mobile(), this.$newElement.on({
"hide.bs.dropdown": function(e) {
i.$menuInner.attr("aria-expanded", !1), i.$element.trigger("hide.bs.select", e)
},
"hidden.bs.dropdown": function(e) {
i.$element.trigger("hidden.bs.select", e)
},
"show.bs.dropdown": function(e) {
i.$menuInner.attr("aria-expanded", !0), i.$element.trigger("show.bs.select", e)
},
"shown.bs.dropdown": function(e) {
i.$element.trigger("shown.bs.select", e)
}
}), i.$element[0].hasAttribute("required") && this.$element.on("invalid", function() {
i.$button.addClass("bs-invalid"), i.$element.on({
"shown.bs.select": function() {
i.$element.val(i.$element.val()).off("shown.bs.select")
},
"rendered.bs.select": function() {
this.validity.valid && i.$button.removeClass("bs-invalid"), i.$element.off("rendered.bs.select")
}
}), i.$button.on("blur.bs.select", function() {
i.$element.focus().blur(), i.$button.off("blur.bs.select")
})
}), setTimeout(function() {
i.$element.trigger("loaded.bs.select")
})
},
createDropdown: function() {
var e = this.multiple || this.options.showTick ? " show-tick" : "",
t = this.autofocus ? " autofocus" : "",
i = this.options.header ? '
" : "",
s = this.options.liveSearch ? '
' : "",
n = this.multiple && this.options.actionsBox ? '' + this.options.selectAllText + ' ' + this.options.deselectAllText + "
" : "",
o = this.multiple && this.options.doneButton ? '" : "",
l = '' + ("4" === _.major ? "" : '' + this.options.template.caret + " ") + ' ";
return F(l)
},
setPositionData: function() {
this.selectpicker.view.canHighlight = [];
for (var e = 0; e < this.selectpicker.current.data.length; e++) {
var t = this.selectpicker.current.data[e],
i = !0;
"divider" === t.type ? (i = !1, t.height = this.sizeInfo.dividerHeight) : "optgroup-label" === t.type ? (i = !1, t.height = this.sizeInfo.dropdownHeaderHeight) : t.height = this.sizeInfo.liHeight, t.disabled && (i = !1), this.selectpicker.view.canHighlight.push(i), t.position = (0 === e ? 0 : this.selectpicker.current.data[e - 1].position) + t.height
}
},
isVirtual: function() {
return !1 !== this.options.virtualScroll && this.selectpicker.main.elements.length >= this.options.virtualScroll || !0 === this.options.virtualScroll
},
createView: function(C, e) {
e = e || 0;
var O = this;
this.selectpicker.current = C ? this.selectpicker.search : this.selectpicker.main;
var z, T, D = [];
function i(e, t) {
var i, s, n, o, l, r, c, a, d, h = O.selectpicker.current.elements.length,
p = [],
u = void 0,
f = !0,
m = O.isVirtual();
O.selectpicker.view.scrollTop = e, !0 === m && O.sizeInfo.hasScrollBar && O.$menu[0].offsetWidth > O.sizeInfo.totalMenuWidth && (O.sizeInfo.menuWidth = O.$menu[0].offsetWidth, O.sizeInfo.totalMenuWidth = O.sizeInfo.menuWidth + O.sizeInfo.scrollBarWidth, O.$menu.css("min-width", O.sizeInfo.menuWidth)), i = Math.ceil(O.sizeInfo.menuInnerHeight / O.sizeInfo.liHeight * 1.5), s = Math.round(h / i) || 1;
for (var v = 0; v < s; v++) {
var g = (v + 1) * i;
if (v === s - 1 && (g = h), p[v] = [v * i + (v ? 1 : 0), g], !h) break;
void 0 === u && e <= O.selectpicker.current.data[g - 1].position - O.sizeInfo.menuInnerHeight && (u = v)
}
if (void 0 === u && (u = 0), l = [O.selectpicker.view.position0, O.selectpicker.view.position1], n = Math.max(0, u - 1), o = Math.min(s - 1, u + 1), O.selectpicker.view.position0 = Math.max(0, p[n][0]) || 0, O.selectpicker.view.position1 = Math.min(h, p[o][1]) || 0, r = l[0] !== O.selectpicker.view.position0 || l[1] !== O.selectpicker.view.position1, void 0 !== O.activeIndex && (T = O.selectpicker.current.elements[O.selectpicker.current.map.newIndex[O.prevActiveIndex]], D = O.selectpicker.current.elements[O.selectpicker.current.map.newIndex[O.activeIndex]], z = O.selectpicker.current.elements[O.selectpicker.current.map.newIndex[O.selectedIndex]], t && (O.activeIndex !== O.selectedIndex && (D.classList.remove("active"), D.firstChild && D.firstChild.classList.remove("active")), O.activeIndex = void 0), O.activeIndex && O.activeIndex !== O.selectedIndex && z && z.length && (z.classList.remove("active"), z.firstChild && z.firstChild.classList.remove("active"))), void 0 !== O.prevActiveIndex && O.prevActiveIndex !== O.activeIndex && O.prevActiveIndex !== O.selectedIndex && T && T.length && (T.classList.remove("active"), T.firstChild && T.firstChild.classList.remove("active")), (t || r) && (c = O.selectpicker.view.visibleElements ? O.selectpicker.view.visibleElements.slice() : [], O.selectpicker.view.visibleElements = O.selectpicker.current.elements.slice(O.selectpicker.view.position0, O.selectpicker.view.position1), O.setOptionStatus(), (C || !1 === m && t) && (a = c, d = O.selectpicker.view.visibleElements, f = !(a.length === d.length && a.every(function(e, t) {
return e === d[t]
}))), (t || !0 === m) && f)) {
var b, w, x = O.$menuInner[0],
I = document.createDocumentFragment(),
k = x.firstChild.cloneNode(!1),
$ = !0 === m ? O.selectpicker.view.visibleElements : O.selectpicker.current.elements;
x.replaceChild(k, x.firstChild);
v = 0;
for (var E = $.length; v < E; v++) I.appendChild($[v]);
!0 === m && (b = 0 === O.selectpicker.view.position0 ? 0 : O.selectpicker.current.data[O.selectpicker.view.position0 - 1].position, w = O.selectpicker.view.position1 > h - 1 ? 0 : O.selectpicker.current.data[h - 1].position - O.selectpicker.current.data[O.selectpicker.view.position1 - 1].position, x.firstChild.style.marginTop = b + "px", x.firstChild.style.marginBottom = w + "px"), x.firstChild.appendChild(I)
}
if (O.prevActiveIndex = O.activeIndex, O.options.liveSearch) {
if (C && t) {
var S, y = 0;
O.selectpicker.view.canHighlight[y] || (y = 1 + O.selectpicker.view.canHighlight.slice(1).indexOf(!0)), S = O.selectpicker.view.visibleElements[y], O.selectpicker.view.currentActive && (O.selectpicker.view.currentActive.classList.remove("active"), O.selectpicker.view.currentActive.firstChild && O.selectpicker.view.currentActive.firstChild.classList.remove("active")), S && (S.classList.add("active"), S.firstChild && S.firstChild.classList.add("active")), O.activeIndex = O.selectpicker.current.map.originalIndex[y]
}
} else O.$menuInner.focus()
}
this.setPositionData(), i(e, !0), this.$menuInner.off("scroll.createView").on("scroll.createView", function(e, t) {
O.noScroll || i(this.scrollTop, t), O.noScroll = !1
}), F(window).off("resize.createView").on("resize.createView", function() {
i(O.$menuInner[0].scrollTop)
})
},
createLi: function() {
var z, T = this,
D = [],
H = 0,
L = 0,
N = [],
A = 0,
P = 0,
R = -1;
this.selectpicker.view.titleOption || (this.selectpicker.view.titleOption = document.createElement("option"));
var W = {
span: document.createElement("span"),
subtext: document.createElement("small"),
a: document.createElement("a"),
li: document.createElement("li"),
whitespace: document.createTextNode(" ")
},
e = W.span.cloneNode(!1),
B = document.createDocumentFragment();
e.className = T.options.iconBase + " " + T.options.tickIcon + " check-mark", W.a.appendChild(e), W.a.setAttribute("role", "option"), W.subtext.className = "text-muted", W.text = W.span.cloneNode(!1), W.text.className = "text";
var M = function(e, t, i, s) {
var n = W.li.cloneNode(!1);
return e && (1 === e.nodeType || 11 === e.nodeType ? n.appendChild(e) : n.innerHTML = e), void 0 !== i && "" !== i && (n.className = i), null != s && n.classList.add("optgroup-" + s), n
},
U = function(e, t, i) {
var s = W.a.cloneNode(!0);
return e && (11 === e.nodeType ? s.appendChild(e) : s.insertAdjacentHTML("beforeend", e)), void 0 !== t & "" !== t && (s.className = t), "4" === _.major && s.classList.add("dropdown-item"), i && s.setAttribute("style", i), s
},
V = function(e) {
var t, i, s = W.text.cloneNode(!1);
if (e.optionContent) s.innerHTML = e.optionContent;
else {
if (s.textContent = e.text, e.optionIcon) {
var n = W.whitespace.cloneNode(!1);
(i = W.span.cloneNode(!1)).className = T.options.iconBase + " " + e.optionIcon, B.appendChild(i), B.appendChild(n)
}
e.optionSubtext && ((t = W.subtext.cloneNode(!1)).innerHTML = e.optionSubtext, s.appendChild(t))
}
return B.appendChild(s), B
};
if (this.options.title && !this.multiple) {
R--;
var t = this.$element[0],
i = !1,
s = !this.selectpicker.view.titleOption.parentNode;
if (s) this.selectpicker.view.titleOption.className = "bs-title-option", this.selectpicker.view.titleOption.value = "", i = void 0 === F(t.options[t.selectedIndex]).attr("selected") && void 0 === this.$element.data("selected");
(s || 0 !== this.selectpicker.view.titleOption.index) && t.insertBefore(this.selectpicker.view.titleOption, t.firstChild), i && (t.selectedIndex = 0)
}
var j = this.$element.find("option");
j.each(function(e) {
var t = F(this);
if (R++, !t.hasClass("bs-title-option")) {
var i, s, n = t.data(),
o = this.className || "",
l = G(this.style.cssText),
r = n.content,
c = this.textContent,
a = n.tokens,
d = n.subtext,
h = n.icon,
p = t.parent(),
u = p[0],
f = "OPTGROUP" === u.tagName,
m = f && u.disabled,
v = this.disabled || m,
g = this.previousElementSibling && "OPTGROUP" === this.previousElementSibling.tagName,
b = p.data();
if (!0 === n.hidden || T.options.hideDisabled && (v && !f || m)) {
i = n.prevHiddenIndex, t.next().data("prevHiddenIndex", void 0 !== i ? i : e), R--, g || void 0 !== i && (y = j[i].previousElementSibling) && "OPTGROUP" === y.tagName && !y.disabled && (g = !0), g && "divider" !== N[N.length - 1].type && (R++, D.push(M(!1, 0, q.DIVIDER, A + "div")), N.push({
type: "divider",
optID: A
}))
} else {
if (f && !0 !== n.divider) {
if (T.options.hideDisabled && v) {
if (void 0 === b.allOptionsDisabled) {
var w = p.children();
p.data("allOptionsDisabled", w.filter(":disabled").length === w.length)
}
if (p.data("allOptionsDisabled")) return void R--
}
var x = " " + u.className || "";
if (!this.previousElementSibling) {
A += 1;
var I = u.label,
k = G(I),
$ = b.subtext,
E = b.icon;
0 !== e && 0 < D.length && (R++, D.push(M(!1, 0, q.DIVIDER, A + "div")), N.push({
type: "divider",
optID: A
})), R++;
var S = function(e) {
var t, i, s = W.text.cloneNode(!1);
if (s.innerHTML = e.labelEscaped, e.labelIcon) {
var n = W.whitespace.cloneNode(!1);
(i = W.span.cloneNode(!1)).className = T.options.iconBase + " " + e.labelIcon, B.appendChild(i), B.appendChild(n)
}
return e.labelSubtext && ((t = W.subtext.cloneNode(!1)).textContent = e.labelSubtext, s.appendChild(t)), B.appendChild(s), B
}({
labelEscaped: k,
labelSubtext: $,
labelIcon: E
});
D.push(M(S, 0, "dropdown-header" + x, A)), N.push({
content: k,
subtext: $,
type: "optgroup-label",
optID: A
}), P = R - 1
}
if (T.options.hideDisabled && v || !0 === n.hidden) return void R--;
s = V({
text: c,
optionContent: r,
optionSubtext: d,
optionIcon: h
}), D.push(M(U(s, "opt " + o + x, l), 0, "", A)), N.push({
content: r || c,
subtext: d,
tokens: a,
type: "option",
optID: A,
headerIndex: P,
lastIndex: P + u.childElementCount,
originalIndex: e,
data: n
}), H++
} else if (!0 === n.divider) D.push(M(!1, 0, q.DIVIDER)), N.push({
type: "divider",
originalIndex: e,
data: n
});
else {
var y;
if (!g && T.options.hideDisabled)
if (void 0 !== (i = n.prevHiddenIndex))(y = j[i].previousElementSibling) && "OPTGROUP" === y.tagName && !y.disabled && (g = !0);
g && "divider" !== N[N.length - 1].type && (R++, D.push(M(!1, 0, q.DIVIDER, A + "div")), N.push({
type: "divider",
optID: A
})), s = V({
text: c,
optionContent: r,
optionSubtext: d,
optionIcon: h
}), D.push(M(U(s, o, l))), N.push({
content: r || c,
subtext: d,
tokens: a,
type: "option",
originalIndex: e,
data: n
}), H++
}
T.selectpicker.main.map.newIndex[e] = R, T.selectpicker.main.map.originalIndex[R] = e;
var C = N[N.length - 1];
C.disabled = v;
var O = 0;
C.content && (O += C.content.length), C.subtext && (O += C.subtext.length), h && (O += 1), L < O && (L = O, z = D[D.length - 1])
}
}
}), this.selectpicker.main.elements = D, this.selectpicker.main.data = N, this.selectpicker.current = this.selectpicker.main, this.selectpicker.view.widestOption = z, this.selectpicker.view.availableOptionsCount = H
},
findLis: function() {
return this.$menuInner.find(".inner > li")
},
render: function() {
var e = this,
t = this.$element.find("option"),
i = [],
s = [];
this.togglePlaceholder(), this.tabIndex();
for (var n = 0, o = this.selectpicker.main.elements.length; n < o; n++) {
var l = t[this.selectpicker.main.map.originalIndex[n]];
if (l && l.selected && (i.push(l), s.length < 100 && "count" !== e.options.selectedTextFormat || 1 === i.length)) {
if (e.options.hideDisabled && (l.disabled || "OPTGROUP" === l.parentNode.tagName && l.parentNode.disabled)) return;
var r, c, a = this.selectpicker.main.data[n].data,
d = a.icon && e.options.showIcon ? ' ' : "";
r = e.options.showSubtext && a.subtext && !e.multiple ? ' ' + a.subtext + " " : "", c = l.title ? l.title : a.content && e.options.showContent ? a.content.toString() : d + l.innerHTML.trim() + r, s.push(c)
}
}
var h = this.multiple ? s.join(this.options.multipleSeparator) : s[0];
if (50 < i.length && (h += "..."), this.multiple && -1 !== this.options.selectedTextFormat.indexOf("count")) {
var p = this.options.selectedTextFormat.split(">");
if (1 < p.length && i.length > p[1] || 1 === p.length && 2 <= i.length) {
var u = this.selectpicker.view.availableOptionsCount;
h = ("function" == typeof this.options.countSelectedText ? this.options.countSelectedText(i.length, u) : this.options.countSelectedText).replace("{0}", i.length.toString()).replace("{1}", u.toString())
}
}
null == this.options.title && (this.options.title = this.$element.attr("title")), "static" == this.options.selectedTextFormat && (h = this.options.title), h || (h = void 0 !== this.options.title ? this.options.title : this.options.noneSelectedText), this.$button[0].title = f(h.replace(/<[^>]*>?/g, "").trim()), this.$button.find(".filter-option-inner-inner")[0].innerHTML = h, this.$element.trigger("rendered.bs.select")
},
setStyle: function(e, t) {
this.$element.attr("class") && this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, ""));
var i = e || this.options.style;
"add" == t ? this.$button.addClass(i) : "remove" == t ? this.$button.removeClass(i) : (this.$button.removeClass(this.options.style), this.$button.addClass(i))
},
liHeight: function(e) {
if (e || !1 !== this.options.size && !this.sizeInfo) {
this.sizeInfo || (this.sizeInfo = {});
var t = document.createElement("div"),
i = document.createElement("div"),
s = document.createElement("div"),
n = document.createElement("ul"),
o = document.createElement("li"),
l = document.createElement("li"),
r = document.createElement("li"),
c = document.createElement("a"),
a = document.createElement("span"),
d = this.options.header && 0 < this.$menu.find("." + q.POPOVERHEADER).length ? this.$menu.find("." + q.POPOVERHEADER)[0].cloneNode(!0) : null,
h = this.options.liveSearch ? document.createElement("div") : null,
p = this.options.actionsBox && this.multiple && 0 < this.$menu.find(".bs-actionsbox").length ? this.$menu.find(".bs-actionsbox")[0].cloneNode(!0) : null,
u = this.options.doneButton && this.multiple && 0 < this.$menu.find(".bs-donebutton").length ? this.$menu.find(".bs-donebutton")[0].cloneNode(!0) : null;
if (this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth, a.className = "text", c.className = "dropdown-item " + this.$element.find("option")[0].className, t.className = this.$menu[0].parentNode.className + " " + q.SHOW, t.style.width = this.sizeInfo.selectWidth + "px", "auto" === this.options.width && (i.style.minWidth = 0), i.className = q.MENU + " " + q.SHOW, s.className = "inner " + q.SHOW, n.className = q.MENU + " inner " + ("4" === _.major ? q.SHOW : ""), o.className = q.DIVIDER, l.className = "dropdown-header", a.appendChild(document.createTextNode("Inner text")), c.appendChild(a), r.appendChild(c), l.appendChild(a.cloneNode(!0)), this.selectpicker.view.widestOption && n.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)), n.appendChild(r), n.appendChild(o), n.appendChild(l), d && i.appendChild(d), h) {
var f = document.createElement("input");
h.className = "bs-searchbox", f.className = "form-control", h.appendChild(f), i.appendChild(h)
}
p && i.appendChild(p), s.appendChild(n), i.appendChild(s), u && i.appendChild(u), t.appendChild(i), document.body.appendChild(t);
var m, v = c.offsetHeight,
g = l ? l.offsetHeight : 0,
b = d ? d.offsetHeight : 0,
w = h ? h.offsetHeight : 0,
x = p ? p.offsetHeight : 0,
I = u ? u.offsetHeight : 0,
k = F(o).outerHeight(!0),
$ = !!window.getComputedStyle && window.getComputedStyle(i),
E = i.offsetWidth,
S = $ ? null : F(i),
y = {
vert: O($ ? $.paddingTop : S.css("paddingTop")) + O($ ? $.paddingBottom : S.css("paddingBottom")) + O($ ? $.borderTopWidth : S.css("borderTopWidth")) + O($ ? $.borderBottomWidth : S.css("borderBottomWidth")),
horiz: O($ ? $.paddingLeft : S.css("paddingLeft")) + O($ ? $.paddingRight : S.css("paddingRight")) + O($ ? $.borderLeftWidth : S.css("borderLeftWidth")) + O($ ? $.borderRightWidth : S.css("borderRightWidth"))
},
C = {
vert: y.vert + O($ ? $.marginTop : S.css("marginTop")) + O($ ? $.marginBottom : S.css("marginBottom")) + 2,
horiz: y.horiz + O($ ? $.marginLeft : S.css("marginLeft")) + O($ ? $.marginRight : S.css("marginRight")) + 2
};
s.style.overflowY = "scroll", m = i.offsetWidth - E, document.body.removeChild(t), this.sizeInfo.liHeight = v, this.sizeInfo.dropdownHeaderHeight = g, this.sizeInfo.headerHeight = b, this.sizeInfo.searchHeight = w, this.sizeInfo.actionsHeight = x, this.sizeInfo.doneButtonHeight = I, this.sizeInfo.dividerHeight = k, this.sizeInfo.menuPadding = y, this.sizeInfo.menuExtras = C, this.sizeInfo.menuWidth = E, this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth, this.sizeInfo.scrollBarWidth = m, this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight, this.setPositionData()
}
},
getSelectPosition: function() {
var e, t = F(window),
i = this.$newElement.offset(),
s = F(this.options.container);
this.options.container && !s.is("body") ? ((e = s.offset()).top += parseInt(s.css("borderTopWidth")), e.left += parseInt(s.css("borderLeftWidth"))) : e = {
top: 0,
left: 0
};
var n = this.options.windowPadding;
this.sizeInfo.selectOffsetTop = i.top - e.top - t.scrollTop(), this.sizeInfo.selectOffsetBot = t.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - e.top - n[2], this.sizeInfo.selectOffsetLeft = i.left - e.left - t.scrollLeft(), this.sizeInfo.selectOffsetRight = t.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - e.left - n[1], this.sizeInfo.selectOffsetTop -= n[0], this.sizeInfo.selectOffsetLeft -= n[3]
},
setMenuSize: function(e) {
this.getSelectPosition();
var t, i, s, n, o, l, r, c = this.sizeInfo.selectWidth,
a = this.sizeInfo.liHeight,
d = this.sizeInfo.headerHeight,
h = this.sizeInfo.searchHeight,
p = this.sizeInfo.actionsHeight,
u = this.sizeInfo.doneButtonHeight,
f = this.sizeInfo.dividerHeight,
m = this.sizeInfo.menuPadding,
v = 0;
if (this.options.dropupAuto && (r = a * this.selectpicker.current.elements.length + m.vert, this.$newElement.toggleClass(q.DROPUP, this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && r + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot)), "auto" === this.options.size) n = 3 < this.selectpicker.current.elements.length ? 3 * this.sizeInfo.liHeight + this.sizeInfo.menuExtras.vert - 2 : 0, i = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert, s = n + d + h + p + u, l = Math.max(n - m.vert, 0), this.$newElement.hasClass(q.DROPUP) && (i = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert), t = (o = i) - d - h - p - u - m.vert;
else if (this.options.size && "auto" != this.options.size && this.selectpicker.current.elements.length > this.options.size) {
for (var g = 0; g < this.options.size; g++) "divider" === this.selectpicker.current.data[g].type && v++;
t = (i = a * this.options.size + v * f + m.vert) - m.vert, o = i + d + h + p + u, s = l = ""
}
"auto" === this.options.dropdownAlignRight && this.$menu.toggleClass(q.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < this.$menu[0].offsetWidth - c), this.$menu.css({
"max-height": o + "px",
overflow: "hidden",
"min-height": s + "px"
}), this.$menuInner.css({
"max-height": t + "px",
"overflow-y": "auto",
"min-height": l + "px"
}), this.sizeInfo.menuInnerHeight = t, this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight && (this.sizeInfo.hasScrollBar = !0, this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth, this.$menu.css("min-width", this.sizeInfo.totalMenuWidth)), this.dropdown && this.dropdown._popper && this.dropdown._popper.update()
},
setSize: function(e) {
if (this.liHeight(e), this.options.header && this.$menu.css("padding-top", 0), !1 !== this.options.size) {
var t, i = this,
s = F(window),
n = 0;
this.setMenuSize(), "auto" === this.options.size ? (this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize", function() {
return i.setMenuSize()
}), s.off("resize.setMenuSize scroll.setMenuSize").on("resize.setMenuSize scroll.setMenuSize", function() {
return i.setMenuSize()
})) : this.options.size && "auto" != this.options.size && this.selectpicker.current.elements.length > this.options.size && (this.$searchbox.off("input.setMenuSize propertychange.setMenuSize"), s.off("resize.setMenuSize scroll.setMenuSize")), e ? n = this.$menuInner[0].scrollTop : i.multiple || "number" == typeof(t = i.selectpicker.main.map.newIndex[i.$element[0].selectedIndex]) && !1 !== i.options.size && (n = (n = i.sizeInfo.liHeight * t) - i.sizeInfo.menuInnerHeight / 2 + i.sizeInfo.liHeight / 2), i.createView(!1, n)
}
},
setWidth: function() {
var i = this;
"auto" === this.options.width ? requestAnimationFrame(function() {
i.$menu.css("min-width", "0"), i.liHeight(), i.setMenuSize();
var e = i.$newElement.clone().appendTo("body"),
t = e.css("width", "auto").children("button").outerWidth();
e.remove(), i.sizeInfo.selectWidth = Math.max(i.sizeInfo.totalMenuWidth, t), i.$newElement.css("width", i.sizeInfo.selectWidth + "px")
}) : "fit" === this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", "").addClass("fit-width")) : this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", this.options.width)) : (this.$menu.css("min-width", ""), this.$newElement.css("width", "")), this.$newElement.hasClass("fit-width") && "fit" !== this.options.width && this.$newElement.removeClass("fit-width")
},
selectPosition: function() {
this.$bsContainer = F('
');
var s, n, o, l = this,
r = F(this.options.container),
e = function(e) {
var t = {},
i = l.options.display || F.fn.dropdown.Constructor.Default.display;
l.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi, "")).toggleClass(q.DROPUP, e.hasClass(q.DROPUP)), s = e.offset(), r.is("body") ? n = {
top: 0,
left: 0
} : ((n = r.offset()).top += parseInt(r.css("borderTopWidth")) - r.scrollTop(), n.left += parseInt(r.css("borderLeftWidth")) - r.scrollLeft()), o = e.hasClass(q.DROPUP) ? 0 : e[0].offsetHeight, (_.major < 4 || "static" === i) && (t.top = s.top - n.top + o, t.left = s.left - n.left), t.width = e[0].offsetWidth, l.$bsContainer.css(t)
};
this.$button.on("click.bs.dropdown.data-api", function() {
l.isDisabled() || (e(l.$newElement), l.$bsContainer.appendTo(l.options.container).toggleClass(q.SHOW, !l.$button.hasClass(q.SHOW)).append(l.$menu))
}), F(window).on("resize scroll", function() {
e(l.$newElement)
}), this.$element.on("hide.bs.select", function() {
l.$menu.data("height", l.$menu.height()), l.$bsContainer.detach()
})
},
setOptionStatus: function() {
var e = this,
t = this.$element.find("option");
if (e.noScroll = !1, e.selectpicker.view.visibleElements && e.selectpicker.view.visibleElements.length)
for (var i = 0; i < e.selectpicker.view.visibleElements.length; i++) {
var s = e.selectpicker.current.map.originalIndex[i + e.selectpicker.view.position0],
n = t[s];
if (n) {
var o = this.selectpicker.main.map.newIndex[s],
l = this.selectpicker.main.elements[o];
e.setDisabled(s, n.disabled || "OPTGROUP" === n.parentNode.tagName && n.parentNode.disabled, o, l), e.setSelected(s, n.selected, o, l)
}
}
},
setSelected: function(e, t, i, s) {
var n, o, l, r = void 0 !== this.activeIndex,
c = this.activeIndex === e || t && !this.multiple && !r;
i || (i = this.selectpicker.main.map.newIndex[e]), s || (s = this.selectpicker.main.elements[i]), l = s.firstChild, t && (this.selectedIndex = e), s.classList.toggle("selected", t), s.classList.toggle("active", c), c && (this.selectpicker.view.currentActive = s, this.activeIndex = e), l && (l.classList.toggle("selected", t), l.classList.toggle("active", c), l.setAttribute("aria-selected", t)), c || !r && t && void 0 !== this.prevActiveIndex && (n = this.selectpicker.main.map.newIndex[this.prevActiveIndex], (o = this.selectpicker.main.elements[n]).classList.toggle("selected", t), o.classList.remove("active"), o.firstChild && (o.firstChild.classList.toggle("selected", t), o.firstChild.classList.remove("active")))
},
setDisabled: function(e, t, i, s) {
var n;
i || (i = this.selectpicker.main.map.newIndex[e]), s || (s = this.selectpicker.main.elements[i]), n = s.firstChild, s.classList.toggle(q.DISABLED, t), n && ("4" === _.major && n.classList.toggle(q.DISABLED, t), n.setAttribute("aria-disabled", t), t ? n.setAttribute("tabindex", -1) : n.setAttribute("tabindex", 0))
},
isDisabled: function() {
return this.$element[0].disabled
},
checkDisabled: function() {
var e = this;
this.isDisabled() ? (this.$newElement.addClass(q.DISABLED), this.$button.addClass(q.DISABLED).attr("tabindex", -1).attr("aria-disabled", !0)) : (this.$button.hasClass(q.DISABLED) && (this.$newElement.removeClass(q.DISABLED), this.$button.removeClass(q.DISABLED).attr("aria-disabled", !1)), -1 != this.$button.attr("tabindex") || this.$element.data("tabindex") || this.$button.removeAttr("tabindex")), this.$button.click(function() {
return !e.isDisabled()
})
},
togglePlaceholder: function() {
var e = this.$element[0],
t = e.selectedIndex,
i = -1 === t;
i || e.options[t].value || (i = !0), this.$button.toggleClass("bs-placeholder", i)
},
tabIndex: function() {
this.$element.data("tabindex") !== this.$element.attr("tabindex") && -98 !== this.$element.attr("tabindex") && "-98" !== this.$element.attr("tabindex") && (this.$element.data("tabindex", this.$element.attr("tabindex")), this.$button.attr("tabindex", this.$element.data("tabindex"))), this.$element.attr("tabindex", -98)
},
clickListener: function() {
var E = this,
t = F(document);
function e() {
E.options.liveSearch ? E.$searchbox.focus() : E.$menuInner.focus()
}
function i() {
E.dropdown && E.dropdown._popper && E.dropdown._popper.state.isCreated ? e() : requestAnimationFrame(i)
}
t.data("spaceSelect", !1), this.$button.on("keyup", function(e) {
/(32)/.test(e.keyCode.toString(10)) && t.data("spaceSelect") && (e.preventDefault(), t.data("spaceSelect", !1))
}), this.$newElement.on("show.bs.dropdown", function() {
3 < _.major && !E.dropdown && (E.dropdown = E.$button.data("bs.dropdown"), E.dropdown._menu = E.$menu[0])
}), this.$button.on("click.bs.dropdown.data-api", function() {
E.$newElement.hasClass(q.SHOW) || E.setSize()
}), this.$element.on("shown.bs.select", function() {
E.$menuInner[0].scrollTop !== E.selectpicker.view.scrollTop && (E.$menuInner[0].scrollTop = E.selectpicker.view.scrollTop), 3 < _.major ? requestAnimationFrame(i) : e()
}), this.$menuInner.on("click", "li a", function(e, t) {
var i = F(this),
s = E.isVirtual() ? E.selectpicker.view.position0 : 0,
n = E.selectpicker.current.map.originalIndex[i.parent().index() + s],
o = S(E.$element[0]),
l = E.$element.prop("selectedIndex"),
r = !0;
if (E.multiple && 1 !== E.options.maxOptions && e.stopPropagation(), e.preventDefault(), !E.isDisabled() && !i.parent().hasClass(q.DISABLED)) {
var c = E.$element.find("option"),
a = c.eq(n),
d = a.prop("selected"),
h = a.parent("optgroup"),
p = h.find("option"),
u = E.options.maxOptions,
f = h.data("maxOptions") || !1;
if (n === E.activeIndex && (t = !0), t || (E.prevActiveIndex = E.activeIndex, E.activeIndex = void 0), E.multiple) {
if (a.prop("selected", !d), E.setSelected(n, !d), i.blur(), !1 !== u || !1 !== f) {
var m = u < c.filter(":selected").length,
v = f < h.find("option:selected").length;
if (u && m || f && v)
if (u && 1 == u) {
c.prop("selected", !1), a.prop("selected", !0);
for (var g = 0; g < c.length; g++) E.setSelected(g, !1);
E.setSelected(n, !0)
} else if (f && 1 == f) {
h.find("option:selected").prop("selected", !1), a.prop("selected", !0);
for (g = 0; g < p.length; g++) {
var b = p[g];
E.setSelected(c.index(b), !1)
}
E.setSelected(n, !0)
} else {
var w = "string" == typeof E.options.maxOptionsText ? [E.options.maxOptionsText, E.options.maxOptionsText] : E.options.maxOptionsText,
x = "function" == typeof w ? w(u, f) : w,
I = x[0].replace("{n}", u),
k = x[1].replace("{n}", f),
$ = F('
');
x[2] && (I = I.replace("{var}", x[2][1 < u ? 0 : 1]), k = k.replace("{var}", x[2][1 < f ? 0 : 1])), a.prop("selected", !1), E.$menu.append($), u && m && ($.append(F("" + I + "
")), r = !1, E.$element.trigger("maxReached.bs.select")), f && v && ($.append(F("" + k + "
")), r = !1, E.$element.trigger("maxReachedGrp.bs.select")), setTimeout(function() {
E.setSelected(n, !1)
}, 10), $.delay(750).fadeOut(300, function() {
F(this).remove()
})
}
}
} else c.prop("selected", !1), a.prop("selected", !0), E.setSelected(n, !0);
!E.multiple || E.multiple && 1 === E.options.maxOptions ? E.$button.focus() : E.options.liveSearch && E.$searchbox.focus(), r && (o != S(E.$element[0]) && E.multiple || l != E.$element.prop("selectedIndex") && !E.multiple) && (y = [n, a.prop("selected"), o], E.$element.triggerNative("change"))
}
}), this.$menu.on("click", "li." + q.DISABLED + " a, ." + q.POPOVERHEADER + ", ." + q.POPOVERHEADER + " :not(.close)", function(e) {
e.currentTarget == this && (e.preventDefault(), e.stopPropagation(), E.options.liveSearch && !F(e.target).hasClass("close") ? E.$searchbox.focus() : E.$button.focus())
}), this.$menuInner.on("click", ".divider, .dropdown-header", function(e) {
e.preventDefault(), e.stopPropagation(), E.options.liveSearch ? E.$searchbox.focus() : E.$button.focus()
}), this.$menu.on("click", "." + q.POPOVERHEADER + " .close", function() {
E.$button.click()
}), this.$searchbox.on("click", function(e) {
e.stopPropagation()
}), this.$menu.on("click", ".actions-btn", function(e) {
E.options.liveSearch ? E.$searchbox.focus() : E.$button.focus(), e.preventDefault(), e.stopPropagation(), F(this).hasClass("bs-select-all") ? E.selectAll() : E.deselectAll()
}), this.$element.on({
change: function() {
E.render(), E.$element.trigger("changed.bs.select", y), y = null
},
focus: function() {
E.$button.focus()
}
})
},
liveSearchListener: function() {
var u = this,
f = document.createElement("li");
this.$button.on("click.bs.dropdown.data-api", function() {
u.$searchbox.val() && u.$searchbox.val("")
}), this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api", function(e) {
e.stopPropagation()
}), this.$searchbox.on("input propertychange", function() {
var e = u.$searchbox.val();
if (u.selectpicker.search.map.newIndex = {}, u.selectpicker.search.map.originalIndex = {}, u.selectpicker.search.elements = [], u.selectpicker.search.data = [], e) {
var t = [],
i = e.toUpperCase(),
s = {},
n = [],
o = u._searchStyle(),
l = u.options.liveSearchNormalize;
u._$lisSelected = u.$menuInner.find(".selected");
for (var r = 0; r < u.selectpicker.main.data.length; r++) {
var c = u.selectpicker.main.data[r];
s[r] || (s[r] = $(c, i, o, l)), s[r] && void 0 !== c.headerIndex && -1 === n.indexOf(c.headerIndex) && (0 < c.headerIndex && (s[c.headerIndex - 1] = !0, n.push(c.headerIndex - 1)), s[c.headerIndex] = !0, n.push(c.headerIndex), s[c.lastIndex + 1] = !0), s[r] && "optgroup-label" !== c.type && n.push(r)
}
r = 0;
for (var a = n.length; r < a; r++) {
var d = n[r],
h = n[r - 1],
p = (c = u.selectpicker.main.data[d], u.selectpicker.main.data[h]);
("divider" !== c.type || "divider" === c.type && p && "divider" !== p.type && a - 1 !== r) && (u.selectpicker.search.data.push(c), t.push(u.selectpicker.main.elements[d]), c.hasOwnProperty("originalIndex") && (u.selectpicker.search.map.newIndex[c.originalIndex] = t.length - 1, u.selectpicker.search.map.originalIndex[t.length - 1] = c.originalIndex))
}
u.activeIndex = void 0, u.noScroll = !0, u.$menuInner.scrollTop(0), u.selectpicker.search.elements = t, u.createView(!0), t.length || (f.className = "no-results", f.innerHTML = u.options.noneResultsText.replace("{0}", '"' + G(e) + '"'), u.$menuInner[0].firstChild.appendChild(f))
} else u.$menuInner.scrollTop(0), u.createView(!1)
})
},
_searchStyle: function() {
return this.options.liveSearchStyle || "contains"
},
val: function(e) {
return void 0 !== e ? (this.$element.val(e).triggerNative("change"), this.$element) : this.$element.val()
},
changeAll: function(e) {
if (this.multiple) {
void 0 === e && (e = !0);
var t = this.$element.find("option"),
i = 0,
s = 0,
n = S(this.$element[0]);
this.$element.addClass("bs-select-hidden");
for (var o = 0; o < this.selectpicker.current.elements.length; o++) {
var l = this.selectpicker.current.data[o],
r = t[this.selectpicker.current.map.originalIndex[o]];
r && !r.disabled && "divider" !== l.type && (r.selected && i++, r.selected = e, r.selected && s++)
}
this.$element.removeClass("bs-select-hidden"), i !== s && (this.setOptionStatus(), this.togglePlaceholder(), y = [null, null, n], this.$element.triggerNative("change"))
}
},
selectAll: function() {
return this.changeAll(!0)
},
deselectAll: function() {
return this.changeAll(!1)
},
toggle: function(e) {
(e = e || window.event) && e.stopPropagation(), this.$button.trigger("click.bs.dropdown.data-api")
},
keydown: function(e) {
var t, i, s, n, o, l = F(this),
r = l.hasClass("dropdown-toggle"),
c = (r ? l.closest(".dropdown") : l.closest(N.MENU)).data("this"),
a = c.findLis(),
d = !1,
h = e.which === D && !r && !c.options.selectOnTab,
p = A.test(e.which) || h,
u = c.$menuInner[0].scrollTop,
f = c.isVirtual(),
m = !0 === f ? c.selectpicker.view.position0 : 0;
if (!(i = c.$newElement.hasClass(q.SHOW)) && (p || 48 <= e.which && e.which <= 57 || 96 <= e.which && e.which <= 105 || 65 <= e.which && e.which <= 90) && c.$button.trigger("click.bs.dropdown.data-api"), e.which === C && i && (e.preventDefault(), c.$button.trigger("click.bs.dropdown.data-api").focus()), p) {
if (!a.length) return;
void 0 === (t = !0 === f ? a.index(a.filter(".active")) : c.selectpicker.current.map.newIndex[c.activeIndex]) && (t = -1), -1 !== t && ((s = c.selectpicker.current.elements[t + m]).classList.remove("active"), s.firstChild && s.firstChild.classList.remove("active")), e.which === H ? (-1 !== t && t--, t + m < 0 && (t += a.length), c.selectpicker.view.canHighlight[t + m] || -1 === (t = c.selectpicker.view.canHighlight.slice(0, t + m).lastIndexOf(!0) - m) && (t = a.length - 1)) : (e.which === L || h) && (++t + m >= c.selectpicker.view.canHighlight.length && (t = 0), c.selectpicker.view.canHighlight[t + m] || (t = t + 1 + c.selectpicker.view.canHighlight.slice(t + m + 1).indexOf(!0))), e.preventDefault();
var v = m + t;
e.which === H ? 0 === m && t === a.length - 1 ? (c.$menuInner[0].scrollTop = c.$menuInner[0].scrollHeight, v = c.selectpicker.current.elements.length - 1) : d = (o = (n = c.selectpicker.current.data[v]).position - n.height) < u : (e.which === L || h) && (0 === t ? v = c.$menuInner[0].scrollTop = 0 : d = u < (o = (n = c.selectpicker.current.data[v]).position - c.sizeInfo.menuInnerHeight)), (s = c.selectpicker.current.elements[v]) && (s.classList.add("active"), s.firstChild && s.firstChild.classList.add("active")), c.activeIndex = c.selectpicker.current.map.originalIndex[v], c.selectpicker.view.currentActive = s, d && (c.$menuInner[0].scrollTop = o), c.options.liveSearch ? c.$searchbox.focus() : l.focus()
} else if (!l.is("input") && !P.test(e.which) || e.which === T && c.selectpicker.keydown.keyHistory) {
var g, b, w = [];
e.preventDefault(), c.selectpicker.keydown.keyHistory += E[e.which], c.selectpicker.keydown.resetKeyHistory.cancel && clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel), c.selectpicker.keydown.resetKeyHistory.cancel = c.selectpicker.keydown.resetKeyHistory.start(), b = c.selectpicker.keydown.keyHistory, /^(.)\1+$/.test(b) && (b = b.charAt(0));
for (var x = 0; x < c.selectpicker.current.data.length; x++) {
var I = c.selectpicker.current.data[x];
$(I, b, "startsWith", !0) && c.selectpicker.view.canHighlight[x] && (I.index = x, w.push(I.originalIndex))
}
if (w.length) {
var k = 0;
a.removeClass("active").find("a").removeClass("active"), 1 === b.length && (-1 === (k = w.indexOf(c.activeIndex)) || k === w.length - 1 ? k = 0 : k++), g = c.selectpicker.current.map.newIndex[w[k]], 0 < u - (n = c.selectpicker.current.data[g]).position ? (o = n.position - n.height, d = !0) : (o = n.position - c.sizeInfo.menuInnerHeight, d = n.position > u + c.sizeInfo.menuInnerHeight), (s = c.selectpicker.current.elements[g]).classList.add("active"), s.firstChild && s.firstChild.classList.add("active"), c.activeIndex = w[k], s.firstChild.focus(), d && (c.$menuInner[0].scrollTop = o), l.focus()
}
}
i && (e.which === T && !c.selectpicker.keydown.keyHistory || e.which === z || e.which === D && c.options.selectOnTab) && (e.which !== T && e.preventDefault(), c.options.liveSearch && e.which === T || (c.$menuInner.find(".active a").trigger("click", !0), l.focus(), c.options.liveSearch || (e.preventDefault(), F(document).data("spaceSelect", !0))))
},
mobile: function() {
this.$element.addClass("mobile-device")
},
refresh: function() {
var e = F.extend({}, this.options, this.$element.data());
this.options = e, this.selectpicker.main.map.newIndex = {}, this.selectpicker.main.map.originalIndex = {}, this.createLi(), this.checkDisabled(), this.render(), this.setStyle(), this.setWidth(), this.setSize(!0), this.$element.trigger("refreshed.bs.select")
},
hide: function() {
this.$newElement.hide()
},
show: function() {
this.$newElement.show()
},
remove: function() {
this.$newElement.remove(), this.$element.remove()
},
destroy: function() {
this.$newElement.before(this.$element).remove(), this.$bsContainer ? this.$bsContainer.remove() : this.$menu.remove(), this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")
}
};
var h = F.fn.selectpicker;
F.fn.selectpicker = r, F.fn.selectpicker.Constructor = c, F.fn.selectpicker.noConflict = function() {
return F.fn.selectpicker = h, this
}, F(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.select", '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input', c.prototype.keydown).on("focusin.modal", '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bs-searchbox input', function(e) {
e.stopPropagation()
}), F(window).on("load.bs.select.data-api", function() {
F(".selectpicker").each(function() {
var e = F(this);
r.call(e, e.data())
})
})
}(e)
});
$.fn.selectpicker.Constructor.BootstrapVersion = '4'
}(jQuery));
/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
! function(a) {
"function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : window.jQuery || window.Zepto)
}(function(a) {
var b, c, d, e, f, g, h = "Close",
i = "BeforeClose",
j = "AfterClose",
k = "BeforeAppend",
l = "MarkupParse",
m = "Open",
n = "Change",
o = "mfp",
p = "." + o,
q = "mfp-ready",
r = "mfp-removing",
s = "mfp-prevent-close",
t = function() {},
u = !!window.jQuery,
v = a(window),
w = function(a, c) {
b.ev.on(o + a + p, c)
},
x = function(b, c, d, e) {
var f = document.createElement("div");
return f.className = "mfp-" + b, d && (f.innerHTML = d), e ? c && c.appendChild(f) : (f = a(f), c && f.appendTo(c)), f
},
y = function(c, d) {
b.ev.triggerHandler(o + c, d), b.st.callbacks && (c = c.charAt(0).toLowerCase() + c.slice(1), b.st.callbacks[c] && b.st.callbacks[c].apply(b, a.isArray(d) ? d : [d]))
},
z = function(c) {
return c === g && b.currTemplate.closeBtn || (b.currTemplate.closeBtn = a(b.st.closeMarkup.replace("%title%", b.st.tClose)), g = c), b.currTemplate.closeBtn
},
A = function() {
a.magnificPopup.instance || (b = new t, b.init(), a.magnificPopup.instance = b)
},
B = function() {
var a = document.createElement("p").style,
b = ["ms", "O", "Moz", "Webkit"];
if (void 0 !== a.transition) return !0;
for (; b.length;)
if (b.pop() + "Transition" in a) return !0;
return !1
};
t.prototype = {
constructor: t,
init: function() {
var c = navigator.appVersion;
b.isLowIE = b.isIE8 = document.all && !document.addEventListener, b.isAndroid = /android/gi.test(c), b.isIOS = /iphone|ipad|ipod/gi.test(c), b.supportsTransition = B(), b.probablyMobile = b.isAndroid || b.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), d = a(document), b.popupsCache = {}
},
open: function(c) {
var e;
if (c.isObj === !1) {
b.items = c.items.toArray(), b.index = 0;
var g, h = c.items;
for (e = 0; e < h.length; e++)
if (g = h[e], g.parsed && (g = g.el[0]), g === c.el[0]) {
b.index = e;
break
}
} else b.items = a.isArray(c.items) ? c.items : [c.items], b.index = c.index || 0;
if (b.isOpen) return void b.updateItemHTML();
b.types = [], f = "", c.mainEl && c.mainEl.length ? b.ev = c.mainEl.eq(0) : b.ev = d, c.key ? (b.popupsCache[c.key] || (b.popupsCache[c.key] = {}), b.currTemplate = b.popupsCache[c.key]) : b.currTemplate = {}, b.st = a.extend(!0, {}, a.magnificPopup.defaults, c), b.fixedContentPos = "auto" === b.st.fixedContentPos ? !b.probablyMobile : b.st.fixedContentPos, b.st.modal && (b.st.closeOnContentClick = !1, b.st.closeOnBgClick = !1, b.st.showCloseBtn = !1, b.st.enableEscapeKey = !1), b.bgOverlay || (b.bgOverlay = x("bg").on("click" + p, function() {
b.close()
}), b.wrap = x("wrap").attr("tabindex", -1).on("click" + p, function(a) {
b._checkIfClose(a.target) && b.close()
}), b.container = x("container", b.wrap)), b.contentContainer = x("content"), b.st.preloader && (b.preloader = x("preloader", b.container, b.st.tLoading));
var i = a.magnificPopup.modules;
for (e = 0; e < i.length; e++) {
var j = i[e];
j = j.charAt(0).toUpperCase() + j.slice(1), b["init" + j].call(b)
}
y("BeforeOpen"), b.st.showCloseBtn && (b.st.closeBtnInside ? (w(l, function(a, b, c, d) {
c.close_replaceWith = z(d.type)
}), f += " mfp-close-btn-in") : b.wrap.append(z())), b.st.alignTop && (f += " mfp-align-top"), b.fixedContentPos ? b.wrap.css({
overflow: b.st.overflowY,
overflowX: "hidden",
overflowY: b.st.overflowY
}) : b.wrap.css({
top: v.scrollTop(),
position: "absolute"
}), (b.st.fixedBgPos === !1 || "auto" === b.st.fixedBgPos && !b.fixedContentPos) && b.bgOverlay.css({
height: d.height(),
position: "absolute"
}), b.st.enableEscapeKey && d.on("keyup" + p, function(a) {
27 === a.keyCode && b.close()
}), v.on("resize" + p, function() {
b.updateSize()
}), b.st.closeOnContentClick || (f += " mfp-auto-cursor"), f && b.wrap.addClass(f);
var k = b.wH = v.height(),
n = {};
if (b.fixedContentPos && b._hasScrollBar(k)) {
var o = b._getScrollbarSize();
o && (n.marginRight = o)
}
b.fixedContentPos && (b.isIE7 ? a("body, html").css("overflow", "hidden") : n.overflow = "hidden");
var r = b.st.mainClass;
return b.isIE7 && (r += " mfp-ie7"), r && b._addClassToMFP(r), b.updateItemHTML(), y("BuildControls"), a("html").css(n), b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo || a(document.body)), b._lastFocusedEl = document.activeElement, setTimeout(function() {
b.content ? (b._addClassToMFP(q), b._setFocus()) : b.bgOverlay.addClass(q), d.on("focusin" + p, b._onFocusIn)
}, 16), b.isOpen = !0, b.updateSize(k), y(m), c
},
close: function() {
b.isOpen && (y(i), b.isOpen = !1, b.st.removalDelay && !b.isLowIE && b.supportsTransition ? (b._addClassToMFP(r), setTimeout(function() {
b._close()
}, b.st.removalDelay)) : b._close())
},
_close: function() {
y(h);
var c = r + " " + q + " ";
if (b.bgOverlay.detach(), b.wrap.detach(), b.container.empty(), b.st.mainClass && (c += b.st.mainClass + " "), b._removeClassFromMFP(c), b.fixedContentPos) {
var e = {
marginRight: ""
};
b.isIE7 ? a("body, html").css("overflow", "") : e.overflow = "", a("html").css(e)
}
d.off("keyup" + p + " focusin" + p), b.ev.off(p), b.wrap.attr("class", "mfp-wrap").removeAttr("style"), b.bgOverlay.attr("class", "mfp-bg"), b.container.attr("class", "mfp-container"), !b.st.showCloseBtn || b.st.closeBtnInside && b.currTemplate[b.currItem.type] !== !0 || b.currTemplate.closeBtn && b.currTemplate.closeBtn.detach(), b.st.autoFocusLast && b._lastFocusedEl && a(b._lastFocusedEl).focus(), b.currItem = null, b.content = null, b.currTemplate = null, b.prevHeight = 0, y(j)
},
updateSize: function(a) {
if (b.isIOS) {
var c = document.documentElement.clientWidth / window.innerWidth,
d = window.innerHeight * c;
b.wrap.css("height", d), b.wH = d
} else b.wH = a || v.height();
b.fixedContentPos || b.wrap.css("height", b.wH), y("Resize")
},
updateItemHTML: function() {
var c = b.items[b.index];
b.contentContainer.detach(), b.content && b.content.detach(), c.parsed || (c = b.parseEl(b.index));
var d = c.type;
if (y("BeforeChange", [b.currItem ? b.currItem.type : "", d]), b.currItem = c, !b.currTemplate[d]) {
var f = b.st[d] ? b.st[d].markup : !1;
y("FirstMarkupParse", f), f ? b.currTemplate[d] = a(f) : b.currTemplate[d] = !0
}
e && e !== c.type && b.container.removeClass("mfp-" + e + "-holder");
var g = b["get" + d.charAt(0).toUpperCase() + d.slice(1)](c, b.currTemplate[d]);
b.appendContent(g, d), c.preloaded = !0, y(n, c), e = c.type, b.container.prepend(b.contentContainer), y("AfterChange")
},
appendContent: function(a, c) {
b.content = a, a ? b.st.showCloseBtn && b.st.closeBtnInside && b.currTemplate[c] === !0 ? b.content.find(".mfp-close").length || b.content.append(z()) : b.content = a : b.content = "", y(k), b.container.addClass("mfp-" + c + "-holder"), b.contentContainer.append(b.content)
},
parseEl: function(c) {
var d, e = b.items[c];
if (e.tagName ? e = {
el: a(e)
} : (d = e.type, e = {
data: e,
src: e.src
}), e.el) {
for (var f = b.types, g = 0; g < f.length; g++)
if (e.el.hasClass("mfp-" + f[g])) {
d = f[g];
break
}
e.src = e.el.attr("data-mfp-src"), e.src || (e.src = e.el.attr("href"))
}
return e.type = d || b.st.type || "inline", e.index = c, e.parsed = !0, b.items[c] = e, y("ElementParse", e), b.items[c]
},
addGroup: function(a, c) {
var d = function(d) {
d.mfpEl = this, b._openClick(d, a, c)
};
c || (c = {});
var e = "click.magnificPopup";
c.mainEl = a, c.items ? (c.isObj = !0, a.off(e).on(e, d)) : (c.isObj = !1, c.delegate ? a.off(e).on(e, c.delegate, d) : (c.items = a, a.off(e).on(e, d)))
},
_openClick: function(c, d, e) {
var f = void 0 !== e.midClick ? e.midClick : a.magnificPopup.defaults.midClick;
if (f || !(2 === c.which || c.ctrlKey || c.metaKey || c.altKey || c.shiftKey)) {
var g = void 0 !== e.disableOn ? e.disableOn : a.magnificPopup.defaults.disableOn;
if (g)
if (a.isFunction(g)) {
if (!g.call(b)) return !0
} else if (v.width() < g) return !0;
c.type && (c.preventDefault(), b.isOpen && c.stopPropagation()), e.el = a(c.mfpEl), e.delegate && (e.items = d.find(e.delegate)), b.open(e)
}
},
updateStatus: function(a, d) {
if (b.preloader) {
c !== a && b.container.removeClass("mfp-s-" + c), d || "loading" !== a || (d = b.st.tLoading);
var e = {
status: a,
text: d
};
y("UpdateStatus", e), a = e.status, d = e.text, b.preloader.html(d), b.preloader.find("a").on("click", function(a) {
a.stopImmediatePropagation()
}), b.container.addClass("mfp-s-" + a), c = a
}
},
_checkIfClose: function(c) {
if (!a(c).hasClass(s)) {
var d = b.st.closeOnContentClick,
e = b.st.closeOnBgClick;
if (d && e) return !0;
if (!b.content || a(c).hasClass("mfp-close") || b.preloader && c === b.preloader[0]) return !0;
if (c === b.content[0] || a.contains(b.content[0], c)) {
if (d) return !0
} else if (e && a.contains(document, c)) return !0;
return !1
}
},
_addClassToMFP: function(a) {
b.bgOverlay.addClass(a), b.wrap.addClass(a)
},
_removeClassFromMFP: function(a) {
this.bgOverlay.removeClass(a), b.wrap.removeClass(a)
},
_hasScrollBar: function(a) {
return (b.isIE7 ? d.height() : document.body.scrollHeight) > (a || v.height())
},
_setFocus: function() {
(b.st.focus ? b.content.find(b.st.focus).eq(0) : b.wrap).focus()
},
_onFocusIn: function(c) {
return c.target === b.wrap[0] || a.contains(b.wrap[0], c.target) ? void 0 : (b._setFocus(), !1)
},
_parseMarkup: function(b, c, d) {
var e;
d.data && (c = a.extend(d.data, c)), y(l, [b, c, d]), a.each(c, function(c, d) {
if (void 0 === d || d === !1) return !0;
if (e = c.split("_"), e.length > 1) {
var f = b.find(p + "-" + e[0]);
if (f.length > 0) {
var g = e[1];
"replaceWith" === g ? f[0] !== d[0] && f.replaceWith(d) : "img" === g ? f.is("img") ? f.attr("src", d) : f.replaceWith(a(" ").attr("src", d).attr("class", f.attr("class"))) : f.attr(e[1], d)
}
} else b.find(p + "-" + c).html(d)
})
},
_getScrollbarSize: function() {
if (void 0 === b.scrollbarSize) {
var a = document.createElement("div");
a.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(a), b.scrollbarSize = a.offsetWidth - a.clientWidth, document.body.removeChild(a)
}
return b.scrollbarSize
}
}, a.magnificPopup = {
instance: null,
proto: t.prototype,
modules: [],
open: function(b, c) {
return A(), b = b ? a.extend(!0, {}, b) : {}, b.isObj = !0, b.index = c || 0, this.instance.open(b)
},
close: function() {
return a.magnificPopup.instance && a.magnificPopup.instance.close()
},
registerModule: function(b, c) {
c.options && (a.magnificPopup.defaults[b] = c.options), a.extend(this.proto, c.proto), this.modules.push(b)
},
defaults: {
disableOn: 0,
key: null,
midClick: !1,
mainClass: "",
preloader: !0,
focus: "",
closeOnContentClick: !1,
closeOnBgClick: !0,
closeBtnInside: !0,
showCloseBtn: !0,
enableEscapeKey: !0,
modal: !1,
alignTop: !1,
removalDelay: 0,
prependTo: null,
fixedContentPos: "auto",
fixedBgPos: "auto",
overflowY: "auto",
closeMarkup: '× ',
tClose: "Close (Esc)",
tLoading: "Loading...",
autoFocusLast: !0
}
}, a.fn.magnificPopup = function(c) {
A();
var d = a(this);
if ("string" == typeof c)
if ("open" === c) {
var e, f = u ? d.data("magnificPopup") : d[0].magnificPopup,
g = parseInt(arguments[1], 10) || 0;
f.items ? e = f.items[g] : (e = d, f.delegate && (e = e.find(f.delegate)), e = e.eq(g)), b._openClick({
mfpEl: e
}, d, f)
} else b.isOpen && b[c].apply(b, Array.prototype.slice.call(arguments, 1));
else c = a.extend(!0, {}, c), u ? d.data("magnificPopup", c) : d[0].magnificPopup = c, b.addGroup(d, c);
return d
};
var C, D, E, F = "inline",
G = function() {
E && (D.after(E.addClass(C)).detach(), E = null)
};
a.magnificPopup.registerModule(F, {
options: {
hiddenClass: "hide",
markup: "",
tNotFound: "Content not found"
},
proto: {
initInline: function() {
b.types.push(F), w(h + "." + F, function() {
G()
})
},
getInline: function(c, d) {
if (G(), c.src) {
var e = b.st.inline,
f = a(c.src);
if (f.length) {
var g = f[0].parentNode;
g && g.tagName && (D || (C = e.hiddenClass, D = x(C), C = "mfp-" + C), E = f.after(D).detach().removeClass(C)), b.updateStatus("ready")
} else b.updateStatus("error", e.tNotFound), f = a("");
return c.inlineElement = f, f
}
return b.updateStatus("ready"), b._parseMarkup(d, {}, c), d
}
}
});
var H, I = "ajax",
J = function() {
H && a(document.body).removeClass(H)
},
K = function() {
J(), b.req && b.req.abort()
};
a.magnificPopup.registerModule(I, {
options: {
settings: null,
cursor: "mfp-ajax-cur",
tError: '
The content could not be loaded.'
},
proto: {
initAjax: function() {
b.types.push(I), H = b.st.ajax.cursor, w(h + "." + I, K), w("BeforeChange." + I, K)
},
getAjax: function(c) {
H && a(document.body).addClass(H), b.updateStatus("loading");
var d = a.extend({
url: c.src,
success: function(d, e, f) {
var g = {
data: d,
xhr: f
};
y("ParseAjax", g), b.appendContent(a(g.data), I), c.finished = !0, J(), b._setFocus(), setTimeout(function() {
b.wrap.addClass(q)
}, 16), b.updateStatus("ready"), y("AjaxContentAdded")
},
error: function() {
J(), c.finished = c.loadError = !0, b.updateStatus("error", b.st.ajax.tError.replace("%url%", c.src))
}
}, b.st.ajax.settings);
return b.req = a.ajax(d), ""
}
}
});
var L, M = function(c) {
if (c.data && void 0 !== c.data.title) return c.data.title;
var d = b.st.image.titleSrc;
if (d) {
if (a.isFunction(d)) return d.call(b, c);
if (c.el) return c.el.attr(d) || ""
}
return ""
};
a.magnificPopup.registerModule("image", {
options: {
markup: '
',
cursor: "mfp-zoom-out-cur",
titleSrc: "title",
verticalFit: !0,
tError: '
The image could not be loaded.'
},
proto: {
initImage: function() {
var c = b.st.image,
d = ".image";
b.types.push("image"), w(m + d, function() {
"image" === b.currItem.type && c.cursor && a(document.body).addClass(c.cursor)
}), w(h + d, function() {
c.cursor && a(document.body).removeClass(c.cursor), v.off("resize" + p)
}), w("Resize" + d, b.resizeImage), b.isLowIE && w("AfterChange", b.resizeImage)
},
resizeImage: function() {
var a = b.currItem;
if (a && a.img && b.st.image.verticalFit) {
var c = 0;
b.isLowIE && (c = parseInt(a.img.css("padding-top"), 10) + parseInt(a.img.css("padding-bottom"), 10)), a.img.css("max-height", b.wH - c)
}
},
_onImageHasSize: function(a) {
a.img && (a.hasSize = !0, L && clearInterval(L), a.isCheckingImgSize = !1, y("ImageHasSize", a), a.imgHidden && (b.content && b.content.removeClass("mfp-loading"), a.imgHidden = !1))
},
findImageSize: function(a) {
var c = 0,
d = a.img[0],
e = function(f) {
L && clearInterval(L), L = setInterval(function() {
return d.naturalWidth > 0 ? void b._onImageHasSize(a) : (c > 200 && clearInterval(L), c++, void(3 === c ? e(10) : 40 === c ? e(50) : 100 === c && e(500)))
}, f)
};
e(1)
},
getImage: function(c, d) {
var e = 0,
f = function() {
c && (c.img[0].complete ? (c.img.off(".mfploader"), c === b.currItem && (b._onImageHasSize(c), b.updateStatus("ready")), c.hasSize = !0, c.loaded = !0, y("ImageLoadComplete")) : (e++, 200 > e ? setTimeout(f, 100) : g()))
},
g = function() {
c && (c.img.off(".mfploader"), c === b.currItem && (b._onImageHasSize(c), b.updateStatus("error", h.tError.replace("%url%", c.src))), c.hasSize = !0, c.loaded = !0, c.loadError = !0)
},
h = b.st.image,
i = d.find(".mfp-img");
if (i.length) {
var j = document.createElement("img");
j.className = "mfp-img", c.el && c.el.find("img").length && (j.alt = c.el.find("img").attr("alt")), c.img = a(j).on("load.mfploader", f).on("error.mfploader", g), j.src = c.src, i.is("img") && (c.img = c.img.clone()), j = c.img[0], j.naturalWidth > 0 ? c.hasSize = !0 : j.width || (c.hasSize = !1)
}
return b._parseMarkup(d, {
title: M(c),
img_replaceWith: c.img
}, c), b.resizeImage(), c.hasSize ? (L && clearInterval(L), c.loadError ? (d.addClass("mfp-loading"), b.updateStatus("error", h.tError.replace("%url%", c.src))) : (d.removeClass("mfp-loading"), b.updateStatus("ready")), d) : (b.updateStatus("loading"), c.loading = !0, c.hasSize || (c.imgHidden = !0, d.addClass("mfp-loading"), b.findImageSize(c)), d)
}
}
});
var N, O = function() {
return void 0 === N && (N = void 0 !== document.createElement("p").style.MozTransform), N
};
a.magnificPopup.registerModule("zoom", {
options: {
enabled: !1,
easing: "ease-in-out",
duration: 300,
opener: function(a) {
return a.is("img") ? a : a.find("img")
}
},
proto: {
initZoom: function() {
var a, c = b.st.zoom,
d = ".zoom";
if (c.enabled && b.supportsTransition) {
var e, f, g = c.duration,
j = function(a) {
var b = a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
d = "all " + c.duration / 1e3 + "s " + c.easing,
e = {
position: "fixed",
zIndex: 9999,
left: 0,
top: 0,
"-webkit-backface-visibility": "hidden"
},
f = "transition";
return e["-webkit-" + f] = e["-moz-" + f] = e["-o-" + f] = e[f] = d, b.css(e), b
},
k = function() {
b.content.css("visibility", "visible")
};
w("BuildControls" + d, function() {
if (b._allowZoom()) {
if (clearTimeout(e), b.content.css("visibility", "hidden"), a = b._getItemToZoom(), !a) return void k();
f = j(a), f.css(b._getOffset()), b.wrap.append(f), e = setTimeout(function() {
f.css(b._getOffset(!0)), e = setTimeout(function() {
k(), setTimeout(function() {
f.remove(), a = f = null, y("ZoomAnimationEnded")
}, 16)
}, g)
}, 16)
}
}), w(i + d, function() {
if (b._allowZoom()) {
if (clearTimeout(e), b.st.removalDelay = g, !a) {
if (a = b._getItemToZoom(), !a) return;
f = j(a)
}
f.css(b._getOffset(!0)), b.wrap.append(f), b.content.css("visibility", "hidden"), setTimeout(function() {
f.css(b._getOffset())
}, 16)
}
}), w(h + d, function() {
b._allowZoom() && (k(), f && f.remove(), a = null)
})
}
},
_allowZoom: function() {
return "image" === b.currItem.type
},
_getItemToZoom: function() {
return b.currItem.hasSize ? b.currItem.img : !1
},
_getOffset: function(c) {
var d;
d = c ? b.currItem.img : b.st.zoom.opener(b.currItem.el || b.currItem);
var e = d.offset(),
f = parseInt(d.css("padding-top"), 10),
g = parseInt(d.css("padding-bottom"), 10);
e.top -= a(window).scrollTop() - f;
var h = {
width: d.width(),
height: (u ? d.innerHeight() : d[0].offsetHeight) - g - f
};
return O() ? h["-moz-transform"] = h.transform = "translate(" + e.left + "px," + e.top + "px)" : (h.left = e.left, h.top = e.top), h
}
}
});
var P = "iframe",
Q = "//about:blank",
R = function(a) {
if (b.currTemplate[P]) {
var c = b.currTemplate[P].find("iframe");
c.length && (a || (c[0].src = Q), b.isIE8 && c.css("display", a ? "block" : "none"))
}
};
a.magnificPopup.registerModule(P, {
options: {
markup: '
',
srcAction: "iframe_src",
patterns: {
youtube: {
index: "youtube.com",
id: "v=",
src: "//www.youtube.com/embed/%id%?autoplay=1"
},
vimeo: {
index: "vimeo.com/",
id: "/",
src: "//player.vimeo.com/video/%id%?autoplay=1"
},
gmaps: {
index: "//maps.google.",
src: "%id%&output=embed"
}
}
},
proto: {
initIframe: function() {
b.types.push(P), w("BeforeChange", function(a, b, c) {
b !== c && (b === P ? R() : c === P && R(!0))
}), w(h + "." + P, function() {
R()
})
},
getIframe: function(c, d) {
var e = c.src,
f = b.st.iframe;
a.each(f.patterns, function() {
return e.indexOf(this.index) > -1 ? (this.id && (e = "string" == typeof this.id ? e.substr(e.lastIndexOf(this.id) + this.id.length, e.length) : this.id.call(this, e)), e = this.src.replace("%id%", e), !1) : void 0
});
var g = {};
return f.srcAction && (g[f.srcAction] = e), b._parseMarkup(d, g, c), b.updateStatus("ready"), d
}
}
});
var S = function(a) {
var c = b.items.length;
return a > c - 1 ? a - c : 0 > a ? c + a : a
},
T = function(a, b, c) {
return a.replace(/%curr%/gi, b + 1).replace(/%total%/gi, c)
};
a.magnificPopup.registerModule("gallery", {
options: {
enabled: !1,
arrowMarkup: '
',
preload: [0, 2],
navigateByImgClick: !0,
arrows: !0,
tPrev: "Previous (Left arrow key)",
tNext: "Next (Right arrow key)",
tCounter: "%curr% of %total%"
},
proto: {
initGallery: function() {
var c = b.st.gallery,
e = ".mfp-gallery";
return b.direction = !0, c && c.enabled ? (f += " mfp-gallery", w(m + e, function() {
c.navigateByImgClick && b.wrap.on("click" + e, ".mfp-img", function() {
return b.items.length > 1 ? (b.next(), !1) : void 0
}), d.on("keydown" + e, function(a) {
37 === a.keyCode ? b.prev() : 39 === a.keyCode && b.next()
})
}), w("UpdateStatus" + e, function(a, c) {
c.text && (c.text = T(c.text, b.currItem.index, b.items.length))
}), w(l + e, function(a, d, e, f) {
var g = b.items.length;
e.counter = g > 1 ? T(c.tCounter, f.index, g) : ""
}), w("BuildControls" + e, function() {
if (b.items.length > 1 && c.arrows && !b.arrowLeft) {
var d = c.arrowMarkup,
e = b.arrowLeft = a(d.replace(/%title%/gi, c.tPrev).replace(/%dir%/gi, "left")).addClass(s),
f = b.arrowRight = a(d.replace(/%title%/gi, c.tNext).replace(/%dir%/gi, "right")).addClass(s);
e.click(function() {
b.prev()
}), f.click(function() {
b.next()
}), b.container.append(e.add(f))
}
}), w(n + e, function() {
b._preloadTimeout && clearTimeout(b._preloadTimeout), b._preloadTimeout = setTimeout(function() {
b.preloadNearbyImages(), b._preloadTimeout = null
}, 16)
}), void w(h + e, function() {
d.off(e), b.wrap.off("click" + e), b.arrowRight = b.arrowLeft = null
})) : !1
},
next: function() {
b.direction = !0, b.index = S(b.index + 1), b.updateItemHTML()
},
prev: function() {
b.direction = !1, b.index = S(b.index - 1), b.updateItemHTML()
},
goTo: function(a) {
b.direction = a >= b.index, b.index = a, b.updateItemHTML()
},
preloadNearbyImages: function() {
var a, c = b.st.gallery.preload,
d = Math.min(c[0], b.items.length),
e = Math.min(c[1], b.items.length);
for (a = 1; a <= (b.direction ? e : d); a++) b._preloadItem(b.index + a);
for (a = 1; a <= (b.direction ? d : e); a++) b._preloadItem(b.index - a)
},
_preloadItem: function(c) {
if (c = S(c), !b.items[c].preloaded) {
var d = b.items[c];
d.parsed || (d = b.parseEl(c)), y("LazyLoad", d), "image" === d.type && (d.img = a('
').on("load.mfploader", function() {
d.hasSize = !0
}).on("error.mfploader", function() {
d.hasSize = !0, d.loadError = !0, y("LazyLoadError", d)
}).attr("src", d.src)), d.preloaded = !0
}
}
}
});
var U = "retina";
a.magnificPopup.registerModule(U, {
options: {
replaceSrc: function(a) {
return a.src.replace(/\.\w+$/, function(a) {
return "@2x" + a
})
},
ratio: 1
},
proto: {
initRetina: function() {
if (window.devicePixelRatio > 1) {
var a = b.st.retina,
c = a.ratio;
c = isNaN(c) ? c() : c, c > 1 && (w("ImageHasSize." + U, function(a, b) {
b.img.css({
"max-width": b.img[0].naturalWidth / c,
width: "100%"
})
}), w("ElementParse." + U, function(b, d) {
d.src = a.replaceSrc(d, c)
}))
}
}
}
}), A()
});
(function($) {
$(document).ready(function() {
$("div[id$='edash_icon_class'], div[id^='edash_icon_class'], .edash_icon_class").each(function() {
$(this).find(".custom-select").each(function() {
$(this).wrap("
");
$(this).find("option").each(function() {
var $edashIcon = $(this).attr("value");
$(this).attr("data-tokens", $edashIcon).attr("data-icon", $edashIcon).attr("data-subtext", $edashIcon)
});
$(this).addClass("selectpicker").attr("data-live-search", "true").attr("data-width", "100%").removeClass("custom-select")
})
})
})
}(jQuery));
! function($) {
"use strict";
$.fn.meanmenu = function(e) {
var n = {
meanMenuTarget: jQuery(this),
meanMenuContainer: ".edash-responsive-menu",
meanMenuClose: "X",
meanMenuCloseSize: "18px",
meanMenuOpen: "
",
meanRevealPosition: "right",
meanRevealPositionDistance: "0",
meanRevealColour: "",
meanScreenWidth: "480",
meanNavPush: "",
meanShowChildren: !0,
meanExpandableChildren: !0,
meanExpand: "+",
meanContract: "-",
meanRemoveAttrs: !1,
onePage: !1,
meanDisplay: "block",
removeElements: ""
};
e = $.extend(n, e);
var a = window.innerWidth || document.documentElement.clientWidth;
return this.each(function() {
var n = e.meanMenuTarget,
t = e.meanMenuContainer,
r = e.meanMenuClose,
i = e.meanMenuCloseSize,
s = e.meanMenuOpen,
u = e.meanRevealPosition,
m = e.meanRevealPositionDistance,
l = e.meanRevealColour,
o = e.meanScreenWidth,
c = e.meanNavPush,
v = ".meanmenu-reveal",
h = e.meanShowChildren,
d = e.meanExpandableChildren,
y = e.meanExpand,
j = e.meanContract,
Q = e.meanRemoveAttrs,
f = e.onePage,
g = e.meanDisplay,
p = e.removeElements,
C = !1;
(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Blackberry/i) || navigator.userAgent.match(/Windows Phone/i)) && (C = !0), (navigator.userAgent.match(/MSIE 8/i) || navigator.userAgent.match(/MSIE 7/i)) && jQuery("html").css("overflow-y", "scroll");
var w = "",
x = function() {
if ("center" === u) {
var e = window.innerWidth || document.documentElement.clientWidth,
n = e / 2 - 22 + "px";
w = "left:" + n + ";right:auto;", C ? jQuery(".meanmenu-reveal").animate({
left: n
}) : jQuery(".meanmenu-reveal").css("left", n)
}
},
A = !1,
E = !1;
"right" === u && (w = "right:" + m + ";left:auto;"), "left" === u && (w = "left:" + m + ";right:auto;"), x();
var M = "",
P = function() {
M.html(jQuery(M).is(".meanmenu-reveal.meanclose") ? r : s)
},
W = function() {
jQuery(".mean-bar,.mean-push").remove(), jQuery(t).removeClass("mean-container"), jQuery(n).css("display", g), A = !1, E = !1, jQuery(p).removeClass("mean-remove")
},
b = function() {
var e = "background:" + l + ";color:" + l + ";" + w;
if (o >= a) {
jQuery(p).addClass("mean-remove"), E = !0, jQuery(t).addClass("mean-container"), jQuery(".mean-container").prepend('
');
var r = jQuery(n).html();
jQuery(".mean-nav").html(r), Q && jQuery("nav.mean-nav ul, nav.mean-nav ul *").each(function() {
jQuery(this).is(".mean-remove") ? jQuery(this).attr("class", "mean-remove") : jQuery(this).removeAttr("class"), jQuery(this).removeAttr("id")
}), jQuery(n).before('
'), jQuery(".mean-push").css("margin-top", c), jQuery(n).hide(), jQuery(".meanmenu-reveal").show(), jQuery(v).html(s), M = jQuery(v), jQuery(".mean-nav ul").hide(), h ? d ? (jQuery(".mean-nav ul ul").each(function() {
jQuery(this).children().length && jQuery(this, "li:first").parent().append('
' + y + " ")
}), jQuery(".mean-expand").on("click", function(e) {
e.preventDefault(), jQuery(this).hasClass("mean-clicked") ? (jQuery(this).text(y), jQuery(this).prev("ul").slideUp(300, function() {})) : (jQuery(this).text(j), jQuery(this).prev("ul").slideDown(300, function() {})), jQuery(this).toggleClass("mean-clicked")
})) : jQuery(".mean-nav ul ul").show() : jQuery(".mean-nav ul ul").hide(), jQuery(".mean-nav ul li").last().addClass("mean-last"), M.removeClass("meanclose"), jQuery(M).click(function(e) {
e.preventDefault(), A === !1 ? (M.css("text-align", "center"), M.css("text-indent", "0"), M.css("font-size", i), jQuery(".mean-nav ul:first").slideDown(), A = !0) : (jQuery(".mean-nav ul:first").slideUp(), A = !1), M.toggleClass("meanclose"), P(), jQuery(p).addClass("mean-remove")
}), f && jQuery(".mean-nav ul > li > a:first-child").on("click", function() {
jQuery(".mean-nav ul:first").slideUp(), A = !1, jQuery(M).toggleClass("meanclose").html(s)
})
} else W()
};
C || jQuery(window).resize(function() {
a = window.innerWidth || document.documentElement.clientWidth, a > o, W(), o >= a ? (b(), x()) : W()
}), jQuery(window).resize(function() {
a = window.innerWidth || document.documentElement.clientWidth, C ? (x(), o >= a ? E === !1 && b() : W()) : (W(), o >= a && (b(), x()))
}), b()
})
}
}(jQuery);
(function($) {
$.fn.appear = function(fn, options) {
var settings = $.extend({
data: undefined,
one: !0,
accX: 0,
accY: 0
}, options);
return this.each(function() {
var t = $(this);
t.appeared = !1;
if (!fn) {
t.trigger('appear', settings.data);
return
}
var w = $(window);
var check = function() {
if (!t.is(':visible')) {
t.appeared = !1;
return
}
var a = w.scrollLeft();
var b = w.scrollTop();
var o = t.offset();
var x = o.left;
var y = o.top;
var ax = settings.accX;
var ay = settings.accY;
var th = t.height();
var wh = w.height();
var tw = t.width();
var ww = w.width();
if (y + th + ay >= b && y <= b + wh + ay && x + tw + ax >= a && x <= a + ww + ax) {
if (!t.appeared) t.trigger('appear', settings.data)
} else {
t.appeared = !1
}
};
var modifiedFn = function() {
t.appeared = !0;
if (settings.one) {
w.unbind('scroll', check);
var i = $.inArray(check, $.fn.appear.checks);
if (i >= 0) $.fn.appear.checks.splice(i, 1)
}
fn.apply(this, arguments)
};
if (settings.one) t.one('appear', settings.data, modifiedFn);
else t.bind('appear', settings.data, modifiedFn);
w.scroll(check);
$.fn.appear.checks.push(check);
(check)()
})
};
$.extend($.fn.appear, {
checks: [],
timeout: null,
checkAll: function() {
var length = $.fn.appear.checks.length;
if (length > 0)
while (length--)($.fn.appear.checks[length])();
},
run: function() {
if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
$.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20)
}
});
$.each(['append', 'prepend', 'after', 'before', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'remove', 'css', 'show', 'hide'], function(i, n) {
var old = $.fn[n];
if (old) {
$.fn[n] = function() {
var r = old.apply(this, arguments);
$.fn.appear.run();
return r
}
}
})
})(jQuery);
/*! odometer 0.4.8 */
(function() {
var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G = [].slice;
q = '
', n = '
' + q + " ", d = '
8 ' + n + " ", g = '
', c = "(,ddd).dd", h = /^\(?([^)]*)\)?(?:(.)(d+))?$/, i = 30, f = 2e3, a = 20, j = 2, e = .5, k = 1e3 / i, b = 1e3 / a, o = "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", y = document.createElement("div").style, p = null != y.transition || null != y.webkitTransition || null != y.mozTransition || null != y.oTransition, w = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, l = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, s = function(a) {
var b;
return b = document.createElement("div"), b.innerHTML = a, b.children[0]
}, v = function(a, b) {
return a.className = a.className.replace(new RegExp("(^| )" + b.split(" ").join("|") + "( |$)", "gi"), " ")
}, r = function(a, b) {
return v(a, b), a.className += " " + b
}, z = function(a, b) {
var c;
return null != document.createEvent ? (c = document.createEvent("HTMLEvents"), c.initEvent(b, !0, !0), a.dispatchEvent(c)) : void 0
}, u = function() {
var a, b;
return null != (a = null != (b = window.performance) && "function" == typeof b.now ? b.now() : void 0) ? a : +new Date
}, x = function(a, b) {
return null == b && (b = 0), b ? (a *= Math.pow(10, b), a += .5, a = Math.floor(a), a /= Math.pow(10, b)) : Math.round(a)
}, A = function(a) {
return 0 > a ? Math.ceil(a) : Math.floor(a)
}, t = function(a) {
return a - x(a)
}, C = !1, (B = function() {
var a, b, c, d, e;
if (!C && null != window.jQuery) {
for (C = !0, d = ["html", "text"], e = [], b = 0, c = d.length; c > b; b++) a = d[b], e.push(function(a) {
var b;
return b = window.jQuery.fn[a], window.jQuery.fn[a] = function(a) {
var c;
return null == a || null == (null != (c = this[0]) ? c.odometer : void 0) ? b.apply(this, arguments) : this[0].odometer.update(a)
}
}(a));
return e
}
})(), setTimeout(B, 0), m = function() {
function a(b) {
var c, d, e, g, h, i, l, m, n, o, p = this;
if (this.options = b, this.el = this.options.el, null != this.el.odometer) return this.el.odometer;
this.el.odometer = this, m = a.options;
for (d in m) g = m[d], null == this.options[d] && (this.options[d] = g);
null == (h = this.options).duration && (h.duration = f), this.MAX_VALUES = this.options.duration / k / j | 0, this.resetFormat(), this.value = this.cleanValue(null != (n = this.options.value) ? n : ""), this.renderInside(), this.render();
try {
for (o = ["innerHTML", "innerText", "textContent"], i = 0, l = o.length; l > i; i++) e = o[i], null != this.el[e] && ! function(a) {
return Object.defineProperty(p.el, a, {
get: function() {
var b;
return "innerHTML" === a ? p.inside.outerHTML : null != (b = p.inside.innerText) ? b : p.inside.textContent
},
set: function(a) {
return p.update(a)
}
})
}(e)
} catch (q) {
c = q, this.watchForMutations()
}
}
return a.prototype.renderInside = function() {
return this.inside = document.createElement("div"), this.inside.className = "odometer-inside", this.el.innerHTML = "", this.el.appendChild(this.inside)
}, a.prototype.watchForMutations = function() {
var a, b = this;
if (null != l) try {
return null == this.observer && (this.observer = new l(function(a) {
var c;
return c = b.el.innerText, b.renderInside(), b.render(b.value), b.update(c)
})), this.watchMutations = !0, this.startWatchingMutations()
} catch (c) {
a = c
}
}, a.prototype.startWatchingMutations = function() {
return this.watchMutations ? this.observer.observe(this.el, {
childList: !0
}) : void 0
}, a.prototype.stopWatchingMutations = function() {
var a;
return null != (a = this.observer) ? a.disconnect() : void 0
}, a.prototype.cleanValue = function(a) {
var b;
return "string" == typeof a && (a = a.replace(null != (b = this.format.radix) ? b : ".", "
"), a = a.replace(/[.,]/g, ""), a = a.replace("", "."), a = parseFloat(a, 10) || 0), x(a, this.format.precision)
}, a.prototype.bindTransitionEnd = function() {
var a, b, c, d, e, f, g = this;
if (!this.transitionEndBound) {
for (this.transitionEndBound = !0, b = !1, e = o.split(" "), f = [], c = 0, d = e.length; d > c; c++) a = e[c], f.push(this.el.addEventListener(a, function() {
return b ? !0 : (b = !0, setTimeout(function() {
return g.render(), b = !1, z(g.el, "odometerdone")
}, 0), !0)
}, !1));
return f
}
}, a.prototype.resetFormat = function() {
var a, b, d, e, f, g, i, j;
if (a = null != (i = this.options.format) ? i : c, a || (a = "d"), d = h.exec(a), !d) throw new Error("Odometer: Unparsable digit format");
return j = d.slice(1, 4), g = j[0], f = j[1], b = j[2], e = (null != b ? b.length : void 0) || 0, this.format = {
repeating: g,
radix: f,
precision: e
}
}, a.prototype.render = function(a) {
var b, c, d, e, f, g, h;
for (null == a && (a = this.value), this.stopWatchingMutations(), this.resetFormat(), this.inside.innerHTML = "", f = this.options.theme, b = this.el.className.split(" "), e = [], g = 0, h = b.length; h > g; g++) c = b[g], c.length && ((d = /^odometer-theme-(.+)$/.exec(c)) ? f = d[1] : /^odometer(-|$)/.test(c) || e.push(c));
return e.push("odometer"), p || e.push("odometer-no-transitions"), f ? e.push("odometer-theme-" + f) : e.push("odometer-auto-theme"), this.el.className = e.join(" "), this.ribbons = {}, this.formatDigits(a), this.startWatchingMutations()
}, a.prototype.formatDigits = function(a) {
var b, c, d, e, f, g, h, i, j, k;
if (this.digits = [], this.options.formatFunction)
for (d = this.options.formatFunction(a), j = d.split("").reverse(), f = 0, h = j.length; h > f; f++) c = j[f], c.match(/0-9/) ? (b = this.renderDigit(), b.querySelector(".odometer-value").innerHTML = c, this.digits.push(b), this.insertDigit(b)) : this.addSpacer(c);
else
for (e = !this.format.precision || !t(a) || !1, k = a.toString().split("").reverse(), g = 0, i = k.length; i > g; g++) b = k[g], "." === b && (e = !0), this.addDigit(b, e)
}, a.prototype.update = function(a) {
var b, c = this;
return a = this.cleanValue(a), (b = a - this.value) ? (v(this.el, "odometer-animating-up odometer-animating-down odometer-animating"), b > 0 ? r(this.el, "odometer-animating-up") : r(this.el, "odometer-animating-down"), this.stopWatchingMutations(), this.animate(a), this.startWatchingMutations(), setTimeout(function() {
return c.el.offsetHeight, r(c.el, "odometer-animating")
}, 0), this.value = a) : void 0
}, a.prototype.renderDigit = function() {
return s(d)
}, a.prototype.insertDigit = function(a, b) {
return null != b ? this.inside.insertBefore(a, b) : this.inside.children.length ? this.inside.insertBefore(a, this.inside.children[0]) : this.inside.appendChild(a)
}, a.prototype.addSpacer = function(a, b, c) {
var d;
return d = s(g), d.innerHTML = a, c && r(d, c), this.insertDigit(d, b)
}, a.prototype.addDigit = function(a, b) {
var c, d, e, f;
if (null == b && (b = !0), "-" === a) return this.addSpacer(a, null, "odometer-negation-mark");
if ("." === a) return this.addSpacer(null != (f = this.format.radix) ? f : ".", null, "odometer-radix-mark");
if (b)
for (e = !1;;) {
if (!this.format.repeating.length) {
if (e) throw new Error("Bad odometer format without digits");
this.resetFormat(), e = !0
}
if (c = this.format.repeating[this.format.repeating.length - 1], this.format.repeating = this.format.repeating.substring(0, this.format.repeating.length - 1), "d" === c) break;
this.addSpacer(c)
}
return d = this.renderDigit(), d.querySelector(".odometer-value").innerHTML = a, this.digits.push(d), this.insertDigit(d)
}, a.prototype.animate = function(a) {
return p && "count" !== this.options.animation ? this.animateSlide(a) : this.animateCount(a)
}, a.prototype.animateCount = function(a) {
var c, d, e, f, g, h = this;
if (d = +a - this.value) return f = e = u(), c = this.value, (g = function() {
var i, j, k;
return u() - f > h.options.duration ? (h.value = a, h.render(), void z(h.el, "odometerdone")) : (i = u() - e, i > b && (e = u(), k = i / h.options.duration, j = d * k, c += j, h.render(Math.round(c))), null != w ? w(g) : setTimeout(g, b))
})()
}, a.prototype.getDigitCount = function() {
var a, b, c, d, e, f;
for (d = 1 <= arguments.length ? G.call(arguments, 0) : [], a = e = 0, f = d.length; f > e; a = ++e) c = d[a], d[a] = Math.abs(c);
return b = Math.max.apply(Math, d), Math.ceil(Math.log(b + 1) / Math.log(10))
}, a.prototype.getFractionalDigitCount = function() {
var a, b, c, d, e, f, g;
for (e = 1 <= arguments.length ? G.call(arguments, 0) : [], b = /^\-?\d*\.(\d*?)0*$/, a = f = 0, g = e.length; g > f; a = ++f) d = e[a], e[a] = d.toString(), c = b.exec(e[a]), null == c ? e[a] = 0 : e[a] = c[1].length;
return Math.max.apply(Math, e)
}, a.prototype.resetDigits = function() {
return this.digits = [], this.ribbons = [], this.inside.innerHTML = "", this.resetFormat()
}, a.prototype.animateSlide = function(a) {
var b, c, d, f, g, h, i, j, k, l, m, n, o, p, q, s, t, u, v, w, x, y, z, B, C, D, E;
if (s = this.value, j = this.getFractionalDigitCount(s, a), j && (a *= Math.pow(10, j), s *= Math.pow(10, j)), d = a - s) {
for (this.bindTransitionEnd(), f = this.getDigitCount(s, a), g = [], b = 0, m = v = 0; f >= 0 ? f > v : v > f; m = f >= 0 ? ++v : --v) {
if (t = A(s / Math.pow(10, f - m - 1)), i = A(a / Math.pow(10, f - m - 1)), h = i - t, Math.abs(h) > this.MAX_VALUES) {
for (l = [], n = h / (this.MAX_VALUES + this.MAX_VALUES * b * e), c = t; h > 0 && i > c || 0 > h && c > i;) l.push(Math.round(c)), c += n;
l[l.length - 1] !== i && l.push(i), b++
} else l = function() {
E = [];
for (var a = t; i >= t ? i >= a : a >= i; i >= t ? a++ : a--) E.push(a);
return E
}.apply(this);
for (m = w = 0, y = l.length; y > w; m = ++w) k = l[m], l[m] = Math.abs(k % 10);
g.push(l)
}
for (this.resetDigits(), D = g.reverse(), m = x = 0, z = D.length; z > x; m = ++x)
for (l = D[m], this.digits[m] || this.addDigit(" ", m >= j), null == (u = this.ribbons)[m] && (u[m] = this.digits[m].querySelector(".odometer-ribbon-inner")), this.ribbons[m].innerHTML = "", 0 > d && (l = l.reverse()), o = C = 0, B = l.length; B > C; o = ++C) k = l[o], q = document.createElement("div"), q.className = "odometer-value", q.innerHTML = k, this.ribbons[m].appendChild(q), o === l.length - 1 && r(q, "odometer-last-value"), 0 === o && r(q, "odometer-first-value");
return 0 > t && this.addDigit("-"), p = this.inside.querySelector(".odometer-radix-mark"), null != p && p.parent.removeChild(p), j ? this.addSpacer(this.format.radix, this.digits[j - 1], "odometer-radix-mark") : void 0
}
}, a
}(), m.options = null != (E = window.odometerOptions) ? E : {}, setTimeout(function() {
var a, b, c, d, e;
if (window.odometerOptions) {
d = window.odometerOptions, e = [];
for (a in d) b = d[a], e.push(null != (c = m.options)[a] ? (c = m.options)[a] : c[a] = b);
return e
}
}, 0), m.init = function() {
var a, b, c, d, e, f;
if (null != document.querySelectorAll) {
for (b = document.querySelectorAll(m.options.selector || ".odometer"), f = [], c = 0, d = b.length; d > c; c++) a = b[c], f.push(a.odometer = new m({
el: a,
value: null != (e = a.innerText) ? e : a.textContent
}));
return f
}
}, null != (null != (F = document.documentElement) ? F.doScroll : void 0) && null != document.createEventObject ? (D = document.onreadystatechange, document.onreadystatechange = function() {
return "complete" === document.readyState && m.options.auto !== !1 && m.init(), null != D ? D.apply(this, arguments) : void 0
}) : document.addEventListener("DOMContentLoaded", function() {
return m.options.auto !== !1 ? m.init() : void 0
}, !1), "function" == typeof define && define.amd ? define([], function() {
return m
}) : "undefined" != typeof exports && null !== exports ? module.exports = m : window.Odometer = m
}).call(this);
/*!
* Tipped - A Complete Javascript Tooltip Solution - v4.7.0
* (c) 2012-2019 Nick Stakenburg
*
* http://www.tippedjs.com
*
* @license: https://creativecommons.org/licenses/by/4.0
*/
! function(t, i) {
"function" == typeof define && define.amd ? define(["jquery"], i) : "object" == typeof module && module.exports ? module.exports = i(require("jquery")) : t.Tipped = i(jQuery)
}(this, function($) {
var Tipped = {};
$.extend(Tipped, {
version: "4.7.0"
}), Tipped.Skins = {
base: {
afterUpdate: !1,
ajax: {},
cache: !0,
container: !1,
containment: {
selector: "viewport",
padding: 5
},
close: !1,
detach: !0,
fadeIn: 200,
fadeOut: 200,
showDelay: 75,
hideDelay: 25,
hideAfter: !1,
hideOn: {
element: "mouseleave"
},
hideOthers: !1,
position: "top",
inline: !1,
offset: {
x: 0,
y: 0
},
onHide: !1,
onShow: !1,
padding: !0,
radius: !0,
shadow: !0,
showOn: {
element: "mousemove"
},
size: "medium",
spinner: !0,
stem: !0,
target: "element",
voila: !0
},
reset: {
ajax: !1,
hideOn: {
element: "mouseleave",
tooltip: "mouseleave"
},
showOn: {
element: "mouseenter",
tooltip: "mouseenter"
}
}
}, $.each("dark light gray red green blue lightyellow lightblue lightpink".split(" "), function(t, i) {
Tipped.Skins[i] = {}
});
var Browser = (e = navigator.userAgent, {
IE: !(!window.attachEvent || -1 !== e.indexOf("Opera")) && f("MSIE "),
Opera: -1 < e.indexOf("Opera") && (!!window.opera && opera.version && parseFloat(opera.version()) || 7.55),
WebKit: -1 < e.indexOf("AppleWebKit/") && f("AppleWebKit/"),
Gecko: -1 < e.indexOf("Gecko") && -1 === e.indexOf("KHTML") && f("rv:"),
MobileSafari: !!e.match(/Apple.*Mobile.*Safari/),
Chrome: -1 < e.indexOf("Chrome") && f("Chrome/"),
ChromeMobile: -1 < e.indexOf("CrMo") && f("CrMo/"),
Android: -1 < e.indexOf("Android") && f("Android "),
IEMobile: -1 < e.indexOf("IEMobile") && f("IEMobile/")
}),
e;
function f(t) {
var i = new RegExp(t + "([\\d.]+)").exec(e);
return !i || parseFloat(i[1])
}
var Support = (i = document.createElement("div"), j = "Webkit Moz O ms Khtml".split(" "), {
css: {
animation: m("animation"),
transform: m("transform"),
prefixed: function(t) {
return m(t, "prefix")
}
},
shadow: m("boxShadow") && m("pointerEvents"),
touch: function() {
try {
return !!("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch)
} catch (t) {
return !1
}
}()
}),
i, j;
function m(t, e) {
var s = t.charAt(0).toUpperCase() + t.substr(1);
return function(t, e) {
for (var s in t)
if (void 0 !== i.style[t[s]]) return "prefix" !== e || t[s];
return !1
}((t + " " + j.join(s + " ") + s).split(" "), e)
}
var _slice = Array.prototype.slice,
_ = {
wrap: function(t, i) {
var e = t;
return function() {
var t = [$.proxy(e, this)].concat(_slice.call(arguments));
return i.apply(this, t)
}
},
isElement: function(t) {
return t && 1 === t.nodeType
},
isText: function(t) {
return t && 3 === t.nodeType
},
isDocumentFragment: function(t) {
return t && 11 === t.nodeType
},
delay: function(t, i) {
var e = _slice.call(arguments, 2);
return setTimeout(function() {
return t.apply(t, e)
}, i)
},
defer: function(t) {
return _.delay.apply(this, [t, 1].concat(_slice.call(arguments, 1)))
},
pointer: function(t) {
return {
x: t.pageX,
y: t.pageY
}
},
element: {
isAttached: function(t) {
var i = function(t) {
for (var i = t; i && i.parentNode;) i = i.parentNode;
return i
}(t);
return !(!i || !i.body)
}
}
};
function degrees(t) {
return 180 * t / Math.PI
}
function radian(t) {
return t * Math.PI / 180
}
function sec(t) {
return 1 / Math.cos(t)
}
function sfcc(t) {
return String.fromCharCode.apply(String, t.replace(" ", "").split(","))
}
function deepExtend(t, i) {
for (var e in i) i[e] && i[e].constructor && i[e].constructor === Object ? (t[e] = $.extend({}, t[e]) || {}, deepExtend(t[e], i[e])) : t[e] = i[e];
return t
}
var getUID = (U = 0, function(t) {
for (t = t || "_tipped-uid-", U++; document.getElementById(t + U);) U++;
return t + U
}),
U, Position = {
positions: ["topleft", "topmiddle", "topright", "righttop", "rightmiddle", "rightbottom", "bottomright", "bottommiddle", "bottomleft", "leftbottom", "leftmiddle", "lefttop"],
regex: {
toOrientation: /^(top|left|bottom|right)(top|left|bottom|right|middle|center)$/,
horizontal: /^(top|bottom)/,
isCenter: /(middle|center)/,
side: /^(top|bottom|left|right)/
},
toDimension: (X = {
top: "height",
left: "width",
bottom: "height",
right: "width"
}, function(t) {
return X[t]
}),
isCenter: function(t) {
return !!t.toLowerCase().match(this.regex.isCenter)
},
isCorner: function(t) {
return !this.isCenter(t)
},
getOrientation: function(t) {
return t.toLowerCase().match(this.regex.horizontal) ? "horizontal" : "vertical"
},
getSide: function(t) {
var i = null,
e = t.toLowerCase().match(this.regex.side);
return e && e[1] && (i = e[1]), i
},
split: function(t) {
return t.toLowerCase().match(this.regex.toOrientation)
},
_flip: {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
},
flip: function(t, i) {
var e = this.split(t);
return i ? this.inverseCornerPlane(this.flip(this.inverseCornerPlane(t))) : this._flip[e[1]] + e[2]
},
inverseCornerPlane: function(t) {
if (Position.isCorner(t)) {
var i = this.split(t);
return i[2] + i[1]
}
return t
},
adjustOffsetBasedOnPosition: function(t, i, e) {
var s = $.extend({}, t),
o = {
horizontal: "x",
vertical: "y"
},
n = Position.getOrientation(i);
if (n === Position.getOrientation(e)) {
if (Position.getSide(i) !== Position.getSide(e)) s[{
x: "y",
y: "x"
}[o[n]]] *= -1
} else {
var r = s.x;
s.x = s.y, s.y = r;
var h = {
top: {
right: "x"
},
bottom: {
left: "x"
},
left: {
bottom: "y"
},
right: {
top: "y"
}
}[Position.getSide(i)][Position.getSide(e)];
h && (s[h] *= -1), s[o[Position.getOrientation(e)]] = 0
}
return s
},
getBoxFromPoints: function(t, i, e, s) {
var o = Math.min(t, e),
n = Math.max(t, e),
r = Math.min(i, s),
h = Math.max(i, s);
return {
left: o,
top: r,
width: Math.max(n - o, 0),
height: Math.max(h - r, 0)
}
},
isPointWithinBox: function(t, i, e, s, o, n) {
var r = this.getBoxFromPoints(e, s, o, n);
return t >= r.left && t <= r.left + r.width && i >= r.top && i <= r.top + r.height
},
isPointWithinBoxLayout: function(t, i, e) {
return this.isPointWithinBox(t, i, e.position.left, e.position.top, e.position.left + e.dimensions.width, e.position.top + e.dimensions.height)
},
getDistance: function(t, i, e, s) {
return Math.sqrt(Math.pow(Math.abs(e - t), 2) + Math.pow(Math.abs(s - i), 2))
},
intersectsLine: function(t, i, e, s, o, n, r, h, a) {
return a ? (u = ((l = r - o) * (i - n) - (c = h - n) * (t - o)) / (-l * (p = s - i) + (d = e - t) * c), 0 <= (f = (-p * (t - o) + d * (i - n)) / (-l * p + d * c)) && f <= 1 && 0 <= u && u <= 1 && {
x: t + u * d,
y: i + u * p
}) : Sa(t, i, o, n, r, h) != Sa(e, s, o, n, r, h) && Sa(t, i, e, s, o, n) != Sa(t, i, e, s, r, h);
var d, p, l, c, f, u
}
},
X;
function Sa(t, i, e, s, o, n) {
var r = (n - i) * (e - t) - (s - i) * (o - t);
return 0 < r || !(r < 0)
}
var Bounds = {
viewport: function() {
return Browser.MobileSafari || Browser.Android && Browser.Gecko ? {
width: window.innerWidth,
height: window.innerHeight
} : {
height: $(window).height(),
width: $(window).width()
}
}
},
Mouse = {
_buffer: {
pageX: 0,
pageY: 0
},
_dimensions: {
width: 30,
height: 30
},
_shift: {
x: 2,
y: 10
},
getPosition: function(t) {
var i = this.getActualPosition(t);
return {
left: i.left - Math.round(.5 * this._dimensions.width) + this._shift.x,
top: i.top - Math.round(.5 * this._dimensions.height) + this._shift.y
}
},
getActualPosition: function(t) {
var i = t && "number" === $.type(t.pageX) ? t : this._buffer;
return {
left: i.pageX,
top: i.pageY
}
},
getDimensions: function() {
return this._dimensions
}
},
Color = (ub = {
_default: "#000000",
aqua: "#00ffff",
black: "#000000",
blue: "#0000ff",
fuchsia: "#ff00ff",
gray: "#808080",
green: "#008000",
lime: "#00ff00",
maroon: "#800000",
navy: "#000080",
olive: "#808000",
purple: "#800080",
red: "#ff0000",
silver: "#c0c0c0",
teal: "#008080",
white: "#ffffff",
yellow: "#ffff00"
}, {
toRGB: function(t) {
if (/^rgba?\(/.test(t)) return function(t) {
return "#" + vb((t = t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/))[1]) + vb(t[2]) + vb(t[3])
}(t);
ub[t] && (t = ub[t]);
var i = t.replace("#", "");
return /^(?:[0-9a-fA-F]{3}){1,2}$/.test(i) ? (3 == i.length && (i = i.charAt(0) + i.charAt(0) + i.charAt(1) + i.charAt(1) + i.charAt(2) + i.charAt(2)), "#" + i) : ub._default
}
}),
ub;
function vb(t) {
return ("0" + parseInt(t).toString(16)).slice(-2)
}
function Spin() {
return this.initialize.apply(this, _slice.call(arguments))
}
function Visible() {
return this.initialize.apply(this, _slice.call(arguments))
}
Spin.supported = Support.css.transform && Support.css.animation, $.extend(Spin.prototype, {
initialize: function() {
this.options = $.extend({}, arguments[0] || {}), this.build(), this.start()
},
build: function() {
var t = 2 * (this.options.length + this.options.radius),
i = {
height: t,
width: t
};
this.element = $("").addClass("tpd-spin").css(i), this.element.append(this._rotate = $("
").addClass("tpd-spin-rotate")), this.element.css({
"margin-left": -.5 * i.width,
"margin-top": -.5 * i.height
});
for (var e = this.options.lines, s = 0; s < e; s++) {
var o, n;
this._rotate.append(o = $("
").addClass("tpd-spin-frame").append(n = $("
").addClass("tpd-spin-line"))), n.css({
"background-color": this.options.color,
width: this.options.width,
height: this.options.length,
"margin-left": -.5 * this.options.width,
"border-radius": Math.round(.5 * this.options.width)
}), o.css({
opacity: (1 / e * (s + 1)).toFixed(2)
});
var r = {};
r[Support.css.prefixed("transform")] = "rotate(" + 360 / e * (s + 1) + "deg)", o.css(r)
}
},
start: function() {
var t = {};
t[Support.css.prefixed("animation")] = "tpd-spin 1s infinite steps(" + this.options.lines + ")", this._rotate.css(t)
},
stop: function() {
var t = {};
t[Support.css.prefixed("animation")] = "none", this._rotate.css(t), this.element.detach()
}
}), $.extend(Visible.prototype, {
initialize: function(t) {
return t = "array" == $.type(t) ? t : [t], this.elements = t, this._restore = [], $.each(t, $.proxy(function(t, i) {
var e = $(i).is(":visible");
e || $(i).show(), this._restore.push({
element: i,
visible: e
})
}, this)), this
},
restore: function() {
$.each(this._restore, function(t, i) {
i.visible || $(i.element).show()
}), this._restore = null
}
});
var AjaxCache = (Qb = [], {
get: function(t) {
for (var i = null, e = 0; e < Qb.length; e++) Qb[e] && Qb[e].url === t.url && (Qb[e].type || "GET").toUpperCase() === (t.type || "GET").toUpperCase() && $.param(Qb[e].data || {}) === $.param(t.data || {}) && (i = Qb[e]);
return i
},
set: function(t, i, e) {
var s = this.get(t);
s || (s = $.extend({
callbacks: {}
}, t), Qb.push(s)), s.callbacks[i] = e
},
remove: function(t) {
for (var i = 0; i < Qb.length; i++) Qb[i] && Qb[i].url === t && delete Qb[i]
},
clear: function() {
Qb = []
}
}),
Qb, Voila = function(r) {
function h(t, i, e) {
if (!(this instanceof h)) return new h(t, i, e);
var s = r.type(i),
o = "object" === s ? i : {},
n = "function" === s ? i : "function" === r.type(e) && e;
return this.options = r.extend({
method: "onload"
}, o), this.deferred = new jQuery.Deferred, n && this.always(n), this._processed = 0, this.images = [], this._add(t), this
}
r.extend(h.prototype, {
_add: function(t) {
var i = "string" == r.type(t) ? r(t) : t instanceof jQuery || 0 < t.length ? t : [t];
r.each(i, r.proxy(function(t, i) {
var e = r(),
s = r(i);
(e = s.is("img") ? e.add(s) : e.add(s.find("img"))).each(r.proxy(function(t, i) {
this.images.push(new o(i, r.proxy(function(t) {
this._progress(t)
}, this), r.proxy(function(t) {
this._progress(t)
}, this), this.options))
}, this))
}, this)), this.images.length < 1 && setTimeout(r.proxy(function() {
this._resolve()
}, this))
},
abort: function() {
this._progress = this._notify = this._reject = this._resolve = function() {}, r.each(this.images, function(t, i) {
i.abort()
}), this.images = []
},
_progress: function(t) {
this._processed++, t.isLoaded || (this._broken = !0), this._notify(t), this._processed === this.images.length && this[this._broken ? "_reject" : "_resolve"]()
},
_notify: function(t) {
this.deferred.notify(this, t)
},
_reject: function() {
this.deferred.reject(this)
},
_resolve: function() {
this.deferred.resolve(this)
},
always: function(t) {
return this.deferred.always(t), this
},
done: function(t) {
return this.deferred.done(t), this
},
fail: function(t) {
return this.deferred.fail(t), this
},
progress: function(t) {
return this.deferred.progress(t), this
}
});
var o = function(n) {
function t() {
return this.initialize.apply(this, Array.prototype.slice.call(arguments))
}
n.extend(t.prototype, {
initialize: function() {
this.options = n.extend({
test: function() {},
success: function() {},
timeout: function() {},
callAt: !1,
intervals: [
[0, 0],
[1e3, 10],
[2e3, 50],
[4e3, 100],
[2e4, 500]
]
}, arguments[0] || {}), this._test = this.options.test, this._success = this.options.success, this._timeout = this.options.timeout, this._ipos = 0, this._time = 0, this._delay = this.options.intervals[this._ipos][1], this._callTimeouts = [], this.poll(), this._createCallsAt()
},
poll: function() {
this._polling = setTimeout(n.proxy(function() {
if (this._test()) this.success();
else {
if (this._time += this._delay, this._time >= this.options.intervals[this._ipos][0]) {
if (!this.options.intervals[this._ipos + 1]) return void("function" == n.type(this._timeout) && this._timeout());
this._ipos++, this._delay = this.options.intervals[this._ipos][1]
}
this.poll()
}
}, this), this._delay)
},
success: function() {
this.abort(), this._success()
},
_createCallsAt: function() {
this.options.callAt && n.each(this.options.callAt, n.proxy(function(t, i) {
var e = i[0],
s = i[1],
o = setTimeout(n.proxy(function() {
s()
}, this), e);
this._callTimeouts.push(o)
}, this))
},
_stopCallTimeouts: function() {
n.each(this._callTimeouts, function(t, i) {
clearTimeout(i)
}), this._callTimeouts = []
},
abort: function() {
this._stopCallTimeouts(), this._polling && (clearTimeout(this._polling), this._polling = null)
}
});
function i() {
return this.initialize.apply(this, Array.prototype.slice.call(arguments))
}
return n.extend(i.prototype, {
supports: {
naturalWidth: "naturalWidth" in new Image
},
initialize: function(t, i, e) {
this.img = n(t)[0], this.successCallback = i, this.errorCallback = e, this.isLoaded = !1, this.options = n.extend({
method: "onload",
pollFallbackAfter: 1e3
}, arguments[3] || {}), "onload" != this.options.method && this.supports.naturalWidth ? this.poll() : this.load()
},
poll: function() {
this._poll = new t({
test: n.proxy(function() {
return 0 < this.img.naturalWidth
}, this),
success: n.proxy(function() {
this.success()
}, this),
timeout: n.proxy(function() {
this.error()
}, this),
callAt: [
[this.options.pollFallbackAfter, n.proxy(function() {
this.load()
}, this)]
]
})
},
load: function() {
this._loading = setTimeout(n.proxy(function() {
var t = new Image;
(this._onloadImage = t).onload = n.proxy(function() {
t.onload = function() {}, this.supports.naturalWidth || (this.img.naturalWidth = t.width, this.img.naturalHeight = t.height, t.naturalWidth = t.width, t.naturalHeight = t.height), this.success()
}, this), t.onerror = n.proxy(this.error, this), t.src = this.img.src
}, this))
},
success: function() {
this._calledSuccess || (this._calledSuccess = !0, this.abort(), this.waitForRender(n.proxy(function() {
this.isLoaded = !0, this.successCallback(this)
}, this)))
},
error: function() {
this._calledError || (this._calledError = !0, this.abort(), this._errorRenderTimeout = setTimeout(n.proxy(function() {
this.errorCallback && this.errorCallback(this)
}, this)))
},
abort: function() {
this.stopLoading(), this.stopPolling(), this.stopWaitingForRender()
},
stopPolling: function() {
this._poll && (this._poll.abort(), this._poll = null)
},
stopLoading: function() {
this._loading && (clearTimeout(this._loading), this._loading = null), this._onloadImage && (this._onloadImage.onload = function() {}, this._onloadImage.onerror = function() {})
},
waitForRender: function(t) {
this._renderTimeout = setTimeout(t)
},
stopWaitingForRender: function() {
this._renderTimeout && (clearTimeout(this._renderTimeout), this._renderTimeout = null), this._errorRenderTimeout && (clearTimeout(this._errorRenderTimeout), this._errorRenderTimeout = null)
}
}), i
}(jQuery);
return h
}(jQuery);
Tipped.Behaviors = {
hide: {
showOn: {
element: "mouseenter",
tooltip: !1
},
hideOn: {
element: "mouseleave",
tooltip: "mouseenter"
}
},
mouse: {
showOn: {
element: "mouseenter",
tooltip: !1
},
hideOn: {
element: "mouseleave",
tooltip: "mouseenter"
},
target: "mouse",
showDelay: 100,
fadeIn: 0,
hideDelay: 0,
fadeOut: 0
},
sticky: {
showOn: {
element: "mouseenter",
tooltip: "mouseenter"
},
hideOn: {
element: "mouseleave",
tooltip: "mouseleave"
},
showDelay: 150,
target: "mouse",
fixed: !0
}
};
var Options = {
create: Rc
},
Oc, Pc;
function Rc(t) {
return Oc = Tipped.Skins.base, Pc = deepExtend($.extend({}, Oc), Tipped.Skins.reset), (Rc = Uc)(t)
}
function Sc(t) {
return t.match(/^(top|left|bottom|right)$/) && (t += "middle"), t.replace("center", "middle").replace(" ", ""), t
}
function Tc(t) {
var i;
return t.behavior && (i = Tipped.Behaviors[t.behavior]) ? deepExtend($.extend({}, i), t) : t
}
function Uc(t) {
var i = t.skin ? t.skin : Tooltips.options.defaultSkin,
e = $.extend({}, Tipped.Skins[i] || {});
e.skin || (e.skin = Tooltips.options.defaultSkin || "dark");
var s, o = deepExtend($.extend({}, Pc), Tc(e)),
n = deepExtend($.extend({}, o), Tc(t));
if (n.ajax) {
Pc.ajax;
var r = Oc.ajax;
"boolean" === $.type(n.ajax) && (n.ajax = {}), n.ajax = deepExtend($.extend({}, r), n.ajax)
}
var h = h = n.position && n.position.target || "string" === $.type(n.position) && n.position || Pc.position && Pc.position.target || "string" === $.type(Pc.position) && Pc.position || Oc.position && Oc.position.target || Oc.position;
h = Sc(h);
var a, d = n.position && n.position.tooltip || Pc.position && Pc.position.tooltip || Oc.position && Oc.position.tooltip || Tooltips.Position.getInversedPosition(h);
if (d = Sc(d), n.position ? "string" === $.type(n.position) ? (n.position = Sc(n.position), s = {
target: n.position,
tooltip: Tooltips.Position.getTooltipPositionFromTarget(n.position)
}) : (s = {
tooltip: d,
target: h
}, n.position.tooltip && (s.tooltip = Sc(n.position.tooltip)), n.position.target && (s.target = Sc(n.position.target))) : s = {
tooltip: d,
target: h
}, Position.isCorner(s.target) && Position.getOrientation(s.target) !== Position.getOrientation(s.tooltip) && (s.target = Position.inverseCornerPlane(s.target)), "mouse" === n.target) {
var p = Position.getOrientation(s.target);
s.target = "horizontal" === p ? s.target.replace(/(left|right)/, "middle") : s.target.replace(/(top|bottom)/, "middle")
}
if (n.position = s, "mouse" === n.target ? (a = $.extend({}, Oc.offset), $.extend(a, Tipped.Skins.reset.offset || {}), t.skin && $.extend(a, (Tipped.Skins[t.skin] || Tipped.Skins[Tooltips.options.defaultSkin] || {}).offset || {}), a = Position.adjustOffsetBasedOnPosition(Oc.offset, Oc.position, s.target, !0), t.offset && (a = $.extend(a, t.offset || {}))) : a = {
x: n.offset.x,
y: n.offset.y
}, n.offset = a, n.hideOn && "click-outside" === n.hideOn && (n.hideOnClickOutside = !0, n.hideOn = !1, n.fadeOut = 0), n.showOn) {
var l = n.showOn;
"string" === $.type(l) && (l = {
element: l
}), n.showOn = l
}
if (n.hideOn) {
var c = n.hideOn;
"string" === $.type(c) && (c = {
element: c
}), n.hideOn = c
}
return n.inline && "string" !== $.type(n.inline) && (n.inline = !1), Browser.IE && Browser.IE < 9 && $.extend(n, {
fadeIn: 0,
fadeOut: 0,
hideDelay: 0
}), n.spinner && (Spin.supported ? "boolean" === $.type(n.spinner) && (n.spinner = Pc.spinner || Oc.spinner || {}) : n.spinner = !1), n.container || (n.container = document.body), n.containment && "string" === $.type(n.containment) && (n.containment = {
selector: n.containment,
padding: Pc.containment && Pc.containment.padding || Oc.padding && Oc.containment.padding
}), n.shadow && (n.shadow = Support.shadow), n
}
function Skin() {
this.initialize.apply(this, _slice.call(arguments))
}
function Stem() {
this.initialize.apply(this, _slice.call(arguments))
}
$.extend(Skin.prototype, {
initialize: function(t) {
this.tooltip = t, this.element = t._skin;
var i, e, s, o, n = this.tooltip.options;
this.tooltip._tooltip[(n.shadow ? "remove" : "add") + "Class"]("tpd-no-shadow")[(n.radius ? "remove" : "add") + "Class"]("tpd-no-radius")[(n.stem ? "remove" : "add") + "Class"]("tpd-no-stem");
var r = Support.css.prefixed("borderTopLeftRadius");
this.element.append(i = $("
").addClass("tpd-frames").append($("
").addClass("tpd-frame").append($("
").addClass("tpd-backgrounds").append(e = $("
").addClass("tpd-background").append(s = $("
").addClass("tpd-background-content")))))).append(o = $("
").addClass("tpd-spinner")), e.css({
width: 999,
height: 999,
zoom: 1
}), this._css = {
border: parseFloat(e.css("border-top-width")),
radius: parseFloat(r ? e.css(r) : 0),
padding: parseFloat(t._content.css("padding-top")),
borderColor: e.css("border-top-color"),
backgroundColor: s.css("background-color"),
backgroundOpacity: s.css("opacity"),
spinner: {
dimensions: {
width: o.innerWidth(),
height: o.innerHeight()
}
}
}, o.remove(), i.remove(), this._side = Position.getSide(t.options.position.tooltip) || "top", this._vars = {}
},
destroy: function() {
this.frames && ($.each("top right bottom left".split(" "), $.proxy(function(t, i) {
this["stem_" + i] && this["stem_" + i].destroy()
}, this)), this.frames.remove(), this.frames = null)
},
build: function() {
this.frames || (this.element.append(this.frames = $("
").addClass("tpd-frames")), $.each("top right bottom left".split(" "), $.proxy(function(t, i) {
this.insertFrame(i)
}, this)), this._spinner || this.tooltip._tooltip.append(this._spinner = $("
").addClass("tpd-spinner").hide().append($("
").addClass("tpd-spinner-spin"))))
},
_frame: function() {
var e, t = $("
").addClass("tpd-frame").append(e = $("
").addClass("tpd-backgrounds").append($("
").addClass("tpd-background-shadow"))).append($("
").addClass("tpd-shift-stem").append($("
").addClass("tpd-shift-stem-side tpd-shift-stem-side-before")).append($("
").addClass("tpd-stem")).append($("
").addClass("tpd-shift-stem-side tpd-shift-stem-side-after")));
return $.each("top right bottom left".split(" "), $.proxy(function(t, i) {
e.append($("
").addClass("tpd-background-box tpd-background-box-" + i).append($("
").addClass("tpd-background-box-shift").append($("
").addClass("tpd-background-box-shift-further").append($("
").addClass("tpd-background").append($("
").addClass("tpd-background-title")).append($("
").addClass("tpd-background-content"))).append($("
").addClass("tpd-background tpd-background-loading")).append($("
").addClass("tpd-background-border-hack").hide()))))
}, this)), t
}(),
_getFrame: function(t) {
var i = this._frame.clone();
i.addClass("tpd-frame-" + t), i.find(".tpd-background-shadow").css({
"border-radius": this._css.radius
}), this.tooltip.options.stem && i.find(".tpd-stem").attr("data-stem-position", t);
var e = Math.max(this._css.radius - this._css.border, 0);
i.find(".tpd-background-title").css({
"border-top-left-radius": e,
"border-top-right-radius": e
}), i.find(".tpd-background-content").css({
"border-bottom-left-radius": e,
"border-bottom-right-radius": e
}), i.find(".tpd-background-loading").css({
"border-radius": e
});
var s = {
backgroundColor: this._css.borderColor
};
s["horizontal" === Position.getOrientation(t) ? "height" : "width"] = this._css.border + "px";
return s[{
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}[t]] = 0, i.find(".tpd-shift-stem-side").css(s), i
},
insertFrame: function(t) {
var i = this["frame_" + t] = this._getFrame(t);
if (this.frames.append(i), this.tooltip.options.stem) {
var e = i.find(".tpd-stem");
this["stem_" + t] = new Stem(e, this, {})
}
},
startLoading: function() {
this.tooltip.supportsLoading && (this.build(), this._spinner || this.tooltip.is("resize-to-content") || this.setDimensions(this._css.spinner.dimensions), this._spinner && this._spinner.show())
},
stopLoading: function() {
this.tooltip.supportsLoading && this._spinner && (this.build(), this._spinner.hide())
},
updateBackground: function() {
var t = this._vars.frames[this._side],
i = $.extend({}, t.background.dimensions);
if (this.tooltip.title && !this.tooltip.is("loading")) {
this.element.find(".tpd-background-title, .tpd-background-content").show(), this.element.find(".tpd-background").css({
"background-color": "transparent"
});
var e = $.extend({}, i),
s = Math.max(this._css.radius - this._css.border, 0),
o = {
"border-top-left-radius": s,
"border-top-right-radius": s,
"border-bottom-left-radius": s,
"border-bottom-right-radius": s
},
n = new Visible(this.tooltip._tooltip),
r = this.tooltip._titleWrapper.innerHeight();
e.height -= r, this.element.find(".tpd-background-title").css({
height: r,
width: i.width
}), o["border-top-left-radius"] = 0, o["border-top-right-radius"] = 0, n.restore(), this.element.find(".tpd-background-content").css(e).css(o), this.element.find(".tpd-background-loading").css({
"background-color": this._css.backgroundColor
})
} else this.element.find(".tpd-background-title, .tpd-background-content").hide(), this.element.find(".tpd-background").css({
"background-color": this._css.backgroundColor
});
this._css.border && (this.element.find(".tpd-background").css({
"border-color": "transparent"
}), this.element.find(".tpd-background-border-hack").css({
width: i.width,
height: i.height,
"border-radius": this._css.radius,
"border-width": this._css.border,
"border-color": this._css.borderColor
}).show())
},
paint: function() {
if (!this._paintedDimensions || this._paintedDimensions.width !== this._dimensions.width || this._paintedDimensions.height !== this._dimensions.height || this._paintedStemPosition !== this._stemPosition) {
this._paintedDimensions = this._dimensions, this._paintedStemPosition = this._stemPosition, this.element.removeClass("tpd-visible-frame-top tpd-visible-frame-bottom tpd-visible-frame-left tpd-visible-frame-right").addClass("tpd-visible-frame-" + this._side);
var t = this._vars.frames[this._side],
i = $.extend({}, t.background.dimensions);
this.element.find(".tpd-background").css(i), this.element.find(".tpd-background-shadow").css({
width: i.width + 2 * this._css.border,
height: i.height + 2 * this._css.border
}), this.updateBackground(), this.element.find(".tpd-background-box-shift, .tpd-background-box-shift-further").removeAttr("style"), this.element.add(this.frames).add(this.tooltip._tooltip).css(t.dimensions);
var e = this._side,
s = this._vars.frames[e],
o = this.element.find(".tpd-frame-" + this._side),
n = this._vars.frames[e].dimensions;
o.css(n), o.find(".tpd-backgrounds").css($.extend({}, s.background.position, {
width: n.width - s.background.position.left,
height: n.height - s.background.position.top
}));
var r = Position.getOrientation(e);
if (this.tooltip.options.stem)
if (o.find(".tpd-shift-stem").css($.extend({}, s.shift.dimensions, s.shift.position)), "vertical" === r) {
(a = o.find(".tpd-background-box-top, .tpd-background-box-bottom")).css({
height: this._vars.cut,
width: this._css.border
}), o.find(".tpd-background-box-bottom").css({
top: s.dimensions.height - this._vars.cut
}).find(".tpd-background-box-shift").css({
"margin-top": -1 * s.dimensions.height + this._vars.cut
});
var h = "right" === e ? s.dimensions.width - s.stemPx - this._css.border : 0;
a.css({
left: h
}).find(".tpd-background-box-shift").css({
"margin-left": -1 * h
}), o.find(".tpd-background-box-" + ("left" == e ? "left" : "right")).hide(), "right" === e ? o.find(".tpd-background-box-left").css({
width: s.dimensions.width - s.stemPx - this._css.border
}) : o.find(".tpd-background-box-right").css({
"margin-left": this._css.border
}).find(".tpd-background-box-shift").css({
"margin-left": -1 * this._css.border
}), (d = o.find(".tpd-background-box-" + this._side)).css({
height: s.dimensions.height - 2 * this._vars.cut,
"margin-top": this._vars.cut
}), d.find(".tpd-background-box-shift").css({
"margin-top": -1 * this._vars.cut
})
} else {
var a;
(a = o.find(".tpd-background-box-left, .tpd-background-box-right")).css({
width: this._vars.cut,
height: this._css.border
}), o.find(".tpd-background-box-right").css({
left: s.dimensions.width - this._vars.cut
}).find(".tpd-background-box-shift").css({
"margin-left": -1 * s.dimensions.width + this._vars.cut
});
var d;
h = "bottom" === e ? s.dimensions.height - s.stemPx - this._css.border : 0;
a.css({
top: h
}).find(".tpd-background-box-shift").css({
"margin-top": -1 * h
}), o.find(".tpd-background-box-" + ("top" === e ? "top" : "bottom")).hide(), "bottom" === e ? o.find(".tpd-background-box-top").css({
height: s.dimensions.height - s.stemPx - this._css.border
}) : o.find(".tpd-background-box-bottom").css({
"margin-top": this._css.border
}).find(".tpd-background-box-shift").css({
"margin-top": -1 * this._css.border
}), (d = o.find(".tpd-background-box-" + this._side)).css({
width: s.dimensions.width - 2 * this._vars.cut,
"margin-left": this._vars.cut
}), d.find(".tpd-background-box-shift").css({
"margin-left": -1 * this._vars.cut
})
}
var p = t.background,
l = p.position,
c = p.dimensions;
this._spinner.css({
top: l.top + this._css.border + (.5 * c.height - .5 * this._css.spinner.dimensions.height),
left: l.left + this._css.border + (.5 * c.width - .5 * this._css.spinner.dimensions.width)
})
}
},
getVars: function() {
this._css.padding, this._css.radius;
var r = this._css.border,
t = this._vars.maxStemHeight || 0,
h = $.extend({}, this._dimensions || {}),
a = {
frames: {},
dimensions: h,
maxStemHeight: t
};
a.cut = Math.max(this._css.border, this._css.radius) || 0;
var d = {
width: 0,
height: 0
},
i = 0,
p = 0;
return this.tooltip.options.stem && (d = this.stem_top.getMath().dimensions.outside, i = this.stem_top._css.offset, p = Math.max(d.height - this._css.border, 0)), a.stemDimensions = d, a.stemOffset = i, $.each("top right bottom left".split(" "), $.proxy(function(t, i) {
var e = "vertical" === Position.getOrientation(i),
s = {
width: h.width + 2 * r,
height: h.height + 2 * r
},
o = s[e ? "height" : "width"] - 2 * a.cut,
n = {
dimensions: s,
stemPx: p,
position: {
top: 0,
left: 0
},
background: {
dimensions: $.extend({}, h),
position: {
top: 0,
left: 0
}
}
};
switch ((a.frames[i] = n).dimensions[e ? "width" : "height"] += p, "top" !== i && "left" !== i || (n.background.position[i] += p), $.extend(n, {
shift: {
position: {
top: 0,
left: 0
},
dimensions: {
width: e ? d.height : o,
height: e ? o : d.height
}
}
}), i) {
case "top":
case "bottom":
n.shift.position.left += a.cut, "bottom" === i && (n.shift.position.top += s.height - r - p);
break;
case "left":
case "right":
n.shift.position.top += a.cut, "right" === i && (n.shift.position.left += s.width - r - p)
}
}, this)), a.connections = {}, $.each(Position.positions, $.proxy(function(t, i) {
a.connections[i] = this.getConnectionLayout(i, a)
}, this)), a
},
setDimensions: function(t) {
this.build();
var i = this._dimensions;
i && i.width === t.width && i.height === t.height || (this._dimensions = t, this._vars = this.getVars())
},
setSide: function(t) {
this._side = t, this._vars = this.getVars()
},
getConnectionLayout: function(t, i) {
var e = Position.getSide(t),
s = Position.getOrientation(t),
o = (i.dimensions, i.cut),
n = this["stem_" + e],
r = i.stemOffset,
h = this.tooltip.options.stem ? n.getMath().dimensions.outside.width : 0,
a = o + r + .5 * h,
d = {
stem: {}
},
p = {
left: 0,
right: 0,
up: 0,
down: 0
},
l = {
top: 0,
left: 0
},
c = {
top: 0,
left: 0
},
f = i.frames[e];
a = 0;
if ("horizontal" == s) {
var u = f.dimensions.width;
this.tooltip.options.stem && ((u = f.shift.dimensions.width) - h < 2 * r && (r = Math.floor(.5 * (u - h)) || 0), a = o + r + .5 * h);
var m = u - 2 * r,
g = r;
switch ((v = Position.split(t))[2]) {
case "left":
p.right = m - h, l.left = a;
break;
case "middle":
g += Math.round(.5 * m - .5 * h), p.left = g - r, p.right = g - r, l.left = c.left = Math.round(.5 * f.dimensions.width);
break;
case "right":
g += m - h, p.left = m - h, l.left = f.dimensions.width - a, c.left = f.dimensions.width
}
"bottom" === v[1] && (l.top += f.dimensions.height, c.top += f.dimensions.height), $.extend(d.stem, {
position: {
left: g
},
before: {
width: g
},
after: {
left: g + h,
width: u - g - h + 1
}
})
} else {
var b = f.dimensions.height;
this.tooltip.options.stem && ((b = f.shift.dimensions.height) - h < 2 * r && (r = Math.floor(.5 * (b - h)) || 0), a = o + r + .5 * h);
var v, _ = b - 2 * r,
x = r;
switch ((v = Position.split(t))[2]) {
case "top":
p.down = _ - h, l.top = a;
break;
case "middle":
x += Math.round(.5 * _ - .5 * h), p.up = x - r, p.down = x - r, l.top = c.top = Math.round(.5 * f.dimensions.height);
break;
case "bottom":
x += _ - h, p.up = _ - h, l.top = f.dimensions.height - a, c.top = f.dimensions.height
}
"right" === v[1] && (l.left += f.dimensions.width, c.left += f.dimensions.width), $.extend(d.stem, {
position: {
top: x
},
before: {
height: x
},
after: {
top: x + h,
height: b - x - h + 1
}
})
}
return d.move = p, d.stem.connection = l, d.connection = c, d
},
setStemPosition: function(t, i) {
if (this._stemPosition !== t) {
this._stemPosition = t;
var e = Position.getSide(t);
this.setSide(e)
}
this.tooltip.options.stem && this.setStemShift(t, i)
},
setStemShift: function(t, i) {
var e = this._shift,
s = this._dimensions;
if (!e || e.stemPosition !== t || e.shift.x !== i.x || e.shift.y !== i.y || !s || e.dimensions.width !== s.width || e.dimensions.height !== s.height) {
this._shift = {
stemPosition: t,
shift: i,
dimensions: s
};
var o = Position.getSide(t),
n = {
horizontal: "x",
vertical: "y"
}[Position.getOrientation(t)],
r = {
x: {
left: "left",
width: "width"
},
y: {
left: "top",
width: "height"
}
}[n],
h = this["stem_" + o],
a = deepExtend({}, this._vars.connections[t].stem);
i && 0 !== i[n] && (a.before[r.width] += i[n], a.position[r.left] += i[n], a.after[r.left] += i[n], a.after[r.width] -= i[n]), h.element.css(a.position), h.element.siblings(".tpd-shift-stem-side-before").css(a.before), h.element.siblings(".tpd-shift-stem-side-after").css(a.after)
}
}
}), $.extend(Stem.prototype, {
initialize: function(t, i) {
this.element = $(t), this.element[0] && (this.skin = i, this.element.removeClass("tpd-stem-reset"), this._css = $.extend({}, i._css, {
width: this.element.innerWidth(),
height: this.element.innerHeight(),
offset: parseFloat(this.element.css("margin-left")),
spacing: parseFloat(this.element.css("margin-top"))
}), this.element.addClass("tpd-stem-reset"), this.options = $.extend({}, arguments[2] || {}), this._position = this.element.attr("data-stem-position") || "top", this._m = 100, this.build())
},
destroy: function() {
this.element.html("")
},
build: function() {
this.destroy();
var t = this._css.backgroundColor,
i = -1 < t.indexOf("rgba") && parseFloat(t.replace(/^.*,(.+)\)/, "$1")),
e = i && i < 1;
this._useTransform = e && Support.css.transform, this._css.border || (this._useTransform = !1), this[(this._useTransform ? "build" : "buildNo") + "Transform"]()
},
buildTransform: function() {
this.element.append(this.spacer = $("
").addClass("tpd-stem-spacer").append(this.downscale = $("
").addClass("tpd-stem-downscale").append(this.transform = $("
").addClass("tpd-stem-transform").append(this.first = $("
").addClass("tpd-stem-side").append(this.border = $("
").addClass("tpd-stem-border")).append($("
").addClass("tpd-stem-border-corner")).append($("
").addClass("tpd-stem-triangle")))))), this.transform.append(this.last = this.first.clone().addClass("tpd-stem-side-inversed")), this.sides = this.first.add(this.last);
var t = this.getMath(),
i = t.dimensions,
e = this._m,
s = Position.getSide(this._position);
if (this.element.find(".tpd-stem-spacer").css({
width: l ? i.inside.height : i.inside.width,
height: l ? i.inside.width : i.inside.height
}), "top" === s || "left" === s) {
var o = {};
"top" === s ? (o.bottom = 0, o.top = "auto") : "left" === s && (o.right = 0, o.left = "auto"), this.element.find(".tpd-stem-spacer").css(o)
}
this.transform.css({
width: i.inside.width * e,
height: i.inside.height * e
});
var n = Support.css.prefixed("transform"),
r = {
"background-color": "transparent",
"border-bottom-color": this._css.backgroundColor,
"border-left-width": .5 * i.inside.width * e,
"border-bottom-width": i.inside.height * e
};
r[n] = "translate(" + t.border * e + "px, 0)", this.element.find(".tpd-stem-triangle").css(r);
var h = this._css.borderColor;
alpha = -1 < h.indexOf("rgba") && parseFloat(h.replace(/^.*,(.+)\)/, "$1")), alpha && alpha < 1 ? h = (h.substring(0, h.lastIndexOf(",")) + ")").replace("rgba", "rgb") : alpha = 1;
var a = {
"background-color": "transparent",
"border-right-width": t.border * e,
width: t.border * e,
"margin-left": -2 * t.border * e,
"border-color": h,
opacity: alpha
};
a[n] = "skew(" + t.skew + "deg) translate(" + t.border * e + "px, " + -1 * this._css.border * e + "px)", this.element.find(".tpd-stem-border").css(a);
h = this._css.borderColor;
alpha = -1 < h.indexOf("rgba") && parseFloat(h.replace(/^.*,(.+)\)/, "$1")), alpha && alpha < 1 ? h = (h.substring(0, h.lastIndexOf(",")) + ")").replace("rgba", "rgb") : alpha = 1;
var d = {
width: t.border * e,
"border-right-width": t.border * e,
"border-right-color": h,
background: h,
opacity: alpha,
"margin-left": -2 * t.border * e
};
if (d[n] = "skew(" + t.skew + "deg) translate(" + t.border * e + "px, " + (i.inside.height - this._css.border) * e + "px)", this.element.find(".tpd-stem-border-corner").css(d), this.setPosition(this._position), 1 < e) {
var p = {};
p[n] = "scale(" + 1 / e + "," + 1 / e + ")", this.downscale.css(p)
}
var l = /^(left|right)$/.test(this._position);
this._css.border || this.element.find(".tpd-stem-border, .tpd-stem-border-corner").hide(), this.element.css({
width: l ? i.outside.height : i.outside.width,
height: l ? i.outside.width : i.outside.height
})
},
buildNoTransform: function() {
this.element.append(this.spacer = $("
").addClass("tpd-stem-spacer").append($("
").addClass("tpd-stem-notransform").append($("
").addClass("tpd-stem-border").append($("
").addClass("tpd-stem-border-corner")).append($("
").addClass("tpd-stem-border-center-offset").append($("
").addClass("tpd-stem-border-center-offset-inverse").append($("
").addClass("tpd-stem-border-center"))))).append($("
").addClass("tpd-stem-triangle"))));
var t = this.getMath(),
i = t.dimensions,
e = /^(left|right)$/.test(this._position),
s = /^(bottom)$/.test(this._position),
o = /^(right)$/.test(this._position),
n = Position.getSide(this._position);
if (this.element.css({
width: e ? i.outside.height : i.outside.width,
height: e ? i.outside.width : i.outside.height
}), this.element.find(".tpd-stem-notransform").add(this.element.find(".tpd-stem-spacer")).css({
width: e ? i.inside.height : i.inside.width,
height: e ? i.inside.width : i.inside.height
}), "top" === n || "left" === n) {
var r = {};
"top" === n ? (r.bottom = 0, r.top = "auto") : "left" === n && (r.right = 0, r.left = "auto"), this.element.find(".tpd-stem-spacer").css(r)
}
this.element.find(".tpd-stem-border").css({
width: "100%",
background: "transparent"
});
var h = {
opacity: 1
};
h[e ? "height" : "width"] = "100%", h[e ? "width" : "height"] = this._css.border, h[s ? "top" : "bottom"] = 0, $.extend(h, o ? {
left: 0
} : {
right: 0
}), this.element.find(".tpd-stem-border-corner").css(h);
var a = {
width: 0,
"background-color": "transparent",
opacity: 1
},
d = .5 * i.inside.width + "px solid transparent",
p = {
"background-color": "transparent"
};
i.inside.width, t.border;
if (e) {
l = {
left: "auto",
top: "50%",
"margin-top": -.5 * i.inside.width,
"border-top": d,
"border-bottom": d
};
$.extend(a, l), a[o ? "right" : "left"] = 0, a[o ? "border-left" : "border-right"] = i.inside.height + "px solid " + this._css.borderColor, $.extend(p, l), p[o ? "border-left" : "border-right"] = i.inside.height + "px solid " + this._css.backgroundColor, p[o ? "right" : "left"] = t.top, p[o ? "left" : "right"] = "auto", this.element.find(".tpd-stem-border-center-offset").css({
"margin-left": -1 * this._css.border * (o ? -1 : 1)
}).find(".tpd-stem-border-center-offset-inverse").css({
"margin-left": this._css.border * (o ? -1 : 1)
})
} else {
var l = {
"margin-left": -.5 * i.inside.width,
"border-left": d,
"border-right": d
};
$.extend(a, l), a[s ? "border-top" : "border-bottom"] = i.inside.height + "px solid " + this._css.borderColor, $.extend(p, l), p[s ? "border-top" : "border-bottom"] = i.inside.height + "px solid " + this._css.backgroundColor, p[s ? "bottom" : "top"] = t.top, p[s ? "top" : "bottom"] = "auto", this.element.find(".tpd-stem-border-center-offset").css({
"margin-top": -1 * this._css.border * (s ? -1 : 1)
}).find(".tpd-stem-border-center-offset-inverse").css({
"margin-top": this._css.border * (s ? -1 : 1)
})
}
this.element.find(".tpd-stem-border-center").css(a), this.element.find(".tpd-stem-border-corner").css({
"background-color": this._css.borderColor
}), this.element.find(".tpd-stem-triangle").css(p), this._css.border || this.element.find(".tpd-stem-border").hide()
},
setPosition: function(t) {
this._position = t, this.transform.attr("class", "tpd-stem-transform tpd-stem-transform-" + t)
},
getMath: function() {
var t = this._css.height,
i = this._css.width,
e = this._css.border;
this._useTransform && Math.floor(i) % 2 && (i = Math.max(Math.floor(i) - 1, 0));
var s = degrees(Math.atan(.5 * i / t)),
o = 90 - s,
n = {
width: i + 2 * (e / Math.cos((90 - o) * Math.PI / 180)),
height: t + (c = e / Math.cos((90 - s) * Math.PI / 180))
};
Math.max(e, this._css.radius);
t = n.height, i = .5 * n.width;
var r = 90 - degrees(Math.atan(t / i)),
h = e / Math.cos(r * Math.PI / 180),
a = 180 * Math.atan(t / i) / Math.PI,
d = -1 * (90 - a),
p = 90 - a,
l = e * Math.tan(p * Math.PI / 180),
c = e / Math.cos((90 - p) * Math.PI / 180),
f = $.extend({}, n),
u = $.extend({}, n);
u.height += this._css.spacing, u.height = Math.ceil(u.height);
var m = !0;
return n.width <= 2 * e && (m = !1), {
enabled: m,
outside: u,
dimensions: {
inside: f,
outside: u
},
top: c,
border: h,
skew: d,
corner: l
}
}
});
var Tooltips = {
tooltips: {},
options: {
defaultSkin: "dark",
startingZIndex: 999999
},
_emptyClickHandler: function() {},
init: function() {
this.reset(), this._resizeHandler = $.proxy(this.onWindowResize, this), $(window).bind("resize orientationchange", this._resizeHandler), Browser.MobileSafari && $("body").bind("click", this._emptyClickHandler)
},
reset: function() {
Tooltips.removeAll(), Delegations.removeAll(), this._resizeHandler && $(window).unbind("resize orientationchange", this._resizeHandler), Browser.MobileSafari && $("body").unbind("click", this._emptyClickHandler)
},
onWindowResize: function() {
this._resizeTimer && (window.clearTimeout(this._resizeTimer), this._resizeTimer = null), this._resizeTimer = _.delay($.proxy(function() {
var t = this.getVisible();
$.each(t, function(t, i) {
i.clearUpdatedTo(), i.position()
})
}, this), 15)
},
_getTooltips: function(t, i) {
var e, s = [],
o = [];
if (_.isElement(t) ? (e = $(t).data("tipped-uids")) && (s = s.concat(e)) : $(t).each(function(t, i) {
(e = $(i).data("tipped-uids")) && (s = s.concat(e))
}), !s[0] && !i) {
var n = this.getTooltipByTooltipElement($(t).closest(".tpd-tooltip")[0]);
n && n.element && (e = $(n.element).data("tipped-uids") || []) && (s = s.concat(e))
}
return 0 < s.length && $.each(s, $.proxy(function(t, i) {
var e;
(e = this.tooltips[i]) && o.push(e)
}, this)), o
},
findElement: function(t) {
var i = [];
return _.isElement(t) && (i = this._getTooltips(t)), i[0] && i[0].element
},
get: function(e) {
var t = $.extend({
api: !1
}, arguments[1] || {}),
s = [];
return _.isElement(e) ? s = this._getTooltips(e) : e instanceof $ ? e.each($.proxy(function(t, i) {
var e = this._getTooltips(i, !0);
0 < e.length && (s = s.concat(e))
}, this)) : "string" === $.type(e) && $.each(this.tooltips, function(t, i) {
i.element && $(i.element).is(e) && s.push(i)
}), t.api && $.each(s, function(t, i) {
i.is("api", !0)
}), s
},
getTooltipByTooltipElement: function(e) {
if (!e) return null;
var s = null;
return $.each(this.tooltips, function(t, i) {
i.is("build") && i._tooltip[0] === e && (s = i)
}), s
},
getBySelector: function(e) {
var s = [];
return $.each(this.tooltips, function(t, i) {
i.element && $(i.element).is(e) && s.push(i)
}), s
},
getNests: function() {
var e = [];
return $.each(this.tooltips, function(t, i) {
i.is("nest") && e.push(i)
}), e
},
show: function(t) {
$(this.get(t)).each(function(t, i) {
i.show(!1, !0)
})
},
hide: function(t) {
$(this.get(t)).each(function(t, i) {
i.hide()
})
},
toggle: function(t) {
$(this.get(t)).each(function(t, i) {
i.toggle()
})
},
hideAll: function(e) {
$.each(this.getVisible(), function(t, i) {
e && e === i || i.hide()
})
},
refresh: function(t) {
var i;
i = t ? $.grep(this.get(t), function(t, i) {
return t.is("visible")
}) : this.getVisible(), $.each(i, function(t, i) {
i.refresh()
})
},
getVisible: function() {
var e = [];
return $.each(this.tooltips, function(t, i) {
i.visible() && e.push(i)
}), e
},
isVisibleByElement: function(e) {
var s = !1;
return _.isElement(e) && $.each(this.getVisible() || [], function(t, i) {
if (i.element === e) return !(s = !0)
}), s
},
getHighestTooltip: function() {
var e, s = 0;
return $.each(this.tooltips, function(t, i) {
i.zIndex > s && (s = i.zIndex, e = i)
}), e
},
resetZ: function() {
this.getVisible().length <= 1 && $.each(this.tooltips, function(t, i) {
i.is("build") && !i.options.zIndex && i._tooltip.css({
zIndex: i.zIndex = +Tooltips.options.startingZIndex
})
})
},
clearAjaxCache: function() {
$.each(this.tooltips, $.proxy(function(t, i) {
i.options.ajax && (i._cache && i._cache.xhr && (i._cache.xhr.abort(), i._cache.xhr = null), i.is("updated", !1), i.is("updating", !1), i.is("sanitized", !1))
}, this)), AjaxCache.clear()
},
add: function(t) {
this.tooltips[t.uid] = t
},
remove: function(t) {
var i = this._getTooltips(t);
this.removeTooltips(i)
},
removeTooltips: function(t) {
t && $.each(t, $.proxy(function(t, i) {
var e = i.uid;
delete this.tooltips[e], i.remove()
}, this))
},
removeDetached: function() {
var t = this.getNests(),
e = [];
0 < t.length && $.each(t, function(t, i) {
i.is("detached") && (e.push(i), i.attach())
}), $.each(this.tooltips, $.proxy(function(t, i) {
i.element && !_.element.isAttached(i.element) && this.remove(i.element)
}, this)), $.each(e, function(t, i) {
i.detach()
})
},
removeAll: function() {
$.each(this.tooltips, $.proxy(function(t, i) {
i.element && this.remove(i.element)
}, this)), this.tooltips = {}
},
setDefaultSkin: function(t) {
this.options.defaultSkin = t || "dark"
},
setStartingZIndex: function(t) {
this.options.startingZIndex = t || 0
}
};
function Tooltip() {
this.initialize.apply(this, _slice.call(arguments))
}
Tooltips.Position = {
inversedPosition: {
left: "right",
right: "left",
top: "bottom",
bottom: "top",
middle: "middle",
center: "center"
},
getInversedPosition: function(t) {
var i = Position.split(t),
e = i[1],
s = i[2],
o = Position.getOrientation(t),
n = $.extend({
horizontal: !0,
vertical: !0
}, arguments[1] || {});
return "horizontal" === o ? (n.vertical && (e = this.inversedPosition[e]), n.horizontal && (s = this.inversedPosition[s])) : (n.vertical && (s = this.inversedPosition[s]), n.horizontal && (e = this.inversedPosition[e])), e + s
},
getTooltipPositionFromTarget: function(t) {
var i = Position.split(t);
return this.getInversedPosition(i[1] + this.inversedPosition[i[2]])
}
}, $.extend(Tooltip.prototype, {
supportsLoading: Support.css.transform && Support.css.animation,
initialize: function(element, content) {
if (this.element = element, this.element) {
var options;
"object" !== $.type(content) || _.isElement(content) || _.isText(content) || _.isDocumentFragment(content) || content instanceof $ ? options = arguments[2] || {} : (options = content, content = null);
var dataOptions = $(element).data("tipped-options");
dataOptions && (options = deepExtend($.extend({}, options), eval("({" + dataOptions + "})"))), this.options = Options.create(options), this._cache = {
dimensions: {
width: 0,
height: 0
},
events: [],
timers: {},
layouts: {},
is: {},
fnCallFn: "",
updatedTo: {}
}, this.queues = {
showhide: $({})
};
var title = $(element).attr("title") || $(element).data("tipped-restore-title");
if (!content) {
var dt = $(element).attr("data-tipped");
if (dt ? content = dt : title && (content = title), content) {
var SCRIPT_REGEX = /