/* Minification failed. Returning unminified contents.
(2439,25-26): run-time warning JS1195: Expected expression: .
(2464,21-22): run-time warning JS1195: Expected expression: .
(1,149853-149857): run-time error JS1137: 'this' is a new reserved word and should not be used as an identifier: this
 */
!function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery) }(function (e) { e.ui = e.ui || {}; var t; e.ui.version = "1.12.1", e.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 }; function a() { 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 }, e.extend(this._defaults, this.regional[""]), this.regional.en = e.extend(!0, {}, this.regional[""]), this.regional["en-US"] = e.extend(!0, {}, this.regional.en), this.dpDiv = i(e("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) } function i(t) { var a = "button, .ui-datepicker-calendar td a"; return t.on("mouseout", a, function () { e(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).removeClass("ui-datepicker-next-hover") }).on("mouseover", a, s) } function s() { e.datepicker._isDisabledDatepicker(t.inline ? t.dpDiv.parent()[0] : t.input[0]) || (e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), e(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).addClass("ui-datepicker-next-hover")) } function r(t, a) { for (var i in e.extend(t, a), a) null == a[i] && (t[i] = a[i]); return t } e.extend(e.ui, { datepicker: { version: "1.12.1" } }), e.extend(a.prototype, { markerClassName: "hasDatepicker", maxRows: 4, _widgetDatepicker: function () { return this.dpDiv }, setDefaults: function (e) { return r(this._defaults, e || {}), this }, _attachDatepicker: function (t, a) { var i, s, r; s = "div" === (i = t.nodeName.toLowerCase()) || "span" === i, t.id || (this.uuid += 1, t.id = "dp" + this.uuid), (r = this._newInst(e(t), s)).settings = e.extend({}, a || {}), "input" === i ? this._connectDatepicker(t, r) : s && this._inlineDatepicker(t, r) }, _newInst: function (t, a) { 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: a, dpDiv: a ? i(e("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv } }, _connectDatepicker: function (t, a) { var i = e(t); a.append = e([]), a.trigger = e([]), i.hasClass(this.markerClassName) || (this._attachments(i, a), i.addClass(this.markerClassName).on("keydown", this._doKeyDown).on("keypress", this._doKeyPress).on("keyup", this._doKeyUp), this._autoSize(a), e.data(t, "datepicker", a), a.settings.disabled && this._disableDatepicker(t)) }, _attachments: function (t, a) { var i, s, r, n = this._get(a, "appendText"), d = this._get(a, "isRTL"); a.append && a.append.remove(), n && (a.append = e("<span class='" + this._appendClass + "'>" + n + "</span>"), t[d ? "before" : "after"](a.append)), t.off("focus", this._showDatepicker), a.trigger && a.trigger.remove(), "focus" !== (i = this._get(a, "showOn")) && "both" !== i || t.on("focus", this._showDatepicker), "button" !== i && "both" !== i || (s = this._get(a, "buttonText"), r = this._get(a, "buttonImage"), a.trigger = e(this._get(a, "buttonImageOnly") ? e("<img/>").addClass(this._triggerClass).attr({ src: r, alt: s, title: s }) : e("<button type='button'></button>").addClass(this._triggerClass).html(r ? e("<img/>").attr({ src: r, alt: s, title: s }) : s)), t[d ? "before" : "after"](a.trigger), a.trigger.on("click", function () { return e.datepicker._datepickerShowing && e.datepicker._lastInput === t[0] ? e.datepicker._hideDatepicker() : e.datepicker._datepickerShowing && e.datepicker._lastInput !== t[0] ? (e.datepicker._hideDatepicker(), e.datepicker._showDatepicker(t[0])) : e.datepicker._showDatepicker(t[0]), !1 })) }, _autoSize: function (e) { if (this._get(e, "autoSize") && !e.inline) { var t, a, i, s, r = new Date(2009, 11, 20), n = this._get(e, "dateFormat"); n.match(/[DM]/) && (t = function (e) { for (a = 0, i = 0, s = 0; s < e.length; s++) e[s].length > a && (a = e[s].length, i = s); return i }, r.setMonth(t(this._get(e, n.match(/MM/) ? "monthNames" : "monthNamesShort"))), r.setDate(t(this._get(e, n.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - r.getDay())), e.input.attr("size", this._formatDate(e, r).length) } }, _inlineDatepicker: function (t, a) { var i = e(t); i.hasClass(this.markerClassName) || (i.addClass(this.markerClassName).append(a.dpDiv), e.data(t, "datepicker", a), this._setDate(a, this._getDefaultDate(a), !0), this._updateDatepicker(a), this._updateAlternate(a), a.settings.disabled && this._disableDatepicker(t), a.dpDiv.css("display", "block")) }, _dialogDatepicker: function (t, a, i, s, n) { var d, c, o, l, h, u = this._dialogInst; return u || (this.uuid += 1, d = "dp" + this.uuid, this._dialogInput = e("<input type='text' id='" + d + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.on("keydown", this._doKeyDown), e("body").append(this._dialogInput), (u = this._dialogInst = this._newInst(this._dialogInput, !1)).settings = {}, e.data(this._dialogInput[0], "datepicker", u)), r(u.settings, s || {}), a = a && a.constructor === Date ? this._formatDate(u, a) : a, this._dialogInput.val(a), this._pos = n ? n.length ? n : [n.pageX, n.pageY] : null, this._pos || (c = document.documentElement.clientWidth, o = document.documentElement.clientHeight, l = document.documentElement.scrollLeft || document.body.scrollLeft, h = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [c / 2 - 100 + l, o / 2 - 150 + h]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), u.settings.onSelect = i, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), e.blockUI && e.blockUI(this.dpDiv), e.data(this._dialogInput[0], "datepicker", u), this }, _destroyDatepicker: function (a) { var i, s = e(a), r = e.data(a, "datepicker"); s.hasClass(this.markerClassName) && (i = a.nodeName.toLowerCase(), e.removeData(a, "datepicker"), "input" === i ? (r.append.remove(), r.trigger.remove(), s.removeClass(this.markerClassName).off("focus", this._showDatepicker).off("keydown", this._doKeyDown).off("keypress", this._doKeyPress).off("keyup", this._doKeyUp)) : "div" !== i && "span" !== i || s.removeClass(this.markerClassName).empty(), t === r && (t = null)) }, _enableDatepicker: function (t) { var a, i, s = e(t), r = e.data(t, "datepicker"); s.hasClass(this.markerClassName) && ("input" === (a = t.nodeName.toLowerCase()) ? (t.disabled = !1, r.trigger.filter("button").each(function () { this.disabled = !1 }).end().filter("img").css({ opacity: "1.0", cursor: "" })) : "div" !== a && "span" !== a || ((i = s.children("." + this._inlineClass)).children().removeClass("ui-state-disabled"), i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = e.map(this._disabledInputs, function (e) { return e === t ? null : e })) }, _disableDatepicker: function (t) { var a, i, s = e(t), r = e.data(t, "datepicker"); s.hasClass(this.markerClassName) && ("input" === (a = t.nodeName.toLowerCase()) ? (t.disabled = !0, r.trigger.filter("button").each(function () { this.disabled = !0 }).end().filter("img").css({ opacity: "0.5", cursor: "default" })) : "div" !== a && "span" !== a || ((i = s.children("." + this._inlineClass)).children().addClass("ui-state-disabled"), i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = e.map(this._disabledInputs, function (e) { return e === t ? null : e }), this._disabledInputs[this._disabledInputs.length] = t) }, _isDisabledDatepicker: function (e) { if (!e) return !1; for (var t = 0; t < this._disabledInputs.length; t++) if (this._disabledInputs[t] === e) return !0; return !1 }, _getInst: function (t) { try { return e.data(t, "datepicker") } catch (e) { throw "Missing instance data for this datepicker" } }, _optionDatepicker: function (t, a, i) { var s, n, d, c, o = this._getInst(t); if (2 === arguments.length && "string" == typeof a) return "defaults" === a ? e.extend({}, e.datepicker._defaults) : o ? "all" === a ? e.extend({}, o.settings) : this._get(o, a) : null; s = a || {}, "string" == typeof a && ((s = {})[a] = i), o && (this._curInst === o && this._hideDatepicker(), n = this._getDateDatepicker(t, !0), d = this._getMinMaxDate(o, "min"), c = this._getMinMaxDate(o, "max"), r(o.settings, s), null !== d && void 0 !== s.dateFormat && void 0 === s.minDate && (o.settings.minDate = this._formatDate(o, d)), null !== c && void 0 !== s.dateFormat && void 0 === s.maxDate && (o.settings.maxDate = this._formatDate(o, c)), "disabled" in s && (s.disabled ? this._disableDatepicker(t) : this._enableDatepicker(t)), this._attachments(e(t), o), this._autoSize(o), this._setDate(o, n), this._updateAlternate(o), this._updateDatepicker(o)) }, _changeDatepicker: function (e, t, a) { this._optionDatepicker(e, t, a) }, _refreshDatepicker: function (e) { var t = this._getInst(e); t && this._updateDatepicker(t) }, _setDateDatepicker: function (e, t) { var a = this._getInst(e); a && (this._setDate(a, t), this._updateDatepicker(a), this._updateAlternate(a)) }, _getDateDatepicker: function (e, t) { var a = this._getInst(e); return a && !a.inline && this._setDateFromField(a, t), a ? this._getDate(a) : null }, _doKeyDown: function (t) { var a, i, s, r = e.datepicker._getInst(t.target), n = !0, d = r.dpDiv.is(".ui-datepicker-rtl"); if (r._keyEvent = !0, e.datepicker._datepickerShowing) switch (t.keyCode) { case 9: e.datepicker._hideDatepicker(), n = !1; break; case 13: return (s = e("td." + e.datepicker._dayOverClass + ":not(." + e.datepicker._currentClass + ")", r.dpDiv))[0] && e.datepicker._selectDay(t.target, r.selectedMonth, r.selectedYear, s[0]), (a = e.datepicker._get(r, "onSelect")) ? (i = e.datepicker._formatDate(r), a.apply(r.input ? r.input[0] : null, [i, r])) : e.datepicker._hideDatepicker(), !1; case 27: e.datepicker._hideDatepicker(); break; case 33: e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(r, "stepBigMonths") : -e.datepicker._get(r, "stepMonths"), "M"); break; case 34: e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(r, "stepBigMonths") : +e.datepicker._get(r, "stepMonths"), "M"); break; case 35: (t.ctrlKey || t.metaKey) && e.datepicker._clearDate(t.target), n = t.ctrlKey || t.metaKey; break; case 36: (t.ctrlKey || t.metaKey) && e.datepicker._gotoToday(t.target), n = t.ctrlKey || t.metaKey; break; case 37: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, d ? 1 : -1, "D"), n = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(r, "stepBigMonths") : -e.datepicker._get(r, "stepMonths"), "M"); break; case 38: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, -7, "D"), n = t.ctrlKey || t.metaKey; break; case 39: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, d ? -1 : 1, "D"), n = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(r, "stepBigMonths") : +e.datepicker._get(r, "stepMonths"), "M"); break; case 40: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, 7, "D"), n = t.ctrlKey || t.metaKey; break; default: n = !1 } else 36 === t.keyCode && t.ctrlKey ? e.datepicker._showDatepicker(this) : n = !1; n && (t.preventDefault(), t.stopPropagation()) }, _doKeyPress: function (t) { var a, i, s = e.datepicker._getInst(t.target); if (e.datepicker._get(s, "constrainInput")) return a = e.datepicker._possibleChars(e.datepicker._get(s, "dateFormat")), i = String.fromCharCode(null == t.charCode ? t.keyCode : t.charCode), t.ctrlKey || t.metaKey || i < " " || !a || a.indexOf(i) > -1 }, _doKeyUp: function (t) { var a = e.datepicker._getInst(t.target); if (a.input.val() !== a.lastVal) try { e.datepicker.parseDate(e.datepicker._get(a, "dateFormat"), a.input ? a.input.val() : null, e.datepicker._getFormatConfig(a)) && (e.datepicker._setDateFromField(a), e.datepicker._updateAlternate(a), e.datepicker._updateDatepicker(a)) } catch (e) { } return !0 }, _showDatepicker: function (t) { var a, i, s, n, d, c, o; ("input" !== (t = t.target || t).nodeName.toLowerCase() && (t = e("input", t.parentNode)[0]), e.datepicker._isDisabledDatepicker(t) || e.datepicker._lastInput === t) || (a = e.datepicker._getInst(t), e.datepicker._curInst && e.datepicker._curInst !== a && (e.datepicker._curInst.dpDiv.stop(!0, !0), a && e.datepicker._datepickerShowing && e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])), !1 !== (s = (i = e.datepicker._get(a, "beforeShow")) ? i.apply(t, [t, a]) : {}) && (r(a.settings, s), a.lastVal = null, e.datepicker._lastInput = t, e.datepicker._setDateFromField(a), e.datepicker._inDialog && (t.value = ""), e.datepicker._pos || (e.datepicker._pos = e.datepicker._findPos(t), e.datepicker._pos[1] += t.offsetHeight), n = !1, e(t).parents().each(function () { return !(n |= "fixed" === e(this).css("position")) }), d = { left: e.datepicker._pos[0], top: e.datepicker._pos[1] }, e.datepicker._pos = null, a.dpDiv.empty(), a.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }), e.datepicker._updateDatepicker(a), d = e.datepicker._checkOffset(a, d, n), a.dpDiv.css({ position: e.datepicker._inDialog && e.blockUI ? "static" : n ? "fixed" : "absolute", display: "none", left: d.left + "px", top: d.top + "px" }), a.inline || (c = e.datepicker._get(a, "showAnim"), o = e.datepicker._get(a, "duration"), a.dpDiv.css("z-index", function (e) { for (var t, a; e.length && e[0] !== document;) { if (("absolute" === (t = e.css("position")) || "relative" === t || "fixed" === t) && (a = parseInt(e.css("zIndex"), 10), !isNaN(a) && 0 !== a)) return a; e = e.parent() } return 0 }(e(t)) + 10), e.datepicker._datepickerShowing = !0, e.effects && e.effects.effect[c] ? a.dpDiv.show(c, e.datepicker._get(a, "showOptions"), o) : a.dpDiv[c || "show"](c ? o : null), e.datepicker._shouldFocusInput(a) && a.input.trigger("focus"), e.datepicker._curInst = a))) }, _updateDatepicker: function (a) { this.maxRows = 4, t = a, a.dpDiv.empty().append(this._generateHTML(a)), this._attachHandlers(a); var i, r = this._getNumberOfMonths(a), n = r[1], d = a.dpDiv.find("." + this._dayOverClass + " a"); d.length > 0 && s.apply(d.get(0)), a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), n > 1 && a.dpDiv.addClass("ui-datepicker-multi-" + n).css("width", 17 * n + "em"), a.dpDiv[(1 !== r[0] || 1 !== r[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), a.dpDiv[(this._get(a, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), a === e.datepicker._curInst && e.datepicker._datepickerShowing && e.datepicker._shouldFocusInput(a) && a.input.trigger("focus"), a.yearshtml && (i = a.yearshtml, setTimeout(function () { i === a.yearshtml && a.yearshtml && a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml), i = a.yearshtml = null }, 0)) }, _shouldFocusInput: function (e) { return e.input && e.input.is(":visible") && !e.input.is(":disabled") && !e.input.is(":focus") }, _checkOffset: function (t, a, i) { var s = t.dpDiv.outerWidth(), r = t.dpDiv.outerHeight(), n = t.input ? t.input.outerWidth() : 0, d = t.input ? t.input.outerHeight() : 0, c = document.documentElement.clientWidth + (i ? 0 : e(document).scrollLeft()), o = document.documentElement.clientHeight + (i ? 0 : e(document).scrollTop()); return a.left -= this._get(t, "isRTL") ? s - n : 0, a.left -= i && a.left === t.input.offset().left ? e(document).scrollLeft() : 0, a.top -= i && a.top === t.input.offset().top + d ? e(document).scrollTop() : 0, a.left -= Math.min(a.left, a.left + s > c && c > s ? Math.abs(a.left + s - c) : 0), a.top -= Math.min(a.top, a.top + r > o && o > r ? Math.abs(r + d) : 0), a }, _findPos: function (t) { for (var a, i = this._getInst(t), s = this._get(i, "isRTL") ; t && ("hidden" === t.type || 1 !== t.nodeType || e.expr.filters.hidden(t)) ;) t = t[s ? "previousSibling" : "nextSibling"]; return [(a = e(t).offset()).left, a.top] }, _hideDatepicker: function (t) { var a, i, s, r, n = this._curInst; !n || t && n !== e.data(t, "datepicker") || this._datepickerShowing && (a = this._get(n, "showAnim"), i = this._get(n, "duration"), s = function () { e.datepicker._tidyDialog(n) }, e.effects && (e.effects.effect[a] || e.effects[a]) ? n.dpDiv.hide(a, e.datepicker._get(n, "showOptions"), i, s) : n.dpDiv["slideDown" === a ? "slideUp" : "fadeIn" === a ? "fadeOut" : "hide"](a ? i : null, s), a || s(), this._datepickerShowing = !1, (r = this._get(n, "onClose")) && r.apply(n.input ? n.input[0] : null, [n.input ? n.input.val() : "", n]), this._lastInput = null, this._inDialog && (this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }), e.blockUI && (e.unblockUI(), e("body").append(this.dpDiv))), this._inDialog = !1) }, _tidyDialog: function (e) { e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar") }, _checkExternalClick: function (t) { if (e.datepicker._curInst) { var a = e(t.target), i = e.datepicker._getInst(a[0]); (a[0].id === e.datepicker._mainDivId || 0 !== a.parents("#" + e.datepicker._mainDivId).length || a.hasClass(e.datepicker.markerClassName) || a.closest("." + e.datepicker._triggerClass).length || !e.datepicker._datepickerShowing || e.datepicker._inDialog && e.blockUI) && (!a.hasClass(e.datepicker.markerClassName) || e.datepicker._curInst === i) || e.datepicker._hideDatepicker() } }, _adjustDate: function (t, a, i) { var s = e(t), r = this._getInst(s[0]); this._isDisabledDatepicker(s[0]) || (this._adjustInstDate(r, a + ("M" === i ? this._get(r, "showCurrentAtPos") : 0), i), this._updateDatepicker(r)) }, _gotoToday: function (t) { var a, i = e(t), s = this._getInst(i[0]); this._get(s, "gotoCurrent") && s.currentDay ? (s.selectedDay = s.currentDay, s.drawMonth = s.selectedMonth = s.currentMonth, s.drawYear = s.selectedYear = s.currentYear) : (a = new Date, s.selectedDay = a.getDate(), s.drawMonth = s.selectedMonth = a.getMonth(), s.drawYear = s.selectedYear = a.getFullYear()), this._notifyChange(s), this._adjustDate(i) }, _selectMonthYear: function (t, a, i) { var s = e(t), r = this._getInst(s[0]); r["selected" + ("M" === i ? "Month" : "Year")] = r["draw" + ("M" === i ? "Month" : "Year")] = parseInt(a.options[a.selectedIndex].value, 10), this._notifyChange(r), this._adjustDate(s) }, _selectDay: function (t, a, i, s) { var r, n = e(t); e(s).hasClass(this._unselectableClass) || this._isDisabledDatepicker(n[0]) || ((r = this._getInst(n[0])).selectedDay = r.currentDay = e("a", s).html(), r.selectedMonth = r.currentMonth = a, r.selectedYear = r.currentYear = i, this._selectDate(t, this._formatDate(r, r.currentDay, r.currentMonth, r.currentYear))) }, _clearDate: function (t) { var a = e(t); this._selectDate(a, "") }, _selectDate: function (t, a) { var i, s = e(t), r = this._getInst(s[0]); a = null != a ? a : this._formatDate(r), r.input && r.input.val(a), this._updateAlternate(r), (i = this._get(r, "onSelect")) ? i.apply(r.input ? r.input[0] : null, [a, r]) : r.input && r.input.trigger("change"), r.inline ? this._updateDatepicker(r) : (this._hideDatepicker(), this._lastInput = r.input[0], "object" != typeof r.input[0] && r.input.trigger("focus"), this._lastInput = null) }, _updateAlternate: function (t) { var a, i, s, r = this._get(t, "altField"); r && (a = this._get(t, "altFormat") || this._get(t, "dateFormat"), i = this._getDate(t), s = this.formatDate(a, i, this._getFormatConfig(t)), e(r).val(s)) }, noWeekends: function (e) { var t = e.getDay(); return [t > 0 && t < 6, ""] }, iso8601Week: function (e) { var t, a = new Date(e.getTime()); return a.setDate(a.getDate() + 4 - (a.getDay() || 7)), t = a.getTime(), a.setMonth(0), a.setDate(1), Math.floor(Math.round((t - a) / 864e5) / 7) + 1 }, parseDate: function (t, a, i) { if (null == t || null == a) throw "Invalid arguments"; if ("" === (a = "object" == typeof a ? a.toString() : a + "")) return null; var s, r, n, d, c = 0, o = (i ? i.shortYearCutoff : null) || this._defaults.shortYearCutoff, l = "string" != typeof o ? o : (new Date).getFullYear() % 100 + parseInt(o, 10), h = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort, u = (i ? i.dayNames : null) || this._defaults.dayNames, p = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort, g = (i ? i.monthNames : null) || this._defaults.monthNames, _ = -1, f = -1, k = -1, D = -1, m = !1, y = function (e) { var a = s + 1 < t.length && t.charAt(s + 1) === e; return a && s++, a }, v = function (e) { var t = y(e), i = "@" === e ? 14 : "!" === e ? 20 : "y" === e && t ? 4 : "o" === e ? 3 : 2, s = new RegExp("^\\d{" + ("y" === e ? i : 1) + "," + i + "}"), r = a.substring(c).match(s); if (!r) throw "Missing number at position " + c; return c += r[0].length, parseInt(r[0], 10) }, M = function (t, i, s) { var r = -1, n = e.map(y(t) ? s : i, function (e, t) { return [[t, e]] }).sort(function (e, t) { return -(e[1].length - t[1].length) }); if (e.each(n, function (e, t) { var i = t[1]; if (a.substr(c, i.length).toLowerCase() === i.toLowerCase()) return r = t[0], c += i.length, !1 }), -1 !== r) return r + 1; throw "Unknown name at position " + c }, w = function () { if (a.charAt(c) !== t.charAt(s)) throw "Unexpected literal at position " + c; c++ }; for (s = 0; s < t.length; s++) if (m) "'" !== t.charAt(s) || y("'") ? w() : m = !1; else switch (t.charAt(s)) { case "d": k = v("d"); break; case "D": M("D", h, u); break; case "o": D = v("o"); break; case "m": f = v("m"); break; case "M": f = M("M", p, g); break; case "y": _ = v("y"); break; case "@": _ = (d = new Date(v("@"))).getFullYear(), f = d.getMonth() + 1, k = d.getDate(); break; case "!": _ = (d = new Date((v("!") - this._ticksTo1970) / 1e4)).getFullYear(), f = d.getMonth() + 1, k = d.getDate(); break; case "'": y("'") ? w() : m = !0; break; default: w() } if (c < a.length && (n = a.substr(c), !/^\s+/.test(n))) throw "Extra/unparsed characters found in date: " + n; if (-1 === _ ? _ = (new Date).getFullYear() : _ < 100 && (_ += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (_ <= l ? 0 : -100)), D > -1) for (f = 1, k = D; ;) { if (k <= (r = this._getDaysInMonth(_, f - 1))) break; f++, k -= r } if ((d = this._daylightSavingAdjust(new Date(_, f - 1, k))).getFullYear() !== _ || d.getMonth() + 1 !== f || d.getDate() !== k) throw "Invalid date"; return d }, 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, a) { if (!t) return ""; var i, s = (a ? a.dayNamesShort : null) || this._defaults.dayNamesShort, r = (a ? a.dayNames : null) || this._defaults.dayNames, n = (a ? a.monthNamesShort : null) || this._defaults.monthNamesShort, d = (a ? a.monthNames : null) || this._defaults.monthNames, c = function (t) { var a = i + 1 < e.length && e.charAt(i + 1) === t; return a && i++, a }, o = function (e, t, a) { var i = "" + t; if (c(e)) for (; i.length < a;) i = "0" + i; return i }, l = function (e, t, a, i) { return c(e) ? i[t] : a[t] }, h = "", u = !1; if (t) for (i = 0; i < e.length; i++) if (u) "'" !== e.charAt(i) || c("'") ? h += e.charAt(i) : u = !1; else switch (e.charAt(i)) { case "d": h += o("d", t.getDate(), 2); break; case "D": h += l("D", t.getDay(), s, r); break; case "o": h += o("o", Math.round((new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - new Date(t.getFullYear(), 0, 0).getTime()) / 864e5), 3); break; case "m": h += o("m", t.getMonth() + 1, 2); break; case "M": h += l("M", t.getMonth(), n, d); break; case "y": h += c("y") ? t.getFullYear() : (t.getFullYear() % 100 < 10 ? "0" : "") + t.getFullYear() % 100; break; case "@": h += t.getTime(); break; case "!": h += 1e4 * t.getTime() + this._ticksTo1970; break; case "'": c("'") ? h += "'" : u = !0; break; default: h += e.charAt(i) } return h }, _possibleChars: function (e) { var t, a = "", i = !1, s = function (a) { var i = t + 1 < e.length && e.charAt(t + 1) === a; return i && t++, i }; for (t = 0; t < e.length; t++) if (i) "'" !== e.charAt(t) || s("'") ? a += e.charAt(t) : i = !1; else switch (e.charAt(t)) { case "d": case "m": case "y": case "@": a += "0123456789"; break; case "D": case "M": return null; case "'": s("'") ? a += "'" : i = !0; break; default: a += e.charAt(t) } return a }, _get: function (e, t) { return void 0 !== e.settings[t] ? e.settings[t] : this._defaults[t] }, _setDateFromField: function (e, t) { if (e.input.val() !== e.lastVal) { var a = this._get(e, "dateFormat"), i = e.lastVal = e.input ? e.input.val() : null, s = this._getDefaultDate(e), r = s, n = this._getFormatConfig(e); try { r = this.parseDate(a, i, n) || s } catch (e) { i = t ? "" : i } e.selectedDay = r.getDate(), e.drawMonth = e.selectedMonth = r.getMonth(), e.drawYear = e.selectedYear = r.getFullYear(), e.currentDay = i ? r.getDate() : 0, e.currentMonth = i ? r.getMonth() : 0, e.currentYear = i ? r.getFullYear() : 0, this._adjustInstDate(e) } }, _getDefaultDate: function (e) { return this._restrictMinMax(e, this._determineDate(e, this._get(e, "defaultDate"), new Date)) }, _determineDate: function (t, a, i) { var s, r, n = null == a || "" === a ? i : "string" == typeof a ? function (a) { try { return e.datepicker.parseDate(e.datepicker._get(t, "dateFormat"), a, e.datepicker._getFormatConfig(t)) } catch (e) { } for (var i = (a.toLowerCase().match(/^c/) ? e.datepicker._getDate(t) : null) || new Date, s = i.getFullYear(), r = i.getMonth(), n = i.getDate(), d = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, c = d.exec(a) ; c;) { switch (c[2] || "d") { case "d": case "D": n += parseInt(c[1], 10); break; case "w": case "W": n += 7 * parseInt(c[1], 10); break; case "m": case "M": r += parseInt(c[1], 10), n = Math.min(n, e.datepicker._getDaysInMonth(s, r)); break; case "y": case "Y": s += parseInt(c[1], 10), n = Math.min(n, e.datepicker._getDaysInMonth(s, r)) } c = d.exec(a) } return new Date(s, r, n) }(a) : "number" == typeof a ? isNaN(a) ? i : (s = a, (r = new Date).setDate(r.getDate() + s), r) : new Date(a.getTime()); return (n = n && "Invalid Date" === n.toString() ? i : n) && (n.setHours(0), n.setMinutes(0), n.setSeconds(0), n.setMilliseconds(0)), this._daylightSavingAdjust(n) }, _daylightSavingAdjust: function (e) { return e ? (e.setHours(e.getHours() > 12 ? e.getHours() + 2 : 0), e) : null }, _setDate: function (e, t, a) { var i = !t, s = e.selectedMonth, r = e.selectedYear, n = this._restrictMinMax(e, this._determineDate(e, t, new Date)); e.selectedDay = e.currentDay = n.getDate(), e.drawMonth = e.selectedMonth = e.currentMonth = n.getMonth(), e.drawYear = e.selectedYear = e.currentYear = n.getFullYear(), s === e.selectedMonth && r === e.selectedYear || a || this._notifyChange(e), this._adjustInstDate(e), e.input && e.input.val(i ? "" : this._formatDate(e)) }, _getDate: function (e) { return !e.currentYear || e.input && "" === e.input.val() ? null : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay)) }, _attachHandlers: function (t) { var a = this._get(t, "stepMonths"), i = "#" + t.id.replace(/\\\\/g, "\\"); t.dpDiv.find("[data-handler]").map(function () { var t = { prev: function () { e.datepicker._adjustDate(i, -a, "M") }, next: function () { e.datepicker._adjustDate(i, +a, "M") }, hide: function () { e.datepicker._hideDatepicker() }, today: function () { e.datepicker._gotoToday(i) }, selectDay: function () { return e.datepicker._selectDay(i, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1 }, selectMonth: function () { return e.datepicker._selectMonthYear(i, this, "M"), !1 }, selectYear: function () { return e.datepicker._selectMonthYear(i, this, "Y"), !1 } }; e(this).on(this.getAttribute("data-event"), t[this.getAttribute("data-handler")]) }) }, _generateHTML: function (e) { var t, a, i, s, r, n, d, c, o, l, h, u, p, g, _, f, k, D, m, y, v, M, w, b, C, I, x, Y, S, N, F, T, A, K, j, O, E, R, P, L = new Date, W = this._daylightSavingAdjust(new Date(L.getFullYear(), L.getMonth(), L.getDate())), H = this._get(e, "isRTL"), U = this._get(e, "showButtonPanel"), z = this._get(e, "hideIfNoPrevNext"), B = this._get(e, "navigationAsDateFormat"), J = this._getNumberOfMonths(e), V = this._get(e, "showCurrentAtPos"), G = this._get(e, "stepMonths"), q = 1 !== J[0] || 1 !== J[1], Q = this._daylightSavingAdjust(e.currentDay ? new Date(e.currentYear, e.currentMonth, e.currentDay) : new Date(9999, 9, 9)), X = this._getMinMaxDate(e, "min"), Z = this._getMinMaxDate(e, "max"), $ = e.drawMonth - V, ee = e.drawYear; if ($ < 0 && ($ += 12, ee--), Z) for (t = this._daylightSavingAdjust(new Date(Z.getFullYear(), Z.getMonth() - J[0] * J[1] + 1, Z.getDate())), t = X && t < X ? X : t; this._daylightSavingAdjust(new Date(ee, $, 1)) > t;)--$ < 0 && ($ = 11, ee--); for (e.drawMonth = $, e.drawYear = ee, a = this._get(e, "prevText"), a = B ? this.formatDate(a, this._daylightSavingAdjust(new Date(ee, $ - G, 1)), this._getFormatConfig(e)) : a, i = this._canAdjustMonth(e, -1, ee, $) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + a + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "e" : "w") + "'>" + a + "</span></a>" : z ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + a + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "e" : "w") + "'>" + a + "</span></a>", s = this._get(e, "nextText"), s = B ? this.formatDate(s, this._daylightSavingAdjust(new Date(ee, $ + G, 1)), this._getFormatConfig(e)) : s, r = this._canAdjustMonth(e, 1, ee, $) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + s + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "w" : "e") + "'>" + s + "</span></a>" : z ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + s + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "w" : "e") + "'>" + s + "</span></a>", n = this._get(e, "currentText"), d = this._get(e, "gotoCurrent") && e.currentDay ? Q : W, n = B ? this.formatDate(n, d, this._getFormatConfig(e)) : n, c = e.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(e, "closeText") + "</button>", o = U ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (H ? c : "") + (this._isInRange(e, d) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + n + "</button>" : "") + (H ? "" : c) + "</div>" : "", l = parseInt(this._get(e, "firstDay"), 10), l = isNaN(l) ? 0 : l, h = this._get(e, "showWeek"), u = this._get(e, "dayNames"), p = this._get(e, "dayNamesMin"), g = this._get(e, "monthNames"), _ = this._get(e, "monthNamesShort"), f = this._get(e, "beforeShowDay"), k = this._get(e, "showOtherMonths"), D = this._get(e, "selectOtherMonths"), m = this._getDefaultDate(e), y = "", M = 0; M < J[0]; M++) { for (w = "", this.maxRows = 4, b = 0; b < J[1]; b++) { if (C = this._daylightSavingAdjust(new Date(ee, $, e.selectedDay)), I = " ui-corner-all", x = "", q) { if (x += "<div class='ui-datepicker-group", J[1] > 1) switch (b) { case 0: x += " ui-datepicker-group-first", I = " ui-corner-" + (H ? "right" : "left"); break; case J[1] - 1: x += " ui-datepicker-group-last", I = " ui-corner-" + (H ? "left" : "right"); break; default: x += " ui-datepicker-group-middle", I = "" } x += "'>" } for (x += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + I + "'>" + (/all|left/.test(I) && 0 === M ? H ? r : i : "") + (/all|right/.test(I) && 0 === M ? H ? i : r : "") + this._generateMonthYearHeader(e, $, ee, X, Z, M > 0 || b > 0, g, _) + "</div><table class='ui-datepicker-calendar'><thead><tr>", Y = h ? "<th class='ui-datepicker-week-col'>" + this._get(e, "weekHeader") + "</th>" : "", v = 0; v < 7; v++) Y += "<th scope='col'" + ((v + l + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + "><span title='" + u[S = (v + l) % 7] + "'>" + p[S] + "</span></th>"; for (x += Y + "</tr></thead><tbody>", N = this._getDaysInMonth(ee, $), ee === e.selectedYear && $ === e.selectedMonth && (e.selectedDay = Math.min(e.selectedDay, N)), F = (this._getFirstDayOfMonth(ee, $) - l + 7) % 7, T = Math.ceil((F + N) / 7), A = q && this.maxRows > T ? this.maxRows : T, this.maxRows = A, K = this._daylightSavingAdjust(new Date(ee, $, 1 - F)), j = 0; j < A; j++) { for (x += "<tr>", O = h ? "<td class='ui-datepicker-week-col'>" + this._get(e, "calculateWeek")(K) + "</td>" : "", v = 0; v < 7; v++) E = f ? f.apply(e.input ? e.input[0] : null, [K]) : [!0, ""], P = (R = K.getMonth() !== $) && !D || !E[0] || X && K < X || Z && K > Z, O += "<td class='" + ((v + l + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (R ? " ui-datepicker-other-month" : "") + (K.getTime() === C.getTime() && $ === e.selectedMonth && e._keyEvent || m.getTime() === K.getTime() && m.getTime() === C.getTime() ? " " + this._dayOverClass : "") + (P ? " " + this._unselectableClass + " ui-state-disabled" : "") + (R && !k ? "" : " " + E[1] + (K.getTime() === Q.getTime() ? " " + this._currentClass : "") + (K.getTime() === W.getTime() ? " ui-datepicker-today" : "")) + "'" + (R && !k || !E[2] ? "" : " title='" + E[2].replace(/'/g, "&#39;") + "'") + (P ? "" : " data-handler='selectDay' data-event='click' data-month='" + K.getMonth() + "' data-year='" + K.getFullYear() + "'") + ">" + (R && !k ? "&#xa0;" : P ? "<span class='ui-state-default'>" + K.getDate() + "</span>" : "<a class='ui-state-default" + (K.getTime() === W.getTime() ? " ui-state-highlight" : "") + (K.getTime() === Q.getTime() ? " ui-state-active" : "") + (R ? " ui-priority-secondary" : "") + "' href='#'>" + K.getDate() + "</a>") + "</td>", K.setDate(K.getDate() + 1), K = this._daylightSavingAdjust(K); x += O + "</tr>" } ++$ > 11 && ($ = 0, ee++), w += x += "</tbody></table>" + (q ? "</div>" + (J[0] > 0 && b === J[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : "") } y += w } return y += o, e._keyEvent = !1, y }, _generateMonthYearHeader: function (e, t, a, i, s, r, n, d) { var c, o, l, h, u, p, g, _, f = this._get(e, "changeMonth"), k = this._get(e, "changeYear"), D = this._get(e, "showMonthAfterYear"), m = "<div class='ui-datepicker-title'>", y = ""; if (r || !f) y += "<span class='ui-datepicker-month'>" + n[t] + "</span>"; else { for (c = i && i.getFullYear() === a, o = s && s.getFullYear() === a, y += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", l = 0; l < 12; l++) (!c || l >= i.getMonth()) && (!o || l <= s.getMonth()) && (y += "<option value='" + l + "'" + (l === t ? " selected='selected'" : "") + ">" + d[l] + "</option>"); y += "</select>" } if (D || (m += y + (!r && f && k ? "" : "&#xa0;")), !e.yearshtml) if (e.yearshtml = "", r || !k) m += "<span class='ui-datepicker-year'>" + a + "</span>"; else { for (h = this._get(e, "yearRange").split(":"), u = (new Date).getFullYear(), g = (p = function (e) { var t = e.match(/c[+\-].*/) ? a + parseInt(e.substring(1), 10) : e.match(/[+\-].*/) ? u + parseInt(e, 10) : parseInt(e, 10); return isNaN(t) ? u : t })(h[0]), _ = Math.max(g, p(h[1] || "")), g = i ? Math.max(g, i.getFullYear()) : g, _ = s ? Math.min(_, s.getFullYear()) : _, e.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; g <= _; g++) e.yearshtml += "<option value='" + g + "'" + (g === a ? " selected='selected'" : "") + ">" + g + "</option>"; e.yearshtml += "</select>", m += e.yearshtml, e.yearshtml = null } return m += this._get(e, "yearSuffix"), D && (m += (!r && f && k ? "" : "&#xa0;") + y), m += "</div>" }, _adjustInstDate: function (e, t, a) { var i = e.selectedYear + ("Y" === a ? t : 0), s = e.selectedMonth + ("M" === a ? t : 0), r = Math.min(e.selectedDay, this._getDaysInMonth(i, s)) + ("D" === a ? t : 0), n = this._restrictMinMax(e, this._daylightSavingAdjust(new Date(i, s, r))); e.selectedDay = n.getDate(), e.drawMonth = e.selectedMonth = n.getMonth(), e.drawYear = e.selectedYear = n.getFullYear(), "M" !== a && "Y" !== a || this._notifyChange(e) }, _restrictMinMax: function (e, t) { var a = this._getMinMaxDate(e, "min"), i = this._getMinMaxDate(e, "max"), s = a && t < a ? a : t; return i && s > i ? i : s }, _notifyChange: function (e) { var t = this._get(e, "onChangeMonthYear"); t && t.apply(e.input ? e.input[0] : null, [e.selectedYear, e.selectedMonth + 1, e]) }, _getNumberOfMonths: function (e) { var t = this._get(e, "numberOfMonths"); return null == t ? [1, 1] : "number" == typeof t ? [1, t] : t }, _getMinMaxDate: function (e, t) { return this._determineDate(e, this._get(e, t + "Date"), null) }, _getDaysInMonth: function (e, t) { return 32 - this._daylightSavingAdjust(new Date(e, t, 32)).getDate() }, _getFirstDayOfMonth: function (e, t) { return new Date(e, t, 1).getDay() }, _canAdjustMonth: function (e, t, a, i) { var s = this._getNumberOfMonths(e), r = this._daylightSavingAdjust(new Date(a, i + (t < 0 ? t : s[0] * s[1]), 1)); return t < 0 && r.setDate(this._getDaysInMonth(r.getFullYear(), r.getMonth())), this._isInRange(e, r) }, _isInRange: function (e, t) { var a, i, s = this._getMinMaxDate(e, "min"), r = this._getMinMaxDate(e, "max"), n = null, d = null, c = this._get(e, "yearRange"); return c && (a = c.split(":"), i = (new Date).getFullYear(), n = parseInt(a[0], 10), d = parseInt(a[1], 10), a[0].match(/[+\-].*/) && (n += i), a[1].match(/[+\-].*/) && (d += i)), (!s || t.getTime() >= s.getTime()) && (!r || t.getTime() <= r.getTime()) && (!n || t.getFullYear() >= n) && (!d || t.getFullYear() <= d) }, _getFormatConfig: function (e) { var t = this._get(e, "shortYearCutoff"); return { shortYearCutoff: t = "string" != typeof t ? t : (new Date).getFullYear() % 100 + parseInt(t, 10), dayNamesShort: this._get(e, "dayNamesShort"), dayNames: this._get(e, "dayNames"), monthNamesShort: this._get(e, "monthNamesShort"), monthNames: this._get(e, "monthNames") } }, _formatDate: function (e, t, a, i) { t || (e.currentDay = e.selectedDay, e.currentMonth = e.selectedMonth, e.currentYear = e.selectedYear); var s = t ? "object" == typeof t ? t : this._daylightSavingAdjust(new Date(i, a, t)) : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay)); return this.formatDate(this._get(e, "dateFormat"), s, this._getFormatConfig(e)) } }), e.fn.datepicker = function (t) { if (!this.length) return this; e.datepicker.initialized || (e(document).on("mousedown", e.datepicker._checkExternalClick), e.datepicker.initialized = !0), 0 === e("#" + e.datepicker._mainDivId).length && e("body").append(e.datepicker.dpDiv); var a = 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] ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(a)) : this.each(function () { "string" == typeof t ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this].concat(a)) : e.datepicker._attachDatepicker(this, t) }) : e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(a)) }, e.datepicker = new a, e.datepicker.initialized = !1, e.datepicker.uuid = (new Date).getTime(), e.datepicker.version = "1.12.1"; e.datepicker });;!function (t, i) { function e(t, i, e) { return [parseInt(t[0], 10) * (a.test(t[0]) ? i / 100 : 1), parseInt(t[1], 10) * (a.test(t[1]) ? e / 100 : 1)] } function o(i, e) { return parseInt(t.css(i, e), 10) || 0 } t.ui = t.ui || {}; var l, n = Math.max, f = Math.abs, s = Math.round, h = /left|center|right/, r = /top|center|bottom/, p = /[\+\-]\d+%?/, c = /^\w+/, a = /%$/, d = t.fn.position; t.position = { scrollbarWidth: function () { if (void 0 !== l) return l; var i, e, o = t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), n = o.children()[0]; return t("body").append(o), i = n.offsetWidth, o.css("overflow", "scroll"), i === (e = n.offsetWidth) && (e = o[0].clientWidth), o.remove(), l = i - e }, getScrollInfo: function (i) { var e = i.isWindow ? "" : i.element.css("overflow-x"), o = i.isWindow ? "" : i.element.css("overflow-y"), l = "scroll" === e || "auto" === e && i.width < i.element[0].scrollWidth, n = "scroll" === o || "auto" === o && i.height < i.element[0].scrollHeight; return { width: l ? t.position.scrollbarWidth() : 0, height: n ? t.position.scrollbarWidth() : 0 } }, getWithinInfo: function (i) { var e = t(i || window), o = t.isWindow(e[0]); return { element: e, isWindow: o, offset: e.offset() || { left: 0, top: 0 }, scrollLeft: e.scrollLeft(), scrollTop: e.scrollTop(), width: o ? e.width() : e.outerWidth(), height: o ? e.height() : e.outerHeight() } } }, t.fn.position = function (i) { if (!i || !i.of) return d.apply(this, arguments); i = t.extend({}, i); var l, a, g, m, u, w, W, v, y = t(i.of), b = t.position.getWithinInfo(i.within), H = t.position.getScrollInfo(b), x = (i.collision || "flip").split(" "), T = {}; return w = 9 === (v = (W = y)[0]).nodeType ? { width: W.width(), height: W.height(), offset: { top: 0, left: 0 } } : t.isWindow(v) ? { width: W.width(), height: W.height(), offset: { top: W.scrollTop(), left: W.scrollLeft() } } : v.preventDefault ? { width: 0, height: 0, offset: { top: v.pageY, left: v.pageX } } : { width: W.outerWidth(), height: W.outerHeight(), offset: W.offset() }, y[0].preventDefault && (i.at = "left top"), a = w.width, g = w.height, m = w.offset, u = t.extend({}, m), t.each(["my", "at"], function () { var t, e, o = (i[this] || "").split(" "); 1 === o.length && (o = h.test(o[0]) ? o.concat(["center"]) : r.test(o[0]) ? ["center"].concat(o) : ["center", "center"]), o[0] = h.test(o[0]) ? o[0] : "center", o[1] = r.test(o[1]) ? o[1] : "center", t = p.exec(o[0]), e = p.exec(o[1]), T[this] = [t ? t[0] : 0, e ? e[0] : 0], i[this] = [c.exec(o[0])[0], c.exec(o[1])[0]] }), 1 === x.length && (x[1] = x[0]), "right" === i.at[0] ? u.left += a : "center" === i.at[0] && (u.left += a / 2), "bottom" === i.at[1] ? u.top += g : "center" === i.at[1] && (u.top += g / 2), l = e(T.at, a, g), u.left += l[0], u.top += l[1], this.each(function () { var h, r, p = t(this), c = p.outerWidth(), d = p.outerHeight(), w = o(this, "marginLeft"), W = o(this, "marginTop"), v = c + w + o(this, "marginRight") + H.width, L = d + W + o(this, "marginBottom") + H.height, I = t.extend({}, u), P = e(T.my, p.outerWidth(), p.outerHeight()); "right" === i.my[0] ? I.left -= c : "center" === i.my[0] && (I.left -= c / 2), "bottom" === i.my[1] ? I.top -= d : "center" === i.my[1] && (I.top -= d / 2), I.left += P[0], I.top += P[1], t.support.offsetFractions || (I.left = s(I.left), I.top = s(I.top)), h = { marginLeft: w, marginTop: W }, t.each(["left", "top"], function (e, o) { t.ui.position[x[e]] && t.ui.position[x[e]][o](I, { targetWidth: a, targetHeight: g, elemWidth: c, elemHeight: d, collisionPosition: h, collisionWidth: v, collisionHeight: L, offset: [l[0] + P[0], l[1] + P[1]], my: i.my, at: i.at, within: b, elem: p }) }), i.using && (r = function (t) { var e = m.left - I.left, o = e + a - c, l = m.top - I.top, s = l + g - d, h = { target: { element: y, left: m.left, top: m.top, width: a, height: g }, element: { element: p, left: I.left, top: I.top, width: c, height: d }, horizontal: o < 0 ? "left" : e > 0 ? "right" : "center", vertical: s < 0 ? "top" : l > 0 ? "bottom" : "middle" }; a < c && f(e + o) < a && (h.horizontal = "center"), g < d && f(l + s) < g && (h.vertical = "middle"), n(f(e), f(o)) > n(f(l), f(s)) ? h.important = "horizontal" : h.important = "vertical", i.using.call(this, t, h) }), p.offset(t.extend(I, { using: r })) }) }, t.ui.position = { fit: { left: function (t, i) { var e, o = i.within, l = o.isWindow ? o.scrollLeft : o.offset.left, f = o.width, s = t.left - i.collisionPosition.marginLeft, h = l - s, r = s + i.collisionWidth - f - l; i.collisionWidth > f ? h > 0 && r <= 0 ? (e = t.left + h + i.collisionWidth - f - l, t.left += h - e) : t.left = r > 0 && h <= 0 ? l : h > r ? l + f - i.collisionWidth : l : h > 0 ? t.left += h : r > 0 ? t.left -= r : t.left = n(t.left - s, t.left) }, top: function (t, i) { var e, o = i.within, l = o.isWindow ? o.scrollTop : o.offset.top, f = i.within.height, s = t.top - i.collisionPosition.marginTop, h = l - s, r = s + i.collisionHeight - f - l; i.collisionHeight > f ? h > 0 && r <= 0 ? (e = t.top + h + i.collisionHeight - f - l, t.top += h - e) : t.top = r > 0 && h <= 0 ? l : h > r ? l + f - i.collisionHeight : l : h > 0 ? t.top += h : r > 0 ? t.top -= r : t.top = n(t.top - s, t.top) } }, flip: { left: function (t, i) { var e, o, l = i.within, n = l.offset.left + l.scrollLeft, s = l.width, h = l.isWindow ? l.scrollLeft : l.offset.left, r = t.left - i.collisionPosition.marginLeft, p = r - h, c = r + i.collisionWidth - s - h, a = "left" === i.my[0] ? -i.elemWidth : "right" === i.my[0] ? i.elemWidth : 0, d = "left" === i.at[0] ? i.targetWidth : "right" === i.at[0] ? -i.targetWidth : 0, g = -2 * i.offset[0]; p < 0 ? ((e = t.left + a + d + g + i.collisionWidth - s - n) < 0 || e < f(p)) && (t.left += a + d + g) : c > 0 && ((o = t.left - i.collisionPosition.marginLeft + a + d + g - h) > 0 || f(o) < c) && (t.left += a + d + g) }, top: function (t, i) { var e, o, l = i.within, n = l.offset.top + l.scrollTop, s = l.height, h = l.isWindow ? l.scrollTop : l.offset.top, r = t.top - i.collisionPosition.marginTop, p = r - h, c = r + i.collisionHeight - s - h, a = "top" === i.my[1] ? -i.elemHeight : "bottom" === i.my[1] ? i.elemHeight : 0, d = "top" === i.at[1] ? i.targetHeight : "bottom" === i.at[1] ? -i.targetHeight : 0, g = -2 * i.offset[1]; p < 0 ? (o = t.top + a + d + g + i.collisionHeight - s - n, t.top + a + d + g > p && (o < 0 || o < f(p)) && (t.top += a + d + g)) : c > 0 && (e = t.top - i.collisionPosition.marginTop + a + d + g - h, t.top + a + d + g > c && (e > 0 || f(e) < c) && (t.top += a + d + g)) } }, flipfit: { left: function () { t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments) }, top: function () { t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments) } } }, function () { var i, e, o, l, n, f = document.getElementsByTagName("body")[0], s = document.createElement("div"); i = document.createElement(f ? "div" : "body"), o = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }, f && t.extend(o, { position: "absolute", left: "-1000px", top: "-1000px" }); for (n in o) i.style[n] = o[n]; i.appendChild(s), (e = f || document.documentElement).insertBefore(i, e.firstChild), s.style.cssText = "position: absolute; left: 10.7432222px;", l = t(s).offset().left, t.support.offsetFractions = l > 10 && l < 11, i.innerHTML = "", e.removeChild(i) }() }(jQuery);;!function ($) { $.extend($.ui, { timepicker: { version: "0.3.3" } }); var PROP_NAME = "timepicker", tpuuid = (new Date).getTime(); function Timepicker() { this.debug = !0, this._curInst = null, this._disabledInputs = [], this._timepickerShowing = !1, this._inDialog = !1, this._dialogClass = "ui-timepicker-dialog", this._mainDivId = "ui-timepicker-div", this._inlineClass = "ui-timepicker-inline", this._currentClass = "ui-timepicker-current", this._dayOverClass = "ui-timepicker-days-cell-over", this.regional = [], this.regional[""] = { hourText: "Hour", minuteText: "Minute", amPmText: ["AM", "PM"], closeButtonText: "Done", nowButtonText: "Now", deselectButtonText: "Deselect" }, this._defaults = { showOn: "focus", button: null, showAnim: "fadeIn", showOptions: {}, appendText: "", beforeShow: null, onSelect: null, onClose: null, timeSeparator: ":", periodSeparator: " ", showPeriod: !1, showPeriodLabels: !0, showLeadingZero: !0, showMinutesLeadingZero: !0, altField: "", defaultTime: "now", myPosition: "left top", atPosition: "left bottom", onHourShow: null, onMinuteShow: null, hours: { starts: 0, ends: 23 }, minutes: { starts: 0, ends: 55, interval: 5, manual: [] }, rows: 4, showHours: !0, showMinutes: !0, optionalMinutes: !1, showCloseButton: !1, showNowButton: !1, showDeselectButton: !1, maxTime: { hour: null, minute: null }, minTime: { hour: null, minute: null } }, $.extend(this._defaults, this.regional[""]), this.tpDiv = $('<div id="' + this._mainDivId + '" class="ui-timepicker ui-widget ui-helper-clearfix ui-corner-all " style="display: none"></div>') } function extendRemove(e, t) { $.extend(e, t); for (var i in t) null != t[i] && void 0 != t[i] || (e[i] = t[i]); return e } $.extend(Timepicker.prototype, { markerClassName: "hasTimepicker", log: function () { this.debug && console.log.apply("", arguments) }, _widgetTimepicker: function () { return this.tpDiv }, setDefaults: function (e) { return extendRemove(this._defaults, e || {}), this }, _attachTimepicker: function (target, settings) { var inlineSettings = null; for (var attrName in this._defaults) { var attrValue = target.getAttribute("time:" + attrName); if (attrValue) { inlineSettings = inlineSettings || {}; try { inlineSettings[attrName] = eval(attrValue) } catch (e) { inlineSettings[attrName] = attrValue } } } var nodeName = target.nodeName.toLowerCase(), inline = "div" == nodeName || "span" == nodeName; target.id || (this.uuid += 1, target.id = "tp" + this.uuid); var inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}, inlineSettings || {}), "input" == nodeName ? (this._connectTimepicker(target, inst), this._setTimeFromField(inst)) : inline && this._inlineTimepicker(target, inst) }, _newInst: function (e, t) { return { id: e[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"), input: e, inline: t, tpDiv: t ? $('<div class="' + this._inlineClass + ' ui-timepicker ui-widget  ui-helper-clearfix"></div>') : this.tpDiv } }, _connectTimepicker: function (e, t) { var i = $(e); t.append = $([]), t.trigger = $([]), i.hasClass(this.markerClassName) || (this._attachments(i, t), i.addClass(this.markerClassName).keydown(this._doKeyDown).keyup(this._doKeyUp).bind("setData.timepicker", function (e, i, s) { t.settings[i] = s }).bind("getData.timepicker", function (e, i) { return this._get(t, i) }), $.data(e, PROP_NAME, t)) }, _doKeyDown: function (e) { var t = $.timepicker._getInst(e.target), i = !0; if (t._keyEvent = !0, $.timepicker._timepickerShowing) switch (e.keyCode) { case 9: $.timepicker._hideTimepicker(), i = !1; break; case 13: return $.timepicker._updateSelectedValue(t), $.timepicker._hideTimepicker(), !1; case 27: $.timepicker._hideTimepicker(); break; default: i = !1 } else 36 == e.keyCode && e.ctrlKey ? $.timepicker._showTimepicker(this) : i = !1; i && (e.preventDefault(), e.stopPropagation()) }, _doKeyUp: function (e) { var t = $.timepicker._getInst(e.target); $.timepicker._setTimeFromField(t), $.timepicker._updateTimepicker(t) }, _attachments: function (e, t) { var i = this._get(t, "appendText"), s = this._get(t, "isRTL"); t.append && t.append.remove(), i && (t.append = $('<span class="' + this._appendClass + '">' + i + "</span>"), e[s ? "before" : "after"](t.append)), e.unbind("focus.timepicker", this._showTimepicker), e.unbind("click.timepicker", this._adjustZIndex), t.trigger && t.trigger.remove(); var n = this._get(t, "showOn"); if ("focus" != n && "both" != n || (e.bind("focus.timepicker", this._showTimepicker), e.bind("click.timepicker", this._adjustZIndex)), "button" == n || "both" == n) { var r = this._get(t, "button"); null == r && (r = $('<button class="ui-timepicker-trigger" type="button">...</button>'), e.after(r)), $(r).bind("click.timepicker", function () { return $.timepicker._timepickerShowing && $.timepicker._lastInput == e[0] ? $.timepicker._hideTimepicker() : t.input.is(":disabled") || $.timepicker._showTimepicker(e[0]), !1 }) } }, _inlineTimepicker: function (e, t) { var i = $(e); i.hasClass(this.markerClassName) || (i.addClass(this.markerClassName).append(t.tpDiv).bind("setData.timepicker", function (e, i, s) { t.settings[i] = s }).bind("getData.timepicker", function (e, i) { return this._get(t, i) }), $.data(e, PROP_NAME, t), this._setTimeFromField(t), this._updateTimepicker(t), t.tpDiv.show()) }, _adjustZIndex: function (e) { e = e.target || e, $.timepicker._getInst(e).tpDiv.css("zIndex", $.timepicker._getZIndex(e) + 1) }, _showTimepicker: function (e) { if ("input" != (e = e.target || e).nodeName.toLowerCase() && (e = $("input", e.parentNode)[0]), !$.timepicker._isDisabledTimepicker(e) && $.timepicker._lastInput != e) { $.timepicker._hideTimepicker(); var t = $.timepicker._getInst(e); $.timepicker._curInst && $.timepicker._curInst != t && $.timepicker._curInst.tpDiv.stop(!0, !0); var i = $.timepicker._get(t, "beforeShow"); extendRemove(t.settings, i ? i.apply(e, [e, t]) : {}), t.lastVal = null, $.timepicker._lastInput = e, $.timepicker._setTimeFromField(t), $.timepicker._inDialog && (e.value = ""), $.timepicker._pos || ($.timepicker._pos = $.timepicker._findPos(e), $.timepicker._pos[1] += e.offsetHeight); var s = !1; $(e).parents().each(function () { return !(s |= "fixed" == $(this).css("position")) }); var n = { left: $.timepicker._pos[0], top: $.timepicker._pos[1] }; if ($.timepicker._pos = null, t.tpDiv.css({ position: "absolute", display: "block", top: "-1000px" }), $.timepicker._updateTimepicker(t), !t.inline && "object" == typeof $.ui.position) { t.tpDiv.position({ of: t.input, my: $.timepicker._get(t, "myPosition"), at: $.timepicker._get(t, "atPosition"), collision: "flip" }); n = t.tpDiv.offset(); $.timepicker._pos = [n.top, n.left] } if (t._hoursClicked = !1, t._minutesClicked = !1, n = $.timepicker._checkOffset(t, n, s), t.tpDiv.css({ position: $.timepicker._inDialog && $.blockUI ? "static" : s ? "fixed" : "absolute", display: "none", left: n.left + "px", top: n.top + "px" }), !t.inline) { var r = $.timepicker._get(t, "showAnim"), a = $.timepicker._get(t, "duration"), u = function () { $.timepicker._timepickerShowing = !0; var e = $.timepicker._getBorders(t.tpDiv); t.tpDiv.find("iframe.ui-timepicker-cover").css({ left: -e[0], top: -e[1], width: t.tpDiv.outerWidth(), height: t.tpDiv.outerHeight() }) }; $.timepicker._adjustZIndex(e), $.effects && $.effects[r] ? t.tpDiv.show(r, $.timepicker._get(t, "showOptions"), a, u) : t.tpDiv.show(r ? a : null, u), r && a || u(), t.input.is(":visible") && !t.input.is(":disabled") && t.input.focus(), $.timepicker._curInst = t } } }, _getZIndex: function (e) { for (var t, i, s = $(e), n = 0; s.length && s[0] !== document;) "absolute" !== (t = s.css("position")) && "relative" !== t && "fixed" !== t || (i = parseInt(s.css("zIndex"), 10), isNaN(i) || 0 === i || i > n && (n = i)), s = s.parent(); return n }, _refreshTimepicker: function (e) { var t = this._getInst(e); t && this._updateTimepicker(t) }, _updateTimepicker: function (e) { e.tpDiv.empty().append(this._generateHTML(e)), this._rebindDialogEvents(e) }, _rebindDialogEvents: function (e) { var t = $.timepicker._getBorders(e.tpDiv), i = this; e.tpDiv.find("iframe.ui-timepicker-cover").css({ left: -t[0], top: -t[1], width: e.tpDiv.outerWidth(), height: e.tpDiv.outerHeight() }).end().find(".ui-timepicker-minute-cell").unbind().bind("click", { fromDoubleClick: !1 }, $.proxy($.timepicker.selectMinutes, this)).bind("dblclick", { fromDoubleClick: !0 }, $.proxy($.timepicker.selectMinutes, this)).end().find(".ui-timepicker-hour-cell").unbind().bind("click", { fromDoubleClick: !1 }, $.proxy($.timepicker.selectHours, this)).bind("dblclick", { fromDoubleClick: !0 }, $.proxy($.timepicker.selectHours, this)).end().find(".ui-timepicker td a").unbind().bind("mouseout", function () { $(this).removeClass("ui-state-hover"), -1 != this.className.indexOf("ui-timepicker-prev") && $(this).removeClass("ui-timepicker-prev-hover"), -1 != this.className.indexOf("ui-timepicker-next") && $(this).removeClass("ui-timepicker-next-hover") }).bind("mouseover", function () { i._isDisabledTimepicker(e.inline ? e.tpDiv.parent()[0] : e.input[0]) || ($(this).parents(".ui-timepicker-calendar").find("a").removeClass("ui-state-hover"), $(this).addClass("ui-state-hover"), -1 != this.className.indexOf("ui-timepicker-prev") && $(this).addClass("ui-timepicker-prev-hover"), -1 != this.className.indexOf("ui-timepicker-next") && $(this).addClass("ui-timepicker-next-hover")) }).end().find("." + this._dayOverClass + " a").trigger("mouseover").end().find(".ui-timepicker-now").bind("click", function (e) { $.timepicker.selectNow(e) }).end().find(".ui-timepicker-deselect").bind("click", function (e) { $.timepicker.deselectTime(e) }).end().find(".ui-timepicker-close").bind("click", function (e) { $.timepicker._hideTimepicker() }).end() }, _generateHTML: function (e) { var t, i, s, n, r = 1 == this._get(e, "showPeriod"), a = 1 == this._get(e, "showPeriodLabels"), u = 1 == this._get(e, "showLeadingZero"), o = 1 == this._get(e, "showHours"), c = 1 == this._get(e, "showMinutes"), p = this._get(e, "amPmText"), l = this._get(e, "rows"), d = 0, h = 0, m = 0, _ = 0, g = 0, k = 0, f = Array(), v = this._get(e, "hours"), $ = null, b = 0, T = this._get(e, "hourText"), w = this._get(e, "showCloseButton"), C = this._get(e, "closeButtonText"), D = this._get(e, "showNowButton"), I = this._get(e, "nowButtonText"), x = this._get(e, "showDeselectButton"), M = this._get(e, "deselectButtonText"), y = w || D || x; for (t = v.starts; t <= v.ends; t++) f.push(t); if ($ = Math.ceil(f.length / l), a) { for (b = 0; b < f.length; b++) f[b] < 12 ? m++ : _++; b = 0, l != (d = Math.floor(m / f.length * l)) + (h = Math.floor(_ / f.length * l)) && (m && (!_ || !d || h && m / d >= _ / h) ? d++ : h++), g = Math.min(d, 1), k = d + 1, $ = 0 == d ? Math.ceil(_ / h) : 0 == h ? Math.ceil(m / d) : Math.ceil(Math.max(m / d, _ / h)) } if (n = '<table class="ui-timepicker-table ui-widget-content ui-corner-all"><tr>', o) { for (n += '<td class="ui-timepicker-hours"><div class="ui-timepicker-title ui-widget-header ui-helper-clearfix ui-corner-all">' + T + '</div><table class="ui-timepicker">', i = 1; i <= l; i++) { for (n += "<tr>", i == g && a && (n += '<th rowspan="' + d.toString() + '" class="periods" scope="row">' + p[0] + "</th>"), i == k && a && (n += '<th rowspan="' + h.toString() + '" class="periods" scope="row">' + p[1] + "</th>"), s = 1; s <= $; s++) a && i < k && f[b] >= 12 ? n += this._generateHTMLHourCell(e, void 0, r, u) : (n += this._generateHTMLHourCell(e, f[b], r, u), b++); n += "</tr>" } n += "</table></td>" } if (c && (n += '<td class="ui-timepicker-minutes">', n += this._generateHTMLMinutes(e), n += "</td>"), n += "</tr>", y) { var N = '<tr><td colspan="3"><div class="ui-timepicker-buttonpane ui-widget-content">'; D && (N += '<button type="button" class="ui-timepicker-now ui-state-default ui-corner-all"  data-timepicker-instance-id="#' + e.id.replace(/\\\\/g, "\\") + '" >' + I + "</button>"), x && (N += '<button type="button" class="ui-timepicker-deselect ui-state-default ui-corner-all"  data-timepicker-instance-id="#' + e.id.replace(/\\\\/g, "\\") + '" >' + M + "</button>"), w && (N += '<button type="button" class="ui-timepicker-close ui-state-default ui-corner-all"  data-timepicker-instance-id="#' + e.id.replace(/\\\\/g, "\\") + '" >' + C + "</button>"), n += N + "</div></td></tr>" } return n += "</table>" }, _updateMinuteDisplay: function (e) { var t = this._generateHTMLMinutes(e); e.tpDiv.find("td.ui-timepicker-minutes").html(t), this._rebindDialogEvents(e) }, _generateHTMLMinutes: function (e) { var t, s, n = "", r = this._get(e, "rows"), a = Array(), u = this._get(e, "minutes"), o = 0, c = 1 == this._get(e, "showMinutesLeadingZero"), p = this._get(e, "onMinuteShow"), l = this._get(e, "minuteText"); for (u.starts || (u.starts = 0), u.ends || (u.ends = 59), u.manual || (u.manual = []), h = u.starts; h <= u.ends; h += u.interval) a.push(h); for (i = 0; i < u.manual.length; i++) { var d = u.manual[i]; "number" != typeof d || d < 0 || d > 59 || $.inArray(d, a) >= 0 || a.push(d) } if (a.sort(function (e, t) { return e - t }), s = Math.round(a.length / r + .49), p && 0 == p.apply(e.input ? e.input[0] : null, [e.hours, e.minutes])) for (o = 0; o < a.length; o += 1) if (h = a[o], p.apply(e.input ? e.input[0] : null, [e.hours, h])) { e.minutes = h; break } for (n += '<div class="ui-timepicker-title ui-widget-header ui-helper-clearfix ui-corner-all">' + l + '</div><table class="ui-timepicker">', o = 0, t = 1; t <= r; t++) { for (n += "<tr>"; o < t * s;) { var h, m = ""; void 0 !== (h = a[o]) && (m = h < 10 && c ? "0" + h.toString() : h.toString()), n += this._generateHTMLMinuteCell(e, h, m), o++ } n += "</tr>" } return n += "</table>" }, _generateHTMLHourCell: function (e, t, i, s) { var n = t; t > 12 && i && (n = t - 12), 0 == n && i && (n = 12), n < 10 && s && (n = "0" + n); var r = !0, a = this._get(e, "onHourShow"), u = this._get(e, "maxTime"), o = this._get(e, "minTime"); return void 0 == t ? '<td><span class="ui-state-default ui-state-disabled">&nbsp;</span></td>' : (a && (r = a.apply(e.input ? e.input[0] : null, [t])), r && (!isNaN(parseInt(u.hour)) && t > u.hour && (r = !1), !isNaN(parseInt(o.hour)) && t < o.hour && (r = !1)), r ? '<td class="ui-timepicker-hour-cell" data-timepicker-instance-id="#' + e.id.replace(/\\\\/g, "\\") + '" data-hour="' + t.toString() + '"><a class="ui-state-default ' + (t == e.hours ? "ui-state-active" : "") + '">' + n.toString() + "</a></td>" : '<td><span class="ui-state-default ui-state-disabled ' + (t == e.hours ? " ui-state-active " : " ") + '">' + n.toString() + "</span></td>") }, _generateHTMLMinuteCell: function (e, t, i) { var s = !0, n = e.hours, r = this._get(e, "onMinuteShow"), a = this._get(e, "maxTime"), u = this._get(e, "minTime"); return r && (s = r.apply(e.input ? e.input[0] : null, [e.hours, t])), void 0 == t ? '<td><span class="ui-state-default ui-state-disabled">&nbsp;</span></td>' : (s && null !== n && (!isNaN(parseInt(a.hour)) && !isNaN(parseInt(a.minute)) && n >= a.hour && t > a.minute && (s = !1), !isNaN(parseInt(u.hour)) && !isNaN(parseInt(u.minute)) && n <= u.hour && t < u.minute && (s = !1)), s ? '<td class="ui-timepicker-minute-cell" data-timepicker-instance-id="#' + e.id.replace(/\\\\/g, "\\") + '" data-minute="' + t.toString() + '" ><a class="ui-state-default ' + (t == e.minutes ? "ui-state-active" : "") + '" >' + i + "</a></td>" : '<td><span class="ui-state-default ui-state-disabled" >' + i + "</span></td>") }, _destroyTimepicker: function (e) { var t = $(e), i = $.data(e, PROP_NAME); if (t.hasClass(this.markerClassName)) { var s = e.nodeName.toLowerCase(); $.removeData(e, PROP_NAME), "input" == s ? (i.append.remove(), i.trigger.remove(), t.removeClass(this.markerClassName).unbind("focus.timepicker", this._showTimepicker).unbind("click.timepicker", this._adjustZIndex)) : "div" != s && "span" != s || t.removeClass(this.markerClassName).empty() } }, _enableTimepicker: function (e) { var t = $(e), i = t.attr("id"), s = $.data(e, PROP_NAME); if (t.hasClass(this.markerClassName)) { var n = e.nodeName.toLowerCase(); if ("input" == n) { e.disabled = !1; var r = this._get(s, "button"); $(r).removeClass("ui-state-disabled").disabled = !1, s.trigger.filter("button").each(function () { this.disabled = !1 }).end() } else if ("div" == n || "span" == n) { var a = t.children("." + this._inlineClass); a.children().removeClass("ui-state-disabled"), a.find("button").each(function () { this.disabled = !1 }) } this._disabledInputs = $.map(this._disabledInputs, function (e) { return e == i ? null : e }) } }, _disableTimepicker: function (e) { var t = $(e), i = $.data(e, PROP_NAME); if (t.hasClass(this.markerClassName)) { var s = e.nodeName.toLowerCase(); if ("input" == s) { var n = this._get(i, "button"); $(n).addClass("ui-state-disabled").disabled = !0, e.disabled = !0, i.trigger.filter("button").each(function () { this.disabled = !0 }).end() } else if ("div" == s || "span" == s) { var r = t.children("." + this._inlineClass); r.children().addClass("ui-state-disabled"), r.find("button").each(function () { this.disabled = !0 }) } this._disabledInputs = $.map(this._disabledInputs, function (t) { return t == e ? null : t }), this._disabledInputs[this._disabledInputs.length] = t.attr("id") } }, _isDisabledTimepicker: function (e) { if (!e) return !1; for (var t = 0; t < this._disabledInputs.length; t++) if (this._disabledInputs[t] == e) return !0; return !1 }, _checkOffset: function (e, t, i) { var s = e.tpDiv.outerWidth(), n = e.tpDiv.outerHeight(), r = e.input ? e.input.outerWidth() : 0, a = e.input ? e.input.outerHeight() : 0, u = document.documentElement.clientWidth + $(document).scrollLeft(), o = document.documentElement.clientHeight + $(document).scrollTop(); return t.left -= this._get(e, "isRTL") ? s - r : 0, t.left -= i && t.left == e.input.offset().left ? $(document).scrollLeft() : 0, t.top -= i && t.top == e.input.offset().top + a ? $(document).scrollTop() : 0, t.left -= Math.min(t.left, t.left + s > u && u > s ? Math.abs(t.left + s - u) : 0), t.top -= Math.min(t.top, t.top + n > o && o > n ? Math.abs(n + a) : 0), t }, _findPos: function (e) { for (var t = this._getInst(e), i = this._get(t, "isRTL") ; e && ("hidden" == e.type || 1 != e.nodeType) ;) e = e[i ? "previousSibling" : "nextSibling"]; var s = $(e).offset(); return [s.left, s.top] }, _getBorders: function (e) { var t = function (e) { return { thin: 1, medium: 2, thick: 3 }[e] || e }; return [parseFloat(t(e.css("border-left-width"))), parseFloat(t(e.css("border-top-width")))] }, _checkExternalClick: function (e) { if ($.timepicker._curInst) { var t = $(e.target); t[0].id == $.timepicker._mainDivId || 0 != t.parents("#" + $.timepicker._mainDivId).length || t.hasClass($.timepicker.markerClassName) || t.hasClass($.timepicker._triggerClass) || !$.timepicker._timepickerShowing || $.timepicker._inDialog && $.blockUI || $.timepicker._hideTimepicker() } }, _hideTimepicker: function (e) { var t = this._curInst; if (t && (!e || t == $.data(e, PROP_NAME)) && this._timepickerShowing) { var i = this._get(t, "showAnim"), s = this._get(t, "duration"), n = function () { $.timepicker._tidyDialog(t), this._curInst = null }; $.effects && $.effects[i] ? t.tpDiv.hide(i, $.timepicker._get(t, "showOptions"), s, n) : t.tpDiv["slideDown" == i ? "slideUp" : "fadeIn" == i ? "fadeOut" : "hide"](i ? s : null, n), i || n(), this._timepickerShowing = !1, this._lastInput = null, this._inDialog && (this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }), $.blockUI && ($.unblockUI(), $("body").append(this.tpDiv))), this._inDialog = !1; var r = this._get(t, "onClose"); r && r.apply(t.input ? t.input[0] : null, [t.input ? t.input.val() : "", t]) } }, _tidyDialog: function (e) { e.tpDiv.removeClass(this._dialogClass).unbind(".ui-timepicker") }, _getInst: function (e) { try { return $.data(e, PROP_NAME) } catch (e) { throw "Missing instance data for this timepicker" } }, _get: function (e, t) { return void 0 !== e.settings[t] ? e.settings[t] : this._defaults[t] }, _setTimeFromField: function (e) { if (e.input.val() != e.lastVal) { var t = this._get(e, "defaultTime"), i = "now" == t ? this._getCurrentTimeRounded(e) : t; if (0 == e.inline && "" != e.input.val() && (i = e.input.val()), i instanceof Date) e.hours = i.getHours(), e.minutes = i.getMinutes(); else { var s = e.lastVal = i; if ("" == i) e.hours = -1, e.minutes = -1; else { var n = this.parseTime(e, s); e.hours = n.hours, e.minutes = n.minutes } } $.timepicker._updateTimepicker(e) } }, _optionTimepicker: function (e, t, i) { var s = this._getInst(e); if (2 == arguments.length && "string" == typeof t) return "defaults" == t ? $.extend({}, $.timepicker._defaults) : s ? "all" == t ? $.extend({}, s.settings) : this._get(s, t) : null; var n = t || {}; "string" == typeof t && ((n = {})[t] = i), s && (extendRemove(s.settings, n), this._curInst == s && (this._hideTimepicker(), this._updateTimepicker(s)), s.inline && this._updateTimepicker(s)) }, _setTimeTimepicker: function (e, t) { var i = this._getInst(e); i && (this._setTime(i, t), this._updateTimepicker(i), this._updateAlternate(i, t)) }, _setTime: function (e, t, i) { var s = e.hours, n = e.minutes; if (t instanceof Date) e.hours = t.getHours(), e.minutes = t.getMinutes(); else { t = this.parseTime(e, t); e.hours = t.hours, e.minutes = t.minutes } s == e.hours && n == e.minutes || i || e.input.trigger("change"), this._updateTimepicker(e), this._updateSelectedValue(e) }, _getCurrentTimeRounded: function (e) { var t = new Date, i = t.getMinutes(), s = this._get(e, "minutes"), n = Math.round(i / s.interval) * s.interval; return t.setMinutes(n), t }, parseTime: function (e, t) { var i = new Object; if (i.hours = -1, i.minutes = -1, !t) return ""; var s = this._get(e, "timeSeparator"), n = this._get(e, "amPmText"), r = this._get(e, "showHours"), a = this._get(e, "showMinutes"), u = this._get(e, "optionalMinutes"), o = 1 == this._get(e, "showPeriod"), c = t.indexOf(s); if (-1 != c ? (i.hours = parseInt(t.substr(0, c), 10), i.minutes = parseInt(t.substr(c + 1), 10)) : !r || a && !u ? !r && a && (i.minutes = parseInt(t, 10)) : i.hours = parseInt(t, 10), r) { var p = t.toUpperCase(); i.hours < 12 && o && -1 != p.indexOf(n[1].toUpperCase()) && (i.hours += 12), 12 == i.hours && o && -1 != p.indexOf(n[0].toUpperCase()) && (i.hours = 0) } return i }, selectNow: function (e) { var t = $(e.target).attr("data-timepicker-instance-id"), i = $(t), s = this._getInst(i[0]), n = new Date; s.hours = n.getHours(), s.minutes = n.getMinutes(), this._updateSelectedValue(s), this._updateTimepicker(s), this._hideTimepicker() }, deselectTime: function (e) { var t = $(e.target).attr("data-timepicker-instance-id"), i = $(t), s = this._getInst(i[0]); s.hours = -1, s.minutes = -1, this._updateSelectedValue(s), this._hideTimepicker() }, selectHours: function (e) { var t = $(e.currentTarget), i = t.attr("data-timepicker-instance-id"), s = parseInt(t.attr("data-hour")), n = e.data.fromDoubleClick, r = $(i), a = this._getInst(r[0]), u = 1 == this._get(a, "showMinutes"); if ($.timepicker._isDisabledTimepicker(r.attr("id"))) return !1; t.parents(".ui-timepicker-hours:first").find("a").removeClass("ui-state-active"), t.children("a").addClass("ui-state-active"), a.hours = s; var o = this._get(a, "onMinuteShow"), c = this._get(a, "maxTime"), p = this._get(a, "minTime"); return (o || c.minute || p.minute) && this._updateMinuteDisplay(a), this._updateSelectedValue(a), a._hoursClicked = !0, (a._minutesClicked || n || 0 == u) && $.timepicker._hideTimepicker(), !1 }, selectMinutes: function (e) { var t = $(e.currentTarget), i = t.attr("data-timepicker-instance-id"), s = parseInt(t.attr("data-minute")), n = e.data.fromDoubleClick, r = $(i), a = this._getInst(r[0]), u = 1 == this._get(a, "showHours"); return !$.timepicker._isDisabledTimepicker(r.attr("id")) && (t.parents(".ui-timepicker-minutes:first").find("a").removeClass("ui-state-active"), t.children("a").addClass("ui-state-active"), a.minutes = s, this._updateSelectedValue(a), a._minutesClicked = !0, !(!a._hoursClicked && !n && 0 != u) && ($.timepicker._hideTimepicker(), !1)) }, _updateSelectedValue: function (e) { var t = this._getParsedTime(e); e.input && (e.input.val(t), e.input.trigger("change")); var i = this._get(e, "onSelect"); return i && i.apply(e.input ? e.input[0] : null, [t, e]), this._updateAlternate(e, t), t }, _getParsedTime: function (e) { if (-1 == e.hours && -1 == e.minutes) return ""; (e.hours < e.hours.starts || e.hours > e.hours.ends) && (e.hours = 0), (e.minutes < e.minutes.starts || e.minutes > e.minutes.ends) && (e.minutes = 0); var t = "", i = 1 == this._get(e, "showPeriod"), s = 1 == this._get(e, "showLeadingZero"), n = 1 == this._get(e, "showHours"), r = 1 == this._get(e, "showMinutes"), a = 1 == this._get(e, "optionalMinutes"), u = this._get(e, "amPmText"), o = e.hours ? e.hours : 0, c = e.minutes ? e.minutes : 0, p = o || 0, l = ""; -1 == p && (p = 0), -1 == c && (c = 0), i && (0 == e.hours && (p = 12), e.hours < 12 ? t = u[0] : (t = u[1], p > 12 && (p -= 12))); var d = p.toString(); s && p < 10 && (d = "0" + d); var h = c.toString(); return c < 10 && (h = "0" + h), n && (l += d), !n || !r || a && 0 == h || (l += this._get(e, "timeSeparator")), !r || a && 0 == h || (l += h), n && t.length > 0 && (l += this._get(e, "periodSeparator") + t), l }, _updateAlternate: function (e, t) { var i = this._get(e, "altField"); i && $(i).each(function (e, i) { $(i).val(t) }) }, _getTimeAsDateTimepicker: function (e) { var t = this._getInst(e); return -1 == t.hours && -1 == t.minutes ? "" : ((t.hours < t.hours.starts || t.hours > t.hours.ends) && (t.hours = 0), (t.minutes < t.minutes.starts || t.minutes > t.minutes.ends) && (t.minutes = 0), new Date(0, 0, 0, t.hours, t.minutes, 0)) }, _getTimeTimepicker: function (e) { var t = this._getInst(e); return this._getParsedTime(t) }, _getHourTimepicker: function (e) { var t = this._getInst(e); return void 0 == t ? -1 : t.hours }, _getMinuteTimepicker: function (e) { var t = this._getInst(e); return void 0 == t ? -1 : t.minutes } }), $.fn.timepicker = function (e) { $.timepicker.initialized || ($(document).mousedown($.timepicker._checkExternalClick), $.timepicker.initialized = !0), 0 === $("#" + $.timepicker._mainDivId).length && $("body").append($.timepicker.tpDiv); var t = Array.prototype.slice.call(arguments, 1); return "string" != typeof e || "getTime" != e && "getTimeAsDate" != e && "getHour" != e && "getMinute" != e ? "option" == e && 2 == arguments.length && "string" == typeof arguments[1] ? $.timepicker["_" + e + "Timepicker"].apply($.timepicker, [this[0]].concat(t)) : this.each(function () { "string" == typeof e ? $.timepicker["_" + e + "Timepicker"].apply($.timepicker, [this].concat(t)) : $.timepicker._attachTimepicker(this, e) }) : $.timepicker["_" + e + "Timepicker"].apply($.timepicker, [this[0]].concat(t)) }, $.timepicker = new Timepicker, $.timepicker.initialized = !1, $.timepicker.uuid = (new Date).getTime(), $.timepicker.version = "0.3.3", window["TP_jQuery_" + tpuuid] = $ }(jQuery);;jQuery(function (e) { e.datepicker.regional.en = { 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: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.tr = { closeText: "kapat", prevText: "&#x3c;geri", nextText: "ileri&#x3e", currentText: "bugÃŒn", monthNames: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], monthNamesShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağust", "Eyl", "Eki", "Kas", "Ara"], dayNames: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], dayNamesShort: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"], dayNamesMin: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.fr = { closeText: "Fermer", prevText: "&#x3c;Préc", nextText: "Suiv&#x3e;", currentText: "Aujourd'hui", monthNames: ["Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre"], monthNamesShort: ["Jan", "Fev", "Mar", "Avr", "Mai", "Jun", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec"], dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"], dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.bg = { closeText: "затвори", prevText: "&#x3C;назад", nextText: "напред&#x3E;", nextBigText: "&#x3E;&#x3E;", currentText: "днес", monthNames: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"], monthNamesShort: ["Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек"], dayNames: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"], dayNamesShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб"], dayNamesMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Съ"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.ru = { closeText: "Закрыть", prevText: "&#x3C;Пред", nextText: "След&#x3E;", currentText: "Сегодня", monthNames: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], monthNamesShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], dayNames: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], dayNamesShort: ["вск", "пнд", "втр", "срд", "чтв", "птн", "сбт"], dayNamesMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.az = { closeText: "Bağla", prevText: "&#x3C;Geri", nextText: "İrəli&#x3E;", currentText: "Bugün", monthNames: ["Yanvar", "Fevral", "Mart", "Aprel", "May", "İyun", "İyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"], monthNamesShort: ["Yan", "Fev", "Mar", "Apr", "May", "İyun", "İyul", "Avq", "Sen", "Okt", "Noy", "Dek"], dayNames: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"], dayNamesShort: ["B", "Be", "Ça", "Ç", "Ca", "C", "Ş"], dayNamesMin: ["B", "B", "Ç", "С", "Ç", "C", "Ş"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.az = { closeText: "Bağla", prevText: "&#x3C;Geri", nextText: "İrəli&#x3E;", currentText: "Bugün", monthNames: ["Yanvar", "Fevral", "Mart", "Aprel", "May", "İyun", "İyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"], monthNamesShort: ["Yan", "Fev", "Mar", "Apr", "May", "İyun", "İyul", "Avq", "Sen", "Okt", "Noy", "Dek"], dayNames: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"], dayNamesShort: ["B", "Be", "Ça", "Ç", "Ca", "C", "Ş"], dayNamesMin: ["B", "B", "Ç", "С", "Ç", "C", "Ş"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { e.datepicker.regional.mk = { closeText: "Затвори", prevText: "&#x3C;", nextText: "&#x3E;", currentText: "Денес", monthNames: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"], monthNamesShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"], dayNames: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"], dayNamesShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб"], dayNamesMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са"], weekHeader: "Hf", dateFormat: "dd.mm.yy", firstDay: 1, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" } }), jQuery(function (e) { var a = e("#hdnCulture").val(); "dk" == a ? e.datepicker.setDefaults(e.datepicker.regional.en) : e.datepicker.setDefaults(e.datepicker.regional[a]) });;!function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery) }(function (e) { var o = !1, t = !1, r = 5e3, i = 2e3, n = 0, s = e; var l = ["ms", "moz", "webkit", "o"], a = window.requestAnimationFrame || !1, c = window.cancelAnimationFrame || !1; if (!a) for (var d in l) { var u = l[d]; a || (a = window[u + "RequestAnimationFrame"]), c || (c = window[u + "CancelAnimationFrame"] || window[u + "CancelRequestAnimationFrame"]) } var h, p, m = window.MutationObserver || window.WebKitMutationObserver || !1, f = { zindex: "auto", cursoropacitymin: 0, cursoropacitymax: 1, cursorcolor: "#424242", cursorwidth: "5px", cursorborder: "1px solid #fff", cursorborderradius: "5px", scrollspeed: 60, mousescrollstep: 24, touchbehavior: !1, hwacceleration: !0, usetransition: !0, boxzoom: !1, dblclickzoom: !0, gesturezoom: !0, grabcursorenabled: !0, autohidemode: !0, background: "", iframeautoresize: !0, cursorminheight: 32, preservenativescrolling: !0, railoffset: !1, bouncescroll: !0, spacebarenabled: !0, railpadding: { top: 0, right: 0, left: 0, bottom: 0 }, disableoutline: !0, horizrailenabled: !0, railalign: "right", railvalign: "bottom", enabletranslate3d: !0, enablemousewheel: !0, enablekeyboard: !0, smoothscroll: !0, sensitiverail: !0, enablemouselockapi: !0, cursorfixedheight: !1, directionlockdeadzone: 6, hidecursordelay: 400, nativeparentscrolling: !0, enablescrollonselection: !0, overflowx: !0, overflowy: !0, cursordragspeed: .3, rtlmode: "auto", cursordragontouch: !1, oneaxismousemode: "auto", scriptpath: (h = document.getElementsByTagName("script"), p = h[h.length - 1].src.split("?")[0], p.split("/").length > 0 ? p.split("/").slice(0, -1).join("/") + "/" : "") }, g = !1, w = function (e, l) { var d = this; if (this.version = "3.5.4", this.name = "nicescroll", this.me = l, this.opt = { doc: s("body"), win: !1 }, s.extend(this.opt, f), this.opt.snapbackspeed = 80, e) for (var u in d.opt) void 0 !== e[u] && (d.opt[u] = e[u]); this.doc = d.opt.doc, this.iddoc = this.doc && this.doc[0] && this.doc[0].id || "", this.ispage = /^BODY|HTML/.test(d.opt.win ? d.opt.win[0].nodeName : this.doc[0].nodeName), this.haswrapper = !1 !== d.opt.win, this.win = d.opt.win || (this.ispage ? s(window) : this.doc), this.docscroll = this.ispage && !this.haswrapper ? s(window) : this.win, this.body = s("body"), this.viewport = !1, this.isfixed = !1, this.iframe = !1, this.isiframe = "IFRAME" == this.doc[0].nodeName && "IFRAME" == this.win[0].nodeName, this.istextarea = "TEXTAREA" == this.win[0].nodeName, this.forcescreen = !1, this.canshowonmouseevent = "scroll" != d.opt.autohidemode, this.onmousedown = !1, this.onmouseup = !1, this.onmousemove = !1, this.onmousewheel = !1, this.onkeypress = !1, this.ongesturezoom = !1, this.onclick = !1, this.onscrollstart = !1, this.onscrollend = !1, this.onscrollcancel = !1, this.onzoomin = !1, this.onzoomout = !1, this.view = !1, this.page = !1, this.scroll = { x: 0, y: 0 }, this.scrollratio = { x: 0, y: 0 }, this.cursorheight = 20, this.scrollvaluemax = 0, this.isrtlmode = !1, this.scrollrunning = !1, this.scrollmom = !1, this.observer = !1, this.observerremover = !1; do { this.id = "ascrail" + i++ } while (document.getElementById(this.id)); this.rail = !1, this.cursor = !1, this.cursorfreezed = !1, this.selectiondrag = !1, this.zoom = !1, this.zoomactive = !1, this.hasfocus = !1, this.hasmousefocus = !1, this.visibility = !0, this.locked = !1, this.hidden = !1, this.cursoractive = !0, this.wheelprevented = !1, this.overflowx = d.opt.overflowx, this.overflowy = d.opt.overflowy, this.nativescrollingarea = !1, this.checkarea = 0, this.events = [], this.saved = {}, this.delaylist = {}, this.synclist = {}, this.lastdeltax = 0, this.lastdeltay = 0, this.detected = function () { if (g) return g; var e = document.createElement("DIV"), o = {}; o.haspointerlock = "pointerLockElement" in document || "mozPointerLockElement" in document || "webkitPointerLockElement" in document, o.isopera = "opera" in window, o.isopera12 = o.isopera && "getUserMedia" in navigator, o.isoperamini = "[object OperaMini]" === Object.prototype.toString.call(window.operamini), o.isie = "all" in document && "attachEvent" in e && !o.isopera, o.isieold = o.isie && !("msInterpolationMode" in e.style), o.isie7 = o.isie && !o.isieold && (!("documentMode" in document) || 7 == document.documentMode), o.isie8 = o.isie && "documentMode" in document && 8 == document.documentMode, o.isie9 = o.isie && "performance" in window && document.documentMode >= 9, o.isie10 = o.isie && "performance" in window && document.documentMode >= 10, o.isie9mobile = /iemobile.9/i.test(navigator.userAgent), o.isie9mobile && (o.isie9 = !1), o.isie7mobile = !o.isie9mobile && o.isie7 && /iemobile/i.test(navigator.userAgent), o.ismozilla = "MozAppearance" in e.style, o.iswebkit = "WebkitAppearance" in e.style, o.ischrome = "chrome" in window, o.ischrome22 = o.ischrome && o.haspointerlock, o.ischrome26 = o.ischrome && "transition" in e.style, o.cantouch = "ontouchstart" in document.documentElement || "ontouchstart" in window, o.hasmstouch = window.navigator.msPointerEnabled || !1, o.ismac = /^mac$/i.test(navigator.platform), o.isios = o.cantouch && /iphone|ipad|ipod/i.test(navigator.platform), o.isios4 = o.isios && !("seal" in Object), o.isandroid = /android/i.test(navigator.userAgent), o.trstyle = !1, o.hastransform = !1, o.hastranslate3d = !1, o.transitionstyle = !1, o.hastransition = !1, o.transitionend = !1; for (var t = ["transform", "msTransform", "webkitTransform", "MozTransform", "OTransform"], r = 0; r < t.length; r++) if (void 0 !== e.style[t[r]]) { o.trstyle = t[r]; break } o.hastransform = 0 != o.trstyle, o.hastransform && (e.style[o.trstyle] = "translate3d(1px,2px,3px)", o.hastranslate3d = /translate3d/.test(e.style[o.trstyle])), o.transitionstyle = !1, o.prefixstyle = "", o.transitionend = !1; t = ["transition", "webkitTransition", "MozTransition", "OTransition", "OTransition", "msTransition", "KhtmlTransition"]; var i = ["", "-webkit-", "-moz-", "-o-", "-o", "-ms-", "-khtml-"], n = ["transitionend", "webkitTransitionEnd", "transitionend", "otransitionend", "oTransitionEnd", "msTransitionEnd", "KhtmlTransitionEnd"]; for (r = 0; r < t.length; r++) if (t[r] in e.style) { o.transitionstyle = t[r], o.prefixstyle = i[r], o.transitionend = n[r]; break } return o.ischrome26 && (o.prefixstyle = i[1]), o.hastransition = o.transitionstyle, o.cursorgrabvalue = function () { var t = ["-moz-grab", "-webkit-grab", "grab"]; (o.ischrome && !o.ischrome22 || o.isie) && (t = []); for (var r = 0; r < t.length; r++) { var i = t[r]; if (e.style.cursor = i, e.style.cursor == i) return i } return "url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize" }(), o.hasmousecapture = "setCapture" in e, o.hasMutationObserver = !1 !== m, e = null, g = o, o }(); var h = s.extend({}, this.detected); this.canhwscroll = h.hastransform && d.opt.hwacceleration, this.ishwscroll = this.canhwscroll && d.haswrapper, this.istouchcapable = !1, h.cantouch && h.ischrome && !h.isios && !h.isandroid && (this.istouchcapable = !0, h.cantouch = !1), h.cantouch && h.ismozilla && !h.isios && !h.isandroid && (this.istouchcapable = !0, h.cantouch = !1), d.opt.enablemouselockapi || (h.hasmousecapture = !1, h.haspointerlock = !1), this.delayed = function (e, o, t, r) { var i = d.delaylist[e], n = (new Date).getTime(); if (!r && i && i.tt) return !1; i && i.tt && clearTimeout(i.tt), i && i.last + t > n && !i.tt ? d.delaylist[e] = { last: n + t, tt: setTimeout(function () { d && (d.delaylist[e].tt = 0, o.call()) }, t) } : i && i.tt || (d.delaylist[e] = { last: n, tt: 0 }, setTimeout(function () { o.call() }, 0)) }, this.debounced = function (e, o, t) { var r = d.delaylist[e]; (new Date).getTime(); d.delaylist[e] = o, r || setTimeout(function () { var o = d.delaylist[e]; d.delaylist[e] = !1, o.call() }, t) }; var p = !1; if (this.synched = function (e, o) { return d.synclist[e] = o, p || (a(function () { p = !1; for (e in d.synclist) { var o = d.synclist[e]; o && o.call(d), d.synclist[e] = !1 } }), p = !0), e }, this.unsynched = function (e) { d.synclist[e] && (d.synclist[e] = !1) }, this.css = function (e, o) { for (var t in o) d.saved.css.push([e, t, e.css(t)]), e.css(t, o[t]) }, this.scrollTop = function (e) { return void 0 === e ? d.getScrollTop() : d.setScrollTop(e) }, this.scrollLeft = function (e) { return void 0 === e ? d.getScrollLeft() : d.setScrollLeft(e) }, BezierClass = function (e, o, t, r, i, n, s) { this.st = e, this.ed = o, this.spd = t, this.p1 = r || 0, this.p2 = i || 1, this.p3 = n || 0, this.p4 = s || 1, this.ts = (new Date).getTime(), this.df = this.ed - this.st }, BezierClass.prototype = { B2: function (e) { return 3 * e * e * (1 - e) }, B3: function (e) { return 3 * e * (1 - e) * (1 - e) }, B4: function (e) { return (1 - e) * (1 - e) * (1 - e) }, getNow: function () { var e = 1 - ((new Date).getTime() - this.ts) / this.spd, o = this.B2(e) + this.B3(e) + this.B4(e); return e < 0 ? this.ed : this.st + Math.round(this.df * o) }, update: function (e, o) { return this.st = this.getNow(), this.ed = e, this.spd = o, this.ts = (new Date).getTime(), this.df = this.ed - this.st, this } }, this.ishwscroll) { function w() { var e = d.doc.css(h.trstyle); return !(!e || "matrix" != e.substr(0, 6)) && e.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, "").split(/, +/) } this.doc.translate = { x: 0, y: 0, tx: "0px", ty: "0px" }, h.hastranslate3d && h.isios && this.doc.css("-webkit-backface-visibility", "hidden"), this.getScrollTop = function (e) { if (!e) { var o = w(); if (o) return 16 == o.length ? -o[13] : -o[5]; if (d.timerscroll && d.timerscroll.bz) return d.timerscroll.bz.getNow() } return d.doc.translate.y }, this.getScrollLeft = function (e) { if (!e) { var o = w(); if (o) return 16 == o.length ? -o[12] : -o[4]; if (d.timerscroll && d.timerscroll.bh) return d.timerscroll.bh.getNow() } return d.doc.translate.x }, document.createEvent ? this.notifyScrollEvent = function (e) { var o = document.createEvent("UIEvents"); o.initUIEvent("scroll", !1, !0, window, 1), e.dispatchEvent(o) } : document.fireEvent ? this.notifyScrollEvent = function (e) { var o = document.createEventObject(); e.fireEvent("onscroll"), o.cancelBubble = !0 } : this.notifyScrollEvent = function (e, o) { }; h.hastranslate3d && d.opt.enabletranslate3d ? (this.setScrollTop = function (e, o) { d.doc.translate.y = e, d.doc.translate.ty = -1 * e + "px", d.doc.css(h.trstyle, "translate3d(" + d.doc.translate.tx + "," + d.doc.translate.ty + ",0px)"), o || d.notifyScrollEvent(d.win[0]) }, this.setScrollLeft = function (e, o) { d.doc.translate.x = e, d.doc.translate.tx = -1 * e + "px", d.doc.css(h.trstyle, "translate3d(" + d.doc.translate.tx + "," + d.doc.translate.ty + ",0px)"), o || d.notifyScrollEvent(d.win[0]) }) : (this.setScrollTop = function (e, o) { d.doc.translate.y = e, d.doc.translate.ty = -1 * e + "px", d.doc.css(h.trstyle, "translate(" + d.doc.translate.tx + "," + d.doc.translate.ty + ")"), o || d.notifyScrollEvent(d.win[0]) }, this.setScrollLeft = function (e, o) { d.doc.translate.x = e, d.doc.translate.tx = -1 * e + "px", d.doc.css(h.trstyle, "translate(" + d.doc.translate.tx + "," + d.doc.translate.ty + ")"), o || d.notifyScrollEvent(d.win[0]) }) } else this.getScrollTop = function () { return d.docscroll.scrollTop() }, this.setScrollTop = function (e) { return d.docscroll.scrollTop(e) }, this.getScrollLeft = function () { return d.docscroll.scrollLeft() }, this.setScrollLeft = function (e) { return d.docscroll.scrollLeft(e) }; this.getTarget = function (e) { return !!e && (e.target ? e.target : !!e.srcElement && e.srcElement) }, this.hasParent = function (e, o) { if (!e) return !1; for (var t = e.target || e.srcElement || e || !1; t && t.id != o;) t = t.parentNode || !1; return !1 !== t }; var b = { thin: 1, medium: 3, thick: 5 }; function y(e, o, t) { var r = e.css(o), i = parseFloat(r); if (isNaN(i)) { var n = 3 == (i = b[r] || 0) ? t ? d.win.outerHeight() - d.win.innerHeight() : d.win.outerWidth() - d.win.innerWidth() : 1; return d.isie8 && i && (i += 1), n ? i : 0 } return i } function x(e, o, t, r) { d._bind(e, o, function (r) { var i = { original: r = r || window.event, target: r.target || r.srcElement, type: "wheel", deltaMode: "MozMousePixelScroll" == r.type ? 0 : 1, deltaX: 0, deltaZ: 0, preventDefault: function () { return r.preventDefault ? r.preventDefault() : r.returnValue = !1, !1 }, stopImmediatePropagation: function () { r.stopImmediatePropagation ? r.stopImmediatePropagation() : r.cancelBubble = !0 } }; return "mousewheel" == o ? (i.deltaY = -.025 * r.wheelDelta, r.wheelDeltaX && (i.deltaX = -.025 * r.wheelDeltaX)) : i.deltaY = r.detail, t.call(e, i) }, r) } function S(e, o, t) { var r, i; if (0 == e.deltaMode ? (r = -Math.floor(e.deltaX * (d.opt.mousescrollstep / 54)), i = -Math.floor(e.deltaY * (d.opt.mousescrollstep / 54))) : 1 == e.deltaMode && (r = -Math.floor(e.deltaX * d.opt.mousescrollstep), i = -Math.floor(e.deltaY * d.opt.mousescrollstep)), o && d.opt.oneaxismousemode && 0 == r && i && (r = i, i = 0), r && (d.scrollmom && d.scrollmom.stop(), d.lastdeltax += r, d.debounced("mousewheelx", function () { var e = d.lastdeltax; d.lastdeltax = 0, d.rail.drag || d.doScrollLeftBy(e) }, 15)), i) { if (d.opt.nativeparentscrolling && t && !d.ispage && !d.zoomactive) if (i < 0) { if (d.getScrollTop() >= d.page.maxh) return !0 } else if (d.getScrollTop() <= 0) return !0; d.scrollmom && d.scrollmom.stop(), d.lastdeltay += i, d.debounced("mousewheely", function () { var e = d.lastdeltay; d.lastdeltay = 0, d.rail.drag || d.doScrollBy(e) }, 15) } return e.stopImmediatePropagation(), e.preventDefault() } this.getOffset = function () { if (d.isfixed) return { top: parseFloat(d.win.css("top")), left: parseFloat(d.win.css("left")) }; if (!d.viewport) return d.win.offset(); var e = d.win.offset(), o = d.viewport.offset(); return { top: e.top - o.top + d.viewport.scrollTop(), left: e.left - o.left + d.viewport.scrollLeft() } }, this.updateScrollBar = function (e) { if (d.ishwscroll) d.rail.css({ height: d.win.innerHeight() }), d.railh && d.railh.css({ width: d.win.innerWidth() }); else { var o = d.getOffset(); (r = { top: o.top, left: o.left }).top += y(d.win, "border-top-width", !0); d.win.outerWidth(), d.win.innerWidth(); r.left += d.rail.align ? d.win.outerWidth() - y(d.win, "border-right-width") - d.rail.width : y(d.win, "border-left-width"); var t = d.opt.railoffset; if (t && (t.top && (r.top += t.top), d.rail.align && t.left && (r.left += t.left)), d.locked || d.rail.css({ top: r.top, left: r.left, height: e ? e.h : d.win.innerHeight() }), d.zoom && d.zoom.css({ top: r.top + 1, left: 1 == d.rail.align ? r.left - 20 : r.left + d.rail.width + 4 }), d.railh && !d.locked) { var r = { top: o.top, left: o.left }, i = d.railh.align ? r.top + y(d.win, "border-top-width", !0) + d.win.innerHeight() - d.railh.height : r.top + y(d.win, "border-top-width", !0), n = r.left + y(d.win, "border-left-width"); d.railh.css({ top: i, left: n, width: d.railh.width }) } } }, this.doRailClick = function (e, o, t) { var r, i, n, s; d.locked || (d.cancelEvent(e), o ? (r = t ? d.doScrollLeft : d.doScrollTop)(n = t ? (e.pageX - d.railh.offset().left - d.cursorwidth / 2) * d.scrollratio.x : (e.pageY - d.rail.offset().top - d.cursorheight / 2) * d.scrollratio.y) : (r = t ? d.doScrollLeftBy : d.doScrollBy, n = t ? d.scroll.x : d.scroll.y, s = t ? e.pageX - d.railh.offset().left : e.pageY - d.rail.offset().top, i = t ? d.view.w : d.view.h, r(n >= s ? i : -i))) }, d.hasanimationframe = a, d.hascancelanimationframe = c, d.hasanimationframe ? d.hascancelanimationframe || (c = function () { d.cancelAnimationFrame = !0 }) : (a = function (e) { return setTimeout(e, 15 - Math.floor(+new Date / 1e3) % 16) }, c = clearInterval), this.init = function () { if (d.saved.css = [], h.isie7mobile) return !0; if (h.isoperamini) return !0; if (h.hasmstouch && d.css(d.ispage ? s("html") : d.win, { "-ms-touch-action": "none" }), d.zindex = "auto", d.ispage || "auto" != d.opt.zindex ? d.zindex = d.opt.zindex : d.zindex = function () { var e = d.win; if ("zIndex" in e) return e.zIndex(); for (; e.length > 0;) { if (9 == e[0].nodeType) return !1; var o = e.css("zIndex"); if (!isNaN(o) && 0 != o) return parseInt(o); e = e.parent() } return !1 }() || "auto", d.ispage || "auto" == d.zindex || d.zindex > n && (n = d.zindex), d.isie && 0 == d.zindex && "auto" == d.opt.zindex && (d.zindex = "auto"), !d.ispage || !h.cantouch && !h.isieold && !h.isie9mobile) { var e = d.docscroll; d.ispage && (e = d.haswrapper ? d.win : d.doc), h.isie9mobile || d.css(e, { "overflow-y": "hidden" }), d.ispage && h.isie7 && ("BODY" == d.doc[0].nodeName ? d.css(s("html"), { "overflow-y": "hidden" }) : "HTML" == d.doc[0].nodeName && d.css(s("body"), { "overflow-y": "hidden" })), !h.isios || d.ispage || d.haswrapper || d.css(s("body"), { "-webkit-overflow-scrolling": "touch" }), (f = s(document.createElement("div"))).css({ position: "relative", top: 0, float: "right", width: d.opt.cursorwidth, height: "0px", "background-color": d.opt.cursorcolor, border: d.opt.cursorborder, "background-clip": "padding-box", "-webkit-border-radius": d.opt.cursorborderradius, "-moz-border-radius": d.opt.cursorborderradius, "border-radius": d.opt.cursorborderradius }), f.hborder = parseFloat(f.outerHeight() - f.innerHeight()), d.cursor = f; var i = s(document.createElement("div")); i.attr("id", d.id), i.addClass("nicescroll-rails"); var l, a, c = ["left", "right"]; for (var u in c) a = c[u], (l = d.opt.railpadding[a]) ? i.css("padding-" + a, l + "px") : d.opt.railpadding[a] = 0; i.append(f), i.width = Math.max(parseFloat(d.opt.cursorwidth), f.outerWidth()) + d.opt.railpadding.left + d.opt.railpadding.right, i.css({ width: i.width + "px", zIndex: d.zindex, background: d.opt.background, cursor: "default" }), i.visibility = !0, i.scrollable = !0, i.align = "left" == d.opt.railalign ? 0 : 1, d.rail = i, d.rail.drag = !1; var p = !1; if (!d.opt.boxzoom || d.ispage || h.isieold || (p = document.createElement("div"), d.bind(p, "click", d.doZoom), d.zoom = s(p), d.zoom.css({ cursor: "pointer", "z-index": d.zindex, height: 18, width: 18, backgroundPosition: "0px 0px" }), d.opt.dblclickzoom && d.bind(d.win, "dblclick", d.doZoom), h.cantouch && d.opt.gesturezoom && (d.ongesturezoom = function (e) { return e.scale > 1.5 && d.doZoomIn(e), e.scale < .8 && d.doZoomOut(e), d.cancelEvent(e) }, d.bind(d.win, "gestureend", d.ongesturezoom))), d.railh = !1, d.opt.horizrailenabled) { var f; d.css(e, { "overflow-x": "hidden" }), (f = s(document.createElement("div"))).css({ position: "relative", top: 0, height: d.opt.cursorwidth, width: "0px", "background-color": d.opt.cursorcolor, border: d.opt.cursorborder, "background-clip": "padding-box", "-webkit-border-radius": d.opt.cursorborderradius, "-moz-border-radius": d.opt.cursorborderradius, "border-radius": d.opt.cursorborderradius }), f.wborder = parseFloat(f.outerWidth() - f.innerWidth()), d.cursorh = f; var g = s(document.createElement("div")); g.attr("id", d.id + "-hr"), g.addClass("nicescroll-rails"), g.height = Math.max(parseFloat(d.opt.cursorwidth), f.outerHeight()), g.css({ height: g.height + "px", zIndex: d.zindex, background: d.opt.background }), g.append(f), g.visibility = !0, g.scrollable = !0, g.align = "top" == d.opt.railvalign ? 0 : 1, d.railh = g, d.railh.drag = !1 } if (d.ispage) i.css({ position: "fixed", top: "0px", height: "100%" }), i.align ? i.css({ right: "0px" }) : i.css({ left: "0px" }), d.body.append(i), d.railh && (g.css({ position: "fixed", left: "0px", width: "100%" }), g.align ? g.css({ bottom: "0px" }) : g.css({ top: "0px" }), d.body.append(g)); else { if (d.ishwscroll) { "static" == d.win.css("position") && d.css(d.win, { position: "relative" }); var w = "HTML" == d.win[0].nodeName ? d.body : d.win; d.zoom && (d.zoom.css({ position: "absolute", top: 1, right: 0, "margin-right": i.width + 4 }), w.append(d.zoom)), i.css({ position: "absolute", top: 0 }), i.align ? i.css({ right: 0 }) : i.css({ left: 0 }), w.append(i), g && (g.css({ position: "absolute", left: 0, bottom: 0 }), g.align ? g.css({ bottom: 0 }) : g.css({ top: 0 }), w.append(g)) } else { d.isfixed = "fixed" == d.win.css("position"); var b = d.isfixed ? "fixed" : "absolute"; d.isfixed || (d.viewport = d.getViewport(d.win[0])), d.viewport && (d.body = d.viewport, 0 == /fixed|relative|absolute/.test(d.viewport.css("position")) && d.css(d.viewport, { position: "relative" })), i.css({ position: b }), d.zoom && d.zoom.css({ position: b }), d.updateScrollBar(), d.body.append(i), d.zoom && d.body.append(d.zoom), d.railh && (g.css({ position: b }), d.body.append(g)) } h.isios && d.css(d.win, { "-webkit-tap-highlight-color": "rgba(0,0,0,0)", "-webkit-touch-callout": "none" }), h.isie && d.opt.disableoutline && d.win.attr("hideFocus", "true"), h.iswebkit && d.opt.disableoutline && d.win.css({ outline: "none" }) } if (!1 === d.opt.autohidemode ? (d.autohidedom = !1, d.rail.css({ opacity: d.opt.cursoropacitymax }), d.railh && d.railh.css({ opacity: d.opt.cursoropacitymax })) : !0 === d.opt.autohidemode || "leave" === d.opt.autohidemode ? (d.autohidedom = s().add(d.rail), h.isie8 && (d.autohidedom = d.autohidedom.add(d.cursor)), d.railh && (d.autohidedom = d.autohidedom.add(d.railh)), d.railh && h.isie8 && (d.autohidedom = d.autohidedom.add(d.cursorh))) : "scroll" == d.opt.autohidemode ? (d.autohidedom = s().add(d.rail), d.railh && (d.autohidedom = d.autohidedom.add(d.railh))) : "cursor" == d.opt.autohidemode ? (d.autohidedom = s().add(d.cursor), d.railh && (d.autohidedom = d.autohidedom.add(d.cursorh))) : "hidden" == d.opt.autohidemode && (d.autohidedom = !1, d.hide(), d.locked = !1), h.isie9mobile) { d.scrollmom = new v(d), d.onmangotouch = function (e) { var o = d.getScrollTop(), t = d.getScrollLeft(); if (o == d.scrollmom.lastscrolly && t == d.scrollmom.lastscrollx) return !0; var r = o - d.mangotouch.sy, i = t - d.mangotouch.sx; if (0 != Math.round(Math.sqrt(Math.pow(i, 2) + Math.pow(r, 2)))) { var n = r < 0 ? -1 : 1, s = i < 0 ? -1 : 1, l = +new Date; if (d.mangotouch.lazy && clearTimeout(d.mangotouch.lazy), l - d.mangotouch.tm > 80 || d.mangotouch.dry != n || d.mangotouch.drx != s) d.scrollmom.stop(), d.scrollmom.reset(t, o), d.mangotouch.sy = o, d.mangotouch.ly = o, d.mangotouch.sx = t, d.mangotouch.lx = t, d.mangotouch.dry = n, d.mangotouch.drx = s, d.mangotouch.tm = l; else { d.scrollmom.stop(), d.scrollmom.update(d.mangotouch.sx - i, d.mangotouch.sy - r); d.mangotouch.tm; d.mangotouch.tm = l; var a = Math.max(Math.abs(d.mangotouch.ly - o), Math.abs(d.mangotouch.lx - t)); d.mangotouch.ly = o, d.mangotouch.lx = t, a > 2 && (d.mangotouch.lazy = setTimeout(function () { d.mangotouch.lazy = !1, d.mangotouch.dry = 0, d.mangotouch.drx = 0, d.mangotouch.tm = 0, d.scrollmom.doMomentum(30) }, 100)) } } }; var y = d.getScrollTop(), x = d.getScrollLeft(); d.mangotouch = { sy: y, ly: y, dry: 0, sx: x, lx: x, drx: 0, lazy: !1, tm: 0 }, d.bind(d.docscroll, "scroll", d.onmangotouch) } else { if (h.cantouch || d.istouchcapable || d.opt.touchbehavior || h.hasmstouch) { d.scrollmom = new v(d), d.ontouchstart = function (e) { if (e.pointerType && 2 != e.pointerType) return !1; if (d.hasmoving = !1, !d.locked) { if (h.hasmstouch) for (var o = !!e.target && e.target; o;) { var t = s(o).getNiceScroll(); if (t.length > 0 && t[0].me == d.me) break; if (t.length > 0) return !1; if ("DIV" == o.nodeName && o.id == d.id) break; o = !!o.parentNode && o.parentNode } if (d.cancelScroll(), o = d.getTarget(e)) if (/INPUT/i.test(o.nodeName) && /range/i.test(o.type)) return d.stopPropagation(e); if (!("clientX" in e) && "changedTouches" in e && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), d.forcescreen) { var r = e; (e = { original: e.original ? e.original : e }).clientX = r.screenX, e.clientY = r.screenY } if (d.rail.drag = { x: e.clientX, y: e.clientY, sx: d.scroll.x, sy: d.scroll.y, st: d.getScrollTop(), sl: d.getScrollLeft(), pt: 2, dl: !1 }, d.ispage || !d.opt.directionlockdeadzone) d.rail.drag.dl = "f"; else { var i = s(window).width(), n = s(window).height(), l = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), a = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight), c = Math.max(0, a - n), u = Math.max(0, l - i); !d.rail.scrollable && d.railh.scrollable ? d.rail.drag.ck = c > 0 && "v" : d.rail.scrollable && !d.railh.scrollable ? d.rail.drag.ck = u > 0 && "h" : d.rail.drag.ck = !1, d.rail.drag.ck || (d.rail.drag.dl = "f") } if (d.opt.touchbehavior && d.isiframe && h.isie) { var p = d.win.position(); d.rail.drag.x += p.left, d.rail.drag.y += p.top } if (d.hasmoving = !1, d.lastmouseup = !1, d.scrollmom.reset(e.clientX, e.clientY), !h.cantouch && !this.istouchcapable && !h.hasmstouch) { if (!(!!o && /INPUT|SELECT|TEXTAREA/i.test(o.nodeName))) return !d.ispage && h.hasmousecapture && o.setCapture(), d.opt.touchbehavior ? (o.onclick && !o._onclick && (o._onclick = o.onclick, o.onclick = function (e) { if (d.hasmoving) return !1; o._onclick.call(this, e) }), d.cancelEvent(e)) : d.stopPropagation(e); /SUBMIT|CANCEL|BUTTON/i.test(s(o).attr("type")) && (pc = { tg: o, click: !1 }, d.preventclick = pc) } } }, d.ontouchend = function (e) { return (!e.pointerType || 2 == e.pointerType) && (d.rail.drag && 2 == d.rail.drag.pt && (d.scrollmom.doMomentum(), d.rail.drag = !1, d.hasmoving && (d.lastmouseup = !0, d.hideCursor(), h.hasmousecapture && document.releaseCapture(), !h.cantouch)) ? d.cancelEvent(e) : void 0) }; var S = d.opt.touchbehavior && d.isiframe && !h.hasmousecapture; d.ontouchmove = function (e, o) { if (e.pointerType && 2 != e.pointerType) return !1; if (d.rail.drag && 2 == d.rail.drag.pt) { if (h.cantouch && void 0 === e.original) return !0; if (d.hasmoving = !0, d.preventclick && !d.preventclick.click && (d.preventclick.click = d.preventclick.tg.onclick || !1, d.preventclick.tg.onclick = d.onpreventclick), "changedTouches" in (e = s.extend({ original: e }, e)) && (e.clientX = e.changedTouches[0].clientX, e.clientY = e.changedTouches[0].clientY), d.forcescreen) { var t = e; (e = { original: e.original ? e.original : e }).clientX = t.screenX, e.clientY = t.screenY } var r = ofy = 0; if (S && !o) { var i = d.win.position(); r = -i.left, ofy = -i.top } var n = e.clientY + ofy, l = n - d.rail.drag.y, a = e.clientX + r, c = a - d.rail.drag.x, u = d.rail.drag.st - l; if (d.ishwscroll && d.opt.bouncescroll ? u < 0 ? u = Math.round(u / 2) : u > d.page.maxh && (u = d.page.maxh + Math.round((u - d.page.maxh) / 2)) : (u < 0 && (u = 0, n = 0), u > d.page.maxh && (u = d.page.maxh, n = 0)), d.railh && d.railh.scrollable) { var p = d.rail.drag.sl - c; d.ishwscroll && d.opt.bouncescroll ? p < 0 ? p = Math.round(p / 2) : p > d.page.maxw && (p = d.page.maxw + Math.round((p - d.page.maxw) / 2)) : (p < 0 && (p = 0, a = 0), p > d.page.maxw && (p = d.page.maxw, a = 0)) } var m = !1; if (d.rail.drag.dl) m = !0, "v" == d.rail.drag.dl ? p = d.rail.drag.sl : "h" == d.rail.drag.dl && (u = d.rail.drag.st); else { var f = Math.abs(l), g = Math.abs(c), w = d.opt.directionlockdeadzone; if ("v" == d.rail.drag.ck) { if (f > w && g <= .3 * f) return d.rail.drag = !1, !0; g > w && (d.rail.drag.dl = "f", s("body").scrollTop(s("body").scrollTop())) } else if ("h" == d.rail.drag.ck) { if (g > w && f <= .3 * g) return d.rail.drag = !1, !0; f > w && (d.rail.drag.dl = "f", s("body").scrollLeft(s("body").scrollLeft())) } } if (d.synched("touchmove", function () { d.rail.drag && 2 == d.rail.drag.pt && (d.prepareTransition && d.prepareTransition(0), d.rail.scrollable && d.setScrollTop(u), d.scrollmom.update(a, n), d.railh && d.railh.scrollable ? (d.setScrollLeft(p), d.showCursor(u, p)) : d.showCursor(u), h.isie10 && document.selection.clear()) }), h.ischrome && d.istouchcapable && (m = !1), m) return d.cancelEvent(e) } } } if (d.onmousedown = function (e, o) { if (!d.rail.drag || 1 == d.rail.drag.pt) { if (d.locked) return d.cancelEvent(e); d.cancelScroll(), d.rail.drag = { x: e.clientX, y: e.clientY, sx: d.scroll.x, sy: d.scroll.y, pt: 1, hr: !!o }; var t = d.getTarget(e); return !d.ispage && h.hasmousecapture && t.setCapture(), d.isiframe && !h.hasmousecapture && (d.saved.csspointerevents = d.doc.css("pointer-events"), d.css(d.doc, { "pointer-events": "none" })), d.hasmoving = !1, d.cancelEvent(e) } }, d.onmouseup = function (e) { if (d.rail.drag) { if (h.hasmousecapture && document.releaseCapture(), d.isiframe && !h.hasmousecapture && d.doc.css("pointer-events", d.saved.csspointerevents), 1 != d.rail.drag.pt) return; return d.rail.drag = !1, d.hasmoving && d.triggerScrollEnd(), d.cancelEvent(e) } }, d.onmousemove = function (e) { if (d.rail.drag) { if (1 != d.rail.drag.pt) return; if (h.ischrome && 0 == e.which) return d.onmouseup(e); if (d.cursorfreezed = !0, d.hasmoving = !0, d.rail.drag.hr) { d.scroll.x = d.rail.drag.sx + (e.clientX - d.rail.drag.x), d.scroll.x < 0 && (d.scroll.x = 0); var o = d.scrollvaluemaxw; d.scroll.x > o && (d.scroll.x = o) } else { d.scroll.y = d.rail.drag.sy + (e.clientY - d.rail.drag.y), d.scroll.y < 0 && (d.scroll.y = 0); var t = d.scrollvaluemax; d.scroll.y > t && (d.scroll.y = t) } return d.synched("mousemove", function () { d.rail.drag && 1 == d.rail.drag.pt && (d.showCursor(), d.rail.drag.hr ? d.doScrollLeft(Math.round(d.scroll.x * d.scrollratio.x), d.opt.cursordragspeed) : d.doScrollTop(Math.round(d.scroll.y * d.scrollratio.y), d.opt.cursordragspeed)) }), d.cancelEvent(e) } }, h.cantouch || d.opt.touchbehavior) d.onpreventclick = function (e) { if (d.preventclick) return d.preventclick.tg.onclick = d.preventclick.click, d.preventclick = !1, d.cancelEvent(e) }, d.bind(d.win, "mousedown", d.ontouchstart), d.onclick = !h.isios && function (e) { return !d.lastmouseup || (d.lastmouseup = !1, d.cancelEvent(e)) }, d.opt.grabcursorenabled && h.cursorgrabvalue && (d.css(d.ispage ? d.doc : d.win, { cursor: h.cursorgrabvalue }), d.css(d.rail, { cursor: h.cursorgrabvalue })); else { "getSelection" in document ? d.hasTextSelected = function () { return document.getSelection().rangeCount > 0 } : "selection" in document ? d.hasTextSelected = function () { return "None" != document.selection.type } : d.hasTextSelected = function () { return !1 }, d.onselectionstart = function (e) { d.ispage || (d.selectiondrag = d.win.offset()) }, d.onselectionend = function (e) { d.selectiondrag = !1 }, d.onselectiondrag = function (e) { d.selectiondrag && d.hasTextSelected() && d.debounced("selectionscroll", function () { !function e(o) { if (d.selectiondrag) { if (o) { var t = d.win.outerHeight(), r = o.pageY - d.selectiondrag.top; r > 0 && r < t && (r = 0), r >= t && (r -= t), d.selectiondrag.df = r } if (0 != d.selectiondrag.df) { var i = 2 * -Math.floor(d.selectiondrag.df / 6); d.doScrollBy(i), d.debounced("doselectionscroll", function () { e() }, 50) } } }(e) }, 250) } } h.hasmstouch && (d.css(d.rail, { "-ms-touch-action": "none" }), d.css(d.cursor, { "-ms-touch-action": "none" }), d.bind(d.win, "MSPointerDown", d.ontouchstart), d.bind(document, "MSPointerUp", d.ontouchend), d.bind(document, "MSPointerMove", d.ontouchmove), d.bind(d.cursor, "MSGestureHold", function (e) { e.preventDefault() }), d.bind(d.cursor, "contextmenu", function (e) { e.preventDefault() })), this.istouchcapable && (d.bind(d.win, "touchstart", d.ontouchstart), d.bind(document, "touchend", d.ontouchend), d.bind(document, "touchcancel", d.ontouchend), d.bind(document, "touchmove", d.ontouchmove)), d.bind(d.cursor, "mousedown", d.onmousedown), d.bind(d.cursor, "mouseup", d.onmouseup), d.railh && (d.bind(d.cursorh, "mousedown", function (e) { d.onmousedown(e, !0) }), d.bind(d.cursorh, "mouseup", d.onmouseup)), (d.opt.cursordragontouch || !h.cantouch && !d.opt.touchbehavior) && (d.rail.css({ cursor: "default" }), d.railh && d.railh.css({ cursor: "default" }), d.jqbind(d.rail, "mouseenter", function () { if (!d.win.is(":visible")) return !1; d.canshowonmouseevent && d.showCursor(), d.rail.active = !0 }), d.jqbind(d.rail, "mouseleave", function () { d.rail.active = !1, d.rail.drag || d.hideCursor() }), d.opt.sensitiverail && (d.bind(d.rail, "click", function (e) { d.doRailClick(e, !1, !1) }), d.bind(d.rail, "dblclick", function (e) { d.doRailClick(e, !0, !1) }), d.bind(d.cursor, "click", function (e) { d.cancelEvent(e) }), d.bind(d.cursor, "dblclick", function (e) { d.cancelEvent(e) })), d.railh && (d.jqbind(d.railh, "mouseenter", function () { if (!d.win.is(":visible")) return !1; d.canshowonmouseevent && d.showCursor(), d.rail.active = !0 }), d.jqbind(d.railh, "mouseleave", function () { d.rail.active = !1, d.rail.drag || d.hideCursor() }), d.opt.sensitiverail && (d.bind(d.railh, "click", function (e) { d.doRailClick(e, !1, !0) }), d.bind(d.railh, "dblclick", function (e) { d.doRailClick(e, !0, !0) }), d.bind(d.cursorh, "click", function (e) { d.cancelEvent(e) }), d.bind(d.cursorh, "dblclick", function (e) { d.cancelEvent(e) })))), h.cantouch || d.opt.touchbehavior ? (d.bind(h.hasmousecapture ? d.win : document, "mouseup", d.ontouchend), d.bind(document, "mousemove", d.ontouchmove), d.onclick && d.bind(document, "click", d.onclick), d.opt.cursordragontouch && (d.bind(d.cursor, "mousedown", d.onmousedown), d.bind(d.cursor, "mousemove", d.onmousemove), d.cursorh && d.bind(d.cursorh, "mousedown", function (e) { d.onmousedown(e, !0) }), d.cursorh && d.bind(d.cursorh, "mousemove", d.onmousemove))) : (d.bind(h.hasmousecapture ? d.win : document, "mouseup", d.onmouseup), d.bind(document, "mousemove", d.onmousemove), d.onclick && d.bind(document, "click", d.onclick), !d.ispage && d.opt.enablescrollonselection && (d.bind(d.win[0], "mousedown", d.onselectionstart), d.bind(document, "mouseup", d.onselectionend), d.bind(d.cursor, "mouseup", d.onselectionend), d.cursorh && d.bind(d.cursorh, "mouseup", d.onselectionend), d.bind(document, "mousemove", d.onselectiondrag)), d.zoom && (d.jqbind(d.zoom, "mouseenter", function () { d.canshowonmouseevent && d.showCursor(), d.rail.active = !0 }), d.jqbind(d.zoom, "mouseleave", function () { d.rail.active = !1, d.rail.drag || d.hideCursor() }))), d.opt.enablemousewheel && (d.isiframe || d.bind(h.isie && d.ispage ? document : d.win, "mousewheel", d.onmousewheel), d.bind(d.rail, "mousewheel", d.onmousewheel), d.railh && d.bind(d.railh, "mousewheel", d.onmousewheelhr)), d.ispage || h.cantouch || /HTML|^BODY/.test(d.win[0].nodeName) || (d.win.attr("tabindex") || d.win.attr({ tabindex: r++ }), d.jqbind(d.win, "focus", function (e) { o = d.getTarget(e).id || !0, d.hasfocus = !0, d.canshowonmouseevent && d.noticeCursor() }), d.jqbind(d.win, "blur", function (e) { o = !1, d.hasfocus = !1 }), d.jqbind(d.win, "mouseenter", function (e) { t = d.getTarget(e).id || !0, d.hasmousefocus = !0, d.canshowonmouseevent && d.noticeCursor() }), d.jqbind(d.win, "mouseleave", function () { t = !1, d.hasmousefocus = !1, d.rail.drag || d.hideCursor() })) } if (d.onkeypress = function (e) { if (d.locked && 0 == d.page.maxh) return !0; e = e || window.e; var r = d.getTarget(e); if (r && /INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName) && (!(r.getAttribute("type") || r.type || !1) || !/submit|button|cancel/i.tp)) return !0; if (s(r).attr("contenteditable")) return !0; if (d.hasfocus || d.hasmousefocus && !o || d.ispage && !o && !t) { var i = e.keyCode; if (d.locked && 27 != i) return d.cancelEvent(e); var n = e.ctrlKey || !1, l = e.shiftKey || !1, a = !1; switch (i) { case 38: case 63233: d.doScrollBy(72), a = !0; break; case 40: case 63235: d.doScrollBy(-72), a = !0; break; case 37: case 63232: d.railh && (n ? d.doScrollLeft(0) : d.doScrollLeftBy(72), a = !0); break; case 39: case 63234: d.railh && (n ? d.doScrollLeft(d.page.maxw) : d.doScrollLeftBy(-72), a = !0); break; case 33: case 63276: d.doScrollBy(d.view.h), a = !0; break; case 34: case 63277: d.doScrollBy(-d.view.h), a = !0; break; case 36: case 63273: d.railh && n ? d.doScrollPos(0, 0) : d.doScrollTo(0), a = !0; break; case 35: case 63275: d.railh && n ? d.doScrollPos(d.page.maxw, d.page.maxh) : d.doScrollTo(d.page.maxh), a = !0; break; case 32: d.opt.spacebarenabled && (l ? d.doScrollBy(d.view.h) : d.doScrollBy(-d.view.h), a = !0); break; case 27: d.zoomactive && (d.doZoom(), a = !0) } if (a) return d.cancelEvent(e) } }, d.opt.enablekeyboard && d.bind(document, h.isopera && !h.isopera12 ? "keypress" : "keydown", d.onkeypress), d.bind(document, "keydown", function (e) { (e.ctrlKey || !1) && (d.wheelprevented = !0) }), d.bind(document, "keyup", function (e) { e.ctrlKey || !1 || (d.wheelprevented = !1) }), d.bind(window, "resize", d.lazyResize), d.bind(window, "orientationchange", d.lazyResize), d.bind(window, "load", d.lazyResize), h.ischrome && !d.ispage && !d.haswrapper) { var z = d.win.attr("style"), T = parseFloat(d.win.css("width")) + 1; d.win.css("width", T), d.synched("chromefix", function () { d.win.attr("style", z) }) } d.onAttributeChange = function (e) { d.lazyResize(250) }, d.ispage || d.haswrapper || (!1 !== m ? (d.observer = new m(function (e) { e.forEach(d.onAttributeChange) }), d.observer.observe(d.win[0], { childList: !0, characterData: !1, attributes: !0, subtree: !1 }), d.observerremover = new m(function (e) { e.forEach(function (e) { if (e.removedNodes.length > 0) for (var o in e.removedNodes) if (e.removedNodes[o] == d.win[0]) return d.remove() }) }), d.observerremover.observe(d.win[0].parentNode, { childList: !0, characterData: !1, attributes: !1, subtree: !1 })) : (d.bind(d.win, h.isie && !h.isie9 ? "propertychange" : "DOMAttrModified", d.onAttributeChange), h.isie9 && d.win[0].attachEvent("onpropertychange", d.onAttributeChange), d.bind(d.win, "DOMNodeRemoved", function (e) { e.target == d.win[0] && d.remove() }))), !d.ispage && d.opt.boxzoom && d.bind(window, "resize", d.resizeZoom), d.istextarea && d.bind(d.win, "mouseup", d.lazyResize), d.lazyResize(30) } if ("IFRAME" == this.doc[0].nodeName) { function k(e) { d.iframexd = !1; try { var o = "contentDocument" in this ? this.contentDocument : this.contentWindow.document; o.domain } catch (e) { d.iframexd = !0, o = !1 } if (d.iframexd) return "console" in window && console.log("NiceScroll error: policy restriced iframe"), !0; if (d.forcescreen = !0, d.isiframe && (d.iframe = { doc: s(o), html: d.doc.contents().find("html")[0], body: d.doc.contents().find("body")[0] }, d.getContentSize = function () { return { w: Math.max(d.iframe.html.scrollWidth, d.iframe.body.scrollWidth), h: Math.max(d.iframe.html.scrollHeight, d.iframe.body.scrollHeight) } }, d.docscroll = s(d.iframe.body)), !h.isios && d.opt.iframeautoresize && !d.isiframe) { d.win.scrollTop(0), d.doc.height(""); var t = Math.max(o.getElementsByTagName("html")[0].scrollHeight, o.body.scrollHeight); d.doc.height(t) } d.lazyResize(30), h.isie7 && d.css(s(d.iframe.html), { "overflow-y": "hidden" }), d.css(s(d.iframe.body), { "overflow-y": "hidden" }), h.isios && d.haswrapper && d.css(s(o.body), { "-webkit-transform": "translate3d(0,0,0)" }), "contentWindow" in this ? d.bind(this.contentWindow, "scroll", d.onscroll) : d.bind(o, "scroll", d.onscroll), d.opt.enablemousewheel && d.bind(o, "mousewheel", d.onmousewheel), d.opt.enablekeyboard && d.bind(o, h.isopera ? "keypress" : "keydown", d.onkeypress), (h.cantouch || d.opt.touchbehavior) && (d.bind(o, "mousedown", d.ontouchstart), d.bind(o, "mousemove", function (e) { d.ontouchmove(e, !0) }), d.opt.grabcursorenabled && h.cursorgrabvalue && d.css(s(o.body), { cursor: h.cursorgrabvalue })), d.bind(o, "mouseup", d.ontouchend), d.zoom && (d.opt.dblclickzoom && d.bind(o, "dblclick", d.doZoom), d.ongesturezoom && d.bind(o, "gestureend", d.ongesturezoom)) } this.doc[0].readyState && "complete" == this.doc[0].readyState && setTimeout(function () { k.call(d.doc[0], !1) }, 500), d.bind(this.doc, "load", k) } }, this.showCursor = function (e, o) { d.cursortimeout && (clearTimeout(d.cursortimeout), d.cursortimeout = 0), d.rail && (d.autohidedom && (d.autohidedom.stop().css({ opacity: d.opt.cursoropacitymax }), d.cursoractive = !0), d.rail.drag && 1 == d.rail.drag.pt || (void 0 !== e && !1 !== e && (d.scroll.y = Math.round(1 * e / d.scrollratio.y)), void 0 !== o && (d.scroll.x = Math.round(1 * o / d.scrollratio.x))), d.cursor.css({ height: d.cursorheight, top: d.scroll.y }), d.cursorh && (!d.rail.align && d.rail.visibility ? d.cursorh.css({ width: d.cursorwidth, left: d.scroll.x + d.rail.width }) : d.cursorh.css({ width: d.cursorwidth, left: d.scroll.x }), d.cursoractive = !0), d.zoom && d.zoom.stop().css({ opacity: d.opt.cursoropacitymax })) }, this.hideCursor = function (e) { d.cursortimeout || d.rail && d.autohidedom && (d.hasmousefocus && "leave" == d.opt.autohidemode || (d.cursortimeout = setTimeout(function () { d.rail.active && d.showonmouseevent || (d.autohidedom.stop().animate({ opacity: d.opt.cursoropacitymin }), d.zoom && d.zoom.stop().animate({ opacity: d.opt.cursoropacitymin }), d.cursoractive = !1), d.cursortimeout = 0 }, e || d.opt.hidecursordelay))) }, this.noticeCursor = function (e, o, t) { d.showCursor(o, t), d.rail.active || d.hideCursor(e) }, this.getContentSize = d.ispage ? function () { return { w: Math.max(document.body.scrollWidth, document.documentElement.scrollWidth), h: Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) } } : d.haswrapper ? function () { return { w: d.doc.outerWidth() + parseInt(d.win.css("paddingLeft")) + parseInt(d.win.css("paddingRight")), h: d.doc.outerHeight() + parseInt(d.win.css("paddingTop")) + parseInt(d.win.css("paddingBottom")) } } : function () { return { w: d.docscroll[0].scrollWidth, h: d.docscroll[0].scrollHeight } }, this.onResize = function (e, o) { if (!d || !d.win) return !1; if (!d.haswrapper && !d.ispage) { if ("none" == d.win.css("display")) return d.visibility && d.hideRail().hideRailHr(), !1; d.hidden || d.visibility || d.showRail().showRailHr() } var t = d.page.maxh, r = d.page.maxw, i = (d.view.h, d.view.w); if (d.view = { w: d.ispage ? d.win.width() : parseInt(d.win[0].clientWidth), h: d.ispage ? d.win.height() : parseInt(d.win[0].clientHeight) }, d.page = o || d.getContentSize(), d.page.maxh = Math.max(0, d.page.h - d.view.h), d.page.maxw = Math.max(0, d.page.w - d.view.w), d.page.maxh == t && d.page.maxw == r && d.view.w == i) { if (d.ispage) return d; var n = d.win.offset(); if (d.lastposition) { var s = d.lastposition; if (s.top == n.top && s.left == n.left) return d } d.lastposition = n } return 0 == d.page.maxh ? (d.hideRail(), d.scrollvaluemax = 0, d.scroll.y = 0, d.scrollratio.y = 0, d.cursorheight = 0, d.setScrollTop(0), d.rail.scrollable = !1) : d.rail.scrollable = !0, 0 == d.page.maxw ? (d.hideRailHr(), d.scrollvaluemaxw = 0, d.scroll.x = 0, d.scrollratio.x = 0, d.cursorwidth = 0, d.setScrollLeft(0), d.railh.scrollable = !1) : d.railh.scrollable = !0, d.locked = 0 == d.page.maxh && 0 == d.page.maxw, d.locked ? (d.ispage || d.updateScrollBar(d.view), !1) : (d.hidden || d.visibility ? d.hidden || d.railh.visibility || d.showRailHr() : d.showRail().showRailHr(), d.istextarea && d.win.css("resize") && "none" != d.win.css("resize") && (d.view.h -= 20), d.cursorheight = Math.min(d.view.h, Math.round(d.view.h * (d.view.h / d.page.h))), d.cursorheight = d.opt.cursorfixedheight ? d.opt.cursorfixedheight : Math.max(d.opt.cursorminheight, d.cursorheight), d.cursorwidth = Math.min(d.view.w, Math.round(d.view.w * (d.view.w / d.page.w))), d.cursorwidth = d.opt.cursorfixedheight ? d.opt.cursorfixedheight : Math.max(d.opt.cursorminheight, d.cursorwidth), d.scrollvaluemax = d.view.h - d.cursorheight - d.cursor.hborder, d.railh && (d.railh.width = d.page.maxh > 0 ? d.view.w - d.rail.width : d.view.w, d.scrollvaluemaxw = d.railh.width - d.cursorwidth - d.cursorh.wborder), d.ispage || d.updateScrollBar(d.view), d.scrollratio = { x: d.page.maxw / d.scrollvaluemaxw, y: d.page.maxh / d.scrollvaluemax }, d.getScrollTop() > d.page.maxh ? d.doScrollTop(d.page.maxh) : (d.scroll.y = Math.round(d.getScrollTop() * (1 / d.scrollratio.y)), d.scroll.x = Math.round(d.getScrollLeft() * (1 / d.scrollratio.x)), d.cursoractive && d.noticeCursor()), d.scroll.y && 0 == d.getScrollTop() && d.doScrollTo(Math.floor(d.scroll.y * d.scrollratio.y)), d) }, this.resize = d.onResize, this.lazyResize = function (e) { return e = isNaN(e) ? 30 : e, d.delayed("resize", d.resize, e), d }, this._bind = function (e, o, t, r) { d.events.push({ e: e, n: o, f: t, b: r, q: !1 }), e.addEventListener ? e.addEventListener(o, t, r || !1) : e.attachEvent ? e.attachEvent("on" + o, t) : e["on" + o] = t }, this.jqbind = function (e, o, t) { d.events.push({ e: e, n: o, f: t, q: !0 }), s(e).bind(o, t) }, this.bind = function (e, o, t, r) { var i = "jquery" in e ? e[0] : e; if ("mousewheel" == o) if ("onwheel" in d.win) d._bind(i, "wheel", t, r || !1); else { var n = void 0 !== document.onmousewheel ? "mousewheel" : "DOMMouseScroll"; x(i, n, t, r || !1), "DOMMouseScroll" == n && x(i, "MozMousePixelScroll", t, r || !1) } else if (i.addEventListener) { if (h.cantouch && /mouseup|mousedown|mousemove/.test(o)) { var s = "mousedown" == o ? "touchstart" : "mouseup" == o ? "touchend" : "touchmove"; d._bind(i, s, function (e) { if (e.touches) e.touches.length < 2 && ((o = e.touches.length ? e.touches[0] : e).original = e, t.call(this, o)); else if (e.changedTouches) { var o; (o = e.changedTouches[0]).original = e, t.call(this, o) } }, r || !1) } d._bind(i, o, t, r || !1), h.cantouch && "mouseup" == o && d._bind(i, "touchcancel", t, r || !1) } else d._bind(i, o, function (e) { return (e = e || window.event || !1) && e.srcElement && (e.target = e.srcElement), "pageY" in e || (e.pageX = e.clientX + document.documentElement.scrollLeft, e.pageY = e.clientY + document.documentElement.scrollTop), !1 !== t.call(i, e) && !1 !== r || d.cancelEvent(e) }) }, this._unbind = function (e, o, t, r) { e.removeEventListener ? e.removeEventListener(o, t, r) : e.detachEvent ? e.detachEvent("on" + o, t) : e["on" + o] = !1 }, this.unbindAll = function () { for (var e = 0; e < d.events.length; e++) { var o = d.events[e]; o.q ? o.e.unbind(o.n, o.f) : d._unbind(o.e, o.n, o.f, o.b) } }, this.cancelEvent = function (e) { return !!(e = e.original ? e.original : e || (window.event || !1)) && (e.preventDefault && e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.preventManipulation && e.preventManipulation(), e.cancelBubble = !0, e.cancel = !0, e.returnValue = !1, !1) }, this.stopPropagation = function (e) { return !!(e = e.original ? e.original : e || (window.event || !1)) && (e.stopPropagation ? e.stopPropagation() : (e.cancelBubble && (e.cancelBubble = !0), !1)) }, this.showRail = function () { return 0 == d.page.maxh || !d.ispage && "none" == d.win.css("display") || (d.visibility = !0, d.rail.visibility = !0, d.rail.css("display", "block")), d }, this.showRailHr = function () { return d.railh ? (0 == d.page.maxw || !d.ispage && "none" == d.win.css("display") || (d.railh.visibility = !0, d.railh.css("display", "block")), d) : d }, this.hideRail = function () { return d.visibility = !1, d.rail.visibility = !1, d.rail.css("display", "none"), d }, this.hideRailHr = function () { return d.railh ? (d.railh.visibility = !1, d.railh.css("display", "none"), d) : d }, this.show = function () { return d.hidden = !1, d.locked = !1, d.showRail().showRailHr() }, this.hide = function () { return d.hidden = !0, d.locked = !0, d.hideRail().hideRailHr() }, this.toggle = function () { return d.hidden ? d.show() : d.hide() }, this.remove = function () { d.stop(), d.cursortimeout && clearTimeout(d.cursortimeout), d.doZoomOut(), d.unbindAll(), h.isie9 && d.win[0].detachEvent("onpropertychange", d.onAttributeChange), !1 !== d.observer && d.observer.disconnect(), !1 !== d.observerremover && d.observerremover.disconnect(), d.events = null, d.cursor && d.cursor.remove(), d.cursorh && d.cursorh.remove(), d.rail && d.rail.remove(), d.railh && d.railh.remove(), d.zoom && d.zoom.remove(); for (var e = 0; e < d.saved.css.length; e++) { var o = d.saved.css[e]; o[0].css(o[1], void 0 === o[2] ? "" : o[2]) } d.saved = !1, d.me.data("__nicescroll", ""); var t = s.nicescroll; t.each(function (e) { if (this && this.id === d.id) { delete t[e]; for (var o = ++e; o < t.length; o++, e++) t[e] = t[o]; t.length--, t.length && delete t[t.length] } }); for (var r in d) d[r] = null, delete d[r]; d = null }, this.scrollstart = function (e) { return this.onscrollstart = e, d }, this.scrollend = function (e) { return this.onscrollend = e, d }, this.scrollcancel = function (e) { return this.onscrollcancel = e, d }, this.zoomin = function (e) { return this.onzoomin = e, d }, this.zoomout = function (e) { return this.onzoomout = e, d }, this.isScrollable = function (e) { var o = e.target ? e.target : e; if ("OPTION" == o.nodeName) return !0; for (; o && 1 == o.nodeType && !/^BODY|HTML/.test(o.nodeName) ;) { var t = s(o), r = t.css("overflowY") || t.css("overflowX") || t.css("overflow") || ""; if (/scroll|auto/.test(r)) return o.clientHeight != o.scrollHeight; o = !!o.parentNode && o.parentNode } return !1 }, this.getViewport = function (e) { for (var o = !(!e || !e.parentNode) && e.parentNode; o && 1 == o.nodeType && !/^BODY|HTML/.test(o.nodeName) ;) { var t = s(o); if (/fixed|absolute/.test(t.css("position"))) return t; var r = t.css("overflowY") || t.css("overflowX") || t.css("overflow") || ""; if (/scroll|auto/.test(r) && o.clientHeight != o.scrollHeight) return t; if (t.getNiceScroll().length > 0) return t; o = !!o.parentNode && o.parentNode } return !!o && s(o) }, this.triggerScrollEnd = function () { if (d.onscrollend) { var e = d.getScrollLeft(), o = d.getScrollTop(), t = { type: "scrollend", current: { x: e, y: o }, end: { x: e, y: o } }; d.onscrollend.call(d, t) } }, this.onmousewheel = function (e) { if (!d.wheelprevented) { if (d.locked) return d.debounced("checkunlock", d.resize, 250), !0; if (d.rail.drag) return d.cancelEvent(e); if ("auto" == d.opt.oneaxismousemode && 0 != e.deltaX && (d.opt.oneaxismousemode = !1), d.opt.oneaxismousemode && 0 == e.deltaX && !d.rail.scrollable) return !d.railh || !d.railh.scrollable || d.onmousewheelhr(e); var o = +new Date, t = !1; if (d.opt.preservenativescrolling && d.checkarea + 600 < o && (d.nativescrollingarea = d.isScrollable(e), t = !0), d.checkarea = o, d.nativescrollingarea) return !0; var r = S(e, !1, t); return r && (d.checkarea = 0), r } }, this.onmousewheelhr = function (e) { if (!d.wheelprevented) { if (d.locked || !d.railh.scrollable) return !0; if (d.rail.drag) return d.cancelEvent(e); var o = +new Date, t = !1; return d.opt.preservenativescrolling && d.checkarea + 600 < o && (d.nativescrollingarea = d.isScrollable(e), t = !0), d.checkarea = o, !!d.nativescrollingarea || (d.locked ? d.cancelEvent(e) : S(e, !0, t)) } }, this.stop = function () { return d.cancelScroll(), d.scrollmon && d.scrollmon.stop(), d.cursorfreezed = !1, d.scroll.y = Math.round(d.getScrollTop() * (1 / d.scrollratio.y)), d.noticeCursor(), d }, this.getTransitionSpeed = function (e) { var o = Math.round(10 * d.opt.scrollspeed), t = Math.min(o, Math.round(e / 20 * d.opt.scrollspeed)); return t > 20 ? t : 0 }, d.opt.smoothscroll ? d.ishwscroll && h.hastransition && d.opt.usetransition ? (this.prepareTransition = function (e, o) { var t = o ? e > 20 ? e : 0 : d.getTransitionSpeed(e), r = t ? h.prefixstyle + "transform " + t + "ms ease-out" : ""; return d.lasttransitionstyle && d.lasttransitionstyle == r || (d.lasttransitionstyle = r, d.doc.css(h.transitionstyle, r)), t }, this.doScrollLeft = function (e, o) { var t = d.scrollrunning ? d.newscrolly : d.getScrollTop(); d.doScrollPos(e, t, o) }, this.doScrollTop = function (e, o) { var t = d.scrollrunning ? d.newscrollx : d.getScrollLeft(); d.doScrollPos(t, e, o) }, this.doScrollPos = function (e, o, t) { var r = d.getScrollTop(), i = d.getScrollLeft(); return ((d.newscrolly - r) * (o - r) < 0 || (d.newscrollx - i) * (e - i) < 0) && d.cancelScroll(), 0 == d.opt.bouncescroll && (o < 0 ? o = 0 : o > d.page.maxh && (o = d.page.maxh), e < 0 ? e = 0 : e > d.page.maxw && (e = d.page.maxw)), (!d.scrollrunning || e != d.newscrollx || o != d.newscrolly) && (d.newscrolly = o, d.newscrollx = e, d.newscrollspeed = t || !1, !d.timer && void (d.timer = setTimeout(function () { var t = d.getScrollTop(), r = d.getScrollLeft(), i = {}; i.x = e - r, i.y = o - t, i.px = r, i.py = t; var n = Math.round(Math.sqrt(Math.pow(i.x, 2) + Math.pow(i.y, 2))), s = d.newscrollspeed && d.newscrollspeed > 1 ? d.newscrollspeed : d.getTransitionSpeed(n); if (d.newscrollspeed && d.newscrollspeed <= 1 && (s *= d.newscrollspeed), d.prepareTransition(s, !0), d.timerscroll && d.timerscroll.tm && clearInterval(d.timerscroll.tm), s > 0) { if (!d.scrollrunning && d.onscrollstart) { var l = { type: "scrollstart", current: { x: r, y: t }, request: { x: e, y: o }, end: { x: d.newscrollx, y: d.newscrolly }, speed: s }; d.onscrollstart.call(d, l) } h.transitionend ? d.scrollendtrapped || (d.scrollendtrapped = !0, d.bind(d.doc, h.transitionend, d.onScrollTransitionEnd, !1)) : (d.scrollendtrapped && clearTimeout(d.scrollendtrapped), d.scrollendtrapped = setTimeout(d.onScrollTransitionEnd, s)); var a = t, c = r; d.timerscroll = { bz: new BezierClass(a, d.newscrolly, s, 0, 0, .58, 1), bh: new BezierClass(c, d.newscrollx, s, 0, 0, .58, 1) }, d.cursorfreezed || (d.timerscroll.tm = setInterval(function () { d.showCursor(d.getScrollTop(), d.getScrollLeft()) }, 60)) } d.synched("doScroll-set", function () { d.timer = 0, d.scrollendtrapped && (d.scrollrunning = !0), d.setScrollTop(d.newscrolly), d.setScrollLeft(d.newscrollx), d.scrollendtrapped || d.onScrollTransitionEnd() }) }, 50))) }, this.cancelScroll = function () { if (!d.scrollendtrapped) return !0; var e = d.getScrollTop(), o = d.getScrollLeft(); return d.scrollrunning = !1, h.transitionend || clearTimeout(h.transitionend), d.scrollendtrapped = !1, d._unbind(d.doc, h.transitionend, d.onScrollTransitionEnd), d.prepareTransition(0), d.setScrollTop(e), d.railh && d.setScrollLeft(o), d.timerscroll && d.timerscroll.tm && clearInterval(d.timerscroll.tm), d.timerscroll = !1, d.cursorfreezed = !1, d.showCursor(e, o), d }, this.onScrollTransitionEnd = function () { d.scrollendtrapped && d._unbind(d.doc, h.transitionend, d.onScrollTransitionEnd), d.scrollendtrapped = !1, d.prepareTransition(0), d.timerscroll && d.timerscroll.tm && clearInterval(d.timerscroll.tm), d.timerscroll = !1; var e = d.getScrollTop(), o = d.getScrollLeft(); if (d.setScrollTop(e), d.railh && d.setScrollLeft(o), d.noticeCursor(!1, e, o), d.cursorfreezed = !1, e < 0 ? e = 0 : e > d.page.maxh && (e = d.page.maxh), o < 0 ? o = 0 : o > d.page.maxw && (o = d.page.maxw), e != d.newscrolly || o != d.newscrollx) return d.doScrollPos(o, e, d.opt.snapbackspeed); d.onscrollend && d.scrollrunning && d.triggerScrollEnd(), d.scrollrunning = !1 }) : (this.doScrollLeft = function (e, o) { var t = d.scrollrunning ? d.newscrolly : d.getScrollTop(); d.doScrollPos(e, t, o) }, this.doScrollTop = function (e, o) { var t = d.scrollrunning ? d.newscrollx : d.getScrollLeft(); d.doScrollPos(t, e, o) }, this.doScrollPos = function (e, o, t) { o = void 0 === o || !1 === o ? d.getScrollTop(!0) : o; if (d.timer && d.newscrolly == o && d.newscrollx == e) return !0; d.timer && c(d.timer), d.timer = 0; var r = d.getScrollTop(), i = d.getScrollLeft(); ((d.newscrolly - r) * (o - r) < 0 || (d.newscrollx - i) * (e - i) < 0) && d.cancelScroll(), d.newscrolly = o, d.newscrollx = e, d.bouncescroll && d.rail.visibility || (d.newscrolly < 0 ? d.newscrolly = 0 : d.newscrolly > d.page.maxh && (d.newscrolly = d.page.maxh)), d.bouncescroll && d.railh.visibility || (d.newscrollx < 0 ? d.newscrollx = 0 : d.newscrollx > d.page.maxw && (d.newscrollx = d.page.maxw)), d.dst = {}, d.dst.x = e - i, d.dst.y = o - r, d.dst.px = i, d.dst.py = r; var n = Math.round(Math.sqrt(Math.pow(d.dst.x, 2) + Math.pow(d.dst.y, 2))); d.dst.ax = d.dst.x / n, d.dst.ay = d.dst.y / n; var s = 0, l = n; 0 == d.dst.x ? (s = r, l = o, d.dst.ay = 1, d.dst.py = 0) : 0 == d.dst.y && (s = i, l = e, d.dst.ax = 1, d.dst.px = 0); var u = d.getTransitionSpeed(n); if (t && t <= 1 && (u *= t), d.bzscroll = u > 0 && (d.bzscroll ? d.bzscroll.update(l, u) : new BezierClass(s, l, u, 0, 1, 0, 1)), !d.timer) { (r == d.page.maxh && o >= d.page.maxh || i == d.page.maxw && e >= d.page.maxw) && d.checkContentSize(); var h = 1; if (d.cancelAnimationFrame = !1, d.timer = 1, d.onscrollstart && !d.scrollrunning) { var p = { type: "scrollstart", current: { x: i, y: r }, request: { x: e, y: o }, end: { x: d.newscrollx, y: d.newscrolly }, speed: u }; d.onscrollstart.call(d, p) } !function e() { if (d.cancelAnimationFrame) return !0; if (d.scrollrunning = !0, h = 1 - h) return d.timer = a(e) || 1; var o = 0, t = sy = d.getScrollTop(); d.dst.ay ? (((r = (t = d.bzscroll ? d.dst.py + d.bzscroll.getNow() * d.dst.ay : d.newscrolly) - sy) < 0 && t < d.newscrolly || r > 0 && t > d.newscrolly) && (t = d.newscrolly), d.setScrollTop(t), t == d.newscrolly && (o = 1)) : o = 1; var r, i = sx = d.getScrollLeft(); d.dst.ax ? (((r = (i = d.bzscroll ? d.dst.px + d.bzscroll.getNow() * d.dst.ax : d.newscrollx) - sx) < 0 && i < d.newscrollx || r > 0 && i > d.newscrollx) && (i = d.newscrollx), d.setScrollLeft(i), i == d.newscrollx && (o += 1)) : o += 1; 2 == o ? (d.timer = 0, d.cursorfreezed = !1, d.bzscroll = !1, d.scrollrunning = !1, t < 0 ? t = 0 : t > d.page.maxh && (t = d.page.maxh), i < 0 ? i = 0 : i > d.page.maxw && (i = d.page.maxw), i != d.newscrollx || t != d.newscrolly ? d.doScrollPos(i, t) : d.onscrollend && d.triggerScrollEnd()) : d.timer = a(e) || 1 }(), (r == d.page.maxh && o >= r || i == d.page.maxw && e >= i) && d.checkContentSize(), d.noticeCursor() } }, this.cancelScroll = function () { return d.timer && c(d.timer), d.timer = 0, d.bzscroll = !1, d.scrollrunning = !1, d }) : (this.doScrollLeft = function (e, o) { var t = d.getScrollTop(); d.doScrollPos(e, t, o) }, this.doScrollTop = function (e, o) { var t = d.getScrollLeft(); d.doScrollPos(t, e, o) }, this.doScrollPos = function (e, o, t) { var r = e > d.page.maxw ? d.page.maxw : e; r < 0 && (r = 0); var i = o > d.page.maxh ? d.page.maxh : o; i < 0 && (i = 0), d.synched("scroll", function () { d.setScrollTop(i), d.setScrollLeft(r) }) }, this.cancelScroll = function () { }), this.doScrollBy = function (e, o) { var t = 0; o ? t = Math.floor((d.scroll.y - e) * d.scrollratio.y) : t = (d.timer ? d.newscrolly : d.getScrollTop(!0)) - e; if (d.bouncescroll) { var r = Math.round(d.view.h / 2); t < -r ? t = -r : t > d.page.maxh + r && (t = d.page.maxh + r) } return d.cursorfreezed = !1, py = d.getScrollTop(!0), t < 0 && py <= 0 ? d.noticeCursor() : t > d.page.maxh && py >= d.page.maxh ? (d.checkContentSize(), d.noticeCursor()) : void d.doScrollTop(t) }, this.doScrollLeftBy = function (e, o) { var t = 0; o ? t = Math.floor((d.scroll.x - e) * d.scrollratio.x) : t = (d.timer ? d.newscrollx : d.getScrollLeft(!0)) - e; if (d.bouncescroll) { var r = Math.round(d.view.w / 2); t < -r ? t = -r : t > d.page.maxw + r && (t = d.page.maxw + r) } return d.cursorfreezed = !1, px = d.getScrollLeft(!0), t < 0 && px <= 0 ? d.noticeCursor() : t > d.page.maxw && px >= d.page.maxw ? d.noticeCursor() : void d.doScrollLeft(t) }, this.doScrollTo = function (e, o) { var t = o ? Math.round(e * d.scrollratio.y) : e; t < 0 ? t = 0 : t > d.page.maxh && (t = d.page.maxh), d.cursorfreezed = !1, d.doScrollTop(e) }, this.checkContentSize = function () { var e = d.getContentSize(); e.h == d.page.h && e.w == d.page.w || d.resize(!1, e) }, d.onscroll = function (e) { d.rail.drag || d.cursorfreezed || d.synched("scroll", function () { d.scroll.y = Math.round(d.getScrollTop() * (1 / d.scrollratio.y)), d.railh && (d.scroll.x = Math.round(d.getScrollLeft() * (1 / d.scrollratio.x))), d.noticeCursor() }) }, d.bind(d.docscroll, "scroll", d.onscroll), this.doZoomIn = function (e) { if (!d.zoomactive) { d.zoomactive = !0, d.zoomrestore = { style: {} }; var o = ["position", "top", "left", "zIndex", "backgroundColor", "marginTop", "marginBottom", "marginLeft", "marginRight"], t = d.win[0].style; for (var r in o) { var i = o[r]; d.zoomrestore.style[i] = void 0 !== t[i] ? t[i] : "" } d.zoomrestore.style.width = d.win.css("width"), d.zoomrestore.style.height = d.win.css("height"), d.zoomrestore.padding = { w: d.win.outerWidth() - d.win.width(), h: d.win.outerHeight() - d.win.height() }, h.isios4 && (d.zoomrestore.scrollTop = s(window).scrollTop(), s(window).scrollTop(0)), d.win.css({ position: h.isios4 ? "absolute" : "fixed", top: 0, left: 0, "z-index": n + 100, margin: "0px" }); var l = d.win.css("backgroundColor"); return ("" == l || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(l)) && d.win.css("backgroundColor", "#fff"), d.rail.css({ "z-index": n + 101 }), d.zoom.css({ "z-index": n + 102 }), d.zoom.css("backgroundPosition", "0px -18px"), d.resizeZoom(), d.onzoomin && d.onzoomin.call(d), d.cancelEvent(e) } }, this.doZoomOut = function (e) { if (d.zoomactive) return d.zoomactive = !1, d.win.css("margin", ""), d.win.css(d.zoomrestore.style), h.isios4 && s(window).scrollTop(d.zoomrestore.scrollTop), d.rail.css({ "z-index": d.zindex }), d.zoom.css({ "z-index": d.zindex }), d.zoomrestore = !1, d.zoom.css("backgroundPosition", "0px 0px"), d.onResize(), d.onzoomout && d.onzoomout.call(d), d.cancelEvent(e) }, this.doZoom = function (e) { return d.zoomactive ? d.doZoomOut(e) : d.doZoomIn(e) }, this.resizeZoom = function () { if (d.zoomactive) { var e = d.getScrollTop(); d.win.css({ width: s(window).width() - d.zoomrestore.padding.w + "px", height: s(window).height() - d.zoomrestore.padding.h + "px" }), d.onResize(), d.setScrollTop(Math.min(d.page.maxh, e)) } }, this.init(), s.nicescroll.push(this) }, v = function (e) { var o = this; this.nc = e, this.lastx = 0, this.lasty = 0, this.speedx = 0, this.speedy = 0, this.lasttime = 0, this.steptime = 0, this.snapx = !1, this.snapy = !1, this.demulx = 0, this.demuly = 0, this.lastscrollx = -1, this.lastscrolly = -1, this.chkx = 0, this.chky = 0, this.timer = 0, this.time = function () { return +new Date }, this.reset = function (e, t) { o.stop(); var r = o.time(); o.steptime = 0, o.lasttime = r, o.speedx = 0, o.speedy = 0, o.lastx = e, o.lasty = t, o.lastscrollx = -1, o.lastscrolly = -1 }, this.update = function (e, t) { var r = o.time(); o.steptime = r - o.lasttime, o.lasttime = r; var i = t - o.lasty, n = e - o.lastx, s = o.nc.getScrollTop() + i, l = o.nc.getScrollLeft() + n; o.snapx = l < 0 || l > o.nc.page.maxw, o.snapy = s < 0 || s > o.nc.page.maxh, o.speedx = n, o.speedy = i, o.lastx = e, o.lasty = t }, this.stop = function () { o.nc.unsynched("domomentum2d"), o.timer && clearTimeout(o.timer), o.timer = 0, o.lastscrollx = -1, o.lastscrolly = -1 }, this.doSnapy = function (e, t) { var r = !1; t < 0 ? (t = 0, r = !0) : t > o.nc.page.maxh && (t = o.nc.page.maxh, r = !0), e < 0 ? (e = 0, r = !0) : e > o.nc.page.maxw && (e = o.nc.page.maxw, r = !0), r ? o.nc.doScrollPos(e, t, o.nc.opt.snapbackspeed) : o.nc.triggerScrollEnd() }, this.doMomentum = function (e) { var t = o.time(), r = e ? t + e : o.lasttime, i = o.nc.getScrollLeft(), n = o.nc.getScrollTop(), s = o.nc.page.maxh, l = o.nc.page.maxw; o.speedx = l > 0 ? Math.min(60, o.speedx) : 0, o.speedy = s > 0 ? Math.min(60, o.speedy) : 0; var a = r && t - r <= 60; (n < 0 || n > s || i < 0 || i > l) && (a = !1); var c = !(!o.speedy || !a) && o.speedy, d = !(!o.speedx || !a) && o.speedx; if (c || d) { var u = Math.max(16, o.steptime); if (u > 50) { var h = u / 50; o.speedx *= h, o.speedy *= h, u = 50 } o.demulxy = 0, o.lastscrollx = o.nc.getScrollLeft(), o.chkx = o.lastscrollx, o.lastscrolly = o.nc.getScrollTop(), o.chky = o.lastscrolly; var p = o.lastscrollx, m = o.lastscrolly, f = function () { var e = o.time() - t > 600 ? .04 : .02; o.speedx && (p = Math.floor(o.lastscrollx - o.speedx * (1 - o.demulxy)), o.lastscrollx = p, (p < 0 || p > l) && (e = .1)), o.speedy && (m = Math.floor(o.lastscrolly - o.speedy * (1 - o.demulxy)), o.lastscrolly = m, (m < 0 || m > s) && (e = .1)), o.demulxy = Math.min(1, o.demulxy + e), o.nc.synched("domomentum2d", function () { o.speedx && (o.nc.getScrollLeft() != o.chkx && o.stop(), o.chkx = p, o.nc.setScrollLeft(p)); o.speedy && (o.nc.getScrollTop() != o.chky && o.stop(), o.chky = m, o.nc.setScrollTop(m)); o.timer || (o.nc.hideCursor(), o.doSnapy(p, m)) }), o.demulxy < 1 ? o.timer = setTimeout(f, u) : (o.stop(), o.nc.hideCursor(), o.doSnapy(p, m)) }; f() } else o.doSnapy(o.nc.getScrollLeft(), o.nc.getScrollTop()) } }, b = e.fn.scrollTop; e.cssHooks.pageYOffset = { get: function (e, o, t) { var r = s.data(e, "__nicescroll") || !1; return r && r.ishwscroll ? r.getScrollTop() : b.call(e) }, set: function (e, o) { var t = s.data(e, "__nicescroll") || !1; return t && t.ishwscroll ? t.setScrollTop(parseInt(o)) : b.call(e, o), this } }, e.fn.scrollTop = function (e) { if (void 0 === e) { var o = this[0] && s.data(this[0], "__nicescroll") || !1; return o && o.ishwscroll ? o.getScrollTop() : b.call(this) } return this.each(function () { var o = s.data(this, "__nicescroll") || !1; o && o.ishwscroll ? o.setScrollTop(parseInt(e)) : b.call(s(this), e) }) }; var y = e.fn.scrollLeft; s.cssHooks.pageXOffset = { get: function (e, o, t) { var r = s.data(e, "__nicescroll") || !1; return r && r.ishwscroll ? r.getScrollLeft() : y.call(e) }, set: function (e, o) { var t = s.data(e, "__nicescroll") || !1; return t && t.ishwscroll ? t.setScrollLeft(parseInt(o)) : y.call(e, o), this } }, e.fn.scrollLeft = function (e) { if (void 0 === e) { var o = this[0] && s.data(this[0], "__nicescroll") || !1; return o && o.ishwscroll ? o.getScrollLeft() : y.call(this) } return this.each(function () { var o = s.data(this, "__nicescroll") || !1; o && o.ishwscroll ? o.setScrollLeft(parseInt(e)) : y.call(s(this), e) }) }; var x = function (e) { var o = this; if (this.length = 0, this.name = "nicescrollarray", this.each = function (e) { for (var t = 0, r = 0; t < o.length; t++) e.call(o[t], r++); return o }, this.push = function (e) { o[o.length] = e, o.length++ }, this.eq = function (e) { return o[e] }, e) for (var t = 0; t < e.length; t++) { var r = s.data(e[t], "__nicescroll") || !1; r && (this[this.length] = r, this.length++) } return this }; !function (e, o, t) { for (var r = 0; r < o.length; r++) t(e, o[r]) }(x.prototype, ["show", "hide", "toggle", "onResize", "resize", "remove", "stop", "doScrollPos"], function (e, o) { e[o] = function () { var e = arguments; return this.each(function () { this[o].apply(this, e) }) } }), e.fn.getNiceScroll = function (e) { return void 0 === e ? new x(this) : this[e] && s.data(this[e], "__nicescroll") || !1 }, e.extend(e.expr[":"], { nicescroll: function (e) { return !!s.data(e, "__nicescroll") } }), s.fn.niceScroll = function (e, o) { void 0 === o && ("object" != typeof e || "jquery" in e || (o = e, e = !1)); var t = new x; void 0 === o && (o = {}), e && (o.doc = s(e), o.win = s(this)); var r = !("doc" in o); return r || "win" in o || (o.win = s(this)), this.each(function () { var e = s(this).data("__nicescroll") || !1; e || (o.doc = r ? s(this) : o.doc, e = new w(o, s(this)), s(this).data("__nicescroll", e)), t.push(e) }), 1 == t.length ? t[0] : t }, window.NiceScroll = { getjQuery: function () { return e } }, s.nicescroll || (s.nicescroll = new x, s.nicescroll.options = f) });;!function (t) { t.fn.dropit = function (i) { var e = { init: function (i) { return this.dropit.settings = t.extend({}, this.dropit.defaults, i), this.each(function () { var i = t(this), e = t.fn.dropit.settings; i.on(e.action, e.this, function () { return t(this).hasClass("active-drop") ? (t(this).removeClass("active-drop"), !1) : (e.beforeHide.call(this), t(".active-drop").removeClass("active-drop"), e.afterHide.call(this), e.beforeShow.call(this), t(this).addClass("active-drop"), e.afterShow.call(this), !1) }), t(document).on("click", function () { e.beforeHide.call(this), t(".active-drop").removeClass("active-drop").find(".dropit-submenu").hide(), e.afterHide.call(this) }), e.afterLoad.call(this) }) } }; return e[i] ? e[i].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof i && i ? void t.error('Method "' + i + '" does not exist in dropit plugin!') : e.init.apply(this, arguments) }, t.fn.dropit.defaults = { action: "click", submenuEl: "ul", triggerEl: "a", triggerParentEl: "li", afterLoad: function () { }, beforeShow: function () { }, afterShow: function () { }, beforeHide: function () { }, afterHide: function () { } }, t.fn.dropit.settings = {} }(jQuery);;!function (t) { "function" == typeof define && define.amd ? define(["jquery"], function (i) { return t(i, document, window, navigator) }) : "object" == typeof exports ? t(require("jquery"), document, window, navigator) : t(jQuery, document, window, navigator) }(function (t, i, s, o, e) { "use strict"; var h, r, n = 0, a = (h = o.userAgent, r = /msie\s\d+/i, h.search(r) > 0 && r.exec(h).toString().split(" ")[1] < 9 && (t("html").addClass("lt-ie9"), !0)); Function.prototype.bind || (Function.prototype.bind = function (t) { var i = this, s = [].slice; if ("function" != typeof i) throw new TypeError; var o = s.call(arguments, 1), e = function () { if (this instanceof e) { var h = function () { }; h.prototype = i.prototype; var r = new h, n = i.apply(r, o.concat(s.call(arguments))); return Object(n) === n ? n : r } return i.apply(t, o.concat(s.call(arguments))) }; return e }), Array.prototype.indexOf || (Array.prototype.indexOf = function (t, i) { var s; if (null == this) throw new TypeError('"this" is null or not defined'); var o = Object(this), e = o.length >>> 0; if (0 === e) return -1; var h = +i || 0; if (Math.abs(h) === 1 / 0 && (h = 0), h >= e) return -1; for (s = Math.max(h >= 0 ? h : e - Math.abs(h), 0) ; s < e;) { if (s in o && o[s] === t) return s; s++ } return -1 }); var c = function (o, h, r) { this.VERSION = "2.1.7", this.input = o, this.plugin_count = r, this.current_plugin = 0, this.calc_count = 0, this.update_tm = 0, this.old_from = 0, this.old_to = 0, this.old_min_interval = null, this.raf_id = null, this.dragging = !1, this.force_redraw = !1, this.no_diapason = !1, this.is_key = !1, this.is_update = !1, this.is_start = !0, this.is_finish = !1, this.is_active = !1, this.is_resize = !1, this.is_click = !1, h = h || {}, this.$cache = { win: t(s), body: t(i.body), input: t(o), cont: null, rs: null, min: null, max: null, from: null, to: null, single: null, bar: null, line: null, s_single: null, s_from: null, s_to: null, shad_single: null, shad_from: null, shad_to: null, edge: null, grid: null, grid_labels: [] }, this.coords = { x_gap: 0, x_pointer: 0, w_rs: 0, w_rs_old: 0, w_handle: 0, p_gap: 0, p_gap_left: 0, p_gap_right: 0, p_step: 0, p_pointer: 0, p_handle: 0, p_single_fake: 0, p_single_real: 0, p_from_fake: 0, p_from_real: 0, p_to_fake: 0, p_to_real: 0, p_bar_x: 0, p_bar_w: 0, grid_gap: 0, big_num: 0, big: [], big_w: [], big_p: [], big_x: [] }, this.labels = { w_min: 0, w_max: 0, w_from: 0, w_to: 0, w_single: 0, p_min: 0, p_max: 0, p_from_fake: 0, p_from_left: 0, p_to_fake: 0, p_to_left: 0, p_single_fake: 0, p_single_left: 0 }; var n, a, c, l = this.$cache.input, _ = l.prop("value"); n = { type: "single", min: 10, max: 100, from: null, to: null, step: 1, min_interval: 0, max_interval: 0, drag_interval: !1, values: [], p_values: [], from_fixed: !1, from_min: null, from_max: null, from_shadow: !1, to_fixed: !1, to_min: null, to_max: null, to_shadow: !1, prettify_enabled: !0, prettify_separator: " ", prettify: null, force_edges: !1, keyboard: !1, keyboard_step: 5, grid: !1, grid_margin: !0, grid_num: 4, grid_snap: !1, hide_min_max: !1, hide_from_to: !1, prefix: "", postfix: "", max_postfix: "", decorate_both: !0, values_separator: " — ", input_values_separator: ";", disable: !1, onStart: null, onChange: null, onFinish: null, onUpdate: null }, "INPUT" !== l[0].nodeName && console && console.warn && console.warn("Base element should be <input>!", l[0]), (a = { type: l.data("type"), min: l.data("min"), max: l.data("max"), from: l.data("from"), to: l.data("to"), step: l.data("step"), min_interval: l.data("minInterval"), max_interval: l.data("maxInterval"), drag_interval: l.data("dragInterval"), values: l.data("values"), from_fixed: l.data("fromFixed"), from_min: l.data("fromMin"), from_max: l.data("fromMax"), from_shadow: l.data("fromShadow"), to_fixed: l.data("toFixed"), to_min: l.data("toMin"), to_max: l.data("toMax"), to_shadow: l.data("toShadow"), prettify_enabled: l.data("prettifyEnabled"), prettify_separator: l.data("prettifySeparator"), force_edges: l.data("forceEdges"), keyboard: l.data("keyboard"), keyboard_step: l.data("keyboardStep"), grid: l.data("grid"), grid_margin: l.data("gridMargin"), grid_num: l.data("gridNum"), grid_snap: l.data("gridSnap"), hide_min_max: l.data("hideMinMax"), hide_from_to: l.data("hideFromTo"), prefix: l.data("prefix"), postfix: l.data("postfix"), max_postfix: l.data("maxPostfix"), decorate_both: l.data("decorateBoth"), values_separator: l.data("valuesSeparator"), input_values_separator: l.data("inputValuesSeparator"), disable: l.data("disable") }).values = a.values && a.values.split(","); for (c in a) a.hasOwnProperty(c) && (a[c] !== e && "" !== a[c] || delete a[c]); _ !== e && "" !== _ && ((_ = _.split(a.input_values_separator || h.input_values_separator || ";"))[0] && _[0] == +_[0] && (_[0] = +_[0]), _[1] && _[1] == +_[1] && (_[1] = +_[1]), h && h.values && h.values.length ? (n.from = _[0] && h.values.indexOf(_[0]), n.to = _[1] && h.values.indexOf(_[1])) : (n.from = _[0] && +_[0], n.to = _[1] && +_[1])), t.extend(n, h), t.extend(n, a), this.options = n, this.update_check = {}, this.validate(), this.result = { input: this.$cache.input, slider: null, min: this.options.min, max: this.options.max, from: this.options.from, from_percent: 0, from_value: null, to: this.options.to, to_percent: 0, to_value: null }, this.init() }; c.prototype = { init: function (t) { this.no_diapason = !1, this.coords.p_step = this.convertToPercent(this.options.step, !0), this.target = "base", this.toggleInput(), this.append(), this.setMinMax(), t ? (this.force_redraw = !0, this.calc(!0), this.callOnUpdate()) : (this.force_redraw = !0, this.calc(!0), this.callOnStart()), this.updateScene() }, append: function () { var t = '<span class="irs js-irs-' + this.plugin_count + '"></span>'; this.$cache.input.before(t), this.$cache.input.prop("readonly", !0), this.$cache.cont = this.$cache.input.prev(), this.result.slider = this.$cache.cont, this.$cache.cont.html('<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>'), this.$cache.rs = this.$cache.cont.find(".irs"), this.$cache.min = this.$cache.cont.find(".irs-min"), this.$cache.max = this.$cache.cont.find(".irs-max"), this.$cache.from = this.$cache.cont.find(".irs-from"), this.$cache.to = this.$cache.cont.find(".irs-to"), this.$cache.single = this.$cache.cont.find(".irs-single"), this.$cache.bar = this.$cache.cont.find(".irs-bar"), this.$cache.line = this.$cache.cont.find(".irs-line"), this.$cache.grid = this.$cache.cont.find(".irs-grid"), "single" === this.options.type ? (this.$cache.cont.append('<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>'), this.$cache.edge = this.$cache.cont.find(".irs-bar-edge"), this.$cache.s_single = this.$cache.cont.find(".single"), this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.shad_single = this.$cache.cont.find(".shadow-single")) : (this.$cache.cont.append('<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>'), this.$cache.s_from = this.$cache.cont.find(".from"), this.$cache.s_to = this.$cache.cont.find(".to"), this.$cache.shad_from = this.$cache.cont.find(".shadow-from"), this.$cache.shad_to = this.$cache.cont.find(".shadow-to"), this.setTopHandler()), this.options.hide_from_to && (this.$cache.from[0].style.display = "none", this.$cache.to[0].style.display = "none", this.$cache.single[0].style.display = "none"), this.appendGrid(), this.options.disable ? (this.appendDisableMask(), this.$cache.input[0].disabled = !0) : (this.$cache.cont.removeClass("irs-disabled"), this.$cache.input[0].disabled = !1, this.bindEvents()), this.options.drag_interval && (this.$cache.bar[0].style.cursor = "ew-resize") }, setTopHandler: function () { var t = this.options.min, i = this.options.max, s = this.options.from, o = this.options.to; s > t && o === i ? this.$cache.s_from.addClass("type_last") : o < i && this.$cache.s_to.addClass("type_last") }, changeLevel: function (t) { switch (t) { case "single": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_single_fake); break; case "from": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_from_fake), this.$cache.s_from.addClass("state_hover"), this.$cache.s_from.addClass("type_last"), this.$cache.s_to.removeClass("type_last"); break; case "to": this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_to_fake), this.$cache.s_to.addClass("state_hover"), this.$cache.s_to.addClass("type_last"), this.$cache.s_from.removeClass("type_last"); break; case "both": this.coords.p_gap_left = this.toFixed(this.coords.p_pointer - this.coords.p_from_fake), this.coords.p_gap_right = this.toFixed(this.coords.p_to_fake - this.coords.p_pointer), this.$cache.s_to.removeClass("type_last"), this.$cache.s_from.removeClass("type_last") } }, appendDisableMask: function () { this.$cache.cont.append('<span class="irs-disable-mask"></span>'), this.$cache.cont.addClass("irs-disabled") }, remove: function () { this.$cache.cont.remove(), this.$cache.cont = null, this.$cache.line.off("keydown.irs_" + this.plugin_count), this.$cache.body.off("touchmove.irs_" + this.plugin_count), this.$cache.body.off("mousemove.irs_" + this.plugin_count), this.$cache.win.off("touchend.irs_" + this.plugin_count), this.$cache.win.off("mouseup.irs_" + this.plugin_count), a && (this.$cache.body.off("mouseup.irs_" + this.plugin_count), this.$cache.body.off("mouseleave.irs_" + this.plugin_count)), this.$cache.grid_labels = [], this.coords.big = [], this.coords.big_w = [], this.coords.big_p = [], this.coords.big_x = [], cancelAnimationFrame(this.raf_id) }, bindEvents: function () { this.no_diapason || (this.$cache.body.on("touchmove.irs_" + this.plugin_count, this.pointerMove.bind(this)), this.$cache.body.on("mousemove.irs_" + this.plugin_count, this.pointerMove.bind(this)), this.$cache.win.on("touchend.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.win.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.line.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.line.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.options.drag_interval && "double" === this.options.type ? (this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "both")), this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "both"))) : (this.$cache.bar.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.bar.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))), "single" === this.options.type ? (this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.s_single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single")), this.$cache.edge.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))) : (this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, null)), this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, null)), this.$cache.from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.s_to.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.shad_from.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_to.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.s_from.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from")), this.$cache.to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.s_to.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "to")), this.$cache.shad_from.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click")), this.$cache.shad_to.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"))), this.options.keyboard && this.$cache.line.on("keydown.irs_" + this.plugin_count, this.key.bind(this, "keyboard")), a && (this.$cache.body.on("mouseup.irs_" + this.plugin_count, this.pointerUp.bind(this)), this.$cache.body.on("mouseleave.irs_" + this.plugin_count, this.pointerUp.bind(this)))) }, pointerMove: function (t) { if (this.dragging) { var i = t.pageX || t.originalEvent.touches && t.originalEvent.touches[0].pageX; this.coords.x_pointer = i - this.coords.x_gap, this.calc() } }, pointerUp: function (i) { this.current_plugin === this.plugin_count && this.is_active && (this.is_active = !1, this.$cache.cont.find(".state_hover").removeClass("state_hover"), this.force_redraw = !0, a && t("*").prop("unselectable", !1), this.updateScene(), this.restoreOriginalMinInterval(), (t.contains(this.$cache.cont[0], i.target) || this.dragging) && this.callOnFinish(), this.dragging = !1) }, pointerDown: function (i, s) { s.preventDefault(); var o = s.pageX || s.originalEvent.touches && s.originalEvent.touches[0].pageX; 2 !== s.button && ("both" === i && this.setTempMinInterval(), i || (i = this.target || "from"), this.current_plugin = this.plugin_count, this.target = i, this.is_active = !0, this.dragging = !0, this.coords.x_gap = this.$cache.rs.offset().left, this.coords.x_pointer = o - this.coords.x_gap, this.calcPointerPercent(), this.changeLevel(i), a && t("*").prop("unselectable", !0), this.$cache.line.trigger("focus"), this.updateScene()) }, pointerClick: function (t, i) { i.preventDefault(); var s = i.pageX || i.originalEvent.touches && i.originalEvent.touches[0].pageX; 2 !== i.button && (this.current_plugin = this.plugin_count, this.target = t, this.is_click = !0, this.coords.x_gap = this.$cache.rs.offset().left, this.coords.x_pointer = +(s - this.coords.x_gap).toFixed(), this.force_redraw = !0, this.calc(), this.$cache.line.trigger("focus")) }, key: function (t, i) { if (!(this.current_plugin !== this.plugin_count || i.altKey || i.ctrlKey || i.shiftKey || i.metaKey)) { switch (i.which) { case 83: case 65: case 40: case 37: i.preventDefault(), this.moveByKey(!1); break; case 87: case 68: case 38: case 39: i.preventDefault(), this.moveByKey(!0) } return !0 } }, moveByKey: function (t) { var i = this.coords.p_pointer; t ? i += this.options.keyboard_step : i -= this.options.keyboard_step, this.coords.x_pointer = this.toFixed(this.coords.w_rs / 100 * i), this.is_key = !0, this.calc() }, setMinMax: function () { if (this.options) { if (this.options.hide_min_max) return this.$cache.min[0].style.display = "none", void (this.$cache.max[0].style.display = "none"); this.options.values.length ? (this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])), this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))) : (this.$cache.min.html(this.decorate(this._prettify(this.options.min), this.options.min)), this.$cache.max.html(this.decorate(this._prettify(this.options.max), this.options.max))), this.labels.w_min = this.$cache.min.outerWidth(!1), this.labels.w_max = this.$cache.max.outerWidth(!1) } }, setTempMinInterval: function () { var t = this.result.to - this.result.from; null === this.old_min_interval && (this.old_min_interval = this.options.min_interval), this.options.min_interval = t }, restoreOriginalMinInterval: function () { null !== this.old_min_interval && (this.options.min_interval = this.old_min_interval, this.old_min_interval = null) }, calc: function (t) { if (this.options && (this.calc_count++, (10 === this.calc_count || t) && (this.calc_count = 0, this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.calcHandlePercent()), this.coords.w_rs)) { this.calcPointerPercent(); var i = this.getHandleX(); switch ("both" === this.target && (this.coords.p_gap = 0, i = this.getHandleX()), "click" === this.target && (this.coords.p_gap = this.coords.p_handle / 2, i = this.getHandleX(), this.options.drag_interval ? this.target = "both_one" : this.target = this.chooseHandle(i)), this.target) { case "base": var s = (this.options.max - this.options.min) / 100, o = (this.result.from - this.options.min) / s, e = (this.result.to - this.options.min) / s; this.coords.p_single_real = this.toFixed(o), this.coords.p_from_real = this.toFixed(o), this.coords.p_to_real = this.toFixed(e), this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_single_fake = this.convertToFakePercent(this.coords.p_single_real), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real), this.target = null; break; case "single": if (this.options.from_fixed) break; this.coords.p_single_real = this.convertToRealPercent(i), this.coords.p_single_real = this.calcWithStep(this.coords.p_single_real), this.coords.p_single_real = this.checkDiapason(this.coords.p_single_real, this.options.from_min, this.options.from_max), this.coords.p_single_fake = this.convertToFakePercent(this.coords.p_single_real); break; case "from": if (this.options.from_fixed) break; this.coords.p_from_real = this.convertToRealPercent(i), this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real), this.coords.p_from_real > this.coords.p_to_real && (this.coords.p_from_real = this.coords.p_to_real), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_real = this.checkMaxInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real); break; case "to": if (this.options.to_fixed) break; this.coords.p_to_real = this.convertToRealPercent(i), this.coords.p_to_real = this.calcWithStep(this.coords.p_to_real), this.coords.p_to_real < this.coords.p_from_real && (this.coords.p_to_real = this.coords.p_from_real), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_real = this.checkMaxInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real); break; case "both": if (this.options.from_fixed || this.options.to_fixed) break; i = this.toFixed(i + .001 * this.coords.p_handle), this.coords.p_from_real = this.convertToRealPercent(i) - this.coords.p_gap_left, this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_real = this.checkMinInterval(this.coords.p_from_real, this.coords.p_to_real, "from"), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_real = this.convertToRealPercent(i) + this.coords.p_gap_right, this.coords.p_to_real = this.calcWithStep(this.coords.p_to_real), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_real = this.checkMinInterval(this.coords.p_to_real, this.coords.p_from_real, "to"), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real); break; case "both_one": if (this.options.from_fixed || this.options.to_fixed) break; var h = this.convertToRealPercent(i), r = this.result.from_percent, n = this.result.to_percent - r, a = n / 2, c = h - a, l = h + a; c < 0 && (l = (c = 0) + n), l > 100 && (c = (l = 100) - n), this.coords.p_from_real = this.calcWithStep(c), this.coords.p_from_real = this.checkDiapason(this.coords.p_from_real, this.options.from_min, this.options.from_max), this.coords.p_from_fake = this.convertToFakePercent(this.coords.p_from_real), this.coords.p_to_real = this.calcWithStep(l), this.coords.p_to_real = this.checkDiapason(this.coords.p_to_real, this.options.to_min, this.options.to_max), this.coords.p_to_fake = this.convertToFakePercent(this.coords.p_to_real) } "single" === this.options.type ? (this.coords.p_bar_x = this.coords.p_handle / 2, this.coords.p_bar_w = this.coords.p_single_fake, this.result.from_percent = this.coords.p_single_real, this.result.from = this.convertToValue(this.coords.p_single_real), this.options.values.length && (this.result.from_value = this.options.values[this.result.from])) : (this.coords.p_bar_x = this.toFixed(this.coords.p_from_fake + this.coords.p_handle / 2), this.coords.p_bar_w = this.toFixed(this.coords.p_to_fake - this.coords.p_from_fake), this.result.from_percent = this.coords.p_from_real, this.result.from = this.convertToValue(this.coords.p_from_real), this.result.to_percent = this.coords.p_to_real, this.result.to = this.convertToValue(this.coords.p_to_real), this.options.values.length && (this.result.from_value = this.options.values[this.result.from], this.result.to_value = this.options.values[this.result.to])), this.calcMinMax(), this.calcLabels() } }, calcPointerPercent: function () { this.coords.w_rs ? (this.coords.x_pointer < 0 || isNaN(this.coords.x_pointer) ? this.coords.x_pointer = 0 : this.coords.x_pointer > this.coords.w_rs && (this.coords.x_pointer = this.coords.w_rs), this.coords.p_pointer = this.toFixed(this.coords.x_pointer / this.coords.w_rs * 100)) : this.coords.p_pointer = 0 }, convertToRealPercent: function (t) { return t / (100 - this.coords.p_handle) * 100 }, convertToFakePercent: function (t) { return t / 100 * (100 - this.coords.p_handle) }, getHandleX: function () { var t = 100 - this.coords.p_handle, i = this.toFixed(this.coords.p_pointer - this.coords.p_gap); return i < 0 ? i = 0 : i > t && (i = t), i }, calcHandlePercent: function () { "single" === this.options.type ? this.coords.w_handle = this.$cache.s_single.outerWidth(!1) : this.coords.w_handle = this.$cache.s_from.outerWidth(!1), this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100) }, chooseHandle: function (t) { return "single" === this.options.type ? "single" : t >= this.coords.p_from_real + (this.coords.p_to_real - this.coords.p_from_real) / 2 ? this.options.to_fixed ? "from" : "to" : this.options.from_fixed ? "to" : "from" }, calcMinMax: function () { this.coords.w_rs && (this.labels.p_min = this.labels.w_min / this.coords.w_rs * 100, this.labels.p_max = this.labels.w_max / this.coords.w_rs * 100) }, calcLabels: function () { this.coords.w_rs && !this.options.hide_from_to && ("single" === this.options.type ? (this.labels.w_single = this.$cache.single.outerWidth(!1), this.labels.p_single_fake = this.labels.w_single / this.coords.w_rs * 100, this.labels.p_single_left = this.coords.p_single_fake + this.coords.p_handle / 2 - this.labels.p_single_fake / 2, this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single_fake)) : (this.labels.w_from = this.$cache.from.outerWidth(!1), this.labels.p_from_fake = this.labels.w_from / this.coords.w_rs * 100, this.labels.p_from_left = this.coords.p_from_fake + this.coords.p_handle / 2 - this.labels.p_from_fake / 2, this.labels.p_from_left = this.toFixed(this.labels.p_from_left), this.labels.p_from_left = this.checkEdges(this.labels.p_from_left, this.labels.p_from_fake), this.labels.w_to = this.$cache.to.outerWidth(!1), this.labels.p_to_fake = this.labels.w_to / this.coords.w_rs * 100, this.labels.p_to_left = this.coords.p_to_fake + this.coords.p_handle / 2 - this.labels.p_to_fake / 2, this.labels.p_to_left = this.toFixed(this.labels.p_to_left), this.labels.p_to_left = this.checkEdges(this.labels.p_to_left, this.labels.p_to_fake), this.labels.w_single = this.$cache.single.outerWidth(!1), this.labels.p_single_fake = this.labels.w_single / this.coords.w_rs * 100, this.labels.p_single_left = (this.labels.p_from_left + this.labels.p_to_left + this.labels.p_to_fake) / 2 - this.labels.p_single_fake / 2, this.labels.p_single_left = this.toFixed(this.labels.p_single_left), this.labels.p_single_left = this.checkEdges(this.labels.p_single_left, this.labels.p_single_fake))) }, updateScene: function () { this.raf_id && (cancelAnimationFrame(this.raf_id), this.raf_id = null), clearTimeout(this.update_tm), this.update_tm = null, this.options && (this.drawHandles(), this.is_active ? this.raf_id = requestAnimationFrame(this.updateScene.bind(this)) : this.update_tm = setTimeout(this.updateScene.bind(this), 300)) }, drawHandles: function () { this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.coords.w_rs && (this.coords.w_rs !== this.coords.w_rs_old && (this.target = "base", this.is_resize = !0), (this.coords.w_rs !== this.coords.w_rs_old || this.force_redraw) && (this.setMinMax(), this.calc(!0), this.drawLabels(), this.options.grid && (this.calcGridMargin(), this.calcGridLabels()), this.force_redraw = !0, this.coords.w_rs_old = this.coords.w_rs, this.drawShadow()), this.coords.w_rs && (this.dragging || this.force_redraw || this.is_key) && ((this.old_from !== this.result.from || this.old_to !== this.result.to || this.force_redraw || this.is_key) && (this.drawLabels(), this.$cache.bar[0].style.left = this.coords.p_bar_x + "%", this.$cache.bar[0].style.width = this.coords.p_bar_w + "%", "single" === this.options.type ? (this.$cache.s_single[0].style.left = this.coords.p_single_fake + "%", this.$cache.single[0].style.left = this.labels.p_single_left + "%") : (this.$cache.s_from[0].style.left = this.coords.p_from_fake + "%", this.$cache.s_to[0].style.left = this.coords.p_to_fake + "%", (this.old_from !== this.result.from || this.force_redraw) && (this.$cache.from[0].style.left = this.labels.p_from_left + "%"), (this.old_to !== this.result.to || this.force_redraw) && (this.$cache.to[0].style.left = this.labels.p_to_left + "%"), this.$cache.single[0].style.left = this.labels.p_single_left + "%"), this.writeToInput(), this.old_from === this.result.from && this.old_to === this.result.to || this.is_start || (this.$cache.input.trigger("change"), this.$cache.input.trigger("input")), this.old_from = this.result.from, this.old_to = this.result.to, this.is_resize || this.is_update || this.is_start || this.is_finish || this.callOnChange(), (this.is_key || this.is_click) && (this.is_key = !1, this.is_click = !1, this.callOnFinish()), this.is_update = !1, this.is_resize = !1, this.is_finish = !1), this.is_start = !1, this.is_key = !1, this.is_click = !1, this.force_redraw = !1)) }, drawLabels: function () { if (this.options) { var t, i, s, o = this.options.values.length, e = this.options.p_values; if (!this.options.hide_from_to) if ("single" === this.options.type) o ? (t = this.decorate(e[this.result.from]), this.$cache.single.html(t)) : (t = this.decorate(this._prettify(this.result.from), this.result.from), this.$cache.single.html(t)), this.calcLabels(), this.labels.p_single_left < this.labels.p_min + 1 ? this.$cache.min[0].style.visibility = "hidden" : this.$cache.min[0].style.visibility = "visible", this.labels.p_single_left + this.labels.p_single_fake > 100 - this.labels.p_max - 1 ? this.$cache.max[0].style.visibility = "hidden" : this.$cache.max[0].style.visibility = "visible"; else { o ? (this.options.decorate_both ? (t = this.decorate(e[this.result.from]), t += this.options.values_separator, t += this.decorate(e[this.result.to])) : t = this.decorate(e[this.result.from] + this.options.values_separator + e[this.result.to]), i = this.decorate(e[this.result.from]), s = this.decorate(e[this.result.to]), this.$cache.single.html(t), this.$cache.from.html(i), this.$cache.to.html(s)) : (this.options.decorate_both ? (t = this.decorate(this._prettify(this.result.from), this.result.from), t += this.options.values_separator, t += this.decorate(this._prettify(this.result.to), this.result.to)) : t = this.decorate(this._prettify(this.result.from) + this.options.values_separator + this._prettify(this.result.to), this.result.to), i = this.decorate(this._prettify(this.result.from), this.result.from), s = this.decorate(this._prettify(this.result.to), this.result.to), this.$cache.single.html(t), this.$cache.from.html(i), this.$cache.to.html(s)), this.calcLabels(); var h = Math.min(this.labels.p_single_left, this.labels.p_from_left), r = this.labels.p_single_left + this.labels.p_single_fake, n = this.labels.p_to_left + this.labels.p_to_fake, a = Math.max(r, n); this.labels.p_from_left + this.labels.p_from_fake >= this.labels.p_to_left ? (this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.single[0].style.visibility = "visible", this.result.from === this.result.to ? ("from" === this.target ? this.$cache.from[0].style.visibility = "visible" : "to" === this.target ? this.$cache.to[0].style.visibility = "visible" : this.target || (this.$cache.from[0].style.visibility = "visible"), this.$cache.single[0].style.visibility = "hidden", a = n) : (this.$cache.from[0].style.visibility = "hidden", this.$cache.to[0].style.visibility = "hidden", this.$cache.single[0].style.visibility = "visible", a = Math.max(r, n))) : (this.$cache.from[0].style.visibility = "visible", this.$cache.to[0].style.visibility = "visible", this.$cache.single[0].style.visibility = "hidden"), h < this.labels.p_min + 1 ? this.$cache.min[0].style.visibility = "hidden" : this.$cache.min[0].style.visibility = "visible", a > 100 - this.labels.p_max - 1 ? this.$cache.max[0].style.visibility = "hidden" : this.$cache.max[0].style.visibility = "visible" } } }, drawShadow: function () { var t, i, s, o, e = this.options, h = this.$cache, r = "number" == typeof e.from_min && !isNaN(e.from_min), n = "number" == typeof e.from_max && !isNaN(e.from_max), a = "number" == typeof e.to_min && !isNaN(e.to_min), c = "number" == typeof e.to_max && !isNaN(e.to_max); "single" === e.type ? e.from_shadow && (r || n) ? (t = this.convertToPercent(r ? e.from_min : e.min), i = this.convertToPercent(n ? e.from_max : e.max) - t, t = this.toFixed(t - this.coords.p_handle / 100 * t), i = this.toFixed(i - this.coords.p_handle / 100 * i), t += this.coords.p_handle / 2, h.shad_single[0].style.display = "block", h.shad_single[0].style.left = t + "%", h.shad_single[0].style.width = i + "%") : h.shad_single[0].style.display = "none" : (e.from_shadow && (r || n) ? (t = this.convertToPercent(r ? e.from_min : e.min), i = this.convertToPercent(n ? e.from_max : e.max) - t, t = this.toFixed(t - this.coords.p_handle / 100 * t), i = this.toFixed(i - this.coords.p_handle / 100 * i), t += this.coords.p_handle / 2, h.shad_from[0].style.display = "block", h.shad_from[0].style.left = t + "%", h.shad_from[0].style.width = i + "%") : h.shad_from[0].style.display = "none", e.to_shadow && (a || c) ? (s = this.convertToPercent(a ? e.to_min : e.min), o = this.convertToPercent(c ? e.to_max : e.max) - s, s = this.toFixed(s - this.coords.p_handle / 100 * s), o = this.toFixed(o - this.coords.p_handle / 100 * o), s += this.coords.p_handle / 2, h.shad_to[0].style.display = "block", h.shad_to[0].style.left = s + "%", h.shad_to[0].style.width = o + "%") : h.shad_to[0].style.display = "none") }, writeToInput: function () { "single" === this.options.type ? (this.options.values.length ? this.$cache.input.prop("value", this.result.from_value) : this.$cache.input.prop("value", this.result.from), this.$cache.input.data("from", this.result.from)) : (this.options.values.length ? this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value) : this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to), this.$cache.input.data("from", this.result.from), this.$cache.input.data("to", this.result.to)) }, callOnStart: function () { this.writeToInput(), this.options.onStart && "function" == typeof this.options.onStart && this.options.onStart(this.result) }, callOnChange: function () { this.writeToInput(), this.options.onChange && "function" == typeof this.options.onChange && this.options.onChange(this.result) }, callOnFinish: function () { this.writeToInput(), this.options.onFinish && "function" == typeof this.options.onFinish && this.options.onFinish(this.result) }, callOnUpdate: function () { this.writeToInput(), this.options.onUpdate && "function" == typeof this.options.onUpdate && this.options.onUpdate(this.result) }, toggleInput: function () { this.$cache.input.toggleClass("irs-hidden-input") }, convertToPercent: function (t, i) { var s, o = this.options.max - this.options.min, e = o / 100; return o ? (s = (i ? t : t - this.options.min) / e, this.toFixed(s)) : (this.no_diapason = !0, 0) }, convertToValue: function (t) { var i, s, o = this.options.min, e = this.options.max, h = o.toString().split(".")[1], r = e.toString().split(".")[1], n = 0, a = 0; if (0 === t) return this.options.min; if (100 === t) return this.options.max; h && (n = i = h.length), r && (n = s = r.length), i && s && (n = i >= s ? i : s), o < 0 && (o = +(o + (a = Math.abs(o))).toFixed(n), e = +(e + a).toFixed(n)); var c, l = (e - o) / 100 * t + o, _ = this.options.step.toString().split(".")[1]; return _ ? l = +l.toFixed(_.length) : (l /= this.options.step, l = +(l *= this.options.step).toFixed(0)), a && (l -= a), (c = _ ? +l.toFixed(_.length) : this.toFixed(l)) < this.options.min ? c = this.options.min : c > this.options.max && (c = this.options.max), c }, calcWithStep: function (t) { var i = Math.round(t / this.coords.p_step) * this.coords.p_step; return i > 100 && (i = 100), 100 === t && (i = 100), this.toFixed(i) }, checkMinInterval: function (t, i, s) { var o, e, h = this.options; return h.min_interval ? (o = this.convertToValue(t), e = this.convertToValue(i), "from" === s ? e - o < h.min_interval && (o = e - h.min_interval) : o - e < h.min_interval && (o = e + h.min_interval), this.convertToPercent(o)) : t }, checkMaxInterval: function (t, i, s) { var o, e, h = this.options; return h.max_interval ? (o = this.convertToValue(t), e = this.convertToValue(i), "from" === s ? e - o > h.max_interval && (o = e - h.max_interval) : o - e > h.max_interval && (o = e + h.max_interval), this.convertToPercent(o)) : t }, checkDiapason: function (t, i, s) { var o = this.convertToValue(t), e = this.options; return "number" != typeof i && (i = e.min), "number" != typeof s && (s = e.max), o < i && (o = i), o > s && (o = s), this.convertToPercent(o) }, toFixed: function (t) { return +(t = t.toFixed(20)) }, _prettify: function (t) { return this.options.prettify_enabled ? this.options.prettify && "function" == typeof this.options.prettify ? this.options.prettify(t) : this.prettify(t) : t }, prettify: function (t) { return t.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g, "$1" + this.options.prettify_separator) }, checkEdges: function (t, i) { return this.options.force_edges ? (t < 0 ? t = 0 : t > 100 - i && (t = 100 - i), this.toFixed(t)) : this.toFixed(t) }, validate: function () { var t, i, s = this.options, o = this.result, e = s.values, h = e.length; if ("string" == typeof s.min && (s.min = +s.min), "string" == typeof s.max && (s.max = +s.max), "string" == typeof s.from && (s.from = +s.from), "string" == typeof s.to && (s.to = +s.to), "string" == typeof s.step && (s.step = +s.step), "string" == typeof s.from_min && (s.from_min = +s.from_min), "string" == typeof s.from_max && (s.from_max = +s.from_max), "string" == typeof s.to_min && (s.to_min = +s.to_min), "string" == typeof s.to_max && (s.to_max = +s.to_max), "string" == typeof s.keyboard_step && (s.keyboard_step = +s.keyboard_step), "string" == typeof s.grid_num && (s.grid_num = +s.grid_num), s.max < s.min && (s.max = s.min), h) for (s.p_values = [], s.min = 0, s.max = h - 1, s.step = 1, s.grid_num = s.max, s.grid_snap = !0, i = 0; i < h; i++) t = +e[i], isNaN(t) ? t = e[i] : (e[i] = t, t = this._prettify(t)), s.p_values.push(t); ("number" != typeof s.from || isNaN(s.from)) && (s.from = s.min), ("number" != typeof s.to || isNaN(s.to)) && (s.to = s.max), "single" === s.type ? (s.from < s.min && (s.from = s.min), s.from > s.max && (s.from = s.max)) : (s.from < s.min && (s.from = s.min), s.from > s.max && (s.from = s.max), s.to < s.min && (s.to = s.min), s.to > s.max && (s.to = s.max), this.update_check.from && (this.update_check.from !== s.from && s.from > s.to && (s.from = s.to), this.update_check.to !== s.to && s.to < s.from && (s.to = s.from)), s.from > s.to && (s.from = s.to), s.to < s.from && (s.to = s.from)), ("number" != typeof s.step || isNaN(s.step) || !s.step || s.step < 0) && (s.step = 1), ("number" != typeof s.keyboard_step || isNaN(s.keyboard_step) || !s.keyboard_step || s.keyboard_step < 0) && (s.keyboard_step = 5), "number" == typeof s.from_min && s.from < s.from_min && (s.from = s.from_min), "number" == typeof s.from_max && s.from > s.from_max && (s.from = s.from_max), "number" == typeof s.to_min && s.to < s.to_min && (s.to = s.to_min), "number" == typeof s.to_max && s.from > s.to_max && (s.to = s.to_max), o && (o.min !== s.min && (o.min = s.min), o.max !== s.max && (o.max = s.max), (o.from < o.min || o.from > o.max) && (o.from = s.from), (o.to < o.min || o.to > o.max) && (o.to = s.to)), ("number" != typeof s.min_interval || isNaN(s.min_interval) || !s.min_interval || s.min_interval < 0) && (s.min_interval = 0), ("number" != typeof s.max_interval || isNaN(s.max_interval) || !s.max_interval || s.max_interval < 0) && (s.max_interval = 0), s.min_interval && s.min_interval > s.max - s.min && (s.min_interval = s.max - s.min), s.max_interval && s.max_interval > s.max - s.min && (s.max_interval = s.max - s.min) }, decorate: function (t, i) { var s = "", o = this.options; return o.prefix && (s += o.prefix), s += t, o.max_postfix && (o.values.length && t === o.p_values[o.max] ? (s += o.max_postfix, o.postfix && (s += " ")) : i === o.max && (s += o.max_postfix, o.postfix && (s += " "))), o.postfix && (s += o.postfix), s }, updateFrom: function () { this.result.from = this.options.from, this.result.from_percent = this.convertToPercent(this.result.from), this.options.values && (this.result.from_value = this.options.values[this.result.from]) }, updateTo: function () { this.result.to = this.options.to, this.result.to_percent = this.convertToPercent(this.result.to), this.options.values && (this.result.to_value = this.options.values[this.result.to]) }, updateResult: function () { this.result.min = this.options.min, this.result.max = this.options.max, this.updateFrom(), this.updateTo() }, appendGrid: function () { if (this.options.grid) { var t, i, s, o, e, h = this.options, r = h.max - h.min, n = h.grid_num, a = 0, c = 0, l = 4, _ = ""; for (this.calcGridMargin(), h.grid_snap ? r > 50 ? (n = 50 / h.step, a = this.toFixed(h.step / .5)) : (n = r / h.step, a = this.toFixed(h.step / (r / 100))) : a = this.toFixed(100 / n), n > 4 && (l = 3), n > 7 && (l = 2), n > 14 && (l = 1), n > 28 && (l = 0), t = 0; t < n + 1; t++) { for (s = l, (c = this.toFixed(a * t)) > 100 && (c = 100, (s -= 2) < 0 && (s = 0)), this.coords.big[t] = c, o = (c - a * (t - 1)) / (s + 1), i = 1; i <= s && 0 !== c; i++) _ += '<span class="irs-grid-pol small" style="left: ' + this.toFixed(c - o * i) + '%"></span>'; _ += '<span class="irs-grid-pol" style="left: ' + c + '%"></span>', e = this.convertToValue(c), _ += '<span class="irs-grid-text js-grid-text-' + t + '" style="left: ' + c + '%">' + (e = h.values.length ? h.p_values[e] : this._prettify(e)) + "</span>" } this.coords.big_num = Math.ceil(n + 1), this.$cache.cont.addClass("irs-with-grid"), this.$cache.grid.html(_), this.cacheGridLabels() } }, cacheGridLabels: function () { var t, i, s = this.coords.big_num; for (i = 0; i < s; i++) t = this.$cache.grid.find(".js-grid-text-" + i), this.$cache.grid_labels.push(t); this.calcGridLabels() }, calcGridLabels: function () { var t, i, s = [], o = [], e = this.coords.big_num; for (t = 0; t < e; t++) this.coords.big_w[t] = this.$cache.grid_labels[t].outerWidth(!1), this.coords.big_p[t] = this.toFixed(this.coords.big_w[t] / this.coords.w_rs * 100), this.coords.big_x[t] = this.toFixed(this.coords.big_p[t] / 2), s[t] = this.toFixed(this.coords.big[t] - this.coords.big_x[t]), o[t] = this.toFixed(s[t] + this.coords.big_p[t]); for (this.options.force_edges && (s[0] < -this.coords.grid_gap && (s[0] = -this.coords.grid_gap, o[0] = this.toFixed(s[0] + this.coords.big_p[0]), this.coords.big_x[0] = this.coords.grid_gap), o[e - 1] > 100 + this.coords.grid_gap && (o[e - 1] = 100 + this.coords.grid_gap, s[e - 1] = this.toFixed(o[e - 1] - this.coords.big_p[e - 1]), this.coords.big_x[e - 1] = this.toFixed(this.coords.big_p[e - 1] - this.coords.grid_gap))), this.calcGridCollision(2, s, o), this.calcGridCollision(4, s, o), t = 0; t < e; t++) i = this.$cache.grid_labels[t][0], this.coords.big_x[t] !== Number.POSITIVE_INFINITY && (i.style.marginLeft = -this.coords.big_x[t] + "%") }, calcGridCollision: function (t, i, s) { var o, e, h, r = this.coords.big_num; for (o = 0; o < r && !((e = o + t / 2) >= r) ; o += t) h = this.$cache.grid_labels[e][0], s[o] <= i[e] ? h.style.visibility = "visible" : h.style.visibility = "hidden" }, calcGridMargin: function () { this.options.grid_margin && (this.coords.w_rs = this.$cache.rs.outerWidth(!1), this.coords.w_rs && ("single" === this.options.type ? this.coords.w_handle = this.$cache.s_single.outerWidth(!1) : this.coords.w_handle = this.$cache.s_from.outerWidth(!1), this.coords.p_handle = this.toFixed(this.coords.w_handle / this.coords.w_rs * 100), this.coords.grid_gap = this.toFixed(this.coords.p_handle / 2 - .1), this.$cache.grid[0].style.width = this.toFixed(100 - this.coords.p_handle) + "%", this.$cache.grid[0].style.left = this.coords.grid_gap + "%")) }, update: function (i) { this.input && (this.is_update = !0, this.options.from = this.result.from, this.options.to = this.result.to, this.update_check.from = this.result.from, this.update_check.to = this.result.to, this.options = t.extend(this.options, i), this.validate(), this.updateResult(i), this.toggleInput(), this.remove(), this.init(!0)) }, reset: function () { this.input && (this.updateResult(), this.update()) }, destroy: function () { this.input && (this.toggleInput(), this.$cache.input.prop("readonly", !1), t.data(this.input, "ionRangeSlider", null), this.remove(), this.input = null, this.options = null) } }, t.fn.ionRangeSlider = function (i) { return this.each(function () { t.data(this, "ionRangeSlider") || t.data(this, "ionRangeSlider", new c(this, i, n++)) }) }, function () { for (var t = 0, i = ["ms", "moz", "webkit", "o"], o = 0; o < i.length && !s.requestAnimationFrame; ++o) s.requestAnimationFrame = s[i[o] + "RequestAnimationFrame"], s.cancelAnimationFrame = s[i[o] + "CancelAnimationFrame"] || s[i[o] + "CancelRequestAnimationFrame"]; s.requestAnimationFrame || (s.requestAnimationFrame = function (i, o) { var e = (new Date).getTime(), h = Math.max(0, 16 - (e - t)), r = s.setTimeout(function () { i(e + h) }, h); return t = e + h, r }), s.cancelAnimationFrame || (s.cancelAnimationFrame = function (t) { clearTimeout(t) }) }() });;!function (e) { var t = "iCheck", i = t + "-helper", a = "checkbox", r = "radio", n = "checked", o = "un" + n, s = "disabled"; function d(e, t, i) { var a = e[0], o = /er/.test(i) ? _indeterminate : /bl/.test(i) ? s : n, d = i == _update ? { checked: a[n], disabled: a[s], indeterminate: "true" == e.attr(_indeterminate) || "false" == e.attr(_determinate) } : a[o]; if (/^(ch|di|in)/.test(i) && !d) c(e, o); else if (/^(un|en|de)/.test(i) && d) l(e, o); else if (i == _update) for (var u in d) d[u] ? c(e, u, !0) : l(e, u, !0); else t && "toggle" != i || (t || e[_callback]("ifClicked"), d ? a[_type] !== r && l(e, o) : c(e, o)) } function c(a, d, c) { var u = a[0], h = a.parent(), b = d == n, m = d == _indeterminate, v = d == s, y = m ? _determinate : b ? o : "enabled", k = _(a, y + p(u[_type])), g = _(a, d + p(u[_type])); if (!0 !== u[d]) { if (!c && d == n && u[_type] == r && u.name) { var C = a.closest("form"), w = 'input[name="' + u.name + '"]'; (w = C.length ? C.find(w) : e(w)).each(function () { this !== u && e(this).data(t) && l(e(this), d) }) } m ? (u[d] = !0, u[n] && l(a, n, "force")) : (c || (u[d] = !0), b && u[_indeterminate] && l(a, _indeterminate, !1)), f(a, b, d, c) } u[s] && _(a, _cursor, !0) && h.find("." + i).css(_cursor, "default"), h[_add](g || _(a, d) || ""), h.attr("role") && !m && h.attr("aria-" + (v ? s : n), "true"), h[_remove](k || _(a, y) || "") } function l(e, t, a) { var r = e[0], d = e.parent(), c = t == n, l = t == _indeterminate, u = t == s, h = l ? _determinate : c ? o : "enabled", b = _(e, h + p(r[_type])), m = _(e, t + p(r[_type])); !1 !== r[t] && (!l && a && "force" != a || (r[t] = !1), f(e, c, h, a)), !r[s] && _(e, _cursor, !0) && d.find("." + i).css(_cursor, "pointer"), d[_remove](m || _(e, t) || ""), d.attr("role") && !l && d.attr("aria-" + (u ? s : n), "false"), d[_add](b || _(e, h) || "") } function u(i, a) { i.data(t) && (i.parent().html(i.attr("style", i.data(t).s || "")), a && i[_callback](a), i.off(".i").unwrap(), e(_label + '[for="' + i[0].id + '"]').add(i.closest(_label)).off(".i")) } function _(e, i, a) { if (e.data(t)) return e.data(t).o[i + (a ? "" : "Class")] } function p(e) { return e.charAt(0).toUpperCase() + e.slice(1) } function f(e, t, i, a) { a || (t && e[_callback]("ifToggled"), e[_callback]("ifChanged")[_callback]("if" + p(i))) } _determinate = "determinate", _indeterminate = "in" + _determinate, _update = "update", _type = "type", _click = "click", _touch = "touchbegin.i touchend.i", _add = "addClass", _remove = "removeClass", _callback = "trigger", _label = "label", _cursor = "cursor", _mobile = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent), e.fn[t] = function (o, _) { var p = 'input[type="' + a + '"], input[type="' + r + '"]', f = e(), h = function (t) { t.each(function () { var t = e(this); f = t.is(p) ? f.add(t) : f.add(t.find(p)) }) }; if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(o)) return o = o.toLowerCase(), h(this), f.each(function () { var t = e(this); "destroy" == o ? u(t, "ifDestroyed") : d(t, !0, o), e.isFunction(_) && _() }); if ("object" != typeof o && o) return this; var b = e.extend({ checkedClass: n, disabledClass: s, indeterminateClass: _indeterminate, labelHover: !0 }, o), m = b.handle, v = b.hoverClass || "hover", y = b.focusClass || "focus", k = b.activeClass || "active", g = !!b.labelHover, C = b.labelHoverClass || "hover", w = 0 | ("" + b.increaseArea).replace("%", ""); return m != a && m != r || (p = 'input[type="' + m + '"]'), w < -50 && (w = -50), h(this), f.each(function () { var o = e(this); u(o); var _, p = this, f = p.id, h = -w + "%", m = 100 + 2 * w + "%", x = { position: "absolute", top: h, left: h, display: "block", width: m, height: m, margin: 0, padding: 0, background: "#fff", border: 0, opacity: 0 }, A = _mobile ? { position: "absolute", visibility: "hidden" } : w ? x : { position: "absolute", opacity: 0 }, H = p[_type] == a ? b.checkboxClass || "i" + a : b.radioClass || "i" + r, j = e(_label + '[for="' + f + '"]').add(o.closest(_label)), D = !!b.aria, P = t + "-" + Math.random().toString(36).substr(2, 6), T = '<div class="' + H + '" ' + (D ? 'role="' + p[_type] + '" ' : ""); D && j.each(function () { T += 'aria-labelledby="', this.id ? T += this.id : (this.id = P, T += P), T += '"' }), T = o.wrap(T + "/>")[_callback]("ifCreated").parent().append(b.insert), _ = e('<ins class="' + i + '"/>').css(x).appendTo(T), o.data(t, { o: b, s: o.attr("style") }).css(A), b.inheritClass && T[_add](p.className || ""), b.inheritID && f && T.attr("id", t + "-" + f), "static" == T.css("position") && T.css("position", "relative"), d(o, !0, _update), j.length && j.on(_click + ".i mouseover.i mouseout.i " + _touch, function (t) { var i = t[_type], a = e(this); if (!p[s]) { if (i == _click) { if (e(t.target).is("a")) return; d(o, !1, !0) } else g && (/ut|nd/.test(i) ? (T[_remove](v), a[_remove](C)) : (T[_add](v), a[_add](C))); if (!_mobile) return !1; t.stopPropagation() } }), o.on(_click + ".i focus.i blur.i keyup.i keydown.i keypress.i", function (e) { var t = e[_type], i = e.keyCode; return t != _click && ("keydown" == t && 32 == i ? (p[_type] == r && p[n] || (p[n] ? l(o, n) : c(o, n)), !1) : void ("keyup" == t && p[_type] == r ? !p[n] && c(o, n) : /us|ur/.test(t) && T["blur" == t ? _remove : _add](y))) }), _.on(_click + " mousedown mouseup mouseover mouseout " + _touch, function (e) { var t = e[_type], i = /wn|up/.test(t) ? k : v; if (!p[s]) { if (t == _click ? d(o, !1, !0) : (/wn|er|in/.test(t) ? T[_add](i) : T[_remove](i + " " + k), j.length && g && i == v && j[/ut|nd/.test(t) ? _remove : _add](C)), !_mobile) return !1; e.stopPropagation() } }) }) } }(window.jQuery || window.Zepto);;/*!
 * typeahead.js 0.10.2
 * https://github.com/twitter/typeahead.js
 * Copyright 2013-2014 Twitter, Inc. and other contributors; Licensed MIT
 */

! function (a) {
    var b = {
        isMsie: function () {
            return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : !1
        },
        isBlankString: function (a) {
            return !a || /^\s*$/.test(a)
        },
        escapeRegExChars: function (a) {
            return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")
        },
        isString: function (a) {
            return "string" == typeof a
        },
        isNumber: function (a) {
            return "number" == typeof a
        },
        isArray: a.isArray,
        isFunction: a.isFunction,
        isObject: a.isPlainObject,
        isUndefined: function (a) {
            return "undefined" == typeof a
        },
        bind: a.proxy,
        each: function (b, c) {
            function d(a, b) {
                return c(b, a)
            }
            a.each(b, d)
        },
        map: a.map,
        filter: a.grep,
        every: function (b, c) {
            var d = !0;
            return b ? (a.each(b, function (a, e) {
                return (d = c.call(null, e, a, b)) ? void 0 : !1
            }), !!d) : d
        },
        some: function (b, c) {
            var d = !1;
            return b ? (a.each(b, function (a, e) {
                return (d = c.call(null, e, a, b)) ? !1 : void 0
            }), !!d) : d
        },
        mixin: a.extend,
        getUniqueId: function () {
            var a = 0;
            return function () {
                return a++
            }
        }(),
        templatify: function (b) {
            function c() {
                return String(b)
            }
            return a.isFunction(b) ? b : c
        },
        defer: function (a) {
            setTimeout(a, 0)
        },
        debounce: function (a, b, c) {
            var d, e;
            return function () {
                var f, g, h = this,
                    i = arguments;
                return f = function () {
                    d = null, c || (e = a.apply(h, i))
                }, g = c && !d, clearTimeout(d), d = setTimeout(f, b), g && (e = a.apply(h, i)), e
            }
        },
        throttle: function (a, b) {
            var c, d, e, f, g, h;
            return g = 0, h = function () {
                g = new Date, e = null, f = a.apply(c, d)
            },
                function () {
                    var i = new Date,
                        j = b - (i - g);
                    return c = this, d = arguments, 0 >= j ? (clearTimeout(e), e = null, g = i, f = a.apply(c, d)) : e || (e = setTimeout(h, j)), f
                }
        },
        noop: function () { }
    }, c = "0.10.2",
        d = function () {
            function a(a) {
                return a.split(/\s+/)
            }

            function b(a) {
                return a.split(/\W+/)
            }

            function c(a) {
                return function (b) {
                    return function (c) {
                        return a(c[b])
                    }
                }
            }
            return {
                nonword: b,
                whitespace: a,
                obj: {
                    nonword: c(b),
                    whitespace: c(a)
                }
            }
        }(),
        e = function () {
            function a(a) {
                this.maxSize = a || 100, this.size = 0, this.hash = {}, this.list = new c
            }

            function c() {
                this.head = this.tail = null
            }

            function d(a, b) {
                this.key = a, this.val = b, this.prev = this.next = null
            }
            return b.mixin(a.prototype, {
                set: function (a, b) {
                    var c, e = this.list.tail;
                    this.size >= this.maxSize && (this.list.remove(e), delete this.hash[e.key]), (c = this.hash[a]) ? (c.val = b, this.list.moveToFront(c)) : (c = new d(a, b), this.list.add(c), this.hash[a] = c, this.size++)
                },
                get: function (a) {
                    var b = this.hash[a];
                    return b ? (this.list.moveToFront(b), b.val) : void 0
                }
            }), b.mixin(c.prototype, {
                add: function (a) {
                    this.head && (a.next = this.head, this.head.prev = a), this.head = a, this.tail = this.tail || a
                },
                remove: function (a) {
                    a.prev ? a.prev.next = a.next : this.head = a.next, a.next ? a.next.prev = a.prev : this.tail = a.prev
                },
                moveToFront: function (a) {
                    this.remove(a), this.add(a)
                }
            }), a
        }(),
        f = function () {
            function a(a) {
                this.prefix = ["__", a, "__"].join(""), this.ttlKey = "__ttl__", this.keyMatcher = new RegExp("^" + this.prefix)
            }

            function c() {
                return (new Date).getTime()
            }

            function d(a) {
                return JSON.stringify(b.isUndefined(a) ? null : a)
            }

            function e(a) {
                return JSON.parse(a)
            }
            var f, g;
            try {
                f = window.localStorage, f.setItem("~~~", "!"), f.removeItem("~~~")
            } catch (h) {
                f = null
            }
            return g = f && window.JSON ? {
                _prefix: function (a) {
                    return this.prefix + a
                },
                _ttlKey: function (a) {
                    return this._prefix(a) + this.ttlKey
                },
                get: function (a) {
                    return this.isExpired(a) && this.remove(a), e(f.getItem(this._prefix(a)))
                },
                set: function (a, e, g) {
                    return b.isNumber(g) ? f.setItem(this._ttlKey(a), d(c() + g)) : f.removeItem(this._ttlKey(a)), f.setItem(this._prefix(a), d(e))
                },
                remove: function (a) {
                    return f.removeItem(this._ttlKey(a)), f.removeItem(this._prefix(a)), this
                },
                clear: function () {
                    var a, b, c = [],
                        d = f.length;
                    for (a = 0; d > a; a++)(b = f.key(a)).match(this.keyMatcher) && c.push(b.replace(this.keyMatcher, ""));
                    for (a = c.length; a--;) this.remove(c[a]);
                    return this
                },
                isExpired: function (a) {
                    var d = e(f.getItem(this._ttlKey(a)));
                    return b.isNumber(d) && c() > d ? !0 : !1
                }
            } : {
                    get: b.noop,
                    set: b.noop,
                    remove: b.noop,
                    clear: b.noop,
                    isExpired: b.noop
                }, b.mixin(a.prototype, g), a
        }(),
        g = function () {
            function c(b) {
                b = b || {}, this._send = b.transport ? d(b.transport) : a.ajax, this._get = b.rateLimiter ? b.rateLimiter(this._get) : this._get
            }

            function d(c) {
                return function (d, e) {
                    function f(a) {
                        b.defer(function () {
                            h.resolve(a)
                        })
                    }

                    function g(a) {
                        b.defer(function () {
                            h.reject(a)
                        })
                    }
                    var h = a.Deferred();
                    return c(d, e, f, g), h
                }
            }
            var f = 0,
                g = {}, h = 6,
                i = new e(10);
            return c.setMaxPendingRequests = function (a) {
                h = a
            }, c.resetCache = function () {
                i = new e(10)
            }, b.mixin(c.prototype, {
                _get: function (a, b, c) {
                    function d(b) {
                        c && c(null, b), i.set(a, b)
                    }

                    function e() {
                        c && c(!0)
                    }

                    function j() {
                        f-- , delete g[a], l.onDeckRequestArgs && (l._get.apply(l, l.onDeckRequestArgs), l.onDeckRequestArgs = null)
                    }
                    var k, l = this;
                    (k = g[a]) ? k.done(d).fail(e) : h > f ? (f++ , g[a] = this._send(a, b).done(d).fail(e).always(j)) : this.onDeckRequestArgs = [].slice.call(arguments, 0)
                },
                get: function (a, c, d) {
                    var e;
                    return b.isFunction(c) && (d = c, c = {}), (e = i.get(a)) ? b.defer(function () {
                        d && d(null, e)
                    }) : this._get(a, c, d), !!e
                }
            }), c
        }(),
        h = function () {
            function c(b) {
                b = b || {}, b.datumTokenizer && b.queryTokenizer || a.error("datumTokenizer and queryTokenizer are both required"), this.datumTokenizer = b.datumTokenizer, this.queryTokenizer = b.queryTokenizer, this.reset()
            }

            function d(a) {
                return a = b.filter(a, function (a) {
                    return !!a
                }), a = b.map(a, function (a) {
                    return a.toLowerCase()
                })
            }

            function e() {
                return {
                    ids: [],
                    children: {}
                }
            }

            function f(a) {
                for (var b = {}, c = [], d = 0; d < a.length; d++) b[a[d]] || (b[a[d]] = !0, c.push(a[d]));
                return c
            }

            function g(a, b) {
                function c(a, b) {
                    return a - b
                }
                var d = 0,
                    e = 0,
                    f = [];
                for (a = a.sort(c), b = b.sort(c); d < a.length && e < b.length;) a[d] < b[e] ? d++ : a[d] > b[e] ? e++ : (f.push(a[d]), d++ , e++);
                return f
            }
            return b.mixin(c.prototype, {
                bootstrap: function (a) {
                    this.datums = a.datums, this.trie = a.trie
                },
                add: function (a) {
                    var c = this;
                    a = b.isArray(a) ? a : [a], b.each(a, function (a) {
                        var f, g;
                        f = c.datums.push(a) - 1, g = d(c.datumTokenizer(a)), b.each(g, function (a) {
                            var b, d, g;
                            for (b = c.trie, d = a.split(""); g = d.shift();) b = b.children[g] || (b.children[g] = e()), b.ids.push(f)
                        })
                    })
                },
                get: function (a) {
                    var c, e, h = this;
                    return c = d(this.queryTokenizer(a)), b.each(c, function (a) {
                        var b, c, d, f;
                        if (e && 0 === e.length) return !1;
                        for (b = h.trie, c = a.split(""); b && (d = c.shift());) b = b.children[d];
                        return b && 0 === c.length ? (f = b.ids.slice(0), void (e = e ? g(e, f) : f)) : (e = [], !1)
                    }), e ? b.map(f(e), function (a) {
                        return h.datums[a]
                    }) : []
                },
                reset: function () {
                    this.datums = [], this.trie = e()
                },
                serialize: function () {
                    return {
                        datums: this.datums,
                        trie: this.trie
                    }
                }
            }), c
        }(),
        i = function () {
            function d(a) {
                return a.local || null
            }

            function e(d) {
                var e, f;
                return f = {
                    url: null,
                    thumbprint: "",
                    ttl: 864e5,
                    filter: null,
                    ajax: {}
                }, (e = d.prefetch || null) && (e = b.isString(e) ? {
                    url: e
                } : e, e = b.mixin(f, e), e.thumbprint = c + e.thumbprint, e.ajax.type = e.ajax.type || "GET", e.ajax.dataType = e.ajax.dataType || "json", !e.url && a.error("prefetch requires url to be set")), e
            }

            function f(c) {
                function d(a) {
                    return function (c) {
                        return b.debounce(c, a)
                    }
                }

                function e(a) {
                    return function (c) {
                        return b.throttle(c, a)
                    }
                }
                var f, g;
                return g = {
                    url: null,
                    wildcard: "%QUERY",
                    replace: null,
                    rateLimitBy: "debounce",
                    rateLimitWait: 300,
                    send: null,
                    filter: null,
                    ajax: {}
                }, (f = c.remote || null) && (f = b.isString(f) ? {
                    url: f
                } : f, f = b.mixin(g, f), f.rateLimiter = /^throttle$/i.test(f.rateLimitBy) ? e(f.rateLimitWait) : d(f.rateLimitWait), f.ajax.type = f.ajax.type || "GET", f.ajax.dataType = f.ajax.dataType || "json", delete f.rateLimitBy, delete f.rateLimitWait, !f.url && a.error("remote requires url to be set")), f
            }
            return {
                local: d,
                prefetch: e,
                remote: f
            }
        }();
    ! function (c) {
        function e(b) {
            b && (b.local || b.prefetch || b.remote) || a.error("one of local, prefetch, or remote is required"), this.limit = b.limit || 5, this.sorter = j(b.sorter), this.dupDetector = b.dupDetector || k, this.local = i.local(b), this.prefetch = i.prefetch(b), this.remote = i.remote(b), this.cacheKey = this.prefetch ? this.prefetch.cacheKey || this.prefetch.url : null, this.index = new h({
                datumTokenizer: b.datumTokenizer,
                queryTokenizer: b.queryTokenizer
            }), this.storage = this.cacheKey ? new f(this.cacheKey) : null
        }

        function j(a) {
            function c(b) {
                return b.sort(a)
            }

            function d(a) {
                return a
            }
            return b.isFunction(a) ? c : d
        }

        function k() {
            return !1
        }
        var l, m;
        return l = c.Bloodhound, m = {
            data: "data",
            protocol: "protocol",
            thumbprint: "thumbprint"
        }, c.Bloodhound = e, e.noConflict = function () {
            return c.Bloodhound = l, e
        }, e.tokenizers = d, b.mixin(e.prototype, {
            _loadPrefetch: function (b) {
                function c(a) {
                    f.clear(), f.add(b.filter ? b.filter(a) : a), f._saveToStorage(f.index.serialize(), b.thumbprint, b.ttl)
                }
                var d, e, f = this;
                return (d = this._readFromStorage(b.thumbprint)) ? (this.index.bootstrap(d), e = a.Deferred().resolve()) : e = a.ajax(b.url, b.ajax).done(c), e
            },
            _getFromRemote: function (a, b) {
                function c(a, c) {
                    b(a ? [] : f.remote.filter ? f.remote.filter(c) : c)
                }
                var d, e, f = this;
                return a = a || "", e = encodeURIComponent(a), d = this.remote.replace ? this.remote.replace(this.remote.url, a) : this.remote.url.replace(this.remote.wildcard, e), this.transport.get(d, this.remote.ajax, c)
            },
            _saveToStorage: function (a, b, c) {
                this.storage && (this.storage.set(m.data, a, c), this.storage.set(m.protocol, location.protocol, c), this.storage.set(m.thumbprint, b, c))
            },
            _readFromStorage: function (a) {
                var b, c = {};
                return this.storage && (c.data = this.storage.get(m.data), c.protocol = this.storage.get(m.protocol), c.thumbprint = this.storage.get(m.thumbprint)), b = c.thumbprint !== a || c.protocol !== location.protocol, c.data && !b ? c.data : null
            },
            _initialize: function () {
                function c() {
                    e.add(b.isFunction(f) ? f() : f)
                }
                var d, e = this,
                    f = this.local;
                return d = this.prefetch ? this._loadPrefetch(this.prefetch) : a.Deferred().resolve(), f && d.done(c), this.transport = this.remote ? new g(this.remote) : null, this.initPromise = d.promise()
            },
            initialize: function (a) {
                return !this.initPromise || a ? this._initialize() : this.initPromise
            },
            add: function (a) {
                this.index.add(a)
            },
            get: function (a, c) {
                function d(a) {
                    var d = f.slice(0);
                    b.each(a, function (a) {
                        var c;
                        return c = b.some(d, function (b) {
                            return e.dupDetector(a, b)
                        }), !c && d.push(a), d.length < e.limit
                    }), c && c(e.sorter(d))
                }
                var e = this,
                    f = [],
                    g = !1;
                f = this.index.get(a), f = this.sorter(f).slice(0, this.limit), f.length < this.limit && this.transport && (g = this._getFromRemote(a, d)), g || (f.length > 0 || !this.transport) && c && c(f)
            },
            clear: function () {
                this.index.reset()
            },
            clearPrefetchCache: function () {
                this.storage && this.storage.clear()
            },
            clearRemoteCache: function () {
                this.transport && g.resetCache()
            },
            ttAdapter: function () {
                return b.bind(this.get, this)
            }
        }), e
    }(this);
    var j = {
        wrapper: '<span class="twitter-typeahead"></span>',
        dropdown: '<span class="tt-dropdown-menu"></span>',
        dataset: '<div class="tt-dataset-%CLASS%"></div>',
        suggestions: '<span class="tt-suggestions"></span>',
        suggestion: '<div class="tt-suggestion"></div>'
    }, k = {
        wrapper: {
            position: "relative",
            display: "block"
        },
        hint: {
            position: "absolute",
            top: "0",
            left: "0",
            borderColor: "transparent",
            boxShadow: "none"
        },
        input: {
            position: "relative",
            verticalAlign: "top",
            backgroundColor: "transparent"
        },
        inputWithNoHint: {
            position: "relative",
            verticalAlign: "top"
        },
        dropdown: {
            position: "absolute",
            top: "100%",
            left: "0",
            zIndex: "100",
            display: "none"
        },
        suggestions: {
            display: "block"
        },
        suggestion: {
            whiteSpace: "nowrap",
            cursor: "pointer"
        },
        suggestionChild: {
            whiteSpace: "normal"
        },
        ltr: {
            left: "0",
            right: "auto"
        },
        rtl: {
            left: "auto",
            right: " 0"
        }
    };
    b.isMsie() && b.mixin(k.input, {
        backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
    }), b.isMsie() && b.isMsie() <= 7 && b.mixin(k.input, {
        marginTop: "-1px"
    });
    var l = function () {
        function c(b) {
            b && b.el || a.error("EventBus initialized without el"), this.$el = a(b.el)
        }
        var d = "typeahead:";
        return b.mixin(c.prototype, {
            trigger: function (a) {
                var b = [].slice.call(arguments, 1);
                this.$el.trigger(d + a, b)
            }
        }), c
    }(),
        m = function () {
            function a(a, b, c, d) {
                var e;
                if (!c) return this;
                for (b = b.split(i), c = d ? h(c, d) : c, this._callbacks = this._callbacks || {}; e = b.shift();) this._callbacks[e] = this._callbacks[e] || {
                    sync: [],
                    async: []
                }, this._callbacks[e][a].push(c);
                return this
            }

            function b(b, c, d) {
                return a.call(this, "async", b, c, d)
            }

            function c(b, c, d) {
                return a.call(this, "sync", b, c, d)
            }

            function d(a) {
                var b;
                if (!this._callbacks) return this;
                for (a = a.split(i); b = a.shift();) delete this._callbacks[b];
                return this
            }

            function e(a) {
                var b, c, d, e, g;
                if (!this._callbacks) return this;
                for (a = a.split(i), d = [].slice.call(arguments, 1);
                    (b = a.shift()) && (c = this._callbacks[b]);) e = f(c.sync, this, [b].concat(d)), g = f(c.async, this, [b].concat(d)), e() && j(g);
                return this
            }

            function f(a, b, c) {
                function d() {
                    for (var d, e = 0; !d && e < a.length; e += 1) d = a[e].apply(b, c) === !1;
                    return !d
                }
                return d
            }

            function g() {
                var a;
                return a = window.setImmediate ? function (a) {
                    setImmediate(function () {
                        a()
                    })
                } : function (a) {
                    setTimeout(function () {
                        a()
                    }, 0)
                }
            }

            function h(a, b) {
                return a.bind ? a.bind(b) : function () {
                    a.apply(b, [].slice.call(arguments, 0))
                }
            }
            var i = /\s+/,
                j = g();
            return {
                onSync: c,
                onAsync: b,
                off: d,
                trigger: e
            }
        }(),
        n = function (a) {
            function c(a, c, d) {
                for (var e, f = [], g = 0; g < a.length; g++) f.push(b.escapeRegExChars(a[g]));
                return e = d ? "\\b(" + f.join("|") + ")\\b" : "(" + f.join("|") + ")", c ? new RegExp(e) : new RegExp(e, "i")
            }
            var d = {
                node: null,
                pattern: null,
                tagName: "strong",
                className: null,
                wordsOnly: !1,
                caseSensitive: !1
            };
            return function (e) {
                function f(b) {
                    var c, d;
                    return (c = h.exec(b.data)) && (wrapperNode = a.createElement(e.tagName), e.className && (wrapperNode.className = e.className), d = b.splitText(c.index), d.splitText(c[0].length), wrapperNode.appendChild(d.cloneNode(!0)), b.parentNode.replaceChild(wrapperNode, d)), !!c
                }

                function g(a, b) {
                    for (var c, d = 3, e = 0; e < a.childNodes.length; e++) c = a.childNodes[e], c.nodeType === d ? e += b(c) ? 1 : 0 : g(c, b)
                }
                var h;
                e = b.mixin({}, d, e), e.node && e.pattern && (e.pattern = b.isArray(e.pattern) ? e.pattern : [e.pattern], h = c(e.pattern, e.caseSensitive, e.wordsOnly), g(e.node, f))
            }
        }(window.document),
        o = function () {
            function c(c) {
                var e, f, h, i, j = this;
                c = c || {}, c.input || a.error("input is missing"), e = b.bind(this._onBlur, this), f = b.bind(this._onFocus, this), h = b.bind(this._onKeydown, this), i = b.bind(this._onInput, this), this.$hint = a(c.hint), this.$input = a(c.input).on("blur.tt", e).on("focus.tt", f).on("keydown.tt", h), 0 === this.$hint.length && (this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = b.noop), b.isMsie() ? this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function (a) {
                    g[a.which || a.keyCode] || b.defer(b.bind(j._onInput, j, a))
                }) : this.$input.on("input.tt", i), this.query = this.$input.val(), this.$overflowHelper = d(this.$input)
            }

            function d(b) {
                return a('<pre aria-hidden="true"></pre>').css({
                    position: "absolute",
                    visibility: "hidden",
                    whiteSpace: "pre",
                    fontFamily: b.css("font-family"),
                    fontSize: b.css("font-size"),
                    fontStyle: b.css("font-style"),
                    fontVariant: b.css("font-variant"),
                    fontWeight: b.css("font-weight"),
                    wordSpacing: b.css("word-spacing"),
                    letterSpacing: b.css("letter-spacing"),
                    textIndent: b.css("text-indent"),
                    textRendering: b.css("text-rendering"),
                    textTransform: b.css("text-transform")
                }).insertAfter(b)
            }

            function e(a, b) {
                return c.normalizeQuery(a) === c.normalizeQuery(b)
            }

            function f(a) {
                return a.altKey || a.ctrlKey || a.metaKey || a.shiftKey
            }
            var g;
            return g = {
                9: "tab",
                27: "esc",
                37: "left",
                39: "right",
                13: "enter",
                38: "up",
                40: "down"
            }, c.normalizeQuery = function (a) {
                return (a || "").replace(/^\s*/g, "").replace(/\s{2,}/g, " ")
            }, b.mixin(c.prototype, m, {
                _onBlur: function () {
                    this.resetInputValue(), this.trigger("blurred")
                },
                _onFocus: function () {
                    this.trigger("focused")
                },
                _onKeydown: function (a) {
                    var b = g[a.which || a.keyCode];
                    this._managePreventDefault(b, a), b && this._shouldTrigger(b, a) && this.trigger(b + "Keyed", a)
                },
                _onInput: function () {
                    this._checkInputValue()
                },
                _managePreventDefault: function (a, b) {
                    var c, d, e;
                    switch (a) {
                        case "tab":
                            d = this.getHint(), e = this.getInputValue(), c = d && d !== e && !f(b);
                            break;
                        case "up":
                        case "down":
                            c = !f(b);
                            break;
                        default:
                            c = !1
                    }
                    c && b.preventDefault()
                },
                _shouldTrigger: function (a, b) {
                    var c;
                    switch (a) {
                        case "tab":
                            c = !f(b);
                            break;
                        default:
                            c = !0
                    }
                    return c
                },
                _checkInputValue: function () {
                    var a, b, c;
                    a = this.getInputValue(), b = e(a, this.query), c = b ? this.query.length !== a.length : !1, b ? c && this.trigger("whitespaceChanged", this.query) : this.trigger("queryChanged", this.query = a)
                },
                focus: function () {
                    this.$input.focus()
                },
                blur: function () {
                    this.$input.blur()
                },
                getQuery: function () {
                    return this.query
                },
                setQuery: function (a) {
                    this.query = a
                },
                getInputValue: function () {
                    return this.$input.val()
                },
                setInputValue: function (a, b) {
                    this.$input.val(a), b ? this.clearHint() : this._checkInputValue()
                },
                resetInputValue: function () {
                    this.setInputValue(this.query, !0)
                },
                getHint: function () {
                    return this.$hint.val()
                },
                setHint: function (a) {
                    this.$hint.val(a)
                },
                clearHint: function () {
                    this.setHint("")
                },
                clearHintIfInvalid: function () {
                    var a, b, c, d;
                    a = this.getInputValue(), b = this.getHint(), c = a !== b && 0 === b.indexOf(a), d = "" !== a && c && !this.hasOverflow(), !d && this.clearHint()
                },
                getLanguageDirection: function () {
                    return (this.$input.css("direction") || "ltr").toLowerCase()
                },
                hasOverflow: function () {
                    var a = this.$input.width() - 2;
                    return this.$overflowHelper.text(this.getInputValue()), this.$overflowHelper.width() >= a
                },
                isCursorAtEnd: function () {
                    var a, c, d;
                    return a = this.$input.val().length, c = this.$input[0].selectionStart, b.isNumber(c) ? c === a : document.selection ? (d = document.selection.createRange(), d.moveStart("character", -a), a === d.text.length) : !0
                },
                destroy: function () {
                    this.$hint.off(".tt"), this.$input.off(".tt"), this.$hint = this.$input = this.$overflowHelper = null
                }
            }), c
        }(),
        p = function () {
            function c(c) {
                c = c || {}, c.templates = c.templates || {}, c.source || a.error("missing source"), c.name && !f(c.name) && a.error("invalid dataset name: " + c.name), this.query = null, this.highlight = !!c.highlight, this.name = c.name || b.getUniqueId(), this.source = c.source, this.displayFn = d(c.display || c.displayKey), this.templates = e(c.templates, this.displayFn), this.$el = a(j.dataset.replace("%CLASS%", this.name))
            }

            function d(a) {
                function c(b) {
                    return b[a]
                }
                return a = a || "value", b.isFunction(a) ? a : c
            }

            function e(a, c) {
                function d(a) {
                    return '<p type="' + a.type + '"><el>' + c(a) + '</el></p>'
                }
                return {
                    empty: a.empty && b.templatify(a.empty),
                    header: a.header && b.templatify(a.header),
                    footer: a.footer && b.templatify(a.footer),
                    suggestion: a.suggestion || d
                }
            }

            function f(a) {
                return /^[_a-zA-Z0-9-]+$/.test(a)
            }
            var g = "ttDataset",
                h = "ttValue",
                i = "ttDatum";
            return c.extractDatasetName = function (b) {
                return a(b).data(g)
            }, c.extractValue = function (b) {
                return a(b).data(h)
            }, c.extractDatum = function (b) {
                return a(b).data(i)
            }, b.mixin(c.prototype, m, {
                _render: function (c, d) {
                    function e() {
                        return p.templates.empty({
                            query: c,
                            isEmpty: !0
                        })
                    }

                    function f() {
                        function e(b) {
                            var c;
                            return c = a(j.suggestion).append(p.templates.suggestion(b)).data(g, p.name).data(h, p.displayFn(b)).data(i, b), c.children().each(function () {
                                a(this).css(k.suggestionChild)
                            }), c
                        }
                        var f, l;
                        return f = a(j.suggestions).css(k.suggestions), l = b.map(d, e), f.append.apply(f, l), p.highlight && n({
                            node: f[0],
                            pattern: c
                        }), f
                    }

                    function l() {
                        return p.templates.header({
                            query: c,
                            isEmpty: !o
                        })
                    }

                    function m() {
                        return p.templates.footer({
                            query: c,
                            isEmpty: !o
                        })
                    }
                    if (this.$el) {
                        var o, p = this;
                        this.$el.empty(), o = d && d.length, !o && this.templates.empty ? this.$el.html(e()).prepend(p.templates.header ? l() : null).append(p.templates.footer ? m() : null) : o && this.$el.html(f()).prepend(p.templates.header ? l() : null).append(p.templates.footer ? m() : null), this.trigger("rendered")
                    }
                },
                getRoot: function () {
                    return this.$el
                },
                update: function (a) {
                    function b(b) {
                        c.canceled || a !== c.query || c._render(a, b)
                    }
                    var c = this;
                    this.query = a, this.canceled = !1, this.source(a, b)
                },
                cancel: function () {
                    this.canceled = !0
                },
                clear: function () {
                    this.cancel(), this.$el.empty(), this.trigger("rendered")
                },
                isEmpty: function () {
                    return this.$el.is(":empty")
                },
                destroy: function () {
                    this.$el = null
                }
            }), c
        }(),
        q = function () {
            function c(c) {
                var e, f, g, h = this;
                c = c || {}, c.menu || a.error("menu is required"), this.isOpen = !1, this.isEmpty = !0, this.datasets = b.map(c.datasets, d), e = b.bind(this._onSuggestionClick, this), f = b.bind(this._onSuggestionMouseEnter, this), g = b.bind(this._onSuggestionMouseLeave, this), this.$menu = a(c.menu).on("click.tt", ".tt-suggestion", e).on("mouseenter.tt", ".tt-suggestion", f).on("mouseleave.tt", ".tt-suggestion", g), b.each(this.datasets, function (a) {
                    h.$menu.append(a.getRoot()), a.onSync("rendered", h._onRendered, h)
                })
            }

            function d(a) {
                return new p(a)
            }
            return b.mixin(c.prototype, m, {
                _onSuggestionClick: function (b) {
                    this.trigger("suggestionClicked", a(b.currentTarget))
                },
                _onSuggestionMouseEnter: function (b) {
                    this._removeCursor(), this._setCursor(a(b.currentTarget), !0)
                },
                _onSuggestionMouseLeave: function () {
                    this._removeCursor()
                },
                _onRendered: function () {
                    function a(a) {
                        return a.isEmpty()
                    }
                    this.isEmpty = b.every(this.datasets, a), this.isEmpty ? this._hide() : this.isOpen && this._show(), this.trigger("datasetRendered")
                },
                _hide: function () {
                    this.$menu.hide()
                },
                _show: function () {
                    this.$menu.css("display", "block")
                },
                _getSuggestions: function () {
                    return this.$menu.find(".tt-suggestion")
                },
                _getCursor: function () {
                    return this.$menu.find(".tt-cursor").first()
                },
                _setCursor: function (a, b) {
                    a.first().addClass("tt-cursor"), !b && this.trigger("cursorMoved")
                },
                _removeCursor: function () {
                    this._getCursor().removeClass("tt-cursor")
                },
                _moveCursor: function (a) {
                    var b, c, d, e;
                    if (this.isOpen) {
                        if (c = this._getCursor(), b = this._getSuggestions(), this._removeCursor(), d = b.index(c) + a, d = (d + 1) % (b.length + 1) - 1, -1 === d) return void this.trigger("cursorRemoved"); - 1 > d && (d = b.length - 1), this._setCursor(e = b.eq(d)), this._ensureVisible(e)
                    }
                },
                _ensureVisible: function (a) {
                    var b, c, d, e;
                    b = a.position().top, c = b + a.outerHeight(!0), d = this.$menu.scrollTop(), e = this.$menu.height() + parseInt(this.$menu.css("paddingTop"), 10) + parseInt(this.$menu.css("paddingBottom"), 10), 0 > b ? this.$menu.scrollTop(d + b) : c > e && this.$menu.scrollTop(d + (c - e))
                },
                close: function () {
                    this.isOpen && (this.isOpen = !1, this._removeCursor(), this._hide(), this.trigger("closed"))
                },
                open: function () {
                    this.isOpen || (this.isOpen = !0, !this.isEmpty && this._show(), this.trigger("opened"))
                },
                setLanguageDirection: function (a) {
                    this.$menu.css("ltr" === a ? k.ltr : k.rtl)
                },
                moveCursorUp: function () {
                    this._moveCursor(-1)
                },
                moveCursorDown: function () {
                    this._moveCursor(1)
                },
                getDatumForSuggestion: function (a) {
                    var b = null;
                    return a.length && (b = {
                        raw: p.extractDatum(a),
                        value: p.extractValue(a),
                        datasetName: p.extractDatasetName(a)
                    }), b
                },
                getDatumForCursor: function () {
                    return this.getDatumForSuggestion(this._getCursor().first())
                },
                getDatumForTopSuggestion: function () {
                    return this.getDatumForSuggestion(this._getSuggestions().first())
                },
                update: function (a) {
                    function c(b) {
                        b.update(a)
                    }
                    b.each(this.datasets, c)
                },
                empty: function () {
                    function a(a) {
                        a.clear()
                    }
                    b.each(this.datasets, a), this.isEmpty = !0
                },
                isVisible: function () {
                    return this.isOpen && !this.isEmpty
                },
                destroy: function () {
                    function a(a) {
                        a.destroy()
                    }
                    this.$menu.off(".tt"), this.$menu = null, b.each(this.datasets, a)
                }
            }), c
        }(),
        r = function () {
            function c(c) {
                var e, f, g;
                c = c || {}, c.input || a.error("missing input"), this.isActivated = !1, this.autoselect = !!c.autoselect, this.minLength = b.isNumber(c.minLength) ? c.minLength : 1, this.$node = d(c.input, c.withHint), e = this.$node.find(".tt-dropdown-menu"), f = this.$node.find(".tt-input"), g = this.$node.find(".tt-hint"), f.on("blur.tt", function (a) {
                    var c, d, g;
                    c = document.activeElement, d = e.is(c), g = e.has(c).length > 0, b.isMsie() && (d || g) && (a.preventDefault(), a.stopImmediatePropagation(), b.defer(function () {
                        f.focus()
                    }))
                }), e.on("mousedown.tt", function (a) {
                    a.preventDefault()
                }), this.eventBus = c.eventBus || new l({
                    el: f
                }), this.dropdown = new q({
                    menu: e,
                    datasets: c.datasets
                }).onSync("suggestionClicked", this._onSuggestionClicked, this).onSync("cursorMoved", this._onCursorMoved, this).onSync("cursorRemoved", this._onCursorRemoved, this).onSync("opened", this._onOpened, this).onSync("closed", this._onClosed, this).onAsync("datasetRendered", this._onDatasetRendered, this), this.input = new o({
                    input: f,
                    hint: g
                }).onSync("focused", this._onFocused, this).onSync("blurred", this._onBlurred, this).onSync("enterKeyed", this._onEnterKeyed, this).onSync("tabKeyed", this._onTabKeyed, this).onSync("escKeyed", this._onEscKeyed, this).onSync("upKeyed", this._onUpKeyed, this).onSync("downKeyed", this._onDownKeyed, this).onSync("leftKeyed", this._onLeftKeyed, this).onSync("rightKeyed", this._onRightKeyed, this).onSync("queryChanged", this._onQueryChanged, this).onSync("whitespaceChanged", this._onWhitespaceChanged, this), this._setLanguageDirection()
            }

            function d(b, c) {
                var d, f, h, i;
                d = a(b), f = a(j.wrapper).css(k.wrapper), h = a(j.dropdown).css(k.dropdown), i = d.clone().css(k.hint).css(e(d)), i.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled", !0).attr({
                    autocomplete: "off",
                    spellcheck: "false"
                }), d.data(g, {
                    dir: d.attr("dir"),
                    autocomplete: d.attr("autocomplete"),
                    spellcheck: d.attr("spellcheck"),
                    style: d.attr("style")
                }), d.addClass("tt-input").attr({
                    autocomplete: "off",
                    spellcheck: !1
                }).css(c ? k.input : k.inputWithNoHint);
                try {
                    !d.attr("dir") && d.attr("dir", "auto")
                } catch (l) { }
                return d.wrap(f).parent().prepend(c ? i : null).append(h)
            }

            function e(a) {
                return {
                    backgroundAttachment: a.css("background-attachment"),
                    backgroundClip: a.css("background-clip"),
                    backgroundColor: a.css("background-color"),
                    backgroundImage: a.css("background-image"),
                    backgroundOrigin: a.css("background-origin"),
                    backgroundPosition: a.css("background-position"),
                    backgroundRepeat: a.css("background-repeat"),
                    backgroundSize: a.css("background-size")
                }
            }

            function f(a) {
                var c = a.find(".tt-input");
                b.each(c.data(g), function (a, d) {
                    b.isUndefined(a) ? c.removeAttr(d) : c.attr(d, a)
                }), c.detach().removeData(g).removeClass("tt-input").insertAfter(a), a.remove()
            }
            var g = "ttAttrs";
            return b.mixin(c.prototype, {
                _onSuggestionClicked: function (a, b) {
                    var c;
                    (c = this.dropdown.getDatumForSuggestion(b)) && this._select(c)
                },
                _onCursorMoved: function () {
                    var a = this.dropdown.getDatumForCursor();
                    this.input.setInputValue(a.value, !0), this.eventBus.trigger("cursorchanged", a.raw, a.datasetName)
                },
                _onCursorRemoved: function () {
                    this.input.resetInputValue(), this._updateHint()
                },
                _onDatasetRendered: function () {
                    this._updateHint()
                },
                _onOpened: function () {
                    this._updateHint(), this.eventBus.trigger("opened")
                },
                _onClosed: function () {
                    this.input.clearHint(), this.eventBus.trigger("closed")
                },
                _onFocused: function () {
                    this.isActivated = !0, this.dropdown.open()
                },
                _onBlurred: function () {
                    this.isActivated = !1, this.dropdown.empty(), this.dropdown.close()
                },
                _onEnterKeyed: function (a, b) {
                    var c, d;
                    c = this.dropdown.getDatumForCursor(), d = this.dropdown.getDatumForTopSuggestion(), c ? (this._select(c), b.preventDefault()) : this.autoselect && d && (this._select(d), b.preventDefault())
                },
                _onTabKeyed: function (a, b) {
                    var c;
                    (c = this.dropdown.getDatumForCursor()) ? (this._select(c), b.preventDefault()) : this._autocomplete(!0)
                },
                _onEscKeyed: function () {
                    this.dropdown.close(), this.input.resetInputValue()
                },
                _onUpKeyed: function () {
                    var a = this.input.getQuery();
                    this.dropdown.isEmpty && a.length >= this.minLength ? this.dropdown.update(a) : this.dropdown.moveCursorUp(), this.dropdown.open()
                },
                _onDownKeyed: function () {
                    var a = this.input.getQuery();
                    this.dropdown.isEmpty && a.length >= this.minLength ? this.dropdown.update(a) : this.dropdown.moveCursorDown(), this.dropdown.open()
                },
                _onLeftKeyed: function () {
                    "rtl" === this.dir && this._autocomplete()
                },
                _onRightKeyed: function () {
                    "ltr" === this.dir && this._autocomplete()
                },
                _onQueryChanged: function (a, b) {
                    this.input.clearHintIfInvalid(), b.length >= this.minLength ? this.dropdown.update(b) : this.dropdown.empty(), this.dropdown.open(), this._setLanguageDirection()
                },
                _onWhitespaceChanged: function () {
                    this._updateHint(), this.dropdown.open()
                },
                _setLanguageDirection: function () {
                    var a;
                    this.dir !== (a = this.input.getLanguageDirection()) && (this.dir = a, this.$node.css("direction", a), this.dropdown.setLanguageDirection(a))
                },
                _updateHint: function () {
                    var a, c, d, e, f, g;
                    a = this.dropdown.getDatumForTopSuggestion(), a && this.dropdown.isVisible() && !this.input.hasOverflow() ? (c = this.input.getInputValue(), d = o.normalizeQuery(c), e = b.escapeRegExChars(d), f = new RegExp("^(?:" + e + ")(.+$)", "i"), g = f.exec(a.value), g ? this.input.setHint(c + g[1]) : this.input.clearHint()) : this.input.clearHint()
                },
                _autocomplete: function (a) {
                    var b, c, d, e;
                    b = this.input.getHint(), c = this.input.getQuery(), d = a || this.input.isCursorAtEnd(), b && c !== b && d && (e = this.dropdown.getDatumForTopSuggestion(), e && this.input.setInputValue(e.value), this.eventBus.trigger("autocompleted", e.raw, e.datasetName))
                },
                _select: function (a) {
                    this.input.setQuery(a.value), this.input.setInputValue(a.value, !0), this._setLanguageDirection(), this.eventBus.trigger("selected", a.raw, a.datasetName), this.dropdown.close(), b.defer(b.bind(this.dropdown.empty, this.dropdown))
                },
                open: function () {
                    this.dropdown.open()
                },
                close: function () {
                    this.dropdown.close()
                },
                setVal: function (a) {
                    this.isActivated ? this.input.setInputValue(a) : (this.input.setQuery(a), this.input.setInputValue(a, !0)), this._setLanguageDirection()
                },
                getVal: function () {
                    return this.input.getQuery()
                },
                destroy: function () {
                    this.input.destroy(), this.dropdown.destroy(), f(this.$node), this.$node = null
                }
            }), c
        }();
    ! function () {
        var c, d, e;
        c = a.fn.typeahead, d = "ttTypeahead", e = {
            initialize: function (c, e) {
                function f() {
                    var f, g, h = a(this);
                    b.each(e, function (a) {
                        a.highlight = !!c.highlight
                    }), g = new r({
                        input: h,
                        eventBus: f = new l({
                            el: h
                        }),
                        withHint: b.isUndefined(c.hint) ? !0 : !!c.hint,
                        minLength: c.minLength,
                        autoselect: c.autoselect,
                        datasets: e
                    }), h.data(d, g)
                }
                return e = b.isArray(e) ? e : [].slice.call(arguments, 1), c = c || {}, this.each(f)
            },
            open: function () {
                function b() {
                    var b, c = a(this);
                    (b = c.data(d)) && b.open()
                }
                return this.each(b)
            },
            close: function () {
                function b() {
                    var b, c = a(this);
                    (b = c.data(d)) && b.close()
                }
                return this.each(b)
            },
            val: function (b) {
                function c() {
                    var c, e = a(this);
                    (c = e.data(d)) && c.setVal(b)
                }

                function e(a) {
                    var b, c;
                    return (b = a.data(d)) && (c = b.getVal()), c
                }
                return arguments.length ? this.each(c) : e(this.first())
            },
            destroy: function () {
                function b() {
                    var b, c = a(this);
                    (b = c.data(d)) && (b.destroy(), c.removeData(d))
                }
                return this.each(b)
            }
        }, a.fn.typeahead = function (a) {
            return e[a] ? e[a].apply(this, [].slice.call(arguments, 1)) : e.initialize.apply(this, arguments)
        }, a.fn.typeahead.noConflict = function () {
            return a.fn.typeahead = c, this
        }
    }()
}(window.jQuery);;(function () { var t, e, n, r, a, l, i, o, c, u, h, s, p, f, g, d, v, m, y, C = [].slice, $ = [].indexOf || function (t) { for (var e = 0, n = this.length; e < n; e++) if (e in this && this[e] === t) return e; return -1 }; (t = jQuery).payment = {}, t.payment.fn = {}, t.fn.payment = function () { var e, n; return n = arguments[0], e = 2 <= arguments.length ? C.call(arguments, 1) : [], t.payment.fn[n].apply(this, e) }, r = [{ type: "maestro", pattern: /^(5018|5020|5038|6304|6759|676[1-3])/, format: a = /(\d{1,4})/g, length: [12, 13, 14, 15, 16, 17, 18, 19], cvcLength: [3], luhn: !0 }, { type: "dinersclub", pattern: /^(36|38|30[0-5])/, format: a, length: [14], cvcLength: [3], luhn: !0 }, { type: "laser", pattern: /^(6706|6771|6709)/, format: a, length: [16, 17, 18, 19], cvcLength: [3], luhn: !0 }, { type: "jcb", pattern: /^35/, format: a, length: [16], cvcLength: [3], luhn: !0 }, { type: "unionpay", pattern: /^62/, format: a, length: [16, 17, 18, 19], cvcLength: [3], luhn: !1 }, { type: "discover", pattern: /^(6011|65|64[4-9]|622)/, format: a, length: [16], cvcLength: [3], luhn: !0 }, { type: "mastercard", pattern: /^5[1-5]/, format: a, length: [16], cvcLength: [3], luhn: !0 }, { type: "amex", pattern: /^3[47]/, format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/, length: [15], cvcLength: [3, 4], luhn: !0 }, { type: "visa", pattern: /^4/, format: a, length: [13, 14, 15, 16], cvcLength: [3], luhn: !0 }], e = function (t) { var e, n, a; for (t = (t + "").replace(/\D/g, ""), n = 0, a = r.length; n < a; n++) if ((e = r[n]).pattern.test(t)) return e }, n = function (t) { var e, n, a; for (n = 0, a = r.length; n < a; n++) if ((e = r[n]).type === t) return e }, p = function (t) { var e, n, r, a, l, i; for (r = !0, a = 0, l = 0, i = (n = (t + "").split("").reverse()).length; l < i; l++) e = n[l], e = parseInt(e, 10), (r = !r) && (e *= 2), e > 9 && (e -= 9), a += e; return a % 10 == 0 }, s = function (t) { var e; return null != t.prop("selectionStart") && t.prop("selectionStart") !== t.prop("selectionEnd") || !("undefined" == typeof document || null === document || null == (e = document.selection) || "function" != typeof e.createRange || !e.createRange().text) }, f = function (e) { return setTimeout(function () { var n, r; return r = (n = t(e.currentTarget)).val(), r = t.payment.formatCardNumber(r), n.val(r) }) }, o = function (n) { var r, a, l, i, o, c, u; if (l = String.fromCharCode(n.which), /^\d+$/.test(l) && (u = (r = t(n.currentTarget)).val(), a = e(u + l), i = (u.replace(/\D/g, "") + l).length, c = 16, a && (c = a.length[a.length.length - 1]), !(i >= c || null != r.prop("selectionStart") && r.prop("selectionStart") !== u.length))) return (o = a && "amex" === a.type ? /^(\d{4}|\d{4}\s\d{6})$/ : /(?:^|\s)(\d{4})$/).test(u) ? (n.preventDefault(), r.val(u + " " + l)) : o.test(u + l) ? (n.preventDefault(), r.val(u + l + " ")) : void 0 }, l = function (e) { var n, r; if (r = (n = t(e.currentTarget)).val(), !e.meta && 8 === e.which && (null == n.prop("selectionStart") || n.prop("selectionStart") === r.length)) return /\d\s$/.test(r) ? (e.preventDefault(), n.val(r.replace(/\d\s$/, ""))) : /\s\d?$/.test(r) ? (e.preventDefault(), n.val(r.replace(/\s\d?$/, ""))) : void 0 }, c = function (e) { var n, r, a; if (r = String.fromCharCode(e.which), /^\d+$/.test(r)) return a = (n = t(e.currentTarget)).val() + r, /^\d$/.test(a) && "0" !== a && "1" !== a ? (e.preventDefault(), n.val("0" + a + " / ")) : /^\d\d$/.test(a) ? (e.preventDefault(), n.val(a + " / ")) : void 0 }, u = function (e) { var n, r, a; if (r = String.fromCharCode(e.which), /^\d+$/.test(r)) return a = (n = t(e.currentTarget)).val(), /^\d\d$/.test(a) ? n.val(a + " / ") : void 0 }, h = function (e) { var n, r; if ("/" === String.fromCharCode(e.which)) return r = (n = t(e.currentTarget)).val(), /^\d$/.test(r) && "0" !== r ? n.val("0" + r + " / ") : void 0 }, i = function (e) { var n, r; if (!e.meta && (r = (n = t(e.currentTarget)).val(), 8 === e.which && (null == n.prop("selectionStart") || n.prop("selectionStart") === r.length))) return /\d(\s|\/)+$/.test(r) ? (e.preventDefault(), n.val(r.replace(/\d(\s|\/)*$/, ""))) : /\s\/\s?\d?$/.test(r) ? (e.preventDefault(), n.val(r.replace(/\s\/\s?\d?$/, ""))) : void 0 }, m = function (t) { var e; return !(!t.metaKey && !t.ctrlKey) || 32 !== t.which && (0 === t.which || (t.which < 33 || (e = String.fromCharCode(t.which), !!/[\d\s]/.test(e)))) }, d = function (n) { var r, a, l, i; if (r = t(n.currentTarget), l = String.fromCharCode(n.which), /^\d+$/.test(l) && !s(r)) return i = (r.val() + l).replace(/\D/g, ""), (a = e(i)) ? i.length <= a.length[a.length.length - 1] : i.length <= 16 }, v = function (e) { var n, r; if (n = t(e.currentTarget), r = String.fromCharCode(e.which), /^\d+$/.test(r) && !s(n)) return !((n.val() + r).replace(/\D/g, "").length > 6) && void 0 }, g = function (e) { var n, r; if (n = t(e.currentTarget), r = String.fromCharCode(e.which), /^\d+$/.test(r)) return (n.val() + r).length <= 4 }, y = function (e) { var n, a, l, i, o; if (o = (n = t(e.currentTarget)).val(), i = t.payment.cardType(o) || "unknown", !n.hasClass(i)) return a = function () { var t, e, n; for (n = [], t = 0, e = r.length; t < e; t++) l = r[t], n.push(l.type); return n }(), n.removeClass("unknown"), n.removeClass(a.join(" ")), n.addClass(i), n.toggleClass("identified", "unknown" !== i), n.trigger("payment.cardType", i) }, t.payment.fn.formatCardCVC = function () { return this.payment("restrictNumeric"), this.on("keypress", g), this }, t.payment.fn.formatCardExpiry = function () { return this.payment("restrictNumeric"), this.on("keypress", v), this.on("keypress", c), this.on("keypress", h), this.on("keypress", u), this.on("keydown", i), this }, t.payment.fn.formatCardNumber = function () { return this.payment("restrictNumeric"), this.on("keypress", d), this.on("keypress", o), this.on("keydown", l), this.on("keyup", y), this.on("paste", f), this }, t.payment.fn.restrictNumeric = function () { return this.on("keypress", m), this }, t.payment.fn.cardExpiryVal = function () { return t.payment.cardExpiryVal(t(this).val()) }, t.payment.cardExpiryVal = function (t) { var e, n, r; return e = (r = (t = t.replace(/\s/g, "")).split("/", 2))[0], 2 === (null != (n = r[1]) ? n.length : void 0) && /^\d+$/.test(n) && (n = (new Date).getFullYear().toString().slice(0, 2) + n), { month: e = parseInt(e, 10), year: n = parseInt(n, 10) } }, t.payment.validateCardNumber = function (t) { var n, r; return t = (t + "").replace(/\s+|-/g, ""), !!/^\d+$/.test(t) && (!!(n = e(t)) && (r = t.length, $.call(n.length, r) >= 0 && (!1 === n.luhn || p(t)))) }, t.payment.validateCardExpiry = function (e, n) { var r, a, l; return "object" == typeof e && "month" in e && (e = (l = e).month, n = l.year), !(!e || !n) && (e = t.trim(e), n = t.trim(n), !!/^\d+$/.test(e) && (!!/^\d+$/.test(n) && (parseInt(e, 10) <= 12 && (2 === n.length && (n = (new Date).getFullYear().toString().slice(0, 2) + n), a = new Date(n, e), r = new Date, a.setMonth(a.getMonth() - 1), a.setMonth(a.getMonth() + 1, 1), a > r)))) }, t.payment.validateCardCVC = function (e, r) { var a, l; return e = t.trim(e), !!/^\d+$/.test(e) && (r ? (a = e.length, $.call(null != (l = n(r)) ? l.cvcLength : void 0, a) >= 0) : e.length >= 3 && e.length <= 4) }, t.payment.cardType = function (t) { var n; return t && (null != (n = e(t)) ? n.type : void 0) || null }, t.payment.formatCardNumber = function (t) { var n, r, a, l; return (n = e(t)) ? (a = n.length[n.length.length - 1], t = (t = t.replace(/\D/g, "")).slice(0, +a + 1 || 9e9), n.format.global ? null != (l = t.match(n.format)) ? l.join(" ") : void 0 : (null != (r = n.format.exec(t)) && r.shift(), null != r ? r.join(" ") : void 0)) : t } }).call(this);;!function (e) { var t, i, n, o, a, r, s, l = "Close", c = "BeforeClose", p = "MarkupParse", u = "Open", d = "Change", f = "mfp", m = "." + f, g = "mfp-ready", h = "mfp-removing", v = "mfp-prevent-close", C = function () { }, y = !!window.jQuery, w = e(window), b = function (e, i) { t.ev.on(f + e + m, i) }, I = function (t, i, n, o) { var a = document.createElement("div"); return a.className = "mfp-" + t, n && (a.innerHTML = n), o ? i && i.appendChild(a) : (a = e(a), i && a.appendTo(i)), a }, x = function (i, n) { t.ev.triggerHandler(f + i, n), t.st.callbacks && (i = i.charAt(0).toLowerCase() + i.slice(1), t.st.callbacks[i] && t.st.callbacks[i].apply(t, e.isArray(n) ? n : [n])) }, k = function () { (t.st.focus ? t.content.find(t.st.focus).eq(0) : t.wrap).trigger("focus") }, T = function (i) { return i === s && t.currTemplate.closeBtn || (t.currTemplate.closeBtn = e(t.st.closeMarkup.replace("%title%", t.st.tClose)), s = i), t.currTemplate.closeBtn }, E = function () { e.magnificPopup.instance || ((t = new C).init(), e.magnificPopup.instance = t) }; C.prototype = { constructor: C, init: function () { var i = navigator.appVersion; t.isIE7 = -1 !== i.indexOf("MSIE 7."), t.isIE8 = -1 !== i.indexOf("MSIE 8."), t.isLowIE = t.isIE7 || t.isIE8, t.isAndroid = /android/gi.test(i), t.isIOS = /iphone|ipad|ipod/gi.test(i), t.supportsTransition = function () { var e = document.createElement("p").style, t = ["ms", "O", "Moz", "Webkit"]; if (void 0 !== e.transition) return !0; for (; t.length;) if (t.pop() + "Transition" in e) return !0; return !1 }(), t.probablyMobile = t.isAndroid || t.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), n = e(document.body), o = e(document), t.popupsCache = {} }, open: function (i) { var n; if (!1 === i.isObj) { t.items = i.items.toArray(), t.index = 0; var a, s = i.items; for (n = 0; n < s.length; n++) if ((a = s[n]).parsed && (a = a.el[0]), a === i.el[0]) { t.index = n; break } } else t.items = e.isArray(i.items) ? i.items : [i.items], t.index = i.index || 0; if (t.isOpen) t.updateItemHTML(); else { t.types = [], r = "", i.mainEl && i.mainEl.length ? t.ev = i.mainEl.eq(0) : t.ev = o, i.key ? (t.popupsCache[i.key] || (t.popupsCache[i.key] = {}), t.currTemplate = t.popupsCache[i.key]) : t.currTemplate = {}, t.st = e.extend(!0, {}, e.magnificPopup.defaults, i), t.fixedContentPos = "auto" === t.st.fixedContentPos ? !t.probablyMobile : t.st.fixedContentPos, t.st.modal && (t.st.closeOnContentClick = !1, t.st.closeOnBgClick = !1, t.st.showCloseBtn = !1, t.st.enableEscapeKey = !1), t.bgOverlay || (t.bgOverlay = I("bg").on("click" + m, function () { t.close() }), t.wrap = I("wrap").attr("tabindex", -1).on("click" + m, function (i) { (function (i) { if (!e(i).hasClass(v)) { var n = t.st.closeOnContentClick, o = t.st.closeOnBgClick; if (n && o) return !0; if (!t.content || e(i).hasClass("mfp-close") || t.preloader && i === t.preloader[0]) return !0; if (i === t.content[0] || e.contains(t.content[0], i)) { if (n) return !0 } else if (o && e.contains(document, i)) return !0; return !1 } })(i.target) && t.close() }), t.container = I("container", t.wrap)), t.contentContainer = I("content"), t.st.preloader && (t.preloader = I("preloader", t.container, t.st.tLoading)); var l = e.magnificPopup.modules; for (n = 0; n < l.length; n++) { var c = l[n]; c = c.charAt(0).toUpperCase() + c.slice(1), t["init" + c].call(t) } x("BeforeOpen"), t.st.showCloseBtn && (t.st.closeBtnInside ? (b(p, function (e, t, i, n) { i.close_replaceWith = T(n.type) }), r += " mfp-close-btn-in") : t.wrap.append(T())), t.st.alignTop && (r += " mfp-align-top"), t.fixedContentPos ? t.wrap.css({ overflow: t.st.overflowY, overflowX: "hidden", overflowY: t.st.overflowY }) : t.wrap.css({ top: w.scrollTop(), position: "absolute" }), (!1 === t.st.fixedBgPos || "auto" === t.st.fixedBgPos && !t.fixedContentPos) && t.bgOverlay.css({ height: o.height(), position: "absolute" }), t.st.enableEscapeKey && o.on("keyup" + m, function (e) { 27 === e.keyCode && t.close() }), w.on("resize" + m, function () { t.updateSize() }), t.st.closeOnContentClick || (r += " mfp-auto-cursor"), r && t.wrap.addClass(r); var d = t.wH = w.height(), f = t.st.mainClass; t.isIE7 && (f += " mfp-ie7"), f && t._addClassToMFP(f), t.updateItemHTML(), x("BuildControls"), e("html").css({}), t.bgOverlay.add(t.wrap).prependTo(document.body), t._lastFocusedEl = document.activeElement, setTimeout(function () { t.content ? (t._addClassToMFP(g), k()) : t.bgOverlay.addClass(g), o.on("focusin" + m, function (i) { if (i.target !== t.wrap[0] && !e.contains(t.wrap[0], i.target)) return k(), !1 }) }, 16), t.isOpen = !0, t.updateSize(d), x(u) } }, close: function () { t.isOpen && (x(c), t.isOpen = !1, t.st.removalDelay && !t.isLowIE && t.supportsTransition ? (t._addClassToMFP(h), setTimeout(function () { t._close() }, t.st.removalDelay)) : t._close()) }, _close: function () { x(l); var i = h + " " + g + " "; if (t.bgOverlay.detach(), t.wrap.detach(), t.container.empty(), t.st.mainClass && (i += t.st.mainClass + " "), t._removeClassFromMFP(i), t.fixedContentPos) { e("html").css({ paddingRight: "" }) } o.off("keyup.mfp focusin" + m), t.ev.off(m), t.wrap.attr("class", "mfp-wrap").removeAttr("style"), t.bgOverlay.attr("class", "mfp-bg"), t.container.attr("class", "mfp-container"), !t.st.showCloseBtn || t.st.closeBtnInside && !0 !== t.currTemplate[t.currItem.type] || t.currTemplate.closeBtn && t.currTemplate.closeBtn.detach(), t._lastFocusedEl && e(t._lastFocusedEl).trigger("focus"), t.currItem = null, t.content = null, t.currTemplate = null, t.prevHeight = 0, x("AfterClose") }, updateSize: function (e) { if (t.isIOS) { var i = document.documentElement.clientWidth / window.innerWidth, n = window.innerHeight * i; t.wrap.css("height", n), t.wH = n } else t.wH = e || w.height(); t.fixedContentPos || t.wrap.css("height", t.wH), x("Resize") }, updateItemHTML: function () { var i = t.items[t.index]; t.contentContainer.detach(), t.content && t.content.detach(), i.parsed || (i = t.parseEl(t.index)); var n = i.type; if (x("BeforeChange", [t.currItem ? t.currItem.type : "", n]), t.currItem = i, !t.currTemplate[n]) { var o = !!t.st[n] && t.st[n].markup; x("FirstMarkupParse", o), t.currTemplate[n] = !o || e(o) } a && a !== i.type && t.container.removeClass("mfp-" + a + "-holder"); var r = t["get" + n.charAt(0).toUpperCase() + n.slice(1)](i, t.currTemplate[n]); t.appendContent(r, n), i.preloaded = !0, x(d, i), a = i.type, t.container.prepend(t.contentContainer), x("AfterChange") }, appendContent: function (e, i) { t.content = e, e ? t.st.showCloseBtn && t.st.closeBtnInside && !0 === t.currTemplate[i] ? t.content.find(".mfp-close").length || t.content.append(T()) : t.content = e : t.content = "", x("BeforeAppend"), t.container.addClass("mfp-" + i + "-holder"), t.contentContainer.append(t.content) }, parseEl: function (i) { var n = t.items[i], o = n.type; if ((n = n.tagName ? { el: e(n) } : { data: n, src: n.src }).el) { for (var a = t.types, r = 0; r < a.length; r++) if (n.el.hasClass("mfp-" + a[r])) { o = a[r]; break } n.src = n.el.attr("data-mfp-src"), n.src || (n.src = n.el.attr("href")) } return n.type = o || t.st.type || "inline", n.index = i, n.parsed = !0, t.items[i] = n, x("ElementParse", n), t.items[i] }, addGroup: function (e, i) { var n = function (n) { n.mfpEl = this, t._openClick(n, e, i) }; i || (i = {}); var o = "click.magnificPopup"; i.mainEl = e, i.items ? (i.isObj = !0, e.off(o).on(o, n)) : (i.isObj = !1, i.delegate ? e.off(o).on(o, i.delegate, n) : (i.items = e, e.off(o).on(o, n))) }, _openClick: function (i, n, o) { if ((void 0 !== o.midClick ? o.midClick : e.magnificPopup.defaults.midClick) || 2 !== i.which && !i.ctrlKey && !i.metaKey) { var a = void 0 !== o.disableOn ? o.disableOn : e.magnificPopup.defaults.disableOn; if (a) if (e.isFunction(a)) { if (!a.call(t)) return !0 } else if (w.width() < a) return !0; i.type && (i.preventDefault(), t.isOpen && i.stopPropagation()), o.el = e(i.mfpEl), o.delegate && (o.items = n.find(o.delegate)), t.open(o) } }, updateStatus: function (e, n) { if (t.preloader) { i !== e && t.container.removeClass("mfp-s-" + i), n || "loading" !== e || (n = t.st.tLoading); var o = { status: e, text: n }; x("UpdateStatus", o), e = o.status, n = o.text, t.preloader.html(n), t.preloader.find("a").on("click", function (e) { e.stopImmediatePropagation() }), t.container.addClass("mfp-s-" + e), i = e } }, _addClassToMFP: function (e) { t.bgOverlay.addClass(e), t.wrap.addClass(e) }, _removeClassFromMFP: function (e) { this.bgOverlay.removeClass(e), t.wrap.removeClass(e) }, _hasScrollBar: function (e) { return (t.isIE7 ? o.height() : document.body.scrollHeight) > (e || w.height()) }, _parseMarkup: function (t, i, n) { var o; n.data && (i = e.extend(n.data, i)), x(p, [t, i, n]), e.each(i, function (e, i) { if (void 0 === i || !1 === i) return !0; if ((o = e.split("_")).length > 1) { var n = t.find(m + "-" + o[0]); if (n.length > 0) { var a = o[1]; "replaceWith" === a ? n[0] !== i[0] && n.replaceWith(i) : "img" === a ? n.is("img") ? n.attr("src", i) : n.replaceWith('<img src="' + i + '" class="' + n.attr("class") + '" />') : n.attr(o[1], i) } } else t.find(m + "-" + e).html(i) }) }, _getScrollbarSize: function () { if (void 0 === t.scrollbarSize) { var e = document.createElement("div"); e.id = "mfp-sbm", e.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(e), t.scrollbarSize = e.offsetWidth - e.clientWidth, document.body.removeChild(e) } return t.scrollbarSize } }, e.magnificPopup = { instance: null, proto: C.prototype, modules: [], open: function (e, t) { return E(), e || (e = {}), e.isObj = !0, e.index = t || 0, this.instance.open(e) }, close: function () { return e.magnificPopup.instance.close() }, registerModule: function (t, i) { i.options && (e.magnificPopup.defaults[t] = i.options), e.extend(this.proto, i.proto), this.modules.push(t) }, defaults: { disableOn: 0, key: null, midClick: !0, mainClass: "", attr: "", preloader: !0, focus: "", closeOnContentClick: !1, closeOnBgClick: !0, closeBtnInside: !1, showCloseBtn: !0, enableEscapeKey: !0, modal: !1, alignTop: !1, removalDelay: 300, fixedContentPos: "auto", fixedBgPos: "auto", overflowY: "auto", closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>', tClose: "Close (Esc)", tLoading: "Loading...", callbacks: { beforeOpen: function () { this.st.image.markup = this.st.image.markup.replace("mfp-figure", "mfp-figure mfp-with-anim"), this.st.mainClass = this.attr } } } }, e.fn.magnificPopup = function (i) { E(); var n = e(this); if ("string" == typeof i) if ("open" === i) { var o, a = y ? n.data("magnificPopup") : n[0].magnificPopup, r = parseInt(arguments[1], 10) || 0; a.items ? o = a.items[r] : (o = n, a.delegate && (o = o.find(a.delegate)), o = o.eq(r)), t._openClick({ mfpEl: o }, n, a) } else t.isOpen && t[i].apply(t, Array.prototype.slice.call(arguments, 1)); else y ? n.data("magnificPopup", i) : n[0].magnificPopup = i, t.addGroup(n, i); return n }; var S, P, O, _ = "inline", M = function () { O && (P.after(O.addClass(S)).detach(), O = null) }; e.magnificPopup.registerModule(_, { options: { hiddenClass: "hide", markup: "", tNotFound: "Content not found" }, proto: { initInline: function () { t.types.push(_), b(l + "." + _, function () { M() }) }, getInline: function (i, n) { if (M(), i.src) { var o = t.st.inline, a = e(i.src); if (a.length) { var r = a[0].parentNode; r && r.tagName && (P || (S = o.hiddenClass, P = I(S), S = "mfp-" + S), O = a.after(P).detach().removeClass(S)), t.updateStatus("ready") } else t.updateStatus("error", o.tNotFound), a = e("<div>"); return i.inlineElement = a, a } return t.updateStatus("ready"), t._parseMarkup(n, {}, i), n } } }); var z, B = "ajax", H = function () { z && n.removeClass(z) }; e.magnificPopup.registerModule(B, { options: { settings: null, cursor: "mfp-ajax-cur", tError: '<a href="%url%">The content</a> could not be loaded.' }, proto: { initAjax: function () { t.types.push(B), z = t.st.ajax.cursor, b(l + "." + B, function () { H(), t.req && t.req.abort() }) }, getAjax: function (i) { z && n.addClass(z), t.updateStatus("loading"); var o = e.extend({ url: i.src, success: function (n, o, a) { var r = { data: n, xhr: a }; x("ParseAjax", r), t.appendContent(e(r.data), B), i.finished = !0, H(), k(), setTimeout(function () { t.wrap.addClass(g) }, 16), t.updateStatus("ready"), x("AjaxContentAdded") }, error: function () { H(), i.finished = i.loadError = !0, t.updateStatus("error", t.st.ajax.tError.replace("%url%", i.src)) } }, t.st.ajax.settings); return t.req = e.ajax(o), "" } } }); var A; e.magnificPopup.registerModule("image", { options: { markup: '<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></div>', cursor: "mfp-zoom-out-cur", titleSrc: "title", verticalFit: !0, tError: '<a href="%url%">The image</a> could not be loaded.' }, proto: { initImage: function () { var e = t.st.image, i = ".image"; t.types.push("image"), b(u + i, function () { "image" === t.currItem.type && e.cursor && n.addClass(e.cursor) }), b(l + i, function () { e.cursor && n.removeClass(e.cursor), w.off("resize" + m) }), b("Resize" + i, t.resizeImage), t.isLowIE && b("AfterChange", t.resizeImage) }, resizeImage: function () { var e = t.currItem; if (e.img && t.st.image.verticalFit) { var i = 0; t.isLowIE && (i = parseInt(e.img.css("padding-top"), 10) + parseInt(e.img.css("padding-bottom"), 10)), e.img.css("max-height", t.wH - i) } }, _onImageHasSize: function (e) { e.img && (e.hasSize = !0, A && clearInterval(A), e.isCheckingImgSize = !1, x("ImageHasSize", e), e.imgHidden && (t.content && t.content.removeClass("mfp-loading"), e.imgHidden = !1)) }, findImageSize: function (e) { var i = 0, n = e.img[0], o = function (a) { A && clearInterval(A), A = setInterval(function () { n.naturalWidth > 0 ? t._onImageHasSize(e) : (i > 200 && clearInterval(A), 3 === ++i ? o(10) : 40 === i ? o(50) : 100 === i && o(500)) }, a) }; o(1) }, getImage: function (i, n) { var o = 0, a = function () { i && (i.img[0].complete ? (i.img.off(".mfploader"), i === t.currItem && (t._onImageHasSize(i), t.updateStatus("ready")), i.hasSize = !0, i.loaded = !0, x("ImageLoadComplete")) : ++o < 200 ? setTimeout(a, 100) : r()) }, r = function () { i && (i.img.off(".mfploader"), i === t.currItem && (t._onImageHasSize(i), t.updateStatus("error", s.tError.replace("%url%", i.src))), i.hasSize = !0, i.loaded = !0, i.loadError = !0) }, s = t.st.image, l = n.find(".mfp-img"); if (l.length) { var c = new Image; c.className = "mfp-img", i.img = e(c).on("load.mfploader", a).on("error.mfploader", r), c.src = i.src, l.is("img") && (i.img = i.img.clone()), i.img[0].naturalWidth > 0 && (i.hasSize = !0) } return t._parseMarkup(n, { title: function (i) { if (i.data && void 0 !== i.data.title) return i.data.title; var n = t.st.image.titleSrc; if (n) { if (e.isFunction(n)) return n.call(t, i); if (i.el) return i.el.attr(n) || "" } return "" }(i), img_replaceWith: i.img }, i), t.resizeImage(), i.hasSize ? (A && clearInterval(A), i.loadError ? (n.addClass("mfp-loading"), t.updateStatus("error", s.tError.replace("%url%", i.src))) : (n.removeClass("mfp-loading"), t.updateStatus("ready")), n) : (t.updateStatus("loading"), i.loading = !0, i.hasSize || (i.imgHidden = !0, n.addClass("mfp-loading"), t.findImageSize(i)), n) } } }); var L; e.magnificPopup.registerModule("zoom", { options: { enabled: !1, easing: "ease-in-out", duration: 300, opener: function (e) { return e.is("img") ? e : e.find("img") } }, proto: { initZoom: function () { var e = t.st.zoom, i = ".zoom"; if (e.enabled && t.supportsTransition) { var n, o, a = e.duration, r = function (t) { var i = t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), n = "all " + e.duration / 1e3 + "s " + e.easing, o = { position: "fixed", zIndex: 9999, left: 0, top: 0, "-webkit-backface-visibility": "hidden" }, a = "transition"; return o["-webkit-" + a] = o["-moz-" + a] = o["-o-" + a] = o[a] = n, i.css(o), i }, s = function () { t.content.css("visibility", "visible") }; b("BuildControls" + i, function () { if (t._allowZoom()) { if (clearTimeout(n), t.content.css("visibility", "hidden"), image = t._getItemToZoom(), !image) return void s(); (o = r(image)).css(t._getOffset()), t.wrap.append(o), n = setTimeout(function () { o.css(t._getOffset(!0)), n = setTimeout(function () { s(), setTimeout(function () { o.remove(), image = o = null, x("ZoomAnimationEnded") }, 16) }, a) }, 16) } }), b(c + i, function () { if (t._allowZoom()) { if (clearTimeout(n), t.st.removalDelay = a, !image) { if (image = t._getItemToZoom(), !image) return; o = r(image) } o.css(t._getOffset(!0)), t.wrap.append(o), t.content.css("visibility", "hidden"), setTimeout(function () { o.css(t._getOffset()) }, 16) } }), b(l + i, function () { t._allowZoom() && (s(), o && o.remove()) }) } }, _allowZoom: function () { return "image" === t.currItem.type }, _getItemToZoom: function () { return !!t.currItem.hasSize && t.currItem.img }, _getOffset: function (i) { var n, o = (n = i ? t.currItem.img : t.st.zoom.opener(t.currItem.el || t.currItem)).offset(), a = parseInt(n.css("padding-top"), 10), r = parseInt(n.css("padding-bottom"), 10); o.top -= e(window).scrollTop() - a; var s = { width: n.width(), height: (y ? n.innerHeight() : n[0].offsetHeight) - r - a }; return void 0 === L && (L = void 0 !== document.createElement("p").style.MozTransform), L ? s["-moz-transform"] = s.transform = "translate(" + o.left + "px," + o.top + "px)" : (s.left = o.left, s.top = o.top), s } } }); var F = "iframe", j = function (e) { if (t.currTemplate[F]) { var i = t.currTemplate[F].find("iframe"); i.length && (e || (i[0].src = "//about:blank"), t.isIE8 && i.css("display", e ? "block" : "none")) } }; e.magnificPopup.registerModule(F, { options: { markup: '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>', srcAction: "iframe_src", patterns: { youtube: { index: "youtube.com", id: "v=", src: "//www.youtube.com/embed/%id%?autoplay=1" }, vimeo: { index: "vimeo.com/", id: "/", src: "//player.vimeo.com/video/%id%?autoplay=1" }, gmaps: { index: "//maps.google.", src: "%id%&output=embed" } } }, proto: { initIframe: function () { t.types.push(F), b("BeforeChange", function (e, t, i) { t !== i && (t === F ? j() : i === F && j(!0)) }), b(l + "." + F, function () { j() }) }, getIframe: function (i, n) { var o = i.src, a = t.st.iframe; e.each(a.patterns, function () { if (o.indexOf(this.index) > -1) return this.id && (o = "string" == typeof this.id ? o.substr(o.lastIndexOf(this.id) + this.id.length, o.length) : this.id.call(this, o)), o = this.src.replace("%id%", o), !1 }); var r = {}; return a.srcAction && (r[a.srcAction] = o), t._parseMarkup(n, r, i), t.updateStatus("ready"), n } } }); var N = function (e) { var i = t.items.length; return e > i - 1 ? e - i : e < 0 ? i + e : e }, W = function (e, t, i) { return e.replace("%curr%", t + 1).replace("%total%", i) }; e.magnificPopup.registerModule("gallery", { options: { enabled: !1, arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', preload: [0, 2], navigateByImgClick: !0, arrows: !0, tPrev: "Previous (Left arrow key)", tNext: "Next (Right arrow key)", tCounter: "%curr% of %total%" }, proto: { initGallery: function () { var i = t.st.gallery, n = ".mfp-gallery", a = Boolean(e.fn.mfpFastClick); if (t.direction = !0, !i || !i.enabled) return !1; r += " mfp-gallery", b(u + n, function () { i.navigateByImgClick && t.wrap.on("click" + n, ".mfp-img", function () { if (t.items.length > 1) return t.next(), !1 }), o.on("keydown" + n, function (e) { 37 === e.keyCode ? t.prev() : 39 === e.keyCode && t.next() }) }), b("UpdateStatus" + n, function (e, i) { i.text && (i.text = W(i.text, t.currItem.index, t.items.length)) }), b(p + n, function (e, n, o, a) { var r = t.items.length; o.counter = r > 1 ? W(i.tCounter, a.index, r) : "" }), b("BuildControls" + n, function () { if (t.items.length > 1 && i.arrows && !t.arrowLeft) { var n = i.arrowMarkup, o = t.arrowLeft = e(n.replace("%title%", i.tPrev).replace("%dir%", "left")).addClass(v), r = t.arrowRight = e(n.replace("%title%", i.tNext).replace("%dir%", "right")).addClass(v), s = a ? "mfpFastClick" : "click"; o[s](function () { t.prev() }), r[s](function () { t.next() }), t.isIE7 && (I("b", o[0], !1, !0), I("a", o[0], !1, !0), I("b", r[0], !1, !0), I("a", r[0], !1, !0)), t.container.append(o.add(r)) } }), b(d + n, function () { t._preloadTimeout && clearTimeout(t._preloadTimeout), t._preloadTimeout = setTimeout(function () { t.preloadNearbyImages(), t._preloadTimeout = null }, 16) }), b(l + n, function () { o.off(n), t.wrap.off("click" + n), t.arrowLeft && a && t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(), t.arrowRight = t.arrowLeft = null }) }, next: function () { t.direction = !0, t.index = N(t.index + 1), t.updateItemHTML() }, prev: function () { t.direction = !1, t.index = N(t.index - 1), t.updateItemHTML() }, goTo: function (e) { t.direction = e >= t.index, t.index = e, t.updateItemHTML() }, preloadNearbyImages: function () { var e, i = t.st.gallery.preload, n = Math.min(i[0], t.items.length), o = Math.min(i[1], t.items.length); for (e = 1; e <= (t.direction ? o : n) ; e++) t._preloadItem(t.index + e); for (e = 1; e <= (t.direction ? n : o) ; e++) t._preloadItem(t.index - e) }, _preloadItem: function (i) { if (i = N(i), !t.items[i].preloaded) { var n = t.items[i]; n.parsed || (n = t.parseEl(i)), x("LazyLoad", n), "image" === n.type && (n.img = e('<img class="mfp-img" />').on("load.mfploader", function () { n.hasSize = !0 }).on("error.mfploader", function () { n.hasSize = !0, n.loadError = !0 }).attr("src", n.src)), n.preloaded = !0 } } } }); var Z, R, q, D = "retina"; e.magnificPopup.registerModule(D, { options: { replaceSrc: function (e) { return e.src.replace(/\.\w+$/, function (e) { return "@2x" + e }) }, ratio: 1 }, proto: { initRetina: function () { if (window.devicePixelRatio > 1) { var e = t.st.retina, i = e.ratio; (i = isNaN(i) ? i() : i) > 1 && (b("ImageHasSize." + D, function (e, t) { t.img.css({ "max-width": t.img[0].naturalWidth / i, width: "100%" }) }), b("ElementParse." + D, function (t, n) { n.src = e.replaceSrc(n, i) })) } } } }), Z = "ontouchstart" in window, R = function () { w.off("touchmove" + q + " touchend" + q) }, q = ".mfpFastClick", e.fn.mfpFastClick = function (t) { return e(this).each(function () { var i, n, o, a, r, s, l, c = e(this); Z && c.on("touchstart" + q, function (e) { r = !1, l = 1, s = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0], o = s.clientX, a = s.clientY, w.on("touchmove" + q, function (e) { s = e.originalEvent ? e.originalEvent.touches : e.touches, l = s.length, s = s[0], (Math.abs(s.clientX - o) > 10 || Math.abs(s.clientY - a) > 10) && (r = !0, R()) }).on("touchend" + q, function (e) { R(), r || l > 1 || (i = !0, e.preventDefault(), clearTimeout(n), n = setTimeout(function () { i = !1 }, 1e3), t()) }) }), c.on("click" + q, function () { i || t() }) }) }, e.fn.destroyMfpFastClick = function () { e(this).off("touchstart" + q + " click" + q), Z && w.off("touchmove" + q + " touchend" + q) } }(window.jQuery || window.Zepto);;eval(function (e, o, a, t, n, i) { if (n = function (e) { return (e < 62 ? "" : n(parseInt(e / 62))) + ((e %= 62) > 35 ? String.fromCharCode(e + 29) : e.toString(36)) }, !"".replace(/^/, String)) { for (; a--;) i[n(a)] = t[a] || n(a); t = [function (e) { return i[e] }], n = function () { return "\\w+" }, a = 1 } for (; a--;) t[a] && (e = e.replace(new RegExp("\\b" + n(a) + "\\b", "g"), t[a])); return e }('(2($){"31 32";3 v=0,33={};$.1L($.1M,{S:2(){4(1b.2f&&2f.34()=="[1n 35]"){x}3 a=1o,2g="S",2h="",1p="2i 2j O 1q 2k".36(" "),1r="",1N=1O.38("T");4(1N.I.2l!==14){a=1s}4(a===1o){U(3 i=0;i<1p.V;i++){4(1N.I[1p[i]+"2m"]!==14){1r=1p[i];2g=1r+"2n";2h="-"+1r.1P()+"-";a=1s;1c}}}x a}()});4(!$("2o[B=2p]")[0]){$("2q").1Q(\'<2o B="2p" 39="1d=3a-1d, 3b-2r=1, 3c-2r=1">\')}$.1e.2s=2(t){3 u="2s";1b[u]=2(m,n){3 o=5;o.G=v;v++;o.6={D:"",W:1o,2t:1o,1R:1s,1f:"1S",1g:"X",y:{B:"2u",18:3d,Y:3e,1t:"2v"}};4(n){U(3 k 1T n){4(E n[k]=="1n"){$.1L(o.6[k],n[k])}A{o.6[k]=n[k]}}}o.9=m;o.$9=$(m);o.$Z=$("K > 19, K > T",o.$9).C().15("> a");3 p=2(){$("[w-7-2w]",o.$9).1h(2(){$(5).11("1d",$(5).w("7-2w"))});o.$9.L("7-M-"+o.G);4(o.6.D=="2x"||o.6.D=="2y"||o.6.D=="1u"){o.$9.L("7-D-"+o.6.D)}4(o.6.W){o.$9.L("7-W")}4(o.6.1R){o.$9.L("7-2z-1d")}4(o.6.1f){3 a=o.6.1f;4(a=="3f-1v"||a=="1S-1v"){o.$9.L("7-1U-1v");a=a.3g("-1v","")}o.$9.L("7-1U-"+a)}4(!o.6.y){o.6.y={B:"2u",18:0,Y:0,1t:"3h"}}o.$1w=$(q(o.6.y.B));o.$9.3i(o.$1w);r();s()};3 q=2(a){3 b={2A:0},1V={2A:1};1S(a){1x"1y-1W":b["N"]="1z(12)";b["-1i-N"]="1z(12)";1c;1x"1y-1u":b["N"]="1z(-12)";b["-1i-N"]="1z(-12)";1c;1x"1y-2x":b["N"]="1A(12)";b["-1i-N"]="1A(12)";1c;1x"1y-2y":b["N"]="1A(-12)";b["-1i-N"]="1A(-12)";1c}$.1j.1X([{B:"7-2B","2C":b,"1Y":1V}]);$.1j.1X([{B:"7-2D","2C":1V,"1Y":b}]);3 c=["<I>",".1a.7-M-"+o.G+" > K > T,",".1a.7-M-"+o.G+" K > 19,",".1a.7-M-"+o.G+" > K:X > T,",".1a.7-M-"+o.G+" K:X > 19 {","2E:2F;","z-2G:-1;","}",".1a.7-M-"+o.G+" > K.7-J > T,",".1a.7-M-"+o.G+" K.7-J > 19 {","2E:3j;","z-2G:20;","}","</I>"].1Z("");x c};o.3k=2(){o.$Z.1B("."+u);o.$Z.C().1B("."+u);$(1O).1B("."+u);4(o.$1w)o.$1w.3l();o.$9.13("7-M-"+o.G);o.$9.13("7-D-"+o.6.D);4(o.6.W)o.$9.13("7-W");4(o.6.1R)o.$9.13("7-2z-1d");4(o.6.1f)o.$9.13("7-1U-"+o.6.1f);o.$9.3m(u)};3 r=2(){2 1C(a){a=a.L("7-J").15("> T, > 19");4(o.6.y.18&&$.1M.S){a.1D([{B:"7-2B",1E:o.6.y.18+"1q",1F:o.6.y.1t}],2(){$(5).1G();$(5).2H("2I")})}}2 16(a){a=a.15("> T, > 19");4(o.6.y.18&&$.1M.S){a.1D([{B:"7-2D",1E:o.6.y.18+"1q",1F:o.6.y.1t}],2(){$(5).1G();$(5).C().13("7-J")})}A{a.C().13("7-J")}}4(o.6.1g=="1k"){o.$Z.P("1k."+u,2(e){3 b=$(5).C();1l(2(a){4(a.C().15("> :X")[0]!=a[0])x;4(a.21("7-J")){16(a)}A{1C(a);e.22();e.23()}}.17(5,b),o.6.y.Y);16(b.2J(".7-J"))})}A 4(o.6.1g=="3n"){o.$Z.P("1k."+u,2(e){3 b=$(5).C();1l(2(a){4(a.C().15("> :X")[0]!=a[0])x;4(a.21("7-J")){16(a)}A{1C(a);e.22();e.23()}}.17(5,b),o.6.y.Y);16(b.2J(".7-J"))})}A{o.$Z.P("3o."+u,2(e){3 b=$(5).C();4(!b.21("7-J")){1l(2(a){4(a.C().15("> :X")[0]!=a[0])x;1C(a)}.17(5,b),o.6.y.Y);e.22();e.23()}})}4(o.6.1g=="1k"||o.6.1g=="X"){o.$Z.C().P("3p."+u,2(){1l(2(a){4(a.C().15("> :X")[0]==a[0])x;16(a)}.17(5,$(5)),o.6.y.Y)})}$(1O).P("1k."+u+" 3q."+u,2(e){4(!$(e.3r).3s(".7-M-"+o.G).V){16(o.$Z.C())}});4(o.6.2t&&!o.6.W){3 c=o.$9.3t(1s),24=o.$9.3u(),2K=$(1b).3v();$(1b).P("2L."+u,2(){3 a=(o.6.D!="1u"&&$(5).2M()>=24.1W)||(o.6.D=="1u"&&($(5).2M()+2K)<=(24.1W+c));4(a){o.$9.L("7-W")}A{o.$9.13("7-W")}}).2L()}};3 s=2(){4(E F!=="14"&&E F.H!=="14"&&E F.H.25!=="14"){$(".7-1m-3w").1h(2(){3 d=$(5);3 e=d.w("26")?3x(d.w("26"),10):8;3 f=d.w("2N")?Q F.H.25(d.w("2N"),d.w("3y")):Q F.H.25(37.3z,-3A.3B);3 g={26:e,3C:F.H.3D.3E,3F:f};3 h=Q F.H.3G(5,g);4(d.w("27")){3 i=Q F.H.3H();i.3I({"27":d.w("27")},2(a,b){4(b==F.H.3J.3K){h.2O(a[0].28.29);f=a[0].28.29;3 c=Q F.H.2P({1m:h,D:a[0].28.29,1H:d.w("1m-1H")})}})}A{3 j=Q F.H.2P({1m:h,D:f,1H:d.w("1m-1H")})}3 k=d.3L("K");3 l=2(){F.H.3M.2H(h,"3N");h.2O(f)};k.P("2I",l)})}};p()};x 5.1h(2(){4(E $(5).w(u)=="14"){$(5).w(u,Q 1b[u](5,t))}A 4(E $(5).w(u)=="1n"&&E t=="14"){$.2Q("3O 3P 3Q 3R 1I."+u)}A 4(E $(5).w(u)=="1n"&&E $(5).w(u)[t]=="2"){$(5).w(u)[t].2R(5,2a.R.2b.1J(2c,1))}A{$.2Q("3S "+t+" 3T 2S 3U P 1I."+u)}})}})(1I);(2(){3 e=1I,n=!1,t="S",i="",a="",r=["2i","2j","O","1q","2k"];!2(){3 o=e("<T>")[0];4(1K 0!==o.I.2l)x 1K(n=!0);U(3 s=0;s<r.V;s++)4(1K 0!==o.I[r[s]+"2m"])x i=r[s],t=i+"2n",a="-"+i.1P()+"-",1K(n=!0);n=!1}();3 o=2(n){x e("<I>").3V({"3W":"1j-I",G:n,3X:"3Y/11"}).3Z("2q")};e.1j={40:2(){x a},41:2(){x n},2d:2(i){4(n){3 r=i.B||"",s="@"+a+"42 "+r+" {";U(3 f 1T i)4("B"!==f){s+=f+" {";U(3 m 1T i[f])s+=m+":"+i[f][m]+";";s+="}"}s+="}";3 u=e("I#"+i.B);4(u.V>0){u.43(s);3 c=e("*").44(2(){5.I[t+"45"]===r});c.1h(2(){3 n,t;n=e(5),t=n.w("2T"),n.1G(2(){n.1D(t)})})}A o(r).1Q(s)}},1X:2(e){4(e.V)U(3 n=0;n<e.V;n++){3 t=e[n];5.2d(t)}A 5.2d(e)}};3 s="S-46-47",f="48";e.1e.1G=2(n){e(5).11(a+s,f).11(a+"S","2F");n&&1l(n,1)},e.1e.49=2(){e(5).11(a+s,"4a")},e.1e.4b=2(){e(5).11(a+s,f)},e.1e.1D=2(n,t){3 i=2(n){x n=e.1L({1E:"2U",1F:"2v",Y:"2U",2V:1,2W:"4c",2X:"4d"},n),[n.B,n.1E,n.1F,n.Y,n.2V,n.2W,n.2X].1Z(" ")},r="";4(e.4e(n)){U(3 o=[],m=0;m<n.V;m++)o.4f("2Y"==E n[m]?n[m]:i(n[m]));r=o.1Z(", ")}A r="2Y"==E n?n:i(n);3 u=a+"S",c=["1i","4g","4h","o",""],l=2(e,n,t){U(3 i=0;i<c.V;i++){c[i]||(n=n.1P());3 a=c[i]+n;e.1B(a).P(a,t)}};x 5.1h(2(){3 i=e(5).L("2Z").11(a+s,f).11(u,r).w("2T",n);t&&(l(i,"4i",t),l(i,"4j",t))}),5},n&&o("4k-1j").1Q(" .2Z{"+a+"N:4l(1,1,1);}")}).1J(5);2e.R.17||(2e.R.17=2(t){4("2"!=E 5)4m Q 4n("2e.R.17 - 4o 30 4p 1Y 4q 4r 30 2S 4s");3 o=2a.R.2b.1J(2c,1),n=5,r=2(){},i=2(){x n.2R(5 4t r&&t?5:t,o.4u(2a.R.2b.1J(2c)))};x r.R=5.R,i.R=Q r,i});', 0, 279, "||function|var|if|this|settings|sm||obj|||||||||||||||||||||||data|return|effect||else|name|parent|position|typeof|google|id|maps|style|opened|li|addClass|js|transform||on|new|prototype|animation|div|for|length|fixed|hover|delay|liDrop||css|50px|removeClass|undefined|find|animationHide|bind|speed|ul|smartmenu|window|break|width|fn|responsive|showOn|each|webkit|keyframe|click|setTimeout|map|object|false|domPrefixes|ms|pfx|true|easing|bottom|margin|styles|case|slide|translateY|translateX|off|animationShow|playKeyframe|duration|timingFunction|resetKeyframe|title|jQuery|call|void|extend|support|elm|document|toLowerCase|append|fullWidth|switch|in|response|showTo|top|define|to|join||hasClass|preventDefault|stopPropagation|amPos|LatLng|zoom|address|geometry|location|Array|slice|arguments|generate|Function|opera|animationstring|keyframeprefix|Webkit|Moz|Khtml|animationName|AnimationName|Animation|meta|viewport|head|scale|smartMenu|sticky|fade|ease|size|left|right|full|opacity|show|from|hide|display|none|index|trigger|smartmenuopen|siblings|wndH|scroll|scrollTop|lat|setCenter|Marker|error|apply|not|keyframeOptions|0ms|iterationCount|direction|fillMode|string|boostKeyframe|is|use|strict|prefixes|toString|Opera|split||createElement|content|device|initial|maximum|300|100|stack|replace|linear|after|block|destroy|remove|removeData|toggle|mouseenter|mouseleave|touchstart|target|parents|outerHeight|offset|height|canvas|parseInt|lng|800976|122|428502|mapTypeId|MapTypeId|ROADMAP|center|Map|Geocoder|geocode|GeocoderStatus|OK|closest|event|resize|This|element|already|has|Method|does|exist|attr|class|type|text|appendTo|getVendorPrefix|isSupported|keyframes|html|filter|Name|play|state|running|pauseKeyframe|paused|resumeKeyframe|normal|forwards|isArray|push|moz|MS|AnimationIteration|AnimationEnd|boost|scale3d|throw|TypeError|what|trying|be|bound|callable|instanceof|concat".split("|"), 0, {}));;!function (t) { "use strict"; t.fn.fitVids = function (e) { var i = { customSelector: null }; if (!document.getElementById("fit-vids-style")) { var r = document.createElement("div"), a = document.getElementsByTagName("base")[0] || document.getElementsByTagName("script")[0]; r.className = "fit-vids-style", r.id = "fit-vids-style", r.style.display = "none", r.innerHTML = "&shy;<style>                 .fluid-width-video-wrapper {                   width: 100%;                                position: relative;                         padding: 0;                              }                                                                                       .fluid-width-video-wrapper iframe,          .fluid-width-video-wrapper object,          .fluid-width-video-wrapper embed {             position: absolute;                         top: 0;                                     left: 0;                                    width: 100%;                                height: 100%;                            }                                         </style>", a.parentNode.insertBefore(r, a) } return e && t.extend(i, e), this.each(function () { var e = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed"]; i.customSelector && e.push(i.customSelector); var r = t(this).find(e.join(",")); (r = r.not("object object")).each(function () { var e = t(this); if (!("embed" === this.tagName.toLowerCase() && e.parent("object").length || e.parent(".fluid-width-video-wrapper").length)) { var i = ("object" === this.tagName.toLowerCase() || e.attr("height") && !isNaN(parseInt(e.attr("height"), 10)) ? parseInt(e.attr("height"), 10) : e.height()) / (isNaN(parseInt(e.attr("width"), 10)) ? e.width() : parseInt(e.attr("width"), 10)); if (!e.attr("id")) { var r = "fitvid" + Math.floor(999999 * Math.random()); e.attr("id", r) } e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", 100 * i + "%"), e.removeAttr("height").removeAttr("width") } }) }) } }(jQuery);;"function" != typeof Object.create && (Object.create = function (t) { function e() { } return e.prototype = t, new e }), function (t, e, o) { var i = { init: function (e, o) { var i = this; i.$elem = t(o), i.options = t.extend({}, t.fn.owlCarousel.options, i.$elem.data(), e), i.userOptions = e, i.loadContent() }, loadContent: function () { var e, o = this; "function" == typeof o.options.beforeInit && o.options.beforeInit.apply(this, [o.$elem]), "string" == typeof o.options.jsonPath ? (e = o.options.jsonPath, t.getJSON(e, function (t) { var e, i = ""; if ("function" == typeof o.options.jsonSuccess) o.options.jsonSuccess.apply(this, [t]); else { for (e in t.owl) t.owl.hasOwnProperty(e) && (i += t.owl[e].item); o.$elem.html(i) } o.logIn() })) : o.logIn() }, logIn: function () { var t = this; t.$elem.data({ "owl-originalStyles": t.$elem.attr("style"), "owl-originalClasses": t.$elem.attr("class") }), t.$elem.css({ opacity: 0 }), t.orignalItems = t.options.items, t.checkBrowser(), t.wrapperWidth = 0, t.checkVisible = null, t.setVars() }, setVars: function () { var t = this; if (0 === t.$elem.children().length) return !1; t.baseClass(), t.eventTypes(), t.$userItems = t.$elem.children(), t.itemsAmount = t.$userItems.length, t.wrapItems(), t.$owlItems = t.$elem.find(".owl-item"), t.$owlWrapper = t.$elem.find(".owl-wrapper"), t.playDirection = "next", t.prevItem = 0, t.prevArr = [0], t.currentItem = 0, t.customEvents(), t.onStartup() }, onStartup: function () { var t = this; t.updateItems(), t.calculateAll(), t.buildControls(), t.updateControls(), t.response(), t.moveEvents(), t.stopOnHover(), t.owlStatus(), !1 !== t.options.transitionStyle && t.transitionTypes(t.options.transitionStyle), !0 === t.options.autoPlay && (t.options.autoPlay = 5e3), t.play(), t.$elem.find(".owl-wrapper").css("display", "block"), t.$elem.is(":visible") ? t.$elem.css("opacity", 1) : t.watchVisibility(), t.onstartup = !1, t.eachMoveUpdate(), "function" == typeof t.options.afterInit && t.options.afterInit.apply(this, [t.$elem]) }, eachMoveUpdate: function () { var t = this; !0 === t.options.lazyLoad && t.lazyLoad(), !0 === t.options.autoHeight && t.autoHeight(), t.onVisibleItems(), "function" == typeof t.options.afterAction && t.options.afterAction.apply(this, [t.$elem]) }, updateVars: function () { var t = this; "function" == typeof t.options.beforeUpdate && t.options.beforeUpdate.apply(this, [t.$elem]), t.watchVisibility(), t.updateItems(), t.calculateAll(), t.updatePosition(), t.updateControls(), t.eachMoveUpdate(), "function" == typeof t.options.afterUpdate && t.options.afterUpdate.apply(this, [t.$elem]) }, reload: function () { var t = this; e.setTimeout(function () { t.updateVars() }, 0) }, watchVisibility: function () { var t = this; if (!1 !== t.$elem.is(":visible")) return !1; t.$elem.css({ opacity: 0 }), e.clearInterval(t.autoPlayInterval), e.clearInterval(t.checkVisible), t.checkVisible = e.setInterval(function () { t.$elem.is(":visible") && (t.reload(), t.$elem.animate({ opacity: 1 }, 200), e.clearInterval(t.checkVisible)) }, 500) }, wrapItems: function () { var t = this; t.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>'), t.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">'), t.wrapperOuter = t.$elem.find(".owl-wrapper-outer"), t.$elem.css("display", "block") }, baseClass: function () { var t = this, e = t.$elem.hasClass(t.options.baseClass), o = t.$elem.hasClass(t.options.theme); e || t.$elem.addClass(t.options.baseClass), o || t.$elem.addClass(t.options.theme) }, updateItems: function () { var e, o, i = this; if (!1 === i.options.responsive) return !1; if (!0 === i.options.singleItem) return i.options.items = i.orignalItems = 1, i.options.itemsCustom = !1, i.options.itemsDesktop = !1, i.options.itemsDesktopSmall = !1, i.options.itemsTablet = !1, i.options.itemsTabletSmall = !1, i.options.itemsMobile = !1, !1; if ((e = t(i.options.responsiveBaseWidth).width()) > (i.options.itemsDesktop[0] || i.orignalItems) && (i.options.items = i.orignalItems), !1 !== i.options.itemsCustom) for (i.options.itemsCustom.sort(function (t, e) { return t[0] - e[0] }), o = 0; o < i.options.itemsCustom.length; o += 1) i.options.itemsCustom[o][0] <= e && (i.options.items = i.options.itemsCustom[o][1]); else e <= i.options.itemsDesktop[0] && !1 !== i.options.itemsDesktop && (i.options.items = i.options.itemsDesktop[1]), e <= i.options.itemsDesktopSmall[0] && !1 !== i.options.itemsDesktopSmall && (i.options.items = i.options.itemsDesktopSmall[1]), e <= i.options.itemsTablet[0] && !1 !== i.options.itemsTablet && (i.options.items = i.options.itemsTablet[1]), e <= i.options.itemsTabletSmall[0] && !1 !== i.options.itemsTabletSmall && (i.options.items = i.options.itemsTabletSmall[1]), e <= i.options.itemsMobile[0] && !1 !== i.options.itemsMobile && (i.options.items = i.options.itemsMobile[1]); i.options.items > i.itemsAmount && !0 === i.options.itemsScaleUp && (i.options.items = i.itemsAmount) }, response: function () { var o, i, s = this; if (!0 !== s.options.responsive) return !1; i = t(e).width(), s.resizer = function () { t(e).width() !== i && (!1 !== s.options.autoPlay && e.clearInterval(s.autoPlayInterval), e.clearTimeout(o), o = e.setTimeout(function () { i = t(e).width(), s.updateVars() }, s.options.responsiveRefreshRate)) }, t(e).resize(s.resizer) }, updatePosition: function () { var t = this; t.jumpTo(t.currentItem), !1 !== t.options.autoPlay && t.checkAp() }, appendItemsSizes: function () { var e = this, o = 0, i = e.itemsAmount - e.options.items; e.$owlItems.each(function (s) { var n = t(this); n.css({ width: e.itemWidth }).data("owl-item", Number(s)), s % e.options.items != 0 && s !== i || s > i || (o += 1), n.data("owl-roundPages", o) }) }, appendWrapperSizes: function () { var t = this, e = t.$owlItems.length * t.itemWidth; t.$owlWrapper.css({ width: 2 * e, left: 0 }), t.appendItemsSizes() }, calculateAll: function () { var t = this; t.calculateWidth(), t.appendWrapperSizes(), t.loops(), t.max() }, calculateWidth: function () { var t = this; t.itemWidth = Math.round(t.$elem.width() / t.options.items) }, max: function () { var t = this, e = -1 * (t.itemsAmount * t.itemWidth - t.options.items * t.itemWidth); return t.options.items > t.itemsAmount ? (t.maximumItem = 0, e = 0, t.maximumPixels = 0) : (t.maximumItem = t.itemsAmount - t.options.items, t.maximumPixels = e), e }, min: function () { return 0 }, loops: function () { var e, o, i = this, s = 0, n = 0; for (i.positionsInArray = [0], i.pagesInArray = [], e = 0; e < i.itemsAmount; e += 1) n += i.itemWidth, i.positionsInArray.push(-n), !0 === i.options.scrollPerPage && (o = t(i.$owlItems[e]).data("owl-roundPages")) !== s && (i.pagesInArray[s] = i.positionsInArray[e], s = o) }, buildControls: function () { var e = this; !0 !== e.options.navigation && !0 !== e.options.pagination || (e.owlControls = t('<div class="owl-controls"/>').toggleClass("clickable", !e.browser.isTouch).appendTo(e.$elem)), !0 === e.options.pagination && e.buildPagination(), !0 === e.options.navigation && e.buildButtons() }, buildButtons: function () { var e = this, o = t('<div class="owl-buttons"/>'); e.owlControls.append(o), e.buttonPrev = t("<div/>", { class: "owl-prev", html: e.options.navigationText[0] || "" }), e.buttonNext = t("<div/>", { class: "owl-next", html: e.options.navigationText[1] || "" }), o.append(e.buttonPrev).append(e.buttonNext), o.on("touchstart.owlControls mousedown.owlControls", 'div[class^="owl"]', function (t) { t.preventDefault() }), o.on("touchend.owlControls mouseup.owlControls", 'div[class^="owl"]', function (o) { o.preventDefault(), t(this).hasClass("owl-next") ? e.next() : e.prev() }) }, buildPagination: function () { var e = this; e.paginationWrapper = t('<div class="owl-pagination"/>'), e.owlControls.append(e.paginationWrapper), e.paginationWrapper.on("touchend.owlControls mouseup.owlControls", ".owl-page", function (o) { o.preventDefault(), Number(t(this).data("owl-page")) !== e.currentItem && e.goTo(Number(t(this).data("owl-page")), !0) }) }, updatePagination: function () { var e, o, i, s, n, a, r = this; if (!1 === r.options.pagination) return !1; for (r.paginationWrapper.html(""), e = 0, o = r.itemsAmount - r.itemsAmount % r.options.items, s = 0; s < r.itemsAmount; s += 1) s % r.options.items == 0 && (e += 1, o === s && (i = r.itemsAmount - r.options.items), n = t("<div/>", { class: "owl-page" }), a = t("<span></span>", { text: !0 === r.options.paginationNumbers ? e : "", class: !0 === r.options.paginationNumbers ? "owl-numbers" : "" }), n.append(a), n.data("owl-page", o === s ? i : s), n.data("owl-roundPages", e), r.paginationWrapper.append(n)); r.checkPagination() }, checkPagination: function () { var e = this; if (!1 === e.options.pagination) return !1; e.paginationWrapper.find(".owl-page").each(function () { t(this).data("owl-roundPages") === t(e.$owlItems[e.currentItem]).data("owl-roundPages") && (e.paginationWrapper.find(".owl-page").removeClass("active"), t(this).addClass("active")) }) }, checkNavigation: function () { var t = this; if (!1 === t.options.navigation) return !1; !1 === t.options.rewindNav && (0 === t.currentItem && 0 === t.maximumItem ? (t.buttonPrev.addClass("disabled"), t.buttonNext.addClass("disabled")) : 0 === t.currentItem && 0 !== t.maximumItem ? (t.buttonPrev.addClass("disabled"), t.buttonNext.removeClass("disabled")) : t.currentItem === t.maximumItem ? (t.buttonPrev.removeClass("disabled"), t.buttonNext.addClass("disabled")) : 0 !== t.currentItem && t.currentItem !== t.maximumItem && (t.buttonPrev.removeClass("disabled"), t.buttonNext.removeClass("disabled"))) }, updateControls: function () { var t = this; t.updatePagination(), t.checkNavigation(), t.owlControls && (t.options.items >= t.itemsAmount ? t.owlControls.hide() : t.owlControls.show()) }, destroyControls: function () { this.owlControls && this.owlControls.remove() }, next: function (t) { var e = this; if (e.isTransition) return !1; if (e.currentItem += !0 === e.options.scrollPerPage ? e.options.items : 1, e.currentItem > e.maximumItem + (!0 === e.options.scrollPerPage ? e.options.items - 1 : 0)) { if (!0 !== e.options.rewindNav) return e.currentItem = e.maximumItem, !1; e.currentItem = 0, t = "rewind" } e.goTo(e.currentItem, t) }, prev: function (t) { var e = this; if (e.isTransition) return !1; if (!0 === e.options.scrollPerPage && e.currentItem > 0 && e.currentItem < e.options.items ? e.currentItem = 0 : e.currentItem -= !0 === e.options.scrollPerPage ? e.options.items : 1, e.currentItem < 0) { if (!0 !== e.options.rewindNav) return e.currentItem = 0, !1; e.currentItem = e.maximumItem, t = "rewind" } e.goTo(e.currentItem, t) }, goTo: function (t, o, i) { var s, n = this; return !n.isTransition && ("function" == typeof n.options.beforeMove && n.options.beforeMove.apply(this, [n.$elem]), t >= n.maximumItem ? t = n.maximumItem : t <= 0 && (t = 0), n.currentItem = n.owl.currentItem = t, !1 !== n.options.transitionStyle && "drag" !== i && 1 === n.options.items && !0 === n.browser.support3d ? (n.swapSpeed(0), !0 === n.browser.support3d ? n.transition3d(n.positionsInArray[t]) : n.css2slide(n.positionsInArray[t], 1), n.afterGo(), n.singleItemTransition(), !1) : (s = n.positionsInArray[t], !0 === n.browser.support3d ? (n.isCss3Finish = !1, !0 === o ? (n.swapSpeed("paginationSpeed"), e.setTimeout(function () { n.isCss3Finish = !0 }, n.options.paginationSpeed)) : "rewind" === o ? (n.swapSpeed(n.options.rewindSpeed), e.setTimeout(function () { n.isCss3Finish = !0 }, n.options.rewindSpeed)) : (n.swapSpeed("slideSpeed"), e.setTimeout(function () { n.isCss3Finish = !0 }, n.options.slideSpeed)), n.transition3d(s)) : !0 === o ? n.css2slide(s, n.options.paginationSpeed) : "rewind" === o ? n.css2slide(s, n.options.rewindSpeed) : n.css2slide(s, n.options.slideSpeed), void n.afterGo())) }, jumpTo: function (t) { var e = this; "function" == typeof e.options.beforeMove && e.options.beforeMove.apply(this, [e.$elem]), t >= e.maximumItem || -1 === t ? t = e.maximumItem : t <= 0 && (t = 0), e.swapSpeed(0), !0 === e.browser.support3d ? e.transition3d(e.positionsInArray[t]) : e.css2slide(e.positionsInArray[t], 1), e.currentItem = e.owl.currentItem = t, e.afterGo() }, afterGo: function () { var t = this; t.prevArr.push(t.currentItem), t.prevItem = t.owl.prevItem = t.prevArr[t.prevArr.length - 2], t.prevArr.shift(0), t.prevItem !== t.currentItem && (t.checkPagination(), t.checkNavigation(), t.eachMoveUpdate(), !1 !== t.options.autoPlay && t.checkAp()), "function" == typeof t.options.afterMove && t.prevItem !== t.currentItem && t.options.afterMove.apply(this, [t.$elem]) }, stop: function () { this.apStatus = "stop", e.clearInterval(this.autoPlayInterval) }, checkAp: function () { "stop" !== this.apStatus && this.play() }, play: function () { var t = this; if (t.apStatus = "play", !1 === t.options.autoPlay) return !1; e.clearInterval(t.autoPlayInterval), t.autoPlayInterval = e.setInterval(function () { t.next(!0) }, t.options.autoPlay) }, swapSpeed: function (t) { var e = this; "slideSpeed" === t ? e.$owlWrapper.css(e.addCssSpeed(e.options.slideSpeed)) : "paginationSpeed" === t ? e.$owlWrapper.css(e.addCssSpeed(e.options.paginationSpeed)) : "string" != typeof t && e.$owlWrapper.css(e.addCssSpeed(t)) }, addCssSpeed: function (t) { return { "-webkit-transition": "all " + t + "ms ease", "-moz-transition": "all " + t + "ms ease", "-o-transition": "all " + t + "ms ease", transition: "all " + t + "ms ease" } }, removeTransition: function () { return { "-webkit-transition": "", "-moz-transition": "", "-o-transition": "", transition: "" } }, doTranslate: function (t) { return { "-webkit-transform": "translate3d(" + t + "px, 0px, 0px)", "-moz-transform": "translate3d(" + t + "px, 0px, 0px)", "-o-transform": "translate3d(" + t + "px, 0px, 0px)", "-ms-transform": "translate3d(" + t + "px, 0px, 0px)", transform: "translate3d(" + t + "px, 0px,0px)" } }, transition3d: function (t) { this.$owlWrapper.css(this.doTranslate(t)) }, css2move: function (t) { this.$owlWrapper.css({ left: t }) }, css2slide: function (t, e) { var o = this; o.isCssFinish = !1, o.$owlWrapper.stop(!0, !0).animate({ left: t }, { duration: e || o.options.slideSpeed, complete: function () { o.isCssFinish = !0 } }) }, checkBrowser: function () { var t, i, s, n, a = "translate3d(0px, 0px, 0px)", r = o.createElement("div"); r.style.cssText = "  -moz-transform:" + a + "; -ms-transform:" + a + "; -o-transform:" + a + "; -webkit-transform:" + a + "; transform:" + a, t = /translate3d\(0px, 0px, 0px\)/g, s = null !== (i = r.style.cssText.match(t)) && 1 === i.length, n = "ontouchstart" in e || e.navigator.msMaxTouchPoints, this.browser = { support3d: s, isTouch: n } }, moveEvents: function () { !1 === this.options.mouseDrag && !1 === this.options.touchDrag || (this.gestures(), this.disabledEvents()) }, eventTypes: function () { var t = this, e = ["s", "e", "x"]; t.ev_types = {}, !0 === t.options.mouseDrag && !0 === t.options.touchDrag ? e = ["touchstart.owl mousedown.owl", "touchmove.owl mousemove.owl", "touchend.owl touchcancel.owl mouseup.owl"] : !1 === t.options.mouseDrag && !0 === t.options.touchDrag ? e = ["touchstart.owl", "touchmove.owl", "touchend.owl touchcancel.owl"] : !0 === t.options.mouseDrag && !1 === t.options.touchDrag && (e = ["mousedown.owl", "mousemove.owl", "mouseup.owl"]), t.ev_types.start = e[0], t.ev_types.move = e[1], t.ev_types.end = e[2] }, disabledEvents: function () { this.$elem.on("dragstart.owl", function (t) { t.preventDefault() }), this.$elem.on("mousedown.disableTextSelect", function (e) { return t(e.target).is("input, textarea, select, option") }) }, gestures: function () { var i = this, s = { offsetX: 0, offsetY: 0, baseElWidth: 0, relativePos: 0, position: null, minSwipe: null, maxSwipe: null, sliding: null, dargging: null, targetElement: null }; function n(t) { if (void 0 !== t.touches) return { x: t.touches[0].pageX, y: t.touches[0].pageY }; if (void 0 === t.touches) { if (void 0 !== t.pageX) return { x: t.pageX, y: t.pageY }; if (void 0 === t.pageX) return { x: t.clientX, y: t.clientY } } } function a(e) { "on" === e ? (t(o).on(i.ev_types.move, r), t(o).on(i.ev_types.end, l)) : "off" === e && (t(o).off(i.ev_types.move), t(o).off(i.ev_types.end)) } function r(a) { var r, l, p = a.originalEvent || a || e.event; i.newPosX = n(p).x - s.offsetX, i.newPosY = n(p).y - s.offsetY, i.newRelativeX = i.newPosX - s.relativePos, "function" == typeof i.options.startDragging && !0 !== s.dragging && 0 !== i.newRelativeX && (s.dragging = !0, i.options.startDragging.apply(i, [i.$elem])), (i.newRelativeX > 8 || i.newRelativeX < -8) && !0 === i.browser.isTouch && (void 0 !== p.preventDefault ? p.preventDefault() : p.returnValue = !1, s.sliding = !0), (i.newPosY > 10 || i.newPosY < -10) && !1 === s.sliding && t(o).off("touchmove.owl"), r = function () { return i.newRelativeX / 5 }, l = function () { return i.maximumPixels + i.newRelativeX / 5 }, i.newPosX = Math.max(Math.min(i.newPosX, r()), l()), !0 === i.browser.support3d ? i.transition3d(i.newPosX) : i.css2move(i.newPosX) } function l(o) { var n, r, l, p = o.originalEvent || o || e.event; p.target = p.target || p.srcElement, s.dragging = !1, !0 !== i.browser.isTouch && i.$owlWrapper.removeClass("grabbing"), i.newRelativeX < 0 ? i.dragDirection = i.owl.dragDirection = "left" : i.dragDirection = i.owl.dragDirection = "right", 0 !== i.newRelativeX && (n = i.getNewPosition(), i.goTo(n, !1, "drag"), s.targetElement === p.target && !0 !== i.browser.isTouch && (t(p.target).on("click.disable", function (e) { e.stopImmediatePropagation(), e.stopPropagation(), e.preventDefault(), t(e.target).off("click.disable") }), l = (r = t._data(p.target, "events").click).pop(), r.splice(0, 0, l))), a("off") } i.isCssFinish = !0, i.$elem.on(i.ev_types.start, ".owl-wrapper", function (o) { var r, l = o.originalEvent || o || e.event; if (3 === l.which) return !1; if (!(i.itemsAmount <= i.options.items)) { if (!1 === i.isCssFinish && !i.options.dragBeforeAnimFinish) return !1; if (!1 === i.isCss3Finish && !i.options.dragBeforeAnimFinish) return !1; !1 !== i.options.autoPlay && e.clearInterval(i.autoPlayInterval), !0 === i.browser.isTouch || i.$owlWrapper.hasClass("grabbing") || i.$owlWrapper.addClass("grabbing"), i.newPosX = 0, i.newRelativeX = 0, t(this).css(i.removeTransition()), r = t(this).position(), s.relativePos = r.left, s.offsetX = n(l).x - r.left, s.offsetY = n(l).y - r.top, a("on"), s.sliding = !1, s.targetElement = l.target || l.srcElement } }) }, getNewPosition: function () { var t = this, e = t.closestItem(); return e > t.maximumItem ? (t.currentItem = t.maximumItem, e = t.maximumItem) : t.newPosX >= 0 && (e = 0, t.currentItem = 0), e }, closestItem: function () { var e = this, o = !0 === e.options.scrollPerPage ? e.pagesInArray : e.positionsInArray, i = e.newPosX, s = null; return t.each(o, function (n, a) { i - e.itemWidth / 20 > o[n + 1] && i - e.itemWidth / 20 < a && "left" === e.moveDirection() ? (s = a, !0 === e.options.scrollPerPage ? e.currentItem = t.inArray(s, e.positionsInArray) : e.currentItem = n) : i + e.itemWidth / 20 < a && i + e.itemWidth / 20 > (o[n + 1] || o[n] - e.itemWidth) && "right" === e.moveDirection() && (!0 === e.options.scrollPerPage ? (s = o[n + 1] || o[o.length - 1], e.currentItem = t.inArray(s, e.positionsInArray)) : (s = o[n + 1], e.currentItem = n + 1)) }), e.currentItem }, moveDirection: function () { var t; return this.newRelativeX < 0 ? (t = "right", this.playDirection = "next") : (t = "left", this.playDirection = "prev"), t }, customEvents: function () { var t = this; t.$elem.on("owl.next", function () { t.next() }), t.$elem.on("owl.prev", function () { t.prev() }), t.$elem.on("owl.play", function (e, o) { t.options.autoPlay = o, t.play(), t.hoverStatus = "play" }), t.$elem.on("owl.stop", function () { t.stop(), t.hoverStatus = "stop" }), t.$elem.on("owl.goTo", function (e, o) { t.goTo(o) }), t.$elem.on("owl.jumpTo", function (e, o) { t.jumpTo(o) }) }, stopOnHover: function () { var t = this; !0 === t.options.stopOnHover && !0 !== t.browser.isTouch && !1 !== t.options.autoPlay && (t.$elem.on("mouseover", function () { t.stop() }), t.$elem.on("mouseout", function () { "stop" !== t.hoverStatus && t.play() })) }, lazyLoad: function () { var e, o, i, s, n = this; if (!1 === n.options.lazyLoad) return !1; for (e = 0; e < n.itemsAmount; e += 1) "loaded" !== (o = t(n.$owlItems[e])).data("owl-loaded") && (i = o.data("owl-item"), "string" == typeof (s = o.find(".lazyOwl")).data("src") ? (void 0 === o.data("owl-loaded") && (s.hide(), o.addClass("loading").data("owl-loaded", "checked")), (!0 !== n.options.lazyFollow || i >= n.currentItem) && i < n.currentItem + n.options.items && s.length && s.each(function () { n.lazyPreload(o, t(this)) })) : o.data("owl-loaded", "loaded")) }, lazyPreload: function (t, o) { var i, s = this, n = 0; function a() { t.data("owl-loaded", "loaded").removeClass("loading"), o.removeAttr("data-src"), "fade" === s.options.lazyEffect ? o.fadeIn(400) : o.show(), "function" == typeof s.options.afterLazyLoad && s.options.afterLazyLoad.apply(this, [s.$elem]) } "DIV" === o.prop("tagName") ? (o.css("background-image", "url(" + o.data("src") + ")"), i = !0) : o[0].src = o.data("src"), function t() { n += 1, s.completeImg(o.get(0)) || !0 === i ? a() : n <= 100 ? e.setTimeout(t, 100) : a() }() }, autoHeight: function () { var o, i = this, s = t(i.$owlItems[i.currentItem]).find("img"); function n() { var o = t(i.$owlItems[i.currentItem]).height(); i.wrapperOuter.css("height", o + "px"), i.wrapperOuter.hasClass("autoHeight") || e.setTimeout(function () { i.wrapperOuter.addClass("autoHeight") }, 0) } void 0 !== s.get(0) ? (o = 0, function t() { o += 1, i.completeImg(s.get(0)) ? n() : o <= 100 ? e.setTimeout(t, 100) : i.wrapperOuter.css("height", "") }()) : n() }, completeImg: function (t) { return !!t.complete && ("undefined" === typeof t.naturalWidth || 0 !== t.naturalWidth) }, onVisibleItems: function () { var e, o = this; for (!0 === o.options.addClassActive && o.$owlItems.removeClass("active"), o.visibleItems = [], e = o.currentItem; e < o.currentItem + o.options.items; e += 1) o.visibleItems.push(e), !0 === o.options.addClassActive && t(o.$owlItems[e]).addClass("active"); o.owl.visibleItems = o.visibleItems }, transitionTypes: function (t) { this.outClass = "owl-" + t + "-out", this.inClass = "owl-" + t + "-in" }, singleItemTransition: function () { var t, e = this, o = e.outClass, i = e.inClass, s = e.$owlItems.eq(e.currentItem), n = e.$owlItems.eq(e.prevItem), a = Math.abs(e.positionsInArray[e.currentItem]) + e.positionsInArray[e.prevItem], r = Math.abs(e.positionsInArray[e.currentItem]) + e.itemWidth / 2, l = "webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend"; e.isTransition = !0, e.$owlWrapper.addClass("owl-origin").css({ "-webkit-transform-origin": r + "px", "-moz-perspective-origin": r + "px", "perspective-origin": r + "px" }), n.css((t = a, { position: "relative", left: t + "px" })).addClass(o).on(l, function () { e.endPrev = !0, n.off(l), e.clearTransStyle(n, o) }), s.addClass(i).on(l, function () { e.endCurrent = !0, s.off(l), e.clearTransStyle(s, i) }) }, clearTransStyle: function (t, e) { var o = this; t.css({ position: "", left: "" }).removeClass(e), o.endPrev && o.endCurrent && (o.$owlWrapper.removeClass("owl-origin"), o.endPrev = !1, o.endCurrent = !1, o.isTransition = !1) }, owlStatus: function () { var t = this; t.owl = { userOptions: t.userOptions, baseElement: t.$elem, userItems: t.$userItems, owlItems: t.$owlItems, currentItem: t.currentItem, prevItem: t.prevItem, visibleItems: t.visibleItems, isTouch: t.browser.isTouch, browser: t.browser, dragDirection: t.dragDirection } }, clearEvents: function () { this.$elem.off(".owl owl mousedown.disableTextSelect"), t(o).off(".owl owl"), t(e).off("resize", this.resizer) }, unWrap: function () { var t = this; 0 !== t.$elem.children().length && (t.$owlWrapper.unwrap(), t.$userItems.unwrap().unwrap(), t.owlControls && t.owlControls.remove()), t.clearEvents(), t.$elem.attr({ style: t.$elem.data("owl-originalStyles") || "", class: t.$elem.data("owl-originalClasses") }) }, destroy: function () { this.stop(), e.clearInterval(this.checkVisible), this.unWrap(), this.$elem.removeData() }, reinit: function (e) { var o = t.extend({}, this.userOptions, e); this.unWrap(), this.init(o, this.$elem) }, addItem: function (t, e) { var o, i = this; return !!t && (0 === i.$elem.children().length ? (i.$elem.append(t), i.setVars(), !1) : (i.unWrap(), (o = void 0 === e || -1 === e ? -1 : e) >= i.$userItems.length || -1 === o ? i.$userItems.eq(-1).after(t) : i.$userItems.eq(o).before(t), void i.setVars())) }, removeItem: function (t) { var e; if (0 === this.$elem.children().length) return !1; e = void 0 === t || -1 === t ? -1 : t, this.unWrap(), this.$userItems.eq(e).remove(), this.setVars() } }; t.fn.owlCarousel = function (e) { return this.each(function () { if (!0 === t(this).data("owl-init")) return !1; t(this).data("owl-init", !0); var o = Object.create(i); o.init(e, this), t.data(this, "owlCarousel", o) }) }, t.fn.owlCarousel.options = { items: 5, itemsCustom: !1, itemsDesktop: [1199, 4], itemsDesktopSmall: [979, 3], itemsTablet: [768, 2], itemsTabletSmall: !1, itemsMobile: [479, 1], singleItem: !1, itemsScaleUp: !1, slideSpeed: 200, paginationSpeed: 800, rewindSpeed: 1e3, autoPlay: !1, stopOnHover: !1, navigation: !1, navigationText: ["prev", "next"], rewindNav: !0, scrollPerPage: !1, pagination: !0, paginationNumbers: !1, responsive: !0, responsiveRefreshRate: 200, responsiveBaseWidth: e, baseClass: "owl-carousel", theme: "owl-theme", lazyLoad: !1, lazyFollow: !0, lazyEffect: "fade", autoHeight: !1, jsonPath: !1, jsonSuccess: !1, dragBeforeAnimFinish: !0, mouseDrag: !0, touchDrag: !0, addClassActive: !1, transitionStyle: !1, beforeUpdate: !1, afterUpdate: !1, beforeInit: !1, afterInit: !1, beforeMove: !1, afterMove: !1, afterAction: !1, startDragging: !1, afterLazyLoad: !1 } }(jQuery, window, document);;!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function n(e){return u.raw?e:encodeURIComponent(e)}function o(e){return u.raw?e:decodeURIComponent(e)}function i(e){return n(u.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(c," ")),u.json?JSON.parse(e):e}catch(n){}}function t(n,o){var i=u.raw?n:r(n);return e.isFunction(o)?o(i):i}var c=/\+/g,u=e.cookie=function(r,c,f){if(void 0!==c&&!e.isFunction(c)){if(f=e.extend({},u.defaults,f),"number"==typeof f.expires){var a=f.expires,d=f.expires=new Date;d.setTime(+d+864e5*a)}return document.cookie=[n(r),"=",i(c),f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}for(var p=r?void 0:{},s=document.cookie?document.cookie.split("; "):[],m=0,x=s.length;x>m;m++){var v=s[m].split("="),k=o(v.shift()),l=v.join("=");if(r&&r===k){p=t(l,c);break}r||void 0===(l=t(l))||(p[k]=l)}return p};u.defaults={},e.removeCookie=function(n,o){return void 0===e.cookie(n)?!1:(e.cookie(n,"",e.extend({},o,{expires:-1})),!e.cookie(n))}});;!function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery) }(function (e) { e.fn.tweet = function (t) { var r = e.extend({ modpath: "./includes/twitter/", username: null, list_id: null, list: null, favorites: !1, query: null, avatar_size: null, count: 3, fetch: null, page: 1, retweets: !0, intro_text: null, outro_text: null, join_text: null, auto_join_text_default: "i said,", auto_join_text_ed: "i", auto_join_text_ing: "i am", auto_join_text_reply: "i replied to", auto_join_text_url: "i was looking at", loading_text: null, refresh_interval: null, twitter_url: "twitter.com", twitter_api_url: "api.twitter.com", twitter_search_url: "api.twitter.com", template: "{avatar}{time}{join}{text}", comparator: function (e, t) { return t.tweet_time - e.tweet_time }, filter: function (e) { return !0 } }, t), a = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi; function n(e, t) { if ("string" == typeof e) { var r = e; for (var a in t) { var n = t[a]; r = r.replace(new RegExp("{" + a + "}", "g"), null === n ? "" : n) } return r } return e(t) } function i(t, r) { return function () { var a = []; return this.each(function () { a.push(this.replace(t, r)) }), e(a) } } function s(e) { return e.replace(/</g, "&lt;").replace(/>/g, "^&gt;") } function u(t) { var i, u, o, l, _ = {}; return _.item = t, _.source = t.source, _.name = t.from_user_name || t.user.name, _.screen_name = t.from_user || t.user.screen_name, _.avatar_size = r.avatar_size, _.avatar_url = function e(t, r) { return r ? "user" in t ? t.user.profile_image_url_https : e(t, !1).replace(/^http:\/\/[a-z0-9]{1,3}\.twimg\.com\//, "https://s3.amazonaws.com/twitter_production/") : t.profile_image_url || t.user.profile_image_url }(t, "https:" === document.location.protocol), _.retweet = void 0 !== t.retweeted_status, _.tweet_time = (i = t.created_at, Date.parse(i.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, "$1,$2$4$3"))), _.join_text = "auto" == r.join_text ? (u = t.text).match(/^(@([A-Za-z0-9-_]+)) .*/i) ? r.auto_join_text_reply : u.match(a) ? r.auto_join_text_url : u.match(/^((\w+ed)|just) .*/im) ? r.auto_join_text_ed : u.match(/^(\w*ing) .*/i) ? r.auto_join_text_ing : r.auto_join_text_default : r.join_text, _.tweet_id = t.id_str, _.twitter_base = "http://" + r.twitter_url + "/", _.user_url = _.twitter_base + _.screen_name, _.tweet_url = _.user_url + "/status/" + _.tweet_id, _.reply_url = _.twitter_base + "intent/tweet?in_reply_to=" + _.tweet_id, _.retweet_url = _.twitter_base + "intent/retweet?tweet_id=" + _.tweet_id, _.favorite_url = _.twitter_base + "intent/favorite?tweet_id=" + _.tweet_id, _.retweeted_screen_name = _.retweet && t.retweeted_status.user.screen_name, _.tweet_relative_time = function (e) { var t = arguments.length > 1 ? arguments[1] : new Date, r = parseInt((t.getTime() - e) / 1e3, 10); return r < 1 ? "just now" : r < 60 ? r + " seconds ago" : r < 120 ? "about a minute ago" : r < 2700 ? "about " + parseInt(r / 60, 10).toString() + " minutes ago" : r < 7200 ? "about an hour ago" : r < 86400 ? "about " + parseInt(r / 3600, 10).toString() + " hours ago" : r < 172800 ? "about a day ago" : "about " + parseInt(r / 86400, 10).toString() + " days ago" }(_.tweet_time), _.entities = t.entities ? (t.entities.urls || []).concat(t.entities.media || []) : [], _.tweet_raw_text = _.retweet ? "RT @" + _.retweeted_screen_name + " " + t.retweeted_status.text : t.text, _.tweet_text = e([(o = _.tweet_raw_text, l = _.entities, o.replace(a, function (e) { for (var t = /^[a-z]+:/i.test(e) ? e : "http://" + e, r = e, a = 0; a < l.length; ++a) { var n = l[a]; if (n.url == t && n.expanded_url) { t = n.expanded_url, r = n.display_url; break } } return '<a href="' + s(t) + '">' + s(r) + "</a>" }))]).linkUser().linkHash()[0], _.tweet_text_fancy = e([_.tweet_text]).makeHeart()[0], _.user = n('<a class="tweet_user" href="{user_url}">{screen_name}</a>', _), _.join = r.join_text ? n(' <span class="tweet_join">{join_text}</span> ', _) : " ", _.avatar = _.avatar_size ? n('<a class="tweet_avatar" href="{user_url}"><img src="{avatar_url}" height="{avatar_size}" width="{avatar_size}" alt="{screen_name}\'s avatar" title="{screen_name}\'s avatar" border="0"/></a>', _) : "", _.time = n('<span class="tweet-time"><a href="{tweet_url}" title="view tweet on twitter">{tweet_relative_time}</a></span>', _), _.text = n('<span class="tweet-text">{tweet_text_fancy}</span>', _), _.reply_action = n('<a class="tweet_action tweet_reply" href="{reply_url}">reply</a>', _), _.retweet_action = n('<a class="tweet_action tweet_retweet" href="{retweet_url}">retweet</a>', _), _.favorite_action = n('<a class="tweet_action tweet_favorite" href="{favorite_url}">favorite</a>', _), _ } return e.extend({ tweet: { t: n } }), e.fn.extend({ linkUser: i(/(^|[\W])@(\w+)/gi, '$1<span class="at">@</span><a href="http://' + r.twitter_url + '/$2">$2</a>'), linkHash: i(/(?:^| )[\#]+([\w\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0600-\u06ff]+)/gi, ' <a href="https://twitter.com/search?q=%23$1' + (r.username && 1 == r.username.length && !r.list ? "&from=" + r.username.join("%2BOR%2B") : "") + '" class="tweet_hashtag">#$1</a>'), makeHeart: i(/(&lt;)+[3]/gi, "<tt class='heart'>&#x2665;</tt>") }), this.each(function (t, a) { var i = e('<ul class="tweet-list">'), s = '<p class="tweet-intro">' + r.intro_text + "</p>", o = '<p class="tweet-outro">' + r.outro_text + "</p>", l = e('<p class="loading">' + r.loading_text + "</p>"); r.username && "string" == typeof r.username && (r.username = [r.username]), e(a).unbind("tweet:load").bind("tweet:load", function () { r.loading_text && e(a).empty().append(l), e.ajax({ dataType: "json", type: "post", async: !1, url: r.modpath || "/twitter/", data: { request: function () { r.modpath; var t = null === r.fetch ? r.count : r.fetch, a = { include_entities: 1 }; if (r.list) return { host: r.twitter_api_url, url: "/1.1/lists/statuses.json", parameters: e.extend({}, a, { list_id: r.list_id, slug: r.list, owner_screen_name: r.username, page: r.page, count: t, include_rts: r.retweets ? 1 : 0 }) }; if (r.favorites) return { host: r.twitter_api_url, url: "/1.1/favorites/list.json", parameters: e.extend({}, a, { list_id: r.list_id, screen_name: r.username, page: r.page, count: t }) }; if (null === r.query && 1 === r.username.length) return { host: r.twitter_api_url, url: "/1.1/statuses/user_timeline.json", parameters: e.extend({}, a, { screen_name: r.username, page: r.page, count: t, include_rts: r.retweets ? 1 : 0 }) }; var n = r.query || "from:" + r.username.join(" OR from:"); return { host: r.twitter_search_url, url: "/1.1/search/tweets.json", parameters: e.extend({}, a, { q: n, count: t }) } }() }, success: function (t, l) { t.message && console.log(t.message); var _ = t.response; e(a).empty().append(i), r.intro_text && i.before(s), i.empty(), void 0 !== _.statuses ? resp = _.statuses : void 0 !== _.results ? resp = _.results : resp = _; var c = e.map(resp, u); c = e.grep(c, r.filter).sort(r.comparator).slice(0, r.count), i.append(e.map(c, function (e) { return "<li>" + n(r.template, e) + "</li>" }).join("")).children("li:first").addClass("tweet-first").end().children("li:odd").addClass("tweet-even").end().children("li:even").addClass("tweet-odd"), r.outro_text && i.after(o), e(a).trigger("loaded").trigger(c ? "empty" : "full"), r.refresh_interval && window.setTimeout(function () { e(a).trigger("tweet:load") }, 1e3 * r.refresh_interval) } }) }).trigger("tweet:load") }) } });;!function ($) { "use strict"; var escape = /["\\\x00-\x1f\x7f-\x9f]/g, meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, hasOwn = Object.prototype.hasOwnProperty; $.toJSON = "object" == typeof JSON && JSON.stringify ? JSON.stringify : function (t) { if (null === t) return "null"; var e, r, n, o, i = $.type(t); if ("undefined" !== i) { if ("number" === i || "boolean" === i) return String(t); if ("string" === i) return $.quoteString(t); if ("function" == typeof t.toJSON) return $.toJSON(t.toJSON()); if ("date" === i) { var f = t.getUTCMonth() + 1, u = t.getUTCDate(), s = t.getUTCFullYear(), a = t.getUTCHours(), l = t.getUTCMinutes(), c = t.getUTCSeconds(), p = t.getUTCMilliseconds(); return f < 10 && (f = "0" + f), u < 10 && (u = "0" + u), a < 10 && (a = "0" + a), l < 10 && (l = "0" + l), c < 10 && (c = "0" + c), p < 100 && (p = "0" + p), p < 10 && (p = "0" + p), '"' + s + "-" + f + "-" + u + "T" + a + ":" + l + ":" + c + "." + p + 'Z"' } if (e = [], $.isArray(t)) { for (r = 0; r < t.length; r++) e.push($.toJSON(t[r]) || "null"); return "[" + e.join(",") + "]" } if ("object" == typeof t) { for (r in t) if (hasOwn.call(t, r)) { if ("number" === (i = typeof r)) n = '"' + r + '"'; else { if ("string" !== i) continue; n = $.quoteString(r) } "function" !== (i = typeof t[r]) && "undefined" !== i && (o = $.toJSON(t[r]), e.push(n + ":" + o)) } return "{" + e.join(",") + "}" } } }, $.evalJSON = "object" == typeof JSON && JSON.parse ? JSON.parse : function (str) { return eval("(" + str + ")") }, $.secureEvalJSON = "object" == typeof JSON && JSON.parse ? JSON.parse : function (str) { var filtered = str.replace(/\\["\\\/bfnrtu]/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""); if (/^[\],:{}\s]*$/.test(filtered)) return eval("(" + str + ")"); throw new SyntaxError("Error parsing JSON, source is not valid.") }, $.quoteString = function (t) { return t.match(escape) ? '"' + t.replace(escape, function (t) { var e = meta[t]; return "string" == typeof e ? e : (e = t.charCodeAt(), "\\u00" + Math.floor(e / 16).toString(16) + (e % 16).toString(16)) }) + '"' : '"' + t + '"' } }(jQuery);;!function (e) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], e) : e("undefined" != typeof jQuery ? jQuery : window.Zepto) }(function (e) { "use strict"; var t = {}; t.fileapi = void 0 !== e("<input type='file'/>").get(0).files, t.formdata = void 0 !== window.FormData; var r = !!e.fn.prop; function a(t) { var r = t.data; t.isDefaultPrevented() || (t.preventDefault(), e(t.target).ajaxSubmit(r)) } function n(t) { var r = t.target, a = e(r); if (!a.is("[type=submit],[type=image]")) { var n = a.closest("[type=submit]"); if (0 === n.length) return; r = n[0] } var i = this; if (i.clk = r, "image" == r.type) if (void 0 !== t.offsetX) i.clk_x = t.offsetX, i.clk_y = t.offsetY; else if ("function" == typeof e.fn.offset) { var o = a.offset(); i.clk_x = t.pageX - o.left, i.clk_y = t.pageY - o.top } else i.clk_x = t.pageX - r.offsetLeft, i.clk_y = t.pageY - r.offsetTop; setTimeout(function () { i.clk = i.clk_x = i.clk_y = null }, 100) } function i() { if (e.fn.ajaxSubmit.debug) { var t = "[jquery.form] " + Array.prototype.join.call(arguments, ""); window.console && window.console.log ? window.console.log(t) : window.opera && window.opera.postError && window.opera.postError(t) } } e.fn.attr2 = function () { if (!r) return this.attr.apply(this, arguments); var e = this.prop.apply(this, arguments); return e && e.jquery || "string" == typeof e ? e : this.attr.apply(this, arguments) }, e.fn.ajaxSubmit = function (a) { if (!this.length) return i("ajaxSubmit: skipping submit process - no element selected"), this; var n, o, s, u = this; "function" == typeof a ? a = { success: a } : void 0 === a && (a = {}), n = a.type || this.attr2("method"), (s = (s = "string" == typeof (o = a.url || this.attr2("action")) ? e.trim(o) : "") || window.location.href || "") && (s = (s.match(/^([^#]+)/) || [])[1]), a = e.extend(!0, { url: s, success: e.ajaxSettings.success, type: n || e.ajaxSettings.type, iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank" }, a); var c = {}; if (this.trigger("form-pre-serialize", [this, a, c]), c.veto) return i("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this; if (a.beforeSerialize && !1 === a.beforeSerialize(this, a)) return i("ajaxSubmit: submit aborted via beforeSerialize callback"), this; var l = a.traditional; void 0 === l && (l = e.ajaxSettings.traditional); var f, m = [], d = this.formToArray(a.semantic, m); if (a.data && (a.extraData = a.data, f = e.param(a.data, l)), a.beforeSubmit && !1 === a.beforeSubmit(d, this, a)) return i("ajaxSubmit: submit aborted via beforeSubmit callback"), this; if (this.trigger("form-submit-validate", [d, this, a, c]), c.veto) return i("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this; var p = e.param(d, l); f && (p = p ? p + "&" + f : f), "GET" == a.type.toUpperCase() ? (a.url += (a.url.indexOf("?") >= 0 ? "&" : "?") + p, a.data = null) : a.data = p; var h = []; if (a.resetForm && h.push(function () { u.resetForm() }), a.clearForm && h.push(function () { u.clearForm(a.includeHidden) }), !a.dataType && a.target) { var v = a.success || function () { }; h.push(function (t) { var r = a.replaceTarget ? "replaceWith" : "html"; e(a.target)[r](t).each(v, arguments) }) } else a.success && h.push(a.success); if (a.success = function (e, t, r) { for (var n = a.context || this, i = 0, o = h.length; i < o; i++) h[i].apply(n, [e, t, r || u, u]) }, a.error) { var g = a.error; a.error = function (e, t, r) { var n = a.context || this; g.apply(n, [e, t, r, u]) } } if (a.complete) { var x = a.complete; a.complete = function (e, t) { var r = a.context || this; x.apply(r, [e, t, u]) } } var b = e("input[type=file]:enabled", this).filter(function () { return "" !== e(this).val() }).length > 0, y = "multipart/form-data", T = u.attr("enctype") == y || u.attr("encoding") == y, j = t.fileapi && t.formdata; i("fileAPI :" + j); var w, S = (b || T) && !j; !1 !== a.iframe && (a.iframe || S) ? a.closeKeepAlive ? e.get(a.closeKeepAlive, function () { w = k(d) }) : w = k(d) : w = (b || T) && j ? function (t) { for (var r = new FormData, i = 0; i < t.length; i++) r.append(t[i].name, t[i].value); if (a.extraData) { var o = function (t) { var r, n, i = e.param(t, a.traditional).split("&"), o = i.length, s = []; for (r = 0; r < o; r++) i[r] = i[r].replace(/\+/g, " "), n = i[r].split("="), s.push([decodeURIComponent(n[0]), decodeURIComponent(n[1])]); return s }(a.extraData); for (i = 0; i < o.length; i++) o[i] && r.append(o[i][0], o[i][1]) } a.data = null; var s = e.extend(!0, {}, e.ajaxSettings, a, { contentType: !1, processData: !1, cache: !1, type: n || "POST" }); a.uploadProgress && (s.xhr = function () { var t = e.ajaxSettings.xhr(); return t.upload && t.upload.addEventListener("progress", function (e) { var t = 0, r = e.loaded || e.position, n = e.total; e.lengthComputable && (t = Math.ceil(r / n * 100)), a.uploadProgress(e, r, n, t) }, !1), t }); s.data = null; var u = s.beforeSend; return s.beforeSend = function (e, t) { a.formData ? t.data = a.formData : t.data = r, u && u.call(this, e, t) }, e.ajax(s) }(d) : e.ajax(a), u.removeData("jqxhr").data("jqxhr", w); for (var D = 0; D < m.length; D++) m[D] = null; return this.trigger("form-submit-notify", [this, a]), this; function k(t) { var o, s, c, l, f, d, p, h, v, g, x, b, y = u[0], T = e.Deferred(); if (T.abort = function (e) { h.abort(e) }, t) for (s = 0; s < m.length; s++) o = e(m[s]), r ? o.prop("disabled", !1) : o.removeAttr("disabled"); if ((c = e.extend(!0, {}, e.ajaxSettings, a)).context = c.context || c, f = "jqFormIO" + (new Date).getTime(), c.iframeTarget ? (g = (d = e(c.iframeTarget)).attr2("name")) ? f = g : d.attr2("name", f) : (d = e('<iframe name="' + f + '" src="' + c.iframeSrc + '" />')).css({ position: "absolute", top: "-1000px", left: "-1000px" }), p = d[0], h = { aborted: 0, responseText: null, responseXML: null, status: 0, statusText: "n/a", getAllResponseHeaders: function () { }, getResponseHeader: function () { }, setRequestHeader: function () { }, abort: function (t) { var r = "timeout" === t ? "timeout" : "aborted"; i("aborting upload... " + r), this.aborted = 1; try { p.contentWindow.document.execCommand && p.contentWindow.document.execCommand("Stop") } catch (e) { } d.attr("src", c.iframeSrc), h.error = r, c.error && c.error.call(c.context, h, r, t), l && e.event.trigger("ajaxError", [h, c, r]), c.complete && c.complete.call(c.context, h, r) } }, (l = c.global) && 0 == e.active++ && e.event.trigger("ajaxStart"), l && e.event.trigger("ajaxSend", [h, c]), c.beforeSend && !1 === c.beforeSend.call(c.context, h, c)) return c.global && e.active--, T.reject(), T; if (h.aborted) return T.reject(), T; (v = y.clk) && (g = v.name) && !v.disabled && (c.extraData = c.extraData || {}, c.extraData[g] = v.value, "image" == v.type && (c.extraData[g + ".x"] = y.clk_x, c.extraData[g + ".y"] = y.clk_y)); var j = 1, w = 2; function S(e) { var t = null; try { e.contentWindow && (t = e.contentWindow.document) } catch (e) { i("cannot get iframe.contentWindow document: " + e) } if (t) return t; try { t = e.contentDocument ? e.contentDocument : e.document } catch (r) { i("cannot get iframe.contentDocument: " + r), t = e.document } return t } var D = e("meta[name=csrf-token]").attr("content"), k = e("meta[name=csrf-param]").attr("content"); function A() { var t = u.attr2("target"), r = u.attr2("action"), a = u.attr("enctype") || u.attr("encoding") || "multipart/form-data"; y.setAttribute("target", f), n && !/post/i.test(n) || y.setAttribute("method", "POST"), r != c.url && y.setAttribute("action", c.url), c.skipEncodingOverride || n && !/post/i.test(n) || u.attr({ encoding: "multipart/form-data", enctype: "multipart/form-data" }), c.timeout && (b = setTimeout(function () { x = !0, O(j) }, c.timeout)); var o = []; try { if (c.extraData) for (var s in c.extraData) c.extraData.hasOwnProperty(s) && (e.isPlainObject(c.extraData[s]) && c.extraData[s].hasOwnProperty("name") && c.extraData[s].hasOwnProperty("value") ? o.push(e('<input type="hidden" name="' + c.extraData[s].name + '">').val(c.extraData[s].value).appendTo(y)[0]) : o.push(e('<input type="hidden" name="' + s + '">').val(c.extraData[s]).appendTo(y)[0])); c.iframeTarget || d.appendTo("body"), p.attachEvent ? p.attachEvent("onload", O) : p.addEventListener("load", O, !1), setTimeout(function e() { try { var t = S(p).readyState; i("state = " + t), t && "uninitialized" == t.toLowerCase() && setTimeout(e, 50) } catch (e) { i("Server abort: ", e, " (", e.name, ")"), O(w), b && clearTimeout(b), b = void 0 } }, 15); try { y.submit() } catch (e) { document.createElement("form").submit.apply(y) } } finally { y.setAttribute("action", r), y.setAttribute("enctype", a), t ? y.setAttribute("target", t) : u.removeAttr("target"), e(o).remove() } } k && D && (c.extraData = c.extraData || {}, c.extraData[k] = D), c.forceSync ? A() : setTimeout(A, 10); var L, E, M, F = 50; function O(t) { if (!h.aborted && !M) { if ((E = S(p)) || (i("cannot access response document"), t = w), t === j && h) return h.abort("timeout"), void T.reject(h, "timeout"); if (t == w && h) return h.abort("server abort"), void T.reject(h, "error", "server abort"); if (E && E.location.href != c.iframeSrc || x) { p.detachEvent ? p.detachEvent("onload", O) : p.removeEventListener("load", O, !1); var r, a = "success"; try { if (x) throw "timeout"; var n = "xml" == c.dataType || E.XMLDocument || e.isXMLDoc(E); if (i("isXml=" + n), !n && window.opera && (null === E.body || !E.body.innerHTML) && --F) return i("requeing onLoad callback, DOM not available"), void setTimeout(O, 250); var o = E.body ? E.body : E.documentElement; h.responseText = o ? o.innerHTML : null, h.responseXML = E.XMLDocument ? E.XMLDocument : E, n && (c.dataType = "xml"), h.getResponseHeader = function (e) { return { "content-type": c.dataType }[e.toLowerCase()] }, o && (h.status = Number(o.getAttribute("status")) || h.status, h.statusText = o.getAttribute("statusText") || h.statusText); var s = (c.dataType || "").toLowerCase(), u = /(json|script|text)/.test(s); if (u || c.textarea) { var f = E.getElementsByTagName("textarea")[0]; if (f) h.responseText = f.value, h.status = Number(f.getAttribute("status")) || h.status, h.statusText = f.getAttribute("statusText") || h.statusText; else if (u) { var m = E.getElementsByTagName("pre")[0], v = E.getElementsByTagName("body")[0]; m ? h.responseText = m.textContent ? m.textContent : m.innerText : v && (h.responseText = v.textContent ? v.textContent : v.innerText) } } else "xml" == s && !h.responseXML && h.responseText && (h.responseXML = X(h.responseText)); try { L = _(h, s, c) } catch (e) { a = "parsererror", h.error = r = e || a } } catch (e) { i("error caught: ", e), a = "error", h.error = r = e || a } h.aborted && (i("upload aborted"), a = null), h.status && (a = h.status >= 200 && h.status < 300 || 304 === h.status ? "success" : "error"), "success" === a ? (c.success && c.success.call(c.context, L, "success", h), T.resolve(h.responseText, "success", h), l && e.event.trigger("ajaxSuccess", [h, c])) : a && (void 0 === r && (r = h.statusText), c.error && c.error.call(c.context, h, a, r), T.reject(h, "error", r), l && e.event.trigger("ajaxError", [h, c, r])), l && e.event.trigger("ajaxComplete", [h, c]), l && !--e.active && e.event.trigger("ajaxStop"), c.complete && c.complete.call(c.context, h, a), M = !0, c.timeout && clearTimeout(b), setTimeout(function () { c.iframeTarget ? d.attr("src", c.iframeSrc) : d.remove(), h.responseXML = null }, 100) } } } var X = e.parseXML || function (e, t) { return window.ActiveXObject ? ((t = new ActiveXObject("Microsoft.XMLDOM")).async = "false", t.loadXML(e)) : t = (new DOMParser).parseFromString(e, "text/xml"), t && t.documentElement && "parsererror" != t.documentElement.nodeName ? t : null }, C = e.parseJSON || function (e) { return window.eval("(" + e + ")") }, _ = function (t, r, a) { var n = t.getResponseHeader("content-type") || "", i = "xml" === r || !r && n.indexOf("xml") >= 0, o = i ? t.responseXML : t.responseText; return i && "parsererror" === o.documentElement.nodeName && e.error && e.error("parsererror"), a && a.dataFilter && (o = a.dataFilter(o, r)), "string" == typeof o && ("json" === r || !r && n.indexOf("json") >= 0 ? o = C(o) : ("script" === r || !r && n.indexOf("javascript") >= 0) && e.globalEval(o)), o }; return T } }, e.fn.ajaxForm = function (t) { if ((t = t || {}).delegation = t.delegation && e.isFunction(e.fn.on), !t.delegation && 0 === this.length) { var r = { s: this.selector, c: this.context }; return !e.isReady && r.s ? (i("DOM not ready, queuing ajaxForm"), e(function () { e(r.s, r.c).ajaxForm(t) }), this) : (i("terminating; zero elements found by selector" + (e.isReady ? "" : " (DOM not ready)")), this) } return t.delegation ? (e(document).off("submit.form-plugin", this.selector, a).off("click.form-plugin", this.selector, n).on("submit.form-plugin", this.selector, t, a).on("click.form-plugin", this.selector, t, n), this) : this.ajaxFormUnbind().bind("submit.form-plugin", t, a).bind("click.form-plugin", t, n) }, e.fn.ajaxFormUnbind = function () { return this.unbind("submit.form-plugin click.form-plugin") }, e.fn.formToArray = function (r, a) { var n = []; if (0 === this.length) return n; var i, o, s, u, c, l, f, m, d = this[0], p = this.attr("id"), h = r ? d.getElementsByTagName("*") : d.elements; if (h && !/MSIE [678]/.test(navigator.userAgent) && (h = e(h).get()), p && (i = e(':input[form="' + p + '"]').get()).length && (h = (h || []).concat(i)), !h || !h.length) return n; for (o = 0, f = h.length; o < f; o++) if ((u = (l = h[o]).name) && !l.disabled) if (r && d.clk && "image" == l.type) d.clk == l && (n.push({ name: u, value: e(l).val(), type: l.type }), n.push({ name: u + ".x", value: d.clk_x }, { name: u + ".y", value: d.clk_y })); else if ((c = e.fieldValue(l, !0)) && c.constructor == Array) for (a && a.push(l), s = 0, m = c.length; s < m; s++) n.push({ name: u, value: c[s] }); else if (t.fileapi && "file" == l.type) { a && a.push(l); var v = l.files; if (v.length) for (s = 0; s < v.length; s++) n.push({ name: u, value: v[s], type: l.type }); else n.push({ name: u, value: "", type: l.type }) } else null !== c && void 0 !== c && (a && a.push(l), n.push({ name: u, value: c, type: l.type, required: l.required })); if (!r && d.clk) { var g = e(d.clk), x = g[0]; (u = x.name) && !x.disabled && "image" == x.type && (n.push({ name: u, value: g.val() }), n.push({ name: u + ".x", value: d.clk_x }, { name: u + ".y", value: d.clk_y })) } return n }, e.fn.formSerialize = function (t) { return e.param(this.formToArray(t)) }, e.fn.fieldSerialize = function (t) { var r = []; return this.each(function () { var a = this.name; if (a) { var n = e.fieldValue(this, t); if (n && n.constructor == Array) for (var i = 0, o = n.length; i < o; i++) r.push({ name: a, value: n[i] }); else null !== n && void 0 !== n && r.push({ name: this.name, value: n }) } }), e.param(r) }, e.fn.fieldValue = function (t) { for (var r = [], a = 0, n = this.length; a < n; a++) { var i = this[a], o = e.fieldValue(i, t); null === o || void 0 === o || o.constructor == Array && !o.length || (o.constructor == Array ? e.merge(r, o) : r.push(o)) } return r }, e.fieldValue = function (t, r) { var a = t.name, n = t.type, i = t.tagName.toLowerCase(); if (void 0 === r && (r = !0), r && (!a || t.disabled || "reset" == n || "button" == n || ("checkbox" == n || "radio" == n) && !t.checked || ("submit" == n || "image" == n) && t.form && t.form.clk != t || "select" == i && -1 == t.selectedIndex)) return null; if ("select" == i) { var o = t.selectedIndex; if (o < 0) return null; for (var s = [], u = t.options, c = "select-one" == n, l = c ? o + 1 : u.length, f = c ? o : 0; f < l; f++) { var m = u[f]; if (m.selected) { var d = m.value; if (d || (d = m.attributes && m.attributes.value && !m.attributes.value.specified ? m.text : m.value), c) return d; s.push(d) } } return s } return e(t).val() }, e.fn.clearForm = function (t) { return this.each(function () { e("input,select,textarea", this).clearFields(t) }) }, e.fn.clearFields = e.fn.clearInputs = function (t) { var r = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; return this.each(function () { var a = this.type, n = this.tagName.toLowerCase(); r.test(a) || "textarea" == n ? this.value = "" : "checkbox" == a || "radio" == a ? this.checked = !1 : "select" == n ? this.selectedIndex = -1 : "file" == a ? /MSIE/.test(navigator.userAgent) ? e(this).replaceWith(e(this).clone(!0)) : e(this).val("") : t && (!0 === t && /hidden/.test(a) || "string" == typeof t && e(this).is(t)) && (this.value = "") }) }, e.fn.resetForm = function () { return this.each(function () { ("function" == typeof this.reset || "object" == typeof this.reset && !this.reset.nodeType) && this.reset() }) }, e.fn.enable = function (e) { return void 0 === e && (e = !0), this.each(function () { this.disabled = !e }) }, e.fn.selected = function (t) { return void 0 === t && (t = !0), this.each(function () { var r = this.type; if ("checkbox" == r || "radio" == r) this.checked = t; else if ("option" == this.tagName.toLowerCase()) { var a = e(this).parent("select"); t && a[0] && "select-one" == a[0].type && a.find("option").selected(!1), this.selected = t } }) }, e.fn.ajaxSubmit.debug = !1 });;!function (i, t) { var n, e = "superslides"; (n = function (n, e) { this.options = t.extend({ play: !1, animation_speed: 600, animation_easing: "swing", animation: "slide", inherit_width_from: i, inherit_height_from: i, pagination: !0, hashchange: !1, scrollable: !0, elements: { preserve: ".preserve", nav: ".slides-navigation", container: ".slides-container", pagination: ".slides-pagination" } }, e); var s = this, o = t("<div>", { class: "slides-control" }), a = 1; this.$el = t(n), this.$container = this.$el.find(this.options.elements.container); var r = { containers: function () { s.init ? (s.$el.css({ height: s.height }), s.$control.css({ width: s.width * a, left: -s.width }), s.$container.css({})) : (t("body").css({ margin: 0 }), s.$el.css({ position: "relative", overflow: "hidden", width: "100%", height: s.height }), s.$control.css({ position: "relative", transform: "translate3d(0)", height: "100%", width: s.width * a, left: -s.width }), s.$container.css({ display: "none", margin: "0", padding: "0", listStyle: "none", position: "relative", height: "100%" })), 1 === s.size() && s.$el.find(s.options.elements.nav).hide() }, images: function () { var i = s.$container.find("img").not(s.options.elements.preserve); i.removeAttr("width").removeAttr("height").css({ "-webkit-backface-visibility": "hidden", "-ms-interpolation-mode": "bicubic", position: "absolute", left: "0", top: "0", "z-index": "-1", "max-width": "none" }), i.each(function () { var i = s.image._aspectRatio(this), n = this; if (t.data(this, "processed")) s.image._scale(n, i), s.image._center(n, i); else { var e = new Image; e.onload = function () { s.image._scale(n, i), s.image._center(n, i), t.data(n, "processed", !0) }, e.src = this.src } }) }, children: function () { var i = s.$container.children(); i.is("img") && (i.each(function () { if (t(this).is("img")) { t(this).wrap("<div>"); var i = t(this).attr("id"); t(this).removeAttr("id"), t(this).parent().attr("id", i) } }), i = s.$container.children()), s.init || i.css({ display: "none", left: 2 * s.width }), i.css({ position: "absolute", overflow: "hidden", height: "100%", width: s.width, top: 0, zIndex: 0 }) } }, h = { slide: function (i, t) { var n = s.$container.children(); n.eq(i.upcoming_slide).css({ left: i.upcoming_position, display: "block" }), s.$control.animate({ left: i.offset }, s.options.animation_speed, s.options.animation_easing, function () { s.size() > 1 && (s.$control.css({ left: -s.width }), n.eq(i.upcoming_slide).css({ left: s.width, zIndex: 2 }), i.outgoing_slide >= 0 && n.eq(i.outgoing_slide).css({ left: s.width, display: "none", zIndex: 0 })), t() }) }, fade: function (i, t) { var n = this, e = n.$container.children(), s = e.eq(i.outgoing_slide), o = e.eq(i.upcoming_slide); o.css({ left: this.width, opacity: 1, display: "block" }), i.outgoing_slide >= 0 ? s.animate({ opacity: 0 }, n.options.animation_speed, n.options.animation_easing, function () { n.size() > 1 && (e.eq(i.upcoming_slide).css({ zIndex: 2 }), i.outgoing_slide >= 0 && e.eq(i.outgoing_slide).css({ opacity: 1, display: "none", zIndex: 0 })), t() }) : (o.css({ zIndex: 2 }), t()) } }; h = t.extend(h, t.fn.superslides.fx); var c = { _centerY: function (i) { var n = t(i); n.css({ top: (s.height - n.height()) / 2 }) }, _centerX: function (i) { var n = t(i); n.css({ left: (s.width - n.width()) / 2 }) }, _center: function (i) { s.image._centerX(i), s.image._centerY(i) }, _aspectRatio: function (i) { if (!i.naturalHeight && !i.naturalWidth) { var t = new Image; t.src = i.src, i.naturalHeight = t.height, i.naturalWidth = t.width } return i.naturalHeight / i.naturalWidth }, _scale: function (i, n) { n = n || s.image._aspectRatio(i); var e = s.height / s.width, o = t(i); e > n ? o.css({ height: s.height, width: s.height / n }) : o.css({ height: s.width * n, width: s.width }) } }, d = { _setCurrent: function (i) { if (s.$pagination) { var t = s.$pagination.children(); t.removeClass("current"), t.eq(i).addClass("current") } }, _addItem: function (i) { var n = i + 1, e = s.$container.children().eq(i).attr("id"); e && (n = e), t("<a>", { href: "#" + n, text: n }).appendTo(s.$pagination) }, _setup: function () { if (s.options.pagination && 1 !== s.size()) { var i = t("<nav>", { class: s.options.elements.pagination.replace(/^\./, "") }); s.$pagination = i.appendTo(s.$el); for (var n = 0; n < s.size() ; n++) s.pagination._addItem(n) } }, _events: function () { s.$el.on("click", s.options.elements.pagination + " a", function (i) { i.preventDefault(); var t = s._parseHash(this.hash), n = s._upcomingSlide(t - 1); n !== s.current && s.animate(n, function () { s.start() }) }) } }; return this.css = r, this.image = c, this.pagination = d, this.fx = h, this.animation = this.fx[this.options.animation], this.$control = this.$container.wrap(o).parent(".slides-control"), s._findPositions(), s.width = s._findWidth(), s.height = s._findHeight(), this.css.children(), this.css.containers(), this.css.images(), this.pagination._setup(), a = s._findMultiplier(), s.$el.on("click", s.options.elements.nav + " a", function (i) { i.preventDefault(), s.stop(), t(this).hasClass("next") ? s.animate("next", function () { s.start() }) : s.animate("prev", function () { s.start() }) }), t(document).on("keyup", function (i) { 37 === i.keyCode && s.animate("prev"), 39 === i.keyCode && s.animate("next") }), t(i).on("resize", function () { setTimeout(function () { var i = s.$container.children(); s.width = s._findWidth(), s.height = s._findHeight(), i.css({ width: s.width, left: s.width }), s.css.containers(), s.css.images() }, 10) }), t(i).on("hashchange", function () { var i, t = s._parseHash(); (i = t && !isNaN(t) ? s._upcomingSlide(t - 1) : s._upcomingSlide(t)) >= 0 && i !== s.current && s.animate(i) }), s.pagination._events(), s.start(), s }).prototype = { _findWidth: function () { return t(this.options.inherit_width_from).width() }, _findHeight: function () { return t(this.options.inherit_height_from).height() }, _findMultiplier: function () { return 1 === this.size() ? 1 : 3 }, _upcomingSlide: function (i) { if (/next/.test(i)) return this._nextInDom(); if (/prev/.test(i)) return this._prevInDom(); if (/\d/.test(i)) return +i; if (i && /\w/.test(i)) { var t = this._findSlideById(i); return t >= 0 ? t : 0 } return 0 }, _findSlideById: function (i) { return this.$container.find("#" + i).index() }, _findPositions: function (i, t) { t = t || this, void 0 === i && (i = -1), t.current = i, t.next = t._nextInDom(), t.prev = t._prevInDom() }, _nextInDom: function () { var i = this.current + 1; return i === this.size() && (i = 0), i }, _prevInDom: function () { var i = this.current - 1; return i < 0 && (i = this.size() - 1), i }, _parseHash: function (t) { return (t = (t = t || i.location.hash).replace(/^#/, "")) && !isNaN(+t) && (t = +t), t }, size: function () { return this.$container.children().length }, destroy: function () { return this.$el.removeData() }, update: function () { this.css.children(), this.css.containers(), this.css.images(), this.pagination._addItem(this.size()), this._findPositions(this.current), this.$el.trigger("updated.slides") }, stop: function () { clearInterval(this.play_id), delete this.play_id, this.$el.trigger("stopped.slides") }, start: function () { var n = this; n.options.hashchange ? t(i).trigger("hashchange") : this.animate(), this.options.play && (this.play_id && this.stop(), this.play_id = setInterval(function () { n.animate() }, this.options.play)), this.$el.trigger("started.slides") }, animate: function (t, n) { var e = this, s = {}; if (!(this.animating || (this.animating = !0, void 0 === t && (t = "next"), s.upcoming_slide = this._upcomingSlide(t), s.upcoming_slide >= this.size()))) { if (s.outgoing_slide = this.current, s.upcoming_position = 2 * this.width, s.offset = -s.upcoming_position, ("prev" === t || t < s.outgoing_slide) && (s.upcoming_position = 0, s.offset = 0), e.size() > 1 && e.pagination._setCurrent(s.upcoming_slide), e.options.hashchange) { var o = s.upcoming_slide + 1, a = e.$container.children(":eq(" + s.upcoming_slide + ")").attr("id"); i.location.hash = a || o } e.$el.trigger("animating.slides", [s]), e.animation(s, function () { e._findPositions(s.upcoming_slide, e), "function" == typeof n && n(), e.animating = !1, e.$el.trigger("animated.slides"), e.init || (e.$el.trigger("init.slides"), e.init = !0, e.$container.fadeIn("fast")) }) } } }, t.fn[e] = function (i, s) { var o = []; return this.each(function () { var a, r, h; if (r = (a = t(this)).data(e), h = "object" == typeof i && i, r || (o = a.data(e, r = new n(this, h))), "string" == typeof i && "function" == typeof (o = r[i])) return o = o.call(r, s) }), o }, t.fn[e].fx = {} }(this, jQuery);;!function (e) { var t = { init: function (t) { var o = { color: e(this).css("background-color"), reach: 20, speed: 1e3, pause: 0, glow: !0, repeat: !0, onHover: !1 }; return e(this).css({ "-moz-outline-radius": e(this).css("border-top-left-radius"), "-webkit-outline-radius": e(this).css("border-top-left-radius"), "outline-radius": e(this).css("border-top-left-radius") }), t && e.extend(o, t), o.color = e("<div style='background:" + o.color + "'></div>").css("background-color"), !0 !== o.repeat && !isNaN(o.repeat) && 0 < o.repeat && (o.repeat -= 1), this.each(function () { o.onHover ? e(this).bind("mouseover", function () { i(o, this, 0) }).bind("mouseout", function () { e(this).pulsate("destroy") }) : i(o, this, 0) }) }, destroy: function () { return this.each(function () { clearTimeout(this.timer), e(this).css("outline", 0) }) } }, i = function (t, r, s) { var n = t.reach, u = (n - (s = s > n ? 0 : s)) / n, a = { outline: "2px solid " + (u = "rgba(" + (a = t.color.split(","))[0].split("(")[1] + "," + a[1] + "," + a[2].split(")")[0] + "," + u + ")") }; t.glow && (a["box-shadow"] = "0px 0px " + parseInt(s / 1.5) + "px " + u), a["outline-offset"] = s + "px", e(r).css(a), r.timer && clearTimeout(r.timer), r.timer = setTimeout(function () { if (s >= n && !t.repeat) return e(r).pulsate("destroy"), !1; if (s >= n && !0 !== t.repeat && !isNaN(t.repeat) && 0 < t.repeat) t.repeat -= 1; else if (t.pause && s >= n) return o(t, r, s + 1), !1; i(t, r, s + 1) }, t.speed / n) }, o = function (e, t, o) { innerfunc = function () { i(e, t, o) }, t.timer = setTimeout(innerfunc, e.pause) }; e.fn.pulsate = function (i) { return t[i] ? t[i].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof i && i ? void e.error("Method " + i + " does not exist on jQuery.pulsate") : t.init.apply(this, arguments) } }(jQuery);;var App = function () { var e = !1, t = !1, n = !1, o = !1, i = [], a = function () { for (var e = 0; e < i.length; e++) { i[e].call() } }, r = function () { $("body").on("click", ".dropdown-menu.hold-on-click", function (e) { e.stopPropagation() }) }, s = function () { $("[data-auto-height]").each(function () { var e = $(this), t = $("[data-height]", e), n = 0, o = e.attr("data-mode"), i = parseInt(e.attr("data-offset") ? e.attr("data-offset") : 0); t.each(function () { "height" == $(this).attr("data-height") ? $(this).css("height", "") : $(this).css("min-height", ""); var e = "base-height" == o ? $(this).outerHeight() : $(this).outerHeight(!0); e > n && (n = e) }), n += i, t.each(function () { "height" == $(this).attr("data-height") ? $(this).css("height", n) : $(this).css("min-height", n) }), e.attr("data-related") && $(e.attr("data-related")).css("height", e.height()) }) }; return { init: function () { var i, d; "rtl" === $("body").css("direction") && (e = !0), t = !!navigator.userAgent.match(/MSIE 8.0/), n = !!navigator.userAgent.match(/MSIE 9.0/), (o = !!navigator.userAgent.match(/MSIE 10.0/)) && $("html").addClass("ie10"), (o || n || t) && $("html").addClass("ie"), t ? $(window).resize(function () { d != document.documentElement.clientHeight && (i && clearTimeout(i), i = setTimeout(function () { a() }, 50), d = document.documentElement.clientHeight) }) : $(window).resize(function () { i && clearTimeout(i), i = setTimeout(function () { a() }, 50) }), r(), this.addResizeHandler(s), (t || n) && $("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function () { var e = $(this); "" === e.val() && "" !== e.attr("placeholder") && e.addClass("placeholder").val(e.attr("placeholder")), e.focus(function () { e.val() == e.attr("placeholder") && e.val("") }), e.blur(function () { "" !== e.val() && e.val() != e.attr("placeholder") || e.val(e.attr("placeholder")) }) }) }, initAjax: function () { handleBootstrapSwitch(), $('[data-hover="dropdown"]').not(".hover-initialized").each(function () { $(this).dropdownHover(), $(this).addClass("hover-initialized") }), r() }, initComponents: function () { this.initAjax() }, addResizeHandler: function (e) { i.push(e) }, runResizeHandlers: function () { a() }, getViewPort: function () { var e = window, t = "inner"; return "innerWidth" in window || (t = "client", e = document.documentElement || document.body), { width: e[t + "Width"], height: e[t + "Height"] } }, getUniqueID: function (e) { return "prefix_" + Math.floor(Math.random() * (new Date).getTime()) }, isIE8: function () { return t }, isIE9: function () { return n }, isRTL: function () { return e }, isAngularJsApp: function () { return "undefined" != typeof angular }, getResponsiveBreakpoint: function (e) { var t = { xs: 480, sm: 768, md: 992, lg: 1200 }; return t[e] ? t[e] : 0 } } }(); jQuery(document).ready(function () { App.init() }); var Layout = function () { var e = App.getResponsiveBreakpoint("md"), t = function (e, t) { var n = location.hash.toLowerCase(), o = $(".hor-menu"); "click" === e || "set" === e ? t = $(t) : "match" === e && o.find("li > a").each(function () { var e = $(this).attr("href").toLowerCase(); e.length > 1 && n.substr(1, e.length - 1) == e.substr(1) && (t = $(this)) }), t && 0 != t.size() && "javascript:;" !== t.attr("href").toLowerCase() && "#" !== t.attr("href").toLowerCase() && (o.find("li.active").removeClass("active"), o.find("li > a > .selected").remove(), o.find("li.open").removeClass("open"), t.parents("li").each(function () { $(this).addClass("active"), 1 === $(this).parent("ul.navbar-nav").size() && $(this).find("> a").append('<span class="selected"></span>') })) }, n = function () { var t = App.getViewPort().width, n = $(".page-header-menu"); t >= e && "desktop" !== n.data("breakpoint") ? ($('.hor-menu [data-toggle="dropdown"].active').removeClass("open"), n.data("breakpoint", "desktop"), $('.hor-menu [data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function () { $(this).dropdownHover(), $(this).addClass("hover-initialized") }), $(".hor-menu .navbar-nav li.open").removeClass("open"), $(".page-header-menu").css("display", "block")) : t < e && "mobile" !== n.data("breakpoint") && ($('.hor-menu [data-toggle="dropdown"].active').addClass("open"), n.data("breakpoint", "mobile"), $('.hor-menu [data-hover="megamenu-dropdown"].hover-initialized').each(function () { $(this).unbind("hover"), $(this).parent().unbind("hover").find(".dropdown-submenu").each(function () { $(this).unbind("hover") }), $(this).removeClass("hover-initialized") })) }; return { initHeader: function () { $(".page-header").on("click", ".search-form", function (e) { $(this).addClass("open"), $(this).find(".form-control").focus(), $(".page-header .search-form .form-control").on("blur", function (e) { $(this).closest(".search-form").removeClass("open"), $(this).unbind("blur") }) }), $(".page-header").on("keypress", ".hor-menu .search-form .form-control", function (e) { if (13 == e.which) return $(this).closest(".search-form").submit(), !1 }), $(".page-header").on("mousedown", ".search-form.open .submit", function (e) { e.preventDefault(), e.stopPropagation(), $(this).closest(".search-form").submit() }), $("body").on("click", ".page-header-top-fixed .page-header-top .menu-toggler", function () { App.scrollTop() }), $(".page-header .menu-toggler").on("click", function (t) { if (App.getViewPort().width < e) { var n = $(".page-header .page-header-menu"); n.is(":visible") ? n.slideUp(300) : n.slideDown(300), $("body").hasClass("page-header-top-fixed") && App.scrollTop() } }), $(".hor-menu .menu-dropdown > a, .hor-menu .dropdown-submenu > a").on("click", function (t) { App.getViewPort().width < e && $(this).next().hasClass("dropdown-menu") && (t.stopPropagation(), $(this).parent().hasClass("opened") ? $(this).parent().removeClass("opened") : $(this).parent().addClass("opened")) }), App.getViewPort().width >= e && $('.hor-menu [data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function () { $(this).dropdownHover(), $(this).addClass("hover-initialized") }), $(document).on("click", '.hor-menu .menu-dropdown > a[data-hover="megamenu-dropdown"]', function () { App.getViewPort().width < e && App.scrollTo($(this)) }), $(".hor-menu li > a").on("click", function (t) { App.getViewPort().width < e && ($(this).parent("li").hasClass("classic-menu-dropdown") || $(this).parent("li").hasClass("mega-menu-dropdown") || $(this).parent("li").hasClass("dropdown-submenu") || ($(".page-header .page-header-menu").slideUp(300), App.scrollTop())) }), $(document).on("click", ".mega-menu-dropdown .dropdown-menu, .classic-menu-dropdown .dropdown-menu", function (e) { e.stopPropagation() }), $(window).scroll(function () { $("body").hasClass("page-header-menu-fixed") && ($(window).scrollTop() > 75 ? $(".page-header-menu").addClass("fixed") : $(".page-header-menu").removeClass("fixed")), $("body").hasClass("page-header-top-fixed") && ($(window).scrollTop() > 75 ? $(".page-header-top").addClass("fixed") : $(".page-header-top").removeClass("fixed")) }), App.addResizeHandler(n), App.isAngularJsApp() && t("match") }, initContent: function () { var e; $("body").height() < App.getViewPort().height && (e = App.getViewPort().height - $(".page-header").outerHeight() - ($(".page-container").outerHeight() - $(".page-content").outerHeight()) - $(".page-prefooter").outerHeight() - $(".page-footer").outerHeight(), $(".page-content").css("min-height", e)) }, init: function () { this.initHeader(), this.initContent() }, setMainMenuActiveLink: function (e, n) { t(e, n) }, closeMainMenu: function () { $(".hor-menu").find("li.open").removeClass("open"), App.getViewPort().width < e && $(".page-header-menu").is(":visible") && $(".page-header .menu-toggler").click() } } }(); !1 === App.isAngularJsApp() && jQuery(document).ready(function () { Layout.init() });;!function (e) { e.fn.countdown = function (t) { return defaults = { schedule: null, datetime: null, showYears: !1, showDays: !0, showHours: !0, showMinutes: !0, showSeconds: !0, showOnZeroYears: !1, showOnZeroDays: !0, showOnZeroHours: !0, showOnZeroMinutes: !0, showOnZeroSeconds: !0, unixFormat: !1 }, (t = e.extend({ timerCallback: function (e) { }, initCallback: function (e) { }, zeroCallback: function (e) { } }, defaults, t)).datetime = e(this).attr("data-countdown") ? e(this).attr("data-countdown") : null, this.each(function () { var o = a(t), i = e(this), u = setInterval(function () { var e = n(o, t); t.timerObject = e; var a = r(e, t); s(i, a, t), e.timeLeft <= 0 ? (clearInterval(u), t.zeroCallback(t)) : t.timerCallback(t) }, 1e3) }) }; var s = function (s, a, n) { e(s).html(a) }, a = function (e) { if (null != e.datetime) return e.datetime; var s = []; for (var a in e.schedule) { var n = t(a); for (var r in e.schedule[a]) { var o = n + " " + e.schedule[a][r]; s.push(o) } } schedule = []; for (var i in s) schedule.push(new Date(s[i])); parsedSchedule = []; for (var i in schedule) parsedSchedule.push(Date.parse(schedule[i]) / 1e3); var u = new Date, c = Date.parse(u) / 1e3; timeDifferences = []; for (var i in parsedSchedule) timeDifferences.push(parsedSchedule[i] - c); timeDifferencesParsed = []; for (i in timeDifferences) timeDifferences[i] > 0 && timeDifferencesParsed.push(timeDifferences[i]); var l = Math.min.apply(null, timeDifferencesParsed); for (var d in timeDifferences) if (l == timeDifferences[d]) var h = d; var f = s[h]; return "" != f ? f : null }, n = function (e, s) { if (null == e) return ""; var a = new Date; if (s.unixFormat) var n = e / 1e3; else n = Date.parse(e) / 1e3; var r = n - (a = Date.parse(a) / 1e3), t = 0, o = 0, i = 0, u = 0, c = 0; if (r > 0) { t = Math.floor(r / 31536e3), o = Math.floor(r / 86400), i = Math.floor((r - 86400 * o) / 3600), u = Math.floor((r - 86400 * o - 3600 * i) / 60), c = Math.floor(r - 86400 * o - 3600 * i - 60 * u); o > 365 && (o %= 365) } return { years: t, days: o, hours: i, minutes: u, seconds: c, timeLeft: r } }, r = function (e, s, a) { e.years < "10" && (e.years = "0" + e.years), e.days < "10" && (e.days = "0" + e.days), e.hours < "10" && (e.hours = "0" + e.hours), e.minutes < "10" && (e.minutes = "0" + e.minutes), e.seconds < "10" && (e.seconds = "0" + e.seconds); var n = '<div class="years"><span class="count">' + e.years + '</span><span class="title">Years</span></div>', r = '<div class="days"><span class="count">' + e.days + '</span><span class="title">Days</span></div>', t = '<div class="hours"><span class="count">' + e.hours + '</span><span class="title">Hours</span></div>', o = '<div class="minutes"><span class="count">' + e.minutes + '</span><span class="title">Minutes</span></div>', i = '<div class="seconds"><span class="count">' + e.seconds + '</span><span class="title">Seconds</span></div>', u = !1, c = !1, l = !1, d = !1, h = !1; s.showYears && (u = !0), s.showDays && (c = !0), s.showHours && (l = !0), s.showMinutes && (d = !0), s.showSeconds && (h = !0), s.showOnZeroYears || "00" != e.years || (u = !1), s.showOnZeroDays || "00" != e.days || (c = !1), s.showOnZeroHours || "00" != e.hours || (l = !1), s.showOnZeroMinutes || "00" != e.minutes || (d = !1), s.showOnZeroSeconds || "00" != e.seconds || (h = !1); var f = ""; return u && (f += n), c && (f += r), l && (f += t), d && (f += o), h && (f += i), f }, t = function (e) { var s = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; for (var a in s) if (e == s[a]) var n = a; var r = new Date, t = r.getDay() - n; t = t > 0 ? t = 7 - t : -t, r.setDate(r.getDate() + t), r.setHours(1); var o = r.getDate(); o < 0 && (o = "0" + o); var i = r.getFullYear(); return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][r.getMonth()] + " " + o + ", " + i } }(jQuery);;!function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e : e(jQuery) }(function (e) { function t(t) { var r = t || window.event, l = s.call(arguments, 1), c = 0, u = 0, h = 0, f = 0, m = 0, p = 0; if ((t = e.event.fix(r)).type = "mousewheel", "detail" in r && (h = -1 * r.detail), "wheelDelta" in r && (h = r.wheelDelta), "wheelDeltaY" in r && (h = r.wheelDeltaY), "wheelDeltaX" in r && (u = -1 * r.wheelDeltaX), "axis" in r && r.axis === r.HORIZONTAL_AXIS && (u = -1 * h, h = 0), c = 0 === h ? u : h, "deltaY" in r && (c = h = -1 * r.deltaY), "deltaX" in r && (u = r.deltaX, 0 === h && (c = -1 * u)), 0 !== h || 0 !== u) { if (1 === r.deltaMode) { var g = e.data(this, "mousewheel-line-height"); c *= g, h *= g, u *= g } else if (2 === r.deltaMode) { var v = e.data(this, "mousewheel-page-height"); c *= v, h *= v, u *= v } if (f = Math.max(Math.abs(h), Math.abs(u)), (!i || i > f) && (i = f, o(r, f) && (i /= 40)), o(r, f) && (c /= 40, u /= 40, h /= 40), c = Math[c >= 1 ? "floor" : "ceil"](c / i), u = Math[u >= 1 ? "floor" : "ceil"](u / i), h = Math[h >= 1 ? "floor" : "ceil"](h / i), d.settings.normalizeOffset && this.getBoundingClientRect) { var x = this.getBoundingClientRect(); m = t.clientX - x.left, p = t.clientY - x.top } return t.deltaX = u, t.deltaY = h, t.deltaFactor = i, t.offsetX = m, t.offsetY = p, t.deltaMode = 0, l.unshift(t, c, u, h), n && clearTimeout(n), n = setTimeout(a, 200), (e.event.dispatch || e.event.handle).apply(this, l) } } function a() { i = null } function o(e, t) { return d.settings.adjustOldDeltas && "mousewheel" === e.type && t % 120 == 0 } var n, i, r = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"], l = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"], s = Array.prototype.slice; if (e.event.fixHooks) for (var c = r.length; c;) e.event.fixHooks[r[--c]] = e.event.mouseHooks; var d = e.event.special.mousewheel = { version: "3.1.12", setup: function () { if (this.addEventListener) for (var a = l.length; a;) this.addEventListener(l[--a], t, !1); else this.onmousewheel = t; e.data(this, "mousewheel-line-height", d.getLineHeight(this)), e.data(this, "mousewheel-page-height", d.getPageHeight(this)) }, teardown: function () { if (this.removeEventListener) for (var a = l.length; a;) this.removeEventListener(l[--a], t, !1); else this.onmousewheel = null; e.removeData(this, "mousewheel-line-height"), e.removeData(this, "mousewheel-page-height") }, getLineHeight: function (t) { var a = e(t), o = a["offsetParent" in e.fn ? "offsetParent" : "parent"](); return o.length || (o = e("body")), parseInt(o.css("fontSize"), 10) || parseInt(a.css("fontSize"), 10) || 16 }, getPageHeight: function (t) { return e(t).height() }, settings: { adjustOldDeltas: !0, normalizeOffset: !0 } }; e.fn.extend({ mousewheel: function (e) { return e ? this.bind("mousewheel", e) : this.trigger("mousewheel") }, unmousewheel: function (e) { return this.unbind("mousewheel", e) } }) }), function (e, t, a) { var o, n, i, r, l, s, c, d, u, h, f, m, p, g, v, x, _, S, w, b, C, y, B, T, M, k, O, I, D, R, E, L, W, P, A, z, H, U, X, Y, j, F, q, N, V, Q, Z, G, J, K, $, ee, te, ae, oe; ae = "function" == typeof define && define.amd, oe = "https:" == a.location.protocol ? "https:" : "http:", ae || e.event.special.mousewheel || e("head").append(decodeURI("%3Cscript src=" + oe + "//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js%3E%3C/script%3E")), o = "mCustomScrollbar", n = "mCS", i = ".mCustomScrollbar", r = { setTop: 0, setLeft: 0, axis: "y", scrollbarPosition: "inside", scrollInertia: 950, autoDraggerLength: !0, alwaysShowScrollbar: 0, snapOffset: 0, mouseWheel: { enable: !0, scrollAmount: "auto", axis: "y", deltaFactor: "auto", disableOver: ["select", "option", "keygen", "datalist", "textarea"] }, scrollButtons: { scrollType: "stepless", scrollAmount: "auto" }, keyboard: { enable: !0, scrollType: "stepless", scrollAmount: "auto" }, contentTouchScroll: 25, advanced: { autoScrollOnFocus: "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']", updateOnContentResize: !0, updateOnImageLoad: !0 }, theme: "light", callbacks: { onTotalScrollOffset: 0, onTotalScrollBackOffset: 0, alwaysTriggerOffsets: !0 } }, l = 0, s = {}, c = t.attachEvent && !t.addEventListener ? 1 : 0, d = !1, u = ["mCSB_dragger_onDrag", "mCSB_scrollTools_onDrag", "mCS_img_loaded", "mCS_disabled", "mCS_destroyed", "mCS_no_scrollbar", "mCS-autoHide", "mCS-dir-rtl", "mCS_no_scrollbar_y", "mCS_no_scrollbar_x", "mCS_y_hidden", "mCS_x_hidden", "mCSB_draggerContainer", "mCSB_buttonUp", "mCSB_buttonDown", "mCSB_buttonLeft", "mCSB_buttonRight"], h = { init: function (t) { var t = e.extend(!0, {}, r, t), a = f.call(this); if (t.live) { var o = t.liveSelector || this.selector || i, c = e(o); if ("off" === t.live) return void p(o); s[o] = setTimeout(function () { c.mCustomScrollbar(t), "once" === t.live && c.length && p(o) }, 500) } else p(o); return t.setWidth = t.set_width ? t.set_width : t.setWidth, t.setHeight = t.set_height ? t.set_height : t.setHeight, t.axis = t.horizontalScroll ? "x" : g(t.axis), t.scrollInertia = t.scrollInertia > 0 && t.scrollInertia < 17 ? 17 : t.scrollInertia, "object" != typeof t.mouseWheel && 1 == t.mouseWheel && (t.mouseWheel = { enable: !0, scrollAmount: "auto", axis: "y", preventDefault: !1, deltaFactor: "auto", normalizeDelta: !1, invert: !1 }), t.mouseWheel.scrollAmount = t.mouseWheelPixels ? t.mouseWheelPixels : t.mouseWheel.scrollAmount, t.mouseWheel.normalizeDelta = t.advanced.normalizeMouseWheelDelta ? t.advanced.normalizeMouseWheelDelta : t.mouseWheel.normalizeDelta, t.scrollButtons.scrollType = v(t.scrollButtons.scrollType), m(t), e(a).each(function () { var a = e(this); if (!a.data(n)) { a.data(n, { idx: ++l, opt: t, scrollRatio: { y: null, x: null }, overflowed: null, contentReset: { y: null, x: null }, bindEvents: !1, tweenRunning: !1, sequential: {}, langDir: a.css("direction"), cbOffsets: null, trigger: null }); var o = a.data(n), i = o.opt, r = a.data("mcs-axis"), s = a.data("mcs-scrollbar-position"), c = a.data("mcs-theme"); r && (i.axis = r), s && (i.scrollbarPosition = s), c && (i.theme = c, m(i)), x.call(this), e("#mCSB_" + o.idx + "_container img:not(." + u[2] + ")").addClass(u[2]), h.update.call(null, a) } }) }, update: function (t, a) { var o = t || f.call(this); return e(o).each(function () { var t = e(this); if (t.data(n)) { var o = t.data(n), i = o.opt, r = e("#mCSB_" + o.idx + "_container"), l = [e("#mCSB_" + o.idx + "_dragger_vertical"), e("#mCSB_" + o.idx + "_dragger_horizontal")]; if (!r.length) return; o.tweenRunning && N(t), t.hasClass(u[3]) && t.removeClass(u[3]), t.hasClass(u[4]) && t.removeClass(u[4]), b.call(this), S.call(this), "y" === i.axis || i.advanced.autoExpandHorizontalScroll || r.css("width", _(r.children())), o.overflowed = T.call(this), I.call(this), i.autoDraggerLength && C.call(this), y.call(this), k.call(this); var s = [Math.abs(r[0].offsetTop), Math.abs(r[0].offsetLeft)]; "x" !== i.axis && (o.overflowed[0] ? l[0].height() > l[0].parent().height() ? M.call(this) : (V(t, s[0].toString(), { dir: "y", dur: 0, overwrite: "none" }), o.contentReset.y = null) : (M.call(this), "y" === i.axis ? O.call(this) : "yx" === i.axis && o.overflowed[1] && V(t, s[1].toString(), { dir: "x", dur: 0, overwrite: "none" }))), "y" !== i.axis && (o.overflowed[1] ? l[1].width() > l[1].parent().width() ? M.call(this) : (V(t, s[1].toString(), { dir: "x", dur: 0, overwrite: "none" }), o.contentReset.x = null) : (M.call(this), "x" === i.axis ? O.call(this) : "yx" === i.axis && o.overflowed[0] && V(t, s[0].toString(), { dir: "y", dur: 0, overwrite: "none" }))), a && o && (2 === a && i.callbacks.onImageLoad && "function" == typeof i.callbacks.onImageLoad ? i.callbacks.onImageLoad.call(this) : 3 === a && i.callbacks.onSelectorChange && "function" == typeof i.callbacks.onSelectorChange ? i.callbacks.onSelectorChange.call(this) : i.callbacks.onUpdate && "function" == typeof i.callbacks.onUpdate && i.callbacks.onUpdate.call(this)), q.call(this) } }) }, scrollTo: function (t, a) { if (void 0 !== t && null != t) { var o = f.call(this); return e(o).each(function () { var o = e(this); if (o.data(n)) { var i = o.data(n), r = i.opt, l = { trigger: "external", scrollInertia: r.scrollInertia, scrollEasing: "mcsEaseInOut", moveDragger: !1, timeout: 60, callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, s = e.extend(!0, {}, l, a), c = j.call(this, t), d = s.scrollInertia > 0 && s.scrollInertia < 17 ? 17 : s.scrollInertia; c[0] = F.call(this, c[0], "y"), c[1] = F.call(this, c[1], "x"), s.moveDragger && (c[0] *= i.scrollRatio.y, c[1] *= i.scrollRatio.x), s.dur = d, setTimeout(function () { null !== c[0] && void 0 !== c[0] && "x" !== r.axis && i.overflowed[0] && (s.dir = "y", s.overwrite = "all", V(o, c[0].toString(), s)), null !== c[1] && void 0 !== c[1] && "y" !== r.axis && i.overflowed[1] && (s.dir = "x", s.overwrite = "none", V(o, c[1].toString(), s)) }, s.timeout) } }) } }, stop: function () { var t = f.call(this); return e(t).each(function () { var t = e(this); t.data(n) && N(t) }) }, disable: function (t) { var a = f.call(this); return e(a).each(function () { var a = e(this); a.data(n) && (a.data(n), q.call(this, "remove"), O.call(this), t && M.call(this), I.call(this, !0), a.addClass(u[3])) }) }, destroy: function () { var t = f.call(this); return e(t).each(function () { var a = e(this); if (a.data(n)) { var i = a.data(n), r = i.opt, l = e("#mCSB_" + i.idx), s = e("#mCSB_" + i.idx + "_container"), c = e(".mCSB_" + i.idx + "_scrollbar"); r.live && p(r.liveSelector || e(t).selector), q.call(this, "remove"), O.call(this), M.call(this), a.removeData(n), J(this, "mcs"), c.remove(), s.find("img." + u[2]).removeClass(u[2]), l.replaceWith(s.contents()), a.removeClass(o + " _" + n + "_" + i.idx + " " + u[6] + " " + u[7] + " " + u[5] + " " + u[3]).addClass(u[4]) } }) } }, f = function () { return "object" != typeof e(this) || e(this).length < 1 ? i : this }, m = function (t) { t.autoDraggerLength = !(e.inArray(t.theme, ["rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark"]) > -1) && t.autoDraggerLength, t.autoExpandScrollbar = !(e.inArray(t.theme, ["rounded-dots", "rounded-dots-dark", "3d", "3d-dark", "3d-thick", "3d-thick-dark", "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark"]) > -1) && t.autoExpandScrollbar, t.scrollButtons.enable = !(e.inArray(t.theme, ["minimal", "minimal-dark"]) > -1) && t.scrollButtons.enable, t.autoHideScrollbar = e.inArray(t.theme, ["minimal", "minimal-dark"]) > -1 || t.autoHideScrollbar, t.scrollbarPosition = e.inArray(t.theme, ["minimal", "minimal-dark"]) > -1 ? "outside" : t.scrollbarPosition }, p = function (e) { s[e] && (clearTimeout(s[e]), J(s, e)) }, g = function (e) { return "yx" === e || "xy" === e || "auto" === e ? "yx" : "x" === e || "horizontal" === e ? "x" : "y" }, v = function (e) { return "stepped" === e || "pixels" === e || "step" === e || "click" === e ? "stepped" : "stepless" }, x = function () { var t = e(this), a = t.data(n), i = a.opt, r = i.autoExpandScrollbar ? " " + u[1] + "_expand" : "", l = ["<div id='mCSB_" + a.idx + "_scrollbar_vertical' class='mCSB_scrollTools mCSB_" + a.idx + "_scrollbar mCS-" + i.theme + " mCSB_scrollTools_vertical" + r + "'><div class='" + u[12] + "'><div id='mCSB_" + a.idx + "_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>", "<div id='mCSB_" + a.idx + "_scrollbar_horizontal' class='mCSB_scrollTools mCSB_" + a.idx + "_scrollbar mCS-" + i.theme + " mCSB_scrollTools_horizontal" + r + "'><div class='" + u[12] + "'><div id='mCSB_" + a.idx + "_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"], s = "yx" === i.axis ? "mCSB_vertical_horizontal" : "x" === i.axis ? "mCSB_horizontal" : "mCSB_vertical", c = "yx" === i.axis ? l[0] + l[1] : "x" === i.axis ? l[1] : l[0], d = "yx" === i.axis ? "<div id='mCSB_" + a.idx + "_container_wrapper' class='mCSB_container_wrapper' />" : "", h = i.autoHideScrollbar ? " " + u[6] : "", f = "x" !== i.axis && "rtl" === a.langDir ? " " + u[7] : ""; i.setWidth && t.css("width", i.setWidth), i.setHeight && t.css("height", i.setHeight), i.setLeft = "y" !== i.axis && "rtl" === a.langDir ? "989999px" : i.setLeft, t.addClass(o + " _" + n + "_" + a.idx + h + f).wrapInner("<div id='mCSB_" + a.idx + "' class='mCustomScrollBox mCS-" + i.theme + " " + s + "'><div id='mCSB_" + a.idx + "_container' class='mCSB_container' style='position:relative; top:" + i.setTop + "; left:" + i.setLeft + ";' dir=" + a.langDir + " /></div>"); var m = e("#mCSB_" + a.idx), p = e("#mCSB_" + a.idx + "_container"); "y" === i.axis || i.advanced.autoExpandHorizontalScroll || p.css("width", _(p.children())), "outside" === i.scrollbarPosition ? ("static" === t.css("position") && t.css("position", "relative"), t.css("overflow", "visible"), m.addClass("mCSB_outside").after(c)) : (m.addClass("mCSB_inside").append(c), p.wrap(d)), w.call(this); var g = [e("#mCSB_" + a.idx + "_dragger_vertical"), e("#mCSB_" + a.idx + "_dragger_horizontal")]; g[0].css("min-height", g[0].height()), g[1].css("min-width", g[1].width()) }, _ = function (t) { return Math.max.apply(Math, t.map(function () { return e(this).outerWidth(!0) }).get()) }, S = function () { var t = e(this), a = t.data(n), o = a.opt, i = e("#mCSB_" + a.idx + "_container"); o.advanced.autoExpandHorizontalScroll && "y" !== o.axis && i.css({ position: "absolute", width: "auto" }).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({ width: Math.ceil(i[0].getBoundingClientRect().right + .4) - Math.floor(i[0].getBoundingClientRect().left), position: "relative" }).unwrap() }, w = function () { var t = e(this), a = t.data(n), o = a.opt, i = e(".mCSB_" + a.idx + "_scrollbar:first"), r = ee(o.scrollButtons.tabindex) ? "tabindex='" + o.scrollButtons.tabindex + "'" : "", l = ["<a href='#' class='" + u[13] + "' oncontextmenu='return false;' " + r + " />", "<a href='#' class='" + u[14] + "' oncontextmenu='return false;' " + r + " />", "<a href='#' class='" + u[15] + "' oncontextmenu='return false;' " + r + " />", "<a href='#' class='" + u[16] + "' oncontextmenu='return false;' " + r + " />"], s = ["x" === o.axis ? l[2] : l[0], "x" === o.axis ? l[3] : l[1], l[2], l[3]]; o.scrollButtons.enable && i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3]) }, b = function () { var t = e(this), a = t.data(n), o = e("#mCSB_" + a.idx), i = t.css("max-height") || "none", r = -1 !== i.indexOf("%"), l = t.css("box-sizing"); if ("none" !== i) { var s = r ? t.parent().height() * parseInt(i) / 100 : parseInt(i); "border-box" === l && (s -= t.innerHeight() - t.height() + (t.outerHeight() - t.innerHeight())), o.css("max-height", Math.round(s)) } }, C = function () { var t = e(this), a = t.data(n), o = e("#mCSB_" + a.idx), i = e("#mCSB_" + a.idx + "_container"), r = [e("#mCSB_" + a.idx + "_dragger_vertical"), e("#mCSB_" + a.idx + "_dragger_horizontal")], l = [o.height() / i.outerHeight(!1), o.width() / i.outerWidth(!1)], s = [parseInt(r[0].css("min-height")), Math.round(l[0] * r[0].parent().height()), parseInt(r[1].css("min-width")), Math.round(l[1] * r[1].parent().width())], d = c && s[1] < s[0] ? s[0] : s[1], u = c && s[3] < s[2] ? s[2] : s[3]; r[0].css({ height: d, "max-height": r[0].parent().height() - 10 }).find(".mCSB_dragger_bar").css({ "line-height": s[0] + "px" }), r[1].css({ width: u, "max-width": r[1].parent().width() - 10 }) }, y = function () { var t = e(this), a = t.data(n), o = e("#mCSB_" + a.idx), i = e("#mCSB_" + a.idx + "_container"), r = [e("#mCSB_" + a.idx + "_dragger_vertical"), e("#mCSB_" + a.idx + "_dragger_horizontal")], l = [i.outerHeight(!1) - o.height(), i.outerWidth(!1) - o.width()], s = [l[0] / (r[0].parent().height() - r[0].height()), l[1] / (r[1].parent().width() - r[1].width())]; a.scrollRatio = { y: s[0], x: s[1] } }, B = function (e, t, a) { var o = a ? u[0] + "_expanded" : "", n = e.closest(".mCSB_scrollTools"); "active" === t ? (e.toggleClass(u[0] + " " + o), n.toggleClass(u[1]), e[0]._draggable = e[0]._draggable ? 0 : 1) : e[0]._draggable || ("hide" === t ? (e.removeClass(u[0]), n.removeClass(u[1])) : (e.addClass(u[0]), n.addClass(u[1]))) }, T = function () { var t = e(this), a = t.data(n), o = e("#mCSB_" + a.idx), i = e("#mCSB_" + a.idx + "_container"), r = null == a.overflowed ? i.height() : i.outerHeight(!1), l = null == a.overflowed ? i.width() : i.outerWidth(!1); return [r > o.height(), l > o.width()] }, M = function () { var t = e(this), a = t.data(n), o = a.opt, i = e("#mCSB_" + a.idx), r = e("#mCSB_" + a.idx + "_container"), l = [e("#mCSB_" + a.idx + "_dragger_vertical"), e("#mCSB_" + a.idx + "_dragger_horizontal")]; if (N(t), ("x" !== o.axis && !a.overflowed[0] || "y" === o.axis && a.overflowed[0]) && (l[0].add(r).css("top", 0), V(t, "_resetY")), "y" !== o.axis && !a.overflowed[1] || "x" === o.axis && a.overflowed[1]) { var s = dx = 0; "rtl" === a.langDir && (s = i.width() - r.outerWidth(!1), dx = Math.abs(s / a.scrollRatio.x)), r.css("left", s), l[1].css("left", dx), V(t, "_resetX") } }, k = function () { var t, a = e(this), o = a.data(n), i = o.opt; o.bindEvents || (R.call(this), i.contentTouchScroll && E.call(this), L.call(this), i.mouseWheel.enable && function o() { t = setTimeout(function () { e.event.special.mousewheel ? (clearTimeout(t), W.call(a[0])) : o() }, 100) }(), A.call(this), H.call(this), i.advanced.autoScrollOnFocus && z.call(this), i.scrollButtons.enable && U.call(this), i.keyboard.enable && X.call(this), o.bindEvents = !0) }, O = function () { var t = e(this), o = t.data(n), i = o.opt, r = n + "_" + o.idx, l = ".mCSB_" + o.idx + "_scrollbar", s = e("#mCSB_" + o.idx + ",#mCSB_" + o.idx + "_container,#mCSB_" + o.idx + "_container_wrapper," + l + " ." + u[12] + ",#mCSB_" + o.idx + "_dragger_vertical,#mCSB_" + o.idx + "_dragger_horizontal," + l + ">a"), c = e("#mCSB_" + o.idx + "_container"); i.advanced.releaseDraggableSelectors && s.add(e(i.advanced.releaseDraggableSelectors)), o.bindEvents && (e(a).unbind("." + r), s.each(function () { e(this).unbind("." + r) }), clearTimeout(t[0]._focusTimeout), J(t[0], "_focusTimeout"), clearTimeout(o.sequential.step), J(o.sequential, "step"), clearTimeout(c[0].onCompleteTimeout), J(c[0], "onCompleteTimeout"), o.bindEvents = !1) }, I = function (t) { var a = e(this), o = a.data(n), i = o.opt, r = e("#mCSB_" + o.idx + "_container_wrapper"), l = r.length ? r : e("#mCSB_" + o.idx + "_container"), s = [e("#mCSB_" + o.idx + "_scrollbar_vertical"), e("#mCSB_" + o.idx + "_scrollbar_horizontal")], c = [s[0].find(".mCSB_dragger"), s[1].find(".mCSB_dragger")]; "x" !== i.axis && (o.overflowed[0] && !t ? (s[0].add(c[0]).add(s[0].children("a")).css("display", "block"), l.removeClass(u[8] + " " + u[10])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[0].add(s[0].children("a")).css("display", "none"), l.removeClass(u[10])) : (s[0].css("display", "none"), l.addClass(u[10])), l.addClass(u[8]))), "y" !== i.axis && (o.overflowed[1] && !t ? (s[1].add(c[1]).add(s[1].children("a")).css("display", "block"), l.removeClass(u[9] + " " + u[11])) : (i.alwaysShowScrollbar ? (2 !== i.alwaysShowScrollbar && c[1].add(s[1].children("a")).css("display", "none"), l.removeClass(u[11])) : (s[1].css("display", "none"), l.addClass(u[11])), l.addClass(u[9]))), o.overflowed[0] || o.overflowed[1] ? a.removeClass(u[5]) : a.addClass(u[5]) }, D = function (e) { var t = e.type; switch (t) { case "pointerdown": case "MSPointerDown": case "pointermove": case "MSPointerMove": case "pointerup": case "MSPointerUp": return [e.originalEvent.pageY, e.originalEvent.pageX, !1]; case "touchstart": case "touchmove": case "touchend": var a = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0], o = e.originalEvent.touches.length || e.originalEvent.changedTouches.length; return [a.pageY, a.pageX, o > 1]; default: return [e.pageY, e.pageX, !1] } }, R = function () { function t(e) { var t = p.find("iframe"); if (t.length) { var a = e ? "auto" : "none"; t.css("pointer-events", a) } } function o(e, t, a, o) { if (p[0].idleTimer = h.scrollInertia < 233 ? 250 : 0, i.attr("id") === m[1]) var n = "x", r = (i[0].offsetLeft - t + o) * u.scrollRatio.x; else var n = "y", r = (i[0].offsetTop - e + a) * u.scrollRatio.y; V(s, r.toString(), { dir: n, drag: !0 }) } var i, r, l, s = e(this), u = s.data(n), h = u.opt, f = n + "_" + u.idx, m = ["mCSB_" + u.idx + "_dragger_vertical", "mCSB_" + u.idx + "_dragger_horizontal"], p = e("#mCSB_" + u.idx + "_container"), g = e("#" + m[0] + ",#" + m[1]), v = h.advanced.releaseDraggableSelectors ? g.add(e(h.advanced.releaseDraggableSelectors)) : g; g.bind("mousedown." + f + " touchstart." + f + " pointerdown." + f + " MSPointerDown." + f, function (o) { if (o.stopImmediatePropagation(), o.preventDefault(), K(o)) { d = !0, c && (a.onselectstart = function () { return !1 }), t(!1), N(s); var n = (i = e(this)).offset(), u = D(o)[0] - n.top, f = D(o)[1] - n.left, m = i.height() + n.top, p = i.width() + n.left; m > u && u > 0 && p > f && f > 0 && (r = u, l = f), B(i, "active", h.autoExpandScrollbar) } }).bind("touchmove." + f, function (e) { e.stopImmediatePropagation(), e.preventDefault(); var t = i.offset(), a = D(e)[0] - t.top, n = D(e)[1] - t.left; o(r, l, a, n) }), e(a).bind("mousemove." + f + " pointermove." + f + " MSPointerMove." + f, function (e) { if (i) { var t = i.offset(), a = D(e)[0] - t.top, n = D(e)[1] - t.left; if (r === a) return; o(r, l, a, n) } }).add(v).bind("mouseup." + f + " touchend." + f + " pointerup." + f + " MSPointerUp." + f, function () { i && (B(i, "active", h.autoExpandScrollbar), i = null), d = !1, c && (a.onselectstart = null), t(!0) }) }, E = function () { function t(e, t) { var a = [1.5 * t, 2 * t, t / 1.5, t / 2]; return e > 90 ? t > 4 ? a[0] : a[3] : e > 60 ? t > 3 ? a[3] : a[2] : e > 30 ? t > 8 ? a[1] : t > 6 ? a[0] : t > 4 ? t : a[2] : t > 8 ? t : a[3] } function a(e, t, a, o, n, i) { e && V(g, e.toString(), { dur: t, scrollEasing: a, dir: o, overwrite: n, drag: i }) } var o, i, r, l, s, c, u, h, f, m, p, g = e(this), v = g.data(n), x = v.opt, _ = n + "_" + v.idx, S = e("#mCSB_" + v.idx), w = e("#mCSB_" + v.idx + "_container"), b = [e("#mCSB_" + v.idx + "_dragger_vertical"), e("#mCSB_" + v.idx + "_dragger_horizontal")], C = [], y = [], B = "yx" === x.axis ? "none" : "all", T = []; w.bind("touchstart." + _ + " pointerdown." + _ + " MSPointerDown." + _, function (e) { if ($(e) && !d && !D(e)[2]) { var t = w.offset(); o = D(e)[0] - t.top, i = D(e)[1] - t.left, T = [D(e)[0], D(e)[1]] } }).bind("touchmove." + _ + " pointermove." + _ + " MSPointerMove." + _, function (e) { if ($(e) && !d && !D(e)[2]) { e.stopImmediatePropagation(), c = Z(); var t = S.offset(), n = D(e)[0] - t.top, r = D(e)[1] - t.left, l = "mcsLinearOut"; if (C.push(n), y.push(r), T[2] = Math.abs(D(e)[0] - T[0]), T[3] = Math.abs(D(e)[1] - T[1]), v.overflowed[0]) var s = b[0].parent().height() - b[0].height(), u = o - n > 0 && n - o > -s * v.scrollRatio.y && (2 * T[3] < T[2] || "yx" === x.axis); if (v.overflowed[1]) var h = b[1].parent().width() - b[1].width(), f = i - r > 0 && r - i > -h * v.scrollRatio.x && (2 * T[2] < T[3] || "yx" === x.axis); (u || f) && e.preventDefault(), m = "yx" === x.axis ? [o - n, i - r] : "x" === x.axis ? [null, i - r] : [o - n, null], w[0].idleTimer = 250, v.overflowed[0] && a(m[0], 0, l, "y", "all", !0), v.overflowed[1] && a(m[1], 0, l, "x", B, !0) } }), S.bind("touchstart." + _ + " pointerdown." + _ + " MSPointerDown." + _, function (e) { if ($(e) && !d && !D(e)[2]) { e.stopImmediatePropagation(), N(g), s = Z(); var t = S.offset(); r = D(e)[0] - t.top, l = D(e)[1] - t.left, C = [], y = [] } }).bind("touchend." + _ + " pointerup." + _ + " MSPointerUp." + _, function (e) { if ($(e) && !d && !D(e)[2]) { e.stopImmediatePropagation(), u = Z(); var o = S.offset(), n = D(e)[0] - o.top, i = D(e)[1] - o.left; if (!(u - c > 30)) { var g = "mcsEaseOut", _ = 2.5 > (f = 1e3 / (u - s)), b = _ ? [C[C.length - 2], y[y.length - 2]] : [0, 0]; h = _ ? [n - b[0], i - b[1]] : [n - r, i - l]; var T = [Math.abs(h[0]), Math.abs(h[1])]; f = _ ? [Math.abs(h[0] / 4), Math.abs(h[1] / 4)] : [f, f]; var M = [Math.abs(w[0].offsetTop) - h[0] * t(T[0] / f[0], f[0]), Math.abs(w[0].offsetLeft) - h[1] * t(T[1] / f[1], f[1])]; m = "yx" === x.axis ? [M[0], M[1]] : "x" === x.axis ? [null, M[1]] : [M[0], null], p = [4 * T[0] + x.scrollInertia, 4 * T[1] + x.scrollInertia]; var k = parseInt(x.contentTouchScroll) || 0; m[0] = T[0] > k ? m[0] : 0, m[1] = T[1] > k ? m[1] : 0, v.overflowed[0] && a(m[0], p[0], g, "y", B, !1), v.overflowed[1] && a(m[1], p[1], g, "x", B, !1) } } }) }, L = function () { function o(e, t, a) { c.type = a && i ? "stepped" : "stepless", c.scrollAmount = 10, Y(r, e, t, "mcsLinearOut", a ? 60 : null) } var i, r = e(this), l = r.data(n), s = l.opt, c = l.sequential, u = n + "_" + l.idx, h = e("#mCSB_" + l.idx + "_container"), f = h.parent(); h.bind("mousedown." + u, function () { i || (i = 1, d = !0) }).add(a).bind("mousemove." + u, function (e) { if (i && (t.getSelection ? t.getSelection().toString() : a.selection && "Control" != a.selection.type && a.selection.createRange().text)) { var n = h.offset(), r = D(e)[0] - n.top + h[0].offsetTop, d = D(e)[1] - n.left + h[0].offsetLeft; r > 0 && r < f.height() && d > 0 && d < f.width() ? c.step && o("off", null, "stepped") : ("x" !== s.axis && l.overflowed[0] && (0 > r ? o("on", 38) : r > f.height() && o("on", 40)), "y" !== s.axis && l.overflowed[1] && (0 > d ? o("on", 37) : d > f.width() && o("on", 39))) } }).bind("mouseup." + u, function () { i && (i = 0, o("off", null)), d = !1 }) }, W = function () { var t = e(this), a = t.data(n); if (a) { var o = a.opt, i = n + "_" + a.idx, r = e("#mCSB_" + a.idx), l = [e("#mCSB_" + a.idx + "_dragger_vertical"), e("#mCSB_" + a.idx + "_dragger_horizontal")], s = e("#mCSB_" + a.idx + "_container").find("iframe"), d = r; s.length && s.each(function () { (function (e) { var t = null; try { var a = e.contentDocument || e.contentWindow.document; t = a.body.innerHTML } catch (e) { } return null !== t })(this) && (d = d.add(e(this).contents().find("body"))) }), d.bind("mousewheel." + i, function (n, i) { if (N(t), !P(t, n.target)) { var s = "auto" !== o.mouseWheel.deltaFactor ? parseInt(o.mouseWheel.deltaFactor) : c && n.deltaFactor < 100 ? 100 : n.deltaFactor || 100; if ("x" === o.axis || "x" === o.mouseWheel.axis) var d = "x", u = [Math.round(s * a.scrollRatio.x), parseInt(o.mouseWheel.scrollAmount)], h = "auto" !== o.mouseWheel.scrollAmount ? u[1] : u[0] >= r.width() ? .9 * r.width() : u[0], f = Math.abs(e("#mCSB_" + a.idx + "_container")[0].offsetLeft), m = l[1][0].offsetLeft, p = l[1].parent().width() - l[1].width(), g = n.deltaX || n.deltaY || i; else var d = "y", u = [Math.round(s * a.scrollRatio.y), parseInt(o.mouseWheel.scrollAmount)], h = "auto" !== o.mouseWheel.scrollAmount ? u[1] : u[0] >= r.height() ? .9 * r.height() : u[0], f = Math.abs(e("#mCSB_" + a.idx + "_container")[0].offsetTop), m = l[0][0].offsetTop, p = l[0].parent().height() - l[0].height(), g = n.deltaY || i; "y" === d && !a.overflowed[0] || "x" === d && !a.overflowed[1] || (o.mouseWheel.invert && (g = -g), o.mouseWheel.normalizeDelta && (g = 0 > g ? -1 : 1), (g > 0 && 0 !== m || 0 > g && m !== p || o.mouseWheel.preventDefault) && (n.stopImmediatePropagation(), n.preventDefault()), V(t, (f - g * h).toString(), { dir: d })) } }) } }, P = function (t, a) { var o = a.nodeName.toLowerCase(), i = t.data(n).opt.mouseWheel.disableOver; return e.inArray(o, i) > -1 && !(e.inArray(o, ["select", "textarea"]) > -1 && !e(a).is(":focus")) }, A = function () { var t = e(this), a = t.data(n), o = n + "_" + a.idx, i = e("#mCSB_" + a.idx + "_container"), r = i.parent(), l = e(".mCSB_" + a.idx + "_scrollbar ." + u[12]); l.bind("touchstart." + o + " pointerdown." + o + " MSPointerDown." + o, function () { d = !0 }).bind("touchend." + o + " pointerup." + o + " MSPointerUp." + o, function () { d = !1 }).bind("click." + o, function (o) { if (e(o.target).hasClass(u[12]) || e(o.target).hasClass("mCSB_draggerRail")) { N(t); var n = e(this), l = n.find(".mCSB_dragger"); if (n.parent(".mCSB_scrollTools_horizontal").length > 0) { if (!a.overflowed[1]) return; var s = "x", c = o.pageX > l.offset().left ? -1 : 1, d = Math.abs(i[0].offsetLeft) - .9 * c * r.width() } else { if (!a.overflowed[0]) return; var s = "y", c = o.pageY > l.offset().top ? -1 : 1, d = Math.abs(i[0].offsetTop) - .9 * c * r.height() } V(t, d.toString(), { dir: s, scrollEasing: "mcsEaseInOut" }) } }) }, z = function () { var t = e(this), o = t.data(n), i = o.opt, r = n + "_" + o.idx, l = e("#mCSB_" + o.idx + "_container"), s = l.parent(); l.bind("focusin." + r, function () { var o = e(a.activeElement), n = l.find(".mCustomScrollBox").length; o.is(i.advanced.autoScrollOnFocus) && (N(t), clearTimeout(t[0]._focusTimeout), t[0]._focusTimer = n ? 17 * n : 0, t[0]._focusTimeout = setTimeout(function () { var e = [te(o)[0], te(o)[1]], a = [l[0].offsetTop, l[0].offsetLeft], n = [a[0] + e[0] >= 0 && a[0] + e[0] < s.height() - o.outerHeight(!1), a[1] + e[1] >= 0 && a[0] + e[1] < s.width() - o.outerWidth(!1)], r = "yx" !== i.axis || n[0] || n[1] ? "all" : "none"; "x" === i.axis || n[0] || V(t, e[0].toString(), { dir: "y", scrollEasing: "mcsEaseInOut", overwrite: r, dur: 0 }), "y" === i.axis || n[1] || V(t, e[1].toString(), { dir: "x", scrollEasing: "mcsEaseInOut", overwrite: r, dur: 0 }) }, t[0]._focusTimer)) }) }, H = function () { var t = e(this), a = t.data(n), o = n + "_" + a.idx, i = e("#mCSB_" + a.idx + "_container").parent(); i.bind("scroll." + o, function () { (0 !== i.scrollTop() || 0 !== i.scrollLeft()) && e(".mCSB_" + a.idx + "_scrollbar").css("visibility", "hidden") }) }, U = function () { var t = e(this), a = t.data(n), o = a.opt, i = a.sequential, r = n + "_" + a.idx, l = ".mCSB_" + a.idx + "_scrollbar", s = e(l + ">a"); s.bind("mousedown." + r + " touchstart." + r + " pointerdown." + r + " MSPointerDown." + r + " mouseup." + r + " touchend." + r + " pointerup." + r + " MSPointerUp." + r + " mouseout." + r + " pointerout." + r + " MSPointerOut." + r + " click." + r, function (n) { function r(e, a) { i.scrollAmount = o.snapAmount || o.scrollButtons.scrollAmount, Y(t, e, a) } if (n.preventDefault(), K(n)) { var l = e(this).attr("class"); switch (i.type = o.scrollButtons.scrollType, n.type) { case "mousedown": case "touchstart": case "pointerdown": case "MSPointerDown": if ("stepped" === i.type) return; d = !0, a.tweenRunning = !1, r("on", l); break; case "mouseup": case "touchend": case "pointerup": case "MSPointerUp": case "mouseout": case "pointerout": case "MSPointerOut": if ("stepped" === i.type) return; d = !1, i.dir && r("off", l); break; case "click": if ("stepped" !== i.type || a.tweenRunning) return; r("on", l) } } }) }, X = function () { var t = e(this), o = t.data(n), i = o.opt, r = o.sequential, l = n + "_" + o.idx, s = e("#mCSB_" + o.idx), c = e("#mCSB_" + o.idx + "_container"), d = c.parent(), u = "input,textarea,select,datalist,keygen,[contenteditable='true']"; s.attr("tabindex", "0").bind("blur." + l + " keydown." + l + " keyup." + l, function (n) { function l(e, a) { r.type = i.keyboard.scrollType, r.scrollAmount = i.snapAmount || i.keyboard.scrollAmount, "stepped" === r.type && o.tweenRunning || Y(t, e, a) } switch (n.type) { case "blur": o.tweenRunning && r.dir && l("off", null); break; case "keydown": case "keyup": var s = n.keyCode ? n.keyCode : n.which, h = "on"; if ("x" !== i.axis && (38 === s || 40 === s) || "y" !== i.axis && (37 === s || 39 === s)) { if ((38 === s || 40 === s) && !o.overflowed[0] || (37 === s || 39 === s) && !o.overflowed[1]) return; "keyup" === n.type && (h = "off"), e(a.activeElement).is(u) || (n.preventDefault(), n.stopImmediatePropagation(), l(h, s)) } else if (33 === s || 34 === s) { if ((o.overflowed[0] || o.overflowed[1]) && (n.preventDefault(), n.stopImmediatePropagation()), "keyup" === n.type) { N(t); var f = 34 === s ? -1 : 1; if ("x" === i.axis || "yx" === i.axis && o.overflowed[1] && !o.overflowed[0]) var m = "x", p = Math.abs(c[0].offsetLeft) - .9 * f * d.width(); else var m = "y", p = Math.abs(c[0].offsetTop) - .9 * f * d.height(); V(t, p.toString(), { dir: m, scrollEasing: "mcsEaseInOut" }) } } else if ((35 === s || 36 === s) && !e(a.activeElement).is(u) && ((o.overflowed[0] || o.overflowed[1]) && (n.preventDefault(), n.stopImmediatePropagation()), "keyup" === n.type)) { if ("x" === i.axis || "yx" === i.axis && o.overflowed[1] && !o.overflowed[0]) var m = "x", p = 35 === s ? Math.abs(d.width() - c.outerWidth(!1)) : 0; else var m = "y", p = 35 === s ? Math.abs(d.height() - c.outerHeight(!1)) : 0; V(t, p.toString(), { dir: m, scrollEasing: "mcsEaseInOut" }) } } }) }, Y = function (t, a, o, i, r) { function l(e) { var a = "stepped" !== d.type, o = r || (e ? a ? c.scrollInertia / 1.5 : c.scrollInertia : 1e3 / 60), n = e ? a ? 7.5 : 40 : 2.5, u = [Math.abs(h[0].offsetTop), Math.abs(h[0].offsetLeft)], f = [s.scrollRatio.y > 10 ? 10 : s.scrollRatio.y, s.scrollRatio.x > 10 ? 10 : s.scrollRatio.x], m = "x" === d.dir[0] ? u[1] + d.dir[1] * f[1] * n : u[0] + d.dir[1] * f[0] * n, p = "x" === d.dir[0] ? u[1] + d.dir[1] * parseInt(d.scrollAmount) : u[0] + d.dir[1] * parseInt(d.scrollAmount), g = "auto" !== d.scrollAmount ? p : m, v = i || (e ? a ? "mcsLinearOut" : "mcsEaseInOut" : "mcsLinear"), x = !!e; return e && 17 > o && (g = "x" === d.dir[0] ? u[1] : u[0]), V(t, g.toString(), { dir: d.dir[0], scrollEasing: v, dur: o, onComplete: x }), e ? void (d.dir = !1) : (clearTimeout(d.step), void (d.step = setTimeout(function () { l() }, o))) } var s = t.data(n), c = s.opt, d = s.sequential, h = e("#mCSB_" + s.idx + "_container"), f = "stepped" === d.type; switch (a) { case "on": if (d.dir = [o === u[16] || o === u[15] || 39 === o || 37 === o ? "x" : "y", o === u[13] || o === u[15] || 38 === o || 37 === o ? -1 : 1], N(t), ee(o) && "stepped" === d.type) return; l(f); break; case "off": clearTimeout(d.step), J(d, "step"), N(t), (f || s.tweenRunning && d.dir) && l(!0) } }, j = function (t) { var a = e(this).data(n).opt, o = []; return "function" == typeof t && (t = t()), t instanceof Array ? o = t.length > 1 ? [t[0], t[1]] : "x" === a.axis ? [null, t[0]] : [t[0], null] : (o[0] = t.y ? t.y : t.x || "x" === a.axis ? null : t, o[1] = t.x ? t.x : t.y || "y" === a.axis ? null : t), "function" == typeof o[0] && (o[0] = o[0]()), "function" == typeof o[1] && (o[1] = o[1]()), o }, F = function (t, a) { if (null != t && void 0 !== t) { var o = e(this), i = o.data(n), r = i.opt, l = e("#mCSB_" + i.idx + "_container"), s = l.parent(), c = typeof t; a || (a = "x" === r.axis ? "x" : "y"); var d = "x" === a ? l.outerWidth(!1) : l.outerHeight(!1), u = "x" === a ? l[0].offsetLeft : l[0].offsetTop, f = "x" === a ? "left" : "top"; switch (c) { case "function": return t(); case "object": var m = t.jquery ? t : e(t); if (!m.length) return; return "x" === a ? te(m)[1] : te(m)[0]; case "string": case "number": if (ee(t)) return Math.abs(t); if (-1 !== t.indexOf("%")) return Math.abs(d * parseInt(t) / 100); if (-1 !== t.indexOf("-=")) return Math.abs(u - parseInt(t.split("-=")[1])); if (-1 !== t.indexOf("+=")) { var p = u + parseInt(t.split("+=")[1]); return p >= 0 ? 0 : Math.abs(p) } if (-1 !== t.indexOf("px") && ee(t.split("px")[0])) return Math.abs(t.split("px")[0]); if ("top" === t || "left" === t) return 0; if ("bottom" === t) return Math.abs(s.height() - l.outerHeight(!1)); if ("right" === t) return Math.abs(s.width() - l.outerWidth(!1)); if ("first" === t || "last" === t) { var m = l.find(":" + t); return "x" === a ? te(m)[1] : te(m)[0] } return e(t).length ? "x" === a ? te(e(t))[1] : te(e(t))[0] : (l.css(f, t), void h.update.call(null, o[0])) } } }, q = function (t) { function a() { var e = 0; return s.advanced.updateOnImageLoad && (e = c.find("img").length), e } function o() { !0 === s.advanced.updateOnSelectorChange && (s.advanced.updateOnSelectorChange = "*"); var t = 0, a = c.find(s.advanced.updateOnSelectorChange); return s.advanced.updateOnSelectorChange && a.length > 0 && a.each(function () { t += e(this).height() + e(this).width() }), t } function i(e) { clearTimeout(c[0].autoUpdate), h.update.call(null, r[0], e) } var r = e(this), l = r.data(n), s = l.opt, c = e("#mCSB_" + l.idx + "_container"); if (t) return clearTimeout(c[0].autoUpdate), void J(c[0], "autoUpdate"); var d, f, m, p = c.parent(), g = [e("#mCSB_" + l.idx + "_scrollbar_vertical"), e("#mCSB_" + l.idx + "_scrollbar_horizontal")], v = function () { return [g[0].is(":visible") ? g[0].outerHeight(!0) : 0, g[1].is(":visible") ? g[1].outerWidth(!0) : 0] }, x = o(), _ = [c.outerHeight(!1), c.outerWidth(!1), p.height(), p.width(), v()[0], v()[1]], S = a(); !function t() { clearTimeout(c[0].autoUpdate), c[0].autoUpdate = setTimeout(function () { return s.advanced.updateOnSelectorChange && (d = o()) !== x ? (i(3), void (x = d)) : (s.advanced.updateOnContentResize && ((f = [c.outerHeight(!1), c.outerWidth(!1), p.height(), p.width(), v()[0], v()[1]])[0] !== _[0] || f[1] !== _[1] || f[2] !== _[2] || f[3] !== _[3] || f[4] !== _[4] || f[5] !== _[5]) && (i(f[0] !== _[0] || f[1] !== _[1]), _ = f), s.advanced.updateOnImageLoad && (m = a()) !== S && (c.find("img").each(function () { !function (t) { if (e(t).hasClass(u[2])) i(); else { var a = new Image; a.onload = function (e, t) { return function () { return t.apply(e, arguments) } }(a, function () { this.onload = null, e(t).addClass(u[2]), i(2) }), a.src = t.src } }(this) }), S = m), void ((s.advanced.updateOnSelectorChange || s.advanced.updateOnContentResize || s.advanced.updateOnImageLoad) && t())) }, 60) }() }, N = function (t) { var a = t.data(n), o = e("#mCSB_" + a.idx + "_container,#mCSB_" + a.idx + "_container_wrapper,#mCSB_" + a.idx + "_dragger_vertical,#mCSB_" + a.idx + "_dragger_horizontal"); o.each(function () { G.call(this) }) }, V = function (t, a, o) { function i(e) { return d && u.callbacks[e] && "function" == typeof u.callbacks[e] } function r() { var e = [p[0].offsetTop, p[0].offsetLeft], a = [_[0].offsetTop, _[0].offsetLeft], n = [p.outerHeight(!1), p.outerWidth(!1)], i = [m.height(), m.width()]; t[0].mcs = { content: p, top: e[0], left: e[1], draggerTop: a[0], draggerLeft: a[1], topPct: Math.round(100 * Math.abs(e[0]) / (Math.abs(n[0]) - i[0])), leftPct: Math.round(100 * Math.abs(e[1]) / (Math.abs(n[1]) - i[1])), direction: o.dir } } var l, s, c, d = t.data(n), u = d.opt, h = { trigger: "internal", dir: "y", scrollEasing: "mcsEaseOut", drag: !1, dur: u.scrollInertia, overwrite: "all", callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, o = e.extend(h, o), f = [o.dur, o.drag ? 0 : o.dur], m = e("#mCSB_" + d.idx), p = e("#mCSB_" + d.idx + "_container"), g = p.parent(), v = u.callbacks.onTotalScrollOffset ? j.call(t, u.callbacks.onTotalScrollOffset) : [0, 0], x = u.callbacks.onTotalScrollBackOffset ? j.call(t, u.callbacks.onTotalScrollBackOffset) : [0, 0]; if (d.trigger = o.trigger, (0 !== g.scrollTop() || 0 !== g.scrollLeft()) && (e(".mCSB_" + d.idx + "_scrollbar").css("visibility", "visible"), g.scrollTop(0).scrollLeft(0)), "_resetY" !== a || d.contentReset.y || (i("onOverflowYNone") && u.callbacks.onOverflowYNone.call(t[0]), d.contentReset.y = 1), "_resetX" !== a || d.contentReset.x || (i("onOverflowXNone") && u.callbacks.onOverflowXNone.call(t[0]), d.contentReset.x = 1), "_resetY" !== a && "_resetX" !== a) { switch (!d.contentReset.y && t[0].mcs || !d.overflowed[0] || (i("onOverflowY") && u.callbacks.onOverflowY.call(t[0]), d.contentReset.x = null), !d.contentReset.x && t[0].mcs || !d.overflowed[1] || (i("onOverflowX") && u.callbacks.onOverflowX.call(t[0]), d.contentReset.x = null), u.snapAmount && (l = a, s = u.snapAmount, c = u.snapOffset, a = Math.round(l / s) * s - c), o.dir) { case "x": var _ = e("#mCSB_" + d.idx + "_dragger_horizontal"), S = "left", w = p[0].offsetLeft, b = [m.width() - p.outerWidth(!1), _.parent().width() - _.width()], C = [a, 0 === a ? 0 : a / d.scrollRatio.x], y = v[1], T = x[1], M = y > 0 ? y / d.scrollRatio.x : 0, k = T > 0 ? T / d.scrollRatio.x : 0; break; case "y": var _ = e("#mCSB_" + d.idx + "_dragger_vertical"), S = "top", w = p[0].offsetTop, b = [m.height() - p.outerHeight(!1), _.parent().height() - _.height()], C = [a, 0 === a ? 0 : a / d.scrollRatio.y], y = v[0], T = x[0], M = y > 0 ? y / d.scrollRatio.y : 0, k = T > 0 ? T / d.scrollRatio.y : 0 } C[1] < 0 || 0 === C[0] && 0 === C[1] ? C = [0, 0] : C[1] >= b[1] ? C = [b[0], b[1]] : C[0] = -C[0], t[0].mcs || (r(), i("onInit") && u.callbacks.onInit.call(t[0])), clearTimeout(p[0].onCompleteTimeout), (d.tweenRunning || !(0 === w && C[0] >= 0 || w === b[0] && C[0] <= b[0])) && (Q(_[0], S, Math.round(C[1]), f[1], o.scrollEasing), Q(p[0], S, Math.round(C[0]), f[0], o.scrollEasing, o.overwrite, { onStart: function () { o.callbacks && o.onStart && !d.tweenRunning && (i("onScrollStart") && (r(), u.callbacks.onScrollStart.call(t[0])), d.tweenRunning = !0, B(_), d.cbOffsets = [u.callbacks.alwaysTriggerOffsets || w >= b[0] + y, u.callbacks.alwaysTriggerOffsets || -T >= w]) }, onUpdate: function () { o.callbacks && o.onUpdate && i("whileScrolling") && (r(), u.callbacks.whileScrolling.call(t[0])) }, onComplete: function () { if (o.callbacks && o.onComplete) { "yx" === u.axis && clearTimeout(p[0].onCompleteTimeout); var e = p[0].idleTimer || 0; p[0].onCompleteTimeout = setTimeout(function () { i("onScroll") && (r(), u.callbacks.onScroll.call(t[0])), i("onTotalScroll") && C[1] >= b[1] - M && d.cbOffsets[0] && (r(), u.callbacks.onTotalScroll.call(t[0])), i("onTotalScrollBack") && C[1] <= k && d.cbOffsets[1] && (r(), u.callbacks.onTotalScrollBack.call(t[0])), d.tweenRunning = !1, p[0].idleTimer = 0, B(_, "hide") }, e) } } })) } }, Q = function (e, a, o, n, i, r, l) { function s() { _.stop || (g || h.call(), g = Z() - p, c(), g >= _.time && (_.time = g > _.time ? g + d - (g - _.time) : g + d - 1, _.time < g + 1 && (_.time = g + 1)), _.time < n ? _.id = u(s) : m.call()) } function c() { n > 0 ? (_.currVal = function (e, t, a, o, n) { switch (n) { case "linear": case "mcsLinear": return a * e / o + t; case "mcsLinearOut": return e /= o, e--, a * Math.sqrt(1 - e * e) + t; case "easeInOutSmooth": return 1 > (e /= o / 2) ? a / 2 * e * e + t : -a / 2 * (--e * (e - 2) - 1) + t; case "easeInOutStrong": return 1 > (e /= o / 2) ? a / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--, a / 2 * (2 - Math.pow(2, -10 * e)) + t); case "easeInOut": case "mcsEaseInOut": return 1 > (e /= o / 2) ? a / 2 * e * e * e + t : a / 2 * ((e -= 2) * e * e + 2) + t; case "easeOutSmooth": return e /= o, -a * (--e * e * e * e - 1) + t; case "easeOutStrong": return a * (1 - Math.pow(2, -10 * e / o)) + t; case "easeOut": case "mcsEaseOut": default: var i = (e /= o) * e, r = i * e; return t + a * (.499999999999997 * r * i + -2.5 * i * i + 5.5 * r + -6.5 * i + 4 * e) } }(_.time, v, S, n, i), x[a] = Math.round(_.currVal) + "px") : x[a] = o + "px", f.call() } e._mTween || (e._mTween = { top: {}, left: {} }); var d, u, l = l || {}, h = l.onStart || function () { }, f = l.onUpdate || function () { }, m = l.onComplete || function () { }, p = Z(), g = 0, v = e.offsetTop, x = e.style, _ = e._mTween[a]; "left" === a && (v = e.offsetLeft); var S = o - v; _.stop = 0, "none" !== r && null != _.id && (t.requestAnimationFrame ? t.cancelAnimationFrame(_.id) : clearTimeout(_.id), _.id = null), d = 1e3 / 60, _.time = g + d, u = t.requestAnimationFrame ? t.requestAnimationFrame : function (e) { return c(), setTimeout(e, .01) }, _.id = u(s) }, Z = function () { return t.performance && t.performance.now ? t.performance.now() : t.performance && t.performance.webkitNow ? t.performance.webkitNow() : Date.now ? Date.now() : (new Date).getTime() }, G = function () { var e = this; e._mTween || (e._mTween = { top: {}, left: {} }); for (var a = ["top", "left"], o = 0; o < a.length; o++) { var n = a[o]; e._mTween[n].id && (t.requestAnimationFrame ? t.cancelAnimationFrame(e._mTween[n].id) : clearTimeout(e._mTween[n].id), e._mTween[n].id = null, e._mTween[n].stop = 1) } }, J = function (e, t) { try { delete e[t] } catch (a) { e[t] = null } }, K = function (e) { return !(e.which && 1 !== e.which) }, $ = function (e) { var t = e.originalEvent.pointerType; return !(t && "touch" !== t && 2 !== t) }, ee = function (e) { return !isNaN(parseFloat(e)) && isFinite(e) }, te = function (e) { var t = e.parents(".mCSB_container"); return [e.offset().top - t.offset().top, e.offset().left - t.offset().left] }, e.fn[o] = function (t) { return h[t] ? h[t].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("Method " + t + " does not exist") : h.init.apply(this, arguments) }, e[o] = function (t) { return h[t] ? h[t].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof t && t ? void e.error("Method " + t + " does not exist") : h.init.apply(this, arguments) }, e[o].defaults = r, t[o] = !0, e(t).load(function () { e(i)[o](), e.extend(e.expr[":"], { mcsInView: e.expr[":"].mcsInView || function (t) { var a, o, n = e(t), i = n.parents(".mCSB_container"); if (i.length) return a = i.parent(), o = [i[0].offsetTop, i[0].offsetLeft], o[0] + te(n)[0] >= 0 && o[0] + te(n)[0] < a.height() - n.outerHeight(!1) && o[1] + te(n)[1] >= 0 && o[1] + te(n)[1] < a.width() - n.outerWidth(!1) }, mcsOverflow: e.expr[":"].mcsOverflow || function (t) { var a = e(t).data(n); if (a) return a.overflowed[0] || a.overflowed[1] } }) }) }(jQuery, window, document);;!function (t) { "function" == typeof define && define.amd ? define(["jquery"], function (i) { t(i, window, document) }) : t(jQuery, window, document) }(function (t, i, e, n) { "use strict"; function a(i, e) { this.element = i, this.options = t.extend({}, r, e), this._defaults = r, this.ns = "." + s + o++, this.isGoodBrowser = Boolean(i.setSelectionRange), this.hadInitialPlaceholder = Boolean(t(i).attr("placeholder")), this._name = s, this.init() } var s = "intlTelInput", o = 1, r = { autoFormat: !0, autoHideDialCode: !0, defaultCountry: "", nationalMode: !1, numberType: "", onlyCountries: [], preferredCountries: ["us", "gb"], responsiveDropdown: !1, utilsScript: "" }, l = 38, u = 40, h = 13, d = 27, c = 43, p = 65, f = 90, g = 48, m = 57, y = 32, v = 8, C = 46, I = 17, b = 91, _ = 224, w = !1; t(i).load(function () { w = !0 }), a.prototype = { init: function () { var i = this; "auto" == this.options.defaultCountry ? t.get("http://ipinfo.io", function (t) { i.options.defaultCountry = t && t.country ? t.country.toLowerCase() : "", i.ready() }, "jsonp") : this.ready() }, ready: function () { this.options.nationalMode && (this.options.autoHideDialCode = !1), (navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/Android/i) && navigator.userAgent.match(/Chrome/i)) && (this.options.autoFormat = !1), i.innerWidth < 500 && (this.options.responsiveDropdown = !0), this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners() }, _processCountryData: function () { this._setInstanceCountryData(), this._setPreferredCountries() }, _addCountryCode: function (t, i, e) { i in this.countryCodes || (this.countryCodes[i] = []); var n = e || 0; this.countryCodes[i][n] = t }, _setInstanceCountryData: function () { var t; if (this.options.onlyCountries.length) for (this.countries = [], t = 0; t < this.options.onlyCountries.length; t++) { var i = this._getCountryData(this.options.onlyCountries[t], !0, !1); i && this.countries.push(i) } else this.countries = D; for (this.countryCodes = {}, t = 0; t < this.countries.length; t++) { var e = this.countries[t]; if (this._addCountryCode(e.iso2, e.dialCode, e.priority), e.areaCodes) for (var n = 0; n < e.areaCodes.length; n++) this._addCountryCode(e.iso2, e.dialCode + e.areaCodes[n]) } }, _setPreferredCountries: function () { this.preferredCountries = []; for (var t = 0; t < this.options.preferredCountries.length; t++) { var i = this.options.preferredCountries[t], e = this._getCountryData(i, !1, !0); e && this.preferredCountries.push(e) } }, _generateMarkup: function () { this.telInput = t(this.element), this.telInput.wrap(t("<div>", { class: "intl-tel-input" })); var i = t("<div>", { class: "flag-dropdown" }).insertAfter(this.telInput), e = t("<div>", { class: "selected-flag" }).appendTo(i); this.selectedFlagInner = t("<div>", { class: "flag" }).appendTo(e), t("<div>", { class: "arrow" }).appendTo(this.selectedFlagInner), this.countryList = t("<ul>", { class: "country-list v-hide" }).appendTo(i), this.preferredCountries.length && (this._appendListItems(this.preferredCountries, "preferred"), t("<li>", { class: "divider" }).appendTo(this.countryList)), this._appendListItems(this.countries, ""), this.dropdownHeight = this.countryList.outerHeight(), this.countryList.removeClass("v-hide").addClass("hide"), this.options.responsiveDropdown && this.countryList.outerWidth(this.telInput.outerWidth()), this.countryListItems = this.countryList.children(".country") }, _appendListItems: function (t, i) { for (var e = "", n = 0; n < t.length; n++) { var a = t[n]; e += "<li class='country " + i + "' data-dial-code='" + a.dialCode + "' data-country-code='" + a.iso2 + "'>", e += "<div class='flag " + a.iso2 + "'></div>", e += "<span class='country-name'>" + a.name + "</span>", e += "<span class='dial-code'>+" + a.dialCode + "</span>", e += "</li>" } this.countryList.append(e) }, _setInitialState: function () { var t, i = this.telInput.val(); this._getDialCode(i) ? this._updateFlagFromNumber(i) : (t = this.options.defaultCountry ? this._getCountryData(this.options.defaultCountry, !1, !1) : this.preferredCountries.length ? this.preferredCountries[0] : this.countries[0], this._selectFlag(t.iso2), i || this._updateDialCode(t.dialCode, !1)); i && this._updateVal(i, !1) }, _initListeners: function () { var e = this; this._initKeyListeners(), (this.options.autoHideDialCode || this.options.autoFormat) && this._initFocusListeners(); var n = this.telInput.closest("label"); n.length && n.on("click" + this.ns, function (t) { e.countryList.hasClass("hide") ? e.telInput.focus() : t.preventDefault() }), this.selectedFlagInner.parent().on("click" + this.ns, function () { e.countryList.hasClass("hide") && !e.telInput.prop("disabled") && e._showDropdown() }), this.options.utilsScript && (w ? this.loadUtils() : t(i).load(function () { e.loadUtils() })) }, _initKeyListeners: function () { var t = this; this.options.autoFormat && this.telInput.on("keypress" + this.ns, function (i) { if (i.which >= y && !i.metaKey) { i.preventDefault(); var e = i.which >= g && i.which <= m || i.which == c, n = t.telInput[0], a = t.isGoodBrowser && n.selectionStart == n.selectionEnd, s = t.telInput.attr("maxlength"); if ((!s || t.telInput.val().length < s) && (e || a)) { var o = e ? String.fromCharCode(i.which) : null; t._handleInputKey(o, !0) } } }), this.telInput.on("keyup" + this.ns, function (i) { if (i.which == h); else if (t.options.autoFormat) { var e = i.which == I || i.which == b || i.which == _, n = t.telInput[0], a = t.isGoodBrowser && n.selectionStart == n.selectionEnd, s = t.isGoodBrowser && n.selectionStart == t.telInput.val().length; if (i.which == C || i.which == v || e && a) { var o = !(i.which == v && s); t._handleInputKey(null, o) } if (!t.options.nationalMode) { var r = t.telInput.val(); if ("+" != r.substr(0, 1)) { var l = t.isGoodBrowser ? n.selectionStart + 1 : 0; t.telInput.val("+" + r), t.isGoodBrowser && n.setSelectionRange(l, l) } } } else t._updateFlagFromNumber(t.telInput.val()) }) }, _handleInputKey: function (t, i) { var e = this.telInput.val(), n = null, a = !1, s = this.telInput[0]; if (this.isGoodBrowser) { var o = s.selectionEnd, r = e.length; a = o == r, t ? (e = e.substr(0, s.selectionStart) + t + e.substring(o, r), a || (n = o + (e.length - r))) : n = s.selectionStart } else t && (e += t); this.setNumber(e, i), this.isGoodBrowser && (a && (n = this.telInput.val().length), s.setSelectionRange(n, n)) }, _initFocusListeners: function () { var t = this; this.options.autoHideDialCode && this.telInput.on("mousedown" + this.ns, function (i) { t.telInput.is(":focus") || t.telInput.val() || (i.preventDefault(), t.telInput.focus()) }), this.telInput.on("focus" + this.ns, function () { var i = t.telInput.val(); t.telInput.data("focusVal", i), t.options.autoHideDialCode && (i || (t._updateVal("+" + t.selectedCountryData.dialCode, !0), t.telInput.one("keypress.plus" + t.ns, function (i) { if (i.which == c) { var e = t.options.autoFormat ? "+" : ""; t.telInput.val(e) } }), setTimeout(function () { var i = t.telInput[0]; if (t.isGoodBrowser) { var e = t.telInput.val().length; i.setSelectionRange(e, e) } }))) }), this.telInput.on("blur" + this.ns, function () { if (t.options.autoHideDialCode) { var i = t.telInput.val(); if ("+" == i.substr(0, 1)) { var e = t._getNumeric(i); e && t.selectedCountryData.dialCode != e || t.telInput.val("") } t.telInput.off("keypress.plus" + t.ns) } t.options.autoFormat && t.telInput.val() != t.telInput.data("focusVal") && t.telInput.trigger("change") }) }, _getNumeric: function (t) { return t.replace(/\D/g, "") }, _showDropdown: function () { this._setDropdownPosition(); var t = this.countryList.children(".active"); this._highlightListItem(t), this.countryList.removeClass("hide"), this._scrollTo(t), this._bindDropdownListeners(), this.selectedFlagInner.children(".arrow").addClass("up") }, _setDropdownPosition: function () { var e = this.telInput.offset().top, n = t(i).scrollTop(), a = e + this.telInput.outerHeight() + this.dropdownHeight < n + t(i).height(), s = e - this.dropdownHeight > n, o = !a && s ? "-" + (this.dropdownHeight - 1) + "px" : ""; this.countryList.css("top", o) }, _bindDropdownListeners: function () { var i = this; this.countryList.on("mouseover" + this.ns, ".country", function () { i._highlightListItem(t(this)) }), this.countryList.on("click" + this.ns, ".country", function () { i._selectListItem(t(this)) }); var n = !0; t("html").on("click" + this.ns, function () { n || i._closeDropdown(), n = !1 }); var a = "", s = null; t(e).on("keydown" + this.ns, function (t) { t.preventDefault(), t.which == l || t.which == u ? i._handleUpDownKey(t.which) : t.which == h ? i._handleEnterKey() : t.which == d ? i._closeDropdown() : (t.which >= p && t.which <= f || t.which == y) && (s && clearTimeout(s), a += String.fromCharCode(t.which), i._searchForCountry(a), s = setTimeout(function () { a = "" }, 1e3)) }) }, _handleUpDownKey: function (t) { var i = this.countryList.children(".highlight").first(), e = t == l ? i.prev() : i.next(); e.length && (e.hasClass("divider") && (e = t == l ? e.prev() : e.next()), this._highlightListItem(e), this._scrollTo(e)) }, _handleEnterKey: function () { var t = this.countryList.children(".highlight").first(); t.length && this._selectListItem(t) }, _searchForCountry: function (t) { for (var i = 0; i < this.countries.length; i++) if (this._startsWith(this.countries[i].name, t)) { var e = this.countryList.children("[data-country-code=" + this.countries[i].iso2 + "]").not(".preferred"); this._highlightListItem(e), this._scrollTo(e, !0); break } }, _startsWith: function (t, i) { return t.substr(0, i.length).toUpperCase() == i }, _updateVal: function (t, e) { var n; if (this.options.autoFormat && i.intlTelInputUtils) { n = intlTelInputUtils.formatNumber(t, this.selectedCountryData.iso2, e); var a = this.telInput.attr("maxlength"); a && n.length > a && (n = n.substr(0, a)) } else n = t; this.telInput.val(n) }, _updateFlagFromNumber: function (t) { this.options.nationalMode && this.selectedCountryData && "1" == this.selectedCountryData.dialCode && "+" != t.substr(0, 1) && (t = "+1" + t); var i = this._getDialCode(t); if (i) { var e = this.countryCodes[this._getNumeric(i)], n = !1; if (this.selectedCountryData) for (var a = 0; a < e.length; a++) e[a] == this.selectedCountryData.iso2 && (n = !0); if (!n || this._isUnknownNanp(t, i)) for (var s = 0; s < e.length; s++) if (e[s]) { this._selectFlag(e[s]); break } } }, _isUnknownNanp: function (t, i) { return "+1" == i && this._getNumeric(t).length >= 4 }, _highlightListItem: function (t) { this.countryListItems.removeClass("highlight"), t.addClass("highlight") }, _getCountryData: function (t, i, e) { for (var n = i ? D : this.countries, a = 0; a < n.length; a++) if (n[a].iso2 == t) return n[a]; if (e) return null; throw new Error("No country data for '" + t + "'") }, _selectFlag: function (t) { this.selectedCountryData = this._getCountryData(t, !1, !1), this.selectedFlagInner.attr("class", "flag " + t); var i = this.selectedCountryData.name + ": +" + this.selectedCountryData.dialCode; this.selectedFlagInner.parent().attr("title", i), this._updatePlaceholder(); var e = this.countryListItems.children(".flag." + t).first().parent(); this.countryListItems.removeClass("active"), e.addClass("active") }, _updatePlaceholder: function () { if (i.intlTelInputUtils && !this.hadInitialPlaceholder) { var t = this.selectedCountryData.iso2, e = this.options.numberType ? intlTelInputUtils.numberType[this.options.numberType] : intlTelInputUtils.numberType.FIXED_LINE, n = intlTelInputUtils.getExampleNumber(t, this.options.nationalMode, e); this.telInput.attr("placeholder", n) } }, _selectListItem: function (t) { var i = t.attr("data-country-code"); this._selectFlag(i), this._closeDropdown(), this._updateDialCode(t.attr("data-dial-code"), !0), this.telInput.trigger("change"), this.telInput.focus() }, _closeDropdown: function () { this.countryList.addClass("hide"), this.selectedFlagInner.children(".arrow").removeClass("up"), t(e).off(this.ns), t("html").off(this.ns), this.countryList.off(this.ns) }, _scrollTo: function (t, i) { var e = this.countryList, n = e.height(), a = e.offset().top, s = a + n, o = t.outerHeight(), r = t.offset().top, l = r + o, u = r - a + e.scrollTop(), h = n / 2 - o / 2; if (a > r) i && (u -= h), e.scrollTop(u); else if (l > s) { i && (u += h); var d = n - o; e.scrollTop(u - d) } }, _updateDialCode: function (i, e) { var n, a = this.telInput.val(); if (i = "+" + i, this.options.nationalMode && "+" != a.substr(0, 1)) n = a; else if (a) { var s = this._getDialCode(a); if (s.length > 1) n = a.replace(s, i); else n = i + ("+" != a.substr(0, 1) ? t.trim(a) : "") } else n = !this.options.autoHideDialCode || e ? i : ""; this._updateVal(n, e) }, _getDialCode: function (i) { var e = ""; if ("+" == i.charAt(0)) for (var n = "", a = 0; a < i.length; a++) { var s = i.charAt(a); if (t.isNumeric(s) && (n += s, this.countryCodes[n] && (e = i.substr(0, a + 1)), 4 == n.length)) break } return e }, destroy: function () { this._closeDropdown(), this.telInput.off(this.ns), this.selectedFlagInner.parent().off(this.ns), this.telInput.closest("label").off(this.ns), this.telInput.parent().before(this.telInput).remove() }, getCleanNumber: function () { return i.intlTelInputUtils ? intlTelInputUtils.formatNumberE164(this.telInput.val(), this.selectedCountryData.iso2) : "" }, getNumberType: function () { return i.intlTelInputUtils ? intlTelInputUtils.getNumberType(this.telInput.val(), this.selectedCountryData.iso2) : -99 }, getSelectedCountryData: function () { return this.selectedCountryData || {} }, getValidationError: function () { return i.intlTelInputUtils ? intlTelInputUtils.getValidationError(this.telInput.val(), this.selectedCountryData.iso2) : -99 }, isValidNumber: function () { var e = t.trim(this.telInput.val()), n = this.options.nationalMode ? this.selectedCountryData.iso2 : ""; return !(/[a-zA-Z]/.test(e) || !i.intlTelInputUtils) && intlTelInputUtils.isValidNumber(e, n) }, loadUtils: function (i) { var e = i || this.options.utilsScript; !t.fn[s].loadedUtilsScript && e && (t.fn[s].loadedUtilsScript = !0, t.ajax({ url: e, success: function () { t(".intl-tel-input input").intlTelInput("utilsLoaded") }, dataType: "script", cache: !0 })) }, selectCountry: function (t) { this.selectedFlagInner.hasClass(t) || (this._selectFlag(t), this._updateDialCode(this.selectedCountryData.dialCode, !1)) }, setNumber: function (t, i) { this.options.nationalMode || "+" == t.substr(0, 1) || (t = "+" + t), this._updateFlagFromNumber(t), this._updateVal(t, i) }, utilsLoaded: function () { this.options.autoFormat && this.telInput.val() && this._updateVal(this.telInput.val()), this._updatePlaceholder() } }, t.fn[s] = function (i) { var e, o = arguments; return i === n || "object" == typeof i ? this.each(function () { t.data(this, "plugin_" + s) || t.data(this, "plugin_" + s, new a(this, i)) }) : "string" == typeof i && "_" !== i[0] && "init" !== i ? (this.each(function () { var n = t.data(this, "plugin_" + s); n instanceof a && "function" == typeof n[i] && (e = n[i].apply(n, Array.prototype.slice.call(o, 1))), "destroy" === i && t.data(this, "plugin_" + s, null) }), e !== n ? e : this) : void 0 }, t.fn[s].getCountryData = function () { return D }, t.fn[s].setCountryData = function (t) { D = t }; for (var D = [["Afghanistan (‫افغانستان‬‎)", "af", "93"], ["Albania (Shqipëri)", "al", "355"], ["Algeria (‫الجزائر‬‎)", "dz", "213"], ["American Samoa", "as", "1684"], ["Andorra", "ad", "376"], ["Angola", "ao", "244"], ["Anguilla", "ai", "1264"], ["Antigua and Barbuda", "ag", "1268"], ["Argentina", "ar", "54"], ["Armenia (Հայաստան)", "am", "374"], ["Aruba", "aw", "297"], ["Australia", "au", "61"], ["Austria (Österreich)", "at", "43"], ["Azerbaijan (Azərbaycan)", "az", "994"], ["Bahamas", "bs", "1242"], ["Bahrain (‫البحرين‬‎)", "bh", "973"], ["Bangladesh (বাংলাদেশ)", "bd", "880"], ["Barbados", "bb", "1246"], ["Belarus (Беларусь)", "by", "375"], ["Belgium (België)", "be", "32"], ["Belize", "bz", "501"], ["Benin (Bénin)", "bj", "229"], ["Bermuda", "bm", "1441"], ["Bhutan (འབྲུག)", "bt", "975"], ["Bolivia", "bo", "591"], ["Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387"], ["Botswana", "bw", "267"], ["Brazil (Brasil)", "br", "55"], ["British Indian Ocean Territory", "io", "246"], ["British Virgin Islands", "vg", "1284"], ["Brunei", "bn", "673"], ["Bulgaria (България)", "bg", "359"], ["Burkina Faso", "bf", "226"], ["Burundi (Uburundi)", "bi", "257"], ["Cambodia (កម្ពុជា)", "kh", "855"], ["Cameroon (Cameroun)", "cm", "237"], ["Canada", "ca", "1", 1, ["204", "236", "249", "250", "289", "306", "343", "365", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]], ["Cape Verde (Kabu Verdi)", "cv", "238"], ["Caribbean Netherlands", "bq", "599", 1], ["Cayman Islands", "ky", "1345"], ["Central African Republic (République centrafricaine)", "cf", "236"], ["Chad (Tchad)", "td", "235"], ["Chile", "cl", "56"], ["China (中国)", "cn", "86"], ["Colombia", "co", "57"], ["Comoros (‫جزر القمر‬‎)", "km", "269"], ["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "cd", "243"], ["Congo (Republic) (Congo-Brazzaville)", "cg", "242"], ["Cook Islands", "ck", "682"], ["Costa Rica", "cr", "506"], ["Côte d’Ivoire", "ci", "225"], ["Croatia (Hrvatska)", "hr", "385"], ["Cuba", "cu", "53"], ["Curaçao", "cw", "599", 0], ["Cyprus (Κύπρος)", "cy", "357"], ["Czech Republic (Česká republika)", "cz", "420"], ["Denmark (Danmark)", "dk", "45"], ["Djibouti", "dj", "253"], ["Dominica", "dm", "1767"], ["Dominican Republic (República Dominicana)", "do", "1", 2, ["809", "829", "849"]], ["Ecuador", "ec", "593"], ["Egypt (‫مصر‬‎)", "eg", "20"], ["El Salvador", "sv", "503"], ["Equatorial Guinea (Guinea Ecuatorial)", "gq", "240"], ["Eritrea", "er", "291"], ["Estonia (Eesti)", "ee", "372"], ["Ethiopia", "et", "251"], ["Falkland Islands (Islas Malvinas)", "fk", "500"], ["Faroe Islands (Føroyar)", "fo", "298"], ["Fiji", "fj", "679"], ["Finland (Suomi)", "fi", "358"], ["France", "fr", "33"], ["French Guiana (Guyane française)", "gf", "594"], ["French Polynesia (Polynésie française)", "pf", "689"], ["Gabon", "ga", "241"], ["Gambia", "gm", "220"], ["Georgia (საქართველო)", "ge", "995"], ["Germany (Deutschland)", "de", "49"], ["Ghana (Gaana)", "gh", "233"], ["Gibraltar", "gi", "350"], ["Greece (Ελλάδα)", "gr", "30"], ["Greenland (Kalaallit Nunaat)", "gl", "299"], ["Grenada", "gd", "1473"], ["Guadeloupe", "gp", "590", 0], ["Guam", "gu", "1671"], ["Guatemala", "gt", "502"], ["Guinea (Guinée)", "gn", "224"], ["Guinea-Bissau (Guiné Bissau)", "gw", "245"], ["Guyana", "gy", "592"], ["Haiti", "ht", "509"], ["Honduras", "hn", "504"], ["Hong Kong (香港)", "hk", "852"], ["Hungary (Magyarország)", "hu", "36"], ["Iceland (Ísland)", "is", "354"], ["India (भारत)", "in", "91"], ["Indonesia", "id", "62"], ["Iran (‫ایران‬‎)", "ir", "98"], ["Iraq (‫العراق‬‎)", "iq", "964"], ["Ireland", "ie", "353"], ["Israel (‫ישראל‬‎)", "il", "972"], ["Italy (Italia)", "it", "39", 0], ["Jamaica", "jm", "1876"], ["Japan (日本)", "jp", "81"], ["Jordan (‫الأردن‬‎)", "jo", "962"], ["Kazakhstan (Казахстан)", "kz", "7", 1], ["Kenya", "ke", "254"], ["Kiribati", "ki", "686"], ["Kuwait (‫الكويت‬‎)", "kw", "965"], ["Kyrgyzstan (Кыргызстан)", "kg", "996"], ["Laos (ລາວ)", "la", "856"], ["Latvia (Latvija)", "lv", "371"], ["Lebanon (‫لبنان‬‎)", "lb", "961"], ["Lesotho", "ls", "266"], ["Liberia", "lr", "231"], ["Libya (‫ليبيا‬‎)", "ly", "218"], ["Liechtenstein", "li", "423"], ["Lithuania (Lietuva)", "lt", "370"], ["Luxembourg", "lu", "352"], ["Macau (澳門)", "mo", "853"], ["Macedonia (FYROM) (Македонија)", "mk", "389"], ["Madagascar (Madagasikara)", "mg", "261"], ["Malawi", "mw", "265"], ["Malaysia", "my", "60"], ["Maldives", "mv", "960"], ["Mali", "ml", "223"], ["Malta", "mt", "356"], ["Marshall Islands", "mh", "692"], ["Martinique", "mq", "596"], ["Mauritania (‫موريتانيا‬‎)", "mr", "222"], ["Mauritius (Moris)", "mu", "230"], ["Mexico (México)", "mx", "52"], ["Micronesia", "fm", "691"], ["Moldova (Republica Moldova)", "md", "373"], ["Monaco", "mc", "377"], ["Mongolia (Монгол)", "mn", "976"], ["Montenegro (Crna Gora)", "me", "382"], ["Montserrat", "ms", "1664"], ["Morocco (‫المغرب‬‎)", "ma", "212"], ["Mozambique (Moçambique)", "mz", "258"], ["Myanmar (Burma) (မြန်မာ)", "mm", "95"], ["Namibia (Namibië)", "na", "264"], ["Nauru", "nr", "674"], ["Nepal (नेपाल)", "np", "977"], ["Netherlands (Nederland)", "nl", "31"], ["New Caledonia (Nouvelle-Calédonie)", "nc", "687"], ["New Zealand", "nz", "64"], ["Nicaragua", "ni", "505"], ["Niger (Nijar)", "ne", "227"], ["Nigeria", "ng", "234"], ["Niue", "nu", "683"], ["Norfolk Island", "nf", "672"], ["North Korea (조선 민주주의 인민 공화국)", "kp", "850"], ["Northern Mariana Islands", "mp", "1670"], ["Norway (Norge)", "no", "47"], ["Oman (‫عُمان‬‎)", "om", "968"], ["Pakistan (‫پاکستان‬‎)", "pk", "92"], ["Palau", "pw", "680"], ["Palestine (‫فلسطين‬‎)", "ps", "970"], ["Panama (Panamá)", "pa", "507"], ["Papua New Guinea", "pg", "675"], ["Paraguay", "py", "595"], ["Peru (Perú)", "pe", "51"], ["Philippines", "ph", "63"], ["Poland (Polska)", "pl", "48"], ["Portugal", "pt", "351"], ["Puerto Rico", "pr", "1", 3, ["787", "939"]], ["Qatar (‫قطر‬‎)", "qa", "974"], ["Réunion (La Réunion)", "re", "262"], ["Romania (România)", "ro", "40"], ["Russia (Россия)", "ru", "7", 0], ["Rwanda", "rw", "250"], ["Saint Barthélemy (Saint-Barthélemy)", "bl", "590", 1], ["Saint Helena", "sh", "290"], ["Saint Kitts and Nevis", "kn", "1869"], ["Saint Lucia", "lc", "1758"], ["Saint Martin (Saint-Martin (partie française))", "mf", "590", 2], ["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508"], ["Saint Vincent and the Grenadines", "vc", "1784"], ["Samoa", "ws", "685"], ["San Marino", "sm", "378"], ["São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239"], ["Saudi Arabia (‫المملكة العربية السعودية‬‎)", "sa", "966"], ["Senegal (Sénégal)", "sn", "221"], ["Serbia (Србија)", "rs", "381"], ["Seychelles", "sc", "248"], ["Sierra Leone", "sl", "232"], ["Singapore", "sg", "65"], ["Sint Maarten", "sx", "1721"], ["Slovakia (Slovensko)", "sk", "421"], ["Slovenia (Slovenija)", "si", "386"], ["Solomon Islands", "sb", "677"], ["Somalia (Soomaaliya)", "so", "252"], ["South Africa", "za", "27"], ["South Korea (대한민국)", "kr", "82"], ["South Sudan (‫جنوب السودان‬‎)", "ss", "211"], ["Spain (España)", "es", "34"], ["Sri Lanka (ශ්‍රී ලංකාව)", "lk", "94"], ["Sudan (‫السودان‬‎)", "sd", "249"], ["Suriname", "sr", "597"], ["Swaziland", "sz", "268"], ["Sweden (Sverige)", "se", "46"], ["Switzerland (Schweiz)", "ch", "41"], ["Syria (‫سوريا‬‎)", "sy", "963"], ["Taiwan (台灣)", "tw", "886"], ["Tajikistan", "tj", "992"], ["Tanzania", "tz", "255"], ["Thailand (ไทย)", "th", "66"], ["Timor-Leste", "tl", "670"], ["Togo", "tg", "228"], ["Tokelau", "tk", "690"], ["Tonga", "to", "676"], ["Trinidad and Tobago", "tt", "1868"], ["Tunisia (‫تونس‬‎)", "tn", "216"], ["Turkey (Türkiye)", "tr", "90"], ["Turkmenistan", "tm", "993"], ["Turks and Caicos Islands", "tc", "1649"], ["Tuvalu", "tv", "688"], ["U.S. Virgin Islands", "vi", "1340"], ["Uganda", "ug", "256"], ["Ukraine (Україна)", "ua", "380"], ["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "ae", "971"], ["United Kingdom", "gb", "44"], ["United States", "us", "1", 0], ["Uruguay", "uy", "598"], ["Uzbekistan (Oʻzbekiston)", "uz", "998"], ["Vanuatu", "vu", "678"], ["Vatican City (Città del Vaticano)", "va", "39", 1], ["Venezuela", "ve", "58"], ["Vietnam (Việt Nam)", "vn", "84"], ["Wallis and Futuna", "wf", "681"], ["Yemen (‫اليمن‬‎)", "ye", "967"], ["Zambia", "zm", "260"], ["Zimbabwe", "zw", "263"]], S = 0; S < D.length; S++) { var L = D[S]; D[S] = { name: L[0], iso2: L[1], dialCode: L[2], priority: L[3] || 0, areaCodes: L[4] || null } } });;!function (e) { "function" == typeof define && define.amd ? define(["jquery"], e) : e("object" == typeof exports ? require("jquery") : jQuery) }(function (e) { var t = function () { if (e && e.fn && e.fn.select2 && e.fn.select2.amd) var t = e.fn.select2.amd; var n, i, r; return t && t.requirejs || (t ? i = t : t = {}, function (e) { function t(e, t) { return y.call(e, t) } function o(e, t) { var n, i, r, o, s, a, l, c, u, d, p, h = t && t.split("/"), f = m.map, g = f && f["*"] || {}; if (e && "." === e.charAt(0)) if (t) { for (s = (e = e.split("/")).length - 1, m.nodeIdCompat && $.test(e[s]) && (e[s] = e[s].replace($, "")), e = h.slice(0, h.length - 1).concat(e), u = 0; u < e.length; u += 1) if (p = e[u], "." === p) e.splice(u, 1), u -= 1; else if (".." === p) { if (1 === u && (".." === e[2] || ".." === e[0])) break; u > 0 && (e.splice(u - 1, 2), u -= 2) } e = e.join("/") } else 0 === e.indexOf("./") && (e = e.substring(2)); if ((h || g) && f) { for (u = (n = e.split("/")).length; u > 0; u -= 1) { if (i = n.slice(0, u).join("/"), h) for (d = h.length; d > 0; d -= 1) if (r = f[h.slice(0, d).join("/")], r && (r = r[i])) { o = r, a = u; break } if (o) break; !l && g && g[i] && (l = g[i], c = u) } !o && l && (o = l, a = c), o && (n.splice(0, a, o), e = n.join("/")) } return e } function s(t, n) { return function () { var i = _.call(arguments, 0); return "string" != typeof i[0] && 1 === i.length && i.push(null), d.apply(e, i.concat([t, n])) } } function a(e) { return function (t) { f[e] = t } } function l(n) { if (t(g, n)) { var i = g[n]; delete g[n], v[n] = !0, u.apply(e, i) } if (!t(f, n) && !t(v, n)) throw new Error("No " + n); return f[n] } function c(e) { var t, n = e ? e.indexOf("!") : -1; return n > -1 && (t = e.substring(0, n), e = e.substring(n + 1, e.length)), [t, e] } var u, d, p, h, f = {}, g = {}, m = {}, v = {}, y = Object.prototype.hasOwnProperty, _ = [].slice, $ = /\.js$/; p = function (e, t) { var n, i, r = c(e), s = r[0]; return e = r[1], s && (n = l(s = o(s, t))), s ? e = n && n.normalize ? n.normalize(e, (i = t, function (e) { return o(e, i) })) : o(e, t) : (s = (r = c(e = o(e, t)))[0], e = r[1], s && (n = l(s))), { f: s ? s + "!" + e : e, n: e, pr: s, p: n } }, h = { require: function (e) { return s(e) }, exports: function (e) { var t = f[e]; return void 0 !== t ? t : f[e] = {} }, module: function (e) { return { id: e, uri: "", exports: f[e], config: (t = e, function () { return m && m.config && m.config[t] || {} }) }; var t } }, u = function (n, i, r, o) { var c, u, d, m, y, _, $ = [], w = typeof r; if (o = o || n, "undefined" === w || "function" === w) { for (i = !i.length && r.length ? ["require", "exports", "module"] : i, y = 0; y < i.length; y += 1) if (m = p(i[y], o), u = m.f, "require" === u) $[y] = h.require(n); else if ("exports" === u) $[y] = h.exports(n), _ = !0; else if ("module" === u) c = $[y] = h.module(n); else if (t(f, u) || t(g, u) || t(v, u)) $[y] = l(u); else { if (!m.p) throw new Error(n + " missing " + u); m.p.load(m.n, s(o, !0), a(u), {}), $[y] = f[u] } d = r ? r.apply(f[n], $) : void 0, n && (c && c.exports !== e && c.exports !== f[n] ? f[n] = c.exports : d === e && _ || (f[n] = d)) } else n && (f[n] = r) }, n = i = d = function (t, n, i, r, o) { if ("string" == typeof t) return h[t] ? h[t](n) : l(p(t, n).f); if (!t.splice) { if ((m = t).deps && d(m.deps, m.callback), !n) return; n.splice ? (t = n, n = i, i = null) : t = e } return n = n || function () { }, "function" == typeof i && (i = r, r = o), r ? u(e, t, n, i) : setTimeout(function () { u(e, t, n, i) }, 4), d }, d.config = function (e) { return d(e) }, n._defined = f, (r = function (e, n, i) { if ("string" != typeof e) throw new Error("See almond README: incorrect module build, no module name"); n.splice || (i = n, n = []), t(f, e) || t(g, e) || (g[e] = [e, n, i]) }).amd = { jQuery: !0 } }(), t.requirejs = n, t.require = i, t.define = r), t.define("almond", function () { }), t.define("jquery", [], function () { var t = e || $; return null == t && console && console.error && console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."), t }), t.define("select2/utils", ["jquery"], function (e) { function t(e) { var t = e.prototype, n = []; for (var i in t) { "function" == typeof t[i] && "constructor" !== i && n.push(i) } return n } var n = { Extend: function (e, t) { function n() { this.constructor = e } var i = {}.hasOwnProperty; for (var r in t) i.call(t, r) && (e[r] = t[r]); return n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype, e }, Decorate: function (e, n) { function i() { var t = Array.prototype.unshift, i = n.prototype.constructor.length, r = e.prototype.constructor; i > 0 && (t.call(arguments, e.prototype.constructor), r = n.prototype.constructor), r.apply(this, arguments) } var r = t(n), o = t(e); n.displayName = e.displayName, i.prototype = new function () { this.constructor = i }; for (var s = 0; s < o.length; s++) { var a = o[s]; i.prototype[a] = e.prototype[a] } for (var l = function (e) { var t = function () { }; e in i.prototype && (t = i.prototype[e]); var r = n.prototype[e]; return function () { return Array.prototype.unshift.call(arguments, t), r.apply(this, arguments) } }, c = 0; c < r.length; c++) { var u = r[c]; i.prototype[u] = l(u) } return i } }, i = function () { this.listeners = {} }; return i.prototype.on = function (e, t) { this.listeners = this.listeners || {}, e in this.listeners ? this.listeners[e].push(t) : this.listeners[e] = [t] }, i.prototype.trigger = function (e) { var t = Array.prototype.slice, n = t.call(arguments, 1); this.listeners = this.listeners || {}, null == n && (n = []), 0 === n.length && n.push({}), n[0]._type = e, e in this.listeners && this.invoke(this.listeners[e], t.call(arguments, 1)), "*" in this.listeners && this.invoke(this.listeners["*"], arguments) }, i.prototype.invoke = function (e, t) { for (var n = 0, i = e.length; i > n; n++) e[n].apply(this, t) }, n.Observable = i, n.generateChars = function (e) { for (var t = "", n = 0; e > n; n++) { t += Math.floor(36 * Math.random()).toString(36) } return t }, n.bind = function (e, t) { return function () { e.apply(t, arguments) } }, n._convertData = function (e) { for (var t in e) { var n = t.split("-"), i = e; if (1 !== n.length) { for (var r = 0; r < n.length; r++) { var o = n[r]; (o = o.substring(0, 1).toLowerCase() + o.substring(1)) in i || (i[o] = {}), r == n.length - 1 && (i[o] = e[t]), i = i[o] } delete e[t] } } return e }, n.hasScroll = function (t, n) { var i = e(n), r = n.style.overflowX, o = n.style.overflowY; return (r !== o || "hidden" !== o && "visible" !== o) && ("scroll" === r || "scroll" === o || (i.innerHeight() < n.scrollHeight || i.innerWidth() < n.scrollWidth)) }, n.escapeMarkup = function (e) { var t = { "\\": "&#92;", "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "/": "&#47;" }; return "string" != typeof e ? e : String(e).replace(/[&<>"'\/\\]/g, function (e) { return t[e] }) }, n.appendMany = function (t, n) { if ("1.7" === e.fn.jquery.substr(0, 3)) { var i = e(); e.map(n, function (e) { i = i.add(e) }), n = i } t.append(n) }, n }), t.define("select2/results", ["jquery", "./utils"], function (e, t) { function n(e, t, i) { this.$element = e, this.data = i, this.options = t, n.__super__.constructor.call(this) } return t.Extend(n, t.Observable), n.prototype.render = function () { var t = e('<ul class="select2-results__options" role="tree"></ul>'); return this.options.get("multiple") && t.attr("aria-multiselectable", "true"), this.$results = t, t }, n.prototype.clear = function () { this.$results.empty() }, n.prototype.displayMessage = function (t) { var n = this.options.get("escapeMarkup"); this.clear(), this.hideLoading(); var i = e('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'), r = this.options.get("translations").get(t.message); i.append(n(r(t.args))), i[0].className += " select2-results__message", this.$results.append(i) }, n.prototype.hideMessages = function () { this.$results.find(".select2-results__message").remove() }, n.prototype.append = function (e) { this.hideLoading(); var t = []; if (null != e.results && 0 !== e.results.length) { e.results = this.sort(e.results); for (var n = 0; n < e.results.length; n++) { var i = e.results[n], r = this.option(i); t.push(r) } this.$results.append(t) } else 0 === this.$results.children().length && this.trigger("results:message", { message: "noResults" }) }, n.prototype.position = function (e, t) { t.find(".select2-results").append(e) }, n.prototype.sort = function (e) { return this.options.get("sorter")(e) }, n.prototype.highlightFirstItem = function () { var e = this.$results.find(".select2-results__option[aria-selected]"), t = e.filter("[aria-selected=true]"); t.length > 0 ? t.first().trigger("mouseenter") : e.first().trigger("mouseenter"), this.ensureHighlightVisible() }, n.prototype.setClasses = function () { var t = this; this.data.current(function (n) { var i = e.map(n, function (e) { return e.id.toString() }); t.$results.find(".select2-results__option[aria-selected]").each(function () { var t = e(this), n = e.data(this, "data"), r = "" + n.id; null != n.element && n.element.selected || null == n.element && e.inArray(r, i) > -1 ? t.attr("aria-selected", "true") : t.attr("aria-selected", "false") }) }) }, n.prototype.showLoading = function (e) { this.hideLoading(); var t = { disabled: !0, loading: !0, text: this.options.get("translations").get("searching")(e) }, n = this.option(t); n.className += " loading-results", this.$results.prepend(n) }, n.prototype.hideLoading = function () { this.$results.find(".loading-results").remove() }, n.prototype.option = function (t) { var n = document.createElement("li"); n.className = "select2-results__option"; var i = { role: "treeitem", "aria-selected": "false" }; t.disabled && (delete i["aria-selected"], i["aria-disabled"] = "true"), null == t.id && delete i["aria-selected"], null != t._resultId && (n.id = t._resultId), t.title && (n.title = t.title), t.children && (i.role = "group", i["aria-label"] = t.text, delete i["aria-selected"]); for (var r in i) { var o = i[r]; n.setAttribute(r, o) } if (t.children) { var s = e(n), a = document.createElement("strong"); a.className = "select2-results__group", e(a), this.template(t, a); for (var l = [], c = 0; c < t.children.length; c++) { var u = t.children[c], d = this.option(u); l.push(d) } var p = e("<ul></ul>", { class: "select2-results__options select2-results__options--nested" }); p.append(l), s.append(a), s.append(p) } else this.template(t, n); return e.data(n, "data", t), n }, n.prototype.bind = function (t, n) { var i = this, r = t.id + "-results"; this.$results.attr("id", r), t.on("results:all", function (e) { i.clear(), i.append(e.data), t.isOpen() && (i.setClasses(), i.highlightFirstItem()) }), t.on("results:append", function (e) { i.append(e.data), t.isOpen() && i.setClasses() }), t.on("query", function (e) { i.hideMessages(), i.showLoading(e) }), t.on("select", function () { t.isOpen() && (i.setClasses(), i.highlightFirstItem()) }), t.on("unselect", function () { t.isOpen() && (i.setClasses(), i.highlightFirstItem()) }), t.on("open", function () { i.$results.attr("aria-expanded", "true"), i.$results.attr("aria-hidden", "false"), i.setClasses(), i.ensureHighlightVisible() }), t.on("close", function () { i.$results.attr("aria-expanded", "false"), i.$results.attr("aria-hidden", "true"), i.$results.removeAttr("aria-activedescendant") }), t.on("results:toggle", function () { var e = i.getHighlightedResults(); 0 !== e.length && e.trigger("mouseup") }), t.on("results:select", function () { var e = i.getHighlightedResults(); if (0 !== e.length) { var t = e.data("data"); "true" == e.attr("aria-selected") ? i.trigger("close", {}) : i.trigger("select", { data: t }) } }), t.on("results:previous", function () { var e = i.getHighlightedResults(), t = i.$results.find("[aria-selected]"), n = t.index(e); if (0 !== n) { var r = n - 1; 0 === e.length && (r = 0); var o = t.eq(r); o.trigger("mouseenter"); var s = i.$results.offset().top, a = o.offset().top, l = i.$results.scrollTop() + (a - s); 0 === r ? i.$results.scrollTop(0) : 0 > a - s && i.$results.scrollTop(l) } }), t.on("results:next", function () { var e = i.getHighlightedResults(), t = i.$results.find("[aria-selected]"), n = t.index(e) + 1; if (!(n >= t.length)) { var r = t.eq(n); r.trigger("mouseenter"); var o = i.$results.offset().top + i.$results.outerHeight(!1), s = r.offset().top + r.outerHeight(!1), a = i.$results.scrollTop() + s - o; 0 === n ? i.$results.scrollTop(0) : s > o && i.$results.scrollTop(a) } }), t.on("results:focus", function (e) { e.element.addClass("select2-results__option--highlighted") }), t.on("results:message", function (e) { i.displayMessage(e) }), e.fn.mousewheel && this.$results.on("mousewheel", function (e) { var t = i.$results.scrollTop(), n = i.$results.get(0).scrollHeight - t + e.deltaY, r = e.deltaY > 0 && t - e.deltaY <= 0, o = e.deltaY < 0 && n <= i.$results.height(); r ? (i.$results.scrollTop(0), e.preventDefault(), e.stopPropagation()) : o && (i.$results.scrollTop(i.$results.get(0).scrollHeight - i.$results.height()), e.preventDefault(), e.stopPropagation()) }), this.$results.on("mouseup", ".select2-results__option[aria-selected]", function (t) { var n = e(this), r = n.data("data"); return "true" === n.attr("aria-selected") ? void (i.options.get("multiple") ? i.trigger("unselect", { originalEvent: t, data: r }) : i.trigger("close", {})) : void i.trigger("select", { originalEvent: t, data: r }) }), this.$results.on("mouseenter", ".select2-results__option[aria-selected]", function (t) { var n = e(this).data("data"); i.getHighlightedResults().removeClass("select2-results__option--highlighted"), i.trigger("results:focus", { data: n, element: e(this) }) }) }, n.prototype.getHighlightedResults = function () { return this.$results.find(".select2-results__option--highlighted") }, n.prototype.destroy = function () { this.$results.remove() }, n.prototype.ensureHighlightVisible = function () { var e = this.getHighlightedResults(); if (0 !== e.length) { var t = this.$results.find("[aria-selected]").index(e), n = this.$results.offset().top, i = e.offset().top, r = this.$results.scrollTop() + (i - n), o = i - n; r -= 2 * e.outerHeight(!1), 2 >= t ? this.$results.scrollTop(0) : (o > this.$results.outerHeight() || 0 > o) && this.$results.scrollTop(r) } }, n.prototype.template = function (t, n) { var i = this.options.get("templateResult"), r = this.options.get("escapeMarkup"), o = i(t, n); null == o ? n.style.display = "none" : "string" == typeof o ? n.innerHTML = r(o) : e(n).append(o) }, n }), t.define("select2/keys", [], function () { return { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 } }), t.define("select2/selection/base", ["jquery", "../utils", "../keys"], function (e, t, n) { function i(e, t) { this.$element = e, this.options = t, i.__super__.constructor.call(this) } return t.Extend(i, t.Observable), i.prototype.render = function () { var t = e('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>'); return this._tabindex = 0, null != this.$element.data("old-tabindex") ? this._tabindex = this.$element.data("old-tabindex") : null != this.$element.attr("tabindex") && (this._tabindex = this.$element.attr("tabindex")), t.attr("title", this.$element.attr("title")), t.attr("tabindex", this._tabindex), this.$selection = t, t }, i.prototype.bind = function (e, t) { var i = this, r = (e.id, e.id + "-results"); this.container = e, this.$selection.on("focus", function (e) { i.trigger("focus", e) }), this.$selection.on("blur", function (e) { i._handleBlur(e) }), this.$selection.on("keydown", function (e) { i.trigger("keypress", e), e.which === n.SPACE && e.preventDefault() }), e.on("results:focus", function (e) { i.$selection.attr("aria-activedescendant", e.data._resultId) }), e.on("selection:update", function (e) { i.update(e.data) }), e.on("open", function () { i.$selection.attr("aria-expanded", "true"), i.$selection.attr("aria-owns", r), i._attachCloseHandler(e) }), e.on("close", function () { i.$selection.attr("aria-expanded", "false"), i.$selection.removeAttr("aria-activedescendant"), i.$selection.removeAttr("aria-owns"), i.$selection.focus(), i._detachCloseHandler(e) }), e.on("enable", function () { i.$selection.attr("tabindex", i._tabindex) }), e.on("disable", function () { i.$selection.attr("tabindex", "-1") }) }, i.prototype._handleBlur = function (t) { var n = this; window.setTimeout(function () { document.activeElement == n.$selection[0] || e.contains(n.$selection[0], document.activeElement) || n.trigger("blur", t) }, 1) }, i.prototype._attachCloseHandler = function (t) { e(document.body).on("mousedown.select2." + t.id, function (t) { var n = e(t.target).closest(".select2"); e(".select2.select2-container--open").each(function () { var t = e(this); this != n[0] && t.data("element").select2("close") }) }) }, i.prototype._detachCloseHandler = function (t) { e(document.body).off("mousedown.select2." + t.id) }, i.prototype.position = function (e, t) { t.find(".selection").append(e) }, i.prototype.destroy = function () { this._detachCloseHandler(this.container) }, i.prototype.update = function (e) { throw new Error("The `update` method must be defined in child classes.") }, i }), t.define("select2/selection/single", ["jquery", "./base", "../utils", "../keys"], function (e, t, n, i) { function r() { r.__super__.constructor.apply(this, arguments) } return n.Extend(r, t), r.prototype.render = function () { var e = r.__super__.render.call(this); return e.addClass("select2-selection--single"), e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'), e }, r.prototype.bind = function (e, t) { var n = this; r.__super__.bind.apply(this, arguments); var i = e.id + "-container"; this.$selection.find(".select2-selection__rendered").attr("id", i), this.$selection.attr("aria-labelledby", i), this.$selection.on("mousedown", function (e) { 1 === e.which && n.trigger("toggle", { originalEvent: e }) }), this.$selection.on("focus", function (e) { }), this.$selection.on("blur", function (e) { }), e.on("focus", function (t) { e.isOpen() || n.$selection.focus() }), e.on("selection:update", function (e) { n.update(e.data) }) }, r.prototype.clear = function () { this.$selection.find(".select2-selection__rendered").empty() }, r.prototype.display = function (e, t) { var n = this.options.get("templateSelection"); return this.options.get("escapeMarkup")(n(e, t)) }, r.prototype.selectionContainer = function () { return e("<span></span>") }, r.prototype.update = function (e) { if (0 !== e.length) { var t = e[0], n = this.$selection.find(".select2-selection__rendered"), i = this.display(t, n); n.empty().append(i), n.prop("title", t.title || t.text) } else this.clear() }, r }), t.define("select2/selection/multiple", ["jquery", "./base", "../utils"], function (e, t, n) { function i(e, t) { i.__super__.constructor.apply(this, arguments) } return n.Extend(i, t), i.prototype.render = function () { var e = i.__super__.render.call(this); return e.addClass("select2-selection--multiple"), e.html('<ul class="select2-selection__rendered"></ul>'), e }, i.prototype.bind = function (t, n) { var r = this; i.__super__.bind.apply(this, arguments), this.$selection.on("click", function (e) { r.trigger("toggle", { originalEvent: e }) }), this.$selection.on("click", ".select2-selection__choice__remove", function (t) { if (!r.options.get("disabled")) { var n = e(this).parent().data("data"); r.trigger("unselect", { originalEvent: t, data: n }) } }) }, i.prototype.clear = function () { this.$selection.find(".select2-selection__rendered").empty() }, i.prototype.display = function (e, t) { var n = this.options.get("templateSelection"); return this.options.get("escapeMarkup")(n(e, t)) }, i.prototype.selectionContainer = function () { return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>') }, i.prototype.update = function (e) { if (this.clear(), 0 !== e.length) { for (var t = [], i = 0; i < e.length; i++) { var r = e[i], o = this.selectionContainer(), s = this.display(r, o); o.append(s), o.prop("title", r.title || r.text), o.data("data", r), t.push(o) } var a = this.$selection.find(".select2-selection__rendered"); n.appendMany(a, t) } }, i }), t.define("select2/selection/placeholder", ["../utils"], function (e) { function t(e, t, n) { this.placeholder = this.normalizePlaceholder(n.get("placeholder")), e.call(this, t, n) } return t.prototype.normalizePlaceholder = function (e, t) { return "string" == typeof t && (t = { id: "", text: t }), t }, t.prototype.createPlaceholder = function (e, t) { var n = this.selectionContainer(); return n.html(this.display(t)), n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"), n }, t.prototype.update = function (e, t) { var n = 1 == t.length && t[0].id != this.placeholder.id; if (t.length > 1 || n) return e.call(this, t); this.clear(); var i = this.createPlaceholder(this.placeholder); this.$selection.find(".select2-selection__rendered").append(i) }, t }), t.define("select2/selection/allowClear", ["jquery", "../keys"], function (e, t) { function n() { } return n.prototype.bind = function (e, t, n) { var i = this; e.call(this, t, n), null == this.placeholder && this.options.get("debug") && window.console && console.error && console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."), this.$selection.on("mousedown", ".select2-selection__clear", function (e) { i._handleClear(e) }), t.on("keypress", function (e) { i._handleKeyboardClear(e, t) }) }, n.prototype._handleClear = function (e, t) { if (!this.options.get("disabled")) { var n = this.$selection.find(".select2-selection__clear"); if (0 !== n.length) { t.stopPropagation(); for (var i = n.data("data"), r = 0; r < i.length; r++) { var o = { data: i[r] }; if (this.trigger("unselect", o), o.prevented) return } this.$element.val(this.placeholder.id).trigger("change"), this.trigger("toggle", {}) } } }, n.prototype._handleKeyboardClear = function (e, n, i) { i.isOpen() || (n.which == t.DELETE || n.which == t.BACKSPACE) && this._handleClear(n) }, n.prototype.update = function (t, n) { if (t.call(this, n), !(this.$selection.find(".select2-selection__placeholder").length > 0 || 0 === n.length)) { var i = e('<span class="select2-selection__clear">&times;</span>'); i.data("data", n), this.$selection.find(".select2-selection__rendered").prepend(i) } }, n }), t.define("select2/selection/search", ["jquery", "../utils", "../keys"], function (e, t, n) { function i(e, t, n) { e.call(this, t, n) } return i.prototype.render = function (t) { var n = e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>'); this.$searchContainer = n, this.$search = n.find("input"); var i = t.call(this); return this._transferTabIndex(), i }, i.prototype.bind = function (e, t, i) { var r = this; e.call(this, t, i), t.on("open", function () { r.$search.trigger("focus") }), t.on("close", function () { r.$search.val(""), r.$search.removeAttr("aria-activedescendant"), r.$search.trigger("focus") }), t.on("enable", function () { r.$search.prop("disabled", !1), r._transferTabIndex() }), t.on("disable", function () { r.$search.prop("disabled", !0) }), t.on("focus", function (e) { r.$search.trigger("focus") }), t.on("results:focus", function (e) { r.$search.attr("aria-activedescendant", e.id) }), this.$selection.on("focusin", ".select2-search--inline", function (e) { r.trigger("focus", e) }), this.$selection.on("focusout", ".select2-search--inline", function (e) { r._handleBlur(e) }), this.$selection.on("keydown", ".select2-search--inline", function (e) { if (e.stopPropagation(), r.trigger("keypress", e), r._keyUpPrevented = e.isDefaultPrevented(), e.which === n.BACKSPACE && "" === r.$search.val()) { var t = r.$searchContainer.prev(".select2-selection__choice"); if (t.length > 0) { var i = t.data("data"); r.searchRemoveChoice(i), e.preventDefault() } } }); var o = document.documentMode, s = o && 11 >= o; this.$selection.on("input.searchcheck", ".select2-search--inline", function (e) { return s ? void r.$selection.off("input.search input.searchcheck") : void r.$selection.off("keyup.search") }), this.$selection.on("keyup.search input.search", ".select2-search--inline", function (e) { if (s && "input" === e.type) r.$selection.off("input.search input.searchcheck"); else { var t = e.which; t != n.SHIFT && t != n.CTRL && t != n.ALT && t != n.TAB && r.handleSearch(e) } }) }, i.prototype._transferTabIndex = function (e) { this.$search.attr("tabindex", this.$selection.attr("tabindex")), this.$selection.attr("tabindex", "-1") }, i.prototype.createPlaceholder = function (e, t) { this.$search.attr("placeholder", t.text) }, i.prototype.update = function (e, t) { var n = this.$search[0] == document.activeElement; this.$search.attr("placeholder", ""), e.call(this, t), this.$selection.find(".select2-selection__rendered").append(this.$searchContainer), this.resizeSearch(), n && this.$search.focus() }, i.prototype.handleSearch = function () { if (this.resizeSearch(), !this._keyUpPrevented) { var e = this.$search.val(); this.trigger("query", { term: e }) } this._keyUpPrevented = !1 }, i.prototype.searchRemoveChoice = function (e, t) { this.trigger("unselect", { data: t }), this.$search.val(t.text), this.handleSearch() }, i.prototype.resizeSearch = function () { this.$search.css("width", "25px"); var e = ""; "" !== this.$search.attr("placeholder") ? e = this.$selection.find(".select2-selection__rendered").innerWidth() : e = .75 * (this.$search.val().length + 1) + "em"; this.$search.css("width", e) }, i }), t.define("select2/selection/eventRelay", ["jquery"], function (e) { function t() { } return t.prototype.bind = function (t, n, i) { var r = this, o = ["open", "opening", "close", "closing", "select", "selecting", "unselect", "unselecting"], s = ["opening", "closing", "selecting", "unselecting"]; t.call(this, n, i), n.on("*", function (t, n) { if (-1 !== e.inArray(t, o)) { n = n || {}; var i = e.Event("select2:" + t, { params: n }); r.$element.trigger(i), -1 !== e.inArray(t, s) && (n.prevented = i.isDefaultPrevented()) } }) }, t }), t.define("select2/translation", ["jquery", "require"], function (e, t) { function n(e) { this.dict = e || {} } return n.prototype.all = function () { return this.dict }, n.prototype.get = function (e) { return this.dict[e] }, n.prototype.extend = function (t) { this.dict = e.extend({}, t.all(), this.dict) }, n._cache = {}, n.loadPath = function (e) { if (!(e in n._cache)) { var i = t(e); n._cache[e] = i } return new n(n._cache[e]) }, n }), t.define("select2/diacritics", [], function () { return { "Ⓐ": "A", "Ａ": "A", "À": "A", "Á": "A", "Â": "A", "Ầ": "A", "Ấ": "A", "Ẫ": "A", "Ẩ": "A", "Ã": "A", "Ā": "A", "Ă": "A", "Ằ": "A", "Ắ": "A", "Ẵ": "A", "Ẳ": "A", "Ȧ": "A", "Ǡ": "A", "Ä": "A", "Ǟ": "A", "Ả": "A", "Å": "A", "Ǻ": "A", "Ǎ": "A", "Ȁ": "A", "Ȃ": "A", "Ạ": "A", "Ậ": "A", "Ặ": "A", "Ḁ": "A", "Ą": "A", "Ⱥ": "A", "Ɐ": "A", "Ꜳ": "AA", "Æ": "AE", "Ǽ": "AE", "Ǣ": "AE", "Ꜵ": "AO", "Ꜷ": "AU", "Ꜹ": "AV", "Ꜻ": "AV", "Ꜽ": "AY", "Ⓑ": "B", "Ｂ": "B", "Ḃ": "B", "Ḅ": "B", "Ḇ": "B", "Ƀ": "B", "Ƃ": "B", "Ɓ": "B", "Ⓒ": "C", "Ｃ": "C", "Ć": "C", "Ĉ": "C", "Ċ": "C", "Č": "C", "Ç": "C", "Ḉ": "C", "Ƈ": "C", "Ȼ": "C", "Ꜿ": "C", "Ⓓ": "D", "Ｄ": "D", "Ḋ": "D", "Ď": "D", "Ḍ": "D", "Ḑ": "D", "Ḓ": "D", "Ḏ": "D", "Đ": "D", "Ƌ": "D", "Ɗ": "D", "Ɖ": "D", "Ꝺ": "D", "Ǳ": "DZ", "Ǆ": "DZ", "ǲ": "Dz", "ǅ": "Dz", "Ⓔ": "E", "Ｅ": "E", "È": "E", "É": "E", "Ê": "E", "Ề": "E", "Ế": "E", "Ễ": "E", "Ể": "E", "Ẽ": "E", "Ē": "E", "Ḕ": "E", "Ḗ": "E", "Ĕ": "E", "Ė": "E", "Ë": "E", "Ẻ": "E", "Ě": "E", "Ȅ": "E", "Ȇ": "E", "Ẹ": "E", "Ệ": "E", "Ȩ": "E", "Ḝ": "E", "Ę": "E", "Ḙ": "E", "Ḛ": "E", "Ɛ": "E", "Ǝ": "E", "Ⓕ": "F", "Ｆ": "F", "Ḟ": "F", "Ƒ": "F", "Ꝼ": "F", "Ⓖ": "G", "Ｇ": "G", "Ǵ": "G", "Ĝ": "G", "Ḡ": "G", "Ğ": "G", "Ġ": "G", "Ǧ": "G", "Ģ": "G", "Ǥ": "G", "Ɠ": "G", "Ꞡ": "G", "Ᵹ": "G", "Ꝿ": "G", "Ⓗ": "H", "Ｈ": "H", "Ĥ": "H", "Ḣ": "H", "Ḧ": "H", "Ȟ": "H", "Ḥ": "H", "Ḩ": "H", "Ḫ": "H", "Ħ": "H", "Ⱨ": "H", "Ⱶ": "H", "Ɥ": "H", "Ⓘ": "I", "Ｉ": "I", "Ì": "I", "Í": "I", "Î": "I", "Ĩ": "I", "Ī": "I", "Ĭ": "I", "İ": "I", "Ï": "I", "Ḯ": "I", "Ỉ": "I", "Ǐ": "I", "Ȉ": "I", "Ȋ": "I", "Ị": "I", "Į": "I", "Ḭ": "I", "Ɨ": "I", "Ⓙ": "J", "Ｊ": "J", "Ĵ": "J", "Ɉ": "J", "Ⓚ": "K", "Ｋ": "K", "Ḱ": "K", "Ǩ": "K", "Ḳ": "K", "Ķ": "K", "Ḵ": "K", "Ƙ": "K", "Ⱪ": "K", "Ꝁ": "K", "Ꝃ": "K", "Ꝅ": "K", "Ꞣ": "K", "Ⓛ": "L", "Ｌ": "L", "Ŀ": "L", "Ĺ": "L", "Ľ": "L", "Ḷ": "L", "Ḹ": "L", "Ļ": "L", "Ḽ": "L", "Ḻ": "L", "Ł": "L", "Ƚ": "L", "Ɫ": "L", "Ⱡ": "L", "Ꝉ": "L", "Ꝇ": "L", "Ꞁ": "L", "Ǉ": "LJ", "ǈ": "Lj", "Ⓜ": "M", "Ｍ": "M", "Ḿ": "M", "Ṁ": "M", "Ṃ": "M", "Ɱ": "M", "Ɯ": "M", "Ⓝ": "N", "Ｎ": "N", "Ǹ": "N", "Ń": "N", "Ñ": "N", "Ṅ": "N", "Ň": "N", "Ṇ": "N", "Ņ": "N", "Ṋ": "N", "Ṉ": "N", "Ƞ": "N", "Ɲ": "N", "Ꞑ": "N", "Ꞥ": "N", "Ǌ": "NJ", "ǋ": "Nj", "Ⓞ": "O", "Ｏ": "O", "Ò": "O", "Ó": "O", "Ô": "O", "Ồ": "O", "Ố": "O", "Ỗ": "O", "Ổ": "O", "Õ": "O", "Ṍ": "O", "Ȭ": "O", "Ṏ": "O", "Ō": "O", "Ṑ": "O", "Ṓ": "O", "Ŏ": "O", "Ȯ": "O", "Ȱ": "O", "Ö": "O", "Ȫ": "O", "Ỏ": "O", "Ő": "O", "Ǒ": "O", "Ȍ": "O", "Ȏ": "O", "Ơ": "O", "Ờ": "O", "Ớ": "O", "Ỡ": "O", "Ở": "O", "Ợ": "O", "Ọ": "O", "Ộ": "O", "Ǫ": "O", "Ǭ": "O", "Ø": "O", "Ǿ": "O", "Ɔ": "O", "Ɵ": "O", "Ꝋ": "O", "Ꝍ": "O", "Ƣ": "OI", "Ꝏ": "OO", "Ȣ": "OU", "Ⓟ": "P", "Ｐ": "P", "Ṕ": "P", "Ṗ": "P", "Ƥ": "P", "Ᵽ": "P", "Ꝑ": "P", "Ꝓ": "P", "Ꝕ": "P", "Ⓠ": "Q", "Ｑ": "Q", "Ꝗ": "Q", "Ꝙ": "Q", "Ɋ": "Q", "Ⓡ": "R", "Ｒ": "R", "Ŕ": "R", "Ṙ": "R", "Ř": "R", "Ȑ": "R", "Ȓ": "R", "Ṛ": "R", "Ṝ": "R", "Ŗ": "R", "Ṟ": "R", "Ɍ": "R", "Ɽ": "R", "Ꝛ": "R", "Ꞧ": "R", "Ꞃ": "R", "Ⓢ": "S", "Ｓ": "S", "ẞ": "S", "Ś": "S", "Ṥ": "S", "Ŝ": "S", "Ṡ": "S", "Š": "S", "Ṧ": "S", "Ṣ": "S", "Ṩ": "S", "Ș": "S", "Ş": "S", "Ȿ": "S", "Ꞩ": "S", "Ꞅ": "S", "Ⓣ": "T", "Ｔ": "T", "Ṫ": "T", "Ť": "T", "Ṭ": "T", "Ț": "T", "Ţ": "T", "Ṱ": "T", "Ṯ": "T", "Ŧ": "T", "Ƭ": "T", "Ʈ": "T", "Ⱦ": "T", "Ꞇ": "T", "Ꜩ": "TZ", "Ⓤ": "U", "Ｕ": "U", "Ù": "U", "Ú": "U", "Û": "U", "Ũ": "U", "Ṹ": "U", "Ū": "U", "Ṻ": "U", "Ŭ": "U", "Ü": "U", "Ǜ": "U", "Ǘ": "U", "Ǖ": "U", "Ǚ": "U", "Ủ": "U", "Ů": "U", "Ű": "U", "Ǔ": "U", "Ȕ": "U", "Ȗ": "U", "Ư": "U", "Ừ": "U", "Ứ": "U", "Ữ": "U", "Ử": "U", "Ự": "U", "Ụ": "U", "Ṳ": "U", "Ų": "U", "Ṷ": "U", "Ṵ": "U", "Ʉ": "U", "Ⓥ": "V", "Ｖ": "V", "Ṽ": "V", "Ṿ": "V", "Ʋ": "V", "Ꝟ": "V", "Ʌ": "V", "Ꝡ": "VY", "Ⓦ": "W", "Ｗ": "W", "Ẁ": "W", "Ẃ": "W", "Ŵ": "W", "Ẇ": "W", "Ẅ": "W", "Ẉ": "W", "Ⱳ": "W", "Ⓧ": "X", "Ｘ": "X", "Ẋ": "X", "Ẍ": "X", "Ⓨ": "Y", "Ｙ": "Y", "Ỳ": "Y", "Ý": "Y", "Ŷ": "Y", "Ỹ": "Y", "Ȳ": "Y", "Ẏ": "Y", "Ÿ": "Y", "Ỷ": "Y", "Ỵ": "Y", "Ƴ": "Y", "Ɏ": "Y", "Ỿ": "Y", "Ⓩ": "Z", "Ｚ": "Z", "Ź": "Z", "Ẑ": "Z", "Ż": "Z", "Ž": "Z", "Ẓ": "Z", "Ẕ": "Z", "Ƶ": "Z", "Ȥ": "Z", "Ɀ": "Z", "Ⱬ": "Z", "Ꝣ": "Z", "ⓐ": "a", "ａ": "a", "ẚ": "a", "à": "a", "á": "a", "â": "a", "ầ": "a", "ấ": "a", "ẫ": "a", "ẩ": "a", "ã": "a", "ā": "a", "ă": "a", "ằ": "a", "ắ": "a", "ẵ": "a", "ẳ": "a", "ȧ": "a", "ǡ": "a", "ä": "a", "ǟ": "a", "ả": "a", "å": "a", "ǻ": "a", "ǎ": "a", "ȁ": "a", "ȃ": "a", "ạ": "a", "ậ": "a", "ặ": "a", "ḁ": "a", "ą": "a", "ⱥ": "a", "ɐ": "a", "ꜳ": "aa", "æ": "ae", "ǽ": "ae", "ǣ": "ae", "ꜵ": "ao", "ꜷ": "au", "ꜹ": "av", "ꜻ": "av", "ꜽ": "ay", "ⓑ": "b", "ｂ": "b", "ḃ": "b", "ḅ": "b", "ḇ": "b", "ƀ": "b", "ƃ": "b", "ɓ": "b", "ⓒ": "c", "ｃ": "c", "ć": "c", "ĉ": "c", "ċ": "c", "č": "c", "ç": "c", "ḉ": "c", "ƈ": "c", "ȼ": "c", "ꜿ": "c", "ↄ": "c", "ⓓ": "d", "ｄ": "d", "ḋ": "d", "ď": "d", "ḍ": "d", "ḑ": "d", "ḓ": "d", "ḏ": "d", "đ": "d", "ƌ": "d", "ɖ": "d", "ɗ": "d", "ꝺ": "d", "ǳ": "dz", "ǆ": "dz", "ⓔ": "e", "ｅ": "e", "è": "e", "é": "e", "ê": "e", "ề": "e", "ế": "e", "ễ": "e", "ể": "e", "ẽ": "e", "ē": "e", "ḕ": "e", "ḗ": "e", "ĕ": "e", "ė": "e", "ë": "e", "ẻ": "e", "ě": "e", "ȅ": "e", "ȇ": "e", "ẹ": "e", "ệ": "e", "ȩ": "e", "ḝ": "e", "ę": "e", "ḙ": "e", "ḛ": "e", "ɇ": "e", "ɛ": "e", "ǝ": "e", "ⓕ": "f", "ｆ": "f", "ḟ": "f", "ƒ": "f", "ꝼ": "f", "ⓖ": "g", "ｇ": "g", "ǵ": "g", "ĝ": "g", "ḡ": "g", "ğ": "g", "ġ": "g", "ǧ": "g", "ģ": "g", "ǥ": "g", "ɠ": "g", "ꞡ": "g", "ᵹ": "g", "ꝿ": "g", "ⓗ": "h", "ｈ": "h", "ĥ": "h", "ḣ": "h", "ḧ": "h", "ȟ": "h", "ḥ": "h", "ḩ": "h", "ḫ": "h", "ẖ": "h", "ħ": "h", "ⱨ": "h", "ⱶ": "h", "ɥ": "h", "ƕ": "hv", "ⓘ": "i", "ｉ": "i", "ì": "i", "í": "i", "î": "i", "ĩ": "i", "ī": "i", "ĭ": "i", "ï": "i", "ḯ": "i", "ỉ": "i", "ǐ": "i", "ȉ": "i", "ȋ": "i", "ị": "i", "į": "i", "ḭ": "i", "ɨ": "i", "ı": "i", "ⓙ": "j", "ｊ": "j", "ĵ": "j", "ǰ": "j", "ɉ": "j", "ⓚ": "k", "ｋ": "k", "ḱ": "k", "ǩ": "k", "ḳ": "k", "ķ": "k", "ḵ": "k", "ƙ": "k", "ⱪ": "k", "ꝁ": "k", "ꝃ": "k", "ꝅ": "k", "ꞣ": "k", "ⓛ": "l", "ｌ": "l", "ŀ": "l", "ĺ": "l", "ľ": "l", "ḷ": "l", "ḹ": "l", "ļ": "l", "ḽ": "l", "ḻ": "l", "ſ": "l", "ł": "l", "ƚ": "l", "ɫ": "l", "ⱡ": "l", "ꝉ": "l", "ꞁ": "l", "ꝇ": "l", "ǉ": "lj", "ⓜ": "m", "ｍ": "m", "ḿ": "m", "ṁ": "m", "ṃ": "m", "ɱ": "m", "ɯ": "m", "ⓝ": "n", "ｎ": "n", "ǹ": "n", "ń": "n", "ñ": "n", "ṅ": "n", "ň": "n", "ṇ": "n", "ņ": "n", "ṋ": "n", "ṉ": "n", "ƞ": "n", "ɲ": "n", "ŉ": "n", "ꞑ": "n", "ꞥ": "n", "ǌ": "nj", "ⓞ": "o", "ｏ": "o", "ò": "o", "ó": "o", "ô": "o", "ồ": "o", "ố": "o", "ỗ": "o", "ổ": "o", "õ": "o", "ṍ": "o", "ȭ": "o", "ṏ": "o", "ō": "o", "ṑ": "o", "ṓ": "o", "ŏ": "o", "ȯ": "o", "ȱ": "o", "ö": "o", "ȫ": "o", "ỏ": "o", "ő": "o", "ǒ": "o", "ȍ": "o", "ȏ": "o", "ơ": "o", "ờ": "o", "ớ": "o", "ỡ": "o", "ở": "o", "ợ": "o", "ọ": "o", "ộ": "o", "ǫ": "o", "ǭ": "o", "ø": "o", "ǿ": "o", "ɔ": "o", "ꝋ": "o", "ꝍ": "o", "ɵ": "o", "ƣ": "oi", "ȣ": "ou", "ꝏ": "oo", "ⓟ": "p", "ｐ": "p", "ṕ": "p", "ṗ": "p", "ƥ": "p", "ᵽ": "p", "ꝑ": "p", "ꝓ": "p", "ꝕ": "p", "ⓠ": "q", "ｑ": "q", "ɋ": "q", "ꝗ": "q", "ꝙ": "q", "ⓡ": "r", "ｒ": "r", "ŕ": "r", "ṙ": "r", "ř": "r", "ȑ": "r", "ȓ": "r", "ṛ": "r", "ṝ": "r", "ŗ": "r", "ṟ": "r", "ɍ": "r", "ɽ": "r", "ꝛ": "r", "ꞧ": "r", "ꞃ": "r", "ⓢ": "s", "ｓ": "s", "ß": "s", "ś": "s", "ṥ": "s", "ŝ": "s", "ṡ": "s", "š": "s", "ṧ": "s", "ṣ": "s", "ṩ": "s", "ș": "s", "ş": "s", "ȿ": "s", "ꞩ": "s", "ꞅ": "s", "ẛ": "s", "ⓣ": "t", "ｔ": "t", "ṫ": "t", "ẗ": "t", "ť": "t", "ṭ": "t", "ț": "t", "ţ": "t", "ṱ": "t", "ṯ": "t", "ŧ": "t", "ƭ": "t", "ʈ": "t", "ⱦ": "t", "ꞇ": "t", "ꜩ": "tz", "ⓤ": "u", "ｕ": "u", "ù": "u", "ú": "u", "û": "u", "ũ": "u", "ṹ": "u", "ū": "u", "ṻ": "u", "ŭ": "u", "ü": "u", "ǜ": "u", "ǘ": "u", "ǖ": "u", "ǚ": "u", "ủ": "u", "ů": "u", "ű": "u", "ǔ": "u", "ȕ": "u", "ȗ": "u", "ư": "u", "ừ": "u", "ứ": "u", "ữ": "u", "ử": "u", "ự": "u", "ụ": "u", "ṳ": "u", "ų": "u", "ṷ": "u", "ṵ": "u", "ʉ": "u", "ⓥ": "v", "ｖ": "v", "ṽ": "v", "ṿ": "v", "ʋ": "v", "ꝟ": "v", "ʌ": "v", "ꝡ": "vy", "ⓦ": "w", "ｗ": "w", "ẁ": "w", "ẃ": "w", "ŵ": "w", "ẇ": "w", "ẅ": "w", "ẘ": "w", "ẉ": "w", "ⱳ": "w", "ⓧ": "x", "ｘ": "x", "ẋ": "x", "ẍ": "x", "ⓨ": "y", "ｙ": "y", "ỳ": "y", "ý": "y", "ŷ": "y", "ỹ": "y", "ȳ": "y", "ẏ": "y", "ÿ": "y", "ỷ": "y", "ẙ": "y", "ỵ": "y", "ƴ": "y", "ɏ": "y", "ỿ": "y", "ⓩ": "z", "ｚ": "z", "ź": "z", "ẑ": "z", "ż": "z", "ž": "z", "ẓ": "z", "ẕ": "z", "ƶ": "z", "ȥ": "z", "ɀ": "z", "ⱬ": "z", "ꝣ": "z", "Ά": "Α", "Έ": "Ε", "Ή": "Η", "Ί": "Ι", "Ϊ": "Ι", "Ό": "Ο", "Ύ": "Υ", "Ϋ": "Υ", "Ώ": "Ω", "ά": "α", "έ": "ε", "ή": "η", "ί": "ι", "ϊ": "ι", "ΐ": "ι", "ό": "ο", "ύ": "υ", "ϋ": "υ", "ΰ": "υ", "ω": "ω", "ς": "σ" } }), t.define("select2/data/base", ["../utils"], function (e) { function t(e, n) { t.__super__.constructor.call(this) } return e.Extend(t, e.Observable), t.prototype.current = function (e) { throw new Error("The `current` method must be defined in child classes.") }, t.prototype.query = function (e, t) { throw new Error("The `query` method must be defined in child classes.") }, t.prototype.bind = function (e, t) { }, t.prototype.destroy = function () { }, t.prototype.generateResultId = function (t, n) { var i = t.id + "-result-"; return (i += e.generateChars(4)) + (null != n.id ? "-" + n.id.toString() : "-" + e.generateChars(4)) }, t }), t.define("select2/data/select", ["./base", "../utils", "jquery"], function (e, t, n) { function i(e, t) { this.$element = e, this.options = t, i.__super__.constructor.call(this) } return t.Extend(i, e), i.prototype.current = function (e) { var t = [], i = this; this.$element.find(":selected").each(function () { var e = n(this), r = i.item(e); t.push(r) }), e(t) }, i.prototype.select = function (e) { var t = this; if (e.selected = !0, n(e.element).is("option")) return e.element.selected = !0, void this.$element.trigger("change"); if (this.$element.prop("multiple")) this.current(function (i) { var r = []; (e = [e]).push.apply(e, i); for (var o = 0; o < e.length; o++) { var s = e[o].id; -1 === n.inArray(s, r) && r.push(s) } t.$element.val(r), t.$element.trigger("change") }); else { var i = e.id; this.$element.val(i), this.$element.trigger("change") } }, i.prototype.unselect = function (e) { var t = this; if (this.$element.prop("multiple")) return e.selected = !1, n(e.element).is("option") ? (e.element.selected = !1, void this.$element.trigger("change")) : void this.current(function (i) { for (var r = [], o = 0; o < i.length; o++) { var s = i[o].id; s !== e.id && -1 === n.inArray(s, r) && r.push(s) } t.$element.val(r), t.$element.trigger("change") }) }, i.prototype.bind = function (e, t) { var n = this; this.container = e, e.on("select", function (e) { n.select(e.data) }), e.on("unselect", function (e) { n.unselect(e.data) }) }, i.prototype.destroy = function () { this.$element.find("*").each(function () { n.removeData(this, "data") }) }, i.prototype.query = function (e, t) { var i = [], r = this; this.$element.children().each(function () { var t = n(this); if (t.is("option") || t.is("optgroup")) { var o = r.item(t), s = r.matches(e, o); null !== s && i.push(s) } }), t({ results: i }) }, i.prototype.addOptions = function (e) { t.appendMany(this.$element, e) }, i.prototype.option = function (e) { var t; e.children ? (t = document.createElement("optgroup")).label = e.text : void 0 !== (t = document.createElement("option")).textContent ? t.textContent = e.text : t.innerText = e.text, e.id && (t.value = e.id), e.disabled && (t.disabled = !0), e.selected && (t.selected = !0), e.title && (t.title = e.title); var i = n(t), r = this._normalizeItem(e); return r.element = t, n.data(t, "data", r), i }, i.prototype.item = function (e) { var t = {}; if (null != (t = n.data(e[0], "data"))) return t; if (e.is("option")) t = { id: e.val(), text: e.text(), disabled: e.prop("disabled"), selected: e.prop("selected"), title: e.prop("title") }; else if (e.is("optgroup")) { t = { text: e.prop("label"), children: [], title: e.prop("title") }; for (var i = e.children("option"), r = [], o = 0; o < i.length; o++) { var s = n(i[o]), a = this.item(s); r.push(a) } t.children = r } return (t = this._normalizeItem(t)).element = e[0], n.data(e[0], "data", t), t }, i.prototype._normalizeItem = function (e) { n.isPlainObject(e) || (e = { id: e, text: e }); return null != (e = n.extend({}, { text: "" }, e)).id && (e.id = e.id.toString()), null != e.text && (e.text = e.text.toString()), null == e._resultId && e.id && null != this.container && (e._resultId = this.generateResultId(this.container, e)), n.extend({}, { selected: !1, disabled: !1 }, e) }, i.prototype.matches = function (e, t) { return this.options.get("matcher")(e, t) }, i }), t.define("select2/data/array", ["./select", "../utils", "jquery"], function (e, t, n) { function i(e, t) { var n = t.get("data") || []; i.__super__.constructor.call(this, e, t), this.addOptions(this.convertToOptions(n)) } return t.Extend(i, e), i.prototype.select = function (e) { var t = this.$element.find("option").filter(function (t, n) { return n.value == e.id.toString() }); 0 === t.length && (t = this.option(e), this.addOptions(t)), i.__super__.select.call(this, e) }, i.prototype.convertToOptions = function (e) { function i(e) { return function () { return n(this).val() == e.id } } for (var r = this, o = this.$element.find("option"), s = o.map(function () { return r.item(n(this)).id }).get(), a = [], l = 0; l < e.length; l++) { var c = this._normalizeItem(e[l]); if (n.inArray(c.id, s) >= 0) { var u = o.filter(i(c)), d = this.item(u), p = n.extend(!0, {}, c, d), h = this.option(p); u.replaceWith(h) } else { var f = this.option(c); if (c.children) { var g = this.convertToOptions(c.children); t.appendMany(f, g) } a.push(f) } } return a }, i }), t.define("select2/data/ajax", ["./array", "../utils", "jquery"], function (e, t, n) { function i(e, t) { this.ajaxOptions = this._applyDefaults(t.get("ajax")), null != this.ajaxOptions.processResults && (this.processResults = this.ajaxOptions.processResults), i.__super__.constructor.call(this, e, t) } return t.Extend(i, e), i.prototype._applyDefaults = function (e) { var t = { data: function (e) { return n.extend({}, e, { q: e.term }) }, transport: function (e, t, i) { var r = n.ajax(e); return r.then(t), r.fail(i), r } }; return n.extend({}, t, e, !0) }, i.prototype.processResults = function (e) { return e }, i.prototype.query = function (e, t) { function i() { var i = o.transport(o, function (i) { var o = r.processResults(i, e); r.options.get("debug") && window.console && console.error && (o && o.results && n.isArray(o.results) || console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")), t(o) }, function () { i.status && "0" === i.status || r.trigger("results:message", { message: "errorLoading" }) }); r._request = i } var r = this; null != this._request && (n.isFunction(this._request.abort) && this._request.abort(), this._request = null); var o = n.extend({ type: "GET" }, this.ajaxOptions); "function" == typeof o.url && (o.url = o.url.call(this.$element, e)), "function" == typeof o.data && (o.data = o.data.call(this.$element, e)), this.ajaxOptions.delay && null != e.term ? (this._queryTimeout && window.clearTimeout(this._queryTimeout), this._queryTimeout = window.setTimeout(i, this.ajaxOptions.delay)) : i() }, i }), t.define("select2/data/tags", ["jquery"], function (e) { function t(t, n, i) { var r = i.get("tags"), o = i.get("createTag"); void 0 !== o && (this.createTag = o); var s = i.get("insertTag"); if (void 0 !== s && (this.insertTag = s), t.call(this, n, i), e.isArray(r)) for (var a = 0; a < r.length; a++) { var l = r[a], c = this._normalizeItem(l), u = this.option(c); this.$element.append(u) } } return t.prototype.query = function (e, t, n) { var i = this; return this._removeOldTags(), null == t.term || null != t.page ? void e.call(this, t, n) : void e.call(this, t, function e(r, o) { for (var s = r.results, a = 0; a < s.length; a++) { var l = s[a], c = null != l.children && !e({ results: l.children }, !0); if (l.text === t.term || c) return !o && (r.data = s, void n(r)) } if (o) return !0; var u = i.createTag(t); if (null != u) { var d = i.option(u); d.attr("data-select2-tag", !0), i.addOptions([d]), i.insertTag(s, u) } r.results = s, n(r) }) }, t.prototype.createTag = function (t, n) { var i = e.trim(n.term); return "" === i ? null : { id: i, text: i } }, t.prototype.insertTag = function (e, t, n) { t.unshift(n) }, t.prototype._removeOldTags = function (t) { (this._lastTag, this.$element.find("option[data-select2-tag]")).each(function () { this.selected || e(this).remove() }) }, t }), t.define("select2/data/tokenizer", ["jquery"], function (e) { function t(e, t, n) { var i = n.get("tokenizer"); void 0 !== i && (this.tokenizer = i), e.call(this, t, n) } return t.prototype.bind = function (e, t, n) { e.call(this, t, n), this.$search = t.dropdown.$search || t.selection.$search || n.find(".select2-search__field") }, t.prototype.query = function (t, n, i) { var r = this; n.term = n.term || ""; var o = this.tokenizer(n, this.options, function (t) { var n, i = r._normalizeItem(t); if (!r.$element.find("option").filter(function () { return e(this).val() === i.id }).length) { var o = r.option(i); o.attr("data-select2-tag", !0), r._removeOldTags(), r.addOptions([o]) } n = i, r.trigger("select", { data: n }) }); o.term !== n.term && (this.$search.length && (this.$search.val(o.term), this.$search.focus()), n.term = o.term), t.call(this, n, i) }, t.prototype.tokenizer = function (t, n, i, r) { for (var o = i.get("tokenSeparators") || [], s = n.term, a = 0, l = this.createTag || function (e) { return { id: e.term, text: e.term } }; a < s.length;) { var c = s[a]; if (-1 !== e.inArray(c, o)) { var u = s.substr(0, a), d = l(e.extend({}, n, { term: u })); null != d ? (r(d), s = s.substr(a + 1) || "", a = 0) : a++ } else a++ } return { term: s } }, t }), t.define("select2/data/minimumInputLength", [], function () { function e(e, t, n) { this.minimumInputLength = n.get("minimumInputLength"), e.call(this, t, n) } return e.prototype.query = function (e, t, n) { return t.term = t.term || "", t.term.length < this.minimumInputLength ? void this.trigger("results:message", { message: "inputTooShort", args: { minimum: this.minimumInputLength, input: t.term, params: t } }) : void e.call(this, t, n) }, e }), t.define("select2/data/maximumInputLength", [], function () { function e(e, t, n) { this.maximumInputLength = n.get("maximumInputLength"), e.call(this, t, n) } return e.prototype.query = function (e, t, n) { return t.term = t.term || "", this.maximumInputLength > 0 && t.term.length > this.maximumInputLength ? void this.trigger("results:message", { message: "inputTooLong", args: { maximum: this.maximumInputLength, input: t.term, params: t } }) : void e.call(this, t, n) }, e }), t.define("select2/data/maximumSelectionLength", [], function () { function e(e, t, n) { this.maximumSelectionLength = n.get("maximumSelectionLength"), e.call(this, t, n) } return e.prototype.query = function (e, t, n) { var i = this; this.current(function (r) { var o = null != r ? r.length : 0; return i.maximumSelectionLength > 0 && o >= i.maximumSelectionLength ? void i.trigger("results:message", { message: "maximumSelected", args: { maximum: i.maximumSelectionLength } }) : void e.call(i, t, n) }) }, e }), t.define("select2/dropdown", ["jquery", "./utils"], function (e, t) { function n(e, t) { this.$element = e, this.options = t, n.__super__.constructor.call(this) } return t.Extend(n, t.Observable), n.prototype.render = function () { var t = e('<span class="select2-dropdown"><span class="select2-results"></span></span>'); return t.attr("dir", this.options.get("dir")), this.$dropdown = t, t }, n.prototype.bind = function () { }, n.prototype.position = function (e, t) { }, n.prototype.destroy = function () { this.$dropdown.remove() }, n }), t.define("select2/dropdown/search", ["jquery", "../utils"], function (e, t) { function n() { } return n.prototype.render = function (t) { var n = t.call(this), i = e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>'); return this.$searchContainer = i, this.$search = i.find("input"), n.prepend(i), n }, n.prototype.bind = function (t, n, i) { var r = this; t.call(this, n, i), this.$search.on("keydown", function (e) { r.trigger("keypress", e), r._keyUpPrevented = e.isDefaultPrevented() }), this.$search.on("input", function (t) { e(this).off("keyup") }), this.$search.on("keyup input", function (e) { r.handleSearch(e) }), n.on("open", function () { r.$search.attr("tabindex", 0), r.$search.focus(), window.setTimeout(function () { r.$search.focus() }, 0) }), n.on("close", function () { r.$search.attr("tabindex", -1), r.$search.val("") }), n.on("focus", function () { n.isOpen() && r.$search.focus() }), n.on("results:all", function (e) { null != e.query.term && "" !== e.query.term || (r.showSearch(e) ? r.$searchContainer.removeClass("select2-search--hide") : r.$searchContainer.addClass("select2-search--hide")) }) }, n.prototype.handleSearch = function (e) { if (!this._keyUpPrevented) { var t = this.$search.val(); this.trigger("query", { term: t }) } this._keyUpPrevented = !1 }, n.prototype.showSearch = function (e, t) { return !0 }, n }), t.define("select2/dropdown/hidePlaceholder", [], function () { function e(e, t, n, i) { this.placeholder = this.normalizePlaceholder(n.get("placeholder")), e.call(this, t, n, i) } return e.prototype.append = function (e, t) { t.results = this.removePlaceholder(t.results), e.call(this, t) }, e.prototype.normalizePlaceholder = function (e, t) { return "string" == typeof t && (t = { id: "", text: t }), t }, e.prototype.removePlaceholder = function (e, t) { for (var n = t.slice(0), i = t.length - 1; i >= 0; i--) { var r = t[i]; this.placeholder.id === r.id && n.splice(i, 1) } return n }, e }), t.define("select2/dropdown/infiniteScroll", ["jquery"], function (e) { function t(e, t, n, i) { this.lastParams = {}, e.call(this, t, n, i), this.$loadingMore = this.createLoadingMore(), this.loading = !1 } return t.prototype.append = function (e, t) { this.$loadingMore.remove(), this.loading = !1, e.call(this, t), this.showLoadingMore(t) && this.$results.append(this.$loadingMore) }, t.prototype.bind = function (t, n, i) { var r = this; t.call(this, n, i), n.on("query", function (e) { r.lastParams = e, r.loading = !0 }), n.on("query:append", function (e) { r.lastParams = e, r.loading = !0 }), this.$results.on("scroll", function () { var t = e.contains(document.documentElement, r.$loadingMore[0]); !r.loading && t && (r.$results.offset().top + r.$results.outerHeight(!1) + 50 >= r.$loadingMore.offset().top + r.$loadingMore.outerHeight(!1) && r.loadMore()) }) }, t.prototype.loadMore = function () { this.loading = !0; var t = e.extend({}, { page: 1 }, this.lastParams); t.page++, this.trigger("query:append", t) }, t.prototype.showLoadingMore = function (e, t) { return t.pagination && t.pagination.more }, t.prototype.createLoadingMore = function () { var t = e('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'), n = this.options.get("translations").get("loadingMore"); return t.html(n(this.lastParams)), t }, t }), t.define("select2/dropdown/attachBody", ["jquery", "../utils"], function (e, t) { function n(t, n, i) { this.$dropdownParent = i.get("dropdownParent") || e(document.body), t.call(this, n, i) } return n.prototype.bind = function (e, t, n) { var i = this, r = !1; e.call(this, t, n), t.on("open", function () { i._showDropdown(), i._attachPositioningHandler(t), r || (r = !0, t.on("results:all", function () { i._positionDropdown(), i._resizeDropdown() }), t.on("results:append", function () { i._positionDropdown(), i._resizeDropdown() })) }), t.on("close", function () { i._hideDropdown(), i._detachPositioningHandler(t) }), this.$dropdownContainer.on("mousedown", function (e) { e.stopPropagation() }) }, n.prototype.destroy = function (e) { e.call(this), this.$dropdownContainer.remove() }, n.prototype.position = function (e, t, n) { t.attr("class", n.attr("class")), t.removeClass("select2"), t.addClass("select2-container--open"), t.css({ position: "absolute", top: -999999 }), this.$container = n }, n.prototype.render = function (t) { var n = e("<span></span>"), i = t.call(this); return n.append(i), this.$dropdownContainer = n, n }, n.prototype._hideDropdown = function (e) { this.$dropdownContainer.detach() }, n.prototype._attachPositioningHandler = function (n, i) { var r = this, o = "scroll.select2." + i.id, s = "resize.select2." + i.id, a = "orientationchange.select2." + i.id, l = this.$container.parents().filter(t.hasScroll); l.each(function () { e(this).data("select2-scroll-position", { x: e(this).scrollLeft(), y: e(this).scrollTop() }) }), l.on(o, function (t) { var n = e(this).data("select2-scroll-position"); e(this).scrollTop(n.y) }), e(window).on(o + " " + s + " " + a, function (e) { r._positionDropdown(), r._resizeDropdown() }) }, n.prototype._detachPositioningHandler = function (n, i) { var r = "scroll.select2." + i.id, o = "resize.select2." + i.id, s = "orientationchange.select2." + i.id; this.$container.parents().filter(t.hasScroll).off(r), e(window).off(r + " " + o + " " + s) }, n.prototype._positionDropdown = function () { var t = e(window), n = this.$dropdown.hasClass("select2-dropdown--above"), i = this.$dropdown.hasClass("select2-dropdown--below"), r = null, o = this.$container.offset(); o.bottom = o.top + this.$container.outerHeight(!1); var s = { height: this.$container.outerHeight(!1) }; s.top = o.top, s.bottom = o.top + s.height; var a = this.$dropdown.outerHeight(!1), l = t.scrollTop(), c = t.scrollTop() + t.height(), u = l < o.top - a, d = c > o.bottom + a, p = { left: o.left, top: s.bottom }, h = this.$dropdownParent; "static" === h.css("position") && (h = h.offsetParent()); var f = h.offset(); p.top -= f.top, p.left -= f.left, n || i || (r = "below"), d || !u || n ? !u && d && n && (r = "below") : r = "above", ("above" == r || n && "below" !== r) && (p.top = s.top - f.top - a), null != r && (this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--" + r), this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--" + r)), this.$dropdownContainer.css(p) }, n.prototype._resizeDropdown = function () { var e = { width: this.$container.outerWidth(!1) + "px" }; this.options.get("dropdownAutoWidth") && (e.minWidth = e.width, e.position = "relative", e.width = "auto"), this.$dropdown.css(e) }, n.prototype._showDropdown = function (e) { this.$dropdownContainer.appendTo(this.$dropdownParent), this._positionDropdown(), this._resizeDropdown() }, n }), t.define("select2/dropdown/minimumResultsForSearch", [], function () { function e(e, t, n, i) { this.minimumResultsForSearch = n.get("minimumResultsForSearch"), this.minimumResultsForSearch < 0 && (this.minimumResultsForSearch = 1 / 0), e.call(this, t, n, i) } return e.prototype.showSearch = function (e, t) { return !(function e(t) { for (var n = 0, i = 0; i < t.length; i++) { var r = t[i]; r.children ? n += e(r.children) : n++ } return n }(t.data.results) < this.minimumResultsForSearch) && e.call(this, t) }, e }), t.define("select2/dropdown/selectOnClose", [], function () { function e() { } return e.prototype.bind = function (e, t, n) { var i = this; e.call(this, t, n), t.on("close", function (e) { i._handleSelectOnClose(e) }) }, e.prototype._handleSelectOnClose = function (e, t) { if (t && null != t.originalSelect2Event) { var n = t.originalSelect2Event; if ("select" === n._type || "unselect" === n._type) return } var i = this.getHighlightedResults(); if (!(i.length < 1)) { var r = i.data("data"); null != r.element && r.element.selected || null == r.element && r.selected || this.trigger("select", { data: r }) } }, e }), t.define("select2/dropdown/closeOnSelect", [], function () { function e() { } return e.prototype.bind = function (e, t, n) { var i = this; e.call(this, t, n), t.on("select", function (e) { i._selectTriggered(e) }), t.on("unselect", function (e) { i._selectTriggered(e) }) }, e.prototype._selectTriggered = function (e, t) { var n = t.originalEvent; n && n.ctrlKey || this.trigger("close", { originalEvent: n, originalSelect2Event: t }) }, e }), t.define("select2/i18n/en", [], function () { return { errorLoading: function () { return "The results could not be loaded." }, inputTooLong: function (e) { var t = e.input.length - e.maximum, n = "Please delete " + t + " character"; return 1 != t && (n += "s"), n }, inputTooShort: function (e) { return "Please enter " + (e.minimum - e.input.length) + " or more characters" }, loadingMore: function () { return "Loading more results…" }, maximumSelected: function (e) { var t = "You can only select " + e.maximum + " item"; return 1 != e.maximum && (t += "s"), t }, noResults: function () { return "No results found" }, searching: function () { return "Searching…" } } }), t.define("select2/defaults", ["jquery", "require", "./results", "./selection/single", "./selection/multiple", "./selection/placeholder", "./selection/allowClear", "./selection/search", "./selection/eventRelay", "./utils", "./translation", "./diacritics", "./data/select", "./data/array", "./data/ajax", "./data/tags", "./data/tokenizer", "./data/minimumInputLength", "./data/maximumInputLength", "./data/maximumSelectionLength", "./dropdown", "./dropdown/search", "./dropdown/hidePlaceholder", "./dropdown/infiniteScroll", "./dropdown/attachBody", "./dropdown/minimumResultsForSearch", "./dropdown/selectOnClose", "./dropdown/closeOnSelect", "./i18n/en"], function (e, t, n, i, r, o, s, a, l, c, u, d, p, h, f, g, m, v, y, _, $, w, b, A, x, E, C, O, S) { function T() { this.reset() } return T.prototype.apply = function (d) { if (null == (d = e.extend(!0, {}, this.defaults, d)).dataAdapter) { if (null != d.ajax ? d.dataAdapter = f : null != d.data ? d.dataAdapter = h : d.dataAdapter = p, d.minimumInputLength > 0 && (d.dataAdapter = c.Decorate(d.dataAdapter, v)), d.maximumInputLength > 0 && (d.dataAdapter = c.Decorate(d.dataAdapter, y)), d.maximumSelectionLength > 0 && (d.dataAdapter = c.Decorate(d.dataAdapter, _)), d.tags && (d.dataAdapter = c.Decorate(d.dataAdapter, g)), (null != d.tokenSeparators || null != d.tokenizer) && (d.dataAdapter = c.Decorate(d.dataAdapter, m)), null != d.query) { var S = t(d.amdBase + "compat/query"); d.dataAdapter = c.Decorate(d.dataAdapter, S) } if (null != d.initSelection) { var T = t(d.amdBase + "compat/initSelection"); d.dataAdapter = c.Decorate(d.dataAdapter, T) } } if (null == d.resultsAdapter && (d.resultsAdapter = n, null != d.ajax && (d.resultsAdapter = c.Decorate(d.resultsAdapter, A)), null != d.placeholder && (d.resultsAdapter = c.Decorate(d.resultsAdapter, b)), d.selectOnClose && (d.resultsAdapter = c.Decorate(d.resultsAdapter, C))), null == d.dropdownAdapter) { if (d.multiple) d.dropdownAdapter = $; else { var D = c.Decorate($, w); d.dropdownAdapter = D } if (0 !== d.minimumResultsForSearch && (d.dropdownAdapter = c.Decorate(d.dropdownAdapter, E)), d.closeOnSelect && (d.dropdownAdapter = c.Decorate(d.dropdownAdapter, O)), null != d.dropdownCssClass || null != d.dropdownCss || null != d.adaptDropdownCssClass) { var q = t(d.amdBase + "compat/dropdownCss"); d.dropdownAdapter = c.Decorate(d.dropdownAdapter, q) } d.dropdownAdapter = c.Decorate(d.dropdownAdapter, x) } if (null == d.selectionAdapter) { if (d.multiple ? d.selectionAdapter = r : d.selectionAdapter = i, null != d.placeholder && (d.selectionAdapter = c.Decorate(d.selectionAdapter, o)), d.allowClear && (d.selectionAdapter = c.Decorate(d.selectionAdapter, s)), d.multiple && (d.selectionAdapter = c.Decorate(d.selectionAdapter, a)), null != d.containerCssClass || null != d.containerCss || null != d.adaptContainerCssClass) { var L = t(d.amdBase + "compat/containerCss"); d.selectionAdapter = c.Decorate(d.selectionAdapter, L) } d.selectionAdapter = c.Decorate(d.selectionAdapter, l) } if ("string" == typeof d.language) if (d.language.indexOf("-") > 0) { var j = d.language.split("-")[0]; d.language = [d.language, j] } else d.language = [d.language]; if (e.isArray(d.language)) { var P = new u; d.language.push("en"); for (var k = d.language, I = 0; I < k.length; I++) { var R = k[I], M = {}; try { M = u.loadPath(R) } catch (e) { try { R = this.defaults.amdLanguageBase + R, M = u.loadPath(R) } catch (e) { d.debug && window.console && console.warn && console.warn('Select2: The language file for "' + R + '" could not be automatically loaded. A fallback will be used instead.'); continue } } P.extend(M) } d.translations = P } else { var U = u.loadPath(this.defaults.amdLanguageBase + "en"), H = new u(d.language); H.extend(U), d.translations = H } return d }, T.prototype.reset = function () { function t(e) { return e.replace(/[^\u0000-\u007E]/g, function (e) { return d[e] || e }) } this.defaults = { amdBase: "./", amdLanguageBase: "./i18n/", closeOnSelect: !0, debug: !1, dropdownAutoWidth: !1, escapeMarkup: c.escapeMarkup, language: S, matcher: function n(i, r) { if ("" === e.trim(i.term)) return r; if (r.children && r.children.length > 0) { for (var o = e.extend(!0, {}, r), s = r.children.length - 1; s >= 0; s--) null == n(i, r.children[s]) && o.children.splice(s, 1); return o.children.length > 0 ? o : n(i, o) } var a = t(r.text).toUpperCase(), l = t(i.term).toUpperCase(); return a.indexOf(l) > -1 ? r : null }, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: !1, sorter: function (e) { return e }, templateResult: function (e) { return e.text }, templateSelection: function (e) { return e.text }, theme: "default", width: "resolve" } }, T.prototype.set = function (t, n) { var i = {}; i[e.camelCase(t)] = n; var r = c._convertData(i); e.extend(this.defaults, r) }, new T }), t.define("select2/options", ["require", "jquery", "./defaults", "./utils"], function (e, t, n, i) { function r(t, r) { if (this.options = t, null != r && this.fromElement(r), this.options = n.apply(this.options), r && r.is("input")) { var o = e(this.get("amdBase") + "compat/inputData"); this.options.dataAdapter = i.Decorate(this.options.dataAdapter, o) } } return r.prototype.fromElement = function (e) { var n = ["select2"]; null == this.options.multiple && (this.options.multiple = e.prop("multiple")), null == this.options.disabled && (this.options.disabled = e.prop("disabled")), null == this.options.language && (e.prop("lang") ? this.options.language = e.prop("lang").toLowerCase() : e.closest("[lang]").prop("lang") && (this.options.language = e.closest("[lang]").prop("lang"))), null == this.options.dir && (e.prop("dir") ? this.options.dir = e.prop("dir") : e.closest("[dir]").prop("dir") ? this.options.dir = e.closest("[dir]").prop("dir") : this.options.dir = "ltr"), e.prop("disabled", this.options.disabled), e.prop("multiple", this.options.multiple), e.data("select2Tags") && (this.options.debug && window.console && console.warn && console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'), e.data("data", e.data("select2Tags")), e.data("tags", !0)), e.data("ajaxUrl") && (this.options.debug && window.console && console.warn && console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."), e.attr("ajax--url", e.data("ajaxUrl")), e.data("ajax--url", e.data("ajaxUrl"))); var r; r = t.fn.jquery && "1." == t.fn.jquery.substr(0, 2) && e[0].dataset ? t.extend(!0, {}, e[0].dataset, e.data()) : e.data(); var o = t.extend(!0, {}, r); o = i._convertData(o); for (var s in o) t.inArray(s, n) > -1 || (t.isPlainObject(this.options[s]) ? t.extend(this.options[s], o[s]) : this.options[s] = o[s]); return this }, r.prototype.get = function (e) { return this.options[e] }, r.prototype.set = function (e, t) { this.options[e] = t }, r }), t.define("select2/core", ["jquery", "./options", "./utils", "./keys"], function (e, t, n, i) { var r = function (e, n) { null != e.data("select2") && e.data("select2").destroy(), this.$element = e, this.id = this._generateId(e), n = n || {}, this.options = new t(n, e), r.__super__.constructor.call(this); var i = e.attr("tabindex") || 0; e.data("old-tabindex", i), e.attr("tabindex", "-1"); var o = this.options.get("dataAdapter"); this.dataAdapter = new o(e, this.options); var s = this.render(); this._placeContainer(s); var a = this.options.get("selectionAdapter"); this.selection = new a(e, this.options), this.$selection = this.selection.render(), this.selection.position(this.$selection, s); var l = this.options.get("dropdownAdapter"); this.dropdown = new l(e, this.options), this.$dropdown = this.dropdown.render(), this.dropdown.position(this.$dropdown, s); var c = this.options.get("resultsAdapter"); this.results = new c(e, this.options, this.dataAdapter), this.$results = this.results.render(), this.results.position(this.$results, this.$dropdown); var u = this; this._bindAdapters(), this._registerDomEvents(), this._registerDataEvents(), this._registerSelectionEvents(), this._registerDropdownEvents(), this._registerResultsEvents(), this._registerEvents(), this.dataAdapter.current(function (e) { u.trigger("selection:update", { data: e }) }), e.addClass("select2-hidden-accessible"), e.attr("aria-hidden", "true"), this._syncAttributes(), e.data("select2", this) }; return n.Extend(r, n.Observable), r.prototype._generateId = function (e) { return "select2-" + (null != e.attr("id") ? e.attr("id") : null != e.attr("name") ? e.attr("name") + "-" + n.generateChars(2) : n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g, "") }, r.prototype._placeContainer = function (e) { e.insertAfter(this.$element); var t = this._resolveWidth(this.$element, this.options.get("width")); null != t && e.css("width", t) }, r.prototype._resolveWidth = function (e, t) { var n = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if ("resolve" == t) { var i = this._resolveWidth(e, "style"); return null != i ? i : this._resolveWidth(e, "element") } if ("element" == t) { var r = e.outerWidth(!1); return 0 >= r ? "auto" : r + "px" } if ("style" == t) { var o = e.attr("style"); if ("string" != typeof o) return null; for (var s = o.split(";"), a = 0, l = s.length; l > a; a += 1) { var c = s[a].replace(/\s/g, "").match(n); if (null !== c && c.length >= 1) return c[1] } return null } return t }, r.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container), this.selection.bind(this, this.$container), this.dropdown.bind(this, this.$container), this.results.bind(this, this.$container) }, r.prototype._registerDomEvents = function () { var t = this; this.$element.on("change.select2", function () { t.dataAdapter.current(function (e) { t.trigger("selection:update", { data: e }) }) }), this.$element.on("focus.select2", function (e) { t.trigger("focus", e) }), this._syncA = n.bind(this._syncAttributes, this), this._syncS = n.bind(this._syncSubtree, this), this.$element[0].attachEvent && this.$element[0].attachEvent("onpropertychange", this._syncA); var i = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; null != i ? (this._observer = new i(function (n) { e.each(n, t._syncA), e.each(n, t._syncS) }), this._observer.observe(this.$element[0], { attributes: !0, childList: !0, subtree: !1 })) : this.$element[0].addEventListener && (this.$element[0].addEventListener("DOMAttrModified", t._syncA, !1), this.$element[0].addEventListener("DOMNodeInserted", t._syncS, !1), this.$element[0].addEventListener("DOMNodeRemoved", t._syncS, !1)) }, r.prototype._registerDataEvents = function () { var e = this; this.dataAdapter.on("*", function (t, n) { e.trigger(t, n) }) }, r.prototype._registerSelectionEvents = function () { var t = this, n = ["toggle", "focus"]; this.selection.on("toggle", function () { t.toggleDropdown() }), this.selection.on("focus", function (e) { t.focus(e) }), this.selection.on("*", function (i, r) { -1 === e.inArray(i, n) && t.trigger(i, r) }) }, r.prototype._registerDropdownEvents = function () { var e = this; this.dropdown.on("*", function (t, n) { e.trigger(t, n) }) }, r.prototype._registerResultsEvents = function () { var e = this; this.results.on("*", function (t, n) { e.trigger(t, n) }) }, r.prototype._registerEvents = function () { var e = this; this.on("open", function () { e.$container.addClass("select2-container--open") }), this.on("close", function () { e.$container.removeClass("select2-container--open") }), this.on("enable", function () { e.$container.removeClass("select2-container--disabled") }), this.on("disable", function () { e.$container.addClass("select2-container--disabled") }), this.on("blur", function () { e.$container.removeClass("select2-container--focus") }), this.on("query", function (t) { e.isOpen() || e.trigger("open", {}), this.dataAdapter.query(t, function (n) { e.trigger("results:all", { data: n, query: t }) }) }), this.on("query:append", function (t) { this.dataAdapter.query(t, function (n) { e.trigger("results:append", { data: n, query: t }) }) }), this.on("keypress", function (t) { var n = t.which; e.isOpen() ? n === i.ESC || n === i.TAB || n === i.UP && t.altKey ? (e.close(), t.preventDefault()) : n === i.ENTER ? (e.trigger("results:select", {}), t.preventDefault()) : n === i.SPACE && t.ctrlKey ? (e.trigger("results:toggle", {}), t.preventDefault()) : n === i.UP ? (e.trigger("results:previous", {}), t.preventDefault()) : n === i.DOWN && (e.trigger("results:next", {}), t.preventDefault()) : (n === i.ENTER || n === i.SPACE || n === i.DOWN && t.altKey) && (e.open(), t.preventDefault()) }) }, r.prototype._syncAttributes = function () { this.options.set("disabled", this.$element.prop("disabled")), this.options.get("disabled") ? (this.isOpen() && this.close(), this.trigger("disable", {})) : this.trigger("enable", {}) }, r.prototype._syncSubtree = function (e, t) { var n = !1, i = this; if (!e || !e.target || "OPTION" === e.target.nodeName || "OPTGROUP" === e.target.nodeName) { if (t) if (t.addedNodes && t.addedNodes.length > 0) for (var r = 0; r < t.addedNodes.length; r++) { t.addedNodes[r].selected && (n = !0) } else t.removedNodes && t.removedNodes.length > 0 && (n = !0); else n = !0; n && this.dataAdapter.current(function (e) { i.trigger("selection:update", { data: e }) }) } }, r.prototype.trigger = function (e, t) { var n = r.__super__.trigger, i = { open: "opening", close: "closing", select: "selecting", unselect: "unselecting" }; if (void 0 === t && (t = {}), e in i) { var o = i[e], s = { prevented: !1, name: e, args: t }; if (n.call(this, o, s), s.prevented) return void (t.prevented = !0) } n.call(this, e, t) }, r.prototype.toggleDropdown = function () { this.options.get("disabled") || (this.isOpen() ? this.close() : this.open()) }, r.prototype.open = function () { this.isOpen() || this.trigger("query", {}) }, r.prototype.close = function () { this.isOpen() && this.trigger("close", {}) }, r.prototype.isOpen = function () { return this.$container.hasClass("select2-container--open") }, r.prototype.hasFocus = function () { return this.$container.hasClass("select2-container--focus") }, r.prototype.focus = function (e) { this.hasFocus() || (this.$container.addClass("select2-container--focus"), this.trigger("focus", {})) }, r.prototype.enable = function (e) { this.options.get("debug") && window.console && console.warn && console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'), (null == e || 0 === e.length) && (e = [!0]); var t = !e[0]; this.$element.prop("disabled", t) }, r.prototype.data = function () { this.options.get("debug") && arguments.length > 0 && window.console && console.warn && console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.'); var e = []; return this.dataAdapter.current(function (t) { e = t }), e }, r.prototype.val = function (t) { if (this.options.get("debug") && window.console && console.warn && console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'), null == t || 0 === t.length) return this.$element.val(); var n = t[0]; e.isArray(n) && (n = e.map(n, function (e) { return e.toString() })), this.$element.val(n).trigger("change") }, r.prototype.destroy = function () { this.$container.remove(), this.$element[0].detachEvent && this.$element[0].detachEvent("onpropertychange", this._syncA), null != this._observer ? (this._observer.disconnect(), this._observer = null) : this.$element[0].removeEventListener && (this.$element[0].removeEventListener("DOMAttrModified", this._syncA, !1), this.$element[0].removeEventListener("DOMNodeInserted", this._syncS, !1), this.$element[0].removeEventListener("DOMNodeRemoved", this._syncS, !1)), this._syncA = null, this._syncS = null, this.$element.off(".select2"), this.$element.attr("tabindex", this.$element.data("old-tabindex")), this.$element.removeClass("select2-hidden-accessible"), this.$element.attr("aria-hidden", "false"), this.$element.removeData("select2"), this.dataAdapter.destroy(), this.selection.destroy(), this.dropdown.destroy(), this.results.destroy(), this.dataAdapter = null, this.selection = null, this.dropdown = null, this.results = null }, r.prototype.render = function () { var t = e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>'); return t.attr("dir", this.options.get("dir")), this.$container = t, this.$container.addClass("select2-container--" + this.options.get("theme")), t.data("element", this.$element), t }, r }), t.define("jquery-mousewheel", ["jquery"], function (e) { return e }), t.define("jquery.select2", ["jquery", "jquery-mousewheel", "./select2/core", "./select2/defaults"], function (e, t, n, i) { if (null == e.fn.select2) { var r = ["open", "close", "destroy"]; e.fn.select2 = function (t) { if ("object" == typeof (t = t || {})) return this.each(function () { var i = e.extend(!0, {}, t); new n(e(this), i) }), this; if ("string" == typeof t) { var i, o = Array.prototype.slice.call(arguments, 1); return this.each(function () { var n = e(this).data("select2"); null == n && window.console && console.error && console.error("The select2('" + t + "') method was called on an element that is not using Select2."), i = n[t].apply(n, o) }), e.inArray(t, r) > -1 ? this : i } throw new Error("Invalid arguments for Select2: " + t) } } return null == e.fn.select2.defaults && (e.fn.select2.defaults = i), n }), { define: t.define, require: t.require } }(), n = t.require("jquery.select2"); return e.fn.select2.amd = t, n });;!function (e, t) { "function" == typeof define && define.amd ? define(["jquery"], function (e) { return t(e) }) : "object" == typeof module && module.exports ? module.exports = t(require("jquery")) : t(e.jQuery) }(this, function (e) { !function (e) { "use strict"; function t(t) { return e.each([{ re: /[\xC0-\xC6]/g, ch: "A" }, { re: /[\xE0-\xE6]/g, ch: "a" }, { re: /[\xC8-\xCB]/g, ch: "E" }, { re: /[\xE8-\xEB]/g, ch: "e" }, { re: /[\xCC-\xCF]/g, ch: "I" }, { re: /[\xEC-\xEF]/g, ch: "i" }, { re: /[\xD2-\xD6]/g, ch: "O" }, { re: /[\xF2-\xF6]/g, ch: "o" }, { re: /[\xD9-\xDC]/g, ch: "U" }, { re: /[\xF9-\xFC]/g, ch: "u" }, { re: /[\xC7-\xE7]/g, ch: "c" }, { re: /[\xD1]/g, ch: "N" }, { re: /[\xF1]/g, ch: "n" }], function () { t = t ? t.replace(this.re, this.ch) : "" }), t } function i(t) { var i = arguments, n = t;[].shift.apply(i); var s, o = this.each(function () { var t = e(this); if (t.is("select")) { var o = t.data("selectpicker"), a = "object" == typeof n && n; if (o) { if (a) for (var l in a) a.hasOwnProperty(l) && (o.options[l] = a[l]) } else { var r = e.extend({}, m.DEFAULTS, e.fn.selectpicker.defaults || {}, t.data(), a); r.template = e.extend({}, m.DEFAULTS.template, e.fn.selectpicker.defaults ? e.fn.selectpicker.defaults.template : {}, t.data().template, a.template), t.data("selectpicker", o = new m(this, r)) } "string" == typeof n && (s = o[n] instanceof Function ? o[n].apply(o, i) : o.options[n]) } }); return void 0 !== s ? s : o } var n, s, o, a, l, r, d; String.prototype.includes || (a = {}.toString, l = function () { try { var e = {}, t = Object.defineProperty, i = t(e, e, e) && t } catch (e) { } return i }(), r = "".indexOf, d = function (e) { if (null == this) throw new TypeError; var t = String(this); if (e && "[object RegExp]" == a.call(e)) throw new TypeError; var i = t.length, n = String(e), s = n.length, o = arguments.length > 1 ? arguments[1] : void 0, l = o ? Number(o) : 0; return l != l && (l = 0), !(s + Math.min(Math.max(l, 0), i) > i) && -1 != r.call(t, n, l) }, l ? l(String.prototype, "includes", { value: d, configurable: !0, writable: !0 }) : String.prototype.includes = d), String.prototype.startsWith || (n = function () { try { var e = {}, t = Object.defineProperty, i = t(e, e, e) && t } catch (e) { } return i }(), s = {}.toString, o = function (e) { if (null == this) throw new TypeError; var t = String(this); if (e && "[object RegExp]" == s.call(e)) throw new TypeError; var i = t.length, n = String(e), o = n.length, a = arguments.length > 1 ? arguments[1] : void 0, l = a ? Number(a) : 0; l != l && (l = 0); var r = Math.min(Math.max(l, 0), i); if (o + r > i) return !1; for (var d = -1; ++d < o;) if (t.charCodeAt(r + d) != n.charCodeAt(d)) return !1; return !0 }, n ? n(String.prototype, "startsWith", { value: o, configurable: !0, writable: !0 }) : String.prototype.startsWith = o), Object.keys || (Object.keys = function (e, t, i) { i = []; for (t in e) i.hasOwnProperty.call(e, t) && i.push(t); return i }); var h = { useDefault: !1, _set: e.valHooks.select.set }; e.valHooks.select.set = function (t, i) { return i && !h.useDefault && e(t).data("selected", !0), h._set.apply(this, arguments) }; var c = null; e.fn.triggerNative = function (e) { var t, i = this[0]; i.dispatchEvent ? ("function" == typeof Event ? t = new Event(e, { bubbles: !0 }) : (t = document.createEvent("Event")).initEvent(e, !0, !1), i.dispatchEvent(t)) : i.fireEvent ? ((t = document.createEventObject()).eventType = e, i.fireEvent("on" + e, t)) : this.trigger(e) }, e.expr.pseudos.icontains = function (t, i, n) { var s = e(t); return (s.data("tokens") || s.text()).toString().toUpperCase().includes(n[3].toUpperCase()) }, e.expr.pseudos.ibegins = function (t, i, n) { var s = e(t); return (s.data("tokens") || s.text()).toString().toUpperCase().startsWith(n[3].toUpperCase()) }, e.expr.pseudos.aicontains = function (t, i, n) { var s = e(t); return (s.data("tokens") || s.data("normalizedText") || s.text()).toString().toUpperCase().includes(n[3].toUpperCase()) }, e.expr.pseudos.aibegins = function (t, i, n) { var s = e(t); return (s.data("tokens") || s.data("normalizedText") || s.text()).toString().toUpperCase().startsWith(n[3].toUpperCase()) }; var p = function (e) { var t = function (t) { return e[t] }, i = "(?:" + Object.keys(e).join("|") + ")", n = RegExp(i), s = RegExp(i, "g"); return function (e) { return e = null == e ? "" : "" + e, n.test(e) ? e.replace(s, t) : e } }, u = p({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;" }), f = p({ "&amp;": "&", "&lt;": "<", "&gt;": ">", "&quot;": '"', "&#x27;": "'", "&#x60;": "`" }), m = function (t, i) { h.useDefault || (e.valHooks.select.set = h._set, h.useDefault = !0), this.$element = e(t), this.$newElement = null, this.$button = null, this.$menu = null, this.$lis = null, this.options = i, null === this.options.title && (this.options.title = this.$element.attr("title")); var n = this.options.windowPadding; "number" == typeof n && (this.options.windowPadding = [n, n, n, n]), this.val = m.prototype.val, this.render = m.prototype.render, this.refresh = m.prototype.refresh, this.setStyle = m.prototype.setStyle, this.selectAll = m.prototype.selectAll, this.deselectAll = m.prototype.deselectAll, this.destroy = m.prototype.destroy, this.remove = m.prototype.remove, this.show = m.prototype.show, this.hide = m.prototype.hide, this.init() }; m.VERSION = "1.12.2", m.DEFAULTS = { noneSelectedText: "Nothing selected", noneResultsText: "No results matched {0}", countSelectedText: function (e, t) { return 1 == e ? "{0} item selected" : "{0} items selected" }, maxOptionsText: function (e, t) { return [1 == e ? "Limit reached ({n} item max)" : "Limit reached ({n} items max)", 1 == t ? "Group limit reached ({n} item max)" : "Group limit reached ({n} items max)"] }, selectAllText: "Select All", deselectAllText: "Deselect All", doneButton: !1, doneButtonText: "Close", multipleSeparator: ", ", styleBase: "btn", style: "btn-default", size: "auto", title: null, selectedTextFormat: "values", width: !1, container: !1, hideDisabled: !1, showSubtext: !1, showIcon: !0, showContent: !0, dropupAuto: !0, header: !1, liveSearch: !1, liveSearchPlaceholder: null, liveSearchNormalize: !1, liveSearchStyle: "contains", actionsBox: !1, iconBase: "glyphicon", tickIcon: "glyphicon-ok", showTick: !1, template: { caret: '<span class="caret"></span>' }, maxOptions: !1, mobile: !1, selectOnTab: !1, dropdownAlignRight: !1, windowPadding: 0 }, m.prototype = { constructor: m, init: function () { var t = this, i = this.$element.attr("id"); this.$element.addClass("bs-select-hidden"), this.liObj = {}, this.multiple = this.$element.prop("multiple"), this.autofocus = this.$element.prop("autofocus"), this.$newElement = this.createView(), this.$element.after(this.$newElement).appendTo(this.$newElement), this.$button = this.$newElement.children("button"), this.$menu = this.$newElement.children(".dropdown-menu"), this.$menuInner = this.$menu.children(".inner"), this.$searchbox = this.$menu.find("input"), this.$element.removeClass("bs-select-hidden"), !0 === this.options.dropdownAlignRight && this.$menu.addClass("dropdown-menu-right"), void 0 !== i && (this.$button.attr("data-id", i), e('label[for="' + i + '"]').click(function (e) { e.preventDefault(), t.$button.focus() })), this.checkDisabled(), this.clickListener(), this.options.liveSearch && this.liveSearchListener(), this.render(), this.setStyle(), this.setWidth(), this.options.container && this.selectPosition(), this.$menu.data("this", this), this.$newElement.data("this", this), this.options.mobile && this.mobile(), this.$newElement.on({ "hide.bs.dropdown": function (e) { t.$menuInner.attr("aria-expanded", !1), t.$element.trigger("hide.bs.select", e) }, "hidden.bs.dropdown": function (e) { t.$element.trigger("hidden.bs.select", e) }, "show.bs.dropdown": function (e) { t.$menuInner.attr("aria-expanded", !0), t.$element.trigger("show.bs.select", e) }, "shown.bs.dropdown": function (e) { t.$element.trigger("shown.bs.select", e) } }), t.$element[0].hasAttribute("required") && this.$element.on("invalid", function () { t.$button.addClass("bs-invalid").focus(), t.$element.on({ "focus.bs.select": function () { t.$button.focus(), t.$element.off("focus.bs.select") }, "shown.bs.select": function () { t.$element.val(t.$element.val()).off("shown.bs.select") }, "rendered.bs.select": function () { this.validity.valid && t.$button.removeClass("bs-invalid"), t.$element.off("rendered.bs.select") } }) }), setTimeout(function () { t.$element.trigger("loaded.bs.select") }) }, createDropdown: function () { var t = this.multiple || this.options.showTick ? " show-tick" : "", i = this.$element.parent().hasClass("input-group") ? " input-group-btn" : "", n = this.autofocus ? " autofocus" : "", s = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>' + this.options.header + "</div>" : "", o = this.options.liveSearch ? '<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"' + (null === this.options.liveSearchPlaceholder ? "" : ' placeholder="' + u(this.options.liveSearchPlaceholder) + '"') + ' role="textbox" aria-label="Search"></div>' : "", a = this.multiple && this.options.actionsBox ? '<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">' + this.options.selectAllText + '</button><button type="button" class="actions-btn bs-deselect-all btn btn-default">' + this.options.deselectAllText + "</button></div></div>" : "", l = this.multiple && this.options.doneButton ? '<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">' + this.options.doneButtonText + "</button></div></div>" : "", r = '<div class="btn-group bootstrap-select' + t + i + '"><button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + n + ' role="button"><span class="filter-option pull-left"></span>&nbsp;<span class="bs-caret">' + this.options.template.caret + '</span></button><div class="dropdown-menu open" role="combobox">' + s + o + a + '<ul class="dropdown-menu inner" role="listbox" aria-expanded="false"></ul>' + l + "</div></div>"; return e(r) }, createView: function () { var e = this.createDropdown(), t = this.createLi(); return e.find("ul")[0].innerHTML = t, e }, reloadLi: function () { var e = this.createLi(); this.$menuInner[0].innerHTML = e }, createLi: function () { var i = this, n = [], s = 0, o = document.createElement("option"), a = -1, l = function (e, t, i, n) { return "<li" + (void 0 !== i & "" !== i ? ' class="' + i + '"' : "") + (void 0 !== t & null !== t ? ' data-original-index="' + t + '"' : "") + (void 0 !== n & null !== n ? 'data-optgroup="' + n + '"' : "") + ">" + e + "</li>" }, r = function (n, s, o, a) { return '<a tabindex="0"' + (void 0 !== s ? ' class="' + s + '"' : "") + (o ? ' style="' + o + '"' : "") + (i.options.liveSearchNormalize ? ' data-normalized-text="' + t(u(e(n).html())) + '"' : "") + (void 0 !== a || null !== a ? ' data-tokens="' + a + '"' : "") + ' role="option">' + n + '<span class="' + i.options.iconBase + " " + i.options.tickIcon + ' check-mark"></span></a>' }; if (this.options.title && !this.multiple && (a--, !this.$element.find(".bs-title-option").length)) { var d = this.$element[0]; o.className = "bs-title-option", o.innerHTML = this.options.title, o.value = "", d.insertBefore(o, d.firstChild), void 0 === e(d.options[d.selectedIndex]).attr("selected") && void 0 === this.$element.data("selected") && (o.selected = !0) } return this.$element.find("option").each(function (t) { var o = e(this); if (a++, !o.hasClass("bs-title-option")) { var d = this.className || "", h = this.style.cssText, c = o.data("content") ? o.data("content") : o.html(), p = o.data("tokens") ? o.data("tokens") : null, f = void 0 !== o.data("subtext") ? '<small class="text-muted">' + o.data("subtext") + "</small>" : "", m = void 0 !== o.data("icon") ? '<span class="' + i.options.iconBase + " " + o.data("icon") + '"></span> ' : "", b = o.parent(), g = "OPTGROUP" === b[0].tagName, v = g && b[0].disabled, $ = this.disabled || v; if ("" !== m && $ && (m = "<span>" + m + "</span>"), i.options.hideDisabled && ($ && !g || v)) return void a--; if (o.data("content") || (c = m + '<span class="text">' + c + f + "</span>"), g && !0 !== o.data("divider")) { if (i.options.hideDisabled && $) { if (void 0 === b.data("allOptionsDisabled")) { var x = b.children(); b.data("allOptionsDisabled", x.filter(":disabled").length === x.length) } if (b.data("allOptionsDisabled")) return void a-- } var w = " " + b[0].className || ""; if (0 === o.index()) { s += 1; var C = b[0].label, y = void 0 !== b.data("subtext") ? '<small class="text-muted">' + b.data("subtext") + "</small>" : ""; C = (b.data("icon") ? '<span class="' + i.options.iconBase + " " + b.data("icon") + '"></span> ' : "") + '<span class="text">' + u(C) + y + "</span>", 0 !== t && n.length > 0 && (a++, n.push(l("", null, "divider", s + "div"))), a++, n.push(l(C, null, "dropdown-header" + w, s)) } if (i.options.hideDisabled && $) return void a--; n.push(l(r(c, "opt " + d + w, h, p), t, "", s)) } else if (!0 === o.data("divider")) n.push(l("", t, "divider")); else if (!0 === o.data("hidden")) n.push(l(r(c, d, h, p), t, "hidden is-hidden")); else { var S = this.previousElementSibling && "OPTGROUP" === this.previousElementSibling.tagName; if (!S && i.options.hideDisabled) for (var k = e(this).prevAll(), E = 0; E < k.length; E++) if ("OPTGROUP" === k[E].tagName) { for (var T = 0, I = 0; I < E; I++) { var z = k[I]; (z.disabled || !0 === e(z).data("hidden")) && T++ } T === E && (S = !0); break } S && (a++, n.push(l("", null, "divider", s + "div"))), n.push(l(r(c, d, h, p), t)) } i.liObj[t] = a } }), this.multiple || 0 !== this.$element.find("option:selected").length || this.options.title || this.$element.find("option").eq(0).prop("selected", !0).attr("selected", "selected"), n.join("") }, findLis: function () { return null == this.$lis && (this.$lis = this.$menu.find("li")), this.$lis }, render: function (t) { var i, n = this; !1 !== t && this.$element.find("option").each(function (e) { var t = n.findLis().eq(n.liObj[e]); n.setDisabled(e, this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled, t), n.setSelected(e, this.selected, t) }), this.togglePlaceholder(), this.tabIndex(); var s = this.$element.find("option").map(function () { if (this.selected) { if (n.options.hideDisabled && (this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled)) return; var t, i = e(this), s = i.data("icon") && n.options.showIcon ? '<i class="' + n.options.iconBase + " " + i.data("icon") + '"></i> ' : ""; return t = n.options.showSubtext && i.data("subtext") && !n.multiple ? ' <small class="text-muted">' + i.data("subtext") + "</small>" : "", void 0 !== i.attr("title") ? i.attr("title") : i.data("content") && n.options.showContent ? i.data("content").toString() : s + i.html() + t } }).toArray(), o = this.multiple ? s.join(this.options.multipleSeparator) : s[0]; if (this.multiple && this.options.selectedTextFormat.indexOf("count") > -1) { var a = this.options.selectedTextFormat.split(">"); if (a.length > 1 && s.length > a[1] || 1 == a.length && s.length >= 2) { i = this.options.hideDisabled ? ", [disabled]" : ""; var l = this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]' + i).length; o = ("function" == typeof this.options.countSelectedText ? this.options.countSelectedText(s.length, l) : this.options.countSelectedText).replace("{0}", s.length.toString()).replace("{1}", l.toString()) } } void 0 == this.options.title && (this.options.title = this.$element.attr("title")), "static" == this.options.selectedTextFormat && (o = this.options.title), o || (o = void 0 !== this.options.title ? this.options.title : this.options.noneSelectedText), this.$button.attr("title", f(e.trim(o.replace(/<[^>]*>?/g, "")))), this.$button.children(".filter-option").html(o), this.$element.trigger("rendered.bs.select") }, setStyle: function (e, t) { this.$element.attr("class") && this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, "")); var i = e || this.options.style; "add" == t ? this.$button.addClass(i) : "remove" == t ? this.$button.removeClass(i) : (this.$button.removeClass(this.options.style), this.$button.addClass(i)) }, liHeight: function (t) { if (t || !1 !== this.options.size && !this.sizeInfo) { var i = document.createElement("div"), n = document.createElement("div"), s = document.createElement("ul"), o = document.createElement("li"), a = document.createElement("li"), l = document.createElement("a"), r = document.createElement("span"), d = this.options.header && this.$menu.find(".popover-title").length > 0 ? this.$menu.find(".popover-title")[0].cloneNode(!0) : null, h = this.options.liveSearch ? document.createElement("div") : null, c = this.options.actionsBox && this.multiple && this.$menu.find(".bs-actionsbox").length > 0 ? this.$menu.find(".bs-actionsbox")[0].cloneNode(!0) : null, p = this.options.doneButton && this.multiple && this.$menu.find(".bs-donebutton").length > 0 ? this.$menu.find(".bs-donebutton")[0].cloneNode(!0) : null; if (r.className = "text", i.className = this.$menu[0].parentNode.className + " open", n.className = "dropdown-menu open", s.className = "dropdown-menu inner", o.className = "divider", r.appendChild(document.createTextNode("Inner text")), l.appendChild(r), a.appendChild(l), s.appendChild(a), s.appendChild(o), d && n.appendChild(d), h) { var u = document.createElement("input"); h.className = "bs-searchbox", u.className = "form-control", h.appendChild(u), n.appendChild(h) } c && n.appendChild(c), n.appendChild(s), p && n.appendChild(p), i.appendChild(n), document.body.appendChild(i); var f = l.offsetHeight, m = d ? d.offsetHeight : 0, b = h ? h.offsetHeight : 0, g = c ? c.offsetHeight : 0, v = p ? p.offsetHeight : 0, $ = e(o).outerHeight(!0), x = "function" == typeof getComputedStyle && getComputedStyle(n), w = x ? null : e(n), C = { vert: parseInt(x ? x.paddingTop : w.css("paddingTop")) + parseInt(x ? x.paddingBottom : w.css("paddingBottom")) + parseInt(x ? x.borderTopWidth : w.css("borderTopWidth")) + parseInt(x ? x.borderBottomWidth : w.css("borderBottomWidth")), horiz: parseInt(x ? x.paddingLeft : w.css("paddingLeft")) + parseInt(x ? x.paddingRight : w.css("paddingRight")) + parseInt(x ? x.borderLeftWidth : w.css("borderLeftWidth")) + parseInt(x ? x.borderRightWidth : w.css("borderRightWidth")) }, y = { vert: C.vert + parseInt(x ? x.marginTop : w.css("marginTop")) + parseInt(x ? x.marginBottom : w.css("marginBottom")) + 2, horiz: C.horiz + parseInt(x ? x.marginLeft : w.css("marginLeft")) + parseInt(x ? x.marginRight : w.css("marginRight")) + 2 }; document.body.removeChild(i), this.sizeInfo = { liHeight: f, headerHeight: m, searchHeight: b, actionsHeight: g, doneButtonHeight: v, dividerHeight: $, menuPadding: C, menuExtras: y } } }, setSize: function () { if (this.findLis(), this.liHeight(), this.options.header && this.$menu.css("padding-top", 0), !1 !== this.options.size) { var t, i, n, s, o, a, l, r, d = this, h = this.$menu, c = this.$menuInner, p = e(window), u = this.$newElement[0].offsetHeight, f = this.$newElement[0].offsetWidth, m = this.sizeInfo.liHeight, b = this.sizeInfo.headerHeight, g = this.sizeInfo.searchHeight, v = this.sizeInfo.actionsHeight, $ = this.sizeInfo.doneButtonHeight, x = this.sizeInfo.dividerHeight, w = this.sizeInfo.menuPadding, C = this.sizeInfo.menuExtras, y = this.options.hideDisabled ? ".disabled" : "", S = function () { var t, i = d.$newElement.offset(), n = e(d.options.container); d.options.container && !n.is("body") ? ((t = n.offset()).top += parseInt(n.css("borderTopWidth")), t.left += parseInt(n.css("borderLeftWidth"))) : t = { top: 0, left: 0 }; var s = d.options.windowPadding; o = i.top - t.top - p.scrollTop(), a = p.height() - o - u - t.top - s[2], l = i.left - t.left - p.scrollLeft(), r = p.width() - l - f - t.left - s[1], o -= s[0], l -= s[3] }; if (S(), "auto" === this.options.size) { var k = function () { var p, u = function (t, i) { return function (n) { return i ? n.classList ? n.classList.contains(t) : e(n).hasClass(t) : !(n.classList ? n.classList.contains(t) : e(n).hasClass(t)) } }, x = d.$menuInner[0].getElementsByTagName("li"), y = Array.prototype.filter ? Array.prototype.filter.call(x, u("hidden", !1)) : d.$lis.not(".hidden"), k = Array.prototype.filter ? Array.prototype.filter.call(y, u("dropdown-header", !0)) : y.filter(".dropdown-header"); S(), t = a - C.vert, i = r - C.horiz, d.options.container ? (h.data("height") || h.data("height", h.height()), n = h.data("height"), h.data("width") || h.data("width", h.width()), s = h.data("width")) : (n = h.height(), s = h.width()), d.options.dropupAuto && d.$newElement.toggleClass("dropup", o > a && t - C.vert < n), d.$newElement.hasClass("dropup") && (t = o - C.vert), "auto" === d.options.dropdownAlignRight && h.toggleClass("dropdown-menu-right", l > r && i - C.horiz < s - f), p = y.length + k.length > 3 ? 3 * m + C.vert - 2 : 0, h.css({ "max-height": t + "px", overflow: "hidden", "min-height": p + b + g + v + $ + "px" }), c.css({ "max-height": t - b - g - v - $ - w.vert + "px", "overflow-y": "auto", "min-height": Math.max(p - w.vert, 0) + "px" }) }; k(), this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize", k), p.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize", k) } else if (this.options.size && "auto" != this.options.size && this.$lis.not(y).length > this.options.size) { var E = this.$lis.not(".divider").not(y).children().slice(0, this.options.size).last().parent().index(), T = this.$lis.slice(0, E + 1).filter(".divider").length; t = m * this.options.size + T * x + w.vert, d.options.container ? (h.data("height") || h.data("height", h.height()), n = h.data("height")) : n = h.height(), d.options.dropupAuto && this.$newElement.toggleClass("dropup", o > a && t - C.vert < n), h.css({ "max-height": t + b + g + v + $ + "px", overflow: "hidden", "min-height": "" }), c.css({ "max-height": t - w.vert + "px", "overflow-y": "auto", "min-height": "" }) } } }, setWidth: function () { if ("auto" === this.options.width) { this.$menu.css("min-width", "0"); var e = this.$menu.parent().clone().appendTo("body"), t = this.options.container ? this.$newElement.clone().appendTo("body") : e, i = e.children(".dropdown-menu").outerWidth(), n = t.css("width", "auto").children("button").outerWidth(); e.remove(), t.remove(), this.$newElement.css("width", Math.max(i, n) + "px") } else "fit" === this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", "").addClass("fit-width")) : this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", this.options.width)) : (this.$menu.css("min-width", ""), this.$newElement.css("width", "")); this.$newElement.hasClass("fit-width") && "fit" !== this.options.width && this.$newElement.removeClass("fit-width") }, selectPosition: function () { this.$bsContainer = e('<div class="bs-container" />'); var t, i, n, s = this, o = e(this.options.container), a = function (e) { s.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi, "")).toggleClass("dropup", e.hasClass("dropup")), t = e.offset(), o.is("body") ? i = { top: 0, left: 0 } : ((i = o.offset()).top += parseInt(o.css("borderTopWidth")) - o.scrollTop(), i.left += parseInt(o.css("borderLeftWidth")) - o.scrollLeft()), n = e.hasClass("dropup") ? 0 : e[0].offsetHeight, s.$bsContainer.css({ top: t.top - i.top + n, left: t.left - i.left, width: e[0].offsetWidth }) }; this.$button.on("click", function () { var t = e(this); s.isDisabled() || (a(s.$newElement), s.$bsContainer.appendTo(s.options.container).toggleClass("open", !t.hasClass("open")).append(s.$menu)) }), e(window).on("resize scroll", function () { a(s.$newElement) }), this.$element.on("hide.bs.select", function () { s.$menu.data("height", s.$menu.height()), s.$bsContainer.detach() }) }, setSelected: function (e, t, i) { i || (this.togglePlaceholder(), i = this.findLis().eq(this.liObj[e])), i.toggleClass("selected", t).find("a").attr("aria-selected", t) }, setDisabled: function (e, t, i) { i || (i = this.findLis().eq(this.liObj[e])), t ? i.addClass("disabled").children("a").attr("href", "#").attr("tabindex", -1).attr("aria-disabled", !0) : i.removeClass("disabled").children("a").removeAttr("href").attr("tabindex", 0).attr("aria-disabled", !1) }, isDisabled: function () { return this.$element[0].disabled }, checkDisabled: function () { var e = this; this.isDisabled() ? (this.$newElement.addClass("disabled"), this.$button.addClass("disabled").attr("tabindex", -1).attr("aria-disabled", !0)) : (this.$button.hasClass("disabled") && (this.$newElement.removeClass("disabled"), this.$button.removeClass("disabled").attr("aria-disabled", !1)), -1 != this.$button.attr("tabindex") || this.$element.data("tabindex") || this.$button.removeAttr("tabindex")), this.$button.click(function () { return !e.isDisabled() }) }, togglePlaceholder: function () { var e = this.$element.val(); this.$button.toggleClass("bs-placeholder", null === e || "" === e || e.constructor === Array && 0 === e.length) }, tabIndex: function () { this.$element.data("tabindex") !== this.$element.attr("tabindex") && -98 !== this.$element.attr("tabindex") && "-98" !== this.$element.attr("tabindex") && (this.$element.data("tabindex", this.$element.attr("tabindex")), this.$button.attr("tabindex", this.$element.data("tabindex"))), this.$element.attr("tabindex", -98) }, clickListener: function () { var t = this, i = e(document); i.data("spaceSelect", !1), this.$button.on("keyup", function (e) { /(32)/.test(e.keyCode.toString(10)) && i.data("spaceSelect") && (e.preventDefault(), i.data("spaceSelect", !1)) }), this.$button.on("click", function () { t.setSize() }), this.$element.on("shown.bs.select", function () { if (t.options.liveSearch || t.multiple) { if (!t.multiple) { var e = t.liObj[t.$element[0].selectedIndex]; if ("number" != typeof e || !1 === t.options.size) return; var i = t.$lis.eq(e)[0].offsetTop - t.$menuInner[0].offsetTop; i = i - t.$menuInner[0].offsetHeight / 2 + t.sizeInfo.liHeight / 2, t.$menuInner[0].scrollTop = i } } else t.$menuInner.find(".selected a").focus() }), this.$menuInner.on("click", "li a", function (i) { var n = e(this), s = n.parent().data("originalIndex"), o = t.$element.val(), a = t.$element.prop("selectedIndex"), l = !0; if (t.multiple && 1 !== t.options.maxOptions && i.stopPropagation(), i.preventDefault(), !t.isDisabled() && !n.parent().hasClass("disabled")) { var r = t.$element.find("option"), d = r.eq(s), h = d.prop("selected"), p = d.parent("optgroup"), u = t.options.maxOptions, f = p.data("maxOptions") || !1; if (t.multiple) { if (d.prop("selected", !h), t.setSelected(s, !h), n.blur(), !1 !== u || !1 !== f) { var m = u < r.filter(":selected").length, b = f < p.find("option:selected").length; if (u && m || f && b) if (u && 1 == u) r.prop("selected", !1), d.prop("selected", !0), t.$menuInner.find(".selected").removeClass("selected"), t.setSelected(s, !0); else if (f && 1 == f) { p.find("option:selected").prop("selected", !1), d.prop("selected", !0); var g = n.parent().data("optgroup"); t.$menuInner.find('[data-optgroup="' + g + '"]').removeClass("selected"), t.setSelected(s, !0) } else { var v = "string" == typeof t.options.maxOptionsText ? [t.options.maxOptionsText, t.options.maxOptionsText] : t.options.maxOptionsText, $ = "function" == typeof v ? v(u, f) : v, x = $[0].replace("{n}", u), w = $[1].replace("{n}", f), C = e('<div class="notify"></div>'); $[2] && (x = x.replace("{var}", $[2][u > 1 ? 0 : 1]), w = w.replace("{var}", $[2][f > 1 ? 0 : 1])), d.prop("selected", !1), t.$menu.append(C), u && m && (C.append(e("<div>" + x + "</div>")), l = !1, t.$element.trigger("maxReached.bs.select")), f && b && (C.append(e("<div>" + w + "</div>")), l = !1, t.$element.trigger("maxReachedGrp.bs.select")), setTimeout(function () { t.setSelected(s, !1) }, 10), C.delay(750).fadeOut(300, function () { e(this).remove() }) } } } else r.prop("selected", !1), d.prop("selected", !0), t.$menuInner.find(".selected").removeClass("selected").find("a").attr("aria-selected", !1), t.setSelected(s, !0); !t.multiple || t.multiple && 1 === t.options.maxOptions ? t.$button.focus() : t.options.liveSearch && t.$searchbox.focus(), l && (o != t.$element.val() && t.multiple || a != t.$element.prop("selectedIndex") && !t.multiple) && (c = [s, d.prop("selected"), h], t.$element.triggerNative("change")) } }), this.$menu.on("click", "li.disabled a, .popover-title, .popover-title :not(.close)", function (i) { i.currentTarget == this && (i.preventDefault(), i.stopPropagation(), t.options.liveSearch && !e(i.target).hasClass("close") ? t.$searchbox.focus() : t.$button.focus()) }), this.$menuInner.on("click", ".divider, .dropdown-header", function (e) { e.preventDefault(), e.stopPropagation(), t.options.liveSearch ? t.$searchbox.focus() : t.$button.focus() }), this.$menu.on("click", ".popover-title .close", function () { t.$button.click() }), this.$searchbox.on("click", function (e) { e.stopPropagation() }), this.$menu.on("click", ".actions-btn", function (i) { t.options.liveSearch ? t.$searchbox.focus() : t.$button.focus(), i.preventDefault(), i.stopPropagation(), e(this).hasClass("bs-select-all") ? t.selectAll() : t.deselectAll() }), this.$element.change(function () { t.render(!1), t.$element.trigger("changed.bs.select", c), c = null }) }, liveSearchListener: function () { var i = this, n = e('<li class="no-results"></li>'); this.$button.on("click.dropdown.data-api", function () { i.$menuInner.find(".active").removeClass("active"), i.$searchbox.val() && (i.$searchbox.val(""), i.$lis.not(".is-hidden").removeClass("hidden"), n.parent().length && n.remove()), i.multiple || i.$menuInner.find(".selected").addClass("active"), setTimeout(function () { i.$searchbox.focus() }, 10) }), this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api", function (e) { e.stopPropagation() }), this.$searchbox.on("input propertychange", function () { if (i.$lis.not(".is-hidden").removeClass("hidden"), i.$lis.filter(".active").removeClass("active"), n.remove(), i.$searchbox.val()) { var s, o = i.$lis.not(".is-hidden, .divider, .dropdown-header"); if ((s = i.options.liveSearchNormalize ? o.find("a").not(":a" + i._searchStyle() + '("' + t(i.$searchbox.val()) + '")') : o.find("a").not(":" + i._searchStyle() + '("' + i.$searchbox.val() + '")')).length === o.length) n.html(i.options.noneResultsText.replace("{0}", '"' + u(i.$searchbox.val()) + '"')), i.$menuInner.append(n), i.$lis.addClass("hidden"); else { s.parent().addClass("hidden"); var a, l = i.$lis.not(".hidden"); l.each(function (t) { var i = e(this); i.hasClass("divider") ? void 0 === a ? i.addClass("hidden") : (a && a.addClass("hidden"), a = i) : i.hasClass("dropdown-header") && l.eq(t + 1).data("optgroup") !== i.data("optgroup") ? i.addClass("hidden") : a = null }), a && a.addClass("hidden"), o.not(".hidden").first().addClass("active") } } }) }, _searchStyle: function () { return { begins: "ibegins", startsWith: "ibegins" }[this.options.liveSearchStyle] || "icontains" }, val: function (e) { return void 0 !== e ? (this.$element.val(e), this.render(), this.$element) : this.$element.val() }, changeAll: function (t) { if (this.multiple) { void 0 === t && (t = !0), this.findLis(); var i = this.$element.find("option"), n = this.$lis.not(".divider, .dropdown-header, .disabled, .hidden"), s = n.length, o = []; if (t) { if (n.filter(".selected").length === n.length) return } else if (0 === n.filter(".selected").length) return; n.toggleClass("selected", t); for (var a = 0; a < s; a++) { var l = n[a].getAttribute("data-original-index"); o[o.length] = i.eq(l)[0] } e(o).prop("selected", t), this.render(!1), this.togglePlaceholder(), this.$element.triggerNative("change") } }, selectAll: function () { return this.changeAll(!0) }, deselectAll: function () { return this.changeAll(!1) }, toggle: function (e) { (e = e || window.event) && e.stopPropagation(), this.$button.trigger("click") }, keydown: function (i) { var n, s, o, a, l, r, d, h, c, p = e(this), u = p.is("input") ? p.parent().parent() : p.parent(), f = u.data("this"), m = ":not(.disabled, .hidden, .dropdown-header, .divider)", b = { 32: " ", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 65: "a", 66: "b", 67: "c", 68: "d", 69: "e", 70: "f", 71: "g", 72: "h", 73: "i", 74: "j", 75: "k", 76: "l", 77: "m", 78: "n", 79: "o", 80: "p", 81: "q", 82: "r", 83: "s", 84: "t", 85: "u", 86: "v", 87: "w", 88: "x", 89: "y", 90: "z", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9" }; if (f.options.liveSearch && (u = p.parent().parent()), f.options.container && (u = f.$menu), n = e('[role="listbox"] li', u), !(c = f.$newElement.hasClass("open")) && (i.keyCode >= 48 && i.keyCode <= 57 || i.keyCode >= 96 && i.keyCode <= 105 || i.keyCode >= 65 && i.keyCode <= 90)) return f.options.container ? f.$button.trigger("click") : (f.setSize(), f.$menu.parent().addClass("open"), c = !0), void f.$searchbox.focus(); if (f.options.liveSearch && (/(^9$|27)/.test(i.keyCode.toString(10)) && c && (i.preventDefault(), i.stopPropagation(), f.$menuInner.click(), f.$button.focus()), n = e('[role="listbox"] li' + m, u), p.val() || /(38|40)/.test(i.keyCode.toString(10)) || 0 === n.filter(".active").length && (n = f.$menuInner.find("li"), n = f.options.liveSearchNormalize ? n.filter(":a" + f._searchStyle() + "(" + t(b[i.keyCode]) + ")") : n.filter(":" + f._searchStyle() + "(" + b[i.keyCode] + ")"))), n.length) { if (/(38|40)/.test(i.keyCode.toString(10))) s = n.index(n.find("a").filter(":focus").parent()), a = n.filter(m).first().index(), l = n.filter(m).last().index(), o = n.eq(s).nextAll(m).eq(0).index(), r = n.eq(s).prevAll(m).eq(0).index(), d = n.eq(o).prevAll(m).eq(0).index(), f.options.liveSearch && (n.each(function (t) { e(this).hasClass("disabled") || e(this).data("index", t) }), s = n.index(n.filter(".active")), a = n.first().data("index"), l = n.last().data("index"), o = n.eq(s).nextAll().eq(0).data("index"), r = n.eq(s).prevAll().eq(0).data("index"), d = n.eq(o).prevAll().eq(0).data("index")), h = p.data("prevIndex"), 38 == i.keyCode ? (f.options.liveSearch && s--, s != d && s > r && (s = r), s < a && (s = a), s == h && (s = l)) : 40 == i.keyCode && (f.options.liveSearch && s++, -1 == s && (s = 0), s != d && s < o && (s = o), s > l && (s = l), s == h && (s = a)), p.data("prevIndex", s), f.options.liveSearch ? (i.preventDefault(), p.hasClass("dropdown-toggle") || (n.removeClass("active").eq(s).addClass("active").children("a").focus(), p.focus())) : n.eq(s).children("a").focus(); else if (!p.is("input")) { var g, v = []; n.each(function () { e(this).hasClass("disabled") || e.trim(e(this).children("a").text().toLowerCase()).substring(0, 1) == b[i.keyCode] && v.push(e(this).index()) }), g = e(document).data("keycount"), g++, e(document).data("keycount", g), e.trim(e(":focus").text().toLowerCase()).substring(0, 1) != b[i.keyCode] ? (g = 1, e(document).data("keycount", g)) : g >= v.length && (e(document).data("keycount", 0), g > v.length && (g = 1)), n.eq(v[g - 1]).children("a").focus() } if ((/(13|32)/.test(i.keyCode.toString(10)) || /(^9$)/.test(i.keyCode.toString(10)) && f.options.selectOnTab) && c) { if (/(32)/.test(i.keyCode.toString(10)) || i.preventDefault(), f.options.liveSearch) /(32) /.test(i.keyCode.toString(10)) || (f.$menuInner.find(".active a").click(), p.focus()); else { var $ = e(":focus"); $.click(), $.focus(), i.preventDefault(), e(document).data("spaceSelect", !0) } e(document).data("keycount", 0) } (/(^9$|27)/.test(i.keyCode.toString(10)) && c && (f.multiple || f.options.liveSearch) || /(27)/.test(i.keyCode.toString(10)) && !c) && (f.$menu.parent().removeClass("open"), f.options.container && f.$newElement.removeClass("open"), f.$button.focus()) } }, mobile: function () { this.$element.addClass("mobile-device") }, refresh: function () { this.$lis = null, this.liObj = {}, this.reloadLi(), this.render(), this.checkDisabled(), this.liHeight(!0), this.setStyle(), this.setWidth(), this.$lis && this.$searchbox.trigger("propertychange"), this.$element.trigger("refreshed.bs.select") }, hide: function () { this.$newElement.hide() }, show: function () { this.$newElement.show() }, remove: function () { this.$newElement.remove(), this.$element.remove() }, destroy: function () { this.$newElement.before(this.$element).remove(), this.$bsContainer ? this.$bsContainer.remove() : this.$menu.remove(), this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker") } }; var b = e.fn.selectpicker; e.fn.selectpicker = i, e.fn.selectpicker.Constructor = m, e.fn.selectpicker.noConflict = function () { return e.fn.selectpicker = b, this }, e(document).data("keycount", 0).on("keydown.bs.select", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', m.prototype.keydown).on("focusin.modal", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', function (e) { e.stopPropagation() }), e(window).on("load.bs.select.data-api", function () { e(".selectpicker").each(function () { var t = e(this); i.call(t, t.data()) }) }) }(e) });;!function (t, e, s) { "use strict"; var i, o, n = t.event; function a() { var t = ["webkit", "moz", "ms", "o"]; if ("hidden" in document) return "hidden"; for (var e = 0; e < t.length; e++) if (t[e] + "Hidden" in document) return t[e] + "Hidden"; return null } function r(t) { return 0 === Object.keys(t).length } i = n.special.debouncedresize = { setup: function () { t(this).on("resize", i.handler) }, teardown: function () { t(this).off("resize", i.handler) }, handler: function (t, e) { var s = this, a = arguments, r = function () { t.type = "debouncedresize", n.dispatch.apply(s, a) }; o && clearTimeout(o), e ? r() : o = setTimeout(r, i.threshold) }, threshold: 100 }, Array.prototype.shuffle = function () { for (var t, e, s = this.length; s--;) t = Math.floor(Math.random() * s), e = this[s], this[s] = this[t], this[t] = e; return this }; var h = t(e), d = e.Modernizr; t.GridRotator = function (e, s) { if (this.$el = t(s), d.backgroundsize) { this.$el.addClass("ri-grid-loading"), this._init(e) } }, t.GridRotator.defaults = { rows: 4, columns: 10, w992: { rows: 3, columns: 8 }, w768: { rows: 3, columns: 7 }, w480: { rows: 3, columns: 5 }, w320: { rows: 2, columns: 4 }, w240: { rows: 2, columns: 3 }, step: "random", maxStep: 3, preventClick: !0, animType: "random", animSpeed: 800, animEasingOut: "linear", animEasingIn: "linear", interval: 3e3, slideshow: !0, onhover: !1, nochange: [] }, t.GridRotator.prototype = { _init: function (e) { this.options = t.extend(!0, {}, t.GridRotator.defaults, e), this._config() }, _config: function () { var e = this; this.supportTransitions = d.csstransitions, this.supportTransforms3D = d.csstransforms3d, this.transEndEventName = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", msTransition: "MSTransitionEnd", transition: "transitionend" }[d.prefixed("transition")] + ".gridrotator", this.animTypes = this.supportTransforms3D ? ["fadeInOut", "slideLeft", "slideRight", "slideTop", "slideBottom", "rotateLeft", "rotateRight", "rotateTop", "rotateBottom", "rotate3d"] : ["fadeInOut", "slideLeft", "slideRight", "slideTop", "slideBottom"], this.animType = this.options.animType, "random" === this.animType || this.supportTransforms3D || -1 !== t.inArray(this.animType, this.animTypes) || "showHide" === this.animType || (this.animType = "fadeInOut"), this.animTypesTotal = this.animTypes.length, this.$list = this.$el.children("ul"); var s = 0, i = this.$list.find("img"), o = i.length; i.each(function () { var n = t(this), a = n.attr("src"); t("<img/>").load(function () { ++s, n.parent().css("background-image", "url(" + a + ")"), s === o && (i.remove(), e.$el.removeClass("ri-grid-loading"), e.$items = e.$list.children("li"), e.$itemsCache = e.$items.clone(), e.itemsTotal = e.$items.length, e.outItems = [], e._layout(function () { e._initEvents() }), e._start()) }).attr("src", a) }) }, _layout: function (e) { var s = this; this._setGridDim(), this.$list.empty(), this.$items = this.$itemsCache.clone().appendTo(this.$list); var i = this.$items.filter(":gt(" + (this.showTotal - 1) + ")"), o = i.children("a"); this.outItems.length = 0, o.each(function (e) { s.outItems.push(t(this)) }), i.remove(); for (var n = document.defaultView ? parseInt(document.defaultView.getComputedStyle(this.$el.get(0), null).width) : this.$el.width(), a = Math.floor(n / this.columns), r = n - this.columns * Math.floor(a), h = 0; h < this.rows; ++h) for (var d = 0; d < this.columns; ++d) { var c = this.columns * h + d, l = this.$items.eq(c); l.css({ width: d < Math.floor(r) ? a + 1 : a, height: a }), -1 !== t.inArray(c, this.options.nochange) && l.addClass("ri-nochange").data("nochange", !0) } this.options.preventClick && this.$items.children().css("cursor", "default").on("click.gridrotator", !1), e && e.call() }, _setGridDim: function () { var t = this.$el.width(); switch (!0) { case t < 240: this.rows = this.options.w240.rows, this.columns = this.options.w240.columns; break; case t < 320: this.rows = this.options.w320.rows, this.columns = this.options.w320.columns; break; case t < 480: this.rows = this.options.w480.rows, this.columns = this.options.w480.columns; break; case t < 768: this.rows = this.options.w768.rows, this.columns = this.options.w768.columns; break; case t < 992: this.rows = this.options.w992.rows, this.columns = this.options.w992.columns; break; default: this.rows = this.options.rows, this.columns = this.options.columns } this.showTotal = this.rows * this.columns }, _initEvents: function () { var e = this; h.on("debouncedresize.gridrotator", function () { e._layout() }); var s = a(); if (s) { var i = s.replace(/[H|h]idden/, "") + "visibilitychange"; document.addEventListener(i, function () { e._visChange() }) } !d.touch && this.options.onhover && e.$items.on("mouseenter.gridrotator", function () { var s = t(this); s.data("active") || s.data("hovered") || s.data("nochange") || (s.data("hovered", !0), e._replace(s)) }).on("mouseleave.gridrotator", function () { t(this).data("hovered", !1) }) }, _visChange: function () { var t; (t = a()) && document[t] ? clearTimeout(this.playtimeout) : this._start() }, _start: function () { this.showTotal < this.itemsTotal && this.options.slideshow && this._showNext() }, _getAnimType: function () { return "random" === this.animType ? this.animTypes[Math.floor(Math.random() * this.animTypesTotal)] : this.animType }, _getAnimProperties: function (t) { var e, s = {}, i = {}, o = {}, n = {}, a = 0; switch (this._getAnimType()) { case "showHide": e = 0, n.opacity = 0; break; case "fadeInOut": n.opacity = 0; break; case "slideLeft": s.left = t.width(), o.left = 0, n.left = -t.width(); break; case "slideRight": s.left = -t.width(), o.left = 0, n.left = t.width(); break; case "slideTop": s.top = t.height(), o.top = 0, n.top = -t.height(); break; case "slideBottom": s.top = -t.height(), o.top = 0, n.top = t.height(); break; case "rotateLeft": e = this.options.animSpeed / 2, s.transform = "rotateY(90deg)", o.transform = "rotateY(0deg)", a = e, n.transform = "rotateY(-90deg)"; break; case "rotateRight": e = this.options.animSpeed / 2, s.transform = "rotateY(-90deg)", o.transform = "rotateY(0deg)", a = e, n.transform = "rotateY(90deg)"; break; case "rotateTop": e = this.options.animSpeed / 2, s.transform = "rotateX(90deg)", o.transform = "rotateX(0deg)", a = e, n.transform = "rotateX(-90deg)"; break; case "rotateBottom": e = this.options.animSpeed / 2, s.transform = "rotateX(-90deg)", o.transform = "rotateX(0deg)", a = e, n.transform = "rotateX(90deg)"; break; case "scale": e = this.options.animSpeed / 2, s.transform = "scale(0)", i.transform = "scale(1)", o.transform = "scale(1)", a = e, n.transform = "scale(0)"; break; case "rotateLeftScale": i.transform = "scale(1)", e = this.options.animSpeed / 2, s.transform = "scale(0.3) rotateY(90deg)", o.transform = "scale(1) rotateY(0deg)", a = e, n.transform = "scale(0.3) rotateY(-90deg)"; break; case "rotateRightScale": i.transform = "scale(1)", e = this.options.animSpeed / 2, s.transform = "scale(0.3) rotateY(-90deg)", o.transform = "scale(1) rotateY(0deg)", a = e, n.transform = "scale(0.3) rotateY(90deg)"; break; case "rotateTopScale": i.transform = "scale(1)", e = this.options.animSpeed / 2, s.transform = "scale(0.3) rotateX(90deg)", o.transform = "scale(1) rotateX(0deg)", a = e, n.transform = "scale(0.3) rotateX(-90deg)"; break; case "rotateBottomScale": i.transform = "scale(1)", e = this.options.animSpeed / 2, s.transform = "scale(0.3) rotateX(-90deg)", o.transform = "scale(1) rotateX(0deg)", a = e, n.transform = "scale(0.3) rotateX(90deg)"; break; case "rotate3d": e = this.options.animSpeed / 2, s.transform = "rotate3d( 1, 1, 0, 90deg )", o.transform = "rotate3d( 1, 1, 0, 0deg )", a = e, n.transform = "rotate3d( 1, 1, 0, -90deg )" } return { startInProp: s, startOutProp: i, endInProp: o, endOutProp: n, delay: a, animSpeed: void 0 != e ? e : this.options.animSpeed } }, _showNext: function (t) { var e = this; clearTimeout(this.playtimeout), this.playtimeout = setTimeout(function () { var t = e.options.step, s = e.options.maxStep; s > e.showTotal && (s = e.showTotal); for (var i = "random" === t ? Math.floor(Math.random() * s + 1) : Math.min(Math.abs(t), s), o = e._getRandom(i, e.showTotal), n = 0; n < i; ++n) { var a = e.$items.eq(o[n]); if (a.data("active") || a.data("nochange")) return e._showNext(1), !1; e._replace(a) } e._showNext() }, t || Math.max(Math.abs(this.options.interval), 300)) }, _replace: function (e) { e.data("active", !0); var s = this, i = e.children("a:last"), o = { width: i.width(), height: i.height() }; e.data("active", !0); var n = this.outItems.shift(); this.outItems.push(i.clone().css("transition", "none")), n.css(o).prependTo(e); var a = this._getAnimProperties(i); n.css(a.startInProp), i.css(a.startOutProp), this._setTransition(n, "all", a.animSpeed, a.delay, this.options.animEasingIn), this._setTransition(i, "all", a.animSpeed, 0, this.options.animEasingOut), this._applyTransition(n, a.endInProp, a.animSpeed, function () { var e = t(this), i = a.animSpeed === s.options.animSpeed && r(a.endInProp) ? a.animSpeed : 0; setTimeout(function () { s.supportTransitions && e.off(s.transEndEventName), e.next().remove(), e.parent().data("active", !1) }, i) }, 0 === a.animSpeed || r(a.endInProp)), this._applyTransition(i, a.endOutProp, a.animSpeed) }, _getRandom: function (t, e) { for (var s = [], i = 0; i < e; ++i) s.push(i); return s.shuffle().slice(0, t) }, _setTransition: function (t, e, s, i, o) { setTimeout(function () { t.css("transition", e + " " + s + "ms " + i + "ms " + o) }, 25) }, _applyTransition: function (e, s, i, o, n) { var a = this; setTimeout(function () { t.fn.applyStyle = a.supportTransitions ? t.fn.css : t.fn.animate, o && a.supportTransitions && (e.on(a.transEndEventName, o), n && o.call(e)), o = o || function () { return !1 }, e.stop().applyStyle(s, t.extend(!0, [], { duration: i + "ms", complete: o })) }, 25) } }; var c = function (t) { e.console && e.console.error(t) }; t.fn.gridrotator = function (e) { var s = t.data(this, "gridrotator"); if ("string" == typeof e) { var i = Array.prototype.slice.call(arguments, 1); this.each(function () { s ? t.isFunction(s[e]) && "_" !== e.charAt(0) ? s[e].apply(s, i) : c("no such method '" + e + "' for gridrotator instance") : c("cannot call methods on gridrotator prior to initialization; attempted to call method '" + e + "'") }) } else this.each(function () { s ? s._init() : s = t.data(this, "gridrotator", new t.GridRotator(e, this)) }); return s } }(jQuery, window);;!function (e) { function t(a, n) { return this instanceof t ? (e.isPlainObject(a) ? n = a : (n = n || {}).alias = a, this.el = void 0, this.opts = e.extend(!0, {}, this.defaults, n), this.noMasksCache = n && void 0 !== n.definitions, this.userOptions = n || {}, this.events = {}, void i(this.opts.alias, n, this.opts)) : new t(a, n) } function i(t, a, n) { var r = n.aliases[t]; return r ? (r.alias && i(r.alias, void 0, n), e.extend(!0, n, r), e.extend(!0, n, a), !0) : (null === n.mask && (n.mask = t), !1) } function a(i, a) { function n(n, r) { if (null !== n && "" !== n) { if (1 === n.length && !1 === i.greedy && 0 !== i.repeat && (i.placeholder = ""), i.repeat > 0 || "*" === i.repeat || "+" === i.repeat) { var o = "*" === i.repeat ? 0 : "+" === i.repeat ? 1 : i.repeat; n = i.groupmarker.start + n + i.groupmarker.end + i.quantifiermarker.start + o + "," + i.repeat + i.quantifiermarker.end } var s; return void 0 === t.prototype.masksCache[n] || !0 === a ? (s = { mask: n, maskToken: function (t) { function a(e, t, i, a) { this.matches = [], this.isGroup = e || !1, this.isOptional = t || !1, this.isQuantifier = i || !1, this.isAlternator = a || !1, this.quantifier = { min: 1, max: 1 } } function n(t, a, n) { var r = i.definitions[a]; n = void 0 !== n ? n : t.matches.length; var o = t.matches[n - 1]; if (r && !v) { r.placeholder = e.isFunction(r.placeholder) ? r.placeholder(i) : r.placeholder; for (var s = r.prevalidator, l = s ? s.length : 0, u = 1; u < r.cardinality; u++) { var c = l >= u ? s[u - 1] : [], d = c.validator, p = c.cardinality; t.matches.splice(n++, 0, { fn: d ? "string" == typeof d ? new RegExp(d) : new function () { this.test = d } : new RegExp("."), cardinality: p || 1, optionality: t.isOptional, newBlockMarker: void 0 === o || o.def !== (r.definitionSymbol || a), casing: r.casing, def: r.definitionSymbol || a, placeholder: r.placeholder, mask: a }), o = t.matches[n - 1] } t.matches.splice(n++, 0, { fn: r.validator ? "string" == typeof r.validator ? new RegExp(r.validator) : new function () { this.test = r.validator } : new RegExp("."), cardinality: r.cardinality, optionality: t.isOptional, newBlockMarker: void 0 === o || o.def !== (r.definitionSymbol || a), casing: r.casing, def: r.definitionSymbol || a, placeholder: r.placeholder, mask: a }) } else t.matches.splice(n++, 0, { fn: null, cardinality: 0, optionality: t.isOptional, newBlockMarker: void 0 === o || o.def !== a, casing: null, def: i.staticDefinitionSymbol || a, placeholder: void 0 !== i.staticDefinitionSymbol ? a : void 0, mask: a }), v = !1 } function r(e, t) { e.isGroup && (e.isGroup = !1, n(e, i.groupmarker.start, 0), !0 !== t && n(e, i.groupmarker.end)) } function o(e, t, i, a) { t.matches.length > 0 && (void 0 === a || a) && r(t.matches[t.matches.length - 1]), n(t, e) } function s() { if (y.length > 0) { if (d = y[y.length - 1], o(u, d, 0, !d.isAlternator), d.isAlternator) { p = y.pop(); for (var e = 0; e < p.matches.length; e++) p.matches[e].isGroup = !1; y.length > 0 ? (d = y[y.length - 1]).matches.push(p) : g.matches.push(p) } } else o(u, g) } for (var l, u, c, d, p, f, m, h = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g, v = !1, g = new a, y = [], k = []; l = h.exec(t) ;) if (u = l[0], v) s(); else switch (u.charAt(0)) { case i.escapeChar: v = !0; break; case i.optionalmarker.end: case i.groupmarker.end: if (void 0 !== (c = y.pop())) if (y.length > 0) { if ((d = y[y.length - 1]).matches.push(c), d.isAlternator) { p = y.pop(); for (var x = 0; x < p.matches.length; x++) p.matches[x].isGroup = !1; y.length > 0 ? (d = y[y.length - 1]).matches.push(p) : g.matches.push(p) } } else g.matches.push(c); else s(); break; case i.optionalmarker.start: y.push(new a(!1, !0)); break; case i.groupmarker.start: y.push(new a(!0)); break; case i.quantifiermarker.start: var b = new a(!1, !1, !0), P = (u = u.replace(/[{}]/g, "")).split(","), S = isNaN(P[0]) ? P[0] : parseInt(P[0]), w = 1 === P.length ? S : isNaN(P[1]) ? P[1] : parseInt(P[1]); if (("*" === w || "+" === w) && (S = "*" === w ? 0 : 1), b.quantifier = { min: S, max: w }, y.length > 0) { var A = y[y.length - 1].matches; (l = A.pop()).isGroup || ((m = new a(!0)).matches.push(l), l = m), A.push(l), A.push(b) } else l = g.matches.pop(), l.isGroup || (m = new a(!0), m.matches.push(l), l = m), g.matches.push(l), g.matches.push(b); break; case i.alternatormarker: y.length > 0 ? (d = y[y.length - 1], f = d.matches.pop()) : f = g.matches.pop(), f.isAlternator ? y.push(f) : ((p = new a(!1, !1, !1, !0)).matches.push(f), y.push(p)); break; default: s() } for (; y.length > 0;) c = y.pop(), r(c, !0), g.matches.push(c); return g.matches.length > 0 && (r(f = g.matches[g.matches.length - 1]), k.push(g)), i.numericInput && function e(t) { t.matches = t.matches.reverse(); for (var a in t.matches) { var n = parseInt(a); if (t.matches[a].isQuantifier && t.matches[n + 1] && t.matches[n + 1].isGroup) { var r = t.matches[a]; t.matches.splice(a, 1), t.matches.splice(n + 1, 0, r) } void 0 !== t.matches[a].matches ? t.matches[a] = e(t.matches[a]) : t.matches[a] = ((o = t.matches[a]) === i.optionalmarker.start ? o = i.optionalmarker.end : o === i.optionalmarker.end ? o = i.optionalmarker.start : o === i.groupmarker.start ? o = i.groupmarker.end : o === i.groupmarker.end && (o = i.groupmarker.start), o) } var o; return t }(k[0]), k }(n), validPositions: {}, _buffer: void 0, buffer: void 0, tests: {}, metadata: r }, !0 !== a && (t.prototype.masksCache[i.numericInput ? n.split("").reverse().join("") : n] = s, s = e.extend(!0, {}, t.prototype.masksCache[i.numericInput ? n.split("").reverse().join("") : n]))) : s = e.extend(!0, {}, t.prototype.masksCache[i.numericInput ? n.split("").reverse().join("") : n]), s } } function r(e) { return e.toString() } var o; if (e.isFunction(i.mask) && (i.mask = i.mask(i)), e.isArray(i.mask)) { if (i.mask.length > 1) { i.keepStatic = null === i.keepStatic || i.keepStatic; var s = "("; return e.each(i.numericInput ? i.mask.reverse() : i.mask, function (t, i) { s.length > 1 && (s += ")|("), s += r(void 0 === i.mask || e.isFunction(i.mask) ? i : i.mask) }), n(s += ")", i.mask) } i.mask = i.mask.pop() } return i.mask && (o = void 0 === i.mask.mask || e.isFunction(i.mask.mask) ? n(r(i.mask), i.mask) : n(r(i.mask.mask), i.mask)), o } function n(i, a, r) { function u(e, t, i) { t = t || 0; var a, n, o, s = [], l = 0, u = p(); do { if (!0 === e && c().validPositions[l]) { var d = c().validPositions[l]; n = d.match, a = d.locator.slice(), s.push(!0 === i ? d.input : O(l, n)) } else o = h(l, a, l - 1), n = o.match, a = o.locator.slice(), (!1 === r.jitMasking || u > l || isFinite(r.jitMasking) && r.jitMasking > l) && s.push(O(l, n)); l++ } while ((void 0 === te || te > l - 1) && null !== n.fn || null === n.fn && "" !== n.def || t >= l); return "" === s[s.length - 1] && s.pop(), s } function c() { return a } function d(e) { var t = c(); t.buffer = void 0, !0 !== e && (t.tests = {}, t._buffer = void 0, t.validPositions = {}, t.p = 0) } function p(e, t) { var i = -1, a = -1, n = c().validPositions; void 0 === e && (e = -1); for (var r in n) { var o = parseInt(r); n[o] && (t || null !== n[o].match.fn) && (e >= o && (i = o), o >= e && (a = o)) } return -1 !== i && e - i > 1 || e > a ? i : a } function f(t, i, a, n) { if (n || r.insertMode && void 0 !== c().validPositions[t] && void 0 === a) { var o, s = e.extend(!0, {}, c().validPositions), l = p(); for (o = t; l >= o; o++) delete c().validPositions[o]; c().validPositions[t] = i; var u, f = !0, m = c().validPositions; for (o = u = t; l >= o; o++) { var h = s[o]; if (void 0 !== h) for (var v = u, y = -1; v < C() && (null == h.match.fn && m[o] && (!0 === m[o].match.optionalQuantifier || !0 === m[o].match.optionality) || null != h.match.fn) ;) if (null === h.match.fn || !r.keepStatic && m[o] && (void 0 !== m[o + 1] && k(o + 1, m[o].locator.slice(), o).length > 1 || void 0 !== m[o].alternation) ? v++ : v = E(u), g(v, h.match.def)) { var x = w(v, h.input, !0, !0); if (f = !1 !== x, u = x.caret || x.insert ? p() : v, f) break } else { if (f = null == h.match.fn, y === v) break; y = v } if (!f) break } if (!f) return c().validPositions = e.extend(!0, {}, s), d(!0), !1 } else c().validPositions[t] = i; return d(!0), !0 } function m(e, t, i, a) { function n(e) { var t = c().validPositions[e]; if (void 0 !== t && null === t.match.fn) { var i = c().validPositions[e - 1], a = c().validPositions[e + 1]; return void 0 !== i && void 0 !== a } return !1 } var o, s = e; for (c().p = e, o = t - 1; o >= s; o--) void 0 !== c().validPositions[o] && (!0 === i || !n(o) && !1 !== r.canClearPosition(c(), o, p(), a, r)) && delete c().validPositions[o]; for (d(!0), o = s + 1; o <= p() ;) { for (; void 0 !== c().validPositions[s];) s++; var l = c().validPositions[s]; if (s > o && (o = s + 1), void 0 === c().validPositions[o] && A(o) || void 0 !== l) o++; else { var u = h(o); g(s, u.match.def) ? !1 !== w(s, u.input || O(o), !0) && (delete c().validPositions[o], o++) : A(o) || (o++, s--), s++ } } d(!0) } function h(e, t, i) { var a = c().validPositions[e]; if (void 0 === a) for (var n = k(e, t, i), o = p(), s = c().validPositions[o] || k(0)[0], l = void 0 !== s.alternation ? s.locator[s.alternation].toString().split(",") : [], u = 0; u < n.length && (a = n[u], !(a.match && (r.greedy && !0 !== a.match.optionalQuantifier || (!1 === a.match.optionality || !1 === a.match.newBlockMarker) && !0 !== a.match.optionalQuantifier) && (void 0 === s.alternation || s.alternation !== a.alternation || void 0 !== a.locator[s.alternation] && S(a.locator[s.alternation].toString().split(","), l)))) ; u++); return a } function v(e) { return c().validPositions[e] ? c().validPositions[e].match : k(e)[0].match } function g(e, t) { for (var i = !1, a = k(e), n = 0; n < a.length; n++) if (a[n].match && a[n].match.def === t) { i = !0; break } return i } function y(t, i) { var a, n; return (c().tests[t] || c().validPositions[t]) && e.each(c().tests[t] || [c().validPositions[t]], function (e, t) { var r = t.alternation ? t.locator[t.alternation].toString().indexOf(i) : -1; (void 0 === n || n > r) && -1 !== r && (a = t, n = r) }), a } function k(t, i, a) { function n(i, a, o, s) { function u(o, s, m) { function h(t, i) { var a = 0 === e.inArray(t, i.matches); return a || e.each(i.matches, function (e, n) { return (!0 !== n.isQuantifier || !(a = h(t, i.matches[e - 1]))) && void 0 }), a } if (l > 1e4) throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + c().mask; if (l === t && void 0 === o.matches) return d.push({ match: o, locator: s.reverse(), cd: f }), !0; if (void 0 !== o.matches) { if (o.isGroup && m !== o) { if (o = u(i.matches[e.inArray(o, i.matches) + 1], s)) return !0 } else if (o.isOptional) { var v = o; if (o = n(o, a, s, m)) { if (!h(r = d[d.length - 1].match, v)) return !0; p = !0, l = t } } else if (o.isAlternator) { var g, k = o, x = [], b = d.slice(), P = s.length, S = a.length > 0 ? a.shift() : -1; if (-1 === S || "string" == typeof S) { var w, A = l, C = a.slice(), E = []; if ("string" == typeof S) E = S.split(","); else for (w = 0; w < k.matches.length; w++) E.push(w); for (var R = 0; R < E.length; R++) { if (w = parseInt(E[R]), d = [], G = void 0, G = y(l, w), a = G ? G.locator.slice(G.alternation + 1) : [], !0 !== (o = u(k.matches[w] || i.matches[w], [w].concat(s), m) || o) && void 0 !== o && E[E.length - 1] < k.matches.length) { var _ = e.inArray(o, i.matches) + 1; i.matches.length > _ && ((o = u(i.matches[_], [_].concat(s.slice(1, s.length)), m)) && (E.push(_.toString()), e.each(d, function (e, t) { t.alternation = s.length - 1 }))) } g = d.slice(), l = A, d = []; for (var O = 0; O < C.length; O++) a[O] = C[O]; for (var M = 0; M < g.length; M++) { var j = g[M]; j.alternation = j.alternation || P; for (var I = 0; I < x.length; I++) { var D = x[I]; if (j.match.def === D.match.def && ("string" != typeof S || -1 !== e.inArray(j.locator[j.alternation].toString(), E))) { j.match.mask === D.match.mask && (g.splice(M, 1), M--), -1 === D.locator[j.alternation].toString().indexOf(j.locator[j.alternation]) && (D.locator[j.alternation] = D.locator[j.alternation] + "," + j.locator[j.alternation], D.alternation = j.alternation); break } } } x = x.concat(g) } "string" == typeof S && (x = e.map(x, function (t, i) { if (isFinite(i)) { var a, n = t.alternation, r = t.locator[n].toString().split(","); t.locator[n] = void 0, t.alternation = void 0; for (var o = 0; o < r.length; o++) a = -1 !== e.inArray(r[o], E), a && (void 0 !== t.locator[n] ? (t.locator[n] += ",", t.locator[n] += r[o]) : t.locator[n] = parseInt(r[o]), t.alternation = n); if (void 0 !== t.locator[n]) return t } })), d = b.concat(x), l = t, p = d.length > 0 } else o = u(k.matches[S] || i.matches[S], [S].concat(s), m); if (o) return !0 } else if (o.isQuantifier && m !== i.matches[e.inArray(o, i.matches) - 1]) for (var F = o, T = a.length > 0 ? a.shift() : 0; T < (isNaN(F.quantifier.max) ? T + 1 : F.quantifier.max) && t >= l; T++) { var N = i.matches[e.inArray(F, i.matches) - 1]; if (o = u(N, [T].concat(s), N)) { if ((r = d[d.length - 1].match).optionalQuantifier = T > F.quantifier.min - 1, h(r, N)) { if (T > F.quantifier.min - 1) { p = !0, l = t; break } return !0 } return !0 } } else if (o = n(o, a, s, m)) return !0 } else l++; var G } for (var m = a.length > 0 ? a.shift() : 0; m < i.matches.length; m++) if (!0 !== i.matches[m].isQuantifier) { var h = u(i.matches[m], [m].concat(o), s); if (h && l === t) return h; if (l > t) break } } var r, o, s = c().maskToken, l = i ? a : 0, u = i || [0], d = [], p = !1, f = i ? i.join("") : ""; if (t > -1) { if (void 0 === i) { for (var m, h = t - 1; void 0 === (m = c().validPositions[h] || c().tests[h]) && h > -1;) h--; void 0 !== m && h > -1 && (u = ((o = m)[0] || o).locator.slice(), f = u.join(""), m = m[0] || m, l = h) } if (c().tests[t] && c().tests[t][0].cd === f) return c().tests[t]; for (var v = u.shift() ; v < s.length; v++) { if (n(s[v], u, [v]) && l === t || l > t) break } } return (0 === d.length || p) && d.push({ match: { fn: null, cardinality: 0, optionality: !0, casing: null, def: "" }, locator: [] }), c().tests[t] = e.extend(!0, [], d), c().tests[t] } function x() { return void 0 === c()._buffer && (c()._buffer = u(!1, 1)), c()._buffer } function b(e) { if (void 0 === c().buffer || !0 === e) { if (!0 === e) for (var t in c().tests) void 0 === c().validPositions[t] && delete c().tests[t]; c().buffer = u(!0, p(), !0) } return c().buffer } function P(e, t, i) { var a; if (i = i, !0 === e) d(), e = 0, t = i.length; else for (a = e; t > a; a++) delete c().validPositions[a], delete c().tests[a]; for (a = e; t > a; a++) d(!0), i[a] !== r.skipOptionalPartCharacter && w(a, i[a], !0, !0) } function S(t, i) { for (var a = r.greedy ? i : i.slice(0, 1), n = !1, o = 0; o < t.length; o++) if (-1 !== e.inArray(t[o], a)) { n = !0; break } return n } function w(i, a, n, o) { function s(e) { return ae ? e.begin - e.end > 1 || e.begin - e.end == 1 && r.insertMode : e.end - e.begin > 1 || e.end - e.begin == 1 && r.insertMode } function l(t, a, n, o) { var l = !1; return e.each(k(t), function (u, h) { for (var v = h.match, g = a ? 1 : 0, y = "", k = v.cardinality; k > g; k--) y += (x = t - (k - 1), void 0 === c().validPositions[x] ? O(x) : c().validPositions[x].input); var x; if (a && (y += a), b(!0), !1 !== (l = null != v.fn ? v.fn.test(y, c(), t, n, r, s(i)) : (a === v.def || a === r.skipOptionalPartCharacter) && "" !== v.def && { c: v.placeholder || v.def, pos: t })) { var S = void 0 !== l.c ? l.c : a; S = S === r.skipOptionalPartCharacter && null === v.fn ? v.placeholder || v.def : S; var A = t, C = b(); if (void 0 !== l.remove && (e.isArray(l.remove) || (l.remove = [l.remove]), e.each(l.remove.sort(function (e, t) { return t - e }), function (e, t) { m(t, t + 1, !0) })), void 0 !== l.insert && (e.isArray(l.insert) || (l.insert = [l.insert]), e.each(l.insert.sort(function (e, t) { return e - t }), function (e, t) { w(t.pos, t.c, !1, o) })), l.refreshFromBuffer) { var E = l.refreshFromBuffer; if (n = !0, P(!0 === E ? E : E.start, E.end, C), void 0 === l.pos && void 0 === l.c) return l.pos = p(), !1; if ((A = void 0 !== l.pos ? l.pos : t) !== t) return l = e.extend(l, w(A, S, !0, o)), !1 } else if (!0 !== l && void 0 !== l.pos && l.pos !== t && (A = l.pos, P(t, A, b().slice()), A !== t)) return l = e.extend(l, w(A, S, !0)), !1; return (!0 === l || void 0 !== l.pos || void 0 !== l.c) && (u > 0 && d(!0), f(A, e.extend({}, h, { input: function (e, t) { switch (t.casing) { case "upper": e = e.toUpperCase(); break; case "lower": e = e.toLowerCase() } return e }(S, v) }), o, s(i)) || (l = !1), !1) } }), l } function u(t, i) { for (var a = c().validPositions[i].locator, n = a.length, r = t; i > r; r++) if (void 0 === c().validPositions[r] && !A(r, !0)) { var o = k(r), s = o[0], l = -1; e.each(o, function (e, t) { for (var i = 0; n > i && void 0 !== t.locator[i] && S(t.locator[i].toString().split(","), a[i].toString().split(",")) ; i++) i > l && (l = i, s = t) }), f(r, e.extend({}, s, { input: s.match.placeholder || s.match.def }), !0) } } n = !0 === n; var v, g = i; void 0 !== i.begin && (g = ae && !s(i) ? i.end : i.begin); for (var x = !1, R = e.extend(!0, {}, c().validPositions), _ = g - 1; _ > -1 && !c().validPositions[_]; _--); for (_++; g > _; _++) void 0 === c().validPositions[_] && ((v = h(_)).match.def === r.radixPointDefinitionSymbol || !A(_, !0) || e.inArray(r.radixPoint, b()) < _ && v.match.fn && v.match.fn.test(O(_), c(), _, !1, r)) && l(p() + 1, v.match.placeholder || (null == v.match.fn ? v.match.def : "" !== O(_) ? O(_) : b()[_]), !0, o); if (s(i) && (N(void 0, t.keyCode.DELETE, i), g = c().p), g < C() && (x = l(g, a, n, o), (!n || !0 === o) && !1 === x)) { var M = c().validPositions[g]; if (!M || null !== M.match.fn || M.match.def !== a && a !== r.skipOptionalPartCharacter) { if ((r.insertMode || void 0 === c().validPositions[E(g)]) && !A(g, !0)) { var j = h(g).match; l(g, j = j.placeholder || j.def, n, o); for (var I = g + 1, D = E(g) ; D >= I; I++) if (x = l(I, a, n, o), !1 !== x) { u(g, I), g = I; break } } } else x = { caret: E(g) } } return !1 === x && r.keepStatic && (x = function (t, i, a, n) { for (var o, s, l, u, f, m, v = e.extend(!0, {}, c().validPositions), g = e.extend(!0, {}, c().tests), k = p() ; k >= 0 && (!(u = c().validPositions[k]) || void 0 === u.alternation || (o = k, s = c().validPositions[o].alternation, h(o).locator[u.alternation] === u.locator[u.alternation])) ; k--); if (void 0 !== s) { o = parseInt(o); for (var x in c().validPositions) if (x = parseInt(x), u = c().validPositions[x], x >= o && void 0 !== u.alternation) { var b; 0 === o ? (b = [], e.each(c().tests[o], function (e, t) { void 0 !== t.locator[s] && (b = b.concat(t.locator[s].toString().split(","))) })) : b = c().validPositions[o].locator[s].toString().split(","); var P = void 0 !== u.locator[s] ? u.locator[s] : b[0]; P.length > 0 && (P = P.split(",")[0]); for (var S = 0; S < b.length; S++) { var A = [], C = 0, E = 0; if (P < b[S]) { for (var R, _, M = x; M >= 0; M--) if (R = c().validPositions[M], void 0 !== R) { var j = y(M, b[S]); c().validPositions[M].match.def !== j.match.def && (A.push(c().validPositions[M].input), c().validPositions[M] = j, c().validPositions[M].input = O(M), null === c().validPositions[M].match.fn && E++, R = j), _ = R.locator[s], R.locator[s] = parseInt(b[S]); break } if (P !== R.locator[s]) { for (f = x + 1; f < p(void 0, !0) + 1; f++) m = c().validPositions[f], m && null != m.match.fn ? A.push(m.input) : t > f && C++, delete c().validPositions[f], delete c().tests[f]; for (d(!0), r.keepStatic = !r.keepStatic, l = !0; A.length > 0;) { var I = A.shift(); if (I !== r.skipOptionalPartCharacter && !(l = w(p(void 0, !0) + 1, I, !1, n))) break } if (R.alternation = s, R.locator[s] = _, l) { var D = p(t) + 1; for (f = x + 1; f < p() + 1; f++) m = c().validPositions[f], (void 0 === m || null == m.match.fn) && t > f && E++; l = w((t += E - C) > D ? D : t, i, a, n) } if (r.keepStatic = !r.keepStatic, l) return l; d(), c().validPositions = e.extend(!0, {}, v), c().tests = e.extend(!0, {}, g) } } } break } } return !1 }(g, a, n, o)), !0 === x && (x = { pos: g }), e.isFunction(r.postValidation) && !1 !== x && !n && !0 !== o && (x = !!r.postValidation(b(!0), x, r) && x), void 0 === x.pos && (x.pos = g), !1 === x && (d(!0), c().validPositions = e.extend(!0, {}, R)), x } function A(e, t) { var i; return t ? "" === (i = h(e).match).def && (i = v(e)) : i = v(e), null != i.fn ? i.fn : !0 !== t && e > -1 && !r.keepStatic && void 0 === c().validPositions[e] && k(e).length > 2 } function C() { var e; -1 === (te = void 0 !== J ? J.maxLength : void 0) && (te = void 0); var t, i = p(), a = c().validPositions[i], n = void 0 !== a ? a.locator.slice() : void 0; for (t = i + 1; void 0 === a || null !== a.match.fn || null === a.match.fn && "" !== a.match.def; t++) a = h(t, n, t - 1), n = a.locator.slice(); return e = "" !== v(t - 1).def ? t : t - 1, void 0 === te || te > e ? e : te } function E(e, t) { var i = C(); if (e >= i) return i; for (var a = e; ++a < i && (!0 === t && (!0 !== v(a).newBlockMarker || !A(a)) || !0 !== t && !A(a) && (!0 !== r.nojumps || r.nojumpsThreshold > a)) ;); return a } function R(e, t) { var i = e; if (0 >= i) return 0; for (; --i > 0 && (!0 === t && !0 !== v(i).newBlockMarker || !0 !== t && !A(i)) ;); return i } function _(t, i, a, n, o) { if (n && e.isFunction(r.onBeforeWrite)) { var s = r.onBeforeWrite(n, i, a, r); if (s) { if (s.refreshFromBuffer) { var l = s.refreshFromBuffer; P(!0 === l ? l : l.start, l.end, s.buffer || i), i = b(!0) } void 0 !== a && (a = void 0 !== s.caret ? s.caret : a) } } t.inputmask._valueSet(i.join("")), void 0 === a || void 0 !== n && "blur" === n.type || I(t, a), !0 === o && (re = !0, e(t).trigger("input")) } function O(e, t) { if (void 0 !== (t = t || v(e)).placeholder) return t.placeholder; if (null === t.fn) { if (e > -1 && !r.keepStatic && void 0 === c().validPositions[e]) { var i, a = k(e), n = 0; if (a.length > 2) for (var o = 0; o < a.length; o++) if (!0 !== a[o].match.optionality && !0 !== a[o].match.optionalQuantifier && (null === a[o].match.fn || void 0 === i || !1 !== a[o].match.fn.test(i.match.def, c(), e, !0, r)) && (n++, null === a[o].match.fn && (i = a[o]), n > 1)) return r.placeholder.charAt(e % r.placeholder.length) } return t.def } return r.placeholder.charAt(e % r.placeholder.length) } function M(i, a, n, o) { var s, l = o.slice(), u = "", f = 0; if (d(), c().p = E(-1), !n) if (!0 !== r.autoUnmask) { var m = x().slice(0, E(-1)).join(""), v = l.join("").match(new RegExp("^" + t.escapeRegex(m), "g")); v && v.length > 0 && (l.splice(0, v.length * m.length), f = E(f)) } else f = E(f); e.each(l, function (t, a) { if (void 0 !== a) { var o = new e.Event("keypress"); o.which = a.charCodeAt(0), u += a; var l = p(void 0, !0), m = c().validPositions[l], v = h(l + 1, m ? m.locator.slice() : void 0, l); if (!function () { var e = !1, t = x().slice(f, E(f)).join("").indexOf(u); if (-1 !== t && !A(f)) { e = !0; for (var i = x().slice(f, f + t), a = 0; a < i.length; a++) if (" " !== i[a]) { e = !1; break } } return e }() || n || r.autoUnmask) { var g = n ? t : null == v.match.fn && v.match.optionality && l + 1 < c().p ? l + 1 : c().p; s = B.call(i, o, !0, !1, n, g), f = g + 1, u = "" } else s = B.call(i, o, !0, !1, !0, l + 1); if (!n && e.isFunction(r.onBeforeWrite) && ((s = r.onBeforeWrite(o, b(), s.forwardPosition, r)) && s.refreshFromBuffer)) { var y = s.refreshFromBuffer; P(!0 === y ? y : y.start, y.end, s.buffer), d(!0), s.caret && (c().p = s.caret) } } }), a && _(i, b(), document.activeElement === i ? E(p(0)) : void 0, new e.Event("checkval")) } function j(t) { if (t && void 0 === t.inputmask) return t.value; var i = [], a = c().validPositions; for (var n in a) a[n].match && null != a[n].match.fn && i.push(a[n].input); var o = 0 === i.length ? null : (ae ? i.reverse() : i).join(""); if (null !== o) { var s = (ae ? b().slice().reverse() : b()).join(""); e.isFunction(r.onUnMask) && (o = r.onUnMask(s, o, r) || o) } return o } function I(e, t, i, a) { function n(e) { !0 === a || !ae || "number" != typeof e || r.greedy && "" === r.placeholder || (e = b().join("").length - e); return e } var s; if ("number" != typeof t) return e.setSelectionRange ? (t = e.selectionStart, i = e.selectionEnd) : window.getSelection ? (s = window.getSelection().getRangeAt(0), (s.commonAncestorContainer.parentNode === e || s.commonAncestorContainer === e) && (t = s.startOffset, i = s.endOffset)) : document.selection && document.selection.createRange && (s = document.selection.createRange(), t = 0 - s.duplicate().moveStart("character", -e.inputmask._valueGet().length), i = t + s.text.length), { begin: n(t), end: n(i) }; t = n(t), i = "number" == typeof (i = n(i)) ? i : t; var l = parseInt(((e.ownerDocument.defaultView || window).getComputedStyle ? (e.ownerDocument.defaultView || window).getComputedStyle(e, null) : e.currentStyle).fontSize) * i; if (e.scrollLeft = l > e.scrollWidth ? l : 0, o || !1 !== r.insertMode || t !== i || i++, e.setSelectionRange) e.selectionStart = t, e.selectionEnd = i; else if (window.getSelection) { if (s = document.createRange(), void 0 === e.firstChild || null === e.firstChild) { var u = document.createTextNode(""); e.appendChild(u) } s.setStart(e.firstChild, t < e.inputmask._valueGet().length ? t : e.inputmask._valueGet().length), s.setEnd(e.firstChild, i < e.inputmask._valueGet().length ? i : e.inputmask._valueGet().length), s.collapse(!0); var c = window.getSelection(); c.removeAllRanges(), c.addRange(s) } else e.createTextRange && (s = e.createTextRange(), s.collapse(!0), s.moveEnd("character", i), s.moveStart("character", t), s.select()) } function D(t) { var i, a, n = b(), r = n.length, o = p(), s = {}, l = c().validPositions[o], u = void 0 !== l ? l.locator.slice() : void 0; for (i = o + 1; i < n.length; i++) a = h(i, u, i - 1), u = a.locator.slice(), s[i] = e.extend(!0, {}, a); var d = l && void 0 !== l.alternation ? l.locator[l.alternation] : void 0; for (i = r - 1; i > o && (((a = s[i]).match.optionality || a.match.optionalQuantifier || d && (d !== s[i].locator[l.alternation] && null != a.match.fn || null === a.match.fn && a.locator[l.alternation] && S(a.locator[l.alternation].toString().split(","), d.toString().split(",")) && "" !== k(i)[0].def)) && n[i] === O(i, a.match)) ; i--) r--; return t ? { l: r, def: s[r] ? s[r].match : void 0 } : r } function F(e) { for (var t = D(), i = e.length - 1; i > t && !A(i) ; i--); return e.splice(t, i + 1 - t), e } function T(t) { if (e.isFunction(r.isComplete)) return r.isComplete(t, r); if ("*" !== r.repeat) { var i = !1, a = D(!0), n = R(a.l); if (void 0 === a.def || a.def.newBlockMarker || a.def.optionality || a.def.optionalQuantifier) { i = !0; for (var o = 0; n >= o; o++) { var s = h(o).match; if (null !== s.fn && void 0 === c().validPositions[o] && !0 !== s.optionality && !0 !== s.optionalQuantifier || null === s.fn && t[o] !== O(o, s)) { i = !1; break } } } return i } } function N(i, a, n, o) { if ((r.numericInput || ae) && (a === t.keyCode.BACKSPACE ? a = t.keyCode.DELETE : a === t.keyCode.DELETE && (a = t.keyCode.BACKSPACE), ae)) { var s = n.end; n.end = n.begin, n.begin = s } a === t.keyCode.BACKSPACE && (n.end - n.begin < 1 || !1 === r.insertMode) ? (n.begin = R(n.begin), void 0 === c().validPositions[n.begin] || c().validPositions[n.begin].input !== r.groupSeparator && c().validPositions[n.begin].input !== r.radixPoint || n.begin--) : a === t.keyCode.DELETE && n.begin === n.end && (n.end = A(n.end) ? n.end + 1 : E(n.end) + 1, void 0 === c().validPositions[n.begin] || c().validPositions[n.begin].input !== r.groupSeparator && c().validPositions[n.begin].input !== r.radixPoint || n.end++), m(n.begin, n.end, !1, o), !0 !== o && function () { if (r.keepStatic) { d(!0); var t, a = [], n = e.extend(!0, {}, c().validPositions); for (t = p() ; t >= 0; t--) { var o = c().validPositions[t]; if (o && (null != o.match.fn && a.push(o.input), delete c().validPositions[t], void 0 !== o.alternation && o.locator[o.alternation] === h(t).locator[o.alternation])) break } if (t > -1) for (; a.length > 0;) { c().p = E(p()); var s = new e.Event("keypress"); s.which = a.pop().charCodeAt(0), B.call(i, s, !0, !1, !1, c().p) } else c().validPositions = e.extend(!0, {}, n) } }(); var l = p(n.begin); l < n.begin ? (-1 === l && d(), c().p = E(l)) : !0 !== o && (c().p = n.begin) } function G(i) { var a, n, o, s, u = this, d = e(u), f = i.keyCode, m = I(u); if (f === t.keyCode.BACKSPACE || f === t.keyCode.DELETE || l && f === t.keyCode.BACKSPACE_SAFARI || i.ctrlKey && f === t.keyCode.X && (a = "cut", n = document.createElement("input"), (s = (o = "on" + a) in n) || (n.setAttribute(o, "return;"), s = "function" == typeof n[o]), n = null, !s)) i.preventDefault(), N(u, f, m), _(u, b(), c().p, i, X !== b().join("")), u.inputmask._valueGet() === x().join("") ? d.trigger("cleared") : !0 === T(b()) && d.trigger("complete"), r.showTooltip && (u.title = r.tooltip || c().mask); else if (f === t.keyCode.END || f === t.keyCode.PAGE_DOWN) { i.preventDefault(); var h = E(p()); r.insertMode || h !== C() || i.shiftKey || h--, I(u, i.shiftKey ? m.begin : h, h, !0) } else f === t.keyCode.HOME && !i.shiftKey || f === t.keyCode.PAGE_UP ? (i.preventDefault(), I(u, 0, i.shiftKey ? m.begin : 0, !0)) : (r.undoOnEscape && f === t.keyCode.ESCAPE || 90 === f && i.ctrlKey) && !0 !== i.altKey ? (M(u, !0, !1, X.split("")), d.trigger("click")) : f !== t.keyCode.INSERT || i.shiftKey || i.ctrlKey ? !0 === r.tabThrough && f === t.keyCode.TAB ? (!0 === i.shiftKey ? (null === v(m.begin).fn && (m.begin = E(m.begin)), m.end = R(m.begin, !0), m.begin = R(m.end, !0)) : (m.begin = E(m.begin, !0), m.end = E(m.begin, !0), m.end < C() && m.end--), m.begin < C() && (i.preventDefault(), I(u, m.begin, m.end))) : !1 !== r.insertMode || i.shiftKey || (f === t.keyCode.RIGHT ? setTimeout(function () { var e = I(u); I(u, e.begin) }, 0) : f === t.keyCode.LEFT && setTimeout(function () { var e = I(u); I(u, ae ? e.begin + 1 : e.begin - 1) }, 0)) : (r.insertMode = !r.insertMode, I(u, r.insertMode || m.begin !== C() ? m.begin : m.begin - 1)); r.onKeyDown.call(this, i, b(), I(u).begin, r), oe = -1 !== e.inArray(f, r.ignorables) } function B(i, a, n, o, s) { var l = e(this), u = i.which || i.charCode || i.keyCode; if (!(!0 === a || i.ctrlKey && i.altKey) && (i.ctrlKey || i.metaKey || oe)) return u === t.keyCode.ENTER && X !== b().join("") && (X = b().join(""), setTimeout(function () { l.trigger("change") }, 0)), !0; if (u) { 46 === u && !1 === i.shiftKey && "," === r.radixPoint && (u = 44); var p, f = a ? { begin: s, end: s } : I(this), m = String.fromCharCode(u); c().writeOutBuffer = !0; var h = w(f, m, o); if (!1 !== h) { var v = h.pos; if (d(!0), void 0 !== h.caret) p = h.caret; else { var g = c().validPositions; p = !r.keepStatic && (void 0 !== g[v + 1] && k(v + 1, g[v].locator.slice(), v).length > 1 || void 0 !== g[v].alternation) ? v + 1 : E(v) } c().p = p } if (!1 !== n) { var y = this; if (setTimeout(function () { r.onKeyValidation.call(y, u, h, r) }, 0), c().writeOutBuffer && !1 !== h) { var x = b(); _(this, x, r.numericInput && void 0 === h.caret ? R(p) : p, i, !0 !== a), !0 !== a && setTimeout(function () { !0 === T(x) && l.trigger("complete") }, 0) } } if (r.showTooltip && (this.title = r.tooltip || c().mask), i.preventDefault(), a) return h.forwardPosition = p, h } } function K(t) { var i, a = this, n = t.originalEvent || t, o = e(a), s = a.inputmask._valueGet(!0), l = I(a); ae && (i = l.end, l.end = l.begin, l.begin = i); var u = s.substr(0, l.begin), c = s.substr(l.end, s.length); u === (ae ? x().reverse() : x()).slice(0, l.begin).join("") && (u = ""), c === (ae ? x().reverse() : x()).slice(l.end).join("") && (c = ""), ae && (i = u, u = c, c = i), window.clipboardData && window.clipboardData.getData ? s = u + window.clipboardData.getData("Text") + c : n.clipboardData && n.clipboardData.getData && (s = u + n.clipboardData.getData("text/plain") + c); var d = s; if (e.isFunction(r.onBeforePaste)) { if (!1 === (d = r.onBeforePaste(s, r))) return t.preventDefault(); d || (d = s) } return M(a, !1, !1, ae ? d.split("").reverse() : d.toString().split("")), _(a, b(), E(p()), t, !0), !0 === T(b()) && o.trigger("complete"), t.preventDefault() } function L(i) { var a = this, n = a.inputmask._valueGet(); if (b().join("") !== n) { var r = I(a); if (n = n.replace(new RegExp("(" + t.escapeRegex(x().join("")) + ")*"), ""), s) { var o = n.replace(b().join(""), ""); if (1 === o.length) { var l = new e.Event("keypress"); return l.which = o.charCodeAt(0), B.call(a, l, !0, !0, !1, c().validPositions[r.begin - 1] ? r.begin : r.begin - 1), !1 } } if (r.begin > n.length && (I(a, n.length), r = I(a)), b().length - n.length != 1 || n.charAt(r.begin) === b()[r.begin] || n.charAt(r.begin + 1) === b()[r.begin] || A(r.begin)) { for (var u = p() + 1, d = b().slice(u).join("") ; null === n.match(t.escapeRegex(d) + "$") ;) d = d.slice(1); M(a, !0, !1, n = (n = n.replace(d, "")).split("")), !0 === T(b()) && e(a).trigger("complete") } else i.keyCode = t.keyCode.BACKSPACE, G.call(a, i); i.preventDefault() } } function U(t) { var i = this.inputmask._valueGet(); M(this, !0, !1, (e.isFunction(r.onBeforeMask) && r.onBeforeMask(i, r) || i).split("")), X = b().join(""), (r.clearMaskOnLostFocus || r.clearIncomplete) && this.inputmask._valueGet() === x().join("") && this.inputmask._valueSet("") } function H(e) { var t = this, i = t.inputmask._valueGet(); r.showMaskOnFocus && (!r.showMaskOnHover || r.showMaskOnHover && "" === i) ? t.inputmask._valueGet() !== b().join("") && _(t, b(), E(p())) : !1 === se && I(t, E(p())), !0 === r.positionCaretOnTab && setTimeout(function () { I(t, E(p())) }, 0), X = b().join("") } function Q(e) { if (se = !1, r.clearMaskOnLostFocus && document.activeElement !== this) { var t = b().slice(), i = this.inputmask._valueGet(); i !== this.getAttribute("placeholder") && "" !== i && (-1 === p() && i === x().join("") ? t = [] : F(t), _(this, t)) } } function q(t) { var i = this; setTimeout(function () { if (document.activeElement === i) { var t = I(i); if (t.begin === t.end) if (function (t) { if (r.radixFocus && "" !== r.radixPoint) { var i = c().validPositions; if (void 0 === i[t] || i[t].input === O(t)) { if (t < E(-1)) return !0; var a = e.inArray(r.radixPoint, b()); if (-1 !== a) { for (var n in i) if (n > a && i[n].input !== O(n)) return !1; return !0 } } } return !1 }(t.begin)) I(i, r.numericInput ? E(e.inArray(r.radixPoint, b())) : e.inArray(r.radixPoint, b())); else { var a = t.begin, n = E(p(a, !0)); if (n > a) I(i, A(a) || A(a - 1) ? a : E(a)); else { var o = O(n); ("" !== o && b()[n] !== o || !A(n, !0) && v(n).def === o) && (n = E(n)), I(i, n) } } } }, 0) } function V(e) { var t = this; setTimeout(function () { I(t, 0, E(p())) }, 0) } function z(i) { var a = this, n = e(a), o = I(a), s = i.originalEvent || i, l = window.clipboardData || s.clipboardData, u = ae ? b().slice(o.end, o.begin) : b().slice(o.begin, o.end); l.setData("text", ae ? u.reverse().join("") : u.join("")), document.execCommand && document.execCommand("copy"), N(a, t.keyCode.DELETE, o), _(a, b(), c().p, i, X !== b().join("")), a.inputmask._valueGet() === x().join("") && n.trigger("cleared"), r.showTooltip && (a.title = r.tooltip || c().mask) } function W(t) { var i = e(this); if (this.inputmask) { var a = this.inputmask._valueGet(), n = b().slice(); X !== n.join("") && setTimeout(function () { i.trigger("change"), X = n.join("") }, 0), "" !== a && (r.clearMaskOnLostFocus && (-1 === p() && a === x().join("") ? n = [] : F(n)), !1 === T(n) && (setTimeout(function () { i.trigger("incomplete") }, 0), r.clearIncomplete && (d(), n = r.clearMaskOnLostFocus ? [] : x().slice())), _(this, n, void 0, t)) } } function Y(e) { se = !0, document.activeElement !== this && r.showMaskOnHover && this.inputmask._valueGet() !== b().join("") && _(this, b()) } function $(e) { X !== b().join("") && ee.trigger("change"), r.clearMaskOnLostFocus && -1 === p() && J.inputmask._valueGet && J.inputmask._valueGet() === x().join("") && J.inputmask._valueSet(""), r.removeMaskOnSubmit && (J.inputmask._valueSet(J.inputmask.unmaskedvalue(), !0), setTimeout(function () { _(J, b()) }, 0)) } function Z(e) { setTimeout(function () { ee.trigger("setvalue") }, 0) } var X, J, ee, te, ie, ae = !1, ne = !1, re = !1, oe = !1, se = !0, le = { on: function (i, a, n) { var o = function (i) { if (void 0 === this.inputmask && "FORM" !== this.nodeName) { var a = e.data(this, "_inputmask_opts"); a ? new t(a).mask(this) : le.off(this) } else { if ("setvalue" === i.type || !(this.disabled || this.readOnly && !("keydown" === i.type && i.ctrlKey && 67 === i.keyCode || !1 === r.tabThrough && i.keyCode === t.keyCode.TAB))) { switch (i.type) { case "input": if (!0 === re) return re = !1, i.preventDefault(); break; case "keydown": ne = !1, re = !1; break; case "keypress": if (!0 === ne) return i.preventDefault(); ne = !0; break; case "click": if (s) { var o = this; return setTimeout(function () { n.apply(o, arguments) }, 0), !1 } } var l = n.apply(this, arguments); return !1 === l && (i.preventDefault(), i.stopPropagation()), l } i.preventDefault() } }; i.inputmask.events[a] = i.inputmask.events[a] || [], i.inputmask.events[a].push(o), -1 !== e.inArray(a, ["submit", "reset"]) ? null != i.form && e(i.form).on(a, o) : e(i).on(a, o) }, off: function (t, i) { var a; t.inputmask && t.inputmask.events && (i ? (a = [])[i] = t.inputmask.events[i] : a = t.inputmask.events, e.each(a, function (i, a) { for (; a.length > 0;) { var n = a.pop(); -1 !== e.inArray(i, ["submit", "reset"]) ? null != t.form && e(t.form).off(i, n) : e(t).off(i, n) } delete t.inputmask.events[i] })) } }; if (void 0 !== i) switch (i.action) { case "isComplete": return J = i.el, T(b()); case "unmaskedvalue": return void 0 !== (J = i.el) && void 0 !== J.inputmask ? (a = J.inputmask.maskset, r = J.inputmask.opts, ae = J.inputmask.isRTL) : (ie = i.value, r.numericInput && (ae = !0), ie = (e.isFunction(r.onBeforeMask) && r.onBeforeMask(ie, r) || ie).split(""), M(void 0, !1, !1, ae ? ie.reverse() : ie), e.isFunction(r.onBeforeWrite) && r.onBeforeWrite(void 0, b(), 0, r)), j(J); case "mask": J = i.el, a = J.inputmask.maskset, r = J.inputmask.opts, ae = J.inputmask.isRTL, X = b().join(""), function (t) { if (ee = e(J = t), r.showTooltip && (J.title = r.tooltip || c().mask), ("rtl" === J.dir || r.rightAlign) && (J.style.textAlign = "right"), ("rtl" === J.dir || r.numericInput) && (J.dir = "ltr", J.removeAttribute("dir"), J.inputmask.isRTL = !0, ae = !0), le.off(J), function (t) { function i() { return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== p() ? document.activeElement === this && r.clearMaskOnLostFocus ? (ae ? F(b().slice()).reverse() : F(b().slice())).join("") : n.call(this) : "" : n.call(this) } function a(t) { o.call(this, t), this.inputmask && e(this).trigger("setvalue") } var n, o, s; if (!t.inputmask.__valueGet) { if (Object.getOwnPropertyDescriptor) { var l = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), "value") : void 0; l && l.get && l.set ? (n = l.get, o = l.set, Object.defineProperty(t, "value", { get: i, set: a, configurable: !0 })) : "INPUT" !== t.tagName && (n = function () { return this.textContent }, o = function (e) { this.textContent = e }, Object.defineProperty(t, "value", { get: i, set: a, configurable: !0 })) } else document.__lookupGetter__ && t.__lookupGetter__("value") && (n = t.__lookupGetter__("value"), o = t.__lookupSetter__("value"), t.__defineGetter__("value", i), t.__defineSetter__("value", a)); void 0 === n && (n = function () { return t.value }, o = function (e) { t.value = e }, function (t) { if (e.valHooks && (void 0 === e.valHooks[t] || !0 !== e.valHooks[t].inputmaskpatch)) { var i = e.valHooks[t] && e.valHooks[t].get ? e.valHooks[t].get : function (e) { return e.value }, a = e.valHooks[t] && e.valHooks[t].set ? e.valHooks[t].set : function (e, t) { return e.value = t, e }; e.valHooks[t] = { get: function (e) { if (e.inputmask) { if (e.inputmask.opts.autoUnmask) return e.inputmask.unmaskedvalue(); var t = i(e); return -1 !== p() ? t : "" } return i(e) }, set: function (t, i) { var n, r = e(t); return n = a(t, i), t.inputmask && r.trigger("setvalue"), n }, inputmaskpatch: !0 } } }(t.type), s = t, le.on(s, "mouseenter", function (t) { var i = e(this); this.inputmask._valueGet() !== b().join("") && i.trigger("setvalue") })), t.inputmask.__valueGet = n, t.inputmask._valueGet = function (e) { return ae && !0 !== e ? n.call(this.el).split("").reverse().join("") : n.call(this.el) }, t.inputmask.__valueSet = o, t.inputmask._valueSet = function (e, t) { o.call(this.el, null === e || void 0 === e ? "" : !0 !== t && ae ? e.split("").reverse().join("") : e) } } }(J), function (t, i) { var a = t.getAttribute("type"), n = "INPUT" === t.tagName && -1 !== e.inArray(a, i.supportsInputType) || t.isContentEditable || "TEXTAREA" === t.tagName; if (!n && "INPUT" === t.tagName) { var r = document.createElement("input"); r.setAttribute("type", a), n = "text" === r.type, r = null } return n }(J, r) && (le.on(J, "submit", $), le.on(J, "reset", Z), le.on(J, "mouseenter", Y), le.on(J, "blur", W), le.on(J, "focus", H), le.on(J, "mouseleave", Q), le.on(J, "click", q), le.on(J, "dblclick", V), le.on(J, "paste", K), le.on(J, "dragdrop", K), le.on(J, "drop", K), le.on(J, "cut", z), le.on(J, "complete", r.oncomplete), le.on(J, "incomplete", r.onincomplete), le.on(J, "cleared", r.oncleared), le.on(J, "keydown", G), le.on(J, "keypress", B), le.on(J, "input", L)), le.on(J, "setvalue", U), "" !== J.inputmask._valueGet() || !1 === r.clearMaskOnLostFocus || document.activeElement === J) { var i = e.isFunction(r.onBeforeMask) && r.onBeforeMask(J.inputmask._valueGet(), r) || J.inputmask._valueGet(); M(J, !0, !1, i.split("")); var a = b().slice(); X = a.join(""), !1 === T(a) && r.clearIncomplete && d(), r.clearMaskOnLostFocus && document.activeElement !== J && (-1 === p() ? a = [] : F(a)), _(J, a), document.activeElement === J && I(J, E(p())) } }(J); break; case "format": return r.numericInput && (ae = !0), ie = (e.isFunction(r.onBeforeMask) && r.onBeforeMask(i.value, r) || i.value).split(""), M(void 0, !1, !1, ae ? ie.reverse() : ie), e.isFunction(r.onBeforeWrite) && r.onBeforeWrite(void 0, b(), 0, r), i.metadata ? { value: ae ? b().slice().reverse().join("") : b().join(""), metadata: n({ action: "getmetadata" }, a, r) } : ae ? b().slice().reverse().join("") : b().join(""); case "isValid": r.numericInput && (ae = !0), i.value ? (ie = i.value.split(""), M(void 0, !1, !0, ae ? ie.reverse() : ie)) : i.value = b().join(""); for (var ue = b(), ce = D(), de = ue.length - 1; de > ce && !A(de) ; de--); return ue.splice(ce, de + 1 - ce), T(ue) && i.value === b().join(""); case "getemptymask": return x().join(""); case "remove": J = i.el, ee = e(J), a = J.inputmask.maskset, r = J.inputmask.opts, J.inputmask._valueSet(j(J)), le.off(J), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(J), "value") && J.inputmask.__valueGet && Object.defineProperty(J, "value", { get: J.inputmask.__valueGet, set: J.inputmask.__valueSet, configurable: !0 }) : document.__lookupGetter__ && J.__lookupGetter__("value") && J.inputmask.__valueGet && (J.__defineGetter__("value", J.inputmask.__valueGet), J.__defineSetter__("value", J.inputmask.__valueSet)), J.inputmask = void 0; break; case "getmetadata": if (e.isArray(a.metadata)) { for (var pe, fe = p(void 0, !0) ; fe >= 0; fe--) if (c().validPositions[fe] && void 0 !== c().validPositions[fe].alternation) { pe = c().validPositions[fe].alternation; break } return void 0 !== pe ? a.metadata[c().validPositions[fe].locator[pe]] : [] } return a.metadata } } t.prototype = { defaults: { placeholder: "_", optionalmarker: { start: "[", end: "]" }, quantifiermarker: { start: "{", end: "}" }, groupmarker: { start: "(", end: ")" }, alternatormarker: "|", escapeChar: "\\", mask: null, oncomplete: e.noop, onincomplete: e.noop, oncleared: e.noop, repeat: 0, greedy: !0, autoUnmask: !1, removeMaskOnSubmit: !1, clearMaskOnLostFocus: !0, insertMode: !0, clearIncomplete: !1, aliases: {}, alias: null, onKeyDown: e.noop, onBeforeMask: null, onBeforePaste: function (t, i) { return e.isFunction(i.onBeforeMask) ? i.onBeforeMask(t, i) : t }, onBeforeWrite: null, onUnMask: null, showMaskOnFocus: !0, showMaskOnHover: !0, onKeyValidation: e.noop, skipOptionalPartCharacter: " ", showTooltip: !1, tooltip: void 0, numericInput: !1, rightAlign: !1, undoOnEscape: !0, radixPoint: "", radixPointDefinitionSymbol: void 0, groupSeparator: "", radixFocus: !1, nojumps: !1, nojumpsThreshold: 0, keepStatic: null, positionCaretOnTab: !1, tabThrough: !1, supportsInputType: ["text", "tel", "password"], definitions: { 9: { validator: "[0-9]", cardinality: 1, definitionSymbol: "*" }, a: { validator: "[A-Za-zА-яЁёÀ-ÿµ]", cardinality: 1, definitionSymbol: "*" }, "*": { validator: "[0-9A-Za-zА-яЁёÀ-ÿµ]", cardinality: 1 } }, ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123], isComplete: null, canClearPosition: e.noop, postValidation: null, staticDefinitionSymbol: void 0, jitMasking: !1 }, masksCache: {}, mask: function (r) { var o = this; return "string" == typeof r && (r = document.getElementById(r) || document.querySelectorAll(r)), r = r.nodeName ? [r] : r, e.each(r, function (r, s) { var l = e.extend(!0, {}, o.opts); !function (t, a, n) { function r(e, i) { null !== (i = void 0 !== i ? i : t.getAttribute("data-inputmask-" + e)) && ("string" == typeof i && (0 === e.indexOf("on") ? i = window[i] : "false" === i ? i = !1 : "true" === i && (i = !0)), n[e] = i) } var o, s, l, u, c = t.getAttribute("data-inputmask"); if (c && "" !== c && (c = c.replace(new RegExp("'", "g"), '"'), s = JSON.parse("{" + c + "}")), s) { l = void 0; for (u in s) if ("alias" === u.toLowerCase()) { l = s[u]; break } } r("alias", l), n.alias && i(n.alias, n, a); for (o in a) { if (s) { l = void 0; for (u in s) if (u.toLowerCase() === o.toLowerCase()) { l = s[u]; break } } r(o, l) } e.extend(!0, a, n) }(s, l, e.extend(!0, {}, o.userOptions)); var u = a(l, o.noMasksCache); void 0 !== u && (void 0 !== s.inputmask && s.inputmask.remove(), s.inputmask = new t, s.inputmask.opts = l, s.inputmask.noMasksCache = o.noMasksCache, s.inputmask.userOptions = e.extend(!0, {}, o.userOptions), s.inputmask.el = s, s.inputmask.maskset = u, s.inputmask.isRTL = !1, e.data(s, "_inputmask_opts", l), n({ action: "mask", el: s })) }), r && r[0] && r[0].inputmask || this }, option: function (t) { return "string" == typeof t ? this.opts[t] : "object" == typeof t ? (e.extend(this.opts, t), e.extend(this.userOptions, t), this.el && (void 0 !== t.mask || void 0 !== t.alias ? this.mask(this.el) : (e.data(this.el, "_inputmask_opts", this.opts), n({ action: "mask", el: this.el }))), this) : void 0 }, unmaskedvalue: function (e) { return n({ action: "unmaskedvalue", el: this.el, value: e }, this.el && this.el.inputmask ? this.el.inputmask.maskset : a(this.opts, this.noMasksCache), this.opts) }, remove: function () { return this.el ? (n({ action: "remove", el: this.el }), this.el.inputmask = void 0, this.el) : void 0 }, getemptymask: function () { return n({ action: "getemptymask" }, this.maskset || a(this.opts, this.noMasksCache), this.opts) }, hasMaskedValue: function () { return !this.opts.autoUnmask }, isComplete: function () { return n({ action: "isComplete", el: this.el }, this.maskset || a(this.opts, this.noMasksCache), this.opts) }, getmetadata: function () { return n({ action: "getmetadata" }, this.maskset || a(this.opts, this.noMasksCache), this.opts) }, isValid: function (e) { return n({ action: "isValid", value: e }, this.maskset || a(this.opts, this.noMasksCache), this.opts) }, format: function (e, t) { return n({ action: "format", value: e, metadata: t }, this.maskset || a(this.opts, this.noMasksCache), this.opts) } }, t.extendDefaults = function (i) { e.extend(!0, t.prototype.defaults, i) }, t.extendDefinitions = function (i) { e.extend(!0, t.prototype.defaults.definitions, i) }, t.extendAliases = function (i) { e.extend(!0, t.prototype.defaults.aliases, i) }, t.format = function (e, i, a) { return t(i).format(e, a) }, t.unmask = function (e, i) { return t(i).unmaskedvalue(e) }, t.isValid = function (e, i) { return t(i).isValid(e) }, t.remove = function (t) { e.each(t, function (e, t) { t.inputmask && t.inputmask.remove() }) }, t.escapeRegex = function (e) { return e.replace(new RegExp("(\\" + ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^"].join("|\\") + ")", "gim"), "\\$1") }, t.keyCode = { ALT: 18, BACKSPACE: 8, BACKSPACE_SAFARI: 127, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91, X: 88 }; var r = navigator.userAgent, o = /mobile/i.test(r), s = /iemobile/i.test(r), l = /iphone/i.test(r) && !s; /android.*safari.*/i.test(r), window.Inputmask = t }(jQuery), function (e, t) { void 0 === e.fn.inputmask && (e.fn.inputmask = function (i, a) { var n, r = this[0]; if (void 0 === a && (a = {}), "string" == typeof i) switch (i) { case "unmaskedvalue": return r && r.inputmask ? r.inputmask.unmaskedvalue() : e(r).val(); case "remove": return this.each(function () { this.inputmask && this.inputmask.remove() }); case "getemptymask": return r && r.inputmask ? r.inputmask.getemptymask() : ""; case "hasMaskedValue": return !(!r || !r.inputmask) && r.inputmask.hasMaskedValue(); case "isComplete": return !r || !r.inputmask || r.inputmask.isComplete(); case "getmetadata": return r && r.inputmask ? r.inputmask.getmetadata() : void 0; case "setvalue": e(r).val(a), r && void 0 !== r.inputmask && e(r).triggerHandler("setvalue"); break; case "option": if ("string" != typeof a) return this.each(function () { return void 0 !== this.inputmask ? this.inputmask.option(a) : void 0 }); if (r && void 0 !== r.inputmask) return r.inputmask.option(a); break; default: return a.alias = i, n = new t(a), this.each(function () { n.mask(this) }) } else { if ("object" == typeof i) return n = new t(i), void 0 === i.mask && void 0 === i.alias ? this.each(function () { return void 0 !== this.inputmask ? this.inputmask.option(i) : void n.mask(this) }) : this.each(function () { n.mask(this) }); if (void 0 === i) return this.each(function () { (n = new t(a)).mask(this) }) } }), e.fn.inputmask }(jQuery, Inputmask), function (e, t) { t.extendDefinitions({ h: { validator: "[01][0-9]|2[0-3]", cardinality: 2, prevalidator: [{ validator: "[0-2]", cardinality: 1 }] }, s: { validator: "[0-5][0-9]", cardinality: 2, prevalidator: [{ validator: "[0-5]", cardinality: 1 }] }, d: { validator: "0[1-9]|[12][0-9]|3[01]", cardinality: 2, prevalidator: [{ validator: "[0-3]", cardinality: 1 }] }, m: { validator: "0[1-9]|1[012]", cardinality: 2, prevalidator: [{ validator: "[01]", cardinality: 1 }] }, y: { validator: "(19|20)\\d{2}", cardinality: 4, prevalidator: [{ validator: "[12]", cardinality: 1 }, { validator: "(19|20)", cardinality: 2 }, { validator: "(19|20)\\d", cardinality: 3 }] } }), t.extendAliases({ "dd/mm/yyyy": { mask: "1/2/y", placeholder: "dd/mm/yyyy", regex: { val1pre: new RegExp("[0-3]"), val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), val2pre: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + i + "[01])") }, val2: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|[12][0-9])" + i + "(0[1-9]|1[012]))|(30" + i + "(0[13-9]|1[012]))|(31" + i + "(0[13578]|1[02]))") } }, leapday: "29/02/", separator: "/", yearrange: { minyear: 1900, maxyear: 2099 }, isInYearRange: function (e, t, i) { if (isNaN(e)) return !1; var a = parseInt(e.concat(t.toString().slice(e.length))), n = parseInt(e.concat(i.toString().slice(e.length))); return !isNaN(a) && (a >= t && i >= a) || !isNaN(n) && (n >= t && i >= n) }, determinebaseyear: function (e, t, i) { var a = (new Date).getFullYear(); if (e > a) return e; if (a > t) { for (var n = t.toString().slice(0, 2), r = t.toString().slice(2, 4) ; n + i > t;) n--; var o = n + r; return e > o ? e : o } if (a >= e && t >= a) { for (var s = a.toString().slice(0, 2) ; s + i > t;) s--; var l = s + i; return e > l ? e : l } return a }, onKeyDown: function (i, a, n, r) { var o = e(this); if (i.ctrlKey && i.keyCode === t.keyCode.RIGHT) { var s = new Date; o.val(s.getDate().toString() + (s.getMonth() + 1).toString() + s.getFullYear().toString()), o.trigger("setvalue") } }, getFrontValue: function (e, t, i) { for (var a = 0, n = 0, r = 0; r < e.length && "2" !== e.charAt(r) ; r++) { var o = i.definitions[e.charAt(r)]; o ? (a += n, n = o.cardinality) : n++ } return t.join("").substr(a, n) }, definitions: { 1: { validator: function (e, t, i, a, n) { var r = n.regex.val1.test(e); return a || r || e.charAt(1) !== n.separator && -1 === "-./".indexOf(e.charAt(1)) || !(r = n.regex.val1.test("0" + e.charAt(0))) ? r : (t.buffer[i - 1] = "0", { refreshFromBuffer: { start: i - 1, end: i }, pos: i, c: e.charAt(0) }) }, cardinality: 2, prevalidator: [{ validator: function (e, t, i, a, n) { var r = e; isNaN(t.buffer[i + 1]) || (r += t.buffer[i + 1]); var o = 1 === r.length ? n.regex.val1pre.test(r) : n.regex.val1.test(r); if (!a && !o) { if (o = n.regex.val1.test(e + "0")) return t.buffer[i] = e, t.buffer[++i] = "0", { pos: i, c: "0" }; if (o = n.regex.val1.test("0" + e)) return t.buffer[i] = "0", i++, { pos: i } } return o }, cardinality: 1 }] }, 2: { validator: function (e, t, i, a, n) { var r = n.getFrontValue(t.mask, t.buffer, n); -1 !== r.indexOf(n.placeholder[0]) && (r = "01" + n.separator); var o = n.regex.val2(n.separator).test(r + e); if (!a && !o && (e.charAt(1) === n.separator || -1 !== "-./".indexOf(e.charAt(1))) && (o = n.regex.val2(n.separator).test(r + "0" + e.charAt(0)))) return t.buffer[i - 1] = "0", { refreshFromBuffer: { start: i - 1, end: i }, pos: i, c: e.charAt(0) }; if (n.mask.indexOf("2") === n.mask.length - 1 && o) { if (t.buffer.join("").substr(4, 4) + e !== n.leapday) return !0; var s = parseInt(t.buffer.join("").substr(0, 4), 10); return s % 4 == 0 && (s % 100 != 0 || s % 400 == 0) } return o }, cardinality: 2, prevalidator: [{ validator: function (e, t, i, a, n) { isNaN(t.buffer[i + 1]) || (e += t.buffer[i + 1]); var r = n.getFrontValue(t.mask, t.buffer, n); -1 !== r.indexOf(n.placeholder[0]) && (r = "01" + n.separator); var o = 1 === e.length ? n.regex.val2pre(n.separator).test(r + e) : n.regex.val2(n.separator).test(r + e); return a || o || !(o = n.regex.val2(n.separator).test(r + "0" + e)) ? o : (t.buffer[i] = "0", { pos: ++i }) }, cardinality: 1 }] }, y: { validator: function (e, t, i, a, n) { if (n.isInYearRange(e, n.yearrange.minyear, n.yearrange.maxyear)) { if (t.buffer.join("").substr(0, 6) !== n.leapday) return !0; var r = parseInt(e, 10); return r % 4 == 0 && (r % 100 != 0 || r % 400 == 0) } return !1 }, cardinality: 4, prevalidator: [{ validator: function (e, t, i, a, n) { var r = n.isInYearRange(e, n.yearrange.minyear, n.yearrange.maxyear); if (!a && !r) { var o = n.determinebaseyear(n.yearrange.minyear, n.yearrange.maxyear, e + "0").toString().slice(0, 1); if (r = n.isInYearRange(o + e, n.yearrange.minyear, n.yearrange.maxyear)) return t.buffer[i++] = o.charAt(0), { pos: i }; if (o = n.determinebaseyear(n.yearrange.minyear, n.yearrange.maxyear, e + "0").toString().slice(0, 2), r = n.isInYearRange(o + e, n.yearrange.minyear, n.yearrange.maxyear)) return t.buffer[i++] = o.charAt(0), t.buffer[i++] = o.charAt(1), { pos: i } } return r }, cardinality: 1 }, { validator: function (e, t, i, a, n) { var r = n.isInYearRange(e, n.yearrange.minyear, n.yearrange.maxyear); if (!a && !r) { var o = n.determinebaseyear(n.yearrange.minyear, n.yearrange.maxyear, e).toString().slice(0, 2); if (r = n.isInYearRange(e[0] + o[1] + e[1], n.yearrange.minyear, n.yearrange.maxyear)) return t.buffer[i++] = o.charAt(1), { pos: i }; if (o = n.determinebaseyear(n.yearrange.minyear, n.yearrange.maxyear, e).toString().slice(0, 2), n.isInYearRange(o + e, n.yearrange.minyear, n.yearrange.maxyear)) if (t.buffer.join("").substr(0, 6) !== n.leapday) r = !0; else { var s = parseInt(e, 10); r = s % 4 == 0 && (s % 100 != 0 || s % 400 == 0) } else r = !1; if (r) return t.buffer[i - 1] = o.charAt(0), t.buffer[i++] = o.charAt(1), t.buffer[i++] = e.charAt(0), { refreshFromBuffer: { start: i - 3, end: i }, pos: i } } return r }, cardinality: 2 }, { validator: function (e, t, i, a, n) { return n.isInYearRange(e, n.yearrange.minyear, n.yearrange.maxyear) }, cardinality: 3 }] } }, insertMode: !1, autoUnmask: !1 }, "mm/dd/yyyy": { placeholder: "mm/dd/yyyy", alias: "dd/mm/yyyy", regex: { val2pre: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[13-9]|1[012])" + i + "[0-3])|(02" + i + "[0-2])") }, val2: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|1[012])" + i + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + i + "30)|((0[13578]|1[02])" + i + "31)") }, val1pre: new RegExp("[01]"), val1: new RegExp("0[1-9]|1[012]") }, leapday: "02/29/", onKeyDown: function (i, a, n, r) { var o = e(this); if (i.ctrlKey && i.keyCode === t.keyCode.RIGHT) { var s = new Date; o.val((s.getMonth() + 1).toString() + s.getDate().toString() + s.getFullYear().toString()), o.trigger("setvalue") } } }, "yyyy/mm/dd": { mask: "y/1/2", placeholder: "yyyy/mm/dd", alias: "mm/dd/yyyy", leapday: "/02/29", onKeyDown: function (i, a, n, r) { var o = e(this); if (i.ctrlKey && i.keyCode === t.keyCode.RIGHT) { var s = new Date; o.val(s.getFullYear().toString() + (s.getMonth() + 1).toString() + s.getDate().toString()), o.trigger("setvalue") } } }, "dd.mm.yyyy": { mask: "1.2.y", placeholder: "dd.mm.yyyy", leapday: "29.02.", separator: ".", alias: "dd/mm/yyyy" }, "dd-mm-yyyy": { mask: "1-2-y", placeholder: "dd-mm-yyyy", leapday: "29-02-", separator: "-", alias: "dd/mm/yyyy" }, "mm.dd.yyyy": { mask: "1.2.y", placeholder: "mm.dd.yyyy", leapday: "02.29.", separator: ".", alias: "mm/dd/yyyy" }, "mm-dd-yyyy": { mask: "1-2-y", placeholder: "mm-dd-yyyy", leapday: "02-29-", separator: "-", alias: "mm/dd/yyyy" }, "yyyy.mm.dd": { mask: "y.1.2", placeholder: "yyyy.mm.dd", leapday: ".02.29", separator: ".", alias: "yyyy/mm/dd" }, "yyyy-mm-dd": { mask: "y-1-2", placeholder: "yyyy-mm-dd", leapday: "-02-29", separator: "-", alias: "yyyy/mm/dd" }, datetime: { mask: "1/2/y h:s", placeholder: "dd/mm/yyyy hh:mm", alias: "dd/mm/yyyy", regex: { hrspre: new RegExp("[012]"), hrs24: new RegExp("2[0-4]|1[3-9]"), hrs: new RegExp("[01][0-9]|2[0-4]"), ampm: new RegExp("^[a|p|A|P][m|M]"), mspre: new RegExp("[0-5]"), ms: new RegExp("[0-5][0-9]") }, timeseparator: ":", hourFormat: "24", definitions: { h: { validator: function (e, t, i, a, n) { if ("24" === n.hourFormat && 24 === parseInt(e, 10)) return t.buffer[i - 1] = "0", t.buffer[i] = "0", { refreshFromBuffer: { start: i - 1, end: i }, c: "0" }; var r = n.regex.hrs.test(e); if (!a && !r && (e.charAt(1) === n.timeseparator || -1 !== "-.:".indexOf(e.charAt(1))) && (r = n.regex.hrs.test("0" + e.charAt(0)))) return t.buffer[i - 1] = "0", t.buffer[i] = e.charAt(0), i++, { refreshFromBuffer: { start: i - 2, end: i }, pos: i, c: n.timeseparator }; if (r && "24" !== n.hourFormat && n.regex.hrs24.test(e)) { var o = parseInt(e, 10); return 24 === o ? (t.buffer[i + 5] = "a", t.buffer[i + 6] = "m") : (t.buffer[i + 5] = "p", t.buffer[i + 6] = "m"), 10 > (o -= 12) ? (t.buffer[i] = o.toString(), t.buffer[i - 1] = "0") : (t.buffer[i] = o.toString().charAt(1), t.buffer[i - 1] = o.toString().charAt(0)), { refreshFromBuffer: { start: i - 1, end: i + 6 }, c: t.buffer[i] } } return r }, cardinality: 2, prevalidator: [{ validator: function (e, t, i, a, n) { var r = n.regex.hrspre.test(e); return a || r || !(r = n.regex.hrs.test("0" + e)) ? r : (t.buffer[i] = "0", { pos: ++i }) }, cardinality: 1 }] }, s: { validator: "[0-5][0-9]", cardinality: 2, prevalidator: [{ validator: function (e, t, i, a, n) { var r = n.regex.mspre.test(e); return a || r || !(r = n.regex.ms.test("0" + e)) ? r : (t.buffer[i] = "0", { pos: ++i }) }, cardinality: 1 }] }, t: { validator: function (e, t, i, a, n) { return n.regex.ampm.test(e + "m") }, casing: "lower", cardinality: 1 } }, insertMode: !1, autoUnmask: !1 }, datetime12: { mask: "1/2/y h:s t\\m", placeholder: "dd/mm/yyyy hh:mm xm", alias: "datetime", hourFormat: "12" }, "mm/dd/yyyy hh:mm xm": { mask: "1/2/y h:s t\\m", placeholder: "mm/dd/yyyy hh:mm xm", alias: "datetime12", regex: { val2pre: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[13-9]|1[012])" + i + "[0-3])|(02" + i + "[0-2])") }, val2: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|1[012])" + i + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + i + "30)|((0[13578]|1[02])" + i + "31)") }, val1pre: new RegExp("[01]"), val1: new RegExp("0[1-9]|1[012]") }, leapday: "02/29/", onKeyDown: function (i, a, n, r) { var o = e(this); if (i.ctrlKey && i.keyCode === t.keyCode.RIGHT) { var s = new Date; o.val((s.getMonth() + 1).toString() + s.getDate().toString() + s.getFullYear().toString()), o.trigger("setvalue") } } }, "hh:mm t": { mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, "h:s t": { mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, "hh:mm:ss": { mask: "h:s:s", placeholder: "hh:mm:ss", alias: "datetime", autoUnmask: !1 }, "hh:mm": { mask: "h:s", placeholder: "hh:mm", alias: "datetime", autoUnmask: !1 }, date: { alias: "dd/mm/yyyy" }, "mm/yyyy": { mask: "1/y", placeholder: "mm/yyyy", leapday: "donotuse", separator: "/", alias: "mm/dd/yyyy" }, shamsi: { regex: { val2pre: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|1[012])" + i + "[0-3])") }, val2: function (e) { var i = t.escapeRegex.call(this, e); return new RegExp("((0[1-9]|1[012])" + i + "(0[1-9]|[12][0-9]))|((0[1-9]|1[012])" + i + "30)|((0[1-6])" + i + "31)") }, val1pre: new RegExp("[01]"), val1: new RegExp("0[1-9]|1[012]") }, yearrange: { minyear: 1300, maxyear: 1499 }, mask: "y/1/2", leapday: "/12/30", placeholder: "yyyy/mm/dd", alias: "mm/dd/yyyy", clearIncomplete: !0 } }) }(jQuery, Inputmask), function (e, t) { t.extendDefinitions({ A: { validator: "[A-Za-zА-яЁёÀ-ÿµ]", cardinality: 1, casing: "upper" }, "&": { validator: "[0-9A-Za-zА-яЁёÀ-ÿµ]", cardinality: 1, casing: "upper" }, "#": { validator: "[0-9A-Fa-f]", cardinality: 1, casing: "upper" } }), t.extendAliases({ url: { definitions: { i: { validator: ".", cardinality: 1 } }, mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}", insertMode: !1, autoUnmask: !1 }, ip: { mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]", definitions: { i: { validator: function (e, t, i, a, n) { return i - 1 > -1 && "." !== t.buffer[i - 1] ? (e = t.buffer[i - 1] + e, e = i - 2 > -1 && "." !== t.buffer[i - 2] ? t.buffer[i - 2] + e : "0" + e) : e = "00" + e, new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(e) }, cardinality: 1 } }, onUnMask: function (e, t, i) { return e } }, email: { mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}[.-{1,63}][.-{1,63}][.-{1,63}]", greedy: !1, onBeforePaste: function (e, t) { return (e = e.toLowerCase()).replace("mailto:", "") }, definitions: { "*": { validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]", cardinality: 1, casing: "lower" }, "-": { validator: "[0-9A-Za-z-]", cardinality: 1, casing: "lower" } }, onUnMask: function (e, t, i) { return e } }, mac: { mask: "##:##:##:##:##:##" }, vin: { mask: "V{13}9{4}", definitions: { V: { validator: "[A-HJ-NPR-Za-hj-npr-z\\d]", cardinality: 1, casing: "upper" } }, clearIncomplete: !0, autoUnmask: !0 } }) }(jQuery, Inputmask), function (e, t) { t.extendAliases({ numeric: { mask: function (e) { function t(t) { for (var i = "", a = 0; a < t.length; a++) i += e.definitions[t.charAt(a)] || e.optionalmarker.start === t.charAt(a) || e.optionalmarker.end === t.charAt(a) || e.quantifiermarker.start === t.charAt(a) || e.quantifiermarker.end === t.charAt(a) || e.groupmarker.start === t.charAt(a) || e.groupmarker.end === t.charAt(a) || e.alternatormarker === t.charAt(a) ? "\\" + t.charAt(a) : t.charAt(a); return i } if (0 !== e.repeat && isNaN(e.integerDigits) && (e.integerDigits = e.repeat), e.repeat = 0, e.groupSeparator === e.radixPoint && ("." === e.radixPoint ? e.groupSeparator = "," : "," === e.radixPoint ? e.groupSeparator = "." : e.groupSeparator = ""), " " === e.groupSeparator && (e.skipOptionalPartCharacter = void 0), e.autoGroup = e.autoGroup && "" !== e.groupSeparator, e.autoGroup && ("string" == typeof e.groupSize && isFinite(e.groupSize) && (e.groupSize = parseInt(e.groupSize)), isFinite(e.integerDigits))) { var i = Math.floor(e.integerDigits / e.groupSize), a = e.integerDigits % e.groupSize; e.integerDigits = parseInt(e.integerDigits) + (0 === a ? i - 1 : i), e.integerDigits < 1 && (e.integerDigits = "*") } e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), e.radixFocus = e.radixFocus && "" !== e.placeholder && !0 === e.integerOptional, e.definitions[";"] = e.definitions["~"], e.definitions[";"].definitionSymbol = "~", !0 === e.numericInput && (e.radixFocus = !1, e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e.decimalProtect = !1); var n = t(e.prefix); return n += "[+]", n += !0 === e.integerOptional ? "~{1," + e.integerDigits + "}" : "~{" + e.integerDigits + "}", void 0 !== e.digits && (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.decimalProtect && (e.radixPointDefinitionSymbol = ":"), n += e.digitsOptional ? "[" + (e.decimalProtect ? ":" : e.radixPoint) + ";{1," + e.digits + "}]" : (e.decimalProtect ? ":" : e.radixPoint) + ";{" + e.digits + "}"), n += "[-]", n += t(e.suffix), e.greedy = !1, n }, placeholder: "", greedy: !1, digits: "*", digitsOptional: !0, radixPoint: ".", radixFocus: !0, groupSize: 3, groupSeparator: "", autoGroup: !1, allowPlus: !0, allowMinus: !0, negationSymbol: { front: "-", back: "" }, integerDigits: "+", integerOptional: !0, prefix: "", suffix: "", rightAlign: !0, decimalProtect: !0, min: null, max: null, step: 1, insertMode: !0, autoUnmask: !1, unmaskAsNumber: !1, postFormat: function (i, a, n) { !0 === n.numericInput && (i = i.reverse(), isFinite(a) && (a = i.join("").length - a - 1)); var r, o, s = !1; i.length >= n.suffix.length && i.join("").indexOf(n.suffix) === i.length - n.suffix.length && (i.length = i.length - n.suffix.length, s = !0); var l = !1, u = i[a = a >= i.length ? i.length - 1 : a < n.prefix.length ? n.prefix.length : a], c = i.slice(); u === n.groupSeparator && (c.splice(a--, 1), u = c[a]), u !== n.radixPoint && u !== n.negationSymbol.front && u !== n.negationSymbol.back && (c[a] = "?"); var d = c.join(""), p = d; if (d.length > 0 && n.autoGroup || -1 !== d.indexOf(n.groupSeparator)) { var f = t.escapeRegex(n.groupSeparator); l = 0 === d.indexOf(n.groupSeparator); var m = (d = d.replace(new RegExp(f, "g"), "")).split(n.radixPoint); if ((d = "" === n.radixPoint ? d : m[0]) !== n.prefix + "?0" && d.length >= n.groupSize + n.prefix.length) for (var h = new RegExp("([-+]?[\\d?]+)([\\d?]{" + n.groupSize + "})") ; h.test(d) && "" !== n.groupSeparator;) d = d.replace(h, "$1" + n.groupSeparator + "$2"), d = d.replace(n.groupSeparator + n.groupSeparator, n.groupSeparator); "" !== n.radixPoint && m.length > 1 && (d += n.radixPoint + m[1]) } for (l = p !== d, i.length = d.length, r = 0, o = d.length; o > r; r++) i[r] = d.charAt(r); var v = e.inArray("?", i); if (-1 === v && (v = e.inArray(u, i)), i[v] = u, !l && s) for (r = 0, o = n.suffix.length; o > r; r++) i.push(n.suffix.charAt(r)); return v = n.numericInput && isFinite(a) ? i.join("").length - v - 1 : v, n.numericInput && (i = i.reverse(), e.inArray(n.radixPoint, i) < v && i.join("").length - n.suffix.length !== v && (v -= 1)), { pos: v, refreshFromBuffer: l, buffer: i } }, onBeforeWrite: function (i, a, n, r) { var o; if (i && ("blur" === i.type || "checkval" === i.type || "keydown" === i.type)) { var s = r.numericInput ? a.slice().reverse().join("") : a.join(""), l = s.replace(r.prefix, ""); l = (l = l.replace(r.suffix, "")).replace(new RegExp(t.escapeRegex(r.groupSeparator), "g"), ""), "," === r.radixPoint && (l = l.replace(r.radixPoint, ".")); var u = l.match(new RegExp("[-" + t.escapeRegex(r.negationSymbol.front) + "]", "g")); if (u = null !== u && 1 === u.length, "" !== (l = (l = (l = l.replace(new RegExp("[-" + t.escapeRegex(r.negationSymbol.front) + "]", "g"), "")).replace(new RegExp(t.escapeRegex(r.negationSymbol.back) + "$"), "")) === r.negationSymbol.front ? l + "0" : l) && isFinite(l)) { var c = parseFloat(l), d = u ? -1 * c : c; if (null !== r.min && isFinite(r.min) && d < parseFloat(r.min) ? (c = Math.abs(r.min), u = r.min < 0) : null !== r.max && isFinite(r.max) && d > parseFloat(r.max) && (c = Math.abs(r.max), u = r.max < 0), l = c.toString().replace(".", r.radixPoint).split(""), isFinite(r.digits)) { var p = e.inArray(r.radixPoint, l), f = e.inArray(r.radixPoint, s); -1 === p && (l.push(r.radixPoint), p = l.length - 1); for (var m = 1; m <= r.digits; m++) r.digitsOptional || void 0 !== l[p + m] && l[p + m] !== r.placeholder.charAt(0) ? -1 !== f && void 0 !== s[f + m] && (l[p + m] = l[p + m] || s[f + m]) : l[p + m] = "0"; l[l.length - 1] === r.radixPoint && delete l[l.length - 1] } if (c.toString() !== l && c.toString() + "." !== l || u) return !u || 0 === c && "blur" === i.type || (l.unshift(r.negationSymbol.front), l.push(r.negationSymbol.back)), l = (r.prefix + l.join("")).split(""), r.numericInput && (l = l.reverse()), o = r.postFormat(l, r.numericInput ? n : n - 1, r), o.buffer && (o.refreshFromBuffer = o.buffer.join("") !== a.join("")), o } } return r.autoGroup ? ((o = r.postFormat(a, r.numericInput ? n : n - 1, r)).caret = n <= r.prefix.length ? o.pos : o.pos + 1, o) : void 0 }, regex: { integerPart: function (e) { return new RegExp("[" + t.escapeRegex(e.negationSymbol.front) + "+]?\\d+") }, integerNPart: function (e) { return new RegExp("[\\d" + t.escapeRegex(e.groupSeparator) + t.escapeRegex(e.placeholder.charAt(0)) + "]+") } }, signHandler: function (e, t, i, a, n) { if (!a && n.allowMinus && "-" === e || n.allowPlus && "+" === e) { var r = t.buffer.join("").match(n.regex.integerPart(n)); if (r && r[0].length > 0) return t.buffer[r.index] === ("-" === e ? "+" : n.negationSymbol.front) ? "-" === e ? "" !== n.negationSymbol.back ? { pos: r.index, c: n.negationSymbol.front, remove: r.index, caret: i, insert: { pos: t.buffer.length - n.suffix.length - 1, c: n.negationSymbol.back } } : { pos: r.index, c: n.negationSymbol.front, remove: r.index, caret: i } : "" !== n.negationSymbol.back ? { pos: r.index, c: "+", remove: [r.index, t.buffer.length - n.suffix.length - 1], caret: i } : { pos: r.index, c: "+", remove: r.index, caret: i } : t.buffer[r.index] === ("-" === e ? n.negationSymbol.front : "+") ? "-" === e && "" !== n.negationSymbol.back ? { remove: [r.index, t.buffer.length - n.suffix.length - 1], caret: i - 1 } : { remove: r.index, caret: i - 1 } : "-" === e ? "" !== n.negationSymbol.back ? { pos: r.index, c: n.negationSymbol.front, caret: i + 1, insert: { pos: t.buffer.length - n.suffix.length, c: n.negationSymbol.back } } : { pos: r.index, c: n.negationSymbol.front, caret: i + 1 } : { pos: r.index, c: e, caret: i + 1 } } return !1 }, radixHandler: function (t, i, a, n, r) { if (!n && !0 !== r.numericInput && t === r.radixPoint && void 0 !== r.digits && (isNaN(r.digits) || parseInt(r.digits) > 0)) { var o = e.inArray(r.radixPoint, i.buffer), s = i.buffer.join("").match(r.regex.integerPart(r)); if (-1 !== o && i.validPositions[o]) return i.validPositions[o - 1] ? { caret: o + 1 } : { pos: s.index, c: s[0], caret: o + 1 }; if (!s || "0" === s[0] && s.index + 1 !== a) return i.buffer[s ? s.index : a] = "0", { pos: (s ? s.index : a) + 1, c: r.radixPoint } } return !1 }, leadingZeroHandler: function (t, i, a, n, r, o) { if (!n) if (!0 === r.numericInput) { var s = i.buffer.slice("").reverse(); if ("0" === s[r.prefix.length]) return { pos: a, remove: s.length - r.prefix.length - 1 } } else { var l = e.inArray(r.radixPoint, i.buffer), u = i.buffer.slice(0, -1 !== l ? l : void 0).join("").match(r.regex.integerNPart(r)); if (u && (-1 === l || l >= a)) { var c = -1 === l ? 0 : parseInt(i.buffer.slice(l + 1).join("")); if (0 === u[0].indexOf("" !== r.placeholder ? r.placeholder.charAt(0) : "0") && (u.index + 1 === a || !0 !== o && 0 === c)) return i.buffer.splice(u.index, 1), a = u.index, { pos: a, remove: u.index }; if ("0" === t && a <= u.index && u[0] !== r.groupSeparator) return !1 } } return !0 }, definitions: { "~": { validator: function (i, a, n, r, o, s) { var l = o.signHandler(i, a, n, r, o); if (!l && (!(l = o.radixHandler(i, a, n, r, o)) && (!0 === (l = r ? new RegExp("[0-9" + t.escapeRegex(o.groupSeparator) + "]").test(i) : new RegExp("[0-9]").test(i)) && !0 === (l = o.leadingZeroHandler(i, a, n, r, o, s))))) { var u = e.inArray(o.radixPoint, a.buffer); l = -1 !== u && (!1 === o.digitsOptional || a.validPositions[n]) && !0 !== o.numericInput && n > u && !r ? { pos: n, remove: n } : { pos: n } } return l }, cardinality: 1 }, "+": { validator: function (e, t, i, a, n) { var r = n.signHandler(e, t, i, a, n); return !r && (a && n.allowMinus && e === n.negationSymbol.front || n.allowMinus && "-" === e || n.allowPlus && "+" === e) && (r = !(!a && "-" === e) || ("" !== n.negationSymbol.back ? { pos: i, c: "-" === e ? n.negationSymbol.front : "+", caret: i + 1, insert: { pos: t.buffer.length, c: n.negationSymbol.back } } : { pos: i, c: "-" === e ? n.negationSymbol.front : "+", caret: i + 1 })), r }, cardinality: 1, placeholder: "" }, "-": { validator: function (e, t, i, a, n) { var r = n.signHandler(e, t, i, a, n); return !r && a && n.allowMinus && e === n.negationSymbol.back && (r = !0), r }, cardinality: 1, placeholder: "" }, ":": { validator: function (e, i, a, n, r) { var o = r.signHandler(e, i, a, n, r); if (!o) { var s = "[" + t.escapeRegex(r.radixPoint) + "]"; (o = new RegExp(s).test(e)) && i.validPositions[a] && i.validPositions[a].match.placeholder === r.radixPoint && (o = { caret: a + 1 }) } return o ? { c: r.radixPoint } : o }, cardinality: 1, placeholder: function (e) { return e.radixPoint } } }, onUnMask: function (e, i, a) { var n = e.replace(a.prefix, ""); return n = (n = n.replace(a.suffix, "")).replace(new RegExp(t.escapeRegex(a.groupSeparator), "g"), ""), a.unmaskAsNumber ? ("" !== a.radixPoint && -1 !== n.indexOf(a.radixPoint) && (n = n.replace(t.escapeRegex.call(this, a.radixPoint), ".")), Number(n)) : n }, isComplete: function (e, i) { var a = e.join(""), n = e.slice(); if (i.postFormat(n, 0, i), n.join("") !== a) return !1; var r = a.replace(i.prefix, ""); return r = (r = r.replace(i.suffix, "")).replace(new RegExp(t.escapeRegex(i.groupSeparator), "g"), ""), "," === i.radixPoint && (r = r.replace(t.escapeRegex(i.radixPoint), ".")), isFinite(r) }, onBeforeMask: function (e, i) { if ("" !== i.radixPoint && isFinite(e)) e = e.toString().replace(".", i.radixPoint); else { var a = e.match(/,/g), n = e.match(/\./g); n && a ? n.length > a.length ? e = (e = e.replace(/\./g, "")).replace(",", i.radixPoint) : a.length > n.length ? e = (e = e.replace(/,/g, "")).replace(".", i.radixPoint) : e = e.indexOf(".") < e.indexOf(",") ? e.replace(/\./g, "") : e = e.replace(/,/g, "") : e = e.replace(new RegExp(t.escapeRegex(i.groupSeparator), "g"), "") } if (0 === i.digits && (-1 !== e.indexOf(".") ? e = e.substring(0, e.indexOf(".")) : -1 !== e.indexOf(",") && (e = e.substring(0, e.indexOf(",")))), "" !== i.radixPoint && isFinite(i.digits) && -1 !== e.indexOf(i.radixPoint)) { var r = e.split(i.radixPoint)[1].match(new RegExp("\\d*"))[0]; if (parseInt(i.digits) < r.toString().length) { var o = Math.pow(10, parseInt(i.digits)); e = e.replace(t.escapeRegex(i.radixPoint), "."), e = (e = Math.round(parseFloat(e) * o) / o).toString().replace(".", i.radixPoint) } } return e.toString() }, canClearPosition: function (e, t, i, a, n) { var r = e.validPositions[t].input; return r !== n.radixPoint || null !== e.validPositions[t].match.fn && !1 === n.decimalProtect || isFinite(r) || t === i || r === n.groupSeparator || r === n.negationSymbol.front || r === n.negationSymbol.back }, onKeyDown: function (i, a, n, r) { var o = e(this); if (i.ctrlKey) switch (i.keyCode) { case t.keyCode.UP: o.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(r.step)), o.trigger("setvalue"); break; case t.keyCode.DOWN: o.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(r.step)), o.trigger("setvalue") } } }, currency: { prefix: "$ ", groupSeparator: ",", alias: "numeric", placeholder: "0", autoGroup: !0, digits: 2, digitsOptional: !1, clearMaskOnLostFocus: !1 }, decimal: { alias: "numeric" }, integer: { alias: "numeric", digits: 0, radixPoint: "" }, percentage: { alias: "numeric", digits: 2, radixPoint: ".", placeholder: "0", autoGroup: !1, min: 0, max: 100, suffix: " %", allowPlus: !1, allowMinus: !1 } }) }(jQuery, Inputmask), function (e, t) { t.extendAliases({ phone: { url: "phone-codes/phone-codes.js", countrycode: "", phoneCodeCache: {}, mask: function (t) { if (void 0 === t.phoneCodeCache[t.url]) { var i = []; t.definitions["#"] = t.definitions[9], e.ajax({ url: t.url, async: !1, type: "get", dataType: "json", success: function (e) { i = e }, error: function (e, i, a) { alert(a + " - " + t.url) } }), t.phoneCodeCache[t.url] = i.sort(function (e, t) { return (e.mask || e) < (t.mask || t) ? -1 : 1 }) } return t.phoneCodeCache[t.url] }, keepStatic: !1, nojumps: !0, nojumpsThreshold: 1, onBeforeMask: function (e, t) { var i = e.replace(/^0{1,2}/, "").replace(/[\s]/g, ""); return (i.indexOf(t.countrycode) > 1 || -1 === i.indexOf(t.countrycode)) && (i = "+" + t.countrycode + i), i } }, phonebe: { alias: "phone", url: "phone-codes/phone-be.js", countrycode: "32", nojumpsThreshold: 4 } }) }(jQuery, Inputmask), function (e, t) { t.extendAliases({ Regex: { mask: "r", greedy: !1, repeat: "*", regex: null, regexTokens: null, tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, quantifierFilter: /[0-9]+[^,]/, isComplete: function (e, t) { return new RegExp(t.regex).test(e.join("")) }, definitions: { r: { validator: function (t, i, a, n, r) { function o(e, t) { this.matches = [], this.isGroup = e || !1, this.isQuantifier = t || !1, this.quantifier = { min: 1, max: 1 }, this.repeaterPart = void 0 } function s(t, i) { var a = !1; i && (d += "(", f++); for (var n = 0; n < t.matches.length; n++) { var r = t.matches[n]; if (!0 === r.isGroup) a = s(r, !0); else if (!0 === r.isQuantifier) { var o = e.inArray(r, t.matches), u = t.matches[o - 1], c = d; if (isNaN(r.quantifier.max)) { for (; r.repeaterPart && r.repeaterPart !== d && r.repeaterPart.length > d.length && !(a = s(u, !0)) ;); (a = a || s(u, !0)) && (r.repeaterPart = d), d = c + r.quantifier.max } else { for (var p = 0, m = r.quantifier.max - 1; m > p && !(a = s(u, !0)) ; p++); d = c + "{" + r.quantifier.min + "," + r.quantifier.max + "}" } } else if (void 0 !== r.matches) for (var h = 0; h < r.length && !(a = s(r[h], i)) ; h++); else { var v; if ("[" == r.charAt(0)) { v = d, v += r; for (var g = 0; f > g; g++) v += ")"; a = new RegExp("^(" + v + ")$").test(l) } else for (var y = 0, k = r.length; k > y; y++) if ("\\" !== r.charAt(y)) { v = d, v = (v += r.substr(0, y + 1)).replace(/\|$/, ""); for (g = 0; f > g; g++) v += ")"; if (a = new RegExp("^(" + v + ")$").test(l)) break } d += r } if (a) break } return i && (d += ")", f--), a } var l, u, c = i.buffer.slice(), d = "", p = !1, f = 0; null === r.regexTokens && function () { var e, t, i = new o, a = []; for (r.regexTokens = []; e = r.tokenizer.exec(r.regex) ;) switch (t = e[0], t.charAt(0)) { case "(": a.push(new o(!0)); break; case ")": u = a.pop(), a.length > 0 ? a[a.length - 1].matches.push(u) : i.matches.push(u); break; case "{": case "+": case "*": var n = new o(!1, !0), s = (t = t.replace(/[{}]/g, "")).split(","), l = isNaN(s[0]) ? s[0] : parseInt(s[0]), c = 1 === s.length ? l : isNaN(s[1]) ? s[1] : parseInt(s[1]); if (n.quantifier = { min: l, max: c }, a.length > 0) { var d = a[a.length - 1].matches; (e = d.pop()).isGroup || ((u = new o(!0)).matches.push(e), e = u), d.push(e), d.push(n) } else e = i.matches.pop(), e.isGroup || (u = new o(!0), u.matches.push(e), e = u), i.matches.push(e), i.matches.push(n); break; default: a.length > 0 ? a[a.length - 1].matches.push(t) : i.matches.push(t) } i.matches.length > 0 && r.regexTokens.push(i) }(), c.splice(a, 0, t), l = c.join(""); for (var m = 0; m < r.regexTokens.length; m++) { var h = r.regexTokens[m]; if (p = s(h, h.isGroup)) break } return p }, cardinality: 1 } } } }) }(jQuery, Inputmask);;(function (factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
        // Node/CommonJS
        factory(require('jquery'));
    } else {
        // Browser globals
        factory(jQuery);
    }
}(function ($) {

var ua = navigator.userAgent,
	iPhone = /iphone/i.test(ua),
	chrome = /chrome/i.test(ua),
	android = /android/i.test(ua),
	caretTimeoutId;

$.mask = {
	//Predefined character definitions
	definitions: {
		'9': "[0-9]",
		'a': "[A-Za-z]",
		'*': "[A-Za-z0-9]"
	},
	autoclear: true,
	dataName: "rawMaskFn",
	placeholder: '_'
};

$.fn.extend({
	//Helper Function for Caret positioning
	caret: function(begin, end) {
		var range;

		if (this.length === 0 || this.is(":hidden") || this.get(0) !== document.activeElement) {
			return;
		}

		if (typeof begin == 'number') {
			end = (typeof end === 'number') ? end : begin;
			return this.each(function() {
				if (this.setSelectionRange) {
					this.setSelectionRange(begin, end);
				} else if (this.createTextRange) {
					range = this.createTextRange();
					range.collapse(true);
					range.moveEnd('character', end);
					range.moveStart('character', begin);
					range.select();
				}
			});
		} else {
			if (this[0].setSelectionRange) {
				begin = this[0].selectionStart;
				end = this[0].selectionEnd;
			} else if (document.selection && document.selection.createRange) {
				range = document.selection.createRange();
				begin = 0 - range.duplicate().moveStart('character', -100000);
				end = begin + range.text.length;
			}
			return { begin: begin, end: end };
		}
	},
	unmask: function() {
		return this.trigger("unmask");
	},
	mask: function(mask, settings) {
		var input,
			defs,
			tests,
			partialPosition,
			firstNonMaskPos,
            lastRequiredNonMaskPos,
            len,
            oldVal;

		if (!mask && this.length > 0) {
			input = $(this[0]);
            var fn = input.data($.mask.dataName)
			return fn?fn():undefined;
		}

		settings = $.extend({
			autoclear: $.mask.autoclear,
			placeholder: $.mask.placeholder, // Load default placeholder
			completed: null
		}, settings);


		defs = $.mask.definitions;
		tests = [];
		partialPosition = len = mask.length;
		firstNonMaskPos = null;

		mask = String(mask);

		$.each(mask.split(""), function(i, c) {
			if (c == '?') {
				len--;
				partialPosition = i;
			} else if (defs[c]) {
				tests.push(new RegExp(defs[c]));
				if (firstNonMaskPos === null) {
					firstNonMaskPos = tests.length - 1;
				}
                if(i < partialPosition){
                    lastRequiredNonMaskPos = tests.length - 1;
                }
			} else {
				tests.push(null);
			}
		});

		return this.trigger("unmask").each(function() {
			var input = $(this),
				buffer = $.map(
    				mask.split(""),
    				function(c, i) {
    					if (c != '?') {
    						return defs[c] ? getPlaceholder(i) : c;
    					}
    				}),
				defaultBuffer = buffer.join(''),
				focusText = input.val();

            function tryFireCompleted(){
                if (!settings.completed) {
                    return;
                }

                for (var i = firstNonMaskPos; i <= lastRequiredNonMaskPos; i++) {
                    if (tests[i] && buffer[i] === getPlaceholder(i)) {
                        return;
                    }
                }
                settings.completed.call(input);
            }

            function getPlaceholder(i){
                if(i < settings.placeholder.length)
                    return settings.placeholder.charAt(i);
                return settings.placeholder.charAt(0);
            }

			function seekNext(pos) {
				while (++pos < len && !tests[pos]);
				return pos;
			}

			function seekPrev(pos) {
				while (--pos >= 0 && !tests[pos]);
				return pos;
			}

			function shiftL(begin,end) {
				var i,
					j;

				if (begin<0) {
					return;
				}

				for (i = begin, j = seekNext(end); i < len; i++) {
					if (tests[i]) {
						if (j < len && tests[i].test(buffer[j])) {
							buffer[i] = buffer[j];
							buffer[j] = getPlaceholder(j);
						} else {
							break;
						}

						j = seekNext(j);
					}
				}
				writeBuffer();
				input.caret(Math.max(firstNonMaskPos, begin));
			}

			function shiftR(pos) {
				var i,
					c,
					j,
					t;

				for (i = pos, c = getPlaceholder(pos); i < len; i++) {
					if (tests[i]) {
						j = seekNext(i);
						t = buffer[i];
						buffer[i] = c;
						if (j < len && tests[j].test(t)) {
							c = t;
						} else {
							break;
						}
					}
				}
			}

			function androidInputEvent(e) {
				var curVal = input.val();
				var pos = input.caret();
				if (oldVal && oldVal.length && oldVal.length > curVal.length ) {
					// a deletion or backspace happened
					checkVal(true);
					while (pos.begin > 0 && !tests[pos.begin-1])
						pos.begin--;
					if (pos.begin === 0)
					{
						while (pos.begin < firstNonMaskPos && !tests[pos.begin])
							pos.begin++;
					}
					input.caret(pos.begin,pos.begin);
				} else {
					var pos2 = checkVal(true);
					var lastEnteredValue = curVal.charAt(pos.begin);
					if (pos.begin < len){
						if(!tests[pos.begin]){
							pos.begin++;
							if(tests[pos.begin].test(lastEnteredValue)){
								pos.begin++;
							}
						}else{
							if(tests[pos.begin].test(lastEnteredValue)){
								pos.begin++;
							}
						}
					}
					input.caret(pos.begin,pos.begin);
				}
				tryFireCompleted();
			}


			function blurEvent(e) {
                checkVal();

                if (input.val() != focusText)
                    input.change();
            }

			function keydownEvent(e) {
                if (input.prop("readonly")){
                    return;
                }

				var k = e.which || e.keyCode,
					pos,
					begin,
					end;
                    oldVal = input.val();
				//backspace, delete, and escape get special treatment
				if (k === 8 || k === 46 || (iPhone && k === 127)) {
					pos = input.caret();
					begin = pos.begin;
					end = pos.end;

					if (end - begin === 0) {
						begin=k!==46?seekPrev(begin):(end=seekNext(begin-1));
						end=k===46?seekNext(end):end;
					}
					clearBuffer(begin, end);
					shiftL(begin, end - 1);

					e.preventDefault();
				} else if( k === 13 ) { // enter
					blurEvent.call(this, e);
				} else if (k === 27) { // escape
					input.val(focusText);
					input.caret(0, checkVal());
					e.preventDefault();
				}
			}

			function keypressEvent(e) {
                if (input.prop("readonly")){
                    return;
                }

				var k = e.which || e.keyCode,
					pos = input.caret(),
					p,
					c,
					next;

				if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
					return;
				} else if ( k && k !== 13 ) {
					if (pos.end - pos.begin !== 0){
						clearBuffer(pos.begin, pos.end);
						shiftL(pos.begin, pos.end-1);
					}

					p = seekNext(pos.begin - 1);
					if (p < len) {
						c = String.fromCharCode(k);
						if (tests[p].test(c)) {
							shiftR(p);

							buffer[p] = c;
							writeBuffer();
							next = seekNext(p);

							if(android){
								//Path for CSP Violation on FireFox OS 1.1
								var proxy = function() {
									$.proxy($.fn.caret,input,next)();
								};

								setTimeout(proxy,0);
							}else{
								input.caret(next);
							}
                            if(pos.begin <= lastRequiredNonMaskPos){
		                         tryFireCompleted();
                             }
						}
					}
					e.preventDefault();
				}
			}

			function clearBuffer(start, end) {
				var i;
				for (i = start; i < end && i < len; i++) {
					if (tests[i]) {
						buffer[i] = getPlaceholder(i);
					}
				}
			}

			function writeBuffer() { input.val(buffer.join('')); }

			function checkVal(allow) {
				//try to place characters where they belong
				var test = input.val(),
					lastMatch = -1,
					i,
					c,
					pos;

				for (i = 0, pos = 0; i < len; i++) {
					if (tests[i]) {
						buffer[i] = getPlaceholder(i);
						while (pos++ < test.length) {
							c = test.charAt(pos - 1);
							if (tests[i].test(c)) {
								buffer[i] = c;
								lastMatch = i;
								break;
							}
						}
						if (pos > test.length) {
							clearBuffer(i + 1, len);
							break;
						}
					} else {
                        if (buffer[i] === test.charAt(pos)) {
                            pos++;
                        }
                        if( i < partialPosition){
                            lastMatch = i;
                        }
					}
				}
				if (allow) {
					writeBuffer();
				} else if (lastMatch + 1 < partialPosition) {
					if (settings.autoclear || buffer.join('') === defaultBuffer) {
						// Invalid value. Remove it and replace it with the
						// mask, which is the default behavior.
						if(input.val()) input.val("");
						clearBuffer(0, len);
					} else {
						// Invalid value, but we opt to show the value to the
						// user and allow them to correct their mistake.
						writeBuffer();
					}
				} else {
					writeBuffer();
					input.val(input.val().substring(0, lastMatch + 1));
				}
				return (partialPosition ? i : firstNonMaskPos);
			}

			input.data($.mask.dataName,function(){
				return $.map(buffer, function(c, i) {
					return tests[i]&&c!=getPlaceholder(i) ? c : null;
				}).join('');
			});


			input
				.one("unmask", function() {
					input
						.off(".mask")
						.removeData($.mask.dataName);
				})
				.on("focus.mask", function() {
                    if (input.prop("readonly")){
                        return;
                    }

					clearTimeout(caretTimeoutId);
					var pos;

					focusText = input.val();

					pos = checkVal();

					caretTimeoutId = setTimeout(function(){
                        if(input.get(0) !== document.activeElement){
                            return;
                        }
						writeBuffer();
						if (pos == mask.replace("?","").length) {
							input.caret(0, pos);
						} else {
							input.caret(pos);
						}
					}, 10);
				})
				.on("blur.mask", blurEvent)
				.on("keydown.mask", keydownEvent)
				.on("keypress.mask", keypressEvent)
				.on("input.mask paste.mask", function() {
                    if (input.prop("readonly")){
                        return;
                    }

					setTimeout(function() {
						var pos=checkVal(true);
						input.caret(pos);
                        tryFireCompleted();
					}, 0);
				});
                if (chrome && android)
                {
                    input
                        .off('input.mask')
                        .on('input.mask', androidInputEvent);
                }
				checkVal(); //Perform initial check for existing values
		});
	}
});
}));
;!function (e) { "use strict"; function t(t) { var n = e(""); try { n = e(t).clone() } catch (o) { n = e("<span />").html(t) } return n } function n(e) { return !!("object" == typeof Node ? e instanceof Node : e && "object" == typeof e && "number" == typeof e.nodeType && "string" == typeof e.nodeName) } e.print = e.fn.print = function () { var o, r, i = this; i instanceof e && (i = i.get(0)), n(i) ? (r = e(i), arguments.length > 0 && (o = arguments[0])) : arguments.length > 0 ? n((r = e(arguments[0]))[0]) ? arguments.length > 1 && (o = arguments[1]) : (o = arguments[0], r = e("html")) : r = e("html"); o = e.extend({}, { globalStyles: !0, mediaPrint: !1, stylesheet: null, noPrintSelector: ".no-print", iframe: !0, append: null, prepend: null }, o || {}); var l = e(""); o.globalStyles ? l = e("style, link, meta, title") : o.mediaPrint && (l = e("link[media=print]")), o.stylesheet && (l = e.merge(l, e('<link rel="stylesheet" href="' + o.stylesheet + '">'))); var c = r.clone(); (c = e("<span/>").append(c)).find(o.noPrintSelector).remove(), c.append(l.clone()), c.append(t(o.append)), c.prepend(t(o.prepend)); var p, s, a = c.html(); if (c.remove(), o.iframe) try { var d = e(o.iframe + ""), m = d.length; 0 === m && (d = e('<iframe height="0" width="0" border="0" wmode="Opaque"/>').prependTo("body").css({ position: "absolute", top: -999, left: -999 })), (s = (p = (p = d.get(0)).contentWindow || p.contentDocument || p).document || p.contentDocument || p).open(), s.write(a), s.close(), setTimeout(function () { p.focus(), p.print(), setTimeout(function () { 0 === m && d.remove() }, 100) }, 250) } catch (e) { console.error("Failed to print from iframe", e.stack, e.message), (p = window.open()).document.write(a), p.document.close(), p.focus(), p.print(), p.close() } else (p = window.open()).document.write(a), p.document.close(), p.focus(), p.print(), p.close(); return this } }(jQuery);;!function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof module && module.exports ? module.exports = t(require("jquery")) : t(jQuery) }(function (t) { var e = t(window.document), s = 0, i = /\w\b/g, n = { 13: "enter", 27: "escape", 40: "downArrow", 38: "upArrow" }; function o(t, e) { this.init.apply(this, arguments) } return t.extend(o.prototype, { init: function (e, i) { i = this.options = t.extend(!0, {}, o.defaults, i), this.$input = t(e), this.$el = i.wrapSelector instanceof t ? i.wrapSelector : this.$input.closest(i.wrapSelector), o.pickTo(i, this.$el.data(), ["url", "onItemSelect", "noResultsText", "inputIdName", "apiInputName"]), i.url = i.url || this.$el.attr("action"), this.ens = ".fastsearch" + ++s, this.itemSelector = o.selectorFromClass(i.itemClass), this.focusedItemSelector = o.selectorFromClass(i.focusedItemClass), this.events() }, namespaceEvents: function (t) { var e = this.ens; return t.replace(i, function (t) { return t + e }) }, events: function () { var e = this, s = this.options; this.$input.on(this.namespaceEvents("keyup focus click"), function (t) { "enter" !== n[t.keyCode] && e.handleTyping() }).on(this.namespaceEvents("keydown"), function (t) { if ("enter" === n[t.keyCode] && s.preventSubmit && t.preventDefault(), e.hasResults && e.resultsOpened) switch (n[t.keyCode]) { case "downArrow": t.preventDefault(), e.navigateItem("down"); break; case "upArrow": t.preventDefault(), e.navigateItem("up"); break; case "enter": e.onEnter(t) } }), this.$el.on(this.namespaceEvents("click"), this.itemSelector, function (s) { s.preventDefault(), e.handleItemSelect(t(this)) }), s.mouseEvents && this.$el.on(this.namespaceEvents("mouseleave"), this.itemSelector, function (e) { t(this).removeClass(s.focusedItemClass) }).on(this.namespaceEvents("mouseenter"), this.itemSelector, function (i) { e.$resultItems.removeClass(s.focusedItemClass), t(this).addClass(s.focusedItemClass) }) }, handleTyping: function () { var e = t.trim(this.$input.val()), s = this; e.length < this.options.minQueryLength ? this.hideResults() : e === this.query ? this.showResults() : (clearTimeout(this.keyupTimeout), this.keyupTimeout = setTimeout(function () { s.$el.addClass(s.options.loadingClass), s.query = e, s.getResults(function (t) { s.showResults(s.storeResponse(t).generateResults(t)) }) }, this.options.typeTimeout)) }, getResults: function (e) { var s = this, i = this.options, n = this.$el.find("input, textarea, select").serializeArray(); i.apiInputName && n.push({ name: i.apiInputName, value: this.$input.val() }), t.get(i.url, n, function (t) { e(i.parseResponse ? i.parseResponse.call(s, t, s) : t) }) }, storeResponse: function (t) { return this.responseData = t, this.hasResults = 0 !== t.length, this }, generateResults: function (e) { var s = t("<div>"), i = this.options; return i.template ? t(i.template(e, this)) : (0 === e.length ? s.html('<p class="' + i.noResultsClass + '">' + ("function" == typeof i.noResultsText ? i.noResultsText.call(this) : i.noResultsText) + "</p>") : "html" === this.options.responseType ? s.html(e) : this["generate" + (e[0][i.responseFormat.groupItems] ? "GroupedResults" : "SimpleResults")](e, s), s.children()) }, generateSimpleResults: function (e, s) { var i = this; this.itemModels = e, t.each(e, function (t, e) { s.append(i.generateItem(e)) }) }, generateGroupedResults: function (e, s) { var i = this, n = this.options, o = n.responseFormat; this.itemModels = [], t.each(e, function (e, l) { var a = t('<div class="' + n.groupClass + '">').appendTo(s); l[o.groupCaption] && a.append('<h3 class="' + n.groupTitleClass + '">' + l[o.groupCaption] + "</h3>"), t.each(l.items, function (t, e) { i.itemModels.push(e), a.append(i.generateItem(e)) }), n.onGroupCreate && n.onGroupCreate.call(i, a, l, i) }) }, generateItem: function (e) { var s = this.options, i = s.responseFormat, n = e[i.url], o = e[i.html] || e[i.label], l = t("<" + (n ? "a" : "span") + ">").html(o).addClass(s.itemClass); return n && l.attr("href", n), s.onItemCreate && s.onItemCreate.call(this, l, e, this), l }, showResults: function (e) { !e && this.resultsOpened || (this.$el.removeClass(this.options.loadingClass).addClass(this.options.resultsOpenedClass), this.options.flipOnBottom && this.checkDropdownPosition(), this.$resultsCont = this.$resultsCont || t("<div>").addClass(this.options.resultsContClass).appendTo(this.$el), e && (this.$resultsCont.html(e), this.$resultItems = this.$resultsCont.find(this.itemSelector), this.options.onResultsCreate && this.options.onResultsCreate.call(this, this.$resultsCont, this.responseData, this)), this.resultsOpened || (this.documentCancelEvents("on"), this.$input.trigger("openingResults")), this.options.focusFirstItem && this.$resultItems && this.$resultItems.length && this.navigateItem("down"), this.resultsOpened = !0) }, checkDropdownPosition: function () { var t = this.options.flipOnBottom, s = "boolean" == typeof t && t ? 400 : t, i = this.$input.offset().top + s > e.height(); this.$el.toggleClass(this.options.resultsFlippedClass, i) }, documentCancelEvents: function (s, i) { var o = this; if ("off" === s && this.closeEventsSetuped) return e.off(this.ens), void (this.closeEventsSetuped = !1); "on" !== s || this.closeEventsSetuped || (e.on(this.namespaceEvents("click keyup"), function (e) { ("escape" === n[e.keyCode] || !t(e.target).is(o.$el) && !t.contains(o.$el.get(0), e.target) && t.contains(document.documentElement, e.target)) && (i ? i.call(o) : o.hideResults()) }), this.closeEventsSetuped = !0) }, navigateItem: function (t) { var e = this.$resultItems.filter(this.focusedItemSelector), s = this.$resultItems.length - 1; if (0 !== e.length) { var i = this.$resultItems.index(e), n = "up" === t ? i - 1 : i + 1; n > s && (n = 0), n < 0 && (n = s), e.removeClass(this.options.focusedItemClass), this.$resultItems.eq(n).addClass(this.options.focusedItemClass) } else this.$resultItems.eq("up" === t ? s : 0).addClass(this.options.focusedItemClass) }, navigateDown: function () { this.navigateItem("down") }, navigateUp: function () { this.navigateItem("up") }, onEnter: function (t) { var e = this.$resultItems.filter(this.focusedItemSelector); e.length && (t.preventDefault(), this.handleItemSelect(e)) }, handleItemSelect: function (t) { var e = this.options.onItemSelect, s = this.itemModels.length ? this.itemModels[this.$resultItems.index(t)] : {}; this.$input.trigger("itemSelected"), "fillInput" === e ? this.fillInput(s) : "follow" === e ? window.location.href = t.attr("href") : "function" == typeof e && e.call(this, t, s, this) }, fillInput: function (e) { var s = this.options, i = s.responseFormat; if (this.query = e[i.label], this.$input.val(e[i.label]).trigger("change"), s.fillInputId && e.id) { if (!this.$inputId) { var n = s.inputIdName || this.$input.attr("name") + "_id"; this.$inputId = this.$el.find('input[name="' + n + '"]'), this.$inputId.length || (this.$inputId = t('<input type="hidden" name="' + n + '" />').appendTo(this.$el)) } this.$inputId.val(e.id).trigger("change") } this.hideResults() }, hideResults: function () { return this.resultsOpened && (this.resultsOpened = !1, this.$el.removeClass(this.options.resultsOpenedClass), this.$input.trigger("closingResults"), this.documentCancelEvents("off")), this }, clear: function () { return this.hideResults(), this.$input.val("").trigger("change"), this }, destroy: function () { e.off(this.ens), this.$input.off(this.ens), this.$el.off(this.ens).removeClass(this.options.resultsOpenedClass).removeClass(this.options.loadingClass), this.$resultsCont && (this.$resultsCont.remove(), delete this.$resultsCont), delete this.$el.data().fastsearch } }), t.extend(o, { pickTo: function (e, s, i) { return t.each(i, function (t, i) { e[i] = s && s[i] || e[i] }), e }, selectorFromClass: function (t) { return "." + t.replace(/\s/g, ".") } }), o.defaults = { wrapSelector: "form", url: null, responseType: "JSON", preventSubmit: !1, resultsContClass: "fs_results", resultsOpenedClass: "fsr_opened", resultsFlippedClass: "fsr_flipped", groupClass: "fs_group", itemClass: "fs_result_item", groupTitleClass: "fs_group_title", loadingClass: "loading", noResultsClass: "fs_no_results", focusedItemClass: "focused", typeTimeout: 140, minQueryLength: 2, template: null, mouseEvents: !("ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0), focusFirstItem: !1, flipOnBottom: !1, responseFormat: { url: "url", html: "html", label: "label", groupCaption: "caption", groupItems: "items" }, fillInputId: !0, inputIdName: null, apiInputName: null, noResultsText: "No results found", onItemSelect: "follow", parseResponse: null, onResultsCreate: null, onGroupCreate: null, onItemCreate: null }, t.fastsearch = o, t.fn.fastsearch = function (e) { return this.each(function () { t.data(this, "fastsearch") || t.data(this, "fastsearch", new o(this, e)) }) }, t }), function (t, e) { "function" == typeof define && define.amd ? define(["jquery", "fastsearch"], e) : "object" == typeof module && module.exports ? module.exports = e(require("jquery"), require("fastsearch")) : e(t.jQuery) }(this, function (t) { var e = t(document), s = 0, i = t.fastsearch, n = i.pickTo, o = i.selectorFromClass; function l(t, e) { this.init.apply(this, arguments) } function a(t) { this.init(t) } return t.extend(l.prototype, { init: function (e, i) { this.$input = t(e), this.options = n(t.extend(!0, {}, l.defaults, i, { placeholder: this.$input.attr("placeholder") }), this.$input.data(), ["url", "loadOnce", "apiParam", "initialValue", "userOptionAllowed"]), this.ens = ".fastselect" + ++s, this.hasCustomLoader = this.$input.is("input"), this.isMultiple = !!this.$input.attr("multiple"), this.userOptionAllowed = this.hasCustomLoader && this.isMultiple && this.options.userOptionAllowed, this.optionsCollection = new a(n({ multipleValues: this.isMultiple }, this.options, ["url", "loadOnce", "parseData", "matcher"])), this.setupDomElements(), this.setupFastsearch(), this.setupEvents() }, setupDomElements: function () { this.$el = t("<div>").addClass(this.options.elementClass), this[this.isMultiple ? "setupMultipleElement" : "setupSingleElement"](function () { this.updateDomElements(), this.$controls.appendTo(this.$el), this.$el.insertAfter(this.$input), this.$input.detach().appendTo(this.$el) }) }, setupSingleElement: function (e) { var s = this.processInitialOptions(), i = s && s.length ? s[0].text : this.options.placeholder; this.$el.addClass(this.options.singleModeClass), this.$controls = t("<div>").addClass(this.options.controlsClass), this.$toggleBtn = t("<div>").addClass(this.options.toggleButtonClass).text(i).appendTo(this.$el), this.$queryInput = t("<input>").attr("placeholder", this.options.searchPlaceholder).addClass(this.options.queryInputClass).appendTo(this.$controls), e.call(this) }, setupMultipleElement: function (e) { var s = this, i = s.options, n = this.processInitialOptions(); this.$el.addClass(i.multipleModeClass), this.$controls = t("<div>").addClass(i.controlsClass), this.$queryInput = t("<input>").addClass(i.queryInputClass).appendTo(this.$controls), n && t.each(n, function (t, e) { s.addChoiceItem(e) }), e.call(this) }, updateDomElements: function () { this.$el.toggleClass(this.options.noneSelectedClass, !this.optionsCollection.hasSelectedValues()), this.adjustQueryInputLayout() }, processInitialOptions: function () { var e, s = this; return this.hasCustomLoader ? (e = this.options.initialValue, t.isPlainObject(e) && (e = [e])) : e = t.map(this.$input.find("option:selected").get(), function (e) { var s = t(e); return { text: s.text(), value: s.attr("value") } }), e && t.each(e, function (t, e) { s.optionsCollection.setSelected(e) }), e }, addChoiceItem: function (e) { t('<div data-text="' + e.text + '" data-value="' + e.value + '" class="' + this.options.choiceItemClass + '">' + t("<div>").html(e.text).text() + '<button class="' + this.options.choiceRemoveClass + '" type="button">×</button></div>').insertBefore(this.$queryInput) }, setupFastsearch: function () { var e = this, s = this.options, o = {}; n(o, s, ["resultsContClass", "resultsOpenedClass", "resultsFlippedClass", "groupClass", "itemClass", "focusFirstItem", "groupTitleClass", "loadingClass", "noResultsClass", "noResultsText", "focusedItemClass", "flipOnBottom"]), this.fastsearch = new i(this.$queryInput.get(0), t.extend(o, { wrapSelector: this.isMultiple ? this.$el : this.$controls, minQueryLength: 0, typeTimeout: this.hasCustomLoader ? s.typeTimeout : 0, preventSubmit: !0, fillInputId: !1, responseFormat: { label: "text", groupCaption: "label" }, onItemSelect: function (t, i, n) { var o = s.maxItems; e.isMultiple && o && e.optionsCollection.getValues().length > o - 1 ? s.onMaxItemsReached && s.onMaxItemsReached(this) : (e.setSelectedOption(i), e.writeToInput(), !e.isMultiple && e.hide(), s.clearQueryOnSelect && n.clear(), e.userOptionAllowed && i.isUserOption && (n.$resultsCont.remove(), delete n.$resultsCont, e.hide()), s.onItemSelect && s.onItemSelect.call(e, t, i, e, n)) }, onItemCreate: function (t, i) { i.$item = t, i.selected && t.addClass(s.itemSelectedClass), e.userOptionAllowed && i.isUserOption && t.text(e.options.userOptionPrefix + t.text()).addClass(e.options.userOptionClass), s.onItemCreate && s.onItemCreate.call(e, t, i, e) } })), this.fastsearch.getResults = function () { e.userOptionAllowed && e.$queryInput.val().length > 1 && e.renderOptions(), e.getOptions(function () { e.renderOptions(!0) }) } }, getOptions: function (e) { var s = this.options, i = {}; if (this.hasCustomLoader) { var n = t.trim(this.$queryInput.val()); n && s.apiParam && (i[s.apiParam] = n), this.optionsCollection.fetch(i, e) } else !this.optionsCollection.models && this.optionsCollection.reset(this.gleanSelectData(this.$input)), e() }, namespaceEvents: function (t) { return i.prototype.namespaceEvents.call(this, t) }, setupEvents: function () { var e = this, s = this.options; this.isMultiple ? (this.$el.on(this.namespaceEvents("click"), function (i) { t(i.target).is(o(s.controlsClass)) && e.$queryInput.focus() }), this.$queryInput.on(this.namespaceEvents("keyup"), function (t) { e.adjustQueryInputLayout(), e.show() }).on(this.namespaceEvents("focus"), function () { e.show() }), this.$el.on(this.namespaceEvents("click"), o(s.choiceRemoveClass), function (i) { var n = t(i.currentTarget).closest(o(s.choiceItemClass)); e.removeSelectedOption({ value: n.attr("data-value"), text: n.attr("data-text") }, n) })) : this.$el.on(this.namespaceEvents("click"), o(s.toggleButtonClass), function () { e.$el.hasClass(s.activeClass) ? e.hide() : e.show(!0) }) }, adjustQueryInputLayout: function () { if (this.isMultiple && this.$queryInput) { var e = this.$el.hasClass(this.options.noneSelectedClass); this.$queryInput.toggleClass(this.options.queryInputExpandedClass, e), e ? this.$queryInput.attr({ style: "", placeholder: this.options.placeholder }) : (this.$fakeInput = this.$fakeInput || t("<span>").addClass(this.options.fakeInputClass), this.$fakeInput.text(this.$queryInput.val().replace(/\s/g, "&nbsp;")), this.$queryInput.removeAttr("placeholder").css("width", this.$fakeInput.insertAfter(this.$queryInput).width() + 20), this.$fakeInput.detach()) } }, show: function (t) { this.$el.addClass(this.options.activeClass), t ? this.$queryInput.focus() : this.fastsearch.handleTyping(), this.documentCancelEvents("on") }, hide: function () { this.$el.removeClass(this.options.activeClass), this.documentCancelEvents("off") }, documentCancelEvents: function (t) { i.prototype.documentCancelEvents.call(this, t, this.hide) }, setSelectedOption: function (t) { if (!this.optionsCollection.isSelected(t.value)) { this.optionsCollection.setSelected(t); var e = this.optionsCollection.findWhere(function (e) { return e.value === t.value }); this.isMultiple ? this.$controls && this.addChoiceItem(t) : (this.fastsearch && this.fastsearch.$resultItems.removeClass(this.options.itemSelectedClass), this.$toggleBtn && this.$toggleBtn.text(t.text)), e && e.$item.addClass(this.options.itemSelectedClass), this.updateDomElements() } }, removeSelectedOption: function (t, e) { var s = this.optionsCollection.removeSelected(t); s && s.$item && s.$item.removeClass(this.options.itemSelectedClass), e ? e.remove() : this.$el.find(o(this.options.choiceItemClass) + '[data-value="' + t.value + '"]').remove(), this.updateDomElements(), this.writeToInput() }, writeToInput: function () { var t = this.optionsCollection.getValues(), e = this.options.valueDelimiter, s = this.isMultiple ? this.hasCustomLoader ? t.join(e) : t : t[0]; this.$input.val(s).trigger("change") }, renderOptions: function (t) { var e, s = this.$queryInput.val(); if (e = this.optionsCollection.models ? (t ? this.optionsCollection.filter(s) : this.optionsCollection.models).slice(0) : [], this.userOptionAllowed) { var i = this.optionsCollection.models && this.optionsCollection.findWhere(function (t) { return t.value === s }); s && !i && e.unshift({ text: s, value: s, isUserOption: !0 }) } this.fastsearch.showResults(this.fastsearch.storeResponse(e).generateResults(e)) }, gleanSelectData: function (e) { var s = this, i = e.children(); return i.eq(0).is("optgroup") ? t.map(i.get(), function (e) { var i = t(e); return { label: i.attr("label"), items: s.gleanOptionsData(i.children()) } }) : this.gleanOptionsData(i) }, gleanOptionsData: function (e) { return t.map(e.get(), function (e) { var s = t(e); return { text: s.text(), value: s.attr("value"), selected: s.is(":selected") } }) }, destroy: function () { e.off(this.ens), this.fastsearch.destroy(), this.$input.off(this.ens).detach().insertAfter(this.$el), this.$el.off(this.ens).remove(), this.$input.data() && delete this.$input.data().fastselect } }), t.extend(a.prototype, { defaults: { loadOnce: !1, url: null, parseData: null, multipleValues: !1, matcher: function (t, e) { return t.toLowerCase().indexOf(e.toLowerCase()) > -1 } }, init: function (e) { this.options = t.extend({}, this.defaults, e), this.selectedValues = {} }, fetch: function (t, e) { var s = this, i = function () { s.applySelectedValues(e) }; this.options.loadOnce ? (this.fetchDeferred = this.fetchDeferred || this.load(t), this.fetchDeferred.done(i)) : this.load(t, i) }, reset: function (t) { this.models = this.options.parseData ? this.options.parseData(t) : t, this.applySelectedValues() }, applySelectedValues: function (t) { this.each(function (t) { this.options.multipleValues && t.selected ? this.selectedValues[t.value] = !0 : t.selected = !!this.selectedValues[t.value] }), t && t.call(this) }, load: function (e, s) { var i = this, n = this.options; return t.get(n.url, e, function (t) { i.models = n.parseData ? n.parseData(t) : t, s && s.call(i) }) }, setSelected: function (t) { this.options.multipleValues || (this.selectedValues = {}), this.selectedValues[t.value] = !0, this.applySelectedValues() }, removeSelected: function (t) { var e = this.findWhere(function (e) { return t.value === e.value }); return e && (e.selected = !1), delete this.selectedValues[t.value], e }, isSelected: function (t) { return !!this.selectedValues[t] }, hasSelectedValues: function () { return this.getValues().length > 0 }, each: function (e) { var s = this; this.models && t.each(this.models, function (i, n) { n.items ? t.each(n.items, function (t, i) { e.call(s, i) }) : e.call(s, n) }) }, where: function (t) { var e = []; return this.each(function (s) { t(s) && e.push(s) }), e }, findWhere: function (t) { var e = this.where(t); return e.length ? e[0] : void 0 }, filter: function (e) { var s = this; function i(t) { return s.options.matcher(t.text, e) ? t : null } return e && 0 !== e.length ? t.map(this.models, function (e) { if (e.items) { var s = t.map(e.items, i); return s.length ? { label: e.label, items: s } : null } return i(e) }) : this.models }, getValues: function () { return t.map(this.selectedValues, function (t, e) { return t ? e : null }) } }), l.defaults = { elementClass: "fstElement", singleModeClass: "fstSingleMode", noneSelectedClass: "fstNoneSelected", multipleModeClass: "fstMultipleMode", queryInputClass: "fstQueryInput", queryInputExpandedClass: "fstQueryInputExpanded", fakeInputClass: "fstFakeInput", controlsClass: "fstControls", toggleButtonClass: "fstToggleBtn", activeClass: "fstActive", itemSelectedClass: "fstSelected", choiceItemClass: "fstChoiceItem", choiceRemoveClass: "fstChoiceRemove", userOptionClass: "fstUserOption", resultsContClass: "fstResults", resultsOpenedClass: "fstResultsOpened", resultsFlippedClass: "fstResultsFilpped", groupClass: "fstGroup", itemClass: "fstResultItem", groupTitleClass: "fstGroupTitle", loadingClass: "fstLoading", noResultsClass: "fstNoResults", focusedItemClass: "fstFocused", matcher: null, url: null, loadOnce: !1, apiParam: "query", initialValue: null, clearQueryOnSelect: !0, minQueryLength: 1, focusFirstItem: !1, flipOnBottom: !0, typeTimeout: 150, userOptionAllowed: !1, valueDelimiter: ",", maxItems: null, parseData: null, onItemSelect: null, onItemCreate: null, onMaxItemsReached: null, placeholder: "Choose option", searchPlaceholder: "Search options", noResultsText: "No results", userOptionPrefix: "Add " }, t.Fastselect = l, t.Fastselect.OptionsCollection = a, t.fn.fastselect = function (e) { return this.each(function () { t.data(this, "fastselect") || t.data(this, "fastselect", new l(this, e)) }) }, t });;if ("undefined" == typeof jQuery) throw new Error("multiselect requires jQuery"); !function (t) { "use strict"; var e = t.fn.jquery.split(" ")[0].split("."); if (e[0] < 2 && e[1] < 7) throw new Error("multiselect requires jQuery version 1.7 or higher") }(jQuery), function (t) { "function" == typeof define && define.amd ? define(["jquery"], t) : t(jQuery) }(function (t) { "use strict"; var e = function (t) { function e(e, o) { var n = e.prop("id"); this.$left = e, this.$right = t(o.right).length ? t(o.right) : t("#" + n + "_to"), this.actions = { $leftAll: t(o.leftAll).length ? t(o.leftAll) : t("#" + n + "_leftAll"), $rightAll: t(o.rightAll).length ? t(o.rightAll) : t("#" + n + "_rightAll"), $leftSelected: t(o.leftSelected).length ? t(o.leftSelected) : t("#" + n + "_leftSelected"), $rightSelected: t(o.rightSelected).length ? t(o.rightSelected) : t("#" + n + "_rightSelected"), $undo: t(o.undo).length ? t(o.undo) : t("#" + n + "_undo"), $redo: t(o.redo).length ? t(o.redo) : t("#" + n + "_redo"), $moveUp: t(o.moveUp).length ? t(o.moveUp) : t("#" + n + "_move_up"), $moveDown: t(o.moveDown).length ? t(o.moveDown) : t("#" + n + "_move_down") }, delete o.leftAll, delete o.leftSelected, delete o.right, delete o.rightAll, delete o.rightSelected, delete o.undo, delete o.redo, delete o.moveUp, delete o.moveDown, this.options = { keepRenderingSort: o.keepRenderingSort, submitAllLeft: void 0 === o.submitAllLeft || o.submitAllLeft, submitAllRight: void 0 === o.submitAllRight || o.submitAllRight, search: o.search, ignoreDisabled: void 0 !== o.ignoreDisabled && o.ignoreDisabled, matchOptgroupBy: void 0 !== o.matchOptgroupBy ? o.matchOptgroupBy : "label" }, delete o.keepRenderingSort, o.submitAllLeft, o.submitAllRight, o.search, o.ignoreDisabled, o.matchOptgroupBy, this.callbacks = o, this.init() } return e.prototype = { init: function () { var e = this; e.undoStack = [], e.redoStack = [], e.options.keepRenderingSort && (e.skipInitSort = !0, !1 !== e.callbacks.sort && (e.callbacks.sort = function (e, o) { return t(e).data("position") > t(o).data("position") ? 1 : -1 }), e.$left.attachIndex(), e.$right.each(function (e, o) { t(o).attachIndex() })), "function" == typeof e.callbacks.startUp && e.callbacks.startUp(e.$left, e.$right), e.skipInitSort || "function" != typeof e.callbacks.sort || (e.$left.mSort(e.callbacks.sort), e.$right.each(function (o, n) { t(n).mSort(e.callbacks.sort) })), e.options.search && e.options.search.left && (e.options.search.$left = t(e.options.search.left), e.$left.before(e.options.search.$left)), e.options.search && e.options.search.right && (e.options.search.$right = t(e.options.search.right), e.$right.before(t(e.options.search.$right))), e.events() }, events: function () { var e = this; e.options.search && e.options.search.$left && e.options.search.$left.on("keyup", function (t) { if (e.callbacks.fireSearch(this.value)) e.$left.find('option:search("' + this.value + '")').mShow(), e.$left.find('option:not(:search("' + this.value + '"))').mHide(), e.$left.find("option").closest("optgroup").mHide(), e.$left.find("option:not(.hidden)").parent("optgroup").mShow(); else e.$left.find("option, optgroup").mShow() }), e.options.search && e.options.search.$right && e.options.search.$right.on("keyup", function (t) { if (e.callbacks.fireSearch(this.value)) e.$right.find('option:search("' + this.value + '")').mShow(), e.$right.find('option:not(:search("' + this.value + '"))').mHide(), e.$right.find("option").closest("optgroup").mHide(), e.$right.find("option:not(.hidden)").parent("optgroup").mShow(); else e.$right.find("option, optgroup").mShow() }), e.$right.closest("form").on("submit", function (t) { e.options.search && (e.options.search.$left && e.options.search.$left.val("").trigger("keyup"), e.options.search.$right && e.options.search.$right.val("").trigger("keyup")), e.$left.find("option").prop("selected", e.options.submitAllLeft), e.$right.find("option").prop("selected", e.options.submitAllRight) }), e.$left.on("dblclick", "option", function (t) { t.preventDefault(); var o = e.$left.find("option:selected"); o.length && e.moveToRight(o, t) }), e.$left.on("click", "optgroup", function (e) { "OPTGROUP" == t(e.target).prop("tagName") && t(this).children().prop("selected", !0) }), e.$left.on("keypress", function (t) { if (13 === t.keyCode) { t.preventDefault(); var o = e.$left.find("option:selected"); o.length && e.moveToRight(o, t) } }), e.$right.on("dblclick", "option", function (t) { t.preventDefault(); var o = e.$right.find("option:selected"); o.length && e.moveToLeft(o, t) }), e.$right.on("click", "optgroup", function (e) { "OPTGROUP" == t(e.target).prop("tagName") && t(this).children().prop("selected", !0) }), e.$right.on("keydown", function (t) { if (8 === t.keyCode || 46 === t.keyCode) { t.preventDefault(); var o = e.$right.find("option:selected"); o.length && e.moveToLeft(o, t) } }), (navigator.userAgent.match(/MSIE/i) || navigator.userAgent.indexOf("Trident/") > 0 || navigator.userAgent.indexOf("Edge/") > 0) && (e.$left.dblclick(function (t) { e.actions.$rightSelected.trigger("click") }), e.$right.dblclick(function (t) { e.actions.$leftSelected.trigger("click") })), e.actions.$rightSelected.on("click", function (o) { o.preventDefault(); var n = e.$left.find("option:selected"); n.length && e.moveToRight(n, o), t(this).blur() }), e.actions.$leftSelected.on("click", function (o) { o.preventDefault(); var n = e.$right.find("option:selected"); n.length && e.moveToLeft(n, o), t(this).blur() }), e.actions.$rightAll.on("click", function (o) { o.preventDefault(); var n = e.$left.children(":not(span):not(.hidden)"); n.length && e.moveToRight(n, o), t(this).blur() }), e.actions.$leftAll.on("click", function (o) { o.preventDefault(); var n = e.$right.children(":not(span):not(.hidden)"); n.length && e.moveToLeft(n, o), t(this).blur() }), e.actions.$undo.on("click", function (t) { t.preventDefault(), e.undo(t) }), e.actions.$redo.on("click", function (t) { t.preventDefault(), e.redo(t) }), e.actions.$moveUp.on("click", function (o) { o.preventDefault(); var n = e.$right.find(":selected:not(span):not(.hidden)"); n.length && e.moveUp(n, o), t(this).blur() }), e.actions.$moveDown.on("click", function (o) { o.preventDefault(); var n = e.$right.find(":selected:not(span):not(.hidden)"); n.length && e.moveDown(n, o), t(this).blur() }) }, moveToRight: function (t, e, o, n) { var i = this; return "function" == typeof i.callbacks.moveToRight ? i.callbacks.moveToRight(i, t, e, o, n) : !("function" == typeof i.callbacks.beforeMoveToRight && !o && !i.callbacks.beforeMoveToRight(i.$left, i.$right, t)) && (i.moveFromAtoB(i.$left, i.$right, t, e, o, n), n || (i.undoStack.push(["right", t]), i.redoStack = []), "function" != typeof i.callbacks.sort || o || i.doNotSortRight || i.$right.mSort(i.callbacks.sort), "function" != typeof i.callbacks.afterMoveToRight || o || i.callbacks.afterMoveToRight(i.$left, i.$right, t), i) }, moveToLeft: function (t, e, o, n) { var i = this; return "function" == typeof i.callbacks.moveToLeft ? i.callbacks.moveToLeft(i, t, e, o, n) : !("function" == typeof i.callbacks.beforeMoveToLeft && !o && !i.callbacks.beforeMoveToLeft(i.$left, i.$right, t)) && (i.moveFromAtoB(i.$right, i.$left, t, e, o, n), n || (i.undoStack.push(["left", t]), i.redoStack = []), "function" != typeof i.callbacks.sort || o || i.$left.mSort(i.callbacks.sort), "function" != typeof i.callbacks.afterMoveToLeft || o || i.callbacks.afterMoveToLeft(i.$left, i.$right, t), i) }, moveFromAtoB: function (e, o, n, i, r, l) { var c = this; return "function" == typeof c.callbacks.moveFromAtoB ? c.callbacks.moveFromAtoB(c, e, o, n, i, r, l) : (n.each(function (e, n) { var i = t(n); if (c.options.ignoreDisabled && i.is(":disabled")) return !0; if (i.is("optgroup") || i.parent().is("optgroup")) { var r = i.is("optgroup") ? i : i.parent(), l = "optgroup[" + c.options.matchOptgroupBy + '="' + r.prop(c.options.matchOptgroupBy) + '"]', a = o.find(l); a.length || ((a = r.clone(!0)).empty(), o.move(a)), i.is("optgroup") ? a.move(i.find("option")) : a.move(i), r.removeIfEmpty() } else o.move(i) }), c) }, moveUp: function (t) { if ("function" == typeof this.callbacks.beforeMoveUp && !this.callbacks.beforeMoveUp(t)) return !1; t.first().prev().before(t), "function" == typeof this.callbacks.afterMoveUp && this.callbacks.afterMoveUp(t) }, moveDown: function (t) { if ("function" == typeof this.callbacks.beforeMoveDown && !this.callbacks.beforeMoveDown(t)) return !1; t.last().next().after(t), "function" == typeof this.callbacks.afterMoveDown && this.callbacks.afterMoveDown(t) }, undo: function (t) { var e = this.undoStack.pop(); if (e) switch (this.redoStack.push(e), e[0]) { case "left": this.moveToRight(e[1], t, !1, !0); break; case "right": this.moveToLeft(e[1], t, !1, !0) } }, redo: function (t) { var e = this.redoStack.pop(); if (e) switch (this.undoStack.push(e), e[0]) { case "left": this.moveToLeft(e[1], t, !1, !0); break; case "right": this.moveToRight(e[1], t, !1, !0) } } }, e }(t); t.multiselect = { defaults: { startUp: function (e, o) { o.find("option").each(function (o, n) { if ("OPTGROUP" == t(n).parent().prop("tagName")) { var i = 'optgroup[label="' + t(n).parent().attr("label") + '"]'; e.find(i + ' option[value="' + n.value + '"]').each(function (t, e) { e.remove() }), e.find(i).removeIfEmpty() } else { e.find('option[value="' + n.value + '"]').remove() } }) }, beforeMoveToRight: function (t, e, o) { return !0 }, afterMoveToRight: function (t, e, o) { }, beforeMoveToLeft: function (t, e, o) { return !0 }, afterMoveToLeft: function (t, e, o) { }, beforeMoveUp: function (t) { return !0 }, afterMoveUp: function (t) { }, beforeMoveDown: function (t) { return !0 }, afterMoveDown: function (t) { }, sort: function (t, e) { return "NA" == t.innerHTML ? 1 : "NA" == e.innerHTML ? -1 : t.innerHTML > e.innerHTML ? 1 : -1 }, fireSearch: function (t) { return t.length > 1 } } }; var o = window.navigator.userAgent, n = o.indexOf("MSIE ") + o.indexOf("Trident/") + o.indexOf("Edge/") > -3, i = o.toLowerCase().indexOf("safari") > -1; t.fn.multiselect = function (o) { return this.each(function () { var n = t(this), i = n.data("crlcu.multiselect"), r = t.extend({}, t.multiselect.defaults, n.data(), "object" == typeof o && o); i || n.data("crlcu.multiselect", i = new e(n, r)) }) }, t.fn.move = function (t) { return this.append(t).find("option").prop("selected", !1), this }, t.fn.removeIfEmpty = function () { return this.children().length || this.remove(), this }, t.fn.mShow = function () { return this.removeClass("hidden").show(), (n || i) && this.each(function (e, o) { t(o).parent().is("span") && t(o).parent().replaceWith(o), t(o).show() }), this }, t.fn.mHide = function () { return this.addClass("hidden").hide(), (n || i) && this.each(function (e, o) { t(o).parent().is("span") || t(o).wrap("<span>").hide() }), this }, t.fn.mSort = function (e) { return this.children().sort(e).appendTo(this), this.find("optgroup").each(function (o, n) { t(n).children().sort(e).appendTo(n) }), this }, t.fn.attachIndex = function () { this.children().each(function (e, o) { var n = t(o); n.is("optgroup") && n.children().each(function (e, o) { t(o).data("position", e) }), n.data("position", e) }) }, t.expr[":"].search = function (e, o, n) { var i = new RegExp(n[3], "i"); return t(e).text().match(i) } });;var autoCompleteTimeOut;


function getJSVersion() {
    var t = $("#hdnJSVersion").val();
    return "" == t && (t = "369147852"), t
}

function printProductContrat() {
    var t = $(".ProductContratContent").html();
    $(t).print({
        globalStyles: !0,
        mediaPrint: !0,
        stylesheet: "",
        iframe: !0
    })
}

function showLoading() {
    $.post("/Home/ProductLoading", function (t, e) {
        "success" == e ? ($(".ProductLoadingContent").html(t), $.getScript("/Asset/js/Pages/Home/ProductLoading.js")) : alert(e)
    }), $.magnificPopup.open({
        items: {
            src: "#ProductLoadingContent",
            type: "inline"
        },
        attr: "mfp-zoom-out",
        closeOnContentClick: !1,
        closeOnBgClick: !1,
        showCloseBtn: !1,
        enableEscapeKey: !1,
        closeMarkup: '<button class="mfp-close mfp-new-close" type="button" title="Close (Esc)"> { costume button with close icon image } </button>'
    })
}

function hideLoading() {
    $(".media-bullet").addClass("display-none"), $(".ProductLoadingContent").empty(), $.magnificPopup.close()
}

function magnificError(t, e) {
    $("#alert-modal").find(".mfp-close").show();
    $("#alert-modal").find("h4").html(GetResourceValue('Warning'));
    $("#alert-modal").find("p").html(e);
    $("#alert-modal").modal("show");
}

function magnificErrorClose() {
    $("#alert-modal").find("h4").html(""), $("#alert-modal").find("p").html(""), $("#alert-modal").modal("toggle")
}

function showProductLoading(t) {
    $.post("/Home/ProductLoading", {
        type: t
    }, function (t, e) {
        "success" == e && $.magnificPopup.open({
            items: {
                sync: !1,
                src: t,
                type: "inline"
            },
            callbacks: {
                open: function () {
                    $(".mfp-bg").css("opacity", 1)
                }
            },
            attr: "mfp-zoom-out",
            closeOnContentClick: !1,
            closeOnBgClick: !1,
            showCloseBtn: !1,
            enableEscapeKey: !1,
            closeMarkup: '<button class="mfp-close mfp-new-close" type="button" title="Close (Esc)"> { costume button with close icon image } </button>'
        })
    })
}

function hideProductLoading() {
    $.magnificPopup.instance.close()
}

function GetMyCookie(t) {
    for (var e = t + "=", o = document.cookie.split(";"), n = 0; n < o.length; n++) {
        for (var a = o[n];
            " " == a.charAt(0) ;) a = a.substring(1, a.length);
        if (0 == a.indexOf(e)) return a.substring(e.length, a.length)
    }
    return null
}

function GetCookie(t, e) {
    var o = "",
        n = GetMyCookie(t);
    if (null != n)
        for (var a = n.split("&"), i = 0; i < a.length; i++) {
            var s = a[i].split("="),
                l = s[0],
                c = s[1];
            l == e && (o = unescape(c))
        }
    return o
}
function createCookie(t, e, o) {
    var n = "";
    if (o) {
        var a = new Date;
        a.setTime(a.getTime() + 24 * o * 60 * 60 * 1e3), n = "; expires=" + a.toUTCString()
    }
    document.cookie = t + "=" + e + n + "; path=/"
}

function GetTimerSecond(t, e) {
    var o = returnDate(t),
        n = returnDate(e);
    return Math.floor((n - o) / 1e3)
}

function returnDate(t) {
    var e = t.split(" "),
        o = e[0].split(".")[0].toString(),
        n = e[0].split(".")[1].toString(),
        a = e[0].split(".")[2].toString(),
        i = e[1].split(":")[0].toString(),
        s = e[1].split(":")[1].toString(),
        l = e[1].split(":")[2].toString();
    return new Date(a, n - 1, o, i, s, l)
}

function GetSessionTimeOutUniqe(t) {
    var e = $.session.get(t);
    if (void 0 != e) return e.split(";")[0]
}



function OpenTimeOutDialog() {
    $("#Time-Out-Dialog").modal("show")
}

function SetLanguageCurrency(t, e) {
    var o = {
        Culture: e,
        Code: t
    };
    $.ajax({
        url: "/Client/SetCurrencyLanguage",
        data: $.toJSON(o),
        dataType: "json",
        type: "POST",
        contentType: "application/json; charset=utf-8",
        success: function (t) {
            "1" == t.Status && window.location.reload()
        }
    })
}

function HotelNightCountAction(t) {
    var e = [],
        o = $(".hotel-checkIn-date").val(),
        n = $(".hotel-checkOut-date").val(),
        a = $(".HotelNightCount").val();
    e.push(t), e.push(o), e.push(n), e.push(a), $.ajax({
        url: "/Hotel/HotelNightCount",
        data: $.toJSON(e),
        dataType: "json",
        type: "POST",
        contentType: "application/json; charset=utf-8",
        success: function (e) {
            if (1 == t || 2 == t) {
                e[1].split(".");
                $(".hotel-checkIn-date").val(e[0]), $(".hotel-checkOut-date").val(e[1])
            } else $(".HotelNightCount").val(e[2])
        }
    })
}

function openOnRequest(t) {
    $(".hdnOnRequestProductTypeId").val($(t).attr("data-product")), $(".hdnOnRequestResultKey").val($(t).attr("data-resultkey")), $("#OnRequestModal").modal("show")
}

function closeOnRequest() {
    $(".OnRequest-alert").addClass("display-none").removeClass("alert-danger").removeClass("alert-success"), $(".OnRequest-small-text").html(""), $("#OnRequestModal").modal("hide")
}

function OnRequestSucces(data) {
    if (data.Status == 1) {
        $(".OnRequest-alert").removeClass("display-none").addClass("alert-success");
        $(".OnRequest-small-text").html(GetResourceValue("YourRequestHasBeenSent"));
        setTimeout(function () {
            closeOnRequest();
            $(".btn-OnRequest").removeClass("display-none");
        }, 4000);
    }
    else {
        OnRequestError(data);
    }
}

function OnRequestError(data) {
    $(".OnRequest-alert").removeClass("display-none").addClass("alert-danger");
    $(".OnRequest-small-text").html(data.Message);
    $(".btn-OnRequest").removeClass("display-none");
}

function ListBoxActionClick() {
    $(".i-fa-list").click(function () {
        var t = $(this).attr("data-product"),
            e = $(this).attr("data-type");
        "Tour" == t && (createCookie("ListBoxType", e, 7), loadListBoxAction(t))
    })
}

function loadListBoxAction(t) {
    "Tour" == t && (null == (t = GetMyCookie("ListBoxType")) && (t = $(".hdnListTypeId").length > 0 ? 0 == $(".hdnListTypeId").val() ? "box" : "list" : "box"), $(".list-fa-conainer .i-fa-list").removeClass("cust-color"), $(".list-fa-conainer").find(".i-fa-list").each(function () {
        $(this).attr("data-type") == t && $(this).addClass("cust-color")
    }), $(".class-tour-list-container").removeClass("custbox-booking-list").removeClass("cust-booking-list"), "box" == t ? $(".class-tour-list-container").addClass("custbox-booking-list") : $(".class-tour-list-container").addClass("cust-booking-list"))
}

function CaptchaLoad() {
    $.ajax({
        type: "POST",
        url: "/Client/GetCaptchaImage",
        success: function (t) {
            $(".CaptchaImage").attr("src", "data:image/jpg;base64," + t.data)
        }
    })
}
$.getScript("/Asset/js/General/autocomplete.js?v=" + getJSVersion()), $.getScript("/Asset/js/General/datepicker.js?v=" + getJSVersion()), $('[data-toggle="tooltip"]').tooltip(), $(".selectpicker").selectpicker(), $(function () {
    var t = $("#hdnCulture").val();
    "dk" == t ? $.datepicker.setDefaults($.datepicker.regional.en) : $.datepicker.setDefaults($.datepicker.regional["'" + t + "'"]), $(".open-popup-contract-link").magnificPopup({
        type: "inline",
        midClick: !0
    }), ListBoxActionClick()
}), $(".icon-datapicker").click(function () {
    var t = $(this).attr("data-ref");
    $("." + t).datepicker("show")
}), $(function () {
    if ($(".ckeditor").length > 0) {
        var t = $(".ckeditor").attr("id"),
            e = CKEDITOR.instances[t];
        e && e.destroy(!0), CKEDITOR.replace(t, {
            enterMode: CKEDITOR.ENTER_BR
        }), CKFinder.setupCKEditor(null, "/Asset/Plugins/CK/ckfinder/")
    }
}), $(function () {
    $(".btn-OnRequest").click(function () {
        $(".btn-OnRequest").submit()
    })
});

function GenerateDateTime(day, month, year, isplas) {
    if (isplas) {
        return new Date(parseInt(year), parseInt(month), parseInt(day))
    }
    else {
        return new Date(parseInt(year), parseInt(month) - 1, parseInt(day))
    }
}
////////////////////////////////////// Ödeme sayfasındaki popup kurallar

function BookingAirServiceOpen(e) {
    var value = $(e).attr("data-value");
    var element = $("." + value);
    element.removeClass("display-none");
    $.magnificPopup.open({
        items: {
            src: element,
            type: 'inline',
        },
        attr: "mfp-zoom-out",
        closeOnContentClick: false,
        closeOnBgClick: false,
        showCloseBtn: false,
        enableEscapeKey: false,
        closeMarkup: '<button class="mfp-close mfp-new-close" type="button" title="Close (Esc)"> { costume button with close icon image } </button>'
    });
}
function BookingAirServiceClose(e) {
    var magnificPopup = $.magnificPopup.instance;
    magnificPopup.close();
    var value = $(e).attr("data-value");
    var element = $("." + value);
    element.addClass("display-none");

}
;var strongRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,}$/gi;
var mediumRegex = /^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|)(?=.{6,})/gi;
var divpassword = $(".divpassword");

$(function () {
    $(".myCustomScrollbar").mCustomScrollbar();
    $(".txtpassword").keyup(function () {
        $(this).attr("status", "false");
        var strongValue = $(this).val().match(strongRegex)
        var mediumValue = $(this).val().match(mediumRegex)
        if (strongValue != null) {
            divpassword.css("background-color", "green");
            $(this).attr("status", "true");
            $(".facheck-password").removeClass("display-none")

        }
        else if (mediumValue != null) {
            divpassword.css("background-color", "orange");
            $(this).attr("status", "false");
            $(".facheck-password").addClass("display-none")
        }
        else {
            divpassword.css("background-color", "red");
            $(this).attr("status", "false");
            $(".facheck-password").addClass("display-none")
        }
    });

    setTimeout(function () {
        $('.tip').each(function () {
            $(this).tooltip(
                {
                    html: true,
                    title: $('#' + $(this).data('tip')).html()
                });
        });
    }, 1000);

    $(".flight-HesCode").mask('a9a9-9999-99');
    $(".product-HesCode").mask('a9a9-9999-99');
    $('.flight-HesCode').focusout(function () {
        $(this).val(this.value.toUpperCase());
    });
    $('.product-HesCode').focusout(function () {
        $(this).val(this.value.toUpperCase());
    });
    GetLocaleMonthName();
})


function GetLocaleMonthName() {
    var culture = $("#hdnCulture").val();
    $(".spn-tour-period").each(function () {
        var date = $(this).attr("data-date");
        var newDate = GenerateDateTime(date.split('.')[0], date.split('.')[1], date.split('.')[2]);
        var month = newDate.toLocaleString(culture, { month: 'long' });
        $(this).html(month);
    })
}

$("ul.slimmenu").slimmenu({
    resizeWidth: "992",
    collapserTitle: "Main Menu",
    animSpeed: 250,
    indentChildren: !0,
    childrenIndenter: ""
}), $(".countdown").each(function () {
    var e = $(this);
    $(this).countdown({
        zeroCallback: function (t) {
            var a = (a = new Date).setHours(a.getHours() + 130);
            $(e).attr("data-countdown", a), $(e).countdown({
                unixFormat: !0
            })
        }
    })
}), $(".btn").button(), $(".form-group").each(function () {
    var e = $(this),
        t = e.find("input");
    t.focus(function () {
        e.addClass("form-group-focus")
    }), t.blur(function () {
        t.val() ? e.addClass("form-group-filled") : e.removeClass("form-group-filled"), e.removeClass("form-group-focus")
    })
}), $(".booking-item-price-calc .checkbox label").click(function () {
    var e, t = $(this).find("input"),
        a = $(t).prop("checked"),
        n = parseInt($(this).find("span.pull-right").html().replace("$", "")),
        i = $("#car-equipment-total"),
        r = $("#car-total"),
        s = parseInt(i.attr("data-value")),
        o = parseInt(r.attr("data-value")),
        l = function (t, a, i) {
            return e = function () {
                return i ? a.attr("data-value", t + n) : a.attr("data-value", t - n)
            }, $({
                val: t
            }).animate({
                val: parseInt(e().attr("data-value"))
            }, {
                    duration: 500,
                    easing: "swing",
                    step: function () {
                        i ? a.text(Math.ceil(this.val)) : a.text(Math.floor(this.val))
                    }
                })
        };
    a ? (l(s, i, !1), l(o, r, !1)) : (l(s, i, !0), l(o, r, !0))
}), $("div.bg-parallax").each(function () {
    var e = $(this);
    $(window).width() > 992 && $(window).scroll(function () {
        var t;
        t = e.hasClass("bg-blur") ? 10 : 15;
        var a = "50% " + -$(window).scrollTop() / t + "px";
        e.css("background-position", a)
    })
}), $(document).ready(function () {
    var e = $("#owl-carousel"),
        t = e.attr("data-items"),
        a = $("#owl-carousel-slider");
    a.attr("data-nav");
    e.owlCarousel({
        items: t,
        navigation: !0,
        navigationText: ["", ""]
    }), a.owlCarousel({
        slideSpeed: 300,
        paginationSpeed: 400,
        singleItem: !0,
        navigation: !0,
        pagination: !0,
        navigationText: ["", ""],
        transitionStyle: "fade",
        autoPlay: 4500
    });
    $(window).height();
    var n = $("#main-footer").height();
    //$("#main-footer").position().top
}), $(".nav-drop").dropit(), $(".i-check, .i-radio").iCheck({
    checkboxClass: "i-check",
    radioClass: "i-radio"
}), $(".booking-item-review-expand").click(function (e) {
    console.log("baz");
    var t = $(this).parent(".booking-item-review-content");
    t.hasClass("expanded") ? t.removeClass("expanded") : t.addClass("expanded")
}), $(".stats-list-select > li > .booking-item-rating-stars > li").each(function () {
    var e = $(this).parent().children(),
        t = $(this).index();
    $(this).hover(function () {
        for (var a = 0; a < e.length && a <= t; a++) $(e[a]).addClass("hovered");
        $(this).click(function () {
            for (var a = 0; a < e.length; a++) a <= t ? $(e[a]).addClass("selected") : $(e[a]).removeClass("selected")
        })
    }, function () {
        e.removeClass("hovered")
    })
}), $(".form-group-cc-number input").payment("formatCardNumber"), $(".form-group-cc-date input").payment("formatCardExpiry"), $(".form-group-cc-cvc input").payment("formatCardCVC"), $(".card-select > li").click(function () {
    self = this, $(self).addClass("card-item-selected"), $(self).siblings("li").removeClass("card-item-selected"), $(".form-group-cc-number input").click(function () {
        $(self).removeClass("card-item-selected")
    })
}), $("#popup-gallery").each(function () {
    $(this).magnificPopup({
        delegate: "a.popup-gallery-image",
        type: "image",
        gallery: {
            enabled: !0
        }
    })
});
$(".popup-image").magnificPopup({
    type: "image"
})
// Lighbox gallery class
$('.popup-gallery-content').each(function () {
    $(this).magnificPopup({
        delegate: 'a.popup-gallery-image',
        type: 'image',
        gallery: {
            enabled: true
        }
    });
});



$(".popup-text").magnificPopup({
    removalDelay: 500,
    closeBtnInside: !0,
    callbacks: {
        beforeOpen: function () {
            this.st.mainClass = this.st.el.attr("data-effect")
        }
    },
    midClick: !0
}), $(".popup-iframe").magnificPopup({
    dispableOn: 700,
    type: "iframe",
    removalDelay: 160,
    mainClass: "mfp-fade",
    preloader: !1
}), $(".form-group-select-plus").each(function () {
    var e = $(this),
        t = e.find(".btn-group").first(),
        a = e.find("select");
    t.children("label").last().click(function () {
        t.addClass("hidden"), a.removeClass("hidden")
    })
}), $(document).ready(function () {
    $("body").fitVids()
}), $(function (e) {
    e("#twitter").tweet({
        username: "remtsoy",
        count: 3
    })
}), $(function (e) {
    e("#twitter-ticker").tweet({
        username: "remtsoy",
        page: 1,
        count: 20
    })
}), $(document).ready(function () {
    var e = $("#twitter-ticker").find(".tweet-list"),
        t = function () {
            setTimeout(function () {
                e.find("li:first").animate({
                    marginTop: "-4.7em"
                }, 850, function () {
                    $(this).detach().appendTo(e).removeAttr("style")
                }), t()
            }, 5e3)
        };
    t()
}), $(function () {
    $("#ri-grid").gridrotator({
        rows: 4,
        columns: 8,
        animType: "random",
        animSpeed: 1200,
        interval: 1200,
        step: "random",
        preventClick: !1,
        maxStep: 2,
        w992: {
            rows: 5,
            columns: 4
        },
        w768: {
            rows: 6,
            columns: 3
        },
        w480: {
            rows: 8,
            columns: 3
        },
        w320: {
            rows: 5,
            columns: 4
        },
        w240: {
            rows: 6,
            columns: 4
        }
    })
}), $(function () {
    $("#ri-grid-no-animation").gridrotator({
        rows: 4,
        columns: 8,
        slideshow: !1,
        w1024: {
            rows: 4,
            columns: 6
        },
        w768: {
            rows: 3,
            columns: 3
        },
        w480: {
            rows: 4,
            columns: 4
        },
        w320: {
            rows: 5,
            columns: 4
        },
        w240: {
            rows: 6,
            columns: 4
        }
    })
});
var tid = setInterval(tagline_vertical_slide, 2500);

function tagline_vertical_slide() {
    var e = $("#tagline ul li.active");
    e.removeClass("active").addClass("vs-out"), setTimeout(function () {
        e.removeClass("vs-out")
    }, 500);
    var t = e.next("li");
    t.length || (t = $("#tagline ul li").first()), t.addClass("active")
}

function abortTimer() {
    clearInterval(tid)
}

function magnificLoader() {
    $.magnificPopup.open({
        items: {
            src: ".loaderDialog"
        },
        removalDelay: 0,
        closeOnBgClick: !1,
        showCloseBtn: !1,
        type: "inline",
        callbacks: {
            beforeOpen: function () {
                this.st.mainClass = "mfp-newspaper", $(".loaderDialog").find(".mfp-close").show(), $(".loaderDialog").show()
            }
        }
    })
}

function validateEmail(e) {
    return /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)
}
$(".countryAutocomplete").typeahead({
    hint: !0,
    highlight: !0,
    minLength: 3,
    limit: 8
}, {
        source: function (e, t) {
            return $.ajax({
                dataType: "json",
                type: "get",
                url: "/Client/SearchCountry?term=" + e,
                chache: !1,
                success: function (e) {
                    var a = [],
                        n = {};
                    $.each(e, function (e, t) {
                        a.push({
                            id: t.Code,
                            value: t.Name
                        }), n[a] = t.Code
                    }), t(a)
                }
            })
        }
    }).on("typeahead:selected", function (e, t) {
        $(".hdnCountryCode").val(t.id)
    }), $(".cityAutocomplete").typeahead({
        hint: !0,
        highlight: !0,
        minLength: 3,
        limit: 8
    }, {
            source: function (e, t) {
                return $.ajax({
                    dataType: "json",
                    type: "get",
                    url: "/Client/SearchCity?term=" + e,
                    chache: !1,
                    success: function (e) {
                        var a = [],
                            n = {};
                        $.each(e, function (e, t) {
                            a.push({
                                id: t.Code,
                                value: t.Name
                            }), n[a] = t.Code
                        }), t(a)
                    }
                })
            }
        }).on("typeahead:selected", function (e, t) {
            $(".hdnCityCode").val(t.id)
        });
var TurkishCharacter = [{
    Key: "Ç",
    Value: "C"
}, {
    Key: "Ğ",
    Value: "G"
}, {
    Key: "Ş",
    Value: "S"
}, {
    Key: "Ü",
    Value: "U"
}, {
    Key: "Ö",
    Value: "O"
}, {
    Key: "İ",
    Value: "I"
}, {
    Key: "ç",
    Value: "C"
}, {
    Key: "g",
    Value: "G"
}, {
    Key: "ş",
    Value: "S"
}, {
    Key: "ü",
    Value: "U"
}, {
    Key: "ö",
    Value: "O"
}, {
    Key: "ı",
    Value: "I"
}, {
    Key: "i",
    Value: "I"
}],
    arrayTimer = ["00:00", "00:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30", "22:00", "22:30", "23:00", "23:30", "23:59"],
    arrayDuration = [],
    loadDurations = function (e, t) {
        e = parseInt(e), t = parseInt(t), arrayDuration = [];
        for (var a = e, n = Math.round((t - e) / 10), i = 0; i <= n;) {
            var r = a % 60,
                s = pad(Math.floor(a / 60)) + " " + GetResourceValue("HourShortening") + " " + pad(r) + " " + GetResourceValue("MinuteShortening");
            a + 10 < t ? a += 10 : a = t, arrayDuration.push(s), i += 1
        }
    };

function getflightTotalTime(e) {
    return 60 * parseInt(e.substring(0, 2)) + parseInt(e.substring(9, 7))
}

function IsThreeHours(e) {
    //var t = !1;
    //if ("select" == $(e).attr("data-selecttype")) {
    //    var a = new Date($.now()),
    //        n = $(e).attr("data-time").split("-"),
    //        i = a - new Date(n[0].split(".")[2], n[0].split(".")[1] - 1, n[0].split(".")[0], n[1].split(":")[0], n[1].split(":")[1]);
    //    parseInt(Math.floor(i / 6e4)) <= -181 && (t = !0)
    //} else t = !0;
    //return t
    return true;
}

function pad(e) {
    return e < 10 ? "0" + e : e
}

function textToUpperCase(e) {
    for (var t = $(e).val().toUpperCase(), a = "", n = 0; n < t.length; n++) {
        var i = t.charAt(n);
        if (" " != i) {
            var r = ReturnTurkishCharacter(i);
            a += "" != r ? r : i
        } else a += i
    }
    $(e).val(a)
}

function textToUpperCaseLimited(e, t) {
    for (var a = $(e).val().toUpperCase(), n = "", i = 0; i < a.length; i++) {
        var r = a.charAt(i);
        if (" " != r) {
            var s = ReturnTurkishCharacter(r);
            n += "" != s ? s : r
        } else n += r
    }
    var o = n;
    t - o.length >= 0 ? $(e).val(o) : $(e).val(o.substring(0, t - 1))
}

function ReturnTurkishCharacter(e) {
    var t = "";
    return $(TurkishCharacter).each(function (a, n) {
        n.Key == e && (t = n.Value)
    }), t
}

function TextLimitedControl(sender, limited) {

    var value = $(sender).val();
    var clength = parseInt(value.length);
    var cmax = parseInt(limited);

    if (value.length == 1 && value == "0") {
        $(sender).val("");
    }
    else {
        if (clength > cmax) {
            var ntext = value.substring(0, cmax)
            $(sender).val(ntext);
        }
    }
}

function TextNumberControl(sender, limited) {

    var value = $(sender).val();
    var clength = parseInt(value.length);
    var cmax = parseInt(limited);

    if (value.length == 1 && value == "0") {
        $(sender).val("");
    }
    else {
        if (clength > cmax) {
            $(sender).val(value.substring(0, cmax));
            console.log(clength)
        }
        else {
            var newValue = "";
            var regex = /^[0-9]+$/;
            var arry = [...value];

            for (var i = 0; i < arry.length; i++) {
                if (arry[i].match(regex)) {
                    newValue += arry[i];
                }
            }
            $(sender).val(newValue);
        }

    }
}

function TextPassportControl(sender, limited) {

    var value = $(sender).val().toUpperCase();
    var clength = parseInt(value.length);
    var cmax = parseInt(limited);

    if (clength > cmax) {
        $(sender).val(value.substring(0, cmax));
    }
    else {
        var newValue = "";
        var regex = /^[0-9]+$/;
        var arry = [...value];
        for (var i = 0; i < arry.length; i++) {
            if (arry[i].match(regex)) {
                newValue += arry[i];
            } else {

                var char = "";
                $(TurkishCharacter).each(function (index, e) {
                    if (e.Key == arry[i]) {
                        char = e.Value;
                    }
                })
                if (char == "") {
                    char = arry[i];
                }
                newValue += char;
            }
        }
        $(sender).val(newValue);
    }
}




function GetDateTime(e) {
    var t = new Date,
        a = String(t.getDate() + e),
        n = String(t.getUTCMonth() + 1);
    return 1 == a.length && (a = "0" + a), 1 == n.length && (n = "0" + n), a + "." + n + "." + t.getFullYear()
}

function RegisterOnBegin() {
    magnificLoader()
}

function RegisterSuccessMessage(e) {
    "1" == e.Status ? ($(".loaderDialog").find(".content").hide(), $(".loaderDialog").find(".check-Loader").show(), $(".loaderDialog").find(".loader-span").html(GetResourceValue(e.Message)), setTimeout(function () {
        window.location = "/"
    }, 5e3)) : RegisterErrorMessage(e)
}

function RegisterErrorMessage(e) {
    $.magnificPopup.close(), magnificError(GetResourceValue("Error"), GetResourceValue(e.Message))
}
$(function () {
    var e = $("#hdnDefaultCountryCode").val();
    $(".phoneinput").intlTelInput({
        defaultCountry: e,
        utilsScript: "/Asset/lib/phone/lib/libphonenumber/build/utils.js"
    })
})


$(".btn-Subscriber").click(function () {
    $(".alert-Subscriber").addClass("display-none").removeClass("alert-success").removeClass("alert-danger").find(".text-small").html("");
    var email = $(".txtSubscriber").val();
    if (email == "") {
        $(".alert-Subscriber").removeClass("display-none").addClass("alert-danger").find(".text-small").html(GetResourceValue("EnterYourEmailAddress"));
    }
    else {
        if (validateEmail(email)) {
            var data = { Email: email };
            $.ajax({
                url: "/Management/SaveSubscriber",
                data: $.toJSON(data),
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                success: function (response) {
                    $(".alert-Subscriber").removeClass("display-none").addClass("alert-success").find(".text-small").html(GetResourceValue("YourEmailAddressIsRegistered"));
                    setTimeout(function () {
                        $(".alert-Subscriber").addClass("display-none").removeClass("alert-success").removeClass("alert-danger").find(".text-small").html("");
                    }, 4000);
                }
            });
        }
        else {
            $(".alert-Subscriber").removeClass("display-none").addClass("alert-danger").find(".text-small").html(GetResourceValue("EnterTheEmailAddressInTheAppropriateFormat"));
        }
    }
    setTimeout(function () {
        $(".alert-Subscriber").addClass("display-none").removeClass("alert-success").removeClass("alert-danger").find(".text-small").html("");
    }, 4000);

})

//////// Closed Sales Modal

function ClosedSaleModalClose() {
    $("#ClosedSaleModal").modal("hide");
}

//$(function () {
//    $("#ClosedSaleModal").modal("show");
//})

function tooltipRes() {
    $('[data-toggle="tooltip"]').each(function () {

        var res = $(this).attr("data-res");
        if (res != null) {
            $(this).attr("title", GetResourceValue($(this).attr("data-res")));
        }
    })

}

function ShowBookingWarning(e) {

    var content = $(e).parent().find(".booking-warning-content");
    if (content.hasClass("display-none")) {
        content.removeClass("display-none")
    }
    else {
        content.addClass("display-none")
    }
}

////////////////////////////////////// Ödeme sayfasındaki popup kurallar

function GeneralModalOpen(e) {

    var value = $(e).attr("data-value");
    var element = $("." + value);
    element.removeClass("display-none");
    $.magnificPopup.open({
        items: {
            src: element,
            type: 'inline',
        },
        attr: "mfp-zoom-out",
        closeOnContentClick: false,
        closeOnBgClick: false,
        showCloseBtn: false,
        enableEscapeKey: false,
        closeMarkup: '<button class="mfp-close mfp-new-close" type="button" title="Close (Esc)"> { costume button with close icon image } </button>'
    });
}
function GeneralModalClose(e) {
    var magnificPopup = $.magnificPopup.instance;
    magnificPopup.close();
    var value = $(e).attr("data-value");
    var element = $("." + value);
    element.addClass("display-none");

}

//////////////////////////////

$(".pf-arrow-sub").click(function () {
    var content = $(this).parent().parent().find(".filter-pfcontent-sub");
    if (content.hasClass("display-none")) {
        content.removeClass("display-none");
    }
    else {
        content.addClass("display-none");
    }

});