/*! * Minified Utility Resources * Theme Core resources. */ !(function (t) { function e(t, e) { var n = t.options.animationSpeed / 1e3; return e.css({ transition: n + "s right, " + n + "s left, " + n + "s top, " + n + "s bottom, " + n + "s height, " + n + "s width" }), !0; } function n(t) { return t.css({ transition: "none" }), !0; } var o = { width: 400, height: "65%", minimizedWidth: 200, gutter: 10, poppedOutDistance: "6%", title: function () { return ""; }, dialogClass: "", buttons: [], animationSpeed: 400, opacity: 1, initialState: "modal", showClose: !0, showPopout: !0, showMinimize: !0, create: void 0, open: void 0, beforeClose: void 0, close: void 0, beforeMinimize: void 0, minimize: void 0, beforeRestore: void 0, restore: void 0, beforePopout: void 0, popout: void 0, }, i = "dockmodal", l = (t(window).width(), { init: function (n) { return this.each(function () { var r = t(this), a = r.data("dockmodal"); if ( ((r.options = t.extend({}, o, n)), (function () { "function" == typeof r.options.title && (r.options.title = r.options.title.call(r)); })(), a) ) return ( t("body").append(r.closest("." + i).show()), l.refreshLayout(), void setTimeout(function () { l.restore.apply(r); }, r.options.animationSpeed) ); r.data("dockmodal", r); var s = t("body"), c = t(window), u = t("
").addClass(i).addClass(r.options.dialogClass); "modal" == r.options.initialState ? u.addClass("popped-out") : "minimized" == r.options.initialState && u.addClass("minimized"), u.height(0), e(r, u); var p = t("
").addClass(i + "-header"); r.options.showClose && t('') .appendTo(p) .click(function () { return l.destroy.apply(r), !1; }), r.options.showPopout && t('') .appendTo(p) .click(function () { return u.hasClass("popped-out") ? l.restore.apply(r) : l.popout.apply(r), !1; }), r.options.showMinimize && t('') .appendTo(p) .click(function () { return u.hasClass("minimized") ? (u.hasClass("popped-out") ? l.popout.apply(r) : l.restore.apply(r)) : l.minimize.apply(r), !1; }), r.options.showMinimize && r.options.showPopout && p.click(function () { return u.hasClass("minimized") ? (u.hasClass("popped-out") ? l.popout.apply(r) : l.restore.apply(r)) : l.minimize.apply(r), !1; }), p.append('
' + (r.options.title || r.attr("title")) + "
"), u.append(p); var d = t('').insertAfter(r); r.placeholder = d; var h = t("
") .addClass(i + "-body") .append(r); if ((u.append(h), r.options.buttons.length)) { var f = t("
").addClass(i + "-footer"), v = t("
").addClass(i + "-footer-buttonset"); f.append(v), t.each(r.options.buttons, function (e, n) { var o = t(''); o.attr({ id: n.id, class: n.buttonClass }), o.html(n.html), o.click(function (t) { return n.click(t, r), !1; }), v.append(o); }), u.append(f); } else u.addClass("no-footer"); var m = t("." + i + "-overlay"); m.length || (m = t("
").addClass(i + "-overlay")), t.isFunction(r.options.create) && r.options.create(r), s.append(u), u.after(m), h.focus(), t.isFunction(r.options.open) && setTimeout(function () { r.options.open(r); }, r.options.animationSpeed), u.hasClass("minimized") ? (u.find(".dockmodal-body, .dockmodal-footer").hide(), l.minimize.apply(r)) : u.hasClass("popped-out") ? l.popout.apply(r) : l.restore.apply(r), s.data("windowWidth", c.width()), c.unbind("resize.dockmodal").bind("resize.dockmodal", function () { c.width() != s.data("windowWidth") && (s.data("windowWidth", c.width()), l.refreshLayout()); }); }); }, destroy: function () { return this.each(function () { var e = t(this).data("dockmodal"); if (e && (!t.isFunction(e.options.beforeClose) || e.options.beforeClose(e) !== !1)) try { var n = e.closest("." + i); n.css(n.hasClass("popped-out") && !n.hasClass("minimized") ? { left: "50%", right: "50%", top: "50%", bottom: "50%" } : { width: "0", height: "0" }), setTimeout(function () { e.removeData("dockmodal"), e.placeholder.replaceWith(e), n.remove(), t("." + i + "-overlay").hide(), l.refreshLayout(), t.isFunction(e.options.close) && e.options.close(e); }, e.options.animationSpeed); } catch (o) { alert(o.message); } }); }, close: function () { l.destroy.apply(this); }, minimize: function () { return this.each(function () { var e = t(this).data("dockmodal"); if (e && (!t.isFunction(e.options.beforeMinimize) || e.options.beforeMinimize(e) !== !1)) { var n = e.closest("." + i), o = n.find(".dockmodal-header").outerHeight(); n.addClass("minimized").css({ width: e.options.minimizedWidth + "px", height: o + "px", left: "auto", right: "auto", top: "auto", bottom: "0" }), setTimeout(function () { n.find(".dockmodal-body, .dockmodal-footer").hide(), t.isFunction(e.options.minimize) && e.options.minimize(e); }, e.options.animationSpeed), t("." + i + "-overlay").hide(), n.find(".action-minimize").attr("title", "Restore"), l.refreshLayout(); } }); }, restore: function () { return this.each(function () { var e = t(this).data("dockmodal"); if (e && (!t.isFunction(e.options.beforeRestore) || e.options.beforeRestore(e) !== !1)) { var n = e.closest("." + i); n.removeClass("minimized popped-out"), n.find(".dockmodal-body, .dockmodal-footer").show(), n.css({ width: e.options.width + "px", height: e.options.height, left: "auto", right: "auto", top: "auto", bottom: "0" }), t("." + i + "-overlay").hide(), n.find(".action-minimize").attr("title", "Minimize"), n.find(".action-popout").attr("title", "Pop-out"), setTimeout(function () { t.isFunction(e.options.restore) && e.options.restore(e); }, e.options.animationSpeed), l.refreshLayout(); } }); }, popout: function () { return this.each(function () { var o = t(this).data("dockmodal"); if (o && (!t.isFunction(o.options.beforePopout) || o.options.beforePopout(o) !== !1)) { var r = o.closest("." + i); r.find(".dockmodal-body, .dockmodal-footer").show(), n(r); var a = r.position(), s = t(window).width(); r.css({ width: "auto", height: "auto", left: a.left + "px", right: s - a.left - r.outerWidth(!0) + "px", top: a.top + "px", bottom: 0 }), e(o, r), setTimeout(function () { r .removeClass("minimized") .addClass("popped-out") .css({ width: "auto", height: "auto", left: o.options.poppedOutDistance, right: o.options.poppedOutDistance, top: o.options.poppedOutDistance, bottom: o.options.poppedOutDistance }), t("." + i + "-overlay").show(), r.find(".action-popout").attr("title", "Pop-in"), l.refreshLayout(); }, 10), setTimeout(function () { t.isFunction(o.options.popout) && o.options.popout(o); }, o.options.animationSpeed); } }); }, refreshLayout: function () { var e = 0, n = t(window).width(); t.each( t("." + i) .toArray() .reverse(), function () { var o = t(this), l = o.find("." + i + "-body > div").data("dockmodal"); (!o.hasClass("popped-out") || o.hasClass("minimized")) && ((e += l.options.gutter), o.css({ right: e + "px" }), (e += o.hasClass("minimized") ? l.options.minimizedWidth : l.options.width), e > n ? o.hide() : setTimeout(function () { o.show(); }, l.options.animationSpeed)); } ); }, }); t.fn.dockmodal = function (e) { return l[e] ? l[e].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof e && e ? void t.error("Method " + e + " does not exist on jQuery.dockmodal") : l.init.apply(this, arguments); }; })(jQuery), (function (t, e) { t.fn.adminpanel = function (n) { var o = { grid: ".admin-grid", draggable: !1, mobile: !1, preserveGrid: !1, onPanel: function () { console.log("callback:", "onPanel"); }, onStart: function () { console.log("callback:", "onStart"); }, onSave: function () { console.log("callback:", "onSave"); }, onDrop: function () { console.log("callback:", "onDrop"); }, onFinish: function () { console.log("callback:", "onFinish"); }, }, n = t.extend({}, o, n), i = t(this), l = (i.attr("id"), n.grid), r = n.draggable, a = n.mobile, s = n.preserveGrid, c = i.find(".panel"), u = "panel-settings_" + location.pathname, p = "panel-positions_" + location.pathname, d = localStorage.getItem(u), h = localStorage.getItem(p); t("body").on("click", ".panel-controls > a", function (e) { e.preventDefault(), t("body.ui-drag-active").length || f.controlHandlers.call(this, n); }); var f = { init: function (e) { t(this); if ( ("function" == typeof e.onStart && e.onStart(), h ? f.setPositions() : localStorage.setItem(p, f.findPositions()), d || localStorage.setItem(u, f.modifySettings()), t(l).each(function (e, n) { t(n).attr("id", "grid-" + e); }), s) ) { var n = "
"; t(l).each(function (e, o) { t(o).append(n); }); } f.createControls(e), f.createMobileControls(e), f.applySettings(), r === !0 && i.sortable({ items: i.find('.panel:not(".sort-disable")'), connectWith: l, cursor: "default", revert: 250, handle: ".panel-heading", opacity: 1, delay: 100, tolerance: "pointer", scroll: !0, placeholder: "panel-placeholder", forcePlaceholderSize: !0, forceHelperSize: !0, start: function (e, n) { t("body").addClass("ui-drag-active"), n.placeholder.height(n.helper.outerHeight() - 4); }, beforeStop: function () { "function" == typeof e.onDrop && e.onDrop(); }, stop: function () { t("body").removeClass("ui-drag-active"); }, update: function () { f.toggleLoader(), f.updatePositions(e); }, }), "function" == typeof e.onFinish && e.onFinish(); }, createMobileControls: function () { var e = c.find(".panel-controls"), n = {}; t.each(e, function (e, o) { var i = t(o), l = t(o).parents(".panel").attr("id"), r = i.width(), a = i.siblings(".panel-title").width(), s = (i.parent(".panel-heading").width(), r + a); n[l] = s; }), t.each(n, function (e, n) { var o = t("#" + e), i = o.width() - 75, l = o.find(".panel-controls"); if (a === !0 || n > i) { o.addClass("mobile-controls"); var r = { html: !0, placement: "left", content: function () { var e = t(this).clone(); return e; }, template: '', }; l.popover(r); } else l.removeClass("mobile-controls"); }), t(".mobile-controls .panel-heading > .panel-controls").on("click", function () { t(this).toggleClass("panel-controls-open"); }); }, applySettings: function () { var e = localStorage.getItem(u), n = JSON.parse(e), o = "panel-primary panel-success panel-info panel-warning panel-danger panel-alert panel-system panel-dark panel-default"; t.each(n, function (e, n) { t.each(n, function (e, n) { var i = n.id, l = n.title, r = n.collapsed, a = n.hidden, s = n.color, c = t("#" + i); l && c.children(".panel-heading").find(".panel-title:first").first().text(l), 1 === r && c.addClass("panel-collapsed").children(".panel-body:first, .panel-menu:first, .panel-footer:first").hide(), s && c.removeClass(o).addClass(s).attr("data-panel-color", s), 1 === a && c.addClass("panel-hidden");//.hide(); }); }); }, createControls: function () { var e = '', n = '', o = '', i = '', l = '', r = '', a = '', s = '', u = '', p = ''; c.each(function (c, d) { var h = t(d), f = h.children(".panel-heading"); t(e).appendTo(f); var v = h.attr("data-panel-title"), m = h.attr("data-panel-color"), g = h.attr("data-panel-collapse"), b = h.attr("data-panel-fullscreen"), y = h.attr("data-panel-remove"), C = h.attr("data-panel-callback"), w = h.attr("data-panel-dockable"), x = h.attr("data-panel-expose"), k = h.attr("data-panel-loader"); if (!k) { var S = f.find(".panel-controls"); t(p).appendTo(S); } if (x) { var S = f.find(".panel-controls"); t(u).appendTo(S); } if (w) { var S = f.find(".panel-controls"); t(s).appendTo(S); } if (C) { var S = f.find(".panel-controls"); t(a).appendTo(S); } if (!y) { var S = f.find(".panel-controls"); t(r).appendTo(S); } if (!v) { var S = f.find(".panel-controls"); t(n).appendTo(S); } if (!m) { var S = f.find(".panel-controls"); t(o).appendTo(S); } if (!g) { var S = f.find(".panel-controls"); t(i).appendTo(S); } if (!b) { var S = f.find(".panel-controls"); t(l).appendTo(S); } }); }, controlHandlers: function () { var o = t(this), l = (o.attr("class"), o.closest(".panel")), a = l.children(".panel-heading"), s = l.find(".panel-title"), c = function () { var t = function () { var t = l.find(".panel-editbox"); t.slideToggle("fast", function () { l.toggleClass("panel-editbox-open"), l.hasClass("panel-editbox-open") || (s.text(t.children("input").val()), f.updateSettings(n)); }); }; if (l.find(".panel-editbox").length) t(); else { var e = '
'; a.after(e); var o = l.find(".panel-editbox"); o.children("input").on("keyup", function () { s.text(o.children("input").val()); }), o.children("input").on("keypress", function (e) { 13 == e.which && t(); }), t(); } }, u = function () { if (!l.find(".panel-colorbox").length) { var e = '
'; a.after(e); } var o = l.find(".panel-colorbox"); o.on("click", "> span", function () { var e = t(this).data("panel-color"), o = "panel-primary panel-info panel-success panel-warning panel-danger panel-alert panel-system panel-dark panel-default panel-white"; l.removeClass(o).addClass(e).data("panel-color", e), f.updateSettings(n); }), o.slideToggle("fast", function () { l.toggleClass("panel-colorbox-open"); }); }, p = function () { l.toggleClass("panel-collapsed"), l.children(".panel-body, .panel-menu, .panel-footer").slideToggle("fast", function () { f.updateSettings(n); }); }, d = function () { t("body.panel-fullscreen-active").length ? (t("body").removeClass("panel-fullscreen-active"), l.removeClass("panel-fullscreen"), r === !0 && i.sortable("enable")) : (t("body").addClass("panel-fullscreen-active"), l.addClass("panel-fullscreen"), r === !0 && i.sortable("disable")), t(".panel-controls").removeClass("panel-controls-open"), t(".popover").popover("hide"), setTimeout(function () { t(e).trigger("resize"); }, 100); }, h = function () { bootbox.confirm ? bootbox.confirm("Are You Sure?!", function (t) { t && setTimeout(function () { l.addClass("panel-removed").hide(), f.updateSettings(n); }, 200); }) : (l.addClass("panel-removed").hide(), f.updateSettings(n)); }, v = function () { "function" == typeof n.onPanel && n.onPanel(); }, m = function () {}; t(this).hasClass("panel-control-collapse") && p(), t(this).hasClass("panel-control-title") && c(), t(this).hasClass("panel-control-color") && u(), t(this).hasClass("panel-control-fullscreen") && d(), t(this).hasClass("panel-control-remove") && h(), t(this).hasClass("panel-control-callback") && v(), t(this).hasClass("panel-control-expose") && m(), t(this).hasClass("panel-control-dockable") || t(this).hasClass("panel-control-loader") || f.toggleLoader.call(this); }, toggleLoader: function () { var e = t(this), n = e.closest(".panel"); n.addClass("panel-loader-active"), setTimeout(function () { n.removeClass("panel-loader-active"); }, 650); }, modifySettings: function () { var e = []; c.each(function (n, o) { var i = t(o), l = {}, r = (i.attr("id"), i.children(".panel-heading").find(".panel-title").text(), i.hasClass("panel-collapsed") ? 1 : 0, i.is(":hidden") ? 1 : 0, i.data("panel-color")); (l.id = i.attr("id")), (l.title = i.children(".panel-heading").find(".panel-title").text()), (l.collapsed = i.hasClass("panel-collapsed") ? 1 : 0), (l.hidden = i.is(":hidden") ? 1 : 0), (l.color = r ? r : null), e.push({ panel: l }); }); var n = JSON.stringify(e); return n; }, findPositions: function () { var e = i.find(l), n = []; e.each(function (e, o) { var i = t(o).find(".panel"), l = []; t(o).attr("id", "grid-" + e), i.each(function (e, n) { var o = t(n).attr("id"); l.push(o); }), (n[e] = l); }); var o = JSON.stringify(n); return o; }, setPositions: function () { var e = localStorage.getItem(p), n = JSON.parse(e); t(l).each(function (e, o) { var i = t(o); t.each(n[e], function (e, n) { t("#" + n).appendTo(i); }); }); }, updatePositions: function (t) { localStorage.setItem(p, f.findPositions()), "function" == typeof t.onSave && t.onSave(); }, updateSettings: function (t) { localStorage.setItem(u, f.modifySettings()), "function" == typeof t.onSave && t.onSave(); }, }; return this.each(function () { f.init.call(i, n); }); }; })(jQuery, window, document), (function (t, e) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? (module.exports = e(require("jquery"))) : (t.bootbox = e(t.jQuery)); })(this, function t(e, n) { "use strict"; function o(t) { var e = m[f.locale]; return e ? e[t] : m.en[t]; } function i(t, n, o) { t.stopPropagation(), t.preventDefault(); var i = e.isFunction(o) && o(t) === !1; i || n.modal("hide"); } function l(t) { var e, n = 0; for (e in t) n++; return n; } function r(t, n) { var o = 0; e.each(t, function (t, e) { n(t, e, o++); }); } function a(t) { var n, o; if ("object" != typeof t) throw new Error("Please supply an object of options"); if (!t.message) throw new Error("Please specify a message"); return ( (t = e.extend({}, f, t)), t.buttons || (t.buttons = {}), (t.backdrop = t.backdrop ? "static" : !1), (n = t.buttons), (o = l(n)), r(n, function (t, i, l) { if ((e.isFunction(i) && (i = n[t] = { callback: i }), "object" !== e.type(i))) throw new Error("button with key " + t + " must be an object"); i.label || (i.label = t), i.className || (i.className = 2 >= o && l === o - 1 ? "btn-primary" : "btn-default"); }), t ); } function s(t, e) { var n = t.length, o = {}; if (1 > n || n > 2) throw new Error("Invalid argument length"); return 2 === n || "string" == typeof t[0] ? ((o[e[0]] = t[0]), (o[e[1]] = t[1])) : (o = t[0]), o; } function c(t, n, o) { return e.extend(!0, {}, t, s(n, o)); } function u(t, e, n, o) { var i = { className: "bootbox-" + t, buttons: p.apply(null, e) }; return d(c(i, o, n), e); } function p() { for (var t = {}, e = 0, n = arguments.length; n > e; e++) { var i = arguments[e], l = i.toLowerCase(), r = i.toUpperCase(); t[l] = { label: o(r) }; } return t; } function d(t, e) { var o = {}; return ( r(e, function (t, e) { o[e] = !0; }), r(t.buttons, function (t) { if (o[t] === n) throw new Error("button key " + t + " is not allowed (options are " + e.join("\n") + ")"); }), t ); } var h = { dialog: "", header: "", footer: "", closeButton: "", form: "
", inputs: { text: "", textarea: "", email: "", select: "", checkbox: "
", date: "", time: "", number: "", password: "", }, }, f = { locale: "en", backdrop: !0, animate: !0, className: null, keyboard: !1, closeButton: !0, show: !0, container: "body" }, v = {}; (v.defineLocale = function (t, e) { return e ? ((m[t] = { OK: e.OK, CANCEL: e.CANCEL, CONFIRM: e.CONFIRM }), m[t]) : (delete m[t], null); }), (v.alert = function () { var t; if (((t = u("alert", ["ok"], ["message", "callback"], arguments)), t.callback && !e.isFunction(t.callback))) throw new Error("alert requires callback property to be a function when provided"); return ( (t.buttons.ok.callback = t.onEscape = function () { return e.isFunction(t.callback) ? t.callback() : !0; }), v.dialog(t) ); }), (v.confirm = function () { var t; if ( ((t = u("confirm", ["cancel", "confirm"], ["message", "callback"], arguments)), (t.buttons.cancel.callback = t.onEscape = function () { return t.callback(!1); }), (t.buttons.confirm.callback = function () { return t.callback(!0); }), !e.isFunction(t.callback)) ) throw new Error("confirm requires a callback"); return v.dialog(t); }), (v.prompt = function () { var t, o, i, l, a, s, u; if ( ((l = e(h.form)), (o = { className: "bootbox-prompt", buttons: p("cancel", "confirm"), value: "", inputType: "text" }), (t = d(c(o, arguments, ["title", "callback"]), ["cancel", "confirm"])), (s = t.show === n ? !0 : t.show), (t.message = l), (t.buttons.cancel.callback = t.onEscape = function () { return t.callback(null); }), (t.buttons.confirm.callback = function () { var n; switch (t.inputType) { case "text": case "textarea": case "email": case "select": case "date": case "time": case "number": case "password": n = a.val(); break; case "checkbox": var o = a.find("input:checked"); (n = []), r(o, function (t, o) { n.push(e(o).val()); }); } return t.callback(n); }), (t.show = !1), !t.title) ) throw new Error("prompt requires a title"); if (!e.isFunction(t.callback)) throw new Error("prompt requires a callback"); if (!h.inputs[t.inputType]) throw new Error("invalid prompt type"); switch (((a = e(h.inputs[t.inputType])), t.inputType)) { case "text": case "textarea": case "email": case "date": case "time": case "number": case "password": a.val(t.value); break; case "select": var f = {}; if (((u = t.inputOptions || []), !u.length)) throw new Error("prompt with select requires options"); r(u, function (t, o) { var i = a; if (o.value === n || o.text === n) throw new Error("given options in wrong format"); o.group && (f[o.group] || (f[o.group] = e("").attr("label", o.group)), (i = f[o.group])), i.append(""); }), r(f, function (t, e) { a.append(e); }), a.val(t.value); break; case "checkbox": var m = e.isArray(t.value) ? t.value : [t.value]; if (((u = t.inputOptions || []), !u.length)) throw new Error("prompt with checkbox requires options"); if (!u[0].value || !u[0].text) throw new Error("given options in wrong format"); (a = e("
")), r(u, function (n, o) { var i = e(h.inputs[t.inputType]); i.find("input").attr("value", o.value), i.find("label").append(o.text), r(m, function (t, e) { e === o.value && i.find("input").prop("checked", !0); }), a.append(i); }); } return ( t.placeholder && a.attr("placeholder", t.placeholder), t.pattern && a.attr("pattern", t.pattern), l.append(a), l.on("submit", function (t) { t.preventDefault(), t.stopPropagation(), i.find(".btn-primary").click(); }), (i = v.dialog(t)), i.off("shown.bs.modal"), i.on("shown.bs.modal", function () { a.focus(); }), s === !0 && i.modal("show"), i ); }), (v.dialog = function (t) { t = a(t); var o = e(h.dialog), l = o.find(".modal-dialog"), s = o.find(".modal-body"), c = t.buttons, u = "", p = { onEscape: t.onEscape }; if (e.fn.modal === n) throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details."); if ( (r(c, function (t, e) { (u += ""), (p[t] = e.callback); }), s.find(".bootbox-body").html(t.message), t.animate === !0 && o.addClass("fade"), t.className && o.addClass(t.className), "large" === t.size && l.addClass("modal-lg"), "small" === t.size && l.addClass("modal-sm"), t.title && s.before(h.header), t.closeButton) ) { var d = e(h.closeButton); t.title ? o.find(".modal-header").prepend(d) : d.css("margin-top", "-10px").prependTo(s); } return ( t.title && o.find(".modal-title").html(t.title), u.length && (s.after(h.footer), o.find(".modal-footer").html(u)), o.on("hidden.bs.modal", function (t) { t.target === this && o.remove(); }), o.on("shown.bs.modal", function () { o.find(".btn-primary:first").focus(); }), o.on("escape.close.bb", function (t) { p.onEscape && i(t, o, p.onEscape); }), o.on("click", ".modal-footer button", function (t) { var n = e(this).data("bb-handler"); i(t, o, p[n]); }), o.on("click", ".bootbox-close-button", function (t) { i(t, o, p.onEscape); }), o.on("keyup", function (t) { 27 === t.which && o.trigger("escape.close.bb"); }), e(t.container).append(o), o.modal({ backdrop: t.backdrop, keyboard: t.keyboard || !1, show: !1 }), t.show && o.modal("show"), o ); }), (v.setDefaults = function () { var t = {}; 2 === arguments.length ? (t[arguments[0]] = arguments[1]) : (t = arguments[0]), e.extend(f, t); }), (v.hideAll = function () { return e(".bootbox").modal("hide"), v; }); var m = { br: { OK: "OK", CANCEL: "Cancelar", CONFIRM: "Sim" }, cs: { OK: "OK", CANCEL: "Zrušit", CONFIRM: "Potvrdit" }, da: { OK: "OK", CANCEL: "Annuller", CONFIRM: "Accepter" }, de: { OK: "OK", CANCEL: "Abbrechen", CONFIRM: "Akzeptieren" }, el: { OK: "Εντάξει", CANCEL: "Ακύρωση", CONFIRM: "Επιβεβαίωση" }, en: { OK: "OK", CANCEL: "Cancel", CONFIRM: "OK" }, es: { OK: "OK", CANCEL: "Cancelar", CONFIRM: "Aceptar" }, et: { OK: "OK", CANCEL: "Katkesta", CONFIRM: "OK" }, fi: { OK: "OK", CANCEL: "Peruuta", CONFIRM: "OK" }, fr: { OK: "OK", CANCEL: "Annuler", CONFIRM: "D'accord" }, he: { OK: "אישור", CANCEL: "ביטול", CONFIRM: "אישור" }, hu: { OK: "OK", CANCEL: "Mégsem", CONFIRM: "Megerősít" }, hr: { OK: "OK", CANCEL: "Odustani", CONFIRM: "Potvrdi" }, id: { OK: "OK", CANCEL: "Batal", CONFIRM: "OK" }, it: { OK: "OK", CANCEL: "Annulla", CONFIRM: "Conferma" }, ja: { OK: "OK", CANCEL: "キャンセル", CONFIRM: "確認" }, lt: { OK: "Gerai", CANCEL: "Atšaukti", CONFIRM: "Patvirtinti" }, lv: { OK: "Labi", CANCEL: "Atcelt", CONFIRM: "Apstiprināt" }, nl: { OK: "OK", CANCEL: "Annuleren", CONFIRM: "Accepteren" }, no: { OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, pl: { OK: "OK", CANCEL: "Anuluj", CONFIRM: "Potwierdź" }, pt: { OK: "OK", CANCEL: "Cancelar", CONFIRM: "Confirmar" }, ru: { OK: "OK", CANCEL: "Отмена", CONFIRM: "Применить" }, sv: { OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, tr: { OK: "Tamam", CANCEL: "İptal", CONFIRM: "Onayla" }, zh_CN: { OK: "OK", CANCEL: "取消", CONFIRM: "确认" }, zh_TW: { OK: "OK", CANCEL: "取消", CONFIRM: "確認" }, }; return ( (v.init = function (n) { return t(n || e); }), v ); }), !(function (t) { "use strict"; function e(t) { return ko.isObservable(t) && !(void 0 === t.destroyAll); } function n(t, e) { for (var n = 0; n < t.length; ++n) e(t[n]); } function o(e, n) { (this.$select = t(e)), (this.options = this.mergeOptions(t.extend({}, n, this.$select.data()))), (this.originalOptions = this.$select.clone()[0].options), (this.query = ""), (this.searchTimeout = null), (this.options.multiple = "multiple" === this.$select.attr("multiple")), (this.options.onChange = t.proxy(this.options.onChange, this)), (this.options.onDropdownShow = t.proxy(this.options.onDropdownShow, this)), (this.options.onDropdownHide = t.proxy(this.options.onDropdownHide, this)), (this.options.onDropdownShown = t.proxy(this.options.onDropdownShown, this)), (this.options.onDropdownHidden = t.proxy(this.options.onDropdownHidden, this)), this.buildContainer(), this.buildButton(), this.buildDropdown(), this.buildSelectAll(), this.buildDropdownOptions(), this.buildFilter(), this.updateButtonText(), this.updateSelectAll(), this.options.disableIfEmpty && t("option", this.$select).length <= 0 && this.disable(), this.$select.hide().after(this.$container); } "undefined" != typeof ko && ko.bindingHandlers && !ko.bindingHandlers.multiselect && (ko.bindingHandlers.multiselect = { init: function (o, i, l) { var r = l().selectedOptions, a = ko.utils.unwrapObservable(i()); t(o).multiselect(a), e(r) && (t(o).multiselect("select", ko.utils.unwrapObservable(r)), r.subscribe( function (e) { var i = [], l = []; n(e, function (t) { switch (t.status) { case "added": i.push(t.value); break; case "deleted": l.push(t.value); } }), i.length > 0 && t(o).multiselect("select", i), l.length > 0 && t(o).multiselect("deselect", l); }, null, "arrayChange" )); }, update: function (n, o, i) { var l = i().options, r = t(n).data("multiselect"), a = ko.utils.unwrapObservable(o()); e(l) && l.subscribe(function () { t(n).multiselect("rebuild"); }), r ? r.updateOriginalOptions() : t(n).multiselect(a); }, }), (o.prototype = { defaults: { buttonText: function (e, n) { if (0 === e.length) return this.nonSelectedText + ' '; if (e.length == t("option", t(n)).length) return this.allSelectedText + ' '; if (e.length > this.numberDisplayed) return e.length + " " + this.nSelectedText + ' '; var o = ""; return ( e.each(function () { var e = void 0 !== t(this).attr("label") ? t(this).attr("label") : t(this).html(); o += e + ", "; }), o.substr(0, o.length - 2) + ' ' ); }, buttonTitle: function (e) { if (0 === e.length) return this.nonSelectedText; var n = ""; return ( e.each(function () { n += t(this).text() + ", "; }), n.substr(0, n.length - 2) ); }, label: function (e) { return t(e).attr("label") || t(e).html(); }, onChange: function () {}, onDropdownShow: function () {}, onDropdownHide: function () {}, onDropdownShown: function () {}, onDropdownHidden: function () {}, buttonClass: "btn btn-default", buttonWidth: "auto", buttonContainer: '
', dropRight: !1, selectedClass: "active", maxHeight: !1, checkboxName: !1, includeSelectAllOption: !1, includeSelectAllIfMoreThan: 0, selectAllText: " Select all", selectAllValue: "multiselect-all", selectAllName: !1, enableFiltering: !1, enableCaseInsensitiveFiltering: !1, enableClickableOptGroups: !1, filterPlaceholder: "Search", filterBehavior: "text", includeFilterClearBtn: !0, preventInputChangeEvent: !1, nonSelectedText: "None selected", nSelectedText: "selected", allSelectedText: "All selected", numberDisplayed: 3, disableIfEmpty: !1, templates: { button: '', ul: '', filter: '
  • ', filterClearBtn: '', li: '
  • ', divider: '
  • ', liGroup: '
  • ', }, }, constructor: o, buildContainer: function () { (this.$container = t(this.options.buttonContainer)), this.$container.on("show.bs.dropdown", this.options.onDropdownShow), this.$container.on("hide.bs.dropdown", this.options.onDropdownHide), this.$container.on("shown.bs.dropdown", this.options.onDropdownShown), this.$container.on("hidden.bs.dropdown", this.options.onDropdownHidden); }, buildButton: function () { (this.$button = t(this.options.templates.button).addClass(this.options.buttonClass)), this.$select.prop("disabled") ? this.disable() : this.enable(), this.options.buttonWidth && "auto" !== this.options.buttonWidth && (this.$button.css({ width: this.options.buttonWidth }), this.$container.css({ width: this.options.buttonWidth })); var e = this.$select.attr("tabindex"); e && this.$button.attr("tabindex", e), this.$container.prepend(this.$button); }, buildDropdown: function () { (this.$ul = t(this.options.templates.ul)), this.options.dropRight && this.$ul.addClass("pull-right"), this.options.maxHeight && this.$ul.css({ "max-height": this.options.maxHeight + "px", "overflow-y": "auto", "overflow-x": "hidden" }), this.$container.append(this.$ul); }, buildDropdownOptions: function () { this.$select.children().each( t.proxy(function (e, n) { var o = t(n), i = o.prop("tagName").toLowerCase(); o.prop("value") !== this.options.selectAllValue && ("optgroup" === i ? this.createOptgroup(n) : "option" === i && ("divider" === o.data("role") ? this.createDivider() : this.createOptionValue(n))); }, this) ), t("li input", this.$ul).on( "change", t.proxy(function (e) { var n = t(e.target), o = n.prop("checked") || !1, i = n.val() === this.options.selectAllValue; this.options.selectedClass && (o ? n.closest("li").addClass(this.options.selectedClass) : n.closest("li").removeClass(this.options.selectedClass)); var l = n.val(), r = this.getOptionByValue(l), a = t("option", this.$select).not(r), s = t("input", this.$container).not(n); return ( i && (o ? this.selectAll() : this.deselectAll()), i || (o ? (r.prop("selected", !0), this.options.multiple ? r.prop("selected", !0) : (this.options.selectedClass && t(s).closest("li").removeClass(this.options.selectedClass), t(s).prop("checked", !1), a.prop("selected", !1), this.$button.click()), "active" === this.options.selectedClass && a.closest("a").css("outline", "")) : r.prop("selected", !1)), this.$select.change(), this.updateButtonText(), this.updateSelectAll(), this.options.onChange(r, o), this.options.preventInputChangeEvent ? !1 : void 0 ); }, this) ), t("li a", this.$ul).on("touchstart click", function (e) { e.stopPropagation(); var n = t(e.target); if ("Range" === document.getSelection().type) { var o = t(this).find("input:first"); o.prop("checked", !o.prop("checked")).trigger("change"); } if (e.shiftKey) { var i = n.prop("checked") || !1; if (i) { var l = n.closest("li").siblings('li[class="active"]:first'), r = n.closest("li").index(), a = l.index(); r > a ? n .closest("li") .prevUntil(l) .each(function () { t(this).find("input:first").prop("checked", !0).trigger("change"); }) : n .closest("li") .nextUntil(l) .each(function () { t(this).find("input:first").prop("checked", !0).trigger("change"); }); } } n.blur(); }), this.$container.off("keydown.multiselect").on( "keydown.multiselect", t.proxy(function (e) { if (!t('input[type="text"]', this.$container).is(":focus")) if (9 === e.keyCode && this.$container.hasClass("open")) this.$button.click(); else { var n = t(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible"); if (!n.length) return; var o = n.index(n.filter(":focus")); 38 === e.keyCode && o > 0 ? o-- : 40 === e.keyCode && o < n.length - 1 ? o++ : ~o || (o = 0); var i = n.eq(o); if ((i.focus(), 32 === e.keyCode || 13 === e.keyCode)) { var l = i.find("input"); l.prop("checked", !l.prop("checked")), l.change(); } e.stopPropagation(), e.preventDefault(); } }, this) ), this.options.enableClickableOptGroups && this.options.multiple && t("li.multiselect-group", this.$ul).on( "click", t.proxy(function (e) { e.stopPropagation(); var n = t(e.target).parent(), o = n.nextUntil("li.multiselect-group"), i = !0, l = o.find("input"); l.each(function () { i = i && t(this).prop("checked"); }), l.prop("checked", !i).trigger("change"); }, this) ); }, createOptionValue: function (e) { var n = t(e); n.is(":selected") && n.prop("selected", !0); var o = this.options.label(e), i = n.val(), l = this.options.multiple ? "checkbox" : "radio", r = t(this.options.templates.li), a = t("label", r); a.addClass(l); var s = t("").attr("type", l); this.options.checkboxName && s.attr("name", this.options.checkboxName), a.append(s); var c = n.prop("selected") || !1; s.val(i), i === this.options.selectAllValue && (r.addClass("multiselect-item multiselect-all"), s.parent().parent().addClass("multiselect-all")), a.append(" " + o), a.attr("title", n.attr("title")), this.$ul.append(r), n.is(":disabled") && s.attr("disabled", "disabled").prop("disabled", !0).closest("a").attr("tabindex", "-1").closest("li").addClass("disabled"), s.prop("checked", c), c && this.options.selectedClass && s.closest("li").addClass(this.options.selectedClass); }, createDivider: function () { var e = t(this.options.templates.divider); this.$ul.append(e); }, createOptgroup: function (e) { var n = t(e).prop("label"), o = t(this.options.templates.liGroup); t("label", o).text(n), this.options.enableClickableOptGroups && o.addClass("multiselect-group-clickable"), this.$ul.append(o), t(e).is(":disabled") && o.addClass("disabled"), t("option", e).each( t.proxy(function (t, e) { this.createOptionValue(e); }, this) ); }, buildSelectAll: function () { "number" == typeof this.options.selectAllValue && (this.options.selectAllValue = this.options.selectAllValue.toString()); var e = this.hasSelectAll(); if (!e && this.options.includeSelectAllOption && this.options.multiple && t("option", this.$select).length > this.options.includeSelectAllIfMoreThan) { this.options.includeSelectAllDivider && this.$ul.prepend(t(this.options.templates.divider)); var n = t(this.options.templates.li); t("label", n).addClass("checkbox"), t("label", n).append(this.options.selectAllName ? '' : ''); var o = t("input", n); o.val(this.options.selectAllValue), n.addClass("multiselect-item multiselect-all"), o.parent().parent().addClass("multiselect-all"), t("label", n).append(" " + this.options.selectAllText), this.$ul.prepend(n), o.prop("checked", !1); } }, buildFilter: function () { if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) { var e = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering); if (this.$select.find("option").length >= e) { if (((this.$filter = t(this.options.templates.filter)), t("input", this.$filter).attr("placeholder", this.options.filterPlaceholder), this.options.includeFilterClearBtn)) { var n = t(this.options.templates.filterClearBtn); n.on( "click", t.proxy(function () { clearTimeout(this.searchTimeout), this.$filter.find(".multiselect-search").val(""), t("li", this.$ul).show().removeClass("filter-hidden"), this.updateSelectAll(); }, this) ), this.$filter.find(".input-group").append(n); } this.$ul.prepend(this.$filter), this.$filter .val(this.query) .on("click", function (t) { t.stopPropagation(); }) .on( "input keydown", t.proxy(function (e) { 13 === e.which && e.preventDefault(), clearTimeout(this.searchTimeout), (this.searchTimeout = this.asyncFunction( t.proxy(function () { if (this.query !== e.target.value) { this.query = e.target.value; var n, o; t.each( t("li", this.$ul), t.proxy(function (e, i) { var l = t("input", i).val(), r = t("label", i).text(), a = ""; if ( ("text" === this.options.filterBehavior ? (a = r) : "value" === this.options.filterBehavior ? (a = l) : "both" === this.options.filterBehavior && (a = r + "\n" + l), l !== this.options.selectAllValue && r) ) { var s = !1; this.options.enableCaseInsensitiveFiltering && a.toLowerCase().indexOf(this.query.toLowerCase()) > -1 ? (s = !0) : a.indexOf(this.query) > -1 && (s = !0), t(i).toggle(s).toggleClass("filter-hidden", !s), t(i).hasClass("multiselect-group") ? ((n = i), (o = s)) : (s && t(n).show().removeClass("filter-hidden"), !s && o && t(i).show().removeClass("filter-hidden")); } }, this) ); } this.updateSelectAll(); }, this), 300, this )); }, this) ); } } }, destroy: function () { this.$container.remove(), this.$select.show(), this.$select.data("multiselect", null); }, refresh: function () { t("option", this.$select).each( t.proxy(function (e, n) { var o = t("li input", this.$ul).filter(function () { return t(this).val() === t(n).val(); }); t(n).is(":selected") ? (o.prop("checked", !0), this.options.selectedClass && o.closest("li").addClass(this.options.selectedClass)) : (o.prop("checked", !1), this.options.selectedClass && o.closest("li").removeClass(this.options.selectedClass)), t(n).is(":disabled") ? o.attr("disabled", "disabled").prop("disabled", !0).closest("li").addClass("disabled") : o.prop("disabled", !1).closest("li").removeClass("disabled"); }, this) ), this.updateButtonText(), this.updateSelectAll(); }, select: function (e, n) { t.isArray(e) || (e = [e]); for (var o = 0; o < e.length; o++) { var i = e[o]; if (null !== i && void 0 !== i) { var l = this.getOptionByValue(i), r = this.getInputByValue(i); void 0 !== l && void 0 !== r && (this.options.multiple || this.deselectAll(!1), this.options.selectedClass && r.closest("li").addClass(this.options.selectedClass), r.prop("checked", !0), l.prop("selected", !0)); } } this.updateButtonText(), this.updateSelectAll(), n && 1 === e.length && this.options.onChange(l, !0); }, clearSelection: function () { this.deselectAll(!1), this.updateButtonText(), this.updateSelectAll(); }, deselect: function (e, n) { t.isArray(e) || (e = [e]); for (var o = 0; o < e.length; o++) { var i = e[o]; if (null !== i && void 0 !== i) { var l = this.getOptionByValue(i), r = this.getInputByValue(i); void 0 !== l && void 0 !== r && (this.options.selectedClass && r.closest("li").removeClass(this.options.selectedClass), r.prop("checked", !1), l.prop("selected", !1)); } } this.updateButtonText(), this.updateSelectAll(), n && 1 === e.length && this.options.onChange(l, !1); }, selectAll: function (e) { var e = "undefined" == typeof e ? !0 : e, n = t("li input[type='checkbox']:enabled", this.$ul), o = n.filter(":visible"), i = n.length, l = o.length; if ( (e ? (o.prop("checked", !0), t("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").addClass(this.options.selectedClass)) : (n.prop("checked", !0), t("li:not(.divider):not(.disabled)", this.$ul).addClass(this.options.selectedClass)), i === l || e === !1) ) t("option:enabled", this.$select).prop("selected", !0); else { var r = o .map(function () { return t(this).val(); }) .get(); t("option:enabled", this.$select) .filter(function () { return -1 !== t.inArray(t(this).val(), r); }) .prop("selected", !0); } }, deselectAll: function (e) { var e = "undefined" == typeof e ? !0 : e; if (e) { var n = t("li input[type='checkbox']:enabled", this.$ul).filter(":visible"); n.prop("checked", !1); var o = n .map(function () { return t(this).val(); }) .get(); t("option:enabled", this.$select) .filter(function () { return -1 !== t.inArray(t(this).val(), o); }) .prop("selected", !1), this.options.selectedClass && t("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").removeClass(this.options.selectedClass); } else t("li input[type='checkbox']:enabled", this.$ul).prop("checked", !1), t("option:enabled", this.$select).prop("selected", !1), this.options.selectedClass && t("li:not(.divider):not(.disabled)", this.$ul).removeClass(this.options.selectedClass); }, rebuild: function () { this.$ul.html(""), (this.options.multiple = "multiple" === this.$select.attr("multiple")), this.buildSelectAll(), this.buildDropdownOptions(), this.buildFilter(), this.updateButtonText(), this.updateSelectAll(), this.options.disableIfEmpty && t("option", this.$select).length <= 0 && this.disable(), this.options.dropRight && this.$ul.addClass("pull-right"); }, dataprovider: function (e) { var o = "", i = 0, l = t(""); t.each(e, function (e, r) { var a; t.isArray(r.children) ? (i++, (a = t("").attr({ label: r.label || "Group " + i })), n(r.children, function (e) { a.append(t("")) : (a = t("