/* Minification failed. Returning unminified contents.
(2914,10): run-time error JS1004: Expected ';'
(2917,42): run-time error JS1004: Expected ';'
(2918,18): run-time error JS1004: Expected ';'
(2933,10): run-time error JS1004: Expected ';'
(2934,14): run-time error JS1004: Expected ';'
 */
/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function (e, t) { "use strict"; "object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return t(e) } : t(e) }("undefined" != typeof window ? window : this, function (C, e) { "use strict"; var t = [], E = C.document, r = Object.getPrototypeOf, s = t.slice, g = t.concat, u = t.push, i = t.indexOf, n = {}, o = n.toString, v = n.hasOwnProperty, a = v.toString, l = a.call(Object), y = {}, m = function (e) { return "function" == typeof e && "number" != typeof e.nodeType }, x = function (e) { return null != e && e === e.window }, c = { type: !0, src: !0, nonce: !0, noModule: !0 }; function b(e, t, n) { var r, i, o = (n = n || E).createElement("script"); if (o.text = e, t) for (r in c) (i = t[r] || t.getAttribute && t.getAttribute(r)) && o.setAttribute(r, i); n.head.appendChild(o).parentNode.removeChild(o) } function w(e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? n[o.call(e)] || "object" : typeof e } var f = "3.4.1", k = function (e, t) { return new k.fn.init(e, t) }, p = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; function d(e) { var t = !!e && "length" in e && e.length, n = w(e); return !m(e) && !x(e) && ("array" === n || 0 === t || "number" == typeof t && 0 < t && t - 1 in e) } k.fn = k.prototype = { jquery: f, constructor: k, length: 0, toArray: function () { return s.call(this) }, get: function (e) { return null == e ? s.call(this) : e < 0 ? this[e + this.length] : this[e] }, pushStack: function (e) { var t = k.merge(this.constructor(), e); return t.prevObject = this, t }, each: function (e) { return k.each(this, e) }, map: function (n) { return this.pushStack(k.map(this, function (e, t) { return n.call(e, t, e) })) }, slice: function () { return this.pushStack(s.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, n = +e + (e < 0 ? t : 0); return this.pushStack(0 <= n && n < t ? [this[n]] : []) }, end: function () { return this.prevObject || this.constructor() }, push: u, sort: t.sort, splice: t.splice }, k.extend = k.fn.extend = function () { var e, t, n, r, i, o, a = arguments[0] || {}, s = 1, u = arguments.length, l = !1; for ("boolean" == typeof a && (l = a, a = arguments[s] || {}, s++), "object" == typeof a || m(a) || (a = {}), s === u && (a = this, s--); s < u; s++)if (null != (e = arguments[s])) for (t in e) r = e[t], "__proto__" !== t && a !== r && (l && r && (k.isPlainObject(r) || (i = Array.isArray(r))) ? (n = a[t], o = i && !Array.isArray(n) ? [] : i || k.isPlainObject(n) ? n : {}, i = !1, a[t] = k.extend(l, o, r)) : void 0 !== r && (a[t] = r)); return a }, k.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isPlainObject: function (e) { var t, n; return !(!e || "[object Object]" !== o.call(e)) && (!(t = r(e)) || "function" == typeof (n = v.call(t, "constructor") && t.constructor) && a.call(n) === l) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, globalEval: function (e, t) { b(e, { nonce: t && t.nonce }) }, each: function (e, t) { var n, r = 0; if (d(e)) { for (n = e.length; r < n; r++)if (!1 === t.call(e[r], r, e[r])) break } else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; return e }, trim: function (e) { return null == e ? "" : (e + "").replace(p, "") }, makeArray: function (e, t) { var n = t || []; return null != e && (d(Object(e)) ? k.merge(n, "string" == typeof e ? [e] : e) : u.call(n, e)), n }, inArray: function (e, t, n) { return null == t ? -1 : i.call(t, e, n) }, merge: function (e, t) { for (var n = +t.length, r = 0, i = e.length; r < n; r++)e[i++] = t[r]; return e.length = i, e }, grep: function (e, t, n) { for (var r = [], i = 0, o = e.length, a = !n; i < o; i++)!t(e[i], i) !== a && r.push(e[i]); return r }, map: function (e, t, n) { var r, i, o = 0, a = []; if (d(e)) for (r = e.length; o < r; o++)null != (i = t(e[o], o, n)) && a.push(i); else for (o in e) null != (i = t(e[o], o, n)) && a.push(i); return g.apply([], a) }, guid: 1, support: y }), "function" == typeof Symbol && (k.fn[Symbol.iterator] = t[Symbol.iterator]), k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (e, t) { n["[object " + t + "]"] = t.toLowerCase() }); var h = function (n) { var e, d, b, o, i, h, f, g, w, u, l, T, C, a, E, v, s, c, y, k = "sizzle" + 1 * new Date, m = n.document, S = 0, r = 0, p = ue(), x = ue(), N = ue(), A = ue(), D = function (e, t) { return e === t && (l = !0), 0 }, j = {}.hasOwnProperty, t = [], q = t.pop, L = t.push, H = t.push, O = t.slice, P = function (e, t) { for (var n = 0, r = e.length; n < r; n++)if (e[n] === t) return n; return -1 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", I = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", W = "\\[" + M + "*(" + I + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + M + "*\\]", $ = ":(" + I + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + W + ")*)|.*)\\)|)", F = new RegExp(M + "+", "g"), B = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), _ = new RegExp("^" + M + "*," + M + "*"), z = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp(M + "|>"), X = new RegExp($), V = new RegExp("^" + I + "$"), G = { ID: new RegExp("^#(" + I + ")"), CLASS: new RegExp("^\\.(" + I + ")"), TAG: new RegExp("^(" + I + "|[*])"), ATTR: new RegExp("^" + W), PSEUDO: new RegExp("^" + $), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), bool: new RegExp("^(?:" + R + ")$", "i"), needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") }, Y = /HTML$/i, Q = /^(?:input|select|textarea|button)$/i, J = /^h\d$/i, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ee = /[+~]/, te = new RegExp("\\\\([\\da-f]{1,6}" + M + "?|(" + M + ")|.)", "ig"), ne = function (e, t, n) { var r = "0x" + t - 65536; return r != r || n ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320) }, re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, ie = function (e, t) { return t ? "\0" === e ? "\ufffd" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e }, oe = function () { T() }, ae = be(function (e) { return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase() }, { dir: "parentNode", next: "legend" }); try { H.apply(t = O.call(m.childNodes), m.childNodes), t[m.childNodes.length].nodeType } catch (e) { H = { apply: t.length ? function (e, t) { L.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function se(t, e, n, r) { var i, o, a, s, u, l, c, f = e && e.ownerDocument, p = e ? e.nodeType : 9; if (n = n || [], "string" != typeof t || !t || 1 !== p && 9 !== p && 11 !== p) return n; if (!r && ((e ? e.ownerDocument || e : m) !== C && T(e), e = e || C, E)) { if (11 !== p && (u = Z.exec(t))) if (i = u[1]) { if (9 === p) { if (!(a = e.getElementById(i))) return n; if (a.id === i) return n.push(a), n } else if (f && (a = f.getElementById(i)) && y(e, a) && a.id === i) return n.push(a), n } else { if (u[2]) return H.apply(n, e.getElementsByTagName(t)), n; if ((i = u[3]) && d.getElementsByClassName && e.getElementsByClassName) return H.apply(n, e.getElementsByClassName(i)), n } if (d.qsa && !A[t + " "] && (!v || !v.test(t)) && (1 !== p || "object" !== e.nodeName.toLowerCase())) { if (c = t, f = e, 1 === p && U.test(t)) { (s = e.getAttribute("id")) ? s = s.replace(re, ie) : e.setAttribute("id", s = k), o = (l = h(t)).length; while (o--) l[o] = "#" + s + " " + xe(l[o]); c = l.join(","), f = ee.test(t) && ye(e.parentNode) || e } try { return H.apply(n, f.querySelectorAll(c)), n } catch (e) { A(t, !0) } finally { s === k && e.removeAttribute("id") } } } return g(t.replace(B, "$1"), e, n, r) } function ue() { var r = []; return function e(t, n) { return r.push(t + " ") > b.cacheLength && delete e[r.shift()], e[t + " "] = n } } function le(e) { return e[k] = !0, e } function ce(e) { var t = C.createElement("fieldset"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function fe(e, t) { var n = e.split("|"), r = n.length; while (r--) b.attrHandle[n[r]] = t } function pe(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex; if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function de(t) { return function (e) { return "input" === e.nodeName.toLowerCase() && e.type === t } } function he(n) { return function (e) { var t = e.nodeName.toLowerCase(); return ("input" === t || "button" === t) && e.type === n } } function ge(t) { return function (e) { return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ae(e) === t : e.disabled === t : "label" in e && e.disabled === t } } function ve(a) { return le(function (o) { return o = +o, le(function (e, t) { var n, r = a([], e.length, o), i = r.length; while (i--) e[n = r[i]] && (e[n] = !(t[n] = e[n])) }) }) } function ye(e) { return e && "undefined" != typeof e.getElementsByTagName && e } for (e in d = se.support = {}, i = se.isXML = function (e) { var t = e.namespaceURI, n = (e.ownerDocument || e).documentElement; return !Y.test(t || n && n.nodeName || "HTML") }, T = se.setDocument = function (e) { var t, n, r = e ? e.ownerDocument || e : m; return r !== C && 9 === r.nodeType && r.documentElement && (a = (C = r).documentElement, E = !i(C), m !== C && (n = C.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)), d.attributes = ce(function (e) { return e.className = "i", !e.getAttribute("className") }), d.getElementsByTagName = ce(function (e) { return e.appendChild(C.createComment("")), !e.getElementsByTagName("*").length }), d.getElementsByClassName = K.test(C.getElementsByClassName), d.getById = ce(function (e) { return a.appendChild(e).id = k, !C.getElementsByName || !C.getElementsByName(k).length }), d.getById ? (b.filter.ID = function (e) { var t = e.replace(te, ne); return function (e) { return e.getAttribute("id") === t } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n = t.getElementById(e); return n ? [n] : [] } }) : (b.filter.ID = function (e) { var n = e.replace(te, ne); return function (e) { var t = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id"); return t && t.value === n } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n, r, i, o = t.getElementById(e); if (o) { if ((n = o.getAttributeNode("id")) && n.value === e) return [o]; i = t.getElementsByName(e), r = 0; while (o = i[r++]) if ((n = o.getAttributeNode("id")) && n.value === e) return [o] } return [] } }), b.find.TAG = d.getElementsByTagName ? function (e, t) { return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e) : d.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, b.find.CLASS = d.getElementsByClassName && function (e, t) { if ("undefined" != typeof t.getElementsByClassName && E) return t.getElementsByClassName(e) }, s = [], v = [], (d.qsa = K.test(C.querySelectorAll)) && (ce(function (e) { a.appendChild(e).innerHTML = "<a id='" + k + "'></a><select id='" + k + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && v.push("[*^$]=" + M + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || v.push("\\[" + M + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + k + "-]").length || v.push("~="), e.querySelectorAll(":checked").length || v.push(":checked"), e.querySelectorAll("a#" + k + "+*").length || v.push(".#.+[+~]") }), ce(function (e) { e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>"; var t = C.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && v.push("name" + M + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && v.push(":enabled", ":disabled"), a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && v.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), v.push(",.*:") })), (d.matchesSelector = K.test(c = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ce(function (e) { d.disconnectedMatch = c.call(e, "*"), c.call(e, "[s!='']:x"), s.push("!=", $) }), v = v.length && new RegExp(v.join("|")), s = s.length && new RegExp(s.join("|")), t = K.test(a.compareDocumentPosition), y = t || K.test(a.contains) ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, D = t ? function (e, t) { if (e === t) return l = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !d.sortDetached && t.compareDocumentPosition(e) === n ? e === C || e.ownerDocument === m && y(m, e) ? -1 : t === C || t.ownerDocument === m && y(m, t) ? 1 : u ? P(u, e) - P(u, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return l = !0, 0; var n, r = 0, i = e.parentNode, o = t.parentNode, a = [e], s = [t]; if (!i || !o) return e === C ? -1 : t === C ? 1 : i ? -1 : o ? 1 : u ? P(u, e) - P(u, t) : 0; if (i === o) return pe(e, t); n = e; while (n = n.parentNode) a.unshift(n); n = t; while (n = n.parentNode) s.unshift(n); while (a[r] === s[r]) r++; return r ? pe(a[r], s[r]) : a[r] === m ? -1 : s[r] === m ? 1 : 0 }), C }, se.matches = function (e, t) { return se(e, null, null, t) }, se.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== C && T(e), d.matchesSelector && E && !A[t + " "] && (!s || !s.test(t)) && (!v || !v.test(t))) try { var n = c.call(e, t); if (n || d.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (e) { A(t, !0) } return 0 < se(t, C, null, [e]).length }, se.contains = function (e, t) { return (e.ownerDocument || e) !== C && T(e), y(e, t) }, se.attr = function (e, t) { (e.ownerDocument || e) !== C && T(e); var n = b.attrHandle[t.toLowerCase()], r = n && j.call(b.attrHandle, t.toLowerCase()) ? n(e, t, !E) : void 0; return void 0 !== r ? r : d.attributes || !E ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, se.escape = function (e) { return (e + "").replace(re, ie) }, se.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, se.uniqueSort = function (e) { var t, n = [], r = 0, i = 0; if (l = !d.detectDuplicates, u = !d.sortStable && e.slice(0), e.sort(D), l) { while (t = e[i++]) t === e[i] && (r = n.push(i)); while (r--) e.splice(n[r], 1) } return u = null, e }, o = se.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling)n += o(e) } else if (3 === i || 4 === i) return e.nodeValue } else while (t = e[r++]) n += o(t); return n }, (b = se.selectors = { cacheLength: 50, createPseudo: le, match: G, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && se.error(e[0]), e }, PSEUDO: function (e) { var t, n = !e[6] && e[2]; return G.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && X.test(n) && (t = h(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(te, ne).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = p[e + " "]; return t || (t = new RegExp("(^|" + M + ")" + e + "(" + M + "|$)")) && p(e, function (e) { return t.test("string" == typeof e.className && e.className || "undefined" != typeof e.getAttribute && e.getAttribute("class") || "") }) }, ATTR: function (n, r, i) { return function (e) { var t = se.attr(e, n); return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(F, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-")) } }, CHILD: function (h, e, t, g, v) { var y = "nth" !== h.slice(0, 3), m = "last" !== h.slice(-4), x = "of-type" === e; return 1 === g && 0 === v ? function (e) { return !!e.parentNode } : function (e, t, n) { var r, i, o, a, s, u, l = y !== m ? "nextSibling" : "previousSibling", c = e.parentNode, f = x && e.nodeName.toLowerCase(), p = !n && !x, d = !1; if (c) { if (y) { while (l) { a = e; while (a = a[l]) if (x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) return !1; u = l = "only" === h && !u && "nextSibling" } return !0 } if (u = [m ? c.firstChild : c.lastChild], m && p) { d = (s = (r = (i = (o = (a = c)[k] || (a[k] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === S && r[1]) && r[2], a = s && c.childNodes[s]; while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if (1 === a.nodeType && ++d && a === e) { i[h] = [S, s, d]; break } } else if (p && (d = s = (r = (i = (o = (a = e)[k] || (a[k] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === S && r[1]), !1 === d) while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if ((x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) && ++d && (p && ((i = (o = a[k] || (a[k] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] = [S, d]), a === e)) break; return (d -= v) === g || d % g == 0 && 0 <= d / g } } }, PSEUDO: function (e, o) { var t, a = b.pseudos[e] || b.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e); return a[k] ? a(o) : 1 < a.length ? (t = [e, e, "", o], b.setFilters.hasOwnProperty(e.toLowerCase()) ? le(function (e, t) { var n, r = a(e, o), i = r.length; while (i--) e[n = P(e, r[i])] = !(t[n] = r[i]) }) : function (e) { return a(e, 0, t) }) : a } }, pseudos: { not: le(function (e) { var r = [], i = [], s = f(e.replace(B, "$1")); return s[k] ? le(function (e, t, n, r) { var i, o = s(e, null, r, []), a = e.length; while (a--) (i = o[a]) && (e[a] = !(t[a] = i)) }) : function (e, t, n) { return r[0] = e, s(r, null, n, i), r[0] = null, !i.pop() } }), has: le(function (t) { return function (e) { return 0 < se(t, e).length } }), contains: le(function (t) { return t = t.replace(te, ne), function (e) { return -1 < (e.textContent || o(e)).indexOf(t) } }), lang: le(function (n) { return V.test(n || "") || se.error("unsupported lang: " + n), n = n.replace(te, ne).toLowerCase(), function (e) { var t; do { if (t = E ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (t = t.toLowerCase()) === n || 0 === t.indexOf(n + "-") } while ((e = e.parentNode) && 1 === e.nodeType); return !1 } }), target: function (e) { var t = n.location && n.location.hash; return t && t.slice(1) === e.id }, root: function (e) { return e === a }, focus: function (e) { return e === C.activeElement && (!C.hasFocus || C.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: ge(!1), disabled: ge(!0), checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling)if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !b.pseudos.empty(e) }, header: function (e) { return J.test(e.nodeName) }, input: function (e) { return Q.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: ve(function () { return [0] }), last: ve(function (e, t) { return [t - 1] }), eq: ve(function (e, t, n) { return [n < 0 ? n + t : n] }), even: ve(function (e, t) { for (var n = 0; n < t; n += 2)e.push(n); return e }), odd: ve(function (e, t) { for (var n = 1; n < t; n += 2)e.push(n); return e }), lt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r;)e.push(r); return e }), gt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : n; ++r < t;)e.push(r); return e }) } }).pseudos.nth = b.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) b.pseudos[e] = de(e); for (e in { submit: !0, reset: !0 }) b.pseudos[e] = he(e); function me() { } function xe(e) { for (var t = 0, n = e.length, r = ""; t < n; t++)r += e[t].value; return r } function be(s, e, t) { var u = e.dir, l = e.next, c = l || u, f = t && "parentNode" === c, p = r++; return e.first ? function (e, t, n) { while (e = e[u]) if (1 === e.nodeType || f) return s(e, t, n); return !1 } : function (e, t, n) { var r, i, o, a = [S, p]; if (n) { while (e = e[u]) if ((1 === e.nodeType || f) && s(e, t, n)) return !0 } else while (e = e[u]) if (1 === e.nodeType || f) if (i = (o = e[k] || (e[k] = {}))[e.uniqueID] || (o[e.uniqueID] = {}), l && l === e.nodeName.toLowerCase()) e = e[u] || e; else { if ((r = i[c]) && r[0] === S && r[1] === p) return a[2] = r[2]; if ((i[c] = a)[2] = s(e, t, n)) return !0 } return !1 } } function we(i) { return 1 < i.length ? function (e, t, n) { var r = i.length; while (r--) if (!i[r](e, t, n)) return !1; return !0 } : i[0] } function Te(e, t, n, r, i) { for (var o, a = [], s = 0, u = e.length, l = null != t; s < u; s++)(o = e[s]) && (n && !n(o, r, i) || (a.push(o), l && t.push(s))); return a } function Ce(d, h, g, v, y, e) { return v && !v[k] && (v = Ce(v)), y && !y[k] && (y = Ce(y, e)), le(function (e, t, n, r) { var i, o, a, s = [], u = [], l = t.length, c = e || function (e, t, n) { for (var r = 0, i = t.length; r < i; r++)se(e, t[r], n); return n }(h || "*", n.nodeType ? [n] : n, []), f = !d || !e && h ? c : Te(c, s, d, n, r), p = g ? y || (e ? d : l || v) ? [] : t : f; if (g && g(f, p, n, r), v) { i = Te(p, u), v(i, [], n, r), o = i.length; while (o--) (a = i[o]) && (p[u[o]] = !(f[u[o]] = a)) } if (e) { if (y || d) { if (y) { i = [], o = p.length; while (o--) (a = p[o]) && i.push(f[o] = a); y(null, p = [], i, r) } o = p.length; while (o--) (a = p[o]) && -1 < (i = y ? P(e, a) : s[o]) && (e[i] = !(t[i] = a)) } } else p = Te(p === t ? p.splice(l, p.length) : p), y ? y(null, t, p, r) : H.apply(t, p) }) } function Ee(e) { for (var i, t, n, r = e.length, o = b.relative[e[0].type], a = o || b.relative[" "], s = o ? 1 : 0, u = be(function (e) { return e === i }, a, !0), l = be(function (e) { return -1 < P(i, e) }, a, !0), c = [function (e, t, n) { var r = !o && (n || t !== w) || ((i = t).nodeType ? u(e, t, n) : l(e, t, n)); return i = null, r }]; s < r; s++)if (t = b.relative[e[s].type]) c = [be(we(c), t)]; else { if ((t = b.filter[e[s].type].apply(null, e[s].matches))[k]) { for (n = ++s; n < r; n++)if (b.relative[e[n].type]) break; return Ce(1 < s && we(c), 1 < s && xe(e.slice(0, s - 1).concat({ value: " " === e[s - 2].type ? "*" : "" })).replace(B, "$1"), t, s < n && Ee(e.slice(s, n)), n < r && Ee(e = e.slice(n)), n < r && xe(e)) } c.push(t) } return we(c) } return me.prototype = b.filters = b.pseudos, b.setFilters = new me, h = se.tokenize = function (e, t) { var n, r, i, o, a, s, u, l = x[e + " "]; if (l) return t ? 0 : l.slice(0); a = e, s = [], u = b.preFilter; while (a) { for (o in n && !(r = _.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), n = !1, (r = z.exec(a)) && (n = r.shift(), i.push({ value: n, type: r[0].replace(B, " ") }), a = a.slice(n.length)), b.filter) !(r = G[o].exec(a)) || u[o] && !(r = u[o](r)) || (n = r.shift(), i.push({ value: n, type: o, matches: r }), a = a.slice(n.length)); if (!n) break } return t ? a.length : a ? se.error(e) : x(e, s).slice(0) }, f = se.compile = function (e, t) { var n, v, y, m, x, r, i = [], o = [], a = N[e + " "]; if (!a) { t || (t = h(e)), n = t.length; while (n--) (a = Ee(t[n]))[k] ? i.push(a) : o.push(a); (a = N(e, (v = o, m = 0 < (y = i).length, x = 0 < v.length, r = function (e, t, n, r, i) { var o, a, s, u = 0, l = "0", c = e && [], f = [], p = w, d = e || x && b.find.TAG("*", i), h = S += null == p ? 1 : Math.random() || .1, g = d.length; for (i && (w = t === C || t || i); l !== g && null != (o = d[l]); l++) { if (x && o) { a = 0, t || o.ownerDocument === C || (T(o), n = !E); while (s = v[a++]) if (s(o, t || C, n)) { r.push(o); break } i && (S = h) } m && ((o = !s && o) && u-- , e && c.push(o)) } if (u += l, m && l !== u) { a = 0; while (s = y[a++]) s(c, f, t, n); if (e) { if (0 < u) while (l--) c[l] || f[l] || (f[l] = q.call(r)); f = Te(f) } H.apply(r, f), i && !e && 0 < f.length && 1 < u + y.length && se.uniqueSort(r) } return i && (S = h, w = p), c }, m ? le(r) : r))).selector = e } return a }, g = se.select = function (e, t, n, r) { var i, o, a, s, u, l = "function" == typeof e && e, c = !r && h(e = l.selector || e); if (n = n || [], 1 === c.length) { if (2 < (o = c[0] = c[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && E && b.relative[o[1].type]) { if (!(t = (b.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n; l && (t = t.parentNode), e = e.slice(o.shift().value.length) } i = G.needsContext.test(e) ? 0 : o.length; while (i--) { if (a = o[i], b.relative[s = a.type]) break; if ((u = b.find[s]) && (r = u(a.matches[0].replace(te, ne), ee.test(o[0].type) && ye(t.parentNode) || t))) { if (o.splice(i, 1), !(e = r.length && xe(o))) return H.apply(n, r), n; break } } } return (l || f(e, c))(r, t, !E, n, !t || ee.test(e) && ye(t.parentNode) || t), n }, d.sortStable = k.split("").sort(D).join("") === k, d.detectDuplicates = !!l, T(), d.sortDetached = ce(function (e) { return 1 & e.compareDocumentPosition(C.createElement("fieldset")) }), ce(function (e) { return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href") }) || fe("type|href|height|width", function (e, t, n) { if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) }), d.attributes && ce(function (e) { return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || fe("value", function (e, t, n) { if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue }), ce(function (e) { return null == e.getAttribute("disabled") }) || fe(R, function (e, t, n) { var r; if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }), se }(C); k.find = h, k.expr = h.selectors, k.expr[":"] = k.expr.pseudos, k.uniqueSort = k.unique = h.uniqueSort, k.text = h.getText, k.isXMLDoc = h.isXML, k.contains = h.contains, k.escapeSelector = h.escape; var T = function (e, t, n) { var r = [], i = void 0 !== n; while ((e = e[t]) && 9 !== e.nodeType) if (1 === e.nodeType) { if (i && k(e).is(n)) break; r.push(e) } return r }, S = function (e, t) { for (var n = []; e; e = e.nextSibling)1 === e.nodeType && e !== t && n.push(e); return n }, N = k.expr.match.needsContext; function A(e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() } var D = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; function j(e, n, r) { return m(n) ? k.grep(e, function (e, t) { return !!n.call(e, t, e) !== r }) : n.nodeType ? k.grep(e, function (e) { return e === n !== r }) : "string" != typeof n ? k.grep(e, function (e) { return -1 < i.call(n, e) !== r }) : k.filter(n, e, r) } k.filter = function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? k.find.matchesSelector(r, e) ? [r] : [] : k.find.matches(e, k.grep(t, function (e) { return 1 === e.nodeType })) }, k.fn.extend({ find: function (e) { var t, n, r = this.length, i = this; if ("string" != typeof e) return this.pushStack(k(e).filter(function () { for (t = 0; t < r; t++)if (k.contains(i[t], this)) return !0 })); for (n = this.pushStack([]), t = 0; t < r; t++)k.find(e, i[t], n); return 1 < r ? k.uniqueSort(n) : n }, filter: function (e) { return this.pushStack(j(this, e || [], !1)) }, not: function (e) { return this.pushStack(j(this, e || [], !0)) }, is: function (e) { return !!j(this, "string" == typeof e && N.test(e) ? k(e) : e || [], !1).length } }); var q, L = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/; (k.fn.init = function (e, t, n) { var r, i; if (!e) return this; if (n = n || q, "string" == typeof e) { if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : L.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e); if (r[1]) { if (t = t instanceof k ? t[0] : t, k.merge(this, k.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : E, !0)), D.test(r[1]) && k.isPlainObject(t)) for (r in t) m(this[r]) ? this[r](t[r]) : this.attr(r, t[r]); return this } return (i = E.getElementById(r[2])) && (this[0] = i, this.length = 1), this } return e.nodeType ? (this[0] = e, this.length = 1, this) : m(e) ? void 0 !== n.ready ? n.ready(e) : e(k) : k.makeArray(e, this) }).prototype = k.fn, q = k(E); var H = /^(?:parents|prev(?:Until|All))/, O = { children: !0, contents: !0, next: !0, prev: !0 }; function P(e, t) { while ((e = e[t]) && 1 !== e.nodeType); return e } k.fn.extend({ has: function (e) { var t = k(e, this), n = t.length; return this.filter(function () { for (var e = 0; e < n; e++)if (k.contains(this, t[e])) return !0 }) }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = "string" != typeof e && k(e); if (!N.test(e)) for (; r < i; r++)for (n = this[r]; n && n !== t; n = n.parentNode)if (n.nodeType < 11 && (a ? -1 < a.index(n) : 1 === n.nodeType && k.find.matchesSelector(n, e))) { o.push(n); break } return this.pushStack(1 < o.length ? k.uniqueSort(o) : o) }, index: function (e) { return e ? "string" == typeof e ? i.call(k(e), this[0]) : i.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(k.uniqueSort(k.merge(this.get(), k(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), k.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return T(e, "parentNode") }, parentsUntil: function (e, t, n) { return T(e, "parentNode", n) }, next: function (e) { return P(e, "nextSibling") }, prev: function (e) { return P(e, "previousSibling") }, nextAll: function (e) { return T(e, "nextSibling") }, prevAll: function (e) { return T(e, "previousSibling") }, nextUntil: function (e, t, n) { return T(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return T(e, "previousSibling", n) }, siblings: function (e) { return S((e.parentNode || {}).firstChild, e) }, children: function (e) { return S(e.firstChild) }, contents: function (e) { return "undefined" != typeof e.contentDocument ? e.contentDocument : (A(e, "template") && (e = e.content || e), k.merge([], e.childNodes)) } }, function (r, i) { k.fn[r] = function (e, t) { var n = k.map(this, i, e); return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = k.filter(t, n)), 1 < this.length && (O[r] || k.uniqueSort(n), H.test(r) && n.reverse()), this.pushStack(n) } }); var R = /[^\x20\t\r\n\f]+/g; function M(e) { return e } function I(e) { throw e } function W(e, t, n, r) { var i; try { e && m(i = e.promise) ? i.call(e).done(t).fail(n) : e && m(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [e].slice(r)) } catch (e) { n.apply(void 0, [e]) } } k.Callbacks = function (r) { var e, n; r = "string" == typeof r ? (e = r, n = {}, k.each(e.match(R) || [], function (e, t) { n[t] = !0 }), n) : k.extend({}, r); var i, t, o, a, s = [], u = [], l = -1, c = function () { for (a = a || r.once, o = i = !0; u.length; l = -1) { t = u.shift(); while (++l < s.length) !1 === s[l].apply(t[0], t[1]) && r.stopOnFalse && (l = s.length, t = !1) } r.memory || (t = !1), i = !1, a && (s = t ? [] : "") }, f = { add: function () { return s && (t && !i && (l = s.length - 1, u.push(t)), function n(e) { k.each(e, function (e, t) { m(t) ? r.unique && f.has(t) || s.push(t) : t && t.length && "string" !== w(t) && n(t) }) }(arguments), t && !i && c()), this }, remove: function () { return k.each(arguments, function (e, t) { var n; while (-1 < (n = k.inArray(t, s, n))) s.splice(n, 1), n <= l && l-- }), this }, has: function (e) { return e ? -1 < k.inArray(e, s) : 0 < s.length }, empty: function () { return s && (s = []), this }, disable: function () { return a = u = [], s = t = "", this }, disabled: function () { return !s }, lock: function () { return a = u = [], t || i || (s = t = ""), this }, locked: function () { return !!a }, fireWith: function (e, t) { return a || (t = [e, (t = t || []).slice ? t.slice() : t], u.push(t), i || c()), this }, fire: function () { return f.fireWith(this, arguments), this }, fired: function () { return !!o } }; return f }, k.extend({ Deferred: function (e) { var o = [["notify", "progress", k.Callbacks("memory"), k.Callbacks("memory"), 2], ["resolve", "done", k.Callbacks("once memory"), k.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", k.Callbacks("once memory"), k.Callbacks("once memory"), 1, "rejected"]], i = "pending", a = { state: function () { return i }, always: function () { return s.done(arguments).fail(arguments), this }, "catch": function (e) { return a.then(null, e) }, pipe: function () { var i = arguments; return k.Deferred(function (r) { k.each(o, function (e, t) { var n = m(i[t[4]]) && i[t[4]]; s[t[1]](function () { var e = n && n.apply(this, arguments); e && m(e.promise) ? e.promise().progress(r.notify).done(r.resolve).fail(r.reject) : r[t[0] + "With"](this, n ? [e] : arguments) }) }), i = null }).promise() }, then: function (t, n, r) { var u = 0; function l(i, o, a, s) { return function () { var n = this, r = arguments, e = function () { var e, t; if (!(i < u)) { if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self-resolution"); t = e && ("object" == typeof e || "function" == typeof e) && e.then, m(t) ? s ? t.call(e, l(u, o, M, s), l(u, o, I, s)) : (u++ , t.call(e, l(u, o, M, s), l(u, o, I, s), l(u, o, M, o.notifyWith))) : (a !== M && (n = void 0, r = [e]), (s || o.resolveWith)(n, r)) } }, t = s ? e : function () { try { e() } catch (e) { k.Deferred.exceptionHook && k.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== I && (n = void 0, r = [e]), o.rejectWith(n, r)) } }; i ? t() : (k.Deferred.getStackHook && (t.stackTrace = k.Deferred.getStackHook()), C.setTimeout(t)) } } return k.Deferred(function (e) { o[0][3].add(l(0, e, m(r) ? r : M, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : M)), o[2][3].add(l(0, e, m(n) ? n : I)) }).promise() }, promise: function (e) { return null != e ? k.extend(e, a) : a } }, s = {}; return k.each(o, function (e, t) { var n = t[2], r = t[5]; a[t[1]] = n.add, r && n.add(function () { i = r }, o[3 - e][2].disable, o[3 - e][3].disable, o[0][2].lock, o[0][3].lock), n.add(t[3].fire), s[t[0]] = function () { return s[t[0] + "With"](this === s ? void 0 : this, arguments), this }, s[t[0] + "With"] = n.fireWith }), a.promise(s), e && e.call(s, s), s }, when: function (e) { var n = arguments.length, t = n, r = Array(t), i = s.call(arguments), o = k.Deferred(), a = function (t) { return function (e) { r[t] = this, i[t] = 1 < arguments.length ? s.call(arguments) : e, --n || o.resolveWith(r, i) } }; if (n <= 1 && (W(e, o.done(a(t)).resolve, o.reject, !n), "pending" === o.state() || m(i[t] && i[t].then))) return o.then(); while (t--) W(i[t], a(t), o.reject); return o.promise() } }); var $ = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; k.Deferred.exceptionHook = function (e, t) { C.console && C.console.warn && e && $.test(e.name) && C.console.warn("jQuery.Deferred exception: " + e.message, e.stack, t) }, k.readyException = function (e) { C.setTimeout(function () { throw e }) }; var F = k.Deferred(); function B() { E.removeEventListener("DOMContentLoaded", B), C.removeEventListener("load", B), k.ready() } k.fn.ready = function (e) { return F.then(e)["catch"](function (e) { k.readyException(e) }), this }, k.extend({ isReady: !1, readyWait: 1, ready: function (e) { (!0 === e ? --k.readyWait : k.isReady) || (k.isReady = !0) !== e && 0 < --k.readyWait || F.resolveWith(E, [k]) } }), k.ready.then = F.then, "complete" === E.readyState || "loading" !== E.readyState && !E.documentElement.doScroll ? C.setTimeout(k.ready) : (E.addEventListener("DOMContentLoaded", B), C.addEventListener("load", B)); var _ = function (e, t, n, r, i, o, a) { var s = 0, u = e.length, l = null == n; if ("object" === w(n)) for (s in i = !0, n) _(e, t, s, n[s], !0, o, a); else if (void 0 !== r && (i = !0, m(r) || (a = !0), l && (a ? (t.call(e, r), t = null) : (l = t, t = function (e, t, n) { return l.call(k(e), n) })), t)) for (; s < u; s++)t(e[s], n, a ? r : r.call(e[s], s, t(e[s], n))); return i ? e : l ? t.call(e) : u ? t(e[0], n) : o }, z = /^-ms-/, U = /-([a-z])/g; function X(e, t) { return t.toUpperCase() } function V(e) { return e.replace(z, "ms-").replace(U, X) } var G = function (e) { return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType }; function Y() { this.expando = k.expando + Y.uid++ } Y.uid = 1, Y.prototype = { cache: function (e) { var t = e[this.expando]; return t || (t = {}, G(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, { value: t, configurable: !0 }))), t }, set: function (e, t, n) { var r, i = this.cache(e); if ("string" == typeof t) i[V(t)] = n; else for (r in t) i[V(r)] = t[r]; return i }, get: function (e, t) { return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][V(t)] }, access: function (e, t, n) { return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t) }, remove: function (e, t) { var n, r = e[this.expando]; if (void 0 !== r) { if (void 0 !== t) { n = (t = Array.isArray(t) ? t.map(V) : (t = V(t)) in r ? [t] : t.match(R) || []).length; while (n--) delete r[t[n]] } (void 0 === t || k.isEmptyObject(r)) && (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando]) } }, hasData: function (e) { var t = e[this.expando]; return void 0 !== t && !k.isEmptyObject(t) } }; var Q = new Y, J = new Y, K = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, Z = /[A-Z]/g; function ee(e, t, n) { var r, i; if (void 0 === n && 1 === e.nodeType) if (r = "data-" + t.replace(Z, "-$&").toLowerCase(), "string" == typeof (n = e.getAttribute(r))) { try { n = "true" === (i = n) || "false" !== i && ("null" === i ? null : i === +i + "" ? +i : K.test(i) ? JSON.parse(i) : i) } catch (e) { } J.set(e, t, n) } else n = void 0; return n } k.extend({ hasData: function (e) { return J.hasData(e) || Q.hasData(e) }, data: function (e, t, n) { return J.access(e, t, n) }, removeData: function (e, t) { J.remove(e, t) }, _data: function (e, t, n) { return Q.access(e, t, n) }, _removeData: function (e, t) { Q.remove(e, t) } }), k.fn.extend({ data: function (n, e) { var t, r, i, o = this[0], a = o && o.attributes; if (void 0 === n) { if (this.length && (i = J.get(o), 1 === o.nodeType && !Q.get(o, "hasDataAttrs"))) { t = a.length; while (t--) a[t] && 0 === (r = a[t].name).indexOf("data-") && (r = V(r.slice(5)), ee(o, r, i[r])); Q.set(o, "hasDataAttrs", !0) } return i } return "object" == typeof n ? this.each(function () { J.set(this, n) }) : _(this, function (e) { var t; if (o && void 0 === e) return void 0 !== (t = J.get(o, n)) ? t : void 0 !== (t = ee(o, n)) ? t : void 0; this.each(function () { J.set(this, n, e) }) }, null, e, 1 < arguments.length, null, !0) }, removeData: function (e) { return this.each(function () { J.remove(this, e) }) } }), k.extend({ queue: function (e, t, n) { var r; if (e) return t = (t || "fx") + "queue", r = Q.get(e, t), n && (!r || Array.isArray(n) ? r = Q.access(e, t, k.makeArray(n)) : r.push(n)), r || [] }, dequeue: function (e, t) { t = t || "fx"; var n = k.queue(e, t), r = n.length, i = n.shift(), o = k._queueHooks(e, t); "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, function () { k.dequeue(e, t) }, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return Q.get(e, n) || Q.access(e, n, { empty: k.Callbacks("once memory").add(function () { Q.remove(e, [t + "queue", n]) }) }) } }), k.fn.extend({ queue: function (t, n) { var e = 2; return "string" != typeof t && (n = t, t = "fx", e--), arguments.length < e ? k.queue(this[0], t) : void 0 === n ? this : this.each(function () { var e = k.queue(this, t, n); k._queueHooks(this, t), "fx" === t && "inprogress" !== e[0] && k.dequeue(this, t) }) }, dequeue: function (e) { return this.each(function () { k.dequeue(this, e) }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var n, r = 1, i = k.Deferred(), o = this, a = this.length, s = function () { --r || i.resolveWith(o, [o]) }; "string" != typeof e && (t = e, e = void 0), e = e || "fx"; while (a--) (n = Q.get(o[a], e + "queueHooks")) && n.empty && (r++ , n.empty.add(s)); return s(), i.promise(t) } }); var te = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, ne = new RegExp("^(?:([+-])=|)(" + te + ")([a-z%]*)$", "i"), re = ["Top", "Right", "Bottom", "Left"], ie = E.documentElement, oe = function (e) { return k.contains(e.ownerDocument, e) }, ae = { composed: !0 }; ie.getRootNode && (oe = function (e) { return k.contains(e.ownerDocument, e) || e.getRootNode(ae) === e.ownerDocument }); var se = function (e, t) { return "none" === (e = t || e).style.display || "" === e.style.display && oe(e) && "none" === k.css(e, "display") }, ue = function (e, t, n, r) { var i, o, a = {}; for (o in t) a[o] = e.style[o], e.style[o] = t[o]; for (o in i = n.apply(e, r || []), t) e.style[o] = a[o]; return i }; function le(e, t, n, r) { var i, o, a = 20, s = r ? function () { return r.cur() } : function () { return k.css(e, t, "") }, u = s(), l = n && n[3] || (k.cssNumber[t] ? "" : "px"), c = e.nodeType && (k.cssNumber[t] || "px" !== l && +u) && ne.exec(k.css(e, t)); if (c && c[3] !== l) { u /= 2, l = l || c[3], c = +u || 1; while (a--) k.style(e, t, c + l), (1 - o) * (1 - (o = s() / u || .5)) <= 0 && (a = 0), c /= o; c *= 2, k.style(e, t, c + l), n = n || [] } return n && (c = +c || +u || 0, i = n[1] ? c + (n[1] + 1) * n[2] : +n[2], r && (r.unit = l, r.start = c, r.end = i)), i } var ce = {}; function fe(e, t) { for (var n, r, i, o, a, s, u, l = [], c = 0, f = e.length; c < f; c++)(r = e[c]).style && (n = r.style.display, t ? ("none" === n && (l[c] = Q.get(r, "display") || null, l[c] || (r.style.display = "")), "" === r.style.display && se(r) && (l[c] = (u = a = o = void 0, a = (i = r).ownerDocument, s = i.nodeName, (u = ce[s]) || (o = a.body.appendChild(a.createElement(s)), u = k.css(o, "display"), o.parentNode.removeChild(o), "none" === u && (u = "block"), ce[s] = u)))) : "none" !== n && (l[c] = "none", Q.set(r, "display", n))); for (c = 0; c < f; c++)null != l[c] && (e[c].style.display = l[c]); return e } k.fn.extend({ show: function () { return fe(this, !0) }, hide: function () { return fe(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { se(this) ? k(this).show() : k(this).hide() }) } }); var pe = /^(?:checkbox|radio)$/i, de = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, he = /^$|^module$|\/(?:java|ecma)script/i, ge = { option: [1, "<select multiple='multiple'>", "</select>"], thead: [1, "<table>", "</table>"], col: [2, "<table><colgroup>", "</colgroup></table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: [0, "", ""] }; function ve(e, t) { var n; return n = "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName(t || "*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && A(e, t) ? k.merge([e], n) : n } function ye(e, t) { for (var n = 0, r = e.length; n < r; n++)Q.set(e[n], "globalEval", !t || Q.get(t[n], "globalEval")) } ge.optgroup = ge.option, ge.tbody = ge.tfoot = ge.colgroup = ge.caption = ge.thead, ge.th = ge.td; var me, xe, be = /<|&#?\w+;/; function we(e, t, n, r, i) { for (var o, a, s, u, l, c, f = t.createDocumentFragment(), p = [], d = 0, h = e.length; d < h; d++)if ((o = e[d]) || 0 === o) if ("object" === w(o)) k.merge(p, o.nodeType ? [o] : o); else if (be.test(o)) { a = a || f.appendChild(t.createElement("div")), s = (de.exec(o) || ["", ""])[1].toLowerCase(), u = ge[s] || ge._default, a.innerHTML = u[1] + k.htmlPrefilter(o) + u[2], c = u[0]; while (c--) a = a.lastChild; k.merge(p, a.childNodes), (a = f.firstChild).textContent = "" } else p.push(t.createTextNode(o)); f.textContent = "", d = 0; while (o = p[d++]) if (r && -1 < k.inArray(o, r)) i && i.push(o); else if (l = oe(o), a = ve(f.appendChild(o), "script"), l && ye(a), n) { c = 0; while (o = a[c++]) he.test(o.type || "") && n.push(o) } return f } me = E.createDocumentFragment().appendChild(E.createElement("div")), (xe = E.createElement("input")).setAttribute("type", "radio"), xe.setAttribute("checked", "checked"), xe.setAttribute("name", "t"), me.appendChild(xe), y.checkClone = me.cloneNode(!0).cloneNode(!0).lastChild.checked, me.innerHTML = "<textarea>x</textarea>", y.noCloneChecked = !!me.cloneNode(!0).lastChild.defaultValue; var Te = /^key/, Ce = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, Ee = /^([^.]*)(?:\.(.+)|)/; function ke() { return !0 } function Se() { return !1 } function Ne(e, t) { return e === function () { try { return E.activeElement } catch (e) { } }() == ("focus" === t) } function Ae(e, t, n, r, i, o) { var a, s; if ("object" == typeof t) { for (s in "string" != typeof n && (r = r || n, n = void 0), t) Ae(e, s, n, r, t[s], o); return e } if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = Se; else if (!i) return e; return 1 === o && (a = i, (i = function (e) { return k().off(e), a.apply(this, arguments) }).guid = a.guid || (a.guid = k.guid++)), e.each(function () { k.event.add(this, t, i, r, n) }) } function De(e, i, o) { o ? (Q.set(e, i, !1), k.event.add(e, i, { namespace: !1, handler: function (e) { var t, n, r = Q.get(this, i); if (1 & e.isTrigger && this[i]) { if (r.length) (k.event.special[i] || {}).delegateType && e.stopPropagation(); else if (r = s.call(arguments), Q.set(this, i, r), t = o(this, i), this[i](), r !== (n = Q.get(this, i)) || t ? Q.set(this, i, !1) : n = {}, r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n.value } else r.length && (Q.set(this, i, { value: k.event.trigger(k.extend(r[0], k.Event.prototype), r.slice(1), this) }), e.stopImmediatePropagation()) } })) : void 0 === Q.get(e, i) && k.event.add(e, i, ke) } k.event = { global: {}, add: function (t, e, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Q.get(t); if (v) { n.handler && (n = (o = n).handler, i = o.selector), i && k.find.matchesSelector(ie, i), n.guid || (n.guid = k.guid++), (u = v.events) || (u = v.events = {}), (a = v.handle) || (a = v.handle = function (e) { return "undefined" != typeof k && k.event.triggered !== e.type ? k.event.dispatch.apply(t, arguments) : void 0 }), l = (e = (e || "").match(R) || [""]).length; while (l--) d = g = (s = Ee.exec(e[l]) || [])[1], h = (s[2] || "").split(".").sort(), d && (f = k.event.special[d] || {}, d = (i ? f.delegateType : f.bindType) || d, f = k.event.special[d] || {}, c = k.extend({ type: d, origType: g, data: r, handler: n, guid: n.guid, selector: i, needsContext: i && k.expr.match.needsContext.test(i), namespace: h.join(".") }, o), (p = u[d]) || ((p = u[d] = []).delegateCount = 0, f.setup && !1 !== f.setup.call(t, r, h, a) || t.addEventListener && t.addEventListener(d, a)), f.add && (f.add.call(t, c), c.handler.guid || (c.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, c) : p.push(c), k.event.global[d] = !0) } }, remove: function (e, t, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Q.hasData(e) && Q.get(e); if (v && (u = v.events)) { l = (t = (t || "").match(R) || [""]).length; while (l--) if (d = g = (s = Ee.exec(t[l]) || [])[1], h = (s[2] || "").split(".").sort(), d) { f = k.event.special[d] || {}, p = u[d = (r ? f.delegateType : f.bindType) || d] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = p.length; while (o--) c = p[o], !i && g !== c.origType || n && n.guid !== c.guid || s && !s.test(c.namespace) || r && r !== c.selector && ("**" !== r || !c.selector) || (p.splice(o, 1), c.selector && p.delegateCount-- , f.remove && f.remove.call(e, c)); a && !p.length && (f.teardown && !1 !== f.teardown.call(e, h, v.handle) || k.removeEvent(e, d, v.handle), delete u[d]) } else for (d in u) k.event.remove(e, d + t[l], n, r, !0); k.isEmptyObject(u) && Q.remove(e, "handle events") } }, dispatch: function (e) { var t, n, r, i, o, a, s = k.event.fix(e), u = new Array(arguments.length), l = (Q.get(this, "events") || {})[s.type] || [], c = k.event.special[s.type] || {}; for (u[0] = s, t = 1; t < arguments.length; t++)u[t] = arguments[t]; if (s.delegateTarget = this, !c.preDispatch || !1 !== c.preDispatch.call(this, s)) { a = k.event.handlers.call(this, s, l), t = 0; while ((i = a[t++]) && !s.isPropagationStopped()) { s.currentTarget = i.elem, n = 0; while ((o = i.handlers[n++]) && !s.isImmediatePropagationStopped()) s.rnamespace && !1 !== o.namespace && !s.rnamespace.test(o.namespace) || (s.handleObj = o, s.data = o.data, void 0 !== (r = ((k.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, u)) && !1 === (s.result = r) && (s.preventDefault(), s.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, s), s.result } }, handlers: function (e, t) { var n, r, i, o, a, s = [], u = t.delegateCount, l = e.target; if (u && l.nodeType && !("click" === e.type && 1 <= e.button)) for (; l !== this; l = l.parentNode || this)if (1 === l.nodeType && ("click" !== e.type || !0 !== l.disabled)) { for (o = [], a = {}, n = 0; n < u; n++)void 0 === a[i = (r = t[n]).selector + " "] && (a[i] = r.needsContext ? -1 < k(i, this).index(l) : k.find(i, this, null, [l]).length), a[i] && o.push(r); o.length && s.push({ elem: l, handlers: o }) } return l = this, u < t.length && s.push({ elem: l, handlers: t.slice(u) }), s }, addProp: function (t, e) { Object.defineProperty(k.Event.prototype, t, { enumerable: !0, configurable: !0, get: m(e) ? function () { if (this.originalEvent) return e(this.originalEvent) } : function () { if (this.originalEvent) return this.originalEvent[t] }, set: function (e) { Object.defineProperty(this, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) } }) }, fix: function (e) { return e[k.expando] ? e : new k.Event(e) }, special: { load: { noBubble: !0 }, click: { setup: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && De(t, "click", ke), !1 }, trigger: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && De(t, "click"), !0 }, _default: function (e) { var t = e.target; return pe.test(t.type) && t.click && A(t, "input") && Q.get(t, "click") || A(t, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } } }, k.removeEvent = function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n) }, k.Event = function (e, t) { if (!(this instanceof k.Event)) return new k.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? ke : Se, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && k.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[k.expando] = !0 }, k.Event.prototype = { constructor: k.Event, isDefaultPrevented: Se, isPropagationStopped: Se, isImmediatePropagationStopped: Se, isSimulated: !1, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = ke, e && !this.isSimulated && e.preventDefault() }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = ke, e && !this.isSimulated && e.stopPropagation() }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = ke, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation() } }, k.each({ altKey: !0, bubbles: !0, cancelable: !0, changedTouches: !0, ctrlKey: !0, detail: !0, eventPhase: !0, metaKey: !0, pageX: !0, pageY: !0, shiftKey: !0, view: !0, "char": !0, code: !0, charCode: !0, key: !0, keyCode: !0, button: !0, buttons: !0, clientX: !0, clientY: !0, offsetX: !0, offsetY: !0, pointerId: !0, pointerType: !0, screenX: !0, screenY: !0, targetTouches: !0, toElement: !0, touches: !0, which: function (e) { var t = e.button; return null == e.which && Te.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && Ce.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which } }, k.event.addProp), k.each({ focus: "focusin", blur: "focusout" }, function (e, t) { k.event.special[e] = { setup: function () { return De(this, e, Ne), !1 }, trigger: function () { return De(this, e), !0 }, delegateType: t } }), k.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (e, i) { k.event.special[e] = { delegateType: i, bindType: i, handle: function (e) { var t, n = e.relatedTarget, r = e.handleObj; return n && (n === this || k.contains(this, n)) || (e.type = r.origType, t = r.handler.apply(this, arguments), e.type = i), t } } }), k.fn.extend({ on: function (e, t, n, r) { return Ae(this, e, t, n, r) }, one: function (e, t, n, r) { return Ae(this, e, t, n, r, 1) }, off: function (e, t, n) { var r, i; if (e && e.preventDefault && e.handleObj) return r = e.handleObj, k(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this; if ("object" == typeof e) { for (i in e) this.off(i, t, e[i]); return this } return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = Se), this.each(function () { k.event.remove(this, e, n, t) }) } }); var je = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, qe = /<script|<style|<link/i, Le = /checked\s*(?:[^=]|=\s*.checked.)/i, He = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; function Oe(e, t) { return A(e, "table") && A(11 !== t.nodeType ? t : t.firstChild, "tr") && k(e).children("tbody")[0] || e } function Pe(e) { return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e } function Re(e) { return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e } function Me(e, t) { var n, r, i, o, a, s, u, l; if (1 === t.nodeType) { if (Q.hasData(e) && (o = Q.access(e), a = Q.set(t, o), l = o.events)) for (i in delete a.handle, a.events = {}, l) for (n = 0, r = l[i].length; n < r; n++)k.event.add(t, i, l[i][n]); J.hasData(e) && (s = J.access(e), u = k.extend({}, s), J.set(t, u)) } } function Ie(n, r, i, o) { r = g.apply([], r); var e, t, a, s, u, l, c = 0, f = n.length, p = f - 1, d = r[0], h = m(d); if (h || 1 < f && "string" == typeof d && !y.checkClone && Le.test(d)) return n.each(function (e) { var t = n.eq(e); h && (r[0] = d.call(this, e, t.html())), Ie(t, r, i, o) }); if (f && (t = (e = we(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), t || o)) { for (s = (a = k.map(ve(e, "script"), Pe)).length; c < f; c++)u = e, c !== p && (u = k.clone(u, !0, !0), s && k.merge(a, ve(u, "script"))), i.call(n[c], u, c); if (s) for (l = a[a.length - 1].ownerDocument, k.map(a, Re), c = 0; c < s; c++)u = a[c], he.test(u.type || "") && !Q.access(u, "globalEval") && k.contains(l, u) && (u.src && "module" !== (u.type || "").toLowerCase() ? k._evalUrl && !u.noModule && k._evalUrl(u.src, { nonce: u.nonce || u.getAttribute("nonce") }) : b(u.textContent.replace(He, ""), u, l)) } return n } function We(e, t, n) { for (var r, i = t ? k.filter(t, e) : e, o = 0; null != (r = i[o]); o++)n || 1 !== r.nodeType || k.cleanData(ve(r)), r.parentNode && (n && oe(r) && ye(ve(r, "script")), r.parentNode.removeChild(r)); return e } k.extend({ htmlPrefilter: function (e) { return e.replace(je, "<$1></$2>") }, clone: function (e, t, n) { var r, i, o, a, s, u, l, c = e.cloneNode(!0), f = oe(e); if (!(y.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || k.isXMLDoc(e))) for (a = ve(c), r = 0, i = (o = ve(e)).length; r < i; r++)s = o[r], u = a[r], void 0, "input" === (l = u.nodeName.toLowerCase()) && pe.test(s.type) ? u.checked = s.checked : "input" !== l && "textarea" !== l || (u.defaultValue = s.defaultValue); if (t) if (n) for (o = o || ve(e), a = a || ve(c), r = 0, i = o.length; r < i; r++)Me(o[r], a[r]); else Me(e, c); return 0 < (a = ve(c, "script")).length && ye(a, !f && ve(e, "script")), c }, cleanData: function (e) { for (var t, n, r, i = k.event.special, o = 0; void 0 !== (n = e[o]); o++)if (G(n)) { if (t = n[Q.expando]) { if (t.events) for (r in t.events) i[r] ? k.event.remove(n, r) : k.removeEvent(n, r, t.handle); n[Q.expando] = void 0 } n[J.expando] && (n[J.expando] = void 0) } } }), k.fn.extend({ detach: function (e) { return We(this, e, !0) }, remove: function (e) { return We(this, e) }, text: function (e) { return _(this, function (e) { return void 0 === e ? k.text(this) : this.empty().each(function () { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e) }) }, null, e, arguments.length) }, append: function () { return Ie(this, arguments, function (e) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || Oe(this, e).appendChild(e) }) }, prepend: function () { return Ie(this, arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = Oe(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return Ie(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return Ie(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++)1 === e.nodeType && (k.cleanData(ve(e, !1)), e.textContent = ""); return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map(function () { return k.clone(this, e, t) }) }, html: function (e) { return _(this, function (e) { var t = this[0] || {}, n = 0, r = this.length; if (void 0 === e && 1 === t.nodeType) return t.innerHTML; if ("string" == typeof e && !qe.test(e) && !ge[(de.exec(e) || ["", ""])[1].toLowerCase()]) { e = k.htmlPrefilter(e); try { for (; n < r; n++)1 === (t = this[n] || {}).nodeType && (k.cleanData(ve(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var n = []; return Ie(this, arguments, function (e) { var t = this.parentNode; k.inArray(this, n) < 0 && (k.cleanData(ve(this)), t && t.replaceChild(e, this)) }, n) } }), k.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, a) { k.fn[e] = function (e) { for (var t, n = [], r = k(e), i = r.length - 1, o = 0; o <= i; o++)t = o === i ? this : this.clone(!0), k(r[o])[a](t), u.apply(n, t.get()); return this.pushStack(n) } }); var $e = new RegExp("^(" + te + ")(?!px)[a-z%]+$", "i"), Fe = function (e) { var t = e.ownerDocument.defaultView; return t && t.opener || (t = C), t.getComputedStyle(e) }, Be = new RegExp(re.join("|"), "i"); function _e(e, t, n) { var r, i, o, a, s = e.style; return (n = n || Fe(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || oe(e) || (a = k.style(e, t)), !y.pixelBoxStyles() && $e.test(a) && Be.test(t) && (r = s.width, i = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a } function ze(e, t) { return { get: function () { if (!e()) return (this.get = t).apply(this, arguments); delete this.get } } } !function () { function e() { if (u) { s.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", u.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", ie.appendChild(s).appendChild(u); var e = C.getComputedStyle(u); n = "1%" !== e.top, a = 12 === t(e.marginLeft), u.style.right = "60%", o = 36 === t(e.right), r = 36 === t(e.width), u.style.position = "absolute", i = 12 === t(u.offsetWidth / 3), ie.removeChild(s), u = null } } function t(e) { return Math.round(parseFloat(e)) } var n, r, i, o, a, s = E.createElement("div"), u = E.createElement("div"); u.style && (u.style.backgroundClip = "content-box", u.cloneNode(!0).style.backgroundClip = "", y.clearCloneStyle = "content-box" === u.style.backgroundClip, k.extend(y, { boxSizingReliable: function () { return e(), r }, pixelBoxStyles: function () { return e(), o }, pixelPosition: function () { return e(), n }, reliableMarginLeft: function () { return e(), a }, scrollboxSize: function () { return e(), i } })) }(); var Ue = ["Webkit", "Moz", "ms"], Xe = E.createElement("div").style, Ve = {}; function Ge(e) { var t = k.cssProps[e] || Ve[e]; return t || (e in Xe ? e : Ve[e] = function (e) { var t = e[0].toUpperCase() + e.slice(1), n = Ue.length; while (n--) if ((e = Ue[n] + t) in Xe) return e }(e) || e) } var Ye = /^(none|table(?!-c[ea]).+)/, Qe = /^--/, Je = { position: "absolute", visibility: "hidden", display: "block" }, Ke = { letterSpacing: "0", fontWeight: "400" }; function Ze(e, t, n) { var r = ne.exec(t); return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t } function et(e, t, n, r, i, o) { var a = "width" === t ? 1 : 0, s = 0, u = 0; if (n === (r ? "border" : "content")) return 0; for (; a < 4; a += 2)"margin" === n && (u += k.css(e, n + re[a], !0, i)), r ? ("content" === n && (u -= k.css(e, "padding" + re[a], !0, i)), "margin" !== n && (u -= k.css(e, "border" + re[a] + "Width", !0, i))) : (u += k.css(e, "padding" + re[a], !0, i), "padding" !== n ? u += k.css(e, "border" + re[a] + "Width", !0, i) : s += k.css(e, "border" + re[a] + "Width", !0, i)); return !r && 0 <= o && (u += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - u - s - .5)) || 0), u } function tt(e, t, n) { var r = Fe(e), i = (!y.boxSizingReliable() || n) && "border-box" === k.css(e, "boxSizing", !1, r), o = i, a = _e(e, t, r), s = "offset" + t[0].toUpperCase() + t.slice(1); if ($e.test(a)) { if (!n) return a; a = "auto" } return (!y.boxSizingReliable() && i || "auto" === a || !parseFloat(a) && "inline" === k.css(e, "display", !1, r)) && e.getClientRects().length && (i = "border-box" === k.css(e, "boxSizing", !1, r), (o = s in e) && (a = e[s])), (a = parseFloat(a) || 0) + et(e, t, n || (i ? "border" : "content"), o, r, a) + "px" } function nt(e, t, n, r, i) { return new nt.prototype.init(e, t, n, r, i) } k.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = _e(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, gridArea: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnStart: !0, gridRow: !0, gridRowEnd: !0, gridRowStart: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: {}, style: function (e, t, n, r) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var i, o, a, s = V(t), u = Qe.test(t), l = e.style; if (u || (t = Ge(s)), a = k.cssHooks[t] || k.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t]; "string" === (o = typeof n) && (i = ne.exec(n)) && i[1] && (n = le(e, t, i), o = "number"), null != n && n == n && ("number" !== o || u || (n += i && i[3] || (k.cssNumber[s] ? "" : "px")), y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (u ? l.setProperty(t, n) : l[t] = n)) } }, css: function (e, t, n, r) { var i, o, a, s = V(t); return Qe.test(t) || (t = Ge(s)), (a = k.cssHooks[t] || k.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = _e(e, t, r)), "normal" === i && t in Ke && (i = Ke[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i } }), k.each(["height", "width"], function (e, u) { k.cssHooks[u] = { get: function (e, t, n) { if (t) return !Ye.test(k.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? tt(e, u, n) : ue(e, Je, function () { return tt(e, u, n) }) }, set: function (e, t, n) { var r, i = Fe(e), o = !y.scrollboxSize() && "absolute" === i.position, a = (o || n) && "border-box" === k.css(e, "boxSizing", !1, i), s = n ? et(e, u, n, a, i) : 0; return a && o && (s -= Math.ceil(e["offset" + u[0].toUpperCase() + u.slice(1)] - parseFloat(i[u]) - et(e, u, "border", !1, i) - .5)), s && (r = ne.exec(t)) && "px" !== (r[3] || "px") && (e.style[u] = t, t = k.css(e, u)), Ze(0, t, s) } } }), k.cssHooks.marginLeft = ze(y.reliableMarginLeft, function (e, t) { if (t) return (parseFloat(_e(e, "marginLeft")) || e.getBoundingClientRect().left - ue(e, { marginLeft: 0 }, function () { return e.getBoundingClientRect().left })) + "px" }), k.each({ margin: "", padding: "", border: "Width" }, function (i, o) { k.cssHooks[i + o] = { expand: function (e) { for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [e]; t < 4; t++)n[i + re[t] + o] = r[t] || r[t - 2] || r[0]; return n } }, "margin" !== i && (k.cssHooks[i + o].set = Ze) }), k.fn.extend({ css: function (e, t) { return _(this, function (e, t, n) { var r, i, o = {}, a = 0; if (Array.isArray(t)) { for (r = Fe(e), i = t.length; a < i; a++)o[t[a]] = k.css(e, t[a], !1, r); return o } return void 0 !== n ? k.style(e, t, n) : k.css(e, t) }, e, t, 1 < arguments.length) } }), ((k.Tween = nt).prototype = { constructor: nt, init: function (e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || k.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (k.cssNumber[n] ? "" : "px") }, cur: function () { var e = nt.propHooks[this.prop]; return e && e.get ? e.get(this) : nt.propHooks._default.get(this) }, run: function (e) { var t, n = nt.propHooks[this.prop]; return this.options.duration ? this.pos = t = k.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : nt.propHooks._default.set(this), this } }).init.prototype = nt.prototype, (nt.propHooks = { _default: { get: function (e) { var t; return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = k.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 }, set: function (e) { k.fx.step[e.prop] ? k.fx.step[e.prop](e) : 1 !== e.elem.nodeType || !k.cssHooks[e.prop] && null == e.elem.style[Ge(e.prop)] ? e.elem[e.prop] = e.now : k.style(e.elem, e.prop, e.now + e.unit) } } }).scrollTop = nt.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, k.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 }, _default: "swing" }, k.fx = nt.prototype.init, k.fx.step = {}; var rt, it, ot, at, st = /^(?:toggle|show|hide)$/, ut = /queueHooks$/; function lt() { it && (!1 === E.hidden && C.requestAnimationFrame ? C.requestAnimationFrame(lt) : C.setTimeout(lt, k.fx.interval), k.fx.tick()) } function ct() { return C.setTimeout(function () { rt = void 0 }), rt = Date.now() } function ft(e, t) { var n, r = 0, i = { height: e }; for (t = t ? 1 : 0; r < 4; r += 2 - t)i["margin" + (n = re[r])] = i["padding" + n] = e; return t && (i.opacity = i.width = e), i } function pt(e, t, n) { for (var r, i = (dt.tweeners[t] || []).concat(dt.tweeners["*"]), o = 0, a = i.length; o < a; o++)if (r = i[o].call(n, t, e)) return r } function dt(o, e, t) { var n, a, r = 0, i = dt.prefilters.length, s = k.Deferred().always(function () { delete u.elem }), u = function () { if (a) return !1; for (var e = rt || ct(), t = Math.max(0, l.startTime + l.duration - e), n = 1 - (t / l.duration || 0), r = 0, i = l.tweens.length; r < i; r++)l.tweens[r].run(n); return s.notifyWith(o, [l, n, t]), n < 1 && i ? t : (i || s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l]), !1) }, l = s.promise({ elem: o, props: k.extend({}, e), opts: k.extend(!0, { specialEasing: {}, easing: k.easing._default }, t), originalProperties: e, originalOptions: t, startTime: rt || ct(), duration: t.duration, tweens: [], createTween: function (e, t) { var n = k.Tween(o, l.opts, e, t, l.opts.specialEasing[e] || l.opts.easing); return l.tweens.push(n), n }, stop: function (e) { var t = 0, n = e ? l.tweens.length : 0; if (a) return this; for (a = !0; t < n; t++)l.tweens[t].run(1); return e ? (s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l, e])) : s.rejectWith(o, [l, e]), this } }), c = l.props; for (!function (e, t) { var n, r, i, o, a; for (n in e) if (i = t[r = V(n)], o = e[n], Array.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), (a = k.cssHooks[r]) && "expand" in a) for (n in o = a.expand(o), delete e[r], o) n in e || (e[n] = o[n], t[n] = i); else t[r] = i }(c, l.opts.specialEasing); r < i; r++)if (n = dt.prefilters[r].call(l, o, c, l.opts)) return m(n.stop) && (k._queueHooks(l.elem, l.opts.queue).stop = n.stop.bind(n)), n; return k.map(c, pt, l), m(l.opts.start) && l.opts.start.call(o, l), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always), k.fx.timer(k.extend(u, { elem: o, anim: l, queue: l.opts.queue })), l } k.Animation = k.extend(dt, { tweeners: { "*": [function (e, t) { var n = this.createTween(e, t); return le(n.elem, e, ne.exec(t), n), n }] }, tweener: function (e, t) { m(e) ? (t = e, e = ["*"]) : e = e.match(R); for (var n, r = 0, i = e.length; r < i; r++)n = e[r], dt.tweeners[n] = dt.tweeners[n] || [], dt.tweeners[n].unshift(t) }, prefilters: [function (e, t, n) { var r, i, o, a, s, u, l, c, f = "width" in t || "height" in t, p = this, d = {}, h = e.style, g = e.nodeType && se(e), v = Q.get(e, "fxshow"); for (r in n.queue || (null == (a = k._queueHooks(e, "fx")).unqueued && (a.unqueued = 0, s = a.empty.fire, a.empty.fire = function () { a.unqueued || s() }), a.unqueued++ , p.always(function () { p.always(function () { a.unqueued-- , k.queue(e, "fx").length || a.empty.fire() }) })), t) if (i = t[r], st.test(i)) { if (delete t[r], o = o || "toggle" === i, i === (g ? "hide" : "show")) { if ("show" !== i || !v || void 0 === v[r]) continue; g = !0 } d[r] = v && v[r] || k.style(e, r) } if ((u = !k.isEmptyObject(t)) || !k.isEmptyObject(d)) for (r in f && 1 === e.nodeType && (n.overflow = [h.overflow, h.overflowX, h.overflowY], null == (l = v && v.display) && (l = Q.get(e, "display")), "none" === (c = k.css(e, "display")) && (l ? c = l : (fe([e], !0), l = e.style.display || l, c = k.css(e, "display"), fe([e]))), ("inline" === c || "inline-block" === c && null != l) && "none" === k.css(e, "float") && (u || (p.done(function () { h.display = l }), null == l && (c = h.display, l = "none" === c ? "" : c)), h.display = "inline-block")), n.overflow && (h.overflow = "hidden", p.always(function () { h.overflow = n.overflow[0], h.overflowX = n.overflow[1], h.overflowY = n.overflow[2] })), u = !1, d) u || (v ? "hidden" in v && (g = v.hidden) : v = Q.access(e, "fxshow", { display: l }), o && (v.hidden = !g), g && fe([e], !0), p.done(function () { for (r in g || fe([e]), Q.remove(e, "fxshow"), d) k.style(e, r, d[r]) })), u = pt(g ? v[r] : 0, r, p), r in v || (v[r] = u.start, g && (u.end = u.start, u.start = 0)) }], prefilter: function (e, t) { t ? dt.prefilters.unshift(e) : dt.prefilters.push(e) } }), k.speed = function (e, t, n) { var r = e && "object" == typeof e ? k.extend({}, e) : { complete: n || !n && t || m(e) && e, duration: e, easing: n && t || t && !m(t) && t }; return k.fx.off ? r.duration = 0 : "number" != typeof r.duration && (r.duration in k.fx.speeds ? r.duration = k.fx.speeds[r.duration] : r.duration = k.fx.speeds._default), null != r.queue && !0 !== r.queue || (r.queue = "fx"), r.old = r.complete, r.complete = function () { m(r.old) && r.old.call(this), r.queue && k.dequeue(this, r.queue) }, r }, k.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(se).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r) }, animate: function (t, e, n, r) { var i = k.isEmptyObject(t), o = k.speed(e, n, r), a = function () { var e = dt(this, k.extend({}, t), o); (i || Q.get(this, "finish")) && e.stop(!0) }; return a.finish = a, i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a) }, stop: function (i, e, o) { var a = function (e) { var t = e.stop; delete e.stop, t(o) }; return "string" != typeof i && (o = e, e = i, i = void 0), e && !1 !== i && this.queue(i || "fx", []), this.each(function () { var e = !0, t = null != i && i + "queueHooks", n = k.timers, r = Q.get(this); if (t) r[t] && r[t].stop && a(r[t]); else for (t in r) r[t] && r[t].stop && ut.test(t) && a(r[t]); for (t = n.length; t--;)n[t].elem !== this || null != i && n[t].queue !== i || (n[t].anim.stop(o), e = !1, n.splice(t, 1)); !e && o || k.dequeue(this, i) }) }, finish: function (a) { return !1 !== a && (a = a || "fx"), this.each(function () { var e, t = Q.get(this), n = t[a + "queue"], r = t[a + "queueHooks"], i = k.timers, o = n ? n.length : 0; for (t.finish = !0, k.queue(this, a, []), r && r.stop && r.stop.call(this, !0), e = i.length; e--;)i[e].elem === this && i[e].queue === a && (i[e].anim.stop(!0), i.splice(e, 1)); for (e = 0; e < o; e++)n[e] && n[e].finish && n[e].finish.call(this); delete t.finish }) } }), k.each(["toggle", "show", "hide"], function (e, r) { var i = k.fn[r]; k.fn[r] = function (e, t, n) { return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(ft(r, !0), e, t, n) } }), k.each({ slideDown: ft("show"), slideUp: ft("hide"), slideToggle: ft("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, r) { k.fn[e] = function (e, t, n) { return this.animate(r, e, t, n) } }), k.timers = [], k.fx.tick = function () { var e, t = 0, n = k.timers; for (rt = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1); n.length || k.fx.stop(), rt = void 0 }, k.fx.timer = function (e) { k.timers.push(e), k.fx.start() }, k.fx.interval = 13, k.fx.start = function () { it || (it = !0, lt()) }, k.fx.stop = function () { it = null }, k.fx.speeds = { slow: 600, fast: 200, _default: 400 }, k.fn.delay = function (r, e) { return r = k.fx && k.fx.speeds[r] || r, e = e || "fx", this.queue(e, function (e, t) { var n = C.setTimeout(e, r); t.stop = function () { C.clearTimeout(n) } }) }, ot = E.createElement("input"), at = E.createElement("select").appendChild(E.createElement("option")), ot.type = "checkbox", y.checkOn = "" !== ot.value, y.optSelected = at.selected, (ot = E.createElement("input")).value = "t", ot.type = "radio", y.radioValue = "t" === ot.value; var ht, gt = k.expr.attrHandle; k.fn.extend({ attr: function (e, t) { return _(this, k.attr, e, t, 1 < arguments.length) }, removeAttr: function (e) { return this.each(function () { k.removeAttr(this, e) }) } }), k.extend({ attr: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return "undefined" == typeof e.getAttribute ? k.prop(e, t, n) : (1 === o && k.isXMLDoc(e) || (i = k.attrHooks[t.toLowerCase()] || (k.expr.match.bool.test(t) ? ht : void 0)), void 0 !== n ? null === n ? void k.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = k.find.attr(e, t)) ? void 0 : r) }, attrHooks: { type: { set: function (e, t) { if (!y.radioValue && "radio" === t && A(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, removeAttr: function (e, t) { var n, r = 0, i = t && t.match(R); if (i && 1 === e.nodeType) while (n = i[r++]) e.removeAttribute(n) } }), ht = { set: function (e, t, n) { return !1 === t ? k.removeAttr(e, n) : e.setAttribute(n, n), n } }, k.each(k.expr.match.bool.source.match(/\w+/g), function (e, t) { var a = gt[t] || k.find.attr; gt[t] = function (e, t, n) { var r, i, o = t.toLowerCase(); return n || (i = gt[o], gt[o] = r, r = null != a(e, t, n) ? o : null, gt[o] = i), r } }); var vt = /^(?:input|select|textarea|button)$/i, yt = /^(?:a|area)$/i; function mt(e) { return (e.match(R) || []).join(" ") } function xt(e) { return e.getAttribute && e.getAttribute("class") || "" } function bt(e) { return Array.isArray(e) ? e : "string" == typeof e && e.match(R) || [] } k.fn.extend({ prop: function (e, t) { return _(this, k.prop, e, t, 1 < arguments.length) }, removeProp: function (e) { return this.each(function () { delete this[k.propFix[e] || e] }) } }), k.extend({ prop: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return 1 === o && k.isXMLDoc(e) || (t = k.propFix[t] || t, i = k.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : e[t] = n : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t] }, propHooks: { tabIndex: { get: function (e) { var t = k.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : vt.test(e.nodeName) || yt.test(e.nodeName) && e.href ? 0 : -1 } } }, propFix: { "for": "htmlFor", "class": "className" } }), y.optSelected || (k.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && t.parentNode && t.parentNode.selectedIndex, null }, set: function (e) { var t = e.parentNode; t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex) } }), k.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { k.propFix[this.toLowerCase()] = this }), k.fn.extend({ addClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { k(this).addClass(t.call(this, e, xt(this))) }); if ((e = bt(t)).length) while (n = this[u++]) if (i = xt(n), r = 1 === n.nodeType && " " + mt(i) + " ") { a = 0; while (o = e[a++]) r.indexOf(" " + o + " ") < 0 && (r += o + " "); i !== (s = mt(r)) && n.setAttribute("class", s) } return this }, removeClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { k(this).removeClass(t.call(this, e, xt(this))) }); if (!arguments.length) return this.attr("class", ""); if ((e = bt(t)).length) while (n = this[u++]) if (i = xt(n), r = 1 === n.nodeType && " " + mt(i) + " ") { a = 0; while (o = e[a++]) while (-1 < r.indexOf(" " + o + " ")) r = r.replace(" " + o + " ", " "); i !== (s = mt(r)) && n.setAttribute("class", s) } return this }, toggleClass: function (i, t) { var o = typeof i, a = "string" === o || Array.isArray(i); return "boolean" == typeof t && a ? t ? this.addClass(i) : this.removeClass(i) : m(i) ? this.each(function (e) { k(this).toggleClass(i.call(this, e, xt(this), t), t) }) : this.each(function () { var e, t, n, r; if (a) { t = 0, n = k(this), r = bt(i); while (e = r[t++]) n.hasClass(e) ? n.removeClass(e) : n.addClass(e) } else void 0 !== i && "boolean" !== o || ((e = xt(this)) && Q.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : Q.get(this, "__className__") || "")) }) }, hasClass: function (e) { var t, n, r = 0; t = " " + e + " "; while (n = this[r++]) if (1 === n.nodeType && -1 < (" " + mt(xt(n)) + " ").indexOf(t)) return !0; return !1 } }); var wt = /\r/g; k.fn.extend({ val: function (n) { var r, e, i, t = this[0]; return arguments.length ? (i = m(n), this.each(function (e) { var t; 1 === this.nodeType && (null == (t = i ? n.call(this, e, k(this).val()) : n) ? t = "" : "number" == typeof t ? t += "" : Array.isArray(t) && (t = k.map(t, function (e) { return null == e ? "" : e + "" })), (r = k.valHooks[this.type] || k.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value") || (this.value = t)) })) : t ? (r = k.valHooks[t.type] || k.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof (e = t.value) ? e.replace(wt, "") : null == e ? "" : e : void 0 } }), k.extend({ valHooks: { option: { get: function (e) { var t = k.find.attr(e, "value"); return null != t ? t : mt(k.text(e)) } }, select: { get: function (e) { var t, n, r, i = e.options, o = e.selectedIndex, a = "select-one" === e.type, s = a ? null : [], u = a ? o + 1 : i.length; for (r = o < 0 ? u : a ? o : 0; r < u; r++)if (((n = i[r]).selected || r === o) && !n.disabled && (!n.parentNode.disabled || !A(n.parentNode, "optgroup"))) { if (t = k(n).val(), a) return t; s.push(t) } return s }, set: function (e, t) { var n, r, i = e.options, o = k.makeArray(t), a = i.length; while (a--) ((r = i[a]).selected = -1 < k.inArray(k.valHooks.option.get(r), o)) && (n = !0); return n || (e.selectedIndex = -1), o } } } }), k.each(["radio", "checkbox"], function () { k.valHooks[this] = { set: function (e, t) { if (Array.isArray(t)) return e.checked = -1 < k.inArray(k(e).val(), t) } }, y.checkOn || (k.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }), y.focusin = "onfocusin" in C; var Tt = /^(?:focusinfocus|focusoutblur)$/, Ct = function (e) { e.stopPropagation() }; k.extend(k.event, { trigger: function (e, t, n, r) { var i, o, a, s, u, l, c, f, p = [n || E], d = v.call(e, "type") ? e.type : e, h = v.call(e, "namespace") ? e.namespace.split(".") : []; if (o = f = a = n = n || E, 3 !== n.nodeType && 8 !== n.nodeType && !Tt.test(d + k.event.triggered) && (-1 < d.indexOf(".") && (d = (h = d.split(".")).shift(), h.sort()), u = d.indexOf(":") < 0 && "on" + d, (e = e[k.expando] ? e : new k.Event(d, "object" == typeof e && e)).isTrigger = r ? 2 : 3, e.namespace = h.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : k.makeArray(t, [e]), c = k.event.special[d] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, t))) { if (!r && !c.noBubble && !x(n)) { for (s = c.delegateType || d, Tt.test(s + d) || (o = o.parentNode); o; o = o.parentNode)p.push(o), a = o; a === (n.ownerDocument || E) && p.push(a.defaultView || a.parentWindow || C) } i = 0; while ((o = p[i++]) && !e.isPropagationStopped()) f = o, e.type = 1 < i ? s : c.bindType || d, (l = (Q.get(o, "events") || {})[e.type] && Q.get(o, "handle")) && l.apply(o, t), (l = u && o[u]) && l.apply && G(o) && (e.result = l.apply(o, t), !1 === e.result && e.preventDefault()); return e.type = d, r || e.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), t) || !G(n) || u && m(n[d]) && !x(n) && ((a = n[u]) && (n[u] = null), k.event.triggered = d, e.isPropagationStopped() && f.addEventListener(d, Ct), n[d](), e.isPropagationStopped() && f.removeEventListener(d, Ct), k.event.triggered = void 0, a && (n[u] = a)), e.result } }, simulate: function (e, t, n) { var r = k.extend(new k.Event, n, { type: e, isSimulated: !0 }); k.event.trigger(r, null, t) } }), k.fn.extend({ trigger: function (e, t) { return this.each(function () { k.event.trigger(e, t, this) }) }, triggerHandler: function (e, t) { var n = this[0]; if (n) return k.event.trigger(e, t, n, !0) } }), y.focusin || k.each({ focus: "focusin", blur: "focusout" }, function (n, r) { var i = function (e) { k.event.simulate(r, e.target, k.event.fix(e)) }; k.event.special[r] = { setup: function () { var e = this.ownerDocument || this, t = Q.access(e, r); t || e.addEventListener(n, i, !0), Q.access(e, r, (t || 0) + 1) }, teardown: function () { var e = this.ownerDocument || this, t = Q.access(e, r) - 1; t ? Q.access(e, r, t) : (e.removeEventListener(n, i, !0), Q.remove(e, r)) } } }); var Et = C.location, kt = Date.now(), St = /\?/; k.parseXML = function (e) { var t; if (!e || "string" != typeof e) return null; try { t = (new C.DOMParser).parseFromString(e, "text/xml") } catch (e) { t = void 0 } return t && !t.getElementsByTagName("parsererror").length || k.error("Invalid XML: " + e), t }; var Nt = /\[\]$/, At = /\r?\n/g, Dt = /^(?:submit|button|image|reset|file)$/i, jt = /^(?:input|select|textarea|keygen)/i; function qt(n, e, r, i) { var t; if (Array.isArray(e)) k.each(e, function (e, t) { r || Nt.test(n) ? i(n, t) : qt(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i) }); else if (r || "object" !== w(e)) i(n, e); else for (t in e) qt(n + "[" + t + "]", e[t], r, i) } k.param = function (e, t) { var n, r = [], i = function (e, t) { var n = m(t) ? t() : t; r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n) }; if (null == e) return ""; if (Array.isArray(e) || e.jquery && !k.isPlainObject(e)) k.each(e, function () { i(this.name, this.value) }); else for (n in e) qt(n, e[n], t, i); return r.join("&") }, k.fn.extend({ serialize: function () { return k.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var e = k.prop(this, "elements"); return e ? k.makeArray(e) : this }).filter(function () { var e = this.type; return this.name && !k(this).is(":disabled") && jt.test(this.nodeName) && !Dt.test(e) && (this.checked || !pe.test(e)) }).map(function (e, t) { var n = k(this).val(); return null == n ? null : Array.isArray(n) ? k.map(n, function (e) { return { name: t.name, value: e.replace(At, "\r\n") } }) : { name: t.name, value: n.replace(At, "\r\n") } }).get() } }); var Lt = /%20/g, Ht = /#.*$/, Ot = /([?&])_=[^&]*/, Pt = /^(.*?):[ \t]*([^\r\n]*)$/gm, Rt = /^(?:GET|HEAD)$/, Mt = /^\/\//, It = {}, Wt = {}, $t = "*/".concat("*"), Ft = E.createElement("a"); function Bt(o) { return function (e, t) { "string" != typeof e && (t = e, e = "*"); var n, r = 0, i = e.toLowerCase().match(R) || []; if (m(t)) while (n = i[r++]) "+" === n[0] ? (n = n.slice(1) || "*", (o[n] = o[n] || []).unshift(t)) : (o[n] = o[n] || []).push(t) } } function _t(t, i, o, a) { var s = {}, u = t === Wt; function l(e) { var r; return s[e] = !0, k.each(t[e] || [], function (e, t) { var n = t(i, o, a); return "string" != typeof n || u || s[n] ? u ? !(r = n) : void 0 : (i.dataTypes.unshift(n), l(n), !1) }), r } return l(i.dataTypes[0]) || !s["*"] && l("*") } function zt(e, t) { var n, r, i = k.ajaxSettings.flatOptions || {}; for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]); return r && k.extend(!0, e, r), e } Ft.href = Et.href, k.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: Et.href, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": $t, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": JSON.parse, "text xml": k.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (e, t) { return t ? zt(zt(e, k.ajaxSettings), t) : zt(k.ajaxSettings, e) }, ajaxPrefilter: Bt(It), ajaxTransport: Bt(Wt), ajax: function (e, t) { "object" == typeof e && (t = e, e = void 0), t = t || {}; var c, f, p, n, d, r, h, g, i, o, v = k.ajaxSetup({}, t), y = v.context || v, m = v.context && (y.nodeType || y.jquery) ? k(y) : k.event, x = k.Deferred(), b = k.Callbacks("once memory"), w = v.statusCode || {}, a = {}, s = {}, u = "canceled", T = { readyState: 0, getResponseHeader: function (e) { var t; if (h) { if (!n) { n = {}; while (t = Pt.exec(p)) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]) } t = n[e.toLowerCase() + " "] } return null == t ? null : t.join(", ") }, getAllResponseHeaders: function () { return h ? p : null }, setRequestHeader: function (e, t) { return null == h && (e = s[e.toLowerCase()] = s[e.toLowerCase()] || e, a[e] = t), this }, overrideMimeType: function (e) { return null == h && (v.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (h) T.always(e[T.status]); else for (t in e) w[t] = [w[t], e[t]]; return this }, abort: function (e) { var t = e || u; return c && c.abort(t), l(0, t), this } }; if (x.promise(T), v.url = ((e || v.url || Et.href) + "").replace(Mt, Et.protocol + "//"), v.type = t.method || t.type || v.method || v.type, v.dataTypes = (v.dataType || "*").toLowerCase().match(R) || [""], null == v.crossDomain) { r = E.createElement("a"); try { r.href = v.url, r.href = r.href, v.crossDomain = Ft.protocol + "//" + Ft.host != r.protocol + "//" + r.host } catch (e) { v.crossDomain = !0 } } if (v.data && v.processData && "string" != typeof v.data && (v.data = k.param(v.data, v.traditional)), _t(It, v, t, T), h) return T; for (i in (g = k.event && v.global) && 0 == k.active++ && k.event.trigger("ajaxStart"), v.type = v.type.toUpperCase(), v.hasContent = !Rt.test(v.type), f = v.url.replace(Ht, ""), v.hasContent ? v.data && v.processData && 0 === (v.contentType || "").indexOf("application/x-www-form-urlencoded") && (v.data = v.data.replace(Lt, "+")) : (o = v.url.slice(f.length), v.data && (v.processData || "string" == typeof v.data) && (f += (St.test(f) ? "&" : "?") + v.data, delete v.data), !1 === v.cache && (f = f.replace(Ot, "$1"), o = (St.test(f) ? "&" : "?") + "_=" + kt++ + o), v.url = f + o), v.ifModified && (k.lastModified[f] && T.setRequestHeader("If-Modified-Since", k.lastModified[f]), k.etag[f] && T.setRequestHeader("If-None-Match", k.etag[f])), (v.data && v.hasContent && !1 !== v.contentType || t.contentType) && T.setRequestHeader("Content-Type", v.contentType), T.setRequestHeader("Accept", v.dataTypes[0] && v.accepts[v.dataTypes[0]] ? v.accepts[v.dataTypes[0]] + ("*" !== v.dataTypes[0] ? ", " + $t + "; q=0.01" : "") : v.accepts["*"]), v.headers) T.setRequestHeader(i, v.headers[i]); if (v.beforeSend && (!1 === v.beforeSend.call(y, T, v) || h)) return T.abort(); if (u = "abort", b.add(v.complete), T.done(v.success), T.fail(v.error), c = _t(Wt, v, t, T)) { if (T.readyState = 1, g && m.trigger("ajaxSend", [T, v]), h) return T; v.async && 0 < v.timeout && (d = C.setTimeout(function () { T.abort("timeout") }, v.timeout)); try { h = !1, c.send(a, l) } catch (e) { if (h) throw e; l(-1, e) } } else l(-1, "No Transport"); function l(e, t, n, r) { var i, o, a, s, u, l = t; h || (h = !0, d && C.clearTimeout(d), c = void 0, p = r || "", T.readyState = 0 < e ? 4 : 0, i = 200 <= e && e < 300 || 304 === e, n && (s = function (e, t, n) { var r, i, o, a, s = e.contents, u = e.dataTypes; while ("*" === u[0]) u.shift(), void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type")); if (r) for (i in s) if (s[i] && s[i].test(r)) { u.unshift(i); break } if (u[0] in n) o = u[0]; else { for (i in n) { if (!u[0] || e.converters[i + " " + u[0]]) { o = i; break } a || (a = i) } o = o || a } if (o) return o !== u[0] && u.unshift(o), n[o] }(v, T, n)), s = function (e, t, n, r) { var i, o, a, s, u, l = {}, c = e.dataTypes.slice(); if (c[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a]; o = c.shift(); while (o) if (e.responseFields[o] && (n[e.responseFields[o]] = t), !u && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), u = o, o = c.shift()) if ("*" === o) o = u; else if ("*" !== u && u !== o) { if (!(a = l[u + " " + o] || l["* " + o])) for (i in l) if ((s = i.split(" "))[1] === o && (a = l[u + " " + s[0]] || l["* " + s[0]])) { !0 === a ? a = l[i] : !0 !== l[i] && (o = s[0], c.unshift(s[1])); break } if (!0 !== a) if (a && e["throws"]) t = a(t); else try { t = a(t) } catch (e) { return { state: "parsererror", error: a ? e : "No conversion from " + u + " to " + o } } } return { state: "success", data: t } }(v, s, T, i), i ? (v.ifModified && ((u = T.getResponseHeader("Last-Modified")) && (k.lastModified[f] = u), (u = T.getResponseHeader("etag")) && (k.etag[f] = u)), 204 === e || "HEAD" === v.type ? l = "nocontent" : 304 === e ? l = "notmodified" : (l = s.state, o = s.data, i = !(a = s.error))) : (a = l, !e && l || (l = "error", e < 0 && (e = 0))), T.status = e, T.statusText = (t || l) + "", i ? x.resolveWith(y, [o, l, T]) : x.rejectWith(y, [T, l, a]), T.statusCode(w), w = void 0, g && m.trigger(i ? "ajaxSuccess" : "ajaxError", [T, v, i ? o : a]), b.fireWith(y, [T, l]), g && (m.trigger("ajaxComplete", [T, v]), --k.active || k.event.trigger("ajaxStop"))) } return T }, getJSON: function (e, t, n) { return k.get(e, t, n, "json") }, getScript: function (e, t) { return k.get(e, void 0, t, "script") } }), k.each(["get", "post"], function (e, i) { k[i] = function (e, t, n, r) { return m(t) && (r = r || n, n = t, t = void 0), k.ajax(k.extend({ url: e, type: i, dataType: r, data: t, success: n }, k.isPlainObject(e) && e)) } }), k._evalUrl = function (e, t) { return k.ajax({ url: e, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, converters: { "text script": function () { } }, dataFilter: function (e) { k.globalEval(e, t) } }) }, k.fn.extend({ wrapAll: function (e) { var t; return this[0] && (m(e) && (e = e.call(this[0])), t = k(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstElementChild) e = e.firstElementChild; return e }).append(this)), this }, wrapInner: function (n) { return m(n) ? this.each(function (e) { k(this).wrapInner(n.call(this, e)) }) : this.each(function () { var e = k(this), t = e.contents(); t.length ? t.wrapAll(n) : e.append(n) }) }, wrap: function (t) { var n = m(t); return this.each(function (e) { k(this).wrapAll(n ? t.call(this, e) : t) }) }, unwrap: function (e) { return this.parent(e).not("body").each(function () { k(this).replaceWith(this.childNodes) }), this } }), k.expr.pseudos.hidden = function (e) { return !k.expr.pseudos.visible(e) }, k.expr.pseudos.visible = function (e) { return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length) }, k.ajaxSettings.xhr = function () { try { return new C.XMLHttpRequest } catch (e) { } }; var Ut = { 0: 200, 1223: 204 }, Xt = k.ajaxSettings.xhr(); y.cors = !!Xt && "withCredentials" in Xt, y.ajax = Xt = !!Xt, k.ajaxTransport(function (i) { var o, a; if (y.cors || Xt && !i.crossDomain) return { send: function (e, t) { var n, r = i.xhr(); if (r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields) for (n in i.xhrFields) r[n] = i.xhrFields[n]; for (n in i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), e) r.setRequestHeader(n, e[n]); o = function (e) { return function () { o && (o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(Ut[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? { binary: r.response } : { text: r.responseText }, r.getAllResponseHeaders())) } }, r.onload = o(), a = r.onerror = r.ontimeout = o("error"), void 0 !== r.onabort ? r.onabort = a : r.onreadystatechange = function () { 4 === r.readyState && C.setTimeout(function () { o && a() }) }, o = o("abort"); try { r.send(i.hasContent && i.data || null) } catch (e) { if (o) throw e } }, abort: function () { o && o() } } }), k.ajaxPrefilter(function (e) { e.crossDomain && (e.contents.script = !1) }), k.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function (e) { return k.globalEval(e), e } } }), k.ajaxPrefilter("script", function (e) { void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET") }), k.ajaxTransport("script", function (n) { var r, i; if (n.crossDomain || n.scriptAttrs) return { send: function (e, t) { r = k("<script>").attr(n.scriptAttrs || {}).prop({ charset: n.scriptCharset, src: n.url }).on("load error", i = function (e) { r.remove(), i = null, e && t("error" === e.type ? 404 : 200, e.type) }), E.head.appendChild(r[0]) }, abort: function () { i && i() } } }); var Vt, Gt = [], Yt = /(=)\?(?=&|$)|\?\?/; k.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var e = Gt.pop() || k.expando + "_" + kt++; return this[e] = !0, e } }), k.ajaxPrefilter("json jsonp", function (e, t, n) { var r, i, o, a = !1 !== e.jsonp && (Yt.test(e.url) ? "url" : "string" == typeof e.data && 0 === (e.contentType || "").indexOf("application/x-www-form-urlencoded") && Yt.test(e.data) && "data"); if (a || "jsonp" === e.dataTypes[0]) return r = e.jsonpCallback = m(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, a ? e[a] = e[a].replace(Yt, "$1" + r) : !1 !== e.jsonp && (e.url += (St.test(e.url) ? "&" : "?") + e.jsonp + "=" + r), e.converters["script json"] = function () { return o || k.error(r + " was not called"), o[0] }, e.dataTypes[0] = "json", i = C[r], C[r] = function () { o = arguments }, n.always(function () { void 0 === i ? k(C).removeProp(r) : C[r] = i, e[r] && (e.jsonpCallback = t.jsonpCallback, Gt.push(r)), o && m(i) && i(o[0]), o = i = void 0 }), "script" }), y.createHTMLDocument = ((Vt = E.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>", 2 === Vt.childNodes.length), k.parseHTML = function (e, t, n) { return "string" != typeof e ? [] : ("boolean" == typeof t && (n = t, t = !1), t || (y.createHTMLDocument ? ((r = (t = E.implementation.createHTMLDocument("")).createElement("base")).href = E.location.href, t.head.appendChild(r)) : t = E), o = !n && [], (i = D.exec(e)) ? [t.createElement(i[1])] : (i = we([e], t, o), o && o.length && k(o).remove(), k.merge([], i.childNodes))); var r, i, o }, k.fn.load = function (e, t, n) { var r, i, o, a = this, s = e.indexOf(" "); return -1 < s && (r = mt(e.slice(s)), e = e.slice(0, s)), m(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), 0 < a.length && k.ajax({ url: e, type: i || "GET", dataType: "html", data: t }).done(function (e) { o = arguments, a.html(r ? k("<div>").append(k.parseHTML(e)).find(r) : e) }).always(n && function (e, t) { a.each(function () { n.apply(this, o || [e.responseText, t, e]) }) }), this }, k.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (e, t) { k.fn[t] = function (e) { return this.on(t, e) } }), k.expr.pseudos.animated = function (t) { return k.grep(k.timers, function (e) { return t === e.elem }).length }, k.offset = { setOffset: function (e, t, n) { var r, i, o, a, s, u, l = k.css(e, "position"), c = k(e), f = {}; "static" === l && (e.style.position = "relative"), s = c.offset(), o = k.css(e, "top"), u = k.css(e, "left"), ("absolute" === l || "fixed" === l) && -1 < (o + u).indexOf("auto") ? (a = (r = c.position()).top, i = r.left) : (a = parseFloat(o) || 0, i = parseFloat(u) || 0), m(t) && (t = t.call(e, n, k.extend({}, s))), null != t.top && (f.top = t.top - s.top + a), null != t.left && (f.left = t.left - s.left + i), "using" in t ? t.using.call(e, f) : c.css(f) } }, k.fn.extend({ offset: function (t) { if (arguments.length) return void 0 === t ? this : this.each(function (e) { k.offset.setOffset(this, t, e) }); var e, n, r = this[0]; return r ? r.getClientRects().length ? (e = r.getBoundingClientRect(), n = r.ownerDocument.defaultView, { top: e.top + n.pageYOffset, left: e.left + n.pageXOffset }) : { top: 0, left: 0 } : void 0 }, position: function () { if (this[0]) { var e, t, n, r = this[0], i = { top: 0, left: 0 }; if ("fixed" === k.css(r, "position")) t = r.getBoundingClientRect(); else { t = this.offset(), n = r.ownerDocument, e = r.offsetParent || n.documentElement; while (e && (e === n.body || e === n.documentElement) && "static" === k.css(e, "position")) e = e.parentNode; e && e !== r && 1 === e.nodeType && ((i = k(e).offset()).top += k.css(e, "borderTopWidth", !0), i.left += k.css(e, "borderLeftWidth", !0)) } return { top: t.top - i.top - k.css(r, "marginTop", !0), left: t.left - i.left - k.css(r, "marginLeft", !0) } } }, offsetParent: function () { return this.map(function () { var e = this.offsetParent; while (e && "static" === k.css(e, "position")) e = e.offsetParent; return e || ie }) } }), k.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (t, i) { var o = "pageYOffset" === i; k.fn[t] = function (e) { return _(this, function (e, t, n) { var r; if (x(e) ? r = e : 9 === e.nodeType && (r = e.defaultView), void 0 === n) return r ? r[i] : e[t]; r ? r.scrollTo(o ? r.pageXOffset : n, o ? n : r.pageYOffset) : e[t] = n }, t, e, arguments.length) } }), k.each(["top", "left"], function (e, n) { k.cssHooks[n] = ze(y.pixelPosition, function (e, t) { if (t) return t = _e(e, n), $e.test(t) ? k(e).position()[n] + "px" : t }) }), k.each({ Height: "height", Width: "width" }, function (a, s) { k.each({ padding: "inner" + a, content: s, "": "outer" + a }, function (r, o) { k.fn[o] = function (e, t) { var n = arguments.length && (r || "boolean" != typeof e), i = r || (!0 === e || !0 === t ? "margin" : "border"); return _(this, function (e, t, n) { var r; return x(e) ? 0 === o.indexOf("outer") ? e["inner" + a] : e.document.documentElement["client" + a] : 9 === e.nodeType ? (r = e.documentElement, Math.max(e.body["scroll" + a], r["scroll" + a], e.body["offset" + a], r["offset" + a], r["client" + a])) : void 0 === n ? k.css(e, t, i) : k.style(e, t, n, i) }, s, n ? e : void 0, n) } }) }), k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function (e, n) { k.fn[n] = function (e, t) { return 0 < arguments.length ? this.on(n, null, e, t) : this.trigger(n) } }), k.fn.extend({ hover: function (e, t) { return this.mouseenter(e).mouseleave(t || e) } }), k.fn.extend({ bind: function (e, t, n) { return this.on(e, null, t, n) }, unbind: function (e, t) { return this.off(e, null, t) }, delegate: function (e, t, n, r) { return this.on(t, e, n, r) }, undelegate: function (e, t, n) { return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n) } }), k.proxy = function (e, t) { var n, r, i; if ("string" == typeof t && (n = e[t], t = e, e = n), m(e)) return r = s.call(arguments, 2), (i = function () { return e.apply(t || this, r.concat(s.call(arguments))) }).guid = e.guid = e.guid || k.guid++ , i }, k.holdReady = function (e) { e ? k.readyWait++ : k.ready(!0) }, k.isArray = Array.isArray, k.parseJSON = JSON.parse, k.nodeName = A, k.isFunction = m, k.isWindow = x, k.camelCase = V, k.type = w, k.now = Date.now, k.isNumeric = function (e) { var t = k.type(e); return ("number" === t || "string" === t) && !isNaN(e - parseFloat(e)) }, "function" == typeof define && define.amd && define("jquery", [], function () { return k }); var Qt = C.jQuery, Jt = C.$; return k.noConflict = function (e) { return C.$ === k && (C.$ = Jt), e && C.jQuery === k && (C.jQuery = Qt), k }, e || (C.jQuery = C.$ = k), k });
;
/*! jQuery UI - v1.12.1 - 2021-05-10
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/resizable.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/slider.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(w){w.ui=w.ui||{};w.ui.version="1.12.1";var n,i=0,r=Array.prototype.slice;w.cleanData=(n=w.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=w._data(i,"events"))&&e.remove&&w(i).triggerHandler("remove")}catch(t){}n(t)}),w.widget=function(t,i,e){var s,n,a,o={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=w.Widget),w.isArray(e)&&(e=w.extend.apply(null,[{}].concat(e))),w.expr[":"][l.toLowerCase()]=function(t){return!!w.data(t,l)},w[r]=w[r]||{},s=w[r][t],n=w[r][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},w.extend(n,s,{version:e.version,_proto:w.extend({},e),_childConstructors:[]}),(a=new i).options=w.widget.extend({},a.options),w.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function a(t){return i.prototype[e].apply(this,t)}w.isFunction(s)?o[e]=function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=a,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:o[e]=s}),n.prototype=w.widget.extend(a,{widgetEventPrefix:s&&a.widgetEventPrefix||t},o,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(w.each(s._childConstructors,function(t,e){var i=e.prototype;w.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),w.widget.bridge(t,n),n},w.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,a=s.length;n<a;n++)for(e in s[n])i=s[n][e],s[n].hasOwnProperty(e)&&void 0!==i&&(w.isPlainObject(i)?t[e]=w.isPlainObject(t[e])?w.widget.extend({},t[e],i):w.widget.extend({},i):t[e]=i);return t},w.widget.bridge=function(a,e){var o=e.prototype.widgetFullName||a;w.fn[a]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=w.data(this,o);return"instance"===i?(n=e,!1):e?w.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:w.error("no such method '"+i+"' for "+a+" widget instance"):w.error("cannot call methods on "+a+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=w.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=w.data(this,o);t?(t.option(i||{}),t._init&&t._init()):w.data(this,o,new e(i,this))})),n}},w.Widget=function(){},w.Widget._childConstructors=[],w.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=w(e||this.defaultElement||this)[0],this.element=w(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=w(),this.hoverable=w(),this.focusable=w(),this.classesElementLookup={},e!==this&&(w.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=w(e.style?e.ownerDocument:e.document||e),this.window=w(this.document[0].defaultView||this.document[0].parentWindow)),this.options=w.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:w.noop,_create:w.noop,_init:w.noop,destroy:function(){var i=this;this._destroy(),w.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:w.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,a=t;if(0===arguments.length)return w.widget.extend({},this.options);if("string"==typeof t)if(a={},t=(i=t.split(".")).shift(),i.length){for(s=a[t]=w.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=e}return this._setOptions(a),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=w(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var a=[],o=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=o.classesElementLookup[t[s]]||w(),i=n.add?w(w.unique(i.get().concat(n.element.get()))):w(i.not(n.element).get()),o.classesElementLookup[t[s]]=i,a.push(t[s]),e&&n.classes[t[s]]&&a.push(n.classes[t[s]])}return n=w.extend({element:this.element,classes:this.options.classes||{}},n),this._on(n.element,{remove:"_untrackClassesElement"}),n.keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),a.join(" ")},_untrackClassesElement:function(i){var s=this;w.each(s.classesElementLookup,function(t,e){-1!==w.inArray(i.target,e)&&(s.classesElementLookup[t]=w(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,t={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return t.element.toggleClass(this._classes(t),s),this},_on:function(n,a,t){var o,r=this;"boolean"!=typeof n&&(t=a,a=n,n=!1),t?(a=o=w(a),this.bindings=this.bindings.add(a)):(t=a,a=this.element,o=this.widget()),w.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!w(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||w.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?o.on(t,s,i):a.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=w(this.bindings.not(t).get()),this.focusable=w(this.focusable.not(t).get()),this.hoverable=w(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(w(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(w(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,a=this.options[t];if(i=i||{},(e=w.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!(w.isFunction(a)&&!1===a.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},w.each({show:"fadeIn",hide:"fadeOut"},function(a,o){w.Widget.prototype["_"+a]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var n=t?!0!==t&&"number"!=typeof t&&t.effect||o:a;"number"==typeof(t=t||{})&&(t={duration:t}),s=!w.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&w.effects&&w.effects.effect[n]?e[a](t):n!==a&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){w(this)[a](),i&&i.call(e[0]),t()})}});var s,D,x,a,o,l,h,u,C;w.widget;function M(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function T(t,e){return parseInt(w.css(t,e),10)||0}D=Math.max,x=Math.abs,a=/left|center|right/,o=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,u=/%$/,C=w.fn.position,w.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=w("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),i=e.children()[0];return w("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?w.position.scrollbarWidth():0,height:e?w.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=w(t||window),i=w.isWindow(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?w(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},w.fn.position=function(c){if(!c||!c.of)return C.apply(this,arguments);c=w.extend({},c);var d,p,f,g,m,t,_=w(c.of),v=w.position.getWithinInfo(c.within),b=w.position.getScrollInfo(v),y=(c.collision||"flip").split(" "),k={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:w.isWindow(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(c.at="left top"),p=e.width,f=e.height,g=e.offset,m=w.extend({},g),w.each(["my","at"],function(){var t,e,i=(c[this]||"").split(" ");1===i.length&&(i=a.test(i[0])?i.concat(["center"]):o.test(i[0])?["center"].concat(i):["center","center"]),i[0]=a.test(i[0])?i[0]:"center",i[1]=o.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],c[this]=[h.exec(i[0])[0],h.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===c.at[0]?m.left+=p:"center"===c.at[0]&&(m.left+=p/2),"bottom"===c.at[1]?m.top+=f:"center"===c.at[1]&&(m.top+=f/2),d=M(k.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,o=w(this),r=o.outerWidth(),l=o.outerHeight(),e=T(this,"marginLeft"),s=T(this,"marginTop"),n=r+e+T(this,"marginRight")+b.width,a=l+s+T(this,"marginBottom")+b.height,h=w.extend({},m),u=M(k.my,o.outerWidth(),o.outerHeight());"right"===c.my[0]?h.left-=r:"center"===c.my[0]&&(h.left-=r/2),"bottom"===c.my[1]?h.top-=l:"center"===c.my[1]&&(h.top-=l/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:s},w.each(["left","top"],function(t,e){w.ui.position[y[t]]&&w.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:a,offset:[d[0]+u[0],d[1]+u[1]],my:c.my,at:c.at,within:v,elem:o})}),c.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,a={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:o,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&x(e+i)<p&&(a.horizontal="center"),f<l&&x(s+n)<f&&(a.vertical="middle"),D(x(e),x(i))>D(x(s),x(n))?a.important="horizontal":a.important="vertical",c.using.call(this,t,a)}),o.offset(w.extend(h,{using:t}))})},w.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,a=t.left-e.collisionPosition.marginLeft,o=s-a,r=a+e.collisionWidth-n-s;e.collisionWidth>n?0<o&&r<=0?(i=t.left+o+e.collisionWidth-n-s,t.left+=o-i):t.left=!(0<r&&o<=0)&&r<o?s+n-e.collisionWidth:s:0<o?t.left+=o:0<r?t.left-=r:t.left=D(t.left-a,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,a=t.top-e.collisionPosition.marginTop,o=s-a,r=a+e.collisionHeight-n-s;e.collisionHeight>n?0<o&&r<=0?(i=t.top+o+e.collisionHeight-n-s,t.top+=o-i):t.top=!(0<r&&o<=0)&&r<o?s+n-e.collisionHeight:s:0<o?t.top+=o:0<r?t.top-=r:t.top=D(t.top-a,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,o=t.left-e.collisionPosition.marginLeft,r=o-a,l=o+e.collisionWidth-n-a,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,o=-2*e.offset[0];r<0?((s=t.left+h+i+o+e.collisionWidth-n-s)<0||s<x(r))&&(t.left+=h+i+o):0<l&&(0<(a=t.left-e.collisionPosition.marginLeft+h+i+o-a)||x(a)<l)&&(t.left+=h+i+o)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,a=i.isWindow?i.scrollTop:i.offset.top,o=t.top-e.collisionPosition.marginTop,r=o-a,l=o+e.collisionHeight-n-a,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,o=-2*e.offset[1];r<0?((s=t.top+h+i+o+e.collisionHeight-n-s)<0||s<x(r))&&(t.top+=h+i+o):0<l&&(0<(a=t.top-e.collisionPosition.marginTop+h+i+o-a)||x(a)<l)&&(t.top+=h+i+o)}},flipfit:{left:function(){w.ui.position.flip.left.apply(this,arguments),w.ui.position.fit.left.apply(this,arguments)},top:function(){w.ui.position.flip.top.apply(this,arguments),w.ui.position.fit.top.apply(this,arguments)}}};var t;w.ui.position,w.extend(w.expr[":"],{data:w.expr.createPseudo?w.expr.createPseudo(function(e){return function(t){return!!w.data(t,e)}}):function(t,e,i){return!!w.data(t,i[3])}}),w.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});w.ui.focusable=function(t,e){var i,s,n,a,o=t.nodeName.toLowerCase();return"area"===o?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=w("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(o)?(n=!t.disabled)&&(a=w(t).closest("fieldset")[0])&&(n=!a.disabled):n="a"===o&&t.href||e,n&&w(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}(w(t)))},w.extend(w.expr[":"],{focusable:function(t){return w.ui.focusable(t,null!=w.attr(t,"tabindex"))}});w.ui.focusable,w.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):w(this[0].form)},w.ui.formResetMixin={_formResetHandler:function(){var e=w(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");w.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element.form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(w.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},w.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},w.ui.escapeSelector=(e=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")}),w.fn.labels=function(){var t,e,i;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+w.ui.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e))},w.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=w(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:w(this[0].ownerDocument||document)},w.extend(w.expr[":"],{tabbable:function(t){var e=w.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&w.ui.focusable(t,i)}}),w.fn.extend({uniqueId:(c=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++c)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&w(this).removeAttr("id")})}}),w.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var e,c,d=!1;w(document).on("mouseup",function(){d=!1});w.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===w.data(t.target,e.widgetName+".preventClickEvent"))return w.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&w(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===w.data(t.target,this.widgetName+".preventClickEvent")&&w.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(w.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&w.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,d=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),w.ui.plugin={add:function(t,e,i){var s,n=w.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,a=t.plugins[e];if(a&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<a.length;n++)t.options[a[n][0]]&&a[n][1].apply(t.element,i)}},w.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},w.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&w(t).trigger("blur")};w.widget("ui.draggable",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<w(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=w(this);return w("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=w.ui.safeActiveElement(this.document[0]);w(t.target).closest(e).length||w.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),w.ui.ddmanager&&(w.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===w(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),w.ui.ddmanager&&!e.dropBehaviour&&w.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),w.ui.ddmanager&&w.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new w.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",w.ui.ddmanager&&w.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return w.ui.ddmanager&&!this.options.dropBehaviour&&(i=w.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||w.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?w(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),w.ui.ddmanager&&w.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),w.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new w.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!w(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=w.isFunction(e.helper),t=i?w(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),w.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&w.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=w(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,w(n).width()-this.helperProportions.width-this.margins.left,(w(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[w(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,w(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,w(window).scrollLeft()+w(window).width()-this.helperProportions.width-this.margins.left,w(window).scrollTop()+(w(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),a=t.pageX,o=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(a=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(o=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(a=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(o=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,o=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,a=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(a=this.originalPageX),"x"===s.axis&&(o=this.originalPageY)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),w.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),w.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),w.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=w.extend({},t,{item:i.element});i.sortables=[],w(i.options.connectToSortable).each(function(){var t=w(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=w.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,w.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){w.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,w.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&w.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,w.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,w.each(n.sortables,function(){this.refreshPositions()}))})}}),w.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=w("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&w("body").css("cursor",i._cursor)}}),w.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=w(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&w(e.helper).css("opacity",i._opacity)}}),w.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,a=i.scrollParentNotHidden[0],o=i.document[0];a!==o&&"HTML"!==a.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+a.offsetHeight-t.pageY<s.scrollSensitivity?a.scrollTop=n=a.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(a.scrollTop=n=a.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+a.offsetWidth-t.pageX<s.scrollSensitivity?a.scrollLeft=n=a.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(a.scrollLeft=n=a.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-w(o).scrollTop()<s.scrollSensitivity?n=w(o).scrollTop(w(o).scrollTop()-s.scrollSpeed):w(window).height()-(t.pageY-w(o).scrollTop())<s.scrollSensitivity&&(n=w(o).scrollTop(w(o).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-w(o).scrollLeft()<s.scrollSensitivity?n=w(o).scrollLeft(w(o).scrollLeft()-s.scrollSpeed):w(window).width()-(t.pageX-w(o).scrollLeft())<s.scrollSensitivity&&(n=w(o).scrollLeft(w(o).scrollLeft()+s.scrollSpeed)))),!1!==n&&w.ui.ddmanager&&!s.dropBehaviour&&w.ui.ddmanager.prepareOffsets(i,t)}}),w.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],w(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=w(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,a,o,r,l,h,u,c,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,u=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||u+p<m||!w.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(u-m)<=p,a=Math.abs(r-g)<=p,o=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:u,left:0}).top),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),c=s||n||a||o,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(u-_)<=p,a=Math.abs(r-f)<=p,o=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:u-i.helperProportions.height,left:0}).top),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||a||o||c)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||a||o||c)}}),w.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=w.makeArray(w(i.stack)).sort(function(t,e){return(parseInt(w(t).css("zIndex"),10)||0)-(parseInt(w(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(w(i[0]).css("zIndex"),10)||0,w(i).each(function(t){w(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),w.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=w(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&w(e.helper).css("zIndex",i._zIndex)}});w.ui.draggable;w.widget("ui.resizable",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===w(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;return 0<t[i]||(t[i]=1,e=0<t[i],t[i]=0,e)},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),w.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(w("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&w(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){w(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){this._super(t,e),"handles"===t&&(this._removeHandles(),this._setupHandles())},_setupHandles:function(){var t,e,i,s,n,a=this.options,o=this;if(this.handles=a.handles||(w(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=w(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=w.trim(i[e])),n=w("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:a.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(n);this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=w(this.handles[e]),this._on(this.handles[e],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=w(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=w(this.handles[e])[0])!==t.target&&!w.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=w(s.containment).scrollLeft()||0,i+=w(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=w(".ui-resizable-"+this.axis).css("cursor"),w("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),w.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,a=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:a.sizeDiff.height,i=e?0:a.sizeDiff.width,e={width:a.helper.width()-i,height:a.helper.height()-s},i=parseFloat(a.element.css("left"))+(a.position.left-a.originalPosition.left)||null,s=parseFloat(a.element.css("top"))+(a.position.top-a.originalPosition.top)||null,n.animate||this.element.css(w.extend(e,{top:s,left:i})),a.helper.height(a.size.height),a.helper.width(a.size.width),this._helper&&!n.animate&&this._proportionallyResize()),w("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,a=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,o=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return a&&(t.width=e.minWidth),o&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),a&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),o&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||w("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){w.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),w.ui.plugin.add("resizable","animate",{stop:function(e){var i=w(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),a=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,o=n?0:i.sizeDiff.width,n={width:i.size.width-o,height:i.size.height-a},o=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,a=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(w.extend(n,a&&o?{top:a,left:o}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&w(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),w.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=w(this).resizable("instance"),t=n.options,e=n.element,a=t.containment,o=a instanceof w?a.get(0):/parent/.test(a)?e.parent().get(0):a;o&&(n.containerElement=w(o),/document/.test(a)||a===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:w(document),left:0,top:0,width:w(document).width(),height:w(document).height()||document.body.parentNode.scrollHeight}):(i=w(o),s=[],w(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,a=n.containerSize.width,a=n._hasScroll(o,"left")?o.scrollWidth:a,e=n._hasScroll(o)?o.scrollHeight:e,n.parentData={element:o,left:t.left,top:t.top,width:a,height:e}))},resize:function(t){var e=w(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,a=e._aspectRatio||t.shiftKey,o={top:0,left:0},r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(o=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-o.left),a&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),a&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-o.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-o.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,a&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,a&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=w(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,a=w(t.helper),o=a.offset(),r=a.outerWidth()-t.sizeDiff.width,a=a.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&w(this).css({left:o.left-s.left-i.left,width:r,height:a}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&w(this).css({left:o.left-s.left-i.left,width:r,height:a})}}),w.ui.plugin.add("resizable","alsoResize",{start:function(){var t=w(this).resizable("instance").options;w(t.alsoResize).each(function(){var t=w(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=w(this).resizable("instance"),s=e.options,n=e.originalSize,a=e.originalPosition,o={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-a.top||0,left:e.position.left-a.left||0};w(s.alsoResize).each(function(){var t=w(this),s=w(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];w.each(e,function(t,e){var i=(s[e]||0)+(o[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){w(this).removeData("ui-resizable-alsoresize")}}),w.ui.plugin.add("resizable","ghost",{start:function(){var t=w(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==w.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=w(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=w(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),w.ui.plugin.add("resizable","grid",{resize:function(){var t,e=w(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,u=Math.round((s.width-n.width)/l)*l,c=Math.round((s.height-n.height)/h)*h,d=n.width+u,p=n.height+c,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-c):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-u):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=a.top-c):(p=h-t.height,e.size.height=p,e.position.top=a.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=a.left-u):(d=l-t.width,e.size.width=d,e.position.left=a.left+n.width-d))}});w.ui.resizable,w.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(t){var e=w(t.target),i=w(w.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var e,i;this.previousFilter||(e=w(t.target).closest(".ui-menu-item"),i=w(t.currentTarget),e[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i)))},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(t){this._delay(function(){w.contains(this.element[0],w.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=w(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case w.ui.keyCode.PAGE_UP:this.previousPage(t);break;case w.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case w.ui.keyCode.HOME:this._move("first","first",t);break;case w.ui.keyCode.END:this._move("last","last",t);break;case w.ui.keyCode.UP:this.previous(t);break;case w.ui.keyCode.DOWN:this.next(t);break;case w.ui.keyCode.LEFT:this.collapse(t);break;case w.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case w.ui.keyCode.ENTER:case w.ui.keyCode.SPACE:this._activate(t);break;case w.ui.keyCode.ESCAPE:this.collapse(t);break;default:n=!1,e=this.previousFilter||"",s=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=w(this),e=t.prev(),i=w("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=w(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!w.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(w.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(w.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=w.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:w(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!w(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(e=w(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=w(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||w(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(w.trim(w(this).children(".ui-menu-item-wrapper").text()))})}});w.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=w.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=w.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=w("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==w.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,e){var i;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){w(t.target).trigger(t.originalEvent)});i=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),(i=e.item.attr("aria-label")||i.value)&&w.trim(i).length&&(this.liveRegion.children().hide(),w("<div>").text(i).appendTo(this.liveRegion))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==w.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=w("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||w.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return(t=t&&(t.jquery||t.nodeType?w(t):this.document.find(t).eq(0)))&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,s,n=this;w.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(w.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=w.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(!t||e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return w.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:w.map(t,function(t){return"string"==typeof t?{label:t,value:t}:w.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(w.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;w.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return w("<li>").append(w("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),w.extend(w.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(w.ui.autocomplete.escapeRegex(e),"i");return w.grep(t,function(t){return i.test(t.label||t.value||t)})}}),w.widget("ui.autocomplete",w.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),w("<div>").text(e).appendTo(this.liveRegion))}});w.ui.autocomplete;var p=/ui-corner-([a-z]){2,6}/g;w.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,o=[];w.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=a.element.find(t)).each(function(){var t=w(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(o=o.concat(e.get()))):void(w.fn[s]&&(n=a["_"+s+"Options"]?a["_"+s+"Options"]("middle"):{classes:{}},a.element.find(t).each(function(){var t=w(this),e=t[s]("instance"),i=w.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=a._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),w.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),o.push(i[0]))})))}),this.childWidgets=w(w.unique(o)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=w(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return w.each(i,function(t){var e=s.options.classes[t]||"",e=w.trim(e.replace(p,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,a=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,this.options.onlyVisible&&(n=n.filter(":visible")),n.length&&(w.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&a["_"+s.widgetName+"Options"]?((i=a["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=a._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):a._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});w.widget("ui.checkboxradio",[w.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this,i=this._super()||{};return this._readType(),t=this.element.labels(),this.label=w(t[t.length-1]),this.label.length||w.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){e.originalLabel+=3===this.nodeType?w(this).text():this.outerHTML}),this.originalLabel&&(i.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(i.disabled=t),i},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||w.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+w.ui.escapeSelector(t)+"']";return t?(this.form.length?w(this.form[0].elements).filter(e):w(e).filter(function(){return 0===w(this).form().length})).not(this.element):w([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=w(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=w("<span>"),this.iconSpace=w("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var f;w.ui.checkboxradio;w.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===w.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=w("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=w("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==w.uiBackCompat&&(w.widget("ui.button",w.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),w.fn.button=(f=w.fn.button,function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?f.apply(this,arguments):(w.ui.checkboxradio||w.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}),w.fn.buttonset=function(){return w.ui.controlgroup||w.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var g;w.ui.button;function m(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},w.extend(this._defaults,this.regional[""]),this.regional.en=w.extend(!0,{},this.regional[""]),this.regional["en-US"]=w.extend(!0,{},this.regional.en),this.dpDiv=_(w("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function _(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){w(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&w(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&w(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,v)}function v(){w.datepicker._isDisabledDatepicker((g.inline?g.dpDiv.parent():g.input)[0])||(w(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),w(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&w(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&w(this).addClass("ui-datepicker-next-hover"))}function b(t,e){for(var i in w.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}w.extend(w.ui,{datepicker:{version:"1.12.1"}}),w.extend(m.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return b(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(w(t),n)).settings=w.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?_(w("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=w(t);e.append=w([]),e.trigger=w([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),w.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=w("<span class='"+this._appendClass+"'>"+s+"</span>"),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),e.trigger=w(this._get(e,"buttonImageOnly")?w("<img/>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):w("<button type='button'></button>").addClass(this._triggerClass).html(i?w("<img/>").attr({src:i,alt:s,title:s}):s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return w.datepicker._datepickerShowing&&w.datepicker._lastInput===t[0]?w.datepicker._hideDatepicker():(w.datepicker._datepickerShowing&&w.datepicker._lastInput!==t[0]&&w.datepicker._hideDatepicker(),w.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,a,o;this._get(t,"autoSize")&&!t.inline&&(a=new Date(2009,11,20),(o=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length))},_inlineDatepicker:function(t,e){var i=w(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),w.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var a,o=this._dialogInst;return o||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=w("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),w("body").append(this._dialogInput),(o=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},w.data(this._dialogInput[0],"datepicker",o)),b(o.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(o,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(a=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),o.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),w.blockUI&&w.blockUI(this.dpDiv),w.data(this._dialogInput[0],"datepicker",o),this},_destroyDatepicker:function(t){var e,i=w(t),s=w.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),w.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),g===s&&(g=null))},_enableDatepicker:function(e){var t,i=w(e),s=w.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=w.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=w(e),s=w.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=w.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return w.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,a,o,r=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?w.extend({},w.datepicker._defaults):r?"all"===e?w.extend({},r.settings):this._get(r,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),r&&(this._curInst===r&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),a=this._getMinMaxDate(r,"min"),o=this._getMinMaxDate(r,"max"),b(r.settings,s),null!==a&&void 0!==s.dateFormat&&void 0===s.minDate&&(r.settings.minDate=this._formatDate(r,a)),null!==o&&void 0!==s.dateFormat&&void 0===s.maxDate&&(r.settings.maxDate=this._formatDate(r,o)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(w(t),r),this._autoSize(r),this._setDate(r,n),this._updateAlternate(r),this._updateDatepicker(r))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=w.datepicker._getInst(t.target),n=!0,a=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,w.datepicker._datepickerShowing)switch(t.keyCode){case 9:w.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=w("td."+w.datepicker._dayOverClass+":not(."+w.datepicker._currentClass+")",s.dpDiv))[0]&&w.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=w.datepicker._get(s,"onSelect"))?(i=w.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):w.datepicker._hideDatepicker(),!1;case 27:w.datepicker._hideDatepicker();break;case 33:w.datepicker._adjustDate(t.target,t.ctrlKey?-w.datepicker._get(s,"stepBigMonths"):-w.datepicker._get(s,"stepMonths"),"M");break;case 34:w.datepicker._adjustDate(t.target,t.ctrlKey?+w.datepicker._get(s,"stepBigMonths"):+w.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&w.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&w.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&w.datepicker._adjustDate(t.target,a?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&w.datepicker._adjustDate(t.target,t.ctrlKey?-w.datepicker._get(s,"stepBigMonths"):-w.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&w.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&w.datepicker._adjustDate(t.target,a?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&w.datepicker._adjustDate(t.target,t.ctrlKey?+w.datepicker._get(s,"stepBigMonths"):+w.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&w.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?w.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=w.datepicker._getInst(t.target);if(w.datepicker._get(i,"constrainInput"))return e=w.datepicker._possibleChars(w.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){var e=w.datepicker._getInst(t.target);if(e.input.val()!==e.lastVal)try{w.datepicker.parseDate(w.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,w.datepicker._getFormatConfig(e))&&(w.datepicker._setDateFromField(e),w.datepicker._updateAlternate(e),w.datepicker._updateDatepicker(e))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=w("input",t.parentNode)[0]),w.datepicker._isDisabledDatepicker(t)||w.datepicker._lastInput===t||(n=w.datepicker._getInst(t),w.datepicker._curInst&&w.datepicker._curInst!==n&&(w.datepicker._curInst.dpDiv.stop(!0,!0),n&&w.datepicker._datepickerShowing&&w.datepicker._hideDatepicker(w.datepicker._curInst.input[0])),!1!==(i=(s=w.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(b(n.settings,i),n.lastVal=null,w.datepicker._lastInput=t,w.datepicker._setDateFromField(n),w.datepicker._inDialog&&(t.value=""),w.datepicker._pos||(w.datepicker._pos=w.datepicker._findPos(t),w.datepicker._pos[1]+=t.offsetHeight),e=!1,w(t).parents().each(function(){return!(e|="fixed"===w(this).css("position"))}),s={left:w.datepicker._pos[0],top:w.datepicker._pos[1]},w.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),w.datepicker._updateDatepicker(n),s=w.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:w.datepicker._inDialog&&w.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=w.datepicker._get(n,"showAnim"),s=w.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(w(t))+1),w.datepicker._datepickerShowing=!0,w.effects&&w.effects.effect[i]?n.dpDiv.show(i,w.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),w.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),w.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(g=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a");0<n.length&&v.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===w.datepicker._curInst&&w.datepicker._datepickerShowing&&w.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),e=t.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),a=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:w(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:w(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-a:0,e.left-=i&&e.left===t.input.offset().left?w(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+o?w(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+o):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||w.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=w(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==w.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){w.datepicker._tidyDialog(s)},w.effects&&(w.effects.effect[e]||w.effects[e])?s.dpDiv.hide(e,w.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),w.blockUI&&(w.unblockUI(),w("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;w.datepicker._curInst&&(e=w(t.target),t=w.datepicker._getInst(e[0]),(e[0].id===w.datepicker._mainDivId||0!==e.parents("#"+w.datepicker._mainDivId).length||e.hasClass(w.datepicker.markerClassName)||e.closest("."+w.datepicker._triggerClass).length||!w.datepicker._datepickerShowing||w.datepicker._inDialog&&w.blockUI)&&(!e.hasClass(w.datepicker.markerClassName)||w.datepicker._curInst===t)||w.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=w(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e+("M"===i?this._get(t,"showCurrentAtPos"):0),i),this._updateDatepicker(t))},_gotoToday:function(t){var e=w(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=w(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=w(t);w(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=w("a",s).html(),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=w(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=w(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),w(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;function a(t){return(t=k+1<e.length&&e.charAt(k+1)===t)&&k++,t}function i(t){var e=a(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}");if(!(e=n.substring(u).match(e)))throw"Missing number at position "+u;return u+=e[0].length,parseInt(e[0],10)}function s(t,e,i){var s=-1,e=w.map(a(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(w.each(e,function(t,e){var i=e[1];if(n.substr(u,i.length).toLowerCase()===i.toLowerCase())return s=e[0],u+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+u}function o(){if(n.charAt(u)!==e.charAt(k))throw"Unexpected literal at position "+u;u++}for(var r,l,h,u=0,c=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,p=(t?t.dayNames:null)||this._defaults.dayNames,f=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,g=(t?t.monthNames:null)||this._defaults.monthNames,m=-1,_=-1,v=-1,b=-1,y=!1,k=0;k<e.length;k++)if(y)"'"!==e.charAt(k)||a("'")?o():y=!1;else switch(e.charAt(k)){case"d":v=i("d");break;case"D":s("D",d,p);break;case"o":b=i("o");break;case"m":_=i("m");break;case"M":_=s("M",f,g);break;case"y":m=i("y");break;case"@":m=(h=new Date(i("@"))).getFullYear(),_=h.getMonth()+1,v=h.getDate();break;case"!":m=(h=new Date((i("!")-this._ticksTo1970)/1e4)).getFullYear(),_=h.getMonth()+1,v=h.getDate();break;case"'":a("'")?o():y=!0;break;default:o()}if(u<n.length&&(l=n.substr(u),!/^\s+/.test(l)))throw"Extra/unparsed characters found in date: "+l;if(-1===m?m=(new Date).getFullYear():m<100&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(m<=c?0:-100)),-1<b)for(_=1,v=b;;){if(v<=(r=this._getDaysInMonth(m,_-1)))break;_++,v-=r}if((h=this._daylightSavingAdjust(new Date(m,_-1,v))).getFullYear()!==m||h.getMonth()+1!==_||h.getDate()!==v)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function n(t){return(t=o+1<e.length&&e.charAt(o+1)===t)&&o++,t}function s(t,e,i){var s=""+e;if(n(t))for(;s.length<i;)s="0"+s;return s}function a(t,e,i,s){return(n(t)?s:i)[e]}var o,r=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,l=(i?i.dayNames:null)||this._defaults.dayNames,h=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,u=(i?i.monthNames:null)||this._defaults.monthNames,c="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||n("'")?c+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":c+=s("d",t.getDate(),2);break;case"D":c+=a("D",t.getDay(),r,l);break;case"o":c+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=s("m",t.getMonth()+1,2);break;case"M":c+=a("M",t.getMonth(),h,u);break;case"y":c+=n("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":n("'")?c+="'":d=!0;break;default:c+=e.charAt(o)}return c},_possibleChars:function(e){function t(t){return(t=n+1<e.length&&e.charAt(n+1)===t)&&n++,t}for(var i="",s=!1,n=0;n<e.length;n++)if(s)"'"!==e.charAt(n)||t("'")?i+=e.charAt(n):s=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":t("'")?i+="'":s=!0;break;default:i+=e.charAt(n)}return i},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,o=this._getFormatConfig(t);try{a=this.parseDate(i,s,o)||n}catch(t){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return w.datepicker.parseDate(w.datepicker._get(r,"dateFormat"),t,w.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?w.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,o=a.exec(t);o;){switch(o[2]||"d"){case"d":case"D":n+=parseInt(o[1],10);break;case"w":case"W":n+=7*parseInt(o[1],10);break;case"m":case"M":s+=parseInt(o[1],10),n=Math.min(n,w.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(o[1],10),n=Math.min(n,w.datepicker._getDaysInMonth(i,s))}o=a.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){w.datepicker._adjustDate(i,-e,"M")},next:function(){w.datepicker._adjustDate(i,+e,"M")},hide:function(){w.datepicker._hideDatepicker()},today:function(){w.datepicker._gotoToday(i)},selectDay:function(){return w.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return w.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return w.datepicker._selectMonthYear(i,this,"Y"),!1}};w(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,o,r,l,h,u,c,d,p,f,g,m,_,v,b,y,k,w,D,x,C,M,T,I,z,S,P,E=new Date,N=this._daylightSavingAdjust(new Date(E.getFullYear(),E.getMonth(),E.getDate())),A=this._get(t,"isRTL"),O=this._get(t,"showButtonPanel"),H=this._get(t,"hideIfNoPrevNext"),W=this._get(t,"navigationAsDateFormat"),F=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),E=this._get(t,"stepMonths"),L=1!==F[0]||1!==F[1],Y=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),B=this._getMinMaxDate(t,"min"),j=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),j)for(e=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth()-F[0]*F[1]+1,j.getDate())),e=B&&e<B?B:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=W?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-E,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+R+"'><span class='ui-icon ui-icon-circle-triangle-"+(A?"e":"w")+"'>"+R+"</span></a>":H?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+R+"'><span class='ui-icon ui-icon-circle-triangle-"+(A?"e":"w")+"'>"+R+"</span></a>",R=this._get(t,"nextText"),R=W?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+E,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+R+"'><span class='ui-icon ui-icon-circle-triangle-"+(A?"w":"e")+"'>"+R+"</span></a>":H?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+R+"'><span class='ui-icon ui-icon-circle-triangle-"+(A?"w":"e")+"'>"+R+"</span></a>",H=this._get(t,"currentText"),R=this._get(t,"gotoCurrent")&&t.currentDay?Y:N,H=W?this.formatDate(H,R,this._getFormatConfig(t)):H,W=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",W=O?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(A?W:"")+(this._isInRange(t,R)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+H+"</button>":"")+(A?"":W)+"</div>":"",n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,a=this._get(t,"showWeek"),o=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),u=this._get(t,"beforeShowDay"),c=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<F[0];m++){for(_="",this.maxRows=4,v=0;v<F[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),D=" ui-corner-all",y="",L){if(y+="<div class='ui-datepicker-group",1<F[1])switch(v){case 0:y+=" ui-datepicker-group-first",D=" ui-corner-"+(A?"right":"left");break;case F[1]-1:y+=" ui-datepicker-group-last",D=" ui-corner-"+(A?"left":"right");break;default:y+=" ui-datepicker-group-middle",D=""}y+="'>"}for(y+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+D+"'>"+(/all|left/.test(D)&&0===m?A?s:i:"")+(/all|right/.test(D)&&0===m?A?i:s:"")+this._generateMonthYearHeader(t,K,U,B,j,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",k=a?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)k+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+o[w=(g+n)%7]+"'>"+r[w]+"</span></th>";for(y+=k+"</tr></thead><tbody>",x=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,x)),D=(this._getFirstDayOfMonth(U,K)-n+7)%7,x=Math.ceil((D+x)/7),C=L&&this.maxRows>x?this.maxRows:x,this.maxRows=C,M=this._daylightSavingAdjust(new Date(U,K,1-D)),T=0;T<C;T++){for(y+="<tr>",I=a?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(M)+"</td>":"",g=0;g<7;g++)z=u?u.apply(t.input?t.input[0]:null,[M]):[!0,""],P=(S=M.getMonth()!==K)&&!d||!z[0]||B&&M<B||j&&j<M,I+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(S?" ui-datepicker-other-month":"")+(M.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===M.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(P?" "+this._unselectableClass+" ui-state-disabled":"")+(S&&!c?"":" "+z[1]+(M.getTime()===Y.getTime()?" "+this._currentClass:"")+(M.getTime()===N.getTime()?" ui-datepicker-today":""))+"'"+(S&&!c||!z[2]?"":" title='"+z[2].replace(/'/g,"&#39;")+"'")+(P?"":" data-handler='selectDay' data-event='click' data-month='"+M.getMonth()+"' data-year='"+M.getFullYear()+"'")+">"+(S&&!c?"&#xa0;":P?"<span class='ui-state-default'>"+M.getDate()+"</span>":"<a class='ui-state-default"+(M.getTime()===N.getTime()?" ui-state-highlight":"")+(M.getTime()===Y.getTime()?" ui-state-active":"")+(S?" ui-priority-secondary":"")+"' href='#'>"+M.getDate()+"</a>")+"</td>",M.setDate(M.getDate()+1),M=this._daylightSavingAdjust(M);y+=I+"</tr>"}11<++K&&(K=0,U++),_+=y+="</tbody></table>"+(L?"</div>"+(0<F[0]&&v===F[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=W,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,a,o,r){var l,h,u,c,d,p,f,g=this._get(t,"changeMonth"),m=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),v="<div class='ui-datepicker-title'>",b="";if(a||!g)b+="<span class='ui-datepicker-month'>"+o[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;u<12;u++)(!l||u>=s.getMonth())&&(!h||u<=n.getMonth())&&(b+="<option value='"+u+"'"+(u===e?" selected='selected'":"")+">"+r[u]+"</option>");b+="</select>"}if(_||(v+=b+(!a&&g&&m?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!m)v+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=(o=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(t)?d:t})(c[0]),f=Math.max(p,o(c[1]||"")),p=s?Math.max(p,s.getFullYear()):p,f=n?Math.min(f,n.getFullYear()):f,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";p<=f;p++)t.yearshtml+="<option value='"+p+"'"+(p===i?" selected='selected'":"")+">"+p+"</option>";t.yearshtml+="</select>",v+=t.yearshtml,t.yearshtml=null}return v+=this._get(t,"yearSuffix"),_&&(v+=(!a&&g&&m?"":"&#xa0;")+b),v+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,a=null,o=this._get(t,"yearRange");return o&&(t=o.split(":"),o=(new Date).getFullYear(),n=parseInt(t[0],10),a=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=o),t[1].match(/[+\-].*/)&&(a+=o)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!a||e.getFullYear()<=a)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),w.fn.datepicker=function(t){if(!this.length)return this;w.datepicker.initialized||(w(document).on("mousedown",w.datepicker._checkExternalClick),w.datepicker.initialized=!0),0===w("#"+w.datepicker._mainDivId).length&&w("body").append(w.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?w.datepicker["_"+t+"Datepicker"].apply(w.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?w.datepicker["_"+t+"Datepicker"].apply(w.datepicker,[this].concat(e)):w.datepicker._attachDatepicker(this,t)})},w.datepicker=new m,w.datepicker.initialized=!1,w.datepicker.uuid=(new Date).getTime(),w.datepicker.version="1.12.1";w.datepicker;w.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=w(this).css(t).offset().top;e<0&&w(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&w.fn.draggable&&this._makeDraggable(),this.options.resizable&&w.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?w(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:w.noop,enable:w.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||w.ui.safeBlur(w.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+w(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=w(w.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=t||this.element.find("[autofocus]")).length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(t){function e(){var t=w.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||w.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),e.call(this),this._delay(e)},_createWrapper:function(){this.uiDialog=w("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===w.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==w.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.filter(":first"),s=e.filter(":last"),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=w("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){w(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=w("<button type='button'></button>").button({label:w("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=w("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=w("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=w("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),w.isEmptyObject(t)||w.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(w.each(t,function(t,e){var i;e=w.isFunction(e)?{click:e,text:t}:e,e=w.extend({type:"button"},e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,w("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,a=this.options;function o(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(w(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,o(e))},drag:function(t,e){n._trigger("drag",t,o(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();a.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(w(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,o(e))}})},_makeResizable:function(){var n=this,a=this.options,t=a.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function o(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(w(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,o(e))},resize:function(t,e){n._trigger("resize",t,o(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();a.height=n.uiDialog.height(),a.width=n.uiDialog.width(),a.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(w(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,o(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=w(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=w.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};w.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:w("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=w(this);return w("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!w(t.target).closest(".ui-dialog").length||!!w(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var e;this.options.modal&&(e=!0,this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=w("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==w.uiBackCompat&&w.widget("ui.dialog",w.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});var y;w.ui.dialog,w.widget("ui.slider",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(w(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){w(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:w.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=w("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,e,o,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),o={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(o),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=w(this),a=t)}),!1!==this._start(t,a)&&(this._mouseSliding=!0,this._handleIndex=a,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),o=!w(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=o?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return 1<t&&(t=1),t<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),a=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),a[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,a))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!w.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),w.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;s<i.length;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,a=this.options.range,o=this.options,r=this,l=!this._animateOff&&o.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",w(this).stop(1,1)[l?"animate":"css"](h,o.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},o.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:o.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},o.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:o.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,o.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},o.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},o.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},o.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},o.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=w(t.target).data("ui-slider-handle-index");switch(t.keyCode){case w.ui.keyCode.HOME:case w.ui.keyCode.END:case w.ui.keyCode.PAGE_UP:case w.ui.keyCode.PAGE_DOWN:case w.ui.keyCode.UP:case w.ui.keyCode.RIGHT:case w.ui.keyCode.DOWN:case w.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(w(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case w.ui.keyCode.HOME:i=this._valueMin();break;case w.ui.keyCode.END:i=this._valueMax();break;case w.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case w.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case w.ui.keyCode.UP:case w.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case w.ui.keyCode.DOWN:case w.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=w(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(w(t.target),null,"ui-state-active"))}}});w.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(y=/#.*$/,function(t){var e=t.href.replace(y,""),i=location.href.replace(y,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),w.isArray(t.disabled)&&(t.disabled=w.unique(t.disabled.concat(w.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=w(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(w(e).attr("aria-controls")===s)return i=t,!1}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==i&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),!t&&!1===i&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):w()}},_tabKeydown:function(t){var e=w(w.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case w.ui.keyCode.RIGHT:case w.ui.keyCode.DOWN:i++;break;case w.ui.keyCode.UP:case w.ui.keyCode.LEFT:s=!1,i--;break;case w.ui.keyCode.END:i=this.anchors.length-1;break;case w.ui.keyCode.HOME:i=0;break;case w.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case w.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===w.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===w.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===w.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==w.inArray((i<t&&(t=0),t<0&&(t=i),t),this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=w.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!w.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=w()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=w()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){w(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){w(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return w("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=w(),this.anchors.each(function(t,e){var i,s,n,a=w(e).uniqueId().attr("id"),o=w(e).closest("li"),r=o.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(i="#"+(n=o.attr("aria-controls")||w({}).uniqueId()[0].id),(s=l.element.find(i)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&o.data("ui-tabs-aria-controls",r),o.attr({"aria-controls":n,"aria-labelledby":a}),s.attr("aria-labelledby",a)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return w("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(w.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=w(e),!0===t||-1!==w.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&w.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=w(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=w(this).outerHeight(!0)}),this.panels.each(function(){w(this).height(Math.max(0,i-w(this).innerHeight()+w(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,w(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=w(t.currentTarget).closest("li"),n=s[0]===i[0],a=n&&e.collapsible,o=a?w():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):w(),i={oldTab:i,oldPanel:r,newTab:a?w():s,newPanel:o};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!a&&this.tabs.index(s),this.active=n?w():s,this.xhr&&this.xhr.abort(),r.length||o.length||w.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function a(){i.running=!1,i._trigger("activate",t,e)}function o(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,a):(s.show(),a())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),o()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),o()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===w(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t.length||(t=this.active),t=t.find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:w.noop}))},_findActive:function(t){return!1===t?w():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+w.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){w.data(this,"ui-tabs-destroy")?w(this).remove():w(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=w(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),w.isArray(t)?w.map(t,function(t){return t!==i?t:null}):w.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==w.inArray(t,e))return;e=w.isArray(e)?w.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&a.panels.stop(!1,!0),a._removeClass(i,"ui-tabs-loading"),o.removeAttr("aria-busy"),t===a.xhr&&delete a.xhr}var a=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),r={tab:i,panel:o};this._isLocal(t[0])||(this.xhr=w.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){o.html(t),a._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,w.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=w(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==w.uiBackCompat&&w.widget("ui.tabs",w.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});w.ui.tabs;w.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=w(this).attr("title")||"";return w("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",w.trim(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=w.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=w.trim(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=w("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=w([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&w.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;w.each(this.tooltips,function(t,e){var i=w.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=w(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=w(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=w([])},open:function(t){var i=this,e=w(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=w(this);e.data("ui-tooltip-open")&&((t=w.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,a,o=w.extend({},this.options.position);function r(t){o.of=t,n.is(":hidden")||n.position(o)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=w("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(w.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(a=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(o.of),clearInterval(a))},w.fx.interval)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===w.ui.keyCode.ESCAPE&&((t=w.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){this._removeTooltip(this._find(e).tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=w(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(w(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&w.each(this.parents,function(t,e){w(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=w("<div>").attr("role","tooltip"),i=w("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t.length||(t=this.document[0].body),t},_destroy:function(){var s=this;w.each(this.tooltips,function(t,e){var i=w.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),w("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==w.uiBackCompat&&w.widget("ui.tooltip",w.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});w.ui.tooltip});;
String.format = function () {
    var s = arguments[0];
    for (var i = 0; i < arguments.length - 1; i++) {
        var reg = new RegExp("\\{" + i + "\\}", "gm");
        s = s.replace(reg, arguments[i + 1]);
    }
    return s;
}

function heightWithSameBorders(offsetHeight, border) {
    return offsetHeight+2*border;
}

function isTouchDevice() {
    return 'ontouchstart' in window || navigator.maxTouchPoints;      
}

function getAllLocalStorageItems() {
    var arr = [];
    for(var klucz in localStorage) {
        arr.push(klucz, localStorage.getItem(klucz));
    }

    return arr;
}

function getFromStorage(key) {
    try {
        return JSON.parse(localStorage.getItem(key));
    } catch(err) {
        console.log(err);
    }
}

function setToStorage(key, val) {
    try {
        localStorage.setItem(key, JSON.stringify(val));
    } catch (err) {
        console.log(err);
    }
}

function incrementStorageKey(key) {
    var count = getFromStorage(key);
    if (count == null) {
        count = 0;
    }
    count++;
    setToStorage(key, count);
}

function guid() {
    function s4() {
        return Math.floor((1 + Math.random()) * 0x10000)
          .toString(16)
          .substring(1);
    }
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
      s4() + '-' + s4() + s4() + s4();
}

function gaevent() {
    console.log("gaevent");
    console.log(arguments);
    try {
        ga(arguments);
    }
    catch(err)
    {
        log.error("gaevent():" + err.message);
    }
}
;
function fireClickEventOnEnter(textbox, button) {
    $(textbox).keypress(function (event) {
        if (event.keyCode == '13') {
            event.preventDefault();

            var href = $(button).attr("href");
            if (href != undefined && href.startsWith('javascript:')) {
                eval(href);
                return false;
            }

            $(button).click();
            return false;
        }
    });
}

function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString()) + ";path=/";
}

function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}

function NIPIsValid(nip) {
    var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7];
    nip = nip.replace(/[\s-]/g, '');

    if (nip.length == 10 && parseInt(nip, 10) > 0) {
        var sum = 0;
        for (var i = 0; i < 9; i++) {
            sum += nip[i] * weights[i];
        }
        return (sum % 11) == nip[9];
    }
    return false;
}

function validateNIP(sender, args) {
    args.IsValid = NIPIsValid(args.Value);
}

function selectAllText(textbox) {
    textbox.focus();
    textbox.select();
}

/* Sprawdza czy przesłany znak jest cyfrą lub znakiem + */
function CheckPhoneNumberChar(e) {
    var charCode = (e.which) ? e.which : event.keyCode;
    if (charCode !== 43 && charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;
}

function PostValidationData(args, url, data) {
    $.ajax({
        type: "POST",
        async: false,
        timeout: 500,
        contentType: "application/json",
        dataType: "json",
        url: url,
        data: data,
        success: function (result) {
            args.IsValid = result.d;
        }
    });
}

var Respond_True = function (sender, args) { args.IsValid = true; };
var Respond_False = function (sender, args) { args.IsValid = false; };

function AjaxValidator(sender, args, ajaxSettings) {
    args.IsValid = false;

    //This is a reference to our validator control
    var $sender = $(sender);

    //Save the original message, color and validation function to restore them later.
    if ($sender.data("orig-text") == undefined) {
        $sender.data("orig-text", $sender.text());
    }
    //if ($sender.data("orig-class") == undefined) {
    //    $sender.data("orig-class", $sender.css());
    //}
    if ($sender.data("orig-function") == undefined) {
        $sender.data("orig-function", sender.clientvalidationfunction);
    }

    //var originalMessage = $sender.text();
    //var originalColor = $sender.css("color");
    //var originalFunction = sender.clientvalidationfunction;

    var validatedControl = $("#" + sender.controltovalidate);

    //Change the error message for a friendlier one.
    $sender.text("Sprawdzanie...").addClass("checking");

    //SpinnerIcon("#iv_login");
    var setRespondFunction = function (respondFunction) {
        sender.clientvalidationfunction = respondFunction; //$sender.data("orig-function");

        //Reconstitute original styles.
        $sender.text($sender.data("orig-text")).removeClass("checking");
        //$sender.text(originalMessage).css({ color: originalColor });

        //Re-validate our control
        ValidatorValidate(sender, null, null);
        ValidatorUpdateIsValid();

        var onChange = function () {
            //Reset the original validation function
            sender.clientvalidationfunction = $sender.data("orig-function");
            //sender.clientvalidationfunction = originalFunction;
            //Re-validate to ensure the original validation function gets called
            ValidatorValidate(sender, null, null);
            ValidatorUpdateIsValid();
            //Ensure the validation function is called just once.
            validatedControl.unbind("change", onChange);
        };
        validatedControl.on("change", onChange);
    }

    var originalSuccessFunction = ajaxSettings.success;
    //Start the AJAX call..
    $.ajax($.extend(ajaxSettings, {
        success: function (data) {
            setRespondFunction(originalSuccessFunction(data) ? "Respond_True" : "Respond_False");
        }
    }));
}

function ValidatorByName(name) {

    for (i = 0; i < Page_Validators.length; i++) {
        if (Page_Validators[i].id == name) {
            return Page_Validators[i];
        }
    }
    return undefined;
}

function Page_ClientValidateReset() {
    if (typeof (Page_Validators) != "undefined") {
        for (var i = 0; i < Page_Validators.length; i++) {
            var validator = Page_Validators[i];
            validator.isvalid = true;
            ValidatorUpdateDisplay(validator);
        }
    }
}

function timeoutFadeOut(obj) {
    if (obj != undefined) {
        t = setTimeout(function (t) {
            obj.fadeOut("fast");
        }, 3000);
        obj.data("timeout", t);
    }
}

function timeoutHide(obj) {
    if (obj != undefined) {
        t = setTimeout(function (t) {
            obj.hide();
        }, 3000);
        obj.data("timeout", t);
    }
}

/* Zastąpiona przez customTabs  - nieużywane?*/
//function postBackTabs(selector) {
//    window.location.hash = selector;
//    alert();
//    var aspnetForm = $('#aspnetForm')[0];
//    if (aspnetForm.action.indexOf('#') >= 0) {
//        aspnetForm.action = aspnetForm.action.substr(0, aspnetForm.action.indexOf('#'));
//    }
//    aspnetForm.action += selector;
//}

function customTabs(selector, ulClassName, activeTabNumber, useJqueryUIStyles) {
    var localHash = window.location.hash;

    ChangeTab(selector, ulClassName, localHash, activeTabNumber, useJqueryUIStyles);

    $(window).on('hashchange', function () {
        ChangeTab(selector, ulClassName, window.location.hash, activeTabNumber, useJqueryUIStyles);
        /* po zmianie zakładki przescrollowanie do hash'a */
        //var hash = window.location.hash;
        //if (hash) {
        //	var elem = document.getElementById(hash.substring(1));
        //	if (elem) {
        //		elem.scrollIntoView({ behavior: 'smooth' });
        //	}
        //}
    });
}

function ChangeTab(selector, ulClassName, hash, activeTabNumber, useJqueryUIStyles) {

	var hrefs = [];

	try {
		$("." + ulClassName + " li").each(function() {
			hrefs.push($(this).find('a').attr('href'));
		});
	} catch (error) {
		console.log("function ChangeTab: get elements with hrefs error");
	}

	var hashes = ["#opis", "#dawkowanie", "#wartosci", "#opinie", "#sposob"];

	if (hash == '' || (hrefs.length > 0 && hrefs.includes(hash)) || hashes.includes(hash))
	{
		if (hash == '') {
	        hash = $("." + ulClassName + " a").eq(activeTabNumber).attr("href");
	    }

	    $("#" + selector + " > div").hide();

	    if (useJqueryUIStyles) {
	        $("#" + selector + " > div").addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");
	    } else {
	        $("." + ulClassName + " a").removeClass("active");
	    }

	    $("." + ulClassName + " a").each(function (index) {
	        var href = $(this).attr("href");
	        $(this).parent().removeClass("ui-tabs-active").removeClass("ui-state-active");
	        if (href == hash)
	        {
	            if (useJqueryUIStyles) {
	                $(this).parent().addClass("ui-tabs-active ui-state-active");
	            } else {
	                $(this).addClass("active");
	            }
	            $(href).show(); /*.replace("#", "#tab_")*/
	            $(href + " > div").show();
	        }
	    });
    $("." + ulClassName + " a").each(function (index) {
        var href = $(this).attr("href");
        $(this).parent().removeClass("ui-tabs-active").removeClass("ui-state-active");
        if (href == hash) {
            if (useJqueryUIStyles) {
                $(this).parent().addClass("ui-tabs-active ui-state-active");
            } else {
                $(this).addClass("active");
            }
            $(href).show(); /*.replace("#", "#tab_")*/
            $(href + " > div").show();
        }
    });

			PrzytnijInneOpakowania();
	}
}

/* jeśli inne opakowania nie zmieszcza sie */
function PrzytnijInneOpakowania() {

    if ($(window).width() >= 786) {

        var boxH = $('.product-page .master-width').eq(0).height();
        var buyboxH = $('.product-page .product-aside').height();
        //var inneOpakowaniaHandler = $('.product-page .produkt-dostepny-polecane .inne-opakowania');
        var inneOpakowaniaHandler = $('.product-replacments--all-packs');
        var otherPacksH = inneOpakowaniaHandler.height();
        var difference = (boxH - buyboxH);
        var active = $('.product-page #szczegoly-tabs .ui-tabs-active a')[0].hash;
        var content = $('.product-page #szczegoly-tabs').find(active);
        var contentH = content.height();
        var otherBoxSize = 296 + inneOpakowaniaHandler.find('h3').height();
        var copyrightsH = $('.product-page .product-copyrights').height();
        var infoH = $('.product-page .product-information').height();
        if (difference < otherBoxSize && difference != 0) {
            content.css('min-height', contentH + otherBoxSize - difference); //0     
        }

        if (difference <= 0) {


            if (copyrightsH === undefined) {
                copyrightsH = 0;
            }

            var szczegolyH = $('.product-page #szczegoly-tabs').height();
            var infoH = $('.product-page .product-information').height();
            var truncatedH = (buyboxH - (szczegolyH + infoH)) - (copyrightsH + 53);

            content.css('min-height', contentH + otherBoxSize + truncatedH); //0
        }

        boxH = $('.product-page .master-width').eq(0).height();
        difference = boxH - buyboxH;
        var zamienikiboxsize = (contentH + copyrightsH + infoH) - buyboxH;

        if (difference - otherPacksH < 0) {
            console.log("Test przytnij if");
            inneOpakowaniaHandler.find(".replacments")
                .slimScroll({
                    height: String.format("{0}px", (250)), //90
                    alwaysVisible: true
                });
        }

        else {
            // TODO: opieranie się na ID na sztywno jest zawodne
            console.log("Test przytnij else");
            //inneOpakowaniaHandler.slimScroll({ destroy: true });
            if ($("#ContentPlaceHolder1_InneOpakowanieProduktControl1_pContainer").find(".slimScrollDiv").length) {
                console.log("Test przytnij else - find");
                $(".slimScrollDiv .slimScrollBar,.slimScrollRail").remove();
                $("#ContentPlaceHolder1_InneOpakowanieProduktControl1_pContainer .slimScrollDiv").contents().unwrap();
                $(".replacments").attr("style", "");
            } else {
                console.log("Test przytnij else - nie");
            }



        }
    }
}
function getRows(selector) {
    var height = $(selector).height();
    var line_height = $(selector).css('line-height');
    line_height = parseFloat(line_height);
    var rows = height / line_height;
    return Math.round(rows);
}



(function ($) {
    if ($('#opinion-text').length) {
        if (getRows('#opinion-text') > 5) {
            $('#opinion-expander').css('display', 'block');
        }
    }

    $.widget("custom.combobox", {
        _create: function () {
            this.wrapper = $("<span>")
                .addClass("custom-combobox")
                .insertAfter(this.element);
            this.element.hide();
            this._createAutocomplete();
            this._createShowAllButton();
        },
        _createAutocomplete: function () {
            var selected = this.element.children(":selected"),
                value = selected.val() ? selected.text() : "";
            this.input = $("<input>")
                .appendTo(this.wrapper)
                .val(value)
                .attr("title", "")
                .addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left")
                .autocomplete({
                    delay: 0,
                    minLength: 0,
                    source: $.proxy(this, "_source")
                })
                .tooltip({
                    tooltipClass: "ui-state-highlight"
                });
            this._on(this.input, {
                autocompleteselect: function (event, ui) {
                    ui.item.option.selected = true;
                    this._trigger("select", event, {
                        item: ui.item.option
                    });
                },
                autocompletechange: "_removeIfInvalid"
            });
        },
        _createShowAllButton: function () {
            var input = this.input,
                wasOpen = false;
            $("<a>")
                .attr("tabIndex", -1)
                .attr("title", "Pokaż wszystko")
                .tooltip()
                .appendTo(this.wrapper)
                .button({
                    icons: {
                        primary: "ui-icon-triangle-1-s"
                    },
                    text: false
                })
                .html('<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span><span class="ui-button-text"></span>')
                .removeClass("ui-corner-all")
                .addClass("custom-combobox-toggle ui-button ui-widget ui-state-default ui-button-icon-only")
                .mousedown(function () {
                    wasOpen = input.autocomplete("widget").is(":visible");
                })
                .click(function () {
                    input.focus();
                    // Close if already visible
                    if (wasOpen) {
                        return;
                    }
                    // Pass empty string as value to search for, displaying all results
                    input.autocomplete("search", "");
                });
        },
        _source: function (request, response) {
            var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
            response(this.element.children("option").map(function () {
                var text = $(this).text();
                if (this.value && (!request.term || matcher.test(text)))
                    return {
                        label: text,
                        value: text,
                        option: this
                    };
            }));
        },
        _removeIfInvalid: function (event, ui) {
            // Selected an item, nothing to do
            if (ui.item) {
                return;
            }
            // Search for a match (case-insensitive)
            var value = this.input.val(),
                valueLowerCase = value.toLowerCase(),
                valid = false;
            this.element.children("option").each(function () {
                if ($(this).text().toLowerCase() === valueLowerCase) {
                    this.selected = valid = true;
                    return false;
                }
            });
            // Found a match, nothing to do
            if (valid) {
                return;
            }
            // Remove invalid value
            this.input
                .val("")
                .attr("title", value + " nie zostało znalezione")
                .tooltip("open");
            this.element.val("");
            this._delay(function () {
                this.input.tooltip("close").attr("title", "");
            }, 2500);
            this.input.autocomplete("instance").term = "";
        },
        _destroy: function () {
            this.wrapper.remove();
            this.element.show();
        }
    });
})(jQuery);

var $CUSjQuery = $;

function supportFullCss3() {
    var div = document.createElement("div");
    div.style.display = 'flex';
    var s1 = div.style.display == 'flex';
    var s2 = 'perspective' in div.style;

    return (s1 && s2);
};

$(function () {
    $(".btn.disabled").on("click", function (e) {
        e.preventDefault();
    });
});




function showMore() {
    var text = document.getElementById("opinion-text");
    text.classList.remove("product-opinion_showless");
    $("#opinion-expander").attr('style', 'display:none');
};

function scrollToValidator() {
    console.log('scrollToValidator()');
    if (typeof Page_Validators != 'undefined' && Page_Validators != null) {
        for (var i = 0; i < Page_Validators.length; i++) {
            if (!Page_Validators[i].isvalid) {

                var validator = $('#' + Page_Validators[i].id).parent().parent();
                if (validator != null) {
                    $('html, body').animate({ scrollTop: validator.offset().top },
                        500,
                        'linear');

                    // TODO: sprawdzić przed scroll czy id, a potem parent, parent istnieje i czy mamy ten top
                    break;
                }
            }
        }
    }
}
;
var Validation = /** @class */ (function () {
    function Validation() {
    }
    Validation.isNumber = function (evt) {
        evt = (evt) ? evt : window.event;
        var charCode = (evt.which) ? evt.which : evt.keyCode;
        if (charCode > 31 && (charCode < 48 || charCode > 57)) {
            return false;
        }
        return true;
    };
    return Validation;
}());
//# sourceMappingURL=Validation.js.map;
/** Klasa z metodami pomocniczymi dla
 * local storage(przechowuje dane permanentnie) i
 * session storage(przechowuje dane w trakcie trwania sesji).
 */
var WebStorage = /** @class */ (function () {
    function WebStorage() {
    }
    /**
     * Pobiera dane z local storage za pomocą klucza
     * @param key
     */
    WebStorage.GetFromLocalStorage = function (key) {
        try {
            return JSON.parse(localStorage.getItem(key));
        }
        catch (err) {
            console.log(err);
            return null;
        }
    };
    /**
     * Zapisuje wartość w local storage
     * @param key
     * @param value
     */
    WebStorage.SetToLocalStorage = function (key, value) {
        try {
            localStorage.setItem(key, JSON.stringify(value));
        }
        catch (err) {
            console.log(err);
        }
    };
    /**
     * Pobiera wartość z session storage na podstawie klucza
     * @param key
     */
    WebStorage.GetFromSessionStorage = function (key) {
        try {
            return JSON.parse(sessionStorage.getItem(key));
        }
        catch (err) {
            console.log(err);
            return null;
        }
    };
    /**
     * Zapisuje wartość w session storage
     * @param key
     * @param value
     */
    WebStorage.SetToSessionStorage = function (key, value) {
        try {
            sessionStorage.setItem(key, JSON.stringify(value));
        }
        catch (err) {
            console.log(err);
        }
    };
    return WebStorage;
}());
//# sourceMappingURL=Storage.js.map;
/** Klasa metod pomocniczych dla Cookies przeglądarki */
var Cookie = /** @class */ (function () {
    function Cookie() {
    }
    /**
     * Metoda zapisująca ciastko
     * @param name - nazwa
     * @param val - wartość
     * @param expireDays - opcjonalnie ilość dni, po których ciastko wygasa
     */
    Cookie.SetCookie = function (name, val, expireDays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + expireDays);
        document.cookie = name + "=" + val + ((expireDays == null) ? "" : ";expires=" + exdate.toUTCString());
    };
    /**
     * Metoda pobierająca wartość ciasteczka
     * @param name
     */
    Cookie.GetCookie = function (name) {
        var cname = name + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ')
                c = c.substring(1);
            if (c.indexOf(cname) != -1)
                return c.substring(cname.length, c.length);
        }
        return "";
    };
    return Cookie;
}());
//# sourceMappingURL=Cookie.js.map;
var Config;
(function (Config) {
    var Slick = /** @class */ (function () {
        function Slick() {
        }
        Slick.Get = function (mode) {
            switch (PageConfig.BundleCatalog) {
                case "GymProvocateur":
                case "Fitwoman":
                    var startsSlideNumber = 4;
                    if (mode === "bestsellers_basket") {
                        startsSlideNumber = 3;
                    }
                    return {
                        infinite: false,
                        slidesToShow: startsSlideNumber,
                        slidesToScroll: startsSlideNumber,
                        responsive: [
                            {
                                breakpoint: 1150,
                                settings: {
                                    slidesToShow: startsSlideNumber - 1 > 0 ? startsSlideNumber - 1 : 1,
                                    slidesToScroll: startsSlideNumber - 1 > 0 ? startsSlideNumber - 1 : 1,
                                }
                            },
                            {
                                breakpoint: 740,
                                settings: {
                                    slidesToShow: startsSlideNumber - 2 > 0 ? startsSlideNumber - 2 : 1,
                                    slidesToScroll: startsSlideNumber - 2 > 0 ? startsSlideNumber - 2 : 1,
                                }
                            },
                            {
                                breakpoint: 472,
                                settings: {
                                    slidesToShow: 1,
                                    slidesToScroll: 1,
                                }
                            }
                        ]
                    };
                default:
                    switch (mode) {
                        case "gratis":
                            return {
                                infinite: false,
                                slidesToShow: 3,
                                slidesToScroll: 3,
                                responsive: [
                                    {
                                        breakpoint: 1024,
                                        settings: {
                                            slidesToShow: 4,
                                            slidesToScroll: 4,
                                        }
                                    },
                                    {
                                        breakpoint: 900,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 650,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    }
                                ]
                            };
                        case "short":
                            return {
                                infinite: false,
                                slidesToShow: 4,
                                slidesToScroll: 4,
                                responsive: [
                                    {
                                        breakpoint: 1235,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 880,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    }
                                ]
                            };
                        case "bestsellers":
                            return {
                                infinite: false,
                                slidesToShow: 4,
                                slidesToScroll: 4,
                                responsive: [
                                    {
                                        breakpoint: 1311,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 937,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    },
                                    {
                                        breakpoint: 620,
                                        settings: {
                                            slidesToShow: 1,
                                            slidesToScroll: 1,
                                        }
                                    }
                                ]
                            };
                        case "bestsellers_basket":
                            return {
                                infinite: false,
                                slidesToShow: 3,
                                slidesToScroll: 3,
                                responsive: [
                                    {
                                        breakpoint: 1311,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 1290,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    },
                                    {
                                        breakpoint: 995,
                                        settings: {
                                            slidesToShow: 1,
                                            slidesToScroll: 1,
                                        }
                                    }
                                ]
                            };
                        case "dodatki":
                            return {
                                infinite: false,
                                slidesToShow: 4,
                                slidesToScroll: 4,
                                responsive: [
                                    {
                                        breakpoint: 1310,
                                        settings: {
                                            slidesToShow: 4,
                                            slidesToScroll: 4,
                                        }
                                    },
                                    {
                                        breakpoint: 900,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 650,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    }
                                ]
                            };
                        case "default":
                            return {
                                infinite: false,
                                slidesToShow: 6,
                                slidesToScroll: 6,
                                responsive: [
                                    {
                                        breakpoint: 1310,
                                        settings: {
                                            slidesToShow: 5,
                                            slidesToScroll: 5,
                                        }
                                    },
                                    {
                                        breakpoint: 1140,
                                        settings: {
                                            slidesToShow: 4,
                                            slidesToScroll: 4,
                                        }
                                    },
                                    {
                                        breakpoint: 900,
                                        settings: {
                                            slidesToShow: 3,
                                            slidesToScroll: 3,
                                        }
                                    },
                                    {
                                        breakpoint: 650,
                                        settings: {
                                            slidesToShow: 2,
                                            slidesToScroll: 2,
                                        }
                                    }
                                ]
                            };
                    }
            }
        };
        return Slick;
    }());
    Config.Slick = Slick;
})(Config || (Config = {}));
//# sourceMappingURL=SlickConfig.js.map;
var Components;
(function (Components) {
    /** Narzędzia pomocnicze dla ekranów dotykowych */
    var TouchScreen = /** @class */ (function () {
        function TouchScreen() {
        }
        /** Czy obsługiwane urządzenie jest urządzeniem dotykowym? */
        TouchScreen.IsTouchDevice = function () {
            return (("ontouchstart" in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
        };
        return TouchScreen;
    }());
    Components.TouchScreen = TouchScreen;
})(Components || (Components = {}));
//# sourceMappingURL=TouchScreen.js.map;
var Components;
(function (Components) {
    /** Pozwala na dodawanie i zarządzanie loaderem dla wybranego elementu */
    var CircleLoader = /** @class */ (function () {
        /**
         * Tworzy nowy loader
         * @param $loaderParent Element, który ma być rodzicem loadera
         */
        function CircleLoader($loaderParent, checkEqualityOnAndOff) {
            if (checkEqualityOnAndOff === void 0) { checkEqualityOnAndOff = false; }
            this.LoaderCounter = 0;
            this.CheckEqualityOnAndOff = checkEqualityOnAndOff;
            this.$LoaderParent = $loaderParent;
            this.CreateLoader();
        }
        /** Dodaje loader do wskazanego w konstruktorze elementu */
        CircleLoader.prototype.CreateLoader = function () {
            var progressPanelLoader = document.createElement("div");
            $(progressPanelLoader).addClass("progress-panel-loader");
            var progressPanel = document.createElement("div");
            $(progressPanel).addClass("progress-panel");
            $(progressPanel).appendTo(progressPanelLoader);
            this.$Loader = $(progressPanelLoader);
            this.$Loader.appendTo(this.$LoaderParent);
        };
        /** Pokazuje loader */
        CircleLoader.prototype.Show = function () {
            this.LoaderCounter++;
            this.$Loader.show();
        };
        /** Ukrywa loader */
        CircleLoader.prototype.Hide = function () {
            if (this.LoaderCounter > 0) {
                this.LoaderCounter--;
            }
            if (!this.CheckEqualityOnAndOff || this.LoaderCounter === 0) {
                this.$Loader.hide();
            }
        };
        /** Czy loader jest w trakcie działania? */
        CircleLoader.prototype.IsRunning = function () {
            return this.LoaderCounter > 0;
        };
        return CircleLoader;
    }());
    Components.CircleLoader = CircleLoader;
})(Components || (Components = {}));
//# sourceMappingURL=CircleLoader.js.map;
var Components;
(function (Components) {
    /** Narzędzia pomocnicze dla przycisków */
    var ButtonUtilities = /** @class */ (function () {
        function ButtonUtilities() {
        }
        /**
         * Ustawia dla przycisku blokadę, która pozwoli kliknąć dany przycisk tylko jeden raz
         * @param $button Przycisk, dla którego ma być wykonana akcja
         * @param onClickAction Pozwala podpiąć zdarzenie, które wywoła się przed zablokowaniem przycisku (opcjonalnie)
         * @param $othersToBlock Inne elementy do zablokowania (opcjonalnie)
         */
        ButtonUtilities.AllowOnlyOneClick = function ($button, onClickAction, $othersToBlock) {
            var _this = this;
            if (onClickAction === void 0) { onClickAction = null; }
            if ($othersToBlock === void 0) { $othersToBlock = null; }
            $button.click(function () {
                if (onClickAction != null) {
                    onClickAction();
                }
                _this.DisableClick($button);
                if ($othersToBlock != null) {
                    $othersToBlock.forEach(function (value, index) {
                        _this.DisableClick(value);
                    });
                }
            });
        };
        /**
         * Blokuje możliwość klikania przycisku
         * @param $button Przycisk, dla którego ma być ustawiona blokada
         */
        ButtonUtilities.DisableClick = function ($button) {
            $button.css({ pointerEvents: "none" });
        };
        /**
         * Wywołuje ponowne kliknięcie przycisku
         * Przydatne gdy zdarzenie click zostało wcześniej przechwycone
         * @param eventObject Obiekt dla zdarzenia kliknięcia
         * @param buttonMode Tryb przycisku
         */
        ButtonUtilities.RepeatClick = function (eventObject, buttonMode) {
            switch (buttonMode) {
                case ButtonMode.Submit:
                    $(eventObject.currentTarget).click();
                    break;
                case ButtonMode.Link:
                    $(eventObject.currentTarget)[0].click();
                    break;
            }
        };
        return ButtonUtilities;
    }());
    Components.ButtonUtilities = ButtonUtilities;
    /** Tryb przycisku */
    var ButtonMode;
    (function (ButtonMode) {
        ButtonMode[ButtonMode["Submit"] = 0] = "Submit";
        ButtonMode[ButtonMode["Link"] = 1] = "Link";
    })(ButtonMode = Components.ButtonMode || (Components.ButtonMode = {}));
})(Components || (Components = {}));
//# sourceMappingURL=ButtonUtilities.js.map;
jQuery.fn.extend({
    onSwipe: function (onSwipeStart, onSwipeEnd, onTouchMove, customConfig) {
        var swipeConfig = getSwipeConfig(customConfig);
        var startX;
        var startY;
        var distanceX;
        var distanceY;
        var elapsedTime;
        var startTime;
        $(this).on("touchstart", function (e) {
            initSwipe(e);
            if (onSwipeStart != null) {
                onSwipeStart(e);
            }
        });
        $(this).on("touchend", function (e) {
            var swipeInfo = analyzeSwipeMove(e, true);
            if (onSwipeEnd != null) {
                onSwipeEnd(e, swipeInfo);
            }
        });
        $(this).on("touchmove", function (e) {
            var swipeInfo = analyzeSwipeMove(e);
            if (onTouchMove != null) {
                onTouchMove(e, swipeInfo);
            }
        });
        /**
         * Inicjalizuje ustawienia swipe
         * @param e Obiekt zdarzenia
         */
        function initSwipe(e) {
            var touch = e.originalEvent.changedTouches[0];
            distanceX = 0;
            distanceY = 0;
            startX = touch.pageX;
            startY = touch.pageY;
            startTime = new Date().getTime();
        }
        /**
         * Ustawia konfigurację swipe na podstawie otrzymanych parametrów
         * @param customConfig Konfiguracja niestandardowa
         */
        function getSwipeConfig(customConfig) {
            var config = getDefaultConfig();
            if (customConfig != null) {
                if (customConfig.hasOwnProperty("minSwipeDistance")) {
                    config.minSwipeDistance = customConfig["minSwipeDistance"];
                }
                if (customConfig.hasOwnProperty("minSwipeVerticalDistanceOnMove")) {
                    config.minSwipeVerticalDistanceOnMove = customConfig["minSwipeVerticalDistanceOnMove"];
                }
                if (customConfig.hasOwnProperty("restraint")) {
                    config.restraint = customConfig["restraint"];
                }
                if (customConfig.hasOwnProperty("allowedTime")) {
                    config.allowedTime = customConfig["allowedTime"];
                }
            }
            return config;
        }
        /** Zwraca domyślną konfigurację swipe */
        function getDefaultConfig() {
            var defaultConfig = {
                minSwipeDistance: 75,
                minSwipeVerticalDistanceOnMove: 30,
                restraint: 50,
                allowedTime: 500
            };
            return defaultConfig;
        }
        /**
         * Zwraca szczegóły dotyczące aktualnego stanu przesunięcia
         * @param e Obiekt zdarzenia
         * @param isEnd Czy szczegóły mają dotyczyć zdarzenia zakończenia swipe?
         */
        function analyzeSwipeMove(e, isEnd) {
            if (isEnd === void 0) { isEnd = false; }
            var touch = e.originalEvent.changedTouches[0];
            distanceX = touch.pageX - startX; // obliczenie poziomego przesunięcia
            distanceY = touch.pageY - startY; // obliczenie pionowego przesunięcia
            elapsedTime = new Date().getTime() - startTime; // obliczenie czasu, jaki upłynął od momentu dotknięcia
            var swipeInfo = {
                direction: getSwipeDirection(isEnd),
                elapsedTime: elapsedTime,
                startX: startX,
                startY: startY,
                actualX: touch.pageX,
                actualY: touch.pageY,
                distanceX: distanceX,
                distanceY: distanceY,
                isCorrectTime: isCorrectTime()
            };
            return swipeInfo;
        }
        /** Zwraca odpowiedź czy swipe został wykonany w zakładanym czasie? */
        function isCorrectTime() {
            return elapsedTime <= swipeConfig.allowedTime;
        }
        /**
         * Zwraca kierunek, w jakim nastąpiło przesunięcie
         * @param isEnd Czy szczegóły mają dotyczyć zdarzenia zakończenia swipe?
         */
        function getSwipeDirection(isEnd) {
            if (isEnd === void 0) { isEnd = false; }
            var swipeDirection = {
                Up: false,
                Down: false,
                Left: false,
                Right: false
            };
            if (!isEnd) {
                swipeDirection.Left = distanceX < 0;
                swipeDirection.Right = distanceX > 0;
                if (Math.abs(distanceY) > swipeConfig.minSwipeVerticalDistanceOnMove) {
                    swipeDirection.Up = distanceY < 0;
                    swipeDirection.Down = distanceY > 0;
                }
            }
            else {
                if (Math.abs(distanceX) >= swipeConfig.minSwipeDistance && Math.abs(distanceY) <= swipeConfig.restraint) {
                    swipeDirection.Left = distanceX < 0;
                    swipeDirection.Right = distanceX > 0;
                }
                else if (Math.abs(distanceY) >= swipeConfig.minSwipeDistance && Math.abs(distanceX) <= swipeConfig.restraint) {
                    swipeDirection.Up = distanceY < 0;
                    swipeDirection.Down = distanceY > 0;
                }
            }
            return swipeDirection;
        }
        return $(this);
    }
});
//# sourceMappingURL=JQuery.js.map;
if (!String.prototype.format) {
    String.prototype.format = function () {
        var args = arguments;
        return this.replace(/{(\d+)}/g, function (match, number) {
            return typeof args[number] != 'undefined'
                ? args[number]
                : match;
        });
    };
}
//# sourceMappingURL=String.js.map;
//# sourceMappingURL=Window.js.map;
var Logic;
(function (Logic) {
    var LastWatchedProducts = /** @class */ (function () {
        function LastWatchedProducts() {
        }
        LastWatchedProducts.Add = function (productId) {
            var list = this.GetProducts();
            if (list == null) {
                list = [];
            }
            if (list.indexOf(productId) > -1) {
                list = this.Sort(list, productId);
            }
            else {
                list = this.AddToCollection(list, productId);
            }
            WebStorage.SetToLocalStorage(this.StorageKey, list);
        };
        LastWatchedProducts.GetProducts = function () {
            return WebStorage.GetFromLocalStorage(this.StorageKey);
        };
        LastWatchedProducts.Sort = function (list, productId) {
            var result = [];
            result.push(productId);
            for (var i = 0; i < list.length; i++) {
                if (list[i] != productId) {
                    result.push(list[i]);
                }
            }
            return result;
        };
        LastWatchedProducts.AddToCollection = function (list, productId) {
            list.unshift(productId);
            list = list.slice(0, 24);
            return list;
        };
        LastWatchedProducts.StorageKey = 'last-watched-products';
        return LastWatchedProducts;
    }());
    Logic.LastWatchedProducts = LastWatchedProducts;
})(Logic || (Logic = {}));
//# sourceMappingURL=LastWatchedProducts.js.map;
var Root;
(function (Root) {
    var Home;
    (function (Home) {
        var LastWatchedProducts = /** @class */ (function () {
            /**
             *
             * @param url adres do pobrania produktów z serwera
             */
            function LastWatchedProducts(url) {
                var _this = this;
                this.ProductsLoaded = false;
                console.log("LastWatched init");
                this.$lastWatchedSection = $('.ostatnio-ogladane');
                $(window).scroll(function () {
                    if (!_this.ProductsLoaded && _this.$lastWatchedSection.length > 0) {
                        if ($(window).scrollTop() > _this.$lastWatchedSection.offset().top - 800) {
                            _this.ProductsLoaded = true;
                            _this.Run(url);
                        }
                    }
                });
            }
            LastWatchedProducts.prototype.Run = function (url) {
                var lastWatched = Logic.LastWatchedProducts.GetProducts();
                if (lastWatched != null && lastWatched.length > 0) {
                    this.RequestForProducts(url, lastWatched);
                }
            };
            LastWatchedProducts.prototype.RequestForProducts = function (url, productsId) {
                var _this = this;
                $.ajax({
                    url: url,
                    type: 'POST',
                    contentType: 'json',
                    data: JSON.stringify(productsId),
                    success: function (response) {
                        _this.Render(response);
                    },
                    error: function (response) {
                        console.log(response);
                    }
                });
            };
            LastWatchedProducts.prototype.Render = function (html) {
                this.$lastWatchedSection.removeClass('ostatnio-ogladane--hidden');
                var $products = this.$lastWatchedSection.find('.products-box');
                $products.html(html);
                $products.slick(Config.Slick.Get("default"));
            };
            return LastWatchedProducts;
        }());
        Home.LastWatchedProducts = LastWatchedProducts;
    })(Home = Root.Home || (Root.Home = {}));
})(Root || (Root = {}));
//$(() => {
//    new HomePage.LastWatchedProducts(`${PageConfig.rootUrl}/aspx/GlownaOstatnioOgladane.ashx`);
//});
//# sourceMappingURL=LastWatchedProducts.js.map;
var ProductPageScripts;
(function (ProductPageScripts) {
    /** Zarządza "Promocją dnia" na stronie produktu */
    var DailyPromotion = /** @class */ (function () {
        function DailyPromotion(selector, asyncMode) {
            if (asyncMode === void 0) { asyncMode = false; }
            /** Poszczególne części licznika */
            this.TimerElements = [];
            this.$DailyPromotionElement = $(selector);
            this.AsyncMode = asyncMode;
            this.IsVisible = this.$DailyPromotionElement.length > 0;
            if (this.IsVisible) {
                this.$TimingBox = this.$DailyPromotionElement.find('.daily-promotion__timing');
                if (!this.AsyncMode) {
                    this.InitDailyPromotionTimer();
                }
            }
        }
        /** Inicjalizuje licznik "Promocji dnia" */
        DailyPromotion.prototype.InitDailyPromotionTimer = function () {
            var _this = this;
            var secondsLeft = this.CutSecondsIfTooLong(parseInt(this.$TimingBox.data('secondsleft')));
            this.CreateTimer(secondsLeft);
            var interval = setInterval(function () {
                secondsLeft--;
                _this.UpdateTimer(secondsLeft);
                if (secondsLeft <= 0) {
                    clearInterval(interval);
                    _this.$TimingBox.html(TextRecourse.PromocjaDniaKoniec);
                    _this.$TimingBox.addClass("daily-promotion__timing--ended");
                }
            }, 1000);
        };
        /**
         * Zmniejsza ilość czasu do 100 godzin (bez 1 sekundy), jeśli podany czas jest dłuższy lub równy niż 100 godzin, ponieważ licznik jest w stanie obsłużyć max. 99:59:59
         * @param seconds Ilość sekund
         */
        DailyPromotion.prototype.CutSecondsIfTooLong = function (seconds) {
            return seconds < 360000 ? seconds : 359999;
        };
        /**
         * Formatuje czas w sekundach na czas w postaci DDMMSS
         * @param seconds Ilość sekund
         */
        DailyPromotion.prototype.SecondsToStringFormat = function (seconds) {
            var date = new Date(1970, 0, 1);
            date.setSeconds(seconds);
            var parts = date.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1").split(':');
            parts[0] = (parseInt(parts[0]) + (24 * (date.getDate() - 1))).toString(); //doliczenie dni do godzin
            if (parseInt(parts[0]) < 10) {
                parts[0] = "0" + parts[0];
            }
            return parts.join("");
        };
        /**
         * Tworzy licznik
         * @param secondsLeft Ilość sekund, od jakiej licznik ma rozpocząć odliczanie
         */
        DailyPromotion.prototype.CreateTimer = function (secondsLeft) {
            var box = $('<div/>');
            var timing = this.SecondsToStringFormat(secondsLeft);
            for (var i = 0; i < timing.length; i++) {
                this.TimerElements[i] = $('<span/>', {
                    text: timing[i]
                });
                this.TimerElements[i].appendTo(box);
                if (i === 1 || i === 3) {
                    box.append('<span class="dots">:</span>');
                }
            }
            box.appendTo(this.$TimingBox);
        };
        /**
         * Uaktualnia licznik
         * @param secondsLeft Ilość sekund, jaka pozostała do końca promocji dnia
         */
        DailyPromotion.prototype.UpdateTimer = function (secondsLeft) {
            var timing = this.SecondsToStringFormat(secondsLeft);
            for (var i = 0; i < timing.length; i++) {
                this.TimerElements[i].text(timing[i]);
            }
        };
        /** Oświeża stan "Promocji dnia" poprzez pobranie aktualnych danych */
        DailyPromotion.prototype.Refresh = function () {
            if (this.IsVisible) {
                this.GetDailyPromotionData();
            }
        };
        /**
         * Pobiera dane dotyczące "Promocji Dnia"
         * @param onSuccess Funkcja, która ma się wykonać po poprawnym pobraniu danych
         */
        DailyPromotion.prototype.GetDailyPromotionData = function (onSuccess) {
            if (onSuccess === void 0) { onSuccess = null; }
            var self = this;
            $.ajax({
                type: 'POST',
                async: true,
                contentType: 'application/json; charset=utf-8',
                dataType: 'json',
                url: PageConfig.rootUrl + "/Default.aspx/GetDailyPromotionData",
                success: function (data) {
                    self.OnGetDailyPromotionDataSuccess(JSON.parse(data.d), onSuccess);
                }
            });
        };
        /**
         * Obsługuje poprawne odczytanie danych dotyczących "Promocji Dnia"
         * @param dailyPromotionData Dane dotyczące "Promocji Dnia"
         * @param onSuccess Funkcja, która ma się wykonać po poprawnym pobraniu danych
         */
        DailyPromotion.prototype.OnGetDailyPromotionDataSuccess = function (dailyPromotionData, onSuccess) {
            if (dailyPromotionData != null) {
                this.UpdateProgressBar(dailyPromotionData);
                this.UpdateAvailableProducts(dailyPromotionData.ProductsLeft);
                this.UpdateSoldProducts(dailyPromotionData.ProductsSold);
                this.RemoveTimingLoader();
                this.$TimingBox.data("secondsleft", dailyPromotionData.SecondsLeft);
                this.InitDailyPromotionTimer();
            }
            if (onSuccess != null) {
                onSuccess(dailyPromotionData);
            }
        };
        /**
         * Uaktualnia pasek postępu dla "Promocji Dnia"
         * @param dailyPromotionData Dane dotyczące "Promocji Dnia"
         */
        DailyPromotion.prototype.UpdateProgressBar = function (dailyPromotionData) {
            var $bar = $(".daily-promotion__quantities .bar > div");
            if ($bar.length > 0) {
                var availablePercent = Math.ceil(dailyPromotionData.ProductsLeft / (dailyPromotionData.ProductsLeft + dailyPromotionData.ProductsSold) * 100);
                $bar.css("width", availablePercent + "%");
            }
        };
        /**
         * Uaktualnia liczbę pozostałych produktów
         * @param productsLeft Liczba pozostałych produktów
         */
        DailyPromotion.prototype.UpdateAvailableProducts = function (productsLeft) {
            var $availableProducts = $(".daily-promotion__quantities .daily-promotion__available-products");
            if ($availableProducts.length > 0) {
                $availableProducts.html(productsLeft.toString());
            }
        };
        /**
         * Uaktualnia liczbę sprzedanych produktów
         * @param productsSold Liczba sprzedanych produktów
         */
        DailyPromotion.prototype.UpdateSoldProducts = function (productsSold) {
            var $soldProducts = $(".daily-promotion__quantities .daily-promotion__sold-products");
            if ($soldProducts.length > 0) {
                $soldProducts.html(productsSold.toString());
            }
        };
        /** Usuwa loader licznika */
        DailyPromotion.prototype.RemoveTimingLoader = function () {
            var $timingLoader = this.$TimingBox.find(".dots-loader");
            if ($timingLoader.length > 0) {
                $timingLoader.remove();
            }
        };
        return DailyPromotion;
    }());
    ProductPageScripts.DailyPromotion = DailyPromotion;
})(ProductPageScripts || (ProductPageScripts = {}));
if (typeof PageConfig !== undefined && !OutputCacheConfig.ProductPage) {
    var dailyPromotionProductPage = new ProductPageScripts.DailyPromotion(".product-page .promocja-dnia");
}
//# sourceMappingURL=DailyPromotion.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var HomePage;
(function (HomePage) {
    /** Zarządza "Promocją Dnia" na stronie głównej */
    var DailyPromotion = /** @class */ (function (_super) {
        __extends(DailyPromotion, _super);
        function DailyPromotion(selector, asyncMode) {
            if (asyncMode === void 0) { asyncMode = false; }
            var _this = _super.call(this, selector, asyncMode) || this;
            if (_this.IsVisible) {
                _this.SetWindowOnLoadEvent();
            }
            return _this;
        }
        /** Ustawia akcję do wykonania po załadowaniu się strony */
        DailyPromotion.prototype.SetWindowOnLoadEvent = function () {
            var _this = this;
            $(window).on("load", function () {
                _this.$DailyPromotionElement.parent().addClass("with-dailypromotion");
                _this.AlignElementHeight();
            });
        };
        /** Dopasowuje wysokość kafla "Promocja Dnia" do innych kafli na stronie głównej */
        DailyPromotion.prototype.AlignElementHeight = function () {
            var diffrence = $('.products-box.images article:not(.promotion-image)').eq(0).height() - this.$DailyPromotionElement.height();
            if (diffrence > 0) {
                this.$DailyPromotionElement.css('padding-top', diffrence + "px");
            }
        };
        return DailyPromotion;
    }(ProductPageScripts.DailyPromotion));
    HomePage.DailyPromotion = DailyPromotion;
})(HomePage || (HomePage = {}));
if (typeof PageConfig !== undefined && !OutputCacheConfig.DefaultPage) {
    var dailyPromotionHomePage = new HomePage.DailyPromotion(".products-box .daily-promotion");
}
//# sourceMappingURL=DailyPromotion.js.map;
var Root;
(function (Root) {
    var Home;
    (function (Home) {
        var AsyncProducts = /** @class */ (function () {
            function AsyncProducts(rootUrl, onlyBestsellers) {
                if (onlyBestsellers === void 0) { onlyBestsellers = false; }
                this.RootUrl = rootUrl;
                this.ProductsInProgress = this.InitProductsElementsState();
                this.ProductsLoaded = this.InitProductsElementsState();
                this.ListsLoaded = this.InitListsElementState();
                if (onlyBestsellers) {
                    this.InitBestsellersSlick();
                    this.AddBestsellersChangeCategoryEvent();
                }
                else {
                    this.PromotionsUrl = 'aspx/GlownaPromocje.ashx';
                    this.ListsUrl = 'aspx/GlownaLists.ashx';
                    this.InitSlick();
                    this.PromotionsLoadBtnEvent();
                    this.ListsLoadBtnEvent();
                    this.AddBestsellersChangeCategoryEvent();
                    this.OnPageScroll();
                    this.WindowOnLoad();
                }
            }
            AsyncProducts.prototype.OnPageScroll = function () {
                var _this = this;
                $(window).scroll(function () {
                    var scrollPos = $(window).scrollTop();
                    if ($(".home-promotions__inner").length > 0) {
                        _this.AutoloadPromotions(scrollPos);
                    }
                    if ($(".page-layout__inner").length > 0) {
                        _this.AutoloadLists(scrollPos);
                    }
                    /* Dla mniejszych rozdzielczości zdarzenie swipe */
                    if ($(window).width() > 900) {
                        var self = _this;
                        $('.products-box[data-autoslick][data-type]').each(function () {
                            var _this = this;
                            if ($(this).attr('data-type') !== "bestsellers" &&
                                $(this).attr('data-type') !== "category-861" &&
                                $(this).attr('data-type') !== "category-862") {
                                var inProgressElement = self.ProductsInProgress.filter(function (p) { return p.productElement == $(_this).data('type'); })[0];
                                var index = self.ProductsInProgress.indexOf(inProgressElement);
                                if (index < 0)
                                    return;
                                var loadUrl = $(this).data('load');
                                if (!self.ProductsLoaded[index].isInState && !self.ProductsInProgress[index].isInState) {
                                    self.ProductsInProgress[index].isInState = true;
                                    self.ProductsLoaded[index].isInState = true;
                                    console.log($(this).eq(0));
                                    self.Load(loadUrl, $(this).eq(0), index);
                                }
                            }
                        });
                    }
                });
            };
            AsyncProducts.prototype.InitSlick = function () {
                $('.products-box[data-autoslick]').each(function (index, element) {
                    if ($(element).attr("data-type") === "latest") {
                        $(element).slick(Config.Slick.Get("default"));
                    }
                    else if (/managed-list-normal-/.test($(element).attr("data-type"))) {
                        $(element).slick(Config.Slick.Get("default"));
                    }
                    else if ($(element).attr("data-type") !== "bestsellers") {
                        $(element).slick(Config.Slick.Get("short"));
                    }
                });
                // wrzucenie do slicka listy kategorii przy mniejszych rozdzielczościach
                if ($(".bestsellers").length > 0 && $(window).width() < 769) {
                    this.InitBestsellersCategoriesSwipe();
                }
                // TODO: Sprawdzić czy to jest potrzebne - wywołanie tego zdarzenia powoduje błąd w konsoli
                $('.products-box[data-autoslick]').on('swipe', function (e, slick, direction) {
                    var _this = this;
                    console.log("on swipe");
                    var loadUrl = $(this).data('load');
                    console.log(loadUrl);
                    console.log($(this).data('type'));
                    var inProgressElement = this.ProductsInProgress.filter(function (p) { return p.productElement == $(_this).data('type'); })[0];
                    var index = this.ProductsInProgress.indexOf(inProgressElement);
                    if ($(window).width() <= 900) {
                        if (direction == 'left') {
                            if ($(this).data('type') == 'latest' && !inProgressElement.isInState) {
                                this.ProductsInProgress[index].isInState = true;
                                this.Load(loadUrl, $(this).eq(0), index);
                            }
                        }
                    }
                    var self = this;
                    $('.products-box[data-autoslick][data-type]').each(function () {
                        var _this = this;
                        var element = self.ProductsInProgress.filter(function (p) { return p.productElement == $(_this).data('type'); })[0];
                        var index = self.ProductsInProgress.indexOf(element);
                        if (!inProgressElement.isInState) {
                            self.ProductsInProgress[index].isInState = true;
                            self.Load(loadUrl, $(this).eq(0), index);
                        }
                    });
                });
            };
            AsyncProducts.prototype.InitBestsellersCategoriesSwipe = function () {
                var sliderItem = $('.bestsellers-categories');
                var slider = $('.bestsellers-categories-box');
                slider.wrapInner("<div class='sfd-slider__main'></div>");
                var sliderMain = slider.children(".sfd-slider__main");
                slider.addClass("sfd-slider");
                sliderItem.addClass("sfd-slider__element");
                var swipeSlider = new Root.SwipeSlider(sliderItem, slider, false, sliderMain);
            };
            AsyncProducts.prototype.AutoloadPromotions = function (scrollPos) {
                var index = this.ProductsLoaded.indexOf(this.ProductsLoaded.filter(function (p) { return p.productElement === 'promotions'; })[0]);
                if (scrollPos > 200 && !this.ProductsLoaded[index].isInState) {
                    this.ProductsLoaded[index].isInState = true;
                    $('.home-promotions__btn').trigger('click');
                }
            };
            AsyncProducts.prototype.AutoloadLists = function (scrollPos) {
                var index = this.ListsLoaded.indexOf(this.ListsLoaded.filter(function (p) { return p.listElement === 'lists'; })[0]);
                if (scrollPos > ScrollPosition && !this.ListsLoaded[index].isInState) {
                    this.ListsLoaded[index].isInState = true;
                    $(".page-layout__btn").trigger('click');
                }
            };
            AsyncProducts.prototype.WindowOnLoad = function () {
                var _this = this;
                $(window).on("load", function () {
                    var height = 0;
                    var productHeight = 0;
                    //this.ChangePromotionTileHeight();
                    $(window).resize(function () {
                        productHeight = $('.products-box.images article:not(.promotion-image)').eq(0).height();
                        if (height !== productHeight) {
                            //this.ChangePromotionTileHeight();
                        }
                    });
                    if ($(".bestsellers").length > 0) {
                        _this.InitBestsellersSlick();
                    }
                });
            };
            AsyncProducts.prototype.Load = function (urlPart, container, arrayIndex, restartSlick, callback) {
                if (restartSlick === void 0) { restartSlick = false; }
                var url = this.RootUrl + "/" + urlPart;
                var self = this;
                console.log("slick load " + url);
                $.ajax({
                    type: "GET",
                    url: url
                }).done(function (results) {
                    self.ProductsLoaded[arrayIndex].isInState = true;
                    container.slick("slickAdd", results);
                    if (restartSlick) {
                        container.slick("slickGoTo", 0);
                    }
                    if (callback != undefined) {
                        callback();
                    }
                }).fail(function (jqXHR, textStatus) {
                    console.log("#### Request failed: {0} ####".format(textStatus));
                    console.log(jqXHR);
                    console.log("################################");
                }).always(function () {
                    self.ProductsInProgress[arrayIndex].isInState = false;
                });
            };
            AsyncProducts.prototype.InitAsyncListsSlick = function () {
                var self = this;
                $('.products-box[data-autoslick][data-type]').each(function () {
                    if ($(this).data("loaded") || $(this).data("type") === "promotions" || $(this).data("type") === "bestsellers")
                        return;
                    var listBox = $(this);
                    var urlPart = $(listBox).data("load");
                    var url = self.RootUrl + "/" + urlPart;
                    var fakeContainer = listBox.clone();
                    fakeContainer.removeAttr("data-load");
                    fakeContainer.removeAttr("data-autoslick");
                    fakeContainer.addClass("hidden-list");
                    var height = listBox.height();
                    fakeContainer.css("margin-bottom", -height);
                    fakeContainer.css("top", -height);
                    listBox.css("opacity", "0");
                    listBox.parent().append(fakeContainer);
                    $.ajax({
                        type: "GET",
                        url: url,
                    }).done(function (results) {
                        listBox.append(results);
                        if (listBox.attr("data-type") === "latest") {
                            listBox.slick(Config.Slick.Get("default"));
                        }
                        else if (/managed-list-normal-/.test(listBox.attr("data-type"))) {
                            listBox.slick(Config.Slick.Get("default"));
                        }
                        else if (listBox.attr("data-type") !== "bestsellers") {
                            listBox.slick(Config.Slick.Get("short"));
                        }
                        setTimeout(function () {
                            listBox.css("opacity", "1");
                            listBox.css("transition", "opacity 200ms");
                            fakeContainer.css("opacity", "0");
                            fakeContainer.css("transition", "opacity 500ms");
                        }, 700);
                        setTimeout(function () {
                            fakeContainer.remove();
                        }, 1000);
                    });
                });
            };
            /**
             * Pobiera dodatkowe dane dla bestsellerów i inicjalizuje slick
             */
            AsyncProducts.prototype.InitBestsellersSlick = function () {
                var bestsellersBox = $('.products-box[data-autoslick][data-type^="bestsellers"]');
                var bestsellersType = $(bestsellersBox).data("type");
                var elementInProgress = this.ProductsInProgress.filter(function (p) { return p.productElement === bestsellersType; })[0];
                var indexOfElementInProgress = this.ProductsInProgress.indexOf(elementInProgress);
                if (elementInProgress.isInState || $(bestsellersBox).length === 0) {
                    return;
                }
                elementInProgress.isInState = true;
                var urlPart = $(bestsellersBox).data("load");
                var params = "async=true";
                var url = this.RootUrl + "/" + urlPart + "?" + params;
                var self = this;
                // Przysłonięcie danych na czas ładowania tymczasowym kontenerem, by uniknąć przeskoków elementów w momencie włączenia slick
                var fakeContainer = bestsellersBox.clone();
                fakeContainer.removeAttr("data-load");
                fakeContainer.removeAttr("data-autoslick");
                var height = bestsellersBox.height();
                fakeContainer.css("margin-bottom", -height);
                fakeContainer.css("top", -height);
                bestsellersBox.css("opacity", "0");
                bestsellersBox.parent().append(fakeContainer);
                $.ajax({
                    type: "GET",
                    url: url
                }).done(function (results) {
                    self.ProductsLoaded[indexOfElementInProgress].isInState = true;
                    bestsellersBox.append(results);
                    if (bestsellersType.length > 0) {
                        bestsellersBox.slick(Config.Slick.Get(bestsellersType));
                    }
                    else {
                        bestsellersBox.slick(Config.Slick.Get("bestsellers"));
                    }
                    // Stopniowe wygaszenie tymczasowego kontenera, by uniknąć efektu przeskoków elementów
                    setTimeout(function () {
                        bestsellersBox.css("opacity", "1");
                        bestsellersBox.css("transition", "opacity 200ms");
                        fakeContainer.css("opacity", "0");
                        fakeContainer.css("transition", "opacity 500ms");
                    }, 700);
                    setTimeout(function () {
                        fakeContainer.remove();
                    }, 1000);
                }).always(function () {
                    self.ProductsInProgress[indexOfElementInProgress].isInState = false;
                });
                if ($('.products-box[data-autoslick][data-type="bestsellers_basket"]').length > 0) {
                    this.InitBestsellersCategoriesSwipe();
                }
            };
            AsyncProducts.prototype.hideOverflowProducts = function () {
                var promotionProducts = $(".products-box.images article");
                var maxProductsInLine = Math.round($(".products-box.images").width() / promotionProducts.width());
                var countProducts = promotionProducts.length;
                var dailyProductBonus = 0;
                if ($('.products-box.images .daily-promotion').length > 0) {
                    countProducts += 2;
                    dailyProductBonus = 2;
                }
                var productsToHide = countProducts % maxProductsInLine;
                promotionProducts.show();
                for (var i = countProducts - 1; i >= countProducts - productsToHide; i--) {
                    promotionProducts.eq(i - dailyProductBonus).hide();
                }
            };
            AsyncProducts.prototype.PromotionsLoadBtnEvent = function () {
                var _this = this;
                $('.home-promotions__btn').on('click', function (e) {
                    e.preventDefault();
                    var self = $(e.currentTarget);
                    $.ajax({
                        type: "GET",
                        url: "{0}/{1}".format(PageConfig.rootUrl, _this.PromotionsUrl),
                        success: function (results) {
                            self.remove();
                            $('.products-box.images').append(results);
                            _this.hideOverflowProducts();
                            //this.ChangePromotionTileHeight();
                            $('.home-promotions__inner').trigger('promotionLoad');
                        }
                    });
                });
            };
            AsyncProducts.prototype.ListsLoadBtnEvent = function () {
                var _this = this;
                $('.page-layout__btn').on('click', function (e) {
                    e.preventDefault();
                    var self = $(e.currentTarget);
                    $.ajax({
                        type: "GET",
                        url: "{0}/{1}".format(PageConfig.rootUrl, _this.ListsUrl),
                        success: function (results) {
                            self.remove();
                            $('.lists-box').append(results);
                            _this.InitAsyncListsSlick();
                        },
                        error: function (xhr) {
                            console.log(xhr.responseText);
                        }
                    });
                });
            };
            /**
             * Podpięcie zdarzenia do obsługi zmiany kategorii, według której mają być filtrowane bestsellery
             */
            AsyncProducts.prototype.AddBestsellersChangeCategoryEvent = function () {
                var _this = this;
                $(".bestsellers-categories-box").on("click", ".bestsellers-categories", function (e) {
                    var categoryItem = $(e.currentTarget);
                    if (categoryItem.hasClass("active")) {
                        e.preventDefault();
                    }
                    else {
                        $(".bestsellers-categories").removeClass("active");
                        categoryItem.addClass("active");
                        var bestselersBox = categoryItem.closest(".bestsellers");
                        var productsBox = bestselersBox.find(".products-box");
                        _this.LoadBestsellers(categoryItem.data("load"), productsBox);
                    }
                });
            };
            /**
             * Pobiera bestsellery z podanego adresu i ładuje je do kontenera
             * @param loadUrl adres do pobrania bestsellerów
             * @param productsBox kontener do wyświetlenia bestsellerów
             */
            AsyncProducts.prototype.LoadBestsellers = function (loadUrl, productsBox) {
                var _this = this;
                var index = this.ProductsLoaded.indexOf(this.ProductsLoaded.filter(function (p) { return p.productElement.indexOf("bestsellers") === 0; })[0]);
                if (!this.ProductsInProgress[index].isInState) {
                    this.ProductsInProgress[index].isInState = true;
                    // Wygaszenie kontenera bestsellerów, by ukryć przeskoki elementów w momencie załadowania nowej treści
                    productsBox.css("opacity", "0");
                    productsBox.css("transition", "opacity 100ms");
                    setTimeout(function () {
                        productsBox.slick("slickGoTo", 0);
                        productsBox.find('.products-list__box').remove();
                        _this.Load(loadUrl, productsBox, index, false, function () { return setTimeout(function () {
                            productsBox.css("opacity", "1");
                            productsBox.css("transition", "opacity 200ms");
                        }, 200); });
                    }, 100);
                }
            };
            /**
             * Zmienia wysokość obrazków promocji umieszczanych pomiędzy kaflami produktów, dostosowując je do kafli produktów
             */
            //protected ChangePromotionTileHeight() {
            //    let height = $('.products-box.images article:not(.promotion-image)').eq(0).height() + 2;
            //    $('.promotion-image').each(function () {
            //        $(this).css("height", height);
            //    });
            //}
            AsyncProducts.prototype.InitProductsElementsState = function () {
                var states = [];
                // dodanie stanu promocji
                if ($(".home-promotions__inner").length) {
                    states.push({ productElement: $(".home-promotions__inner").attr("data-type"), isInState: false });
                }
                //dodanie stanu reszty elementów
                $(".products-box[data-autoslick][data-type]").each(function () {
                    states.push({ productElement: $(this).attr("data-type"), isInState: false });
                });
                return states;
            };
            AsyncProducts.prototype.InitListsElementState = function () {
                var states = [];
                if ($(".page-layout__inner").length) {
                    states.push({ listElement: $(".page-layout__inner").attr("data-type"), isInState: false });
                }
                return states;
            };
            /**
             * Włącza zdarzenie ukrywania produktów jeśli jest za dużo (nie równa siatka kafli)
             */
            AsyncProducts.prototype.HideProducts = function () {
                var _this = this;
                $(function () {
                    _this.hideOverflowProducts();
                });
                $(window).resize(function () {
                    _this.hideOverflowProducts();
                });
            };
            return AsyncProducts;
        }());
        Home.AsyncProducts = AsyncProducts;
    })(Home = Root.Home || (Root.Home = {}));
})(Root || (Root = {}));
//# sourceMappingURL=AsyncProducts.js.map;
var HomePage;
(function (HomePage) {
    /** Klasa zarządzająca promocjami na stronie głównej */
    var HomePagePromotions = /** @class */ (function () {
        /**
         * Tworzy obiekt do zarządzania promocjami na stronie głównej
         * @param productsLoadedOnStart liczba produktów wyświetlanych na początku załadowania się strony głównej
         */
        function HomePagePromotions(productsLoadedOnStart) {
            this.PromotionsSectionConfig = {
                Section: $(".home-promotions__inner"),
                ProductsLoadedOnStart: productsLoadedOnStart
            };
            this.ShopPrefix = this.GetShopPrefix();
            this.PromotionsCounter = 0;
            this.PromotionData = [];
            this.GtmPromotions = $(".gtm-promotion");
            this.GtmRotatorBanners = $(".rotator div[data-gtm-creative=Banner]");
            this.PromoView = new TagManager.PromoView(window.dataLayer);
            this.PromoClick = new TagManager.PromoClick(window.dataLayer);
            this.SendAllPromotions();
            this.WaitForLoadingPromotions();
        }
        /** Wysyła wszystkie widoczne promocje do GTM */
        HomePagePromotions.prototype.SendAllPromotions = function () {
            var _this = this;
            var promotionData = [];
            this.GtmPromotions.each(function (i, element) {
                var promotion = _this.CreatePromotionItem($(element));
                promotionData.push(promotion);
            });
            this.PromoView.Invoke(promotionData);
        };
        /** Funkcja tworząca obiekty promocji z elementów doładowanych później */
        HomePagePromotions.prototype.WaitForLoadingPromotions = function () {
            var _this = this;
            this.PromotionsSectionConfig.Section.on("promotionLoad", function () {
                var promotionData = [];
                var promotionsSectionElements = _this.PromotionsSectionConfig.Section.find(".gtm-promotion");
                promotionsSectionElements.each(function (i, element) {
                    var index = _this.PromotionsSectionConfig.Section.children().index(element);
                    if (index >= _this.PromotionsSectionConfig.ProductsLoadedOnStart) {
                        var promotion = _this.CreatePromotionItem($(element));
                        promotionData.push(promotion);
                        $(element).click(function (e) { return _this.OnPromotionClick(e); });
                    }
                });
                _this.PromoView.Invoke(promotionData);
            });
        };
        /**
         * Obsługuje zgłoszenie zmiany wyświetlanego baneru
         * @param bannerNumber Numer baneru, który został wczytany
         */
        HomePagePromotions.prototype.OnPromotionBannerChange = function (bannerNumber) {
            var banner = this.GtmRotatorBanners.eq(bannerNumber);
            var promotionItem = this.CreatePromotionItem(banner);
            var promotionData = [];
            promotionData.push(promotionItem);
            this.PromoView.Invoke(promotionData);
        };
        /**
         * Tworzy obiekt promocji na podstawie elementu na stronie wyświetlającego promocję
         * @param item Element na stronie wyświetlający promocję
         */
        HomePagePromotions.prototype.CreatePromotionItem = function (item) {
            var _this = this;
            var name = this.GetImageName(item);
            var id = this.ShopPrefix + "_" + name.replace(" ", "");
            var creative = item.attr("data-gtm-creative");
            var isBanner = creative === "Banner";
            var promotionAlreadyExists = this.PromotionData.some(function (promotion) { return promotion.id === id; });
            var position;
            if (isBanner) {
                position = parseInt(item.attr("data-slick-index")) + 1;
            }
            else {
                this.PromotionsCounter = this.PromotionsCounter === 0
                    ? this.GtmRotatorBanners.length + 1
                    : ++this.PromotionsCounter;
                position = this.PromotionsCounter;
            }
            var promotionItem = {
                id: id,
                name: name,
                creative: creative,
                position: position.toString(),
            };
            if (!promotionAlreadyExists) {
                this.PromotionData.push(promotionItem);
                item.click(function (e) { return _this.OnPromotionClick(e); });
            }
            return promotionItem;
        };
        /**
         * Obsługuje kliknięcie na promocję
         * @param e Obiekt zdarzenia kliknięcia
         */
        HomePagePromotions.prototype.OnPromotionClick = function (e) {
            var name = this.GetImageName($(e.currentTarget));
            var callbackUrl = $(e.currentTarget).find('a:first').attr('href');
            if (this.PromotionData.some(function (item) { return item.name === name; })) {
                var promotion = this.PromotionData.filter(function (item) { return item.name === name; })[0];
                if (promotion != null) {
                    e.preventDefault();
                    this.PromoClick.Invoke(promotion, callbackUrl);
                }
            }
        };
        /**
         * Pobiera nazwę pliku dla promocji wyświetlanej na stronie
         * @param item Element na stronie wyświetlający promocję
         */
        HomePagePromotions.prototype.GetImageName = function (item) {
            var src = item.find('img').attr('src');
            if (src == null) {
                src = item.css('background-image');
                if (src) {
                    src = src.replace('url(', '').replace(')', '').replace(/\"/gi, "");
                }
            }
            if (src && src != "none") {
                var img = src.split('/');
                var fileName = img[img.length - 1].match(/(.*)\.[\w]+$/)[1];
                return fileName;
            }
            else {
                return "";
            }
        };
        /** Pobiera prefix określający bieżący sklep */
        HomePagePromotions.prototype.GetShopPrefix = function () {
            if (PageConfig.BundleCatalog) {
                return PageConfig.BundleCatalog[0];
            }
            else {
                return "";
            }
        };
        return HomePagePromotions;
    }());
    HomePage.HomePagePromotions = HomePagePromotions;
})(HomePage || (HomePage = {}));
//# sourceMappingURL=HomePagePromotions.js.map;
var HomePage;
(function (HomePage) {
    var HomePageRedirect = /** @class */ (function () {
        function HomePageRedirect(redirect) {
            this.languageDict = {
                'Title': {
                    'pl-PL': 'Cześć!',
                    'cs-CZ': 'Zdravíme!',
                    'sk': 'Dobrý den!',
                },
                'Accept': {
                    'pl-PL': 'Przekieruj',
                    'cs-CZ': 'Presmerovať',
                    'sk': 'Přesměrovat',
                },
                'Decline': {
                    'pl-PL': 'Pozostań',
                    'cs-CZ': 'Zostať',
                    'sk': 'Zůstat',
                },
                'Text': {
                    'pl-PL': 'Wygląda na to, że jesteś w kraj, czy chcesz przejść na naszą kraj stronę?',
                    'cs-CZ': 'Vyzerá to tak, že ste na Slovensku, chcete navštíviť naše slovenské stránky?',
                    'sk': 'Zdá se, že jste v České republice, chcete přejít na české stránky?',
                },
            };
            this.Redirect = redirect;
            this.ShowPopup();
        }
        HomePageRedirect.prototype.SetText = function (subdict) {
            if (document.documentElement.lang in this.languageDict[subdict]) {
                return this.languageDict[subdict][document.documentElement.lang];
            }
        };
        HomePageRedirect.prototype.ShowPopup = function () {
            var url = this.Redirect;
            if (this.Redirect !== "") {
                $('.redirect-text').text(this.SetText('Text'));
                $('.redirect-text').dialog({
                    modal: true,
                    title: this.SetText('Title'),
                    draggable: false,
                    closeText: "",
                    open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
                    close: function () { $(this).dialog("destroy"); },
                    buttons: [{
                            text: this.SetText('Accept'),
                            'class': 'btn btn-accept',
                            click: function () {
                                $(this).dialog("close");
                                parent.location.replace(url);
                            }
                        },
                        {
                            text: this.SetText('Decline'),
                            'class': 'btn btn-cancel',
                            click: function () {
                                $(this).dialog("close");
                                $('.redirect-text').text("");
                            }
                        }]
                });
            }
        };
        return HomePageRedirect;
    }());
    HomePage.HomePageRedirect = HomePageRedirect;
})(HomePage || (HomePage = {}));
//# sourceMappingURL=HomePageRedirect.js.map;
var Root;
(function (Root) {
    var SliderList = /** @class */ (function () {
        function SliderList(sliderItem, sliderList, autoPlay) {
            this.$sliderSectionItem = sliderItem;
            this.$sliderSectionList = sliderList;
            this.$autoPlay = autoPlay;
            this.Slider();
            //this.$sliderSectionList.on("mouseover", function () {
            //    $(this).slick("slickPause");
            //});
            //this.$sliderSectionList.on("mouseout", function () {
            //    $(this).slick("slickPlay");
            //});
        }
        SliderList.prototype.Slider = function () {
            if (this.$sliderSectionItem.length > 6) {
                if (this.$autoPlay) {
                    this.$sliderSectionList.slick({
                        speed: 10000,
                        slidesToShow: 6,
                        autoplay: this.$autoPlay,
                        infinite: this.$autoPlay,
                        autoplaySpeed: 0,
                        cssEase: 'linear',
                        arrows: false,
                        draggable: true,
                        pauseOnHover: true,
                        variableWidth: true,
                        responsive: [
                            {
                                breakpoint: 1200,
                                settings: {
                                    slidesToShow: 5,
                                }
                            },
                            {
                                breakpoint: 1050,
                                settings: {
                                    slidesToShow: 4,
                                    slidesToScroll: 2,
                                }
                            },
                            {
                                breakpoint: 768,
                                settings: {
                                    slidesToShow: 3,
                                    slidesToScroll: 3,
                                }
                            },
                            {
                                breakpoint: 550,
                                settings: {
                                    slidesToShow: 2,
                                    slidesToScroll: 2,
                                }
                            }
                        ]
                    });
                }
                else {
                    this.$sliderSectionList.slick({
                        slidesToShow: 6,
                        slidesToScroll: 3,
                        arrows: false,
                        draggable: true,
                        responsive: [
                            {
                                breakpoint: 1200,
                                settings: {
                                    slidesToShow: 5,
                                }
                            },
                            {
                                breakpoint: 1050,
                                settings: {
                                    slidesToShow: 4,
                                    slidesToScroll: 2,
                                }
                            },
                            {
                                breakpoint: 768,
                                settings: {
                                    slidesToShow: 3,
                                    slidesToScroll: 3,
                                }
                            },
                            {
                                breakpoint: 550,
                                settings: {
                                    slidesToShow: 2,
                                    slidesToScroll: 2,
                                }
                            }
                        ]
                    });
                }
            }
            this.$sliderSectionList.css("opacity", "1");
        };
        return SliderList;
    }());
    Root.SliderList = SliderList;
})(Root || (Root = {}));
//# sourceMappingURL=SliderList.js.map;
var Root;
(function (Root) {
    var TouchScreen = Components.TouchScreen;
    var SliderSfd = /** @class */ (function () {
        function SliderSfd(sliderItem, slider, firstStatic, autoFlow) {
            var _this = this;
            this.$sliderItem = sliderItem;
            this.$slider = slider;
            this.$slider.wrapInner("<div class='sfd-slider__main'></div>");
            this.$sliderMain = this.$slider.children(".sfd-slider__main");
            this.$slider.addClass("sfd-slider");
            this.$sliderItem.addClass("sfd-slider__element");
            if (!TouchScreen.IsTouchDevice())
                this.$sliderItem.addClass("on-swipe-desktop");
            //this.addElementsAtStart();
            this.firstStaticElement(firstStatic);
            // Dynamiczny resize, ale tylko biorący pod uwagę szerokość (pod statyczny element)
            var width = $(window).width();
            $(window).resize(function (e) {
                if ($(window).width() !== width) {
                    _this.firstStaticElement(firstStatic);
                }
            });
            var swiperSlider = new Root.SwipeSlider(this.$sliderItem, this.$slider, autoFlow, this.$sliderMain);
        }
        // Pierwszy element statyczny jeśli włączone + na szerszych ekranach
        SliderSfd.prototype.firstStaticElement = function (firstStatic) {
            var staticElement = this.$slider.find(".sfd-slider__element--static");
            if (firstStatic && staticElement.length === 0 && $(window).width() > 600) {
                var first = this.$sliderItem.first();
                first.addClass("sfd-slider__element--static");
                first.insertAfter(this.$sliderMain);
            }
            else if (staticElement.length > 0 && $(window).width() <= 600) {
                staticElement.removeClass("sfd-slider__element--static");
                this.$sliderMain.append(staticElement);
            }
        };
        // Przenosi ostatnie elementy na początek, by nie było pustego miejsca
        SliderSfd.prototype.addElementsAtStart = function () {
            this.right = this.$sliderItem.width() * 5;
            var firstElement = this.$sliderItem.first();
            firstElement.addClass("sfd-slider__element--active");
            var lastElements = this.$sliderItem.slice(this.$sliderItem.last().index() - 4, this.$sliderItem.last().index());
            firstElement.before(lastElements);
            this.$sliderMain.css("right", this.right);
            // Dodajemy kopie elementów jeśli jest ich za mało
            if (this.$sliderItem.length * this.$sliderItem.outerWidth(true) < 3000) {
                var lastElement = this.$sliderItem.last();
                lastElement.after(this.$sliderItem.clone());
            }
        };
        return SliderSfd;
    }());
    Root.SliderSfd = SliderSfd;
})(Root || (Root = {}));
//# sourceMappingURL=SliderSfd.js.map;
var Root;
(function (Root) {
    var TouchScreen = Components.TouchScreen;
    var SwipeSlider = /** @class */ (function () {
        /**
        * Skrypt do swipowania
        * @param sliderItem Pojedyńczy element całego panelu
        * @param slider Panel który się ma swipować
        * @param autoFlow Czy panel ma się samoistnie przesuwać
        */
        function SwipeSlider(sliderItem, slider, autoFlow, sliderMain) {
            this.$sliderItem = sliderItem;
            this.$slider = slider;
            this.$slider.wrapInner("<div class='sfd-slider__main'></div>");
            this.$sliderMain = sliderMain;
            this.$slider.addClass("sfd-slider");
            this.$sliderItem.addClass("sfd-slider__element");
            //wartości startowe
            this.flow = true; // umożliwia samoistne przesuwanie się panelu
            this.sliderPosition = 0; // aktualna pozycja slidera
            this.previousOffset = 0; // poprzednia docelowa pozycja
            this.speed = 0; // oblicza prędkość swipowania
            this.loopOffset = 0; // odległość pokonana przez samojeżdzący slider razem z ogólnym przesunięciem slidera
            this.lastPositionAdded = 0; // ostatnia odległość przy której została zmieniona pozycja slidera
            this.lastAddedSet = 0; // liczba przesunięć zestawu elementów
            //konfiguracja
            this.speedFactor = 1.3; // współczynnik dzięki któremu można przyśpieszyć swipowanie
            this.loopSpeed = -20; // odległość przesuwania się slidera podczas samoistniejącego przesuwania się
            this.maxYOffset = 40; // maksymalne przesunięcie strony w góre/dół które zostanie potraktowane jako swipe
            if (TouchScreen.IsTouchDevice()) {
                this.MobileSwipeEvents();
                this.speedFactor = 2.7; //szybciej na mobile
                autoFlow = false;
            }
            else {
                this.DesktopSwipeEvents();
            }
            if (autoFlow)
                this.SetLoop();
            this.numberOfItems = this.$slider.find(".sfd-slider__element").not(".sfd-slider__element--static").length;
            this.sumWidth = this.GetSumWidthOfElements();
            this.AddClonesAtFirst();
        }
        /**
        * Funkcja obsługjąca zdarzenia onSwipe na urządzeniu z dotykowym ekranem
        */
        SwipeSlider.prototype.MobileSwipeEvents = function () {
            var _this_1 = this;
            this.$slider.onSwipe(function (e) {
                _this_1.StartTrigger();
            }, function (e, swipeInfo) {
                _this_1.EnableScrolling();
                _this_1.EndTrigger(swipeInfo.elapsedTime);
            }, function (e, swipeInfo) {
                if (!(swipeInfo.direction.Down || swipeInfo.direction.Up) && Math.abs(swipeInfo.actualX - swipeInfo.startX) > 5) {
                    _this_1.DisableScrolling();
                    _this_1.startX = swipeInfo.startX;
                    if (swipeInfo.direction.Left)
                        _this_1.swipeLeft = true;
                    if (swipeInfo.direction.Right)
                        _this_1.swipeLeft = false;
                    _this_1.FollowFinger(swipeInfo.actualX);
                }
            });
        };
        /**
         * Funkcja obsługjąca zdarzenia onSwipe na urządzeniu desktopowym
         */
        SwipeSlider.prototype.DesktopSwipeEvents = function () {
            var _this_1 = this;
            var _this = this;
            var startTime;
            var startX;
            var startY;
            this.$slider.mousedown(function (e) {
                _this.$sliderMain.css("pointer-events", "auto");
                _this.onClickMouse = true;
                startTime = new Date().getTime();
                startX = e.pageX;
                startY = e.clientY;
                _this.StartTrigger();
            });
            this.$slider.mouseup(function () {
                _this_1.$sliderMain.css("pointer-events", "auto");
                _this_1.onClickMouse = false;
                var elapsedTime = new Date().getTime() - startTime;
                _this_1.EndTrigger(elapsedTime);
            });
            this.$slider.mousemove(function (e) {
                if (_this.onClickMouse) {
                    var upDownOffset = Math.abs(startY - e.clientY);
                    if (upDownOffset <= _this.maxYOffset) {
                        _this.$sliderMain.css("pointer-events", "none");
                        _this.startX = startX;
                        var x = e.clientX;
                        _this.swipeLeft = startX > x ? true : false;
                        _this.FollowFinger(x);
                    }
                }
            });
            this.$slider.on('dragstart', function (e) {
                e.preventDefault();
            });
            this.$slider.mouseover(function () {
                _this_1.flow = false;
            });
            this.$slider.mouseout(function () {
                _this_1.flow = true;
            });
        };
        /**
         * Obsługuje zdarzenie dotknięcia panelu - wspólne dla desktopu i mobile
         */
        SwipeSlider.prototype.StartTrigger = function () {
            this.$sliderMain.removeClass('slow-down-transition');
            this.flow = false;
            this.slideFast = false;
            this.$sliderMain.removeClass('sfd-slider__main');
            this.$sliderMain.addClass('swipe-slider-main');
        };
        /**
         * Obsługuje zdarzenia puszczenia myszki/palca z panelu
         * @param elapsedTime Czas pomiędzy dotknięciem a puszczeniem
         */
        SwipeSlider.prototype.EndTrigger = function (elapsedTime) {
            var _this_1 = this;
            var touchEndTime = new Date().getTime();
            var timeDif = touchEndTime - this.timeOfLastTouch;
            this.slideFast = timeDif < 50 ? true : false;
            var distance = Math.abs(this.sliderPosition - this.previousOffset);
            this.speed = (distance / elapsedTime) * 100;
            var waitTime = 100;
            if (this.slideFast && this.speed != 0) {
                waitTime = 600;
                this.SlideAfterSwipe();
            }
            setTimeout(function () {
                _this_1.flow = true;
                _this_1.loopOffset = _this_1.previousOffset;
            }, waitTime);
            this.sliderPosition = this.previousOffset;
            this.$sliderMain.addClass('sfd-slider__main');
            this.$sliderMain.removeClass('swipe-slider-main');
        };
        /**
        * Funkcja pozwalająca na podążanie slidera za palcem
        * @param x Aktualna pozycja palca na ekranie
        */
        SwipeSlider.prototype.FollowFinger = function (x) {
            this.timeOfLastTouch = new Date().getTime();
            var offset = -(this.startX - x);
            var sliderPosition = this.sliderPosition + offset;
            this.previousOffset = sliderPosition;
            this.MoveSlider(sliderPosition, true);
        };
        /**
         * Funkcja wykonująca dodatkowe przesunięcie, jeśli prędkość była powyżej wartości
         */
        SwipeSlider.prototype.SlideAfterSwipe = function () {
            var moveAfter = this.swipeLeft ? -(this.speed) : this.speed;
            moveAfter = moveAfter * this.speedFactor;
            this.previousOffset = this.previousOffset + moveAfter;
            this.MoveSlider(this.previousOffset, true);
            this.$sliderMain.addClass('slow-down-transition');
        };
        /**
         * Funkcja przesuwająca panel o podaną pozycje
         * @param position Pozycja do której panel się przesunie
         * @param autoLoop Czy przesunięcie jest spowodowane samoistnym sliderem
         */
        SwipeSlider.prototype.MoveSlider = function (position, autoLoop) {
            this.$sliderMain.css({
                '-webkit-transform': "translate3d(" + position + "px, 0px,0px)",
                '-moz-transform': "translate3d(" + position + "px, 0px,0px)",
                '-ms-transform': "translate3d(" + position + "px, 0px,0px)",
                '-o-transform': "translate3d(" + position + "px, 0px,0px)",
                'transform': "translate3d(" + position + "px, 0px,0px)"
            });
            if (autoLoop)
                this.BackToPosition();
        };
        /**
         * Niekończąca się pętla przesuwająca panel, jeśli jest taka potrzeba
         * @param x Aktualna pozycja palca na ekranie
         */
        SwipeSlider.prototype.SetLoop = function () {
            var _this_1 = this;
            if (this.flow) {
                this.$sliderMain.css("pointer-events", "auto");
                setInterval(function () { return _this_1.LoopSlide(); }, 500);
            }
        };
        /**
         * Funkcja przesuwająca panel o ilość px podanych w konfiguracji
         */
        SwipeSlider.prototype.LoopSlide = function () {
            if (this.flow && !document.hidden) {
                this.$sliderMain.removeClass('slow-down-transition');
                var right = parseInt(this.$sliderMain.css('right'));
                if ((Math.abs(right) + Math.abs(this.loopOffset)) % (2 * this.sumWidth) < Math.abs(this.loopSpeed)) {
                    this.$sliderMain.css("right", right - this.sumWidth);
                    this.lastAddedSet++;
                    this.lastPositionAdded = this.sliderPosition;
                }
                this.loopOffset += this.loopSpeed;
                this.sliderPosition = this.loopOffset;
                this.previousOffset = this.sliderPosition;
                this.MoveSlider(this.loopOffset, false);
            }
        };
        /**
         * Funkcja dodająca zestaw elementów z lewej i prawej
         */
        SwipeSlider.prototype.AddClonesAtFirst = function () {
            for (var i = 0; i < this.numberOfItems; i++) {
                var elementToClone = this.$slider.find(".sfd-slider__element").not(".sfd-slider__element--static").eq(this.numberOfItems - 1);
                var firstElement = this.$slider.find(".sfd-slider__element").not(".sfd-slider__element--static").first();
                var clonedElement = elementToClone.clone();
                firstElement.before(clonedElement);
                var elementWidth = $(clonedElement).outerWidth(true);
                var right = parseInt(this.$sliderMain.css('right')) + elementWidth;
                this.$sliderMain.css("right", right);
            }
            for (var i = 0; i < this.numberOfItems; i++) {
                var elementToClone = this.$slider.find(".sfd-slider__element").not(".sfd-slider__element--static").eq(i);
                var lastElement = this.$slider.find(".sfd-slider__element").not(".sfd-slider__element--static").last();
                var clonedElement = elementToClone.clone();
                lastElement.after(clonedElement);
            }
        };
        /**
         * Przejście do pozycji startowej
         */
        SwipeSlider.prototype.BackToPosition = function () {
            var result = Math.abs(this.previousOffset) / this.sumWidth;
            result = Math.floor(result);
            var offset = Math.abs(this.previousOffset) - Math.abs(this.lastPositionAdded);
            if (Math.abs(offset) >= (this.sumWidth * 0.98) && this.lastAddedSet != result) {
                this.lastAddedSet = result;
                var right = parseInt(this.$sliderMain.css('right'));
                if (this.swipeLeft) {
                    this.lastPositionAdded -= this.sumWidth;
                    this.$sliderMain.css("right", right - this.sumWidth);
                }
                else {
                    this.lastPositionAdded += this.sumWidth;
                    this.$sliderMain.css("right", right + this.sumWidth);
                }
            }
        };
        /**
         * Sumuje szerokość wszystkich elementów
         */
        SwipeSlider.prototype.GetSumWidthOfElements = function () {
            var sumWidth = 0;
            var _this = this;
            $(this.$sliderItem).not(".sfd-slider__element--static").each(function (i) {
                sumWidth += $(_this.$sliderItem).eq(i).outerWidth(true);
            });
            return sumWidth;
        };
        /**
         * Blokuje scrollowanie
         */
        SwipeSlider.prototype.DisableScrolling = function () {
            document.body.addEventListener('touchmove', this.PreventScroll, { passive: false });
        };
        /**
         * Odpala scrollowanie z powrotem
         */
        SwipeSlider.prototype.EnableScrolling = function () {
            document.body.removeEventListener('touchmove', this.PreventScroll);
        };
        SwipeSlider.prototype.PreventScroll = function (e) {
            e.preventDefault();
        };
        return SwipeSlider;
    }());
    Root.SwipeSlider = SwipeSlider;
})(Root || (Root = {}));
//# sourceMappingURL=SwipeSlider.js.map;
var Components;
(function (Components) {
    var ShowMoreTextbox = /** @class */ (function () {
        function ShowMoreTextbox(showMoreTextboxContainer, showMoreTextboxBox, showMoreTextboxButton) {
            var _this = this;
            this.$showMoreTextboxContainer = showMoreTextboxContainer;
            this.$showMoreTextboxBox = showMoreTextboxBox;
            this.$showMoreTextboxButton = showMoreTextboxButton;
            this.height = $(this.$showMoreTextboxBox).css('max-height');
            $(this.$showMoreTextboxButton).on('click', function (e) {
                e.preventDefault();
                if ($(_this.$showMoreTextboxButton).hasClass('description__button--down')) {
                    $(_this.$showMoreTextboxButton).text(TextRecourse.Ukryj);
                    $(_this.$showMoreTextboxButton).removeClass('description__button--down').addClass('description__button--up');
                    var wys = _this.$showMoreTextboxContainer.height() + 40;
                    _this.$showMoreTextboxBox.animate({ "height": wys }, { duration: "slow" }).css({ "max-height": wys }).addClass('description__box--nofade');
                }
                else {
                    $(_this.$showMoreTextboxButton).removeClass('description__button--up').addClass('description__button--down');
                    $(_this.$showMoreTextboxButton).text(TextRecourse.PokazWiecej);
                    _this.$showMoreTextboxBox.animate({ "height": _this.height }, { duration: "slow" }).removeClass('description__box--nofade');
                }
            });
        }
        return ShowMoreTextbox;
    }());
    Components.ShowMoreTextbox = ShowMoreTextbox;
})(Components || (Components = {}));
//# sourceMappingURL=ShowMoreTextbox.js.map;
var Root;
(function (Root) {
    var Application = /** @class */ (function () {
        function Application(rootUrl) {
            this.RootUrl = rootUrl;
            this.Test();
            this.HomePageInit();
            this.RodoShowMoreInit();
        }
        Application.prototype.HomePageInit = function () {
            var _this = this;
            this.HomepageAsyncProducts = new Root.Home.AsyncProducts(this.RootUrl);
            this.HomepageAsyncProducts.HideProducts();
            //let favoriteCategories = new Home.FavoriteCategories();
            var opineoSlider = new Root.SliderSfd($('.opineo-slider__item'), $('.opineo-slider__list'), true, true);
            //let tileCategoriesSlider = new Root.SliderSfd($('.tile-categories__item'), $('.title-categories__inner'),true, true);
            var showMoreTextboxObject = new Components.ShowMoreTextbox($('.home-shop-description'), $('.shop-description__box'), $('.shop-description__button'));
            $(function () {
                var lastWatchedProducts = new Root.Home.LastWatchedProducts(_this.RootUrl + '/aspx/GlownaOstatnioOgladane.ashx');
            });
        };
        Application.prototype.RodoShowMoreInit = function () {
            if ($('.clause-description').length) {
                var showMoreTextboxObject = new Components.ShowMoreTextbox($('.clause-description'), $('.clause-description__box'), $('.clause__button'));
            }
        };
        Application.prototype.Test = function () {
            console.log('[Test] from Root.Application');
        };
        return Application;
    }());
    Root.Application = Application;
})(Root || (Root = {}));
//# sourceMappingURL=Application.js.map;
var bar = $('.top_bar');
var barH = 0;
var headH = 0;
var tbSzukajDefault = typeof tbSzukaj !== "undefined" ? tbSzukaj : null;
var autocompleteVisible = false;
var menuVisible = false;
var hoverElem = null;

/*elementy pomocnicze w nawigacji */
var elToCopy;
var backLink;

/*media breakpoint*/
var masterWidth;
var maxWidth;
var minWidth;

/*zmienna do wysokości scrolla*/
var scrollH;

//szerokość wrappera dla multisklepu
switch (PageConfig.BundleCatalog) {
    case "GymProvocateur":
    case "Fitwoman": {
        masterWidth = 1200;
        maxWidth = window.matchMedia("(max-width: 1199px)");
        minWidth = window.matchMedia("(min-width: 1200px)");
        break;
    }
    default: {
        masterWidth = 1280;
        maxWidth = window.matchMedia("(max-width: 1279px)");
        minWidth = window.matchMedia("(min-width: 1280px)");

        break;
    }
}

//wyszukiwarka
if (tbSzukajDefault != null) {
    $(tbSzukajDefault).on("onShowAutocomplete", function () {
        autocompleteVisible = true;
        autocompleteVisible = true;
    });

    $(tbSzukajDefault).on("onHideAutocomplete", function () {
        autocompleteVisible = false;
    });
}

$("*").on("mouseenter", function () {
    hoverElem = this;
});

$(".primary-menu__submenu-link.primary-menu__item-text--arrows").on("click", function (e) {
    if (maxWidth.matches || isTouchDevice() && $(this).next().is("div")) {//jesli ekran dotykowy lub mobile to nie przechodź
        e.preventDefault();
    }
    elToCopy = $(this);
    var parent = $(this).parent();
    var childNav = $(this).next();

    //NADKATEGORIE
    if (maxWidth.matches && $(this).next().is("div")) {
        if (!parent.hasClass("primary-menu__main-list-item--active")) {
            parent.addClass("primary-menu__main-list-item--active");
            childNav.children("ul").scrollTop(0);
        }
        $("<span class='go--back primary-menu__item-text--arrows'>" + elToCopy.text() + "</span> ").prependTo($(childNav).children("ul"));

    }

    //PODKATEGORIE
    if (maxWidth.matches && $(this).next().is("ul")) {
        if (!parent.hasClass("primary-menu__submenu-listitem--active")) {
            parent.addClass("primary-menu__submenu-listitem--active");
        }
        $("<span class='go--back primary-menu__item-text--arrows'>" + elToCopy.text() + "</span> ").prependTo($(childNav));
    }
});


//dodanie pomocniczego elementu do nawigacji
$(document).on("click", ".go--back.primary-menu__item-text--arrows", function (e) {
    var mostParentNav = $(this).parent().parent().parent();
    var parentNav = $(this).parent().parent();

    if (mostParentNav.hasClass("primary-menu__main-list-item--active")) {
        mostParentNav.removeClass("primary-menu__main-list-item--active");
    }
    if (parentNav.hasClass("primary-menu__submenu-listitem--active")) {
        parentNav.removeClass("primary-menu__submenu-listitem--active");

    }
    $(this).parent().scrollTop(0);
    $(this).parent().parent().parent().scrollTop(0);
    $(this).remove();
});

//fixed menu
function SetSiteHeaderScrolledState() {
    barH = $(bar).height();
    headH = $('.page-header').height();

    if ($(window).scrollTop() > headH && minWidth.matches) {
        $('.page-header').addClass("page-header--scrolled").trigger('classChange');
    }

    else {
        $('.page-header').removeClass("page-header--scrolled").trigger('classChange');
    }
}

//hamburger menu - mobile
$(document).on("click", ".menu-switch", function (e) {
    if ($(this).hasClass("active")) {
        $(this).removeClass("active").trigger('hideMenu');
        $(".page-header").removeClass("page-header--menu-activated");

    } else {
        $(this).addClass("active").trigger('showMenu');
        $(".page-header").addClass("page-header--menu-activated");
    }
});


//działanie nawigacji - multisklep
$(document).on("click", ".primary-menu__item-text", ".primary-menu__item-text.account-menu__text", function (e) {
    var parent = $(this).parent();
    if (parent.hasClass("primary-menu__item--active") && minWidth.matches) {
        parent.removeClass("primary-menu__item--active");
    } else {
        $(".primary-menu__item-text").parent().removeClass("primary-menu__item--active");
        parent.addClass("primary-menu__item--active");
    }
    if (parent.hasClass("primary-menu__category-item")) {
        $(".page-header__bottom").addClass("desktop-menu-active");
        if (!$(".primary-menu__main-list-item").hasClass("primary-menu__main-list-item--active") && minWidth.matches) {
            $(".primary-menu__main-list-item:first-child").addClass("primary-menu__main-list-item--active"); //pierwsza lista domyślnie aktywna przy uruchomieniu menu kat.
        }
    }
});


$(document).on("click", ".account-menu__text", function (e) {
    if (PageConfig.BundleCatalog === "SklepSFD" || PageConfig.BundleCatalog === "Allnutritioncz") {
        var parent = $(this).parent();
        if (!parent.hasClass("primary-menu__item--active")) {
            parent.addClass("primary-menu__item--active");

        }
        else {
            $(".account-menu__text").parent().removeClass("primary-menu__item--active");
        }
    }
});

$(document).on("click", ".my-account__close", function (e) {
    e.preventDefault();
    $(".account-menu__text").parent().removeClass("primary-menu__item--active");
});

//ustawienie widocznego pierwszego elementu dla menu mobile
$(document).on("showMenu", function () {
    if (!$(".primary-menu__item").hasClass("primary-menu__item--active")) {
        $(".primary-menu__category-item ").addClass("primary-menu__item--active");
    }
    //zmienna pomocnicza do obliczania wysokości scrolla w menu, póki co jednak niepotrzebna
    if (PageConfig.BundleCatalog == "SklepSFD" || PageConfig.BundleCatalog == "Allnutritioncz") {
        setScrollHeieght();
    }
    $("body").addClass("menu-avoid-scroll");
});

//$(".page-header__bottom").on("windowHeightChange", () => { setScrollHeieght(); });

function setScrollHeieght() {
    scrollH = $(window).innerHeight() - $(".page-header").outerHeight(true) - $(".primary-menu__item-text").outerHeight(true) * 2 - 20;
    $(".submenu-kategorie ul, .submenu-producenci ").css("height", scrollH + "px");
}

$(document).on("hideMenu", function () {
    $("body").removeClass("menu-avoid-scroll");
});


$(document).scroll(function () {
    SetSiteHeaderScrolledState();
}).trigger('scroll');

/* Chowanie menu przy scrollowaniu na mniejszych urządzeniach */
var lastScrollPosition = 0;
$(window).scroll(function (e) {
    var headerElement = $(".page-header").eq(0);
    if ($(window).height() < 813 && maxWidth.matches && !headerElement.hasClass("page-header--menu-activated") && !autocompleteVisible) {
        var headerHeight = headerElement.outerHeight();
        var mainPaddingTop = parseInt($("main").css("padding-top").replace("px", ""));
        var headerSlideStartPoint = headerHeight + mainPaddingTop;
        var currentScrollPosition = $(this).scrollTop();

        if (currentScrollPosition > headerSlideStartPoint) {
            if (currentScrollPosition > lastScrollPosition) {
                headerElement.css("top", (-1 * headerSlideStartPoint) + "px").trigger("stickyNav");
            } else {
                headerElement.css("top", "0px").trigger("unstickyNav");
            }
            lastScrollPosition = currentScrollPosition;
        }
        else {
            // pokaz przy kazdym scrollu
            headerElement.css("top", "0px");
            lastScrollPosition = currentScrollPosition;
        }
    }
});

$(function () {

    SetSiteHeaderScrolledState();

    var hoveredSubmenu = null; /* Przetrzymuje informacje o najechanym menu w celu sprawdzenia czy włączyć je wraz z opóźnieniem czy akcja jest już niepotrzebna */

    if ($('.secondary-menu li > .order-again_btn').length && maxWidth.matches) {
        $('.secondary-menu li > .order-again_btn').insertAfter($('.page-header'));
    }

    /*nawigacja główna na hover - minimum 1280px*/
    $(".primary-menu__item > .primary-menu__item-text").parent().on("mouseover", function () {
        if (minWidth.matches && !isTouchDevice()) {
            var self = $(this);
            var hoverId = self.data("hoverid");
            if (hoverId == undefined) {
                hoverId = guid();
                self.data("hoverid", hoverId);
            }

            hoveredSubmenu = hoverId;
            setTimeout(function () {
                if (hoveredSubmenu == hoverId) {
                    RemoveActiveClasses();
                    self.addClass("primary-menu__item--active");
                    if (self.find("div").length > 1) {
                        $(".page-header__bottom").addClass("desktop-menu-active");
                    }
                }
            }, 300);
            if (self.find("div").length > 1 && !$(".primary-menu__main-list-item").hasClass("primary-menu__main-list-item--active")) {
                $(".primary-menu__main-list-item:first-child").addClass("primary-menu__main-list-item--active");
            }
        }
    });

    function RemoveActiveClasses() {
        if ($('.primary-menu__item').hasClass('primary-menu__item--active')) {
            $('.primary-menu__item').removeClass('primary-menu__item--active');
        }
    }

    //kateogrie i producenci po hoverze
    $(".primary-menu__item > .primary-menu__item-text").parent().on("mouseleave", function () {
        ItemMouseleave();
    });

    async function ItemMouseleave() {
        hoveredSubmenu = null;
        if (minWidth.matches && !isTouchDevice()) {
            var onAcceptableClass = await CheckIfIsAcceptableClass();
            await WaitUntil(50);
            if (onAcceptableClass) {
                return;
            } else {
                $(this).children($(".primary-menu__main-list-item")).removeClass("primary-menu__main-list-item--active");
                $(".page-header__bottom").removeClass("desktop-menu-active");
                if ($(".primary-menu__main-list-item").hasClass("primary-menu__main-list-item--active")) {
                    $(".primary-menu__main-list-item").removeClass("primary-menu__main-list-item--active"); //odznaczenie nadkategorii
                }
                RemoveActiveClasses();
            }
        }
    }

    //Jeśli kursor znajduje się nad elementem z danej podkategorii menu
    async function CheckIfIsAcceptableClass() {
        await WaitUntil(30);
        return $('.primary-menu').find($(hoverElem)).length;
    }

    function WaitUntil(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    //tymczasowo pozwalamy przechodzić do kat głównej na desktopie ZASTĄPIONE WYŻEJ
    $(".primary-menu__main-list-item > a ").on("click", function (e) {
        if (maxWidth.matches || isTouchDevice()) {
            e.preventDefault();
            $(this).parent().parent().children().removeClass('primary-menu__main-list-item--active');
            $(this).parent().addClass("primary-menu__main-list-item--active");
        }
    });

    //hover dla nadkategorii
    $(".primary-menu__main-list-item > a ").on("mouseover", function (e) {
        if (minWidth.matches && !isTouchDevice()) {
            $(this).parent().parent().children().removeClass('primary-menu__main-list-item--active');
            $(this).parent().addClass("primary-menu__main-list-item--active");
        }
    });

    $(".submenu-promocje .promocje-typy a").on("click", function (e) {
        if (!$(".page-header").hasClass("page-header--menu-activated")) {
            e.preventDefault();
        }
        $(".submenu-promocje .promocje-typy a").removeClass("active");
        $(this).addClass("active");

        var index = $(this).data("index");
        $(".submenu-promocje .promotion-box").hide();
        $(".submenu-promocje .promotion-box").each(function () {
            if ($(this).data("index") == index) {
                $(this).show();
            }
        });
    });

    var visitedCategories = getFromStorage("categories-visits");
    visitedCategories = visitedCategories == null ? [] : visitedCategories.visits;
    var categoriesInSubmenu = [];

    for (var index in visitedCategories) {
        var item = visitedCategories[index];
        $(".primary-menu li").each(function () {
            var cat = $(this).find("a");
            if (cat.data("id") == item.id) {
                categoriesInSubmenu.push(item);
                return false; //zamiast break; w .each
            }
        });

        if (categoriesInSubmenu.length == 5) {
            break;
        }
    }

    //categoriesInSubmenu.reverse();

    //for (var index in categoriesInSubmenu) {
    //    var moveElement = $(String.format('.submenu-kategorie a[data-id="{0}"]', categoriesInSubmenu[index].id));
    //    moveElement.addClass("user-prefer");
    //}
});;
var PageHeader;
(function (PageHeader) {
    var ProducersHandbands = /** @class */ (function () {
        function ProducersHandbands(rootUrl) {
            var _this = this;
            this.ProducersMenu = $('.submenu-producenci .producent-list');
            this.ProducersMenuCopyHtml = this.ProducersMenu.html();
            this.RootUrl = rootUrl;
            var goBack = $("<span class=\"go-back_producent-list\">" + TextRecourse.TopMenuWroc + "</span>");
            $(goBack).on('click', function (e) {
                e.preventDefault();
                $(goBack).hide();
                _this.ProducersMenu.html(_this.ProducersMenuCopyHtml);
                $('.primary-menu__heading.producents-list').text(TextRecourse.TopMenuBestselers);
                if (screen.width > 1279) {
                    _this.ProducersMenu.attr('style', _this.ColumnsStyle(6));
                }
            });
            $('.submenu-producenci .headbands-box__link').on('click', function (e) {
                e.preventDefault();
                $(goBack).show();
                goBack.insertBefore($('.producent-list'));
                _this.Load($(e.currentTarget).text());
            });
        }
        ProducersHandbands.prototype.Load = function (headband) {
            var _this = this;
            $.ajax({
                url: this.RootUrl + "/Default.aspx/GetProducers",
                data: JSON.stringify({ captial: "" + headband }),
                type: 'POST',
                contentType: "application/json",
                success: function (response) {
                    var r = JSON.parse(response.d);
                    _this.RenderMenu(r);
                },
                error: function (response) {
                    alert("Wyst\u0105pi\u0142 b\u0142\u0105d aplikacji: " + response.responseText);
                    _this.ProducersMenu.html(_this.ProducersMenuCopyHtml);
                    _this.ProducersMenu.attr('style', _this.ColumnsStyle(4));
                }
            });
        };
        ProducersHandbands.prototype.ColumnsStyle = function (numberOfColumns) {
            return "-moz-column-count: " + numberOfColumns + "; -webkit-column-count: " + numberOfColumns + "; column-count: " + numberOfColumns + ";";
        };
        ProducersHandbands.prototype.RenderMenu = function (data) {
            var cols = Math.ceil(Object.keys(data).length / 13);
            this.ProducersMenu.attr('style', this.ColumnsStyle(cols));
            this.ProducersMenu.html(this.CreateHtml(data));
        };
        ProducersHandbands.prototype.CreateHtml = function (data) {
            var html = '';
            for (var key in data) {
                html += "<li><a href=\"" + data[key] + "\">" + key + "</a></li>";
            }
            html += '<li></li>';
            return html;
        };
        return ProducersHandbands;
    }());
    PageHeader.ProducersHandbands = ProducersHandbands;
})(PageHeader || (PageHeader = {}));
new PageHeader.ProducersHandbands(PageConfig.rootUrl);
//# sourceMappingURL=ProducersHandbands.js.map;
var PageHeader;
(function (PageHeader) {
    var TopBar = /** @class */ (function () {
        function TopBar() {
            this.storageKey = 'topbar-closed';
            this.marginsUpdated = false;
            this.CloseTopBar();
            //this.topBarClosed = Cookie.GetCookie(this.storageKey) === 'true';
            //if (!this.topBarClosed) {
            //    this.ShowTopBar();
            //}
        }
        TopBar.prototype.CloseTopBar = function () {
            var _this = this;
            $('.close_topbar').on('click', function () {
                $('.top_bar').hide();
                $('.page-header__bottom').trigger("windowHeightChange");
                $('.page-header__bottom').removeAttr("style");
                var element = $('main');
                if ($('.rotator').length) {
                    element = $('.rotator');
                }
                element.removeAttr("style");
                Cookie.SetCookie(_this.storageKey, 'true');
            });
        };
        TopBar.prototype.ShowTopBar = function () {
            $('.top_bar').show();
        };
        return TopBar;
    }());
    PageHeader.TopBar = TopBar;
})(PageHeader || (PageHeader = {}));
var topBar = null;
$(document).ready(function () {
    topBar = new PageHeader.TopBar();
    console.log("topmargin document ready");
    var link = $('.top_bar__item a');
    if (!link.attr('href')) {
        link.css("cursor", "default");
    }
});
//# sourceMappingURL=TopBar.js.map;
var PageFooter;
(function (PageFooter) {
    var Newsletter = /** @class */ (function () {
        function Newsletter() {
            if (typeof NEWSLETTER_CONFIG !== 'undefined') {
                fireClickEventOnEnter(NEWSLETTER_CONFIG.tbEmailHandle, NEWSLETTER_CONFIG.lbZapiszHandle);
                this.SaveNewsletter();
            }
        }
        Newsletter.prototype.SaveNewsletter = function () {
            $(NEWSLETTER_CONFIG.lbZapiszHandle).click(function (e) {
                var isvalid = Page_ClientValidate('vgNewsletter');
                if (!NEWSLETTER_CONFIG.zgodaRODO) {
                    e.preventDefault();
                    if (isvalid) {
                        $('#newsletter-zgoda').dialog({
                            modal: true,
                            title: TextRecourse.NewsletterZapiszSie,
                            draggable: false,
                            resizable: false,
                            closeText: '',
                            open: function () {
                                $("#klauzulaRODO").load(PageConfig.rootUrl + '/aspx/RODO.ashx', function () {
                                    var showMoreTextboxNewsletterRODOObject = new Components.ShowMoreTextbox($('.clause-description'), $('.clause-description__box'), $('.clause__button'));
                                });
                            },
                            close: function () {
                                $(this).dialog("close");
                            },
                            buttons: [
                                {
                                    text: TextRecourse.Zapisz,
                                    click: function () {
                                        var isChecked = Page_ClientValidate('vgNewsletter2');
                                        if (isChecked && $(NEWSLETTER_CONFIG.cbZgodaMailNewsletter).is(":checked")) {
                                            $(this).dialog("close");
                                            console.log("newsletter.save");
                                            NEWSLETTER_CONFIG.zgodaRODO = true;
                                            $(NEWSLETTER_CONFIG.btnZapiszHandle).trigger('click');
                                        }
                                    },
                                    "class": "btn-accept btn-accept--arrow"
                                }
                            ]
                        });
                    }
                }
            });
        };
        return Newsletter;
    }());
    PageFooter.Newsletter = Newsletter;
})(PageFooter || (PageFooter = {}));
var newsletter = new PageFooter.Newsletter();
//# sourceMappingURL=Newsletter.js.map;
var PurchaseProcess;
(function (PurchaseProcess) {
    var ZipCodeValidator = /** @class */ (function () {
        function ZipCodeValidator(Config) {
            var _this = this;
            this.Config = Config;
            this.ConfirmPanel = $(Config.$ConfirmZipCodePanel);
            this.ZipCodeFocusOut();
            this.CityFocusOut();
            this.ZipCodeFoucusIn();
            this.ConfirmCodeClick();
            this.CountryChange();
            this.CorrectZipCode = false;
            this.CityChanged = false;
            this.PolandValue = "31";
            this.CzechValue = "10";
            this.SlovakiaValue = "37";
            this.DefaultCountry = "-1";
            $(".js-cbOtherAddress").on("click", function (e) { return _this.ConfirmPanel.hide(); });
        }
        /**
         * Obsługuje zdarzenie wyjścia z inputa kodu pocztowego
         */
        ZipCodeValidator.prototype.ZipCodeFocusOut = function () {
            var _this = this;
            $(this.Config.$TbZipCode).focusout(function () {
                _this.CheckIfCityValidatorEnabled();
                var code = $(_this.Config.$TbZipCode).val();
                code = code.replace(/\D+/g, '');
                if (code.length == 5) {
                    if ((($(_this.Config.$TbZipCode).val().length - code.length < 1) || ($(_this.Config.$TbZipCode).val().length - code.length == 1 && $(_this.Config.$TbZipCode).val()[2] == "-")) && _this.CheckCountry(_this.PolandValue)) {
                        //jeśli kod jest w formacie xxxxx lub xx-xxx, w przeciwnym wypadku odpali się zwykły walidator
                        code = code.slice(0, 2) + "-" + code.slice(2);
                        _this.ZipCode = code;
                        _this.ValidateCode("kod=" + code);
                    }
                    else if ((($(_this.Config.$TbZipCode).val().length - code.length < 1) || ($(_this.Config.$TbZipCode).val().length - code.length == 1 && $(_this.Config.$TbZipCode).val()[3] == " ")) && (_this.CheckCountry(_this.CzechValue) || _this.CheckCountry(_this.SlovakiaValue))) {
                        code = code.slice(0, 3) + " " + code.slice(3);
                        _this.ZipCode = code;
                        //$(this.Config.$TbCity).val(code);
                        _this.ValidateCode("kod=" + code + "&kraj=" + $(_this.Config.$DdlKraj + ' :selected').val());
                    }
                }
                else {
                    _this.ConfirmPanel.hide();
                }
            });
        };
        /**
         * Obsługuje zdarzenie wyjścia z inputa miasta
         */
        ZipCodeValidator.prototype.CityFocusOut = function () {
            var _this = this;
            $(this.Config.$TbCity).focusout(function () {
                _this.CheckIfCityValidatorEnabled();
                _this.CityChanged = true;
                if ($(_this.Config.$TbCity).val().length != 0 && _this.CorrectZipCode && _this.CheckCountryAll()) {
                    _this.ValidateCode("kod=" + _this.ZipCode + "&miasto=" + $(_this.Config.$TbCity).val());
                }
            });
        };
        /**
         * Sprawdza czy podany kod pocztowy jest w bazie
         */
        ZipCodeValidator.prototype.ValidateCode = function (urlPart) {
            var _this = this;
            if (this.CheckCountryAll()) {
                $.ajax({
                    type: "GET",
                    url: PageConfig.rootUrl + "/aspx/controls/KodPocztowy.ashx/?" + urlPart,
                    contentType: 'application/json; charset=utf-8',
                    dataType: 'json',
                    async: true,
                    timeout: 1000,
                    success: function (data) {
                        if (data != null) {
                            _this.ManageValdationResult(data);
                        }
                    }
                });
            }
        };
        /**
         * Obsługuje wynik walidacji formularza
         */
        ZipCodeValidator.prototype.ManageValdationResult = function (data) {
            if (data == "false") {
                if (this.CheckCountryAll()) {
                    this.ResetCountry();
                    this.ConfirmPanel.show();
                }
            }
            else {
                this.CorrectZipCode = true;
                this.ConfirmPanel.hide();
                //this.SetCountry();
                //jeśli znalazło dokładnie jedno miasto
                if (data != "true") {
                    $(this.Config.$TbCity).val(data);
                    $('.city-validation-text').hide();
                }
            }
        };
        /**
         * Wydarzenie kliknięcia w btn potwierdzający poprawny kod pocztowy
         */
        ZipCodeValidator.prototype.ConfirmCodeClick = function () {
            var _this = this;
            $(".confirm-zip-code__btn").on('click', function (event) {
                event.preventDefault();
                _this.ConfirmPanel.hide();
            });
        };
        /**
         * Obsługuje zdarzenie wejścia w input kodu pocztowego
         */
        ZipCodeValidator.prototype.ZipCodeFoucusIn = function () {
            var _this = this;
            $(this.Config.$TbZipCode).focusin(function () {
                _this.CorrectZipCode = false;
                _this.CityChanged = false;
            });
        };
        /**
         * Obsługuje zdarzenie wyjścia z wyboru państw
         */
        ZipCodeValidator.prototype.CountryChange = function () {
            var _this = this;
            $(this.Config.$DdlKraj).change(function () {
                _this.EnableValidators();
            });
        };
        /**
         * Sprawdza czy jest odpalony walidator miasta
         */
        ZipCodeValidator.prototype.CheckIfCityValidatorEnabled = function () {
            var cityValidator = $('.city-validation-text:visible');
            if (cityValidator.length == 1) {
                this.ConfirmPanel.css("margin-top", "20px");
            }
            else {
                this.ConfirmPanel.css("margin-top", "5px");
            }
        };
        /**
         * Sprawdza czy zostało wybrane państwo podane w parametrze
         */
        ZipCodeValidator.prototype.CheckCountry = function (value) {
            console.log($(this.Config.$DdlKraj + ' :selected').val());
            if ($(this.Config.$DdlKraj + ' :selected').val() == value) {
                return true;
            }
            else {
                this.ConfirmPanel.hide();
                return false;
            }
        };
        /**
         * Sprawdza czy dla wybranego państwa ma być sprawdzany kod pocztowy
         * */
        ZipCodeValidator.prototype.CheckCountryAll = function () {
            if ($(this.Config.$DdlKraj + ' :selected').val() == this.PolandValue || $(this.Config.$DdlKraj + ' :selected').val() == this.CzechValue || $(this.Config.$DdlKraj + ' :selected').val() == this.SlovakiaValue) {
                return true;
            }
            else {
                this.ConfirmPanel.hide();
                return false;
            }
        };
        /**
         * Zmienia wybrane państwo na "Wybierz kraj"
         */
        ZipCodeValidator.prototype.ResetCountry = function () {
            if (!this.CityChanged) {
                $(this.Config.$DdlKraj).val(this.DefaultCountry);
            }
        };
        /**
         * Zmienia wybrane państwo na Polskę
         */
        ZipCodeValidator.prototype.SetCountry = function () {
            if ($(this.Config.$DdlKraj + ' :selected').val() == this.DefaultCountry) {
                $(this.Config.$DdlKraj).val(this.PolandValue);
            }
        };
        /**
         * Odpala walidacje kodu pocztowego w przypadku wybrania Polski
         */
        ZipCodeValidator.prototype.EnableValidators = function () {
            if (this.CheckCountry(this.PolandValue)) {
                ValidatorEnable(document.getElementById(this.Config.ZipCodeValidatorId), true);
            }
            else {
                ValidatorEnable(document.getElementById(this.Config.ZipCodeValidatorId), false);
            }
        };
        return ZipCodeValidator;
    }());
    PurchaseProcess.ZipCodeValidator = ZipCodeValidator;
})(PurchaseProcess || (PurchaseProcess = {}));
//# sourceMappingURL=ZipCodeValidator.js.map;
var SklepMaster;
(function (SklepMaster) {
    /** Zarządza danymi UTM, które są przekazywane jako parametr GET, z którym klient dociera na stronę sklepu */
    var CriteoUtmManager = /** @class */ (function () {
        function CriteoUtmManager(dateOfVisit) {
            /** Klucz, pod jakim są przechowywane dane z Criteo w Local Storage */
            this.LocalStorageKey = "arrival_to_shop_from_criteo";
            this.DateOfVisit = dateOfVisit;
        }
        /**
         * Sprawdza czy adres użyty do otwarcia strony zawiera UTM pochodzący z Criteo.
         * Jeśli tak, w LocalStorage zostaje zapisana informacja, że klient przybył z Criteo
         */
        CriteoUtmManager.prototype.CheckForCriteoUtmParameter = function () {
            var queryString = window.location.search;
            var searchParams = new URLSearchParams(queryString);
            if (searchParams.has("utm_source") && searchParams.get("utm_source").indexOf("criteo") !== -1) {
                localStorage.setItem(this.LocalStorageKey, JSON.stringify(this.DateOfVisit));
            }
        };
        /** Czy klient ma zapisaną informację, że przybył z Criteo */
        CriteoUtmManager.prototype.IsCriteoClient = function () {
            var criteoInfo = localStorage.getItem(this.LocalStorageKey);
            if (criteoInfo == null) {
                return false;
            }
            try {
                var criteoDate = new Date(JSON.parse(criteoInfo));
                var daysOfActivity = 7;
                criteoDate.setDate(criteoDate.getDate() + daysOfActivity);
                return criteoDate >= this.DateOfVisit;
            }
            catch (e) {
                return false;
            }
        };
        /** Zwraca parametr mówiący o tym czy klient przybył z Criteo */
        CriteoUtmManager.prototype.GetCriteoDeduplicationValue = function () {
            return this.IsCriteoClient() ? 1 : 0;
        };
        return CriteoUtmManager;
    }());
    SklepMaster.CriteoUtmManager = CriteoUtmManager;
})(SklepMaster || (SklepMaster = {}));
//# sourceMappingURL=CriteoUtmManager.js.map;
