Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * These are Bolt’s COMPILED JS files!
  3.  * Do not edit this file, because all changes will be lost. You can edit the
  4.  * `*.js` files in `app/src/js/` and then run `yarn grunt updateBolt` to generate
  5.  * this file. You will need to use the "Clone the Git Repository" installation method, to
  6.  * get these files. See: https://docs.bolt.cm/core-development/install-git-clone,
  7.  * as well as the `README.md` file in the `app/src/` folder.
  8.  */
  9. String.prototype.subst = function(t) {
  10.     "use strict";
  11.     return this.replace(/%[A-Z][A-Z0-9_]+%/g, function(e) {
  12.         return e in t ? t[e] : e
  13.     })
  14. };
  15. var init = {
  16.         depublishTracking: function() {
  17.             "use strict";
  18.             var i = "dateDepublishNotice",
  19.                 n = $("#datedepublish").data("notice");
  20.             $("#datedepublish, #statusselect").on("change", function() {
  21.                 var e = $("#statusselect").val(),
  22.                     t = $("#datedepublish").val();
  23.                 $("." + i).remove(), "" !== t && "published" === e && moment(t + Bolt.conf("timezone.offset")) < moment() && $('<div class="' + i + ' alert alert-warning alert-dismissible"><button type="button" class="close" data-dismiss="alert">×</button>' + n + "</div>").hide().insertAfter(".depublish-group").slideDown("fast")
  24.             }), $("#datedepublish").trigger("change")
  25.         },
  26.         bindEditFile: function(e) {
  27.             "use strict";
  28.             var n;
  29.             if ("undefined" != typeof CodeMirror) {
  30.                 n = CodeMirror.fromTextArea(document.getElementById("file_edit_contents"), {
  31.                     lineNumbers: !0,
  32.                     autofocus: !0,
  33.                     foldGutter: {
  34.                         rangeFinder: CodeMirror.fold.indent
  35.                     },
  36.                     gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
  37.                     extraKeys: {
  38.                         "Ctrl-Q": function(e) {
  39.                             e.foldCode(e.getCursor(), {
  40.                                 rangeFinder: CodeMirror.fold.indent,
  41.                                 minFoldSize: 3
  42.                             })
  43.                         },
  44.                         Tab: function(e) {
  45.                             e.somethingSelected() ? e.indentSelection("add") : e.replaceSelection(e.getOption("indentWithTabs") ? "\t" : Array(e.getOption("indentUnit") + 1).join(" "), "end", "+input")
  46.                         },
  47.                         "Ctrl-S": function() {
  48.                             $("#file_edit_save").click()
  49.                         },
  50.                         "Ctrl-H": "replaceAll"
  51.                     },
  52.                     tabSize: 4,
  53.                     indentUnit: 4,
  54.                     indentWithTabs: !1,
  55.                     readOnly: e.readonly
  56.                 });
  57.                 var t = $(window).height() - 312;
  58.                 t < 200 && (t = 200), n.setSize(null, t)
  59.             }
  60.             $("#file_edit_save").on("click", function(e) {
  61.                 Bolt.events.fire("Bolt.File.Save.Start"), e.preventDefault(), n && n.save();
  62.                 $("#file_edit_save").addClass("disabled"), $("#file_edit_save i").addClass("fa-spin fa-spinner"), $("p.lastsaved").text(Bolt.data("editcontent.msg.saving"));
  63.                 var t = $(e.target),
  64.                     i = $('form[name="file_edit"]').serialize() + "&" + encodeURI(t.attr("name")) + "=" + encodeURI(t.attr("value"));
  65.                 $.post("?returnto=ajax", i).done(function(e) {
  66.                     e.ok ? Bolt.events.fire("Bolt.File.Save.Done", e) : (alert(e.msg), Bolt.events.fire("Bolt.File.Save.Fail", e)), $("p.lastsaved").html(e.msg)
  67.                 }).fail(function() {
  68.                     Bolt.events.fire("Bolt.File.Save.Fail"), alert("Not saved")
  69.                 }).always(function() {
  70.                     Bolt.events.fire("Bolt.File.Save.Always"), window.setTimeout(function() {
  71.                         $("#file_edit_save").removeClass("disabled").blur(), $("#file_edit_save i").removeClass("fa-spin fa-spinner")
  72.                     }, 300)
  73.                 })
  74.             })
  75.         },
  76.         bindEditLocale: function(e) {
  77.             "use strict";
  78.             CodeMirror.fromTextArea(document.getElementById("file_edit_contents"), {
  79.                 lineNumbers: !0,
  80.                 autofocus: !0,
  81.                 tabSize: 4,
  82.                 indentUnit: 4,
  83.                 indentWithTabs: !1,
  84.                 readOnly: e.readonly
  85.             }).setSize(null, $(window).height() - 276)
  86.         },
  87.         bindFileBrowser: function() {
  88.             "use strict";
  89.             $("#myTab a").click(function(e) {
  90.                 e.preventDefault(), $(this).tab("show")
  91.             });
  92.             var e, t, i = (e = new RegExp("(?:[?&]|&)" + "CKEditorFuncNum" + "=([^&]+)", "i"), (t = window.location.search.match(e)) && 1 < t.length ? t[1] : null);
  93.             $("a.filebrowserCallbackLink").bind("click", function(e) {
  94.                 e.preventDefault();
  95.                 var t = $(this).attr("href");
  96.                 window.opener.CKEDITOR.tools.callFunction(i, t), window.close()
  97.             }), $("a.filebrowserCloseLink").bind("click", function() {
  98.                 window.close()
  99.             })
  100.         },
  101.         bindCkFileSelect: function() {
  102.             "use strict";
  103.             var e, t, i = (e = new RegExp("(?:[?&]|&)" + "CKEditorFuncNum" + "=([^&]+)", "i"), (t = window.location.search.match(e)) && 1 < t.length ? t[1] : null);
  104.             $("a.filebrowserCallbackLink").bind("click", function(e) {
  105.                 e.preventDefault();
  106.                 var t = $(this).attr("href");
  107.                 window.opener.CKEDITOR.tools.callFunction(i, t), window.close()
  108.             })
  109.         },
  110.         bindPrefill: function() {
  111.             "use strict";
  112.             var e = $("#form_contenttypes").find(":checkbox");
  113.             $("#prefill_check_all").on("click", function() {
  114.                 e.removeAttr("checked").trigger("click")
  115.             }), $("#prefill_uncheck_all").on("click", function() {
  116.                 e.removeAttr("checked")
  117.             })
  118.         },
  119.         confirmationDialogs: function() {
  120.             "use strict";
  121.             $(".confirm").on("click", function() {
  122.                 return confirm($(this).data("confirm"))
  123.             })
  124.         },
  125.         dropDowns: function() {
  126.             "use strict";
  127.             $('[data-toggle="dropdown"]').each(function(e, t) {
  128.                 var a;
  129.                 "undefined" == typeof event ? $(t).parent().click(function(e) {
  130.                     a = e
  131.                 }) : a = event, $(t).parent().on("show.bs.dropdown", function() {
  132.                     if (null != a) {
  133.                         var e = $(this).find('[data-toggle="dropdown"]').next(".dropdown-menu"),
  134.                             t = a.pageY + 20,
  135.                             i = e.height(),
  136.                             n = $(window).height() - t + i;
  137.                         20 < t - i && n < 37 && e.css({
  138.                             top: "auto",
  139.                             bottom: "100%"
  140.                         })
  141.                     }
  142.                 })
  143.             })
  144.         },
  145.         dropZone: function() {
  146.             "use strict";
  147.             $(document).bind("dragover", function(e) {
  148.                 var t = $(".elm-dropzone"),
  149.                     i = window.dropZoneTimeout;
  150.                 i ? clearTimeout(i) : t.addClass("in"), e.target === t[0] ? t.addClass("hover") : t.removeClass("hover"), window.dropZoneTimeout = setTimeout(function() {
  151.                     window.dropZoneTimeout = null, t.removeClass("in hover")
  152.                 }, 100)
  153.             })
  154.         },
  155.         magnificPopup: function() {
  156.             "use strict";
  157.             $(".magnific, .fancybox").magnificPopup({
  158.                 type: "image",
  159.                 gallery: {
  160.                     enabled: !0
  161.                 },
  162.                 disableOn: 400,
  163.                 closeBtnInside: !0,
  164.                 enableEscapeKey: !0,
  165.                 mainClass: "mfp-with-zoom",
  166.                 zoom: {
  167.                     enabled: !0,
  168.                     duration: 300,
  169.                     easing: "ease-in-out",
  170.                     opener: function(e) {
  171.                         return e.parent().parent().find("img")
  172.                     }
  173.                 }
  174.             })
  175.         },
  176.         focusStatusSelect: function() {
  177.             "use strict";
  178.             $("#lastsavedstatus").click(function(e) {
  179.                 e.preventDefault(), $('a[href="#tab-meta"]').click(), $("#statusselect").focus()
  180.             })
  181.         },
  182.         passwordInput: function() {
  183.             "use strict";
  184.             $(".togglepass").on("click", function() {
  185.                 $(this).hasClass("show-password") ? ($('input[name="user_login[password]"]').attr("type", "text"), $(".togglepass.show-password").hide(), $(".togglepass.hide-password").show()) : ($('input[name="user_login[password]"]').attr("type", "password"), $(".togglepass.show-password").show(), $(".togglepass.hide-password").hide())
  186.             }), $(".login-forgot").bind("click", function() {
  187.                 $(".login-group, .password-group").hide(), $("#user_login_password").attr("required", !1), $(".reset-group").show()
  188.             }), $(".login-remembered").bind("click", function() {
  189.                 $(".login-group, .password-group").show(), $("#user_login_password").attr("required", !0), $(".reset-group").hide()
  190.             })
  191.         },
  192.         popOvers: function() {
  193.             "use strict";
  194.             $(".info-pop").popover({
  195.                 trigger: "hover",
  196.                 delay: {
  197.                     show: 500,
  198.                     hide: 200
  199.                 }
  200.             })
  201.         },
  202.         sortables: function() {
  203.             "use strict";
  204.             $("tbody.sortable").sortable({
  205.                 items: "tr",
  206.                 opacity: "0.5",
  207.                 axis: "y",
  208.                 handle: ".sorthandle",
  209.                 update: function() {
  210.                     var e = $(this).sortable("serialize");
  211.                     $.ajax({
  212.                         url: $("#baseurl").attr("value") + "content/sortcontent/" + $(this).parent("table").data("contenttype"),
  213.                         type: "POST",
  214.                         data: e,
  215.                         success: function() {}
  216.                     })
  217.                 }
  218.             })
  219.         }
  220.     },
  221.     Bolt = {};
  222. ! function(bolt, $) {
  223.     "use strict";
  224.     var actions = {
  225.         init: function() {
  226.             $("button, input[type=button], a").off("click.action"), $("[data-action]").on("click.action", function(e) {
  227.                 var action = $(this).attr("data-action");
  228.                 void 0 !== action && "" !== action && (e.preventDefault(), eval(action), e.stopPropagation())
  229.             }).on("click.popover", ".popover", function(e) {
  230.                 e.stopPropagation()
  231.             }), $(".clickspinner").on("click.spinner", function() {
  232.                 $(this).addClass("disabled").blur(), $(this).find("i").addClass("fa-spin fa-spinner"), window.setTimeout(function(e) {
  233.                     $(e).removeClass("disabled"), $(e).find("i").removeClass("fa-spin fa-spinner")
  234.                 }, 1e4, this)
  235.             }), $(".submitspinner").on("submit.spinner", function() {
  236.                 $(this).find("button[type=submit]").addClass("disabled").blur(), $(this).find("button[type=submit] i").addClass("fa-spin fa-spinner"), window.setTimeout(function(e) {
  237.                     $(e).removeClass("disabled"), $(e).find("i").removeClass("fa-spin fa-spinner")
  238.                 }, 1e4, $(this).find("button[type=submit]"))
  239.             })
  240.         },
  241.         submit: function(e, t) {
  242.             $('<input type="hidden" />').attr("name", t.name).val(1).appendTo(e), e.submit()
  243.         }
  244.     };
  245.     bolt.actions = actions
  246. }(Bolt || {}, jQuery),
  247. function(t, n, i, a) {
  248.     "use strict";
  249.     var o, e = {},
  250.         s = 1e4;
  251.     e.gMapsApiReady = function() {
  252.         o = !0, t.events.fire("Bolt.GoogleMapsAPI.Load.Done")
  253.     }, e.run = function() {
  254.         var e;
  255.         t.conf.init(), t.data.init(), s = t.conf("buid").match(/(\d+)$/)[1], e = t.conf("locale.long"), n.fn.select2.defaults.set("language", e.replace("_", "-")), i.locale(e), n.datepicker.setDefaults(n.datepicker.regional[e]), t.events.on("Bolt.GoogleMapsAPI.Load.Request", function() {
  256.             if (void 0 === o) {
  257.                 o = !1;
  258.                 var e = "https://maps.google.com/maps/api/js?sensor=false&callback=Bolt.app.gMapsApiReady";
  259.                 Bolt.conf.get("google_api_key") && (e = e + "&key=" + Bolt.conf.get("google_api_key")), n.getScript(e).fail(function() {
  260.                     o = void 0, t.events.fire("Bolt.GoogleMapsAPI.Load.Fail")
  261.                 })
  262.             } else !0 === o && t.events.fire("Bolt.GoogleMapsAPI.Load.Done")
  263.         }), t.actions.init(), t.secmenu.init(), t.stack.init(), t.omnisearch.init(), t.extend.init(), t.filemanager.init(), t.ckeditor.init(), t.datetime.init(), a.confirmationDialogs(), a.magnificPopup(), a.dropZone(), a.popOvers(), a.dropDowns(), a.passwordInput(), a.sortables(), a.focusStatusSelect(), a.depublishTracking(), n("[data-bind]").each(function() {
  264.             var e = n(this).data("bind");
  265.             switch (e.bind) {
  266.                 case "editcontent":
  267.                     t.editcontent.init(e);
  268.                     break;
  269.                 case "editfile":
  270.                     a.bindEditFile(e);
  271.                     break;
  272.                 case "editlocale":
  273.                     a.bindEditLocale(e);
  274.                     break;
  275.                 case "filebrowser":
  276.                     a.bindFileBrowser();
  277.                     break;
  278.                 case "ckfileselect":
  279.                     a.bindCkFileSelect();
  280.                     break;
  281.                 case "prefill":
  282.                     a.bindPrefill()
  283.             }
  284.         }), t.app.initWidgets()
  285.     }, e.buid = function() {
  286.         return "buid-" + s++
  287.     }, e.initWidgets = function(e) {
  288.         void 0 === e && (e = n(document.documentElement)), n("[data-bolt-widget]", e).each(function() {
  289.             var i = n(this),
  290.                 e = i.data("bolt-widget"),
  291.                 t = {};
  292.             "string" == typeof e ? t[e] = {} : t = e, n.each(t, function(e, t) {
  293.                 i[e](t).removeAttr("data-bolt-widget").removeData("bolt-widget")
  294.             })
  295.         })
  296.     }, n(document).ready(e.run), t.app = e
  297. }(Bolt || {}, jQuery, moment, init),
  298. function(a, o, t) {
  299.     "use strict";
  300.     var e = {};
  301.  
  302.     function s() {
  303.         var e = [];
  304.         for (var t in arguments)
  305.             if (1 === arguments[t].length || arguments[t][0]) {
  306.                 var i = arguments[t][arguments[t].length - 1];
  307.                 "string" == typeof i && "|" === i.substr(0, 1) && (i = i.substr(1), e = e.concat("-")), e = e.concat(i)
  308.             }
  309.         return e
  310.     }
  311.     e.init = function() {
  312.         t && (t = e.initcke(t))
  313.     }, e.update = function() {
  314.         if (t)
  315.             for (var e in t.instances) t.instances.hasOwnProperty(e) && t.instances[e].updateElement()
  316.     }, e.add = function(e) {
  317.         t && t.replace(e)
  318.     }, e.initcke = function(e) {
  319.         return e.editorConfig = function(e) {
  320.             var t, i = o(this.element.$).data("param") || {},
  321.                 n = a.conf("ckeditor");
  322.             for (t in e.language = a.conf("ckeditor.lang"), e.skin = "moono-lisa", e.resize_enabled = !0, e.entities = !1, e.fillEmptyBlocks = !1, e.extraPlugins += (e.extraPlugins ? "," : "") + "codemirror", e.baseFloatZIndex = 100015, e.toolbar = s([{
  323.                     name: "clipboard",
  324.                     items: s([n.clipboard, "Undo"], [n.clipboard, "Redo"], [n.copypaste, "Cut"], [n.copypaste, "Copy"], [n.copypaste, "Paste"], [n.copypaste, "PasteFromWord"], [n.copypaste, "PasteText"])
  325.                 }], [{
  326.                     name: "styles",
  327.                     items: s(["Format"], [n.styles, "Styles"])
  328.                 }], [{
  329.                     name: "basicstyles",
  330.                     items: s(["Bold"], ["Italic"], [n.underline, "Underline"], [n.strike, "Strike"])
  331.                 }], [{
  332.                     name: "paragraph",
  333.                     items: s(["NumberedList"], ["BulletedList"], ["Indent"], ["Outdent"], [n.blockquote, "|Blockquote"])
  334.                 }], [{
  335.                     name: "links",
  336.                     items: s(["Link"], ["Unlink"], [n.anchor, "|Anchor"])
  337.                 }], [n.subsuper, {
  338.                     name: "subsuper",
  339.                     items: s(["Subscript"], ["Superscript"])
  340.                 }], [n.images, {
  341.                     name: "image",
  342.                     items: s(["Image"])
  343.                 }], [n.embed, {
  344.                     name: "embed",
  345.                     items: s(["oembed"])
  346.                 }], [n.tables, {
  347.                     name: "table",
  348.                     items: s(["Table"])
  349.                 }], [n.ruler, {
  350.                     name: "ruler",
  351.                     items: s(["HorizontalRule"])
  352.                 }], [n.align, {
  353.                     name: "align",
  354.                     items: s(["JustifyLeft"], ["JustifyCenter"], ["JustifyRight"], ["JustifyBlock"])
  355.                 }], [n.fontcolor, {
  356.                     name: "colors",
  357.                     items: s(["TextColor"], ["BGColor"])
  358.                 }], [n.codesnippet, {
  359.                     name: "code",
  360.                     items: s(["|CodeSnippet"])
  361.                 }], [{
  362.                     name: "tools",
  363.                     items: s(["RemoveFormat"], ["Maximize"], ["|Source"], [n.specialchar, "|SpecialChar"])
  364.                 }]), n.embed && (e.extraPlugins += ",oembed,widget", e.oembed_maxWidth = "853", e.oembed_maxHeight = "480"), e.height = 250, e.autoGrow_onStartup = !0, e.autoGrow_minHeight = 150, e.autoGrow_maxHeight = 400, e.autoGrow_bottomSpace = 24, e.removePlugins = "elementspath", e.resize_dir = "vertical", n.filebrowser ? (n.filebrowser.browseUrl && (e.filebrowserBrowseUrl = n.filebrowser.browseUrl), n.filebrowser.imageBrowseUrl && (e.filebrowserImageBrowseUrl = n.filebrowser.imageBrowseUrl), n.filebrowser.uploadUrl && (e.filebrowserUploadUrl = n.filebrowser.uploadUrl), n.filebrowser.imageUploadUrl && (e.filebrowserImageUploadUrl = n.filebrowser.imageUploadUrl)) : (e.filebrowserBrowseUrl = "", e.filebrowserImageBrowseUrl = "", e.filebrowserUploadUrl = "", e.filebrowserImageUploadUrl = ""), e.codemirror = {
  365.                     theme: "default",
  366.                     lineNumbers: !0,
  367.                     lineWrapping: !0,
  368.                     matchBrackets: !0,
  369.                     autoCloseTags: !0,
  370.                     autoCloseBrackets: !0,
  371.                     enableSearchTools: !0,
  372.                     enableCodeFolding: !0,
  373.                     enableCodeFormatting: !0,
  374.                     autoFormatOnStart: !1,
  375.                     autoFormatOnUncomment: !1,
  376.                     autoFormatOnModeChange: !1,
  377.                     highlightActiveLine: !0,
  378.                     highlightMatches: !0,
  379.                     showFormatButton: !1,
  380.                     showCommentButton: !1,
  381.                     showUncommentButton: !1
  382.                 }, n.ck) n.ck.hasOwnProperty(t) && (e[t] = n.ck[t]);
  383.             for (t in i.height && (e.height = parseInt(i.height), e.autoGrow_minHeight = Math.max(e.autoGrow_minHeight, e.height), e.autoGrow_maxHeight = Math.max(e.autoGrow_maxHeight, e.height)), i.ckeditor) i.ckeditor.hasOwnProperty(t) && (e[t] = i.ckeditor[t])
  384.         }, a.conf("ckeditor").ck.allowNbsp && e.on("instanceReady", function(e) {
  385.             e.editor.on("paste", function(e) {
  386.                 e.data.dataValue = e.data.dataValue.replace(/&nbsp;/g, " "), e.data.dataValue = e.data.dataValue.replace(/<p> <\/p>/g, "")
  387.             }, null, null, 9)
  388.         }), e
  389.     }, a.ckeditor = e
  390. }(Bolt || {}, jQuery, "undefined" != typeof CKEDITOR ? CKEDITOR : void 0),
  391. function(e, t, i) {
  392.     "use strict";
  393.     var a = {},
  394.         n = function(e) {
  395.             var t, i = e.split("."),
  396.                 n = a;
  397.             for (t = 0; t < i.length; t++) {
  398.                 if (void 0 === n[i[t]]) return;
  399.                 n = n[i[t]]
  400.             }
  401.             return n
  402.         };
  403.     (n.get = n).init = function() {
  404.         a = t("script[data-config]").first().data("config")
  405.     }, e.conf = n
  406. }(Bolt || {}, jQuery),
  407. function(e, t, i) {
  408.     "use strict";
  409.     var o = {},
  410.         n = function(e, t) {
  411.             var i, n = e.split("."),
  412.                 a = o;
  413.             for (i = 0; i < n.length; i++) {
  414.                 if (void 0 === a[n[i]]) return;
  415.                 a = a[n[i]]
  416.             }
  417.             return t && "string" == typeof a ? a.subst(t) : a
  418.         };
  419.     (n.get = n).init = function() {
  420.         o = t("script[data-jsdata]").first().data("jsdata") || {}
  421.     }, e.data = n
  422. }(Bolt || {}, jQuery),
  423. function(e, l, d) {
  424.     "use strict";
  425.     var r, t = {},
  426.         a = [];
  427.  
  428.     function o(e) {
  429.         var t, i, n, a, o = "",
  430.             s = "";
  431.         "datedepublish" === e.data.attr("id") && "1900-01-01 00:00:00" === e.data.val() && e.data.val(""), (i = e.data.val().match(/^(\d{4}-\d{2}-\d{2})(?: (\d{2}:\d{2}:\d{2}))?$/)) && (o = i[1], s = i[2] || ""), n = "" === o || "0000-00-00" === o ? "" : l.datepicker.parseDate("yy-mm-dd", o), e.date.datepicker("setDate", n), e.time.exists && "0000-00-00" !== o && (s = "" === s ? "" !== o ? "00:00" : "" : r ? e.data.val().slice(11, 16) : (a = (t = parseInt(s.slice(0, 2))) < 12 ? " AM" : " PM", (t % 12 || 12) + s.slice(2, 5) + a), e.time.val(s)), e.data.trigger("change")
  432.     }
  433.  
  434.     function s(e) {
  435.         var t, i, n, a = d(e.date.datepicker("getDate")),
  436.             o = d([2001, 11, 24]),
  437.             s = !1;
  438.         if (e.time.exists) {
  439.             var l = new RegExp("^(?:(?:([01]?[0-9]|2[0-3]))[:,.]([0-5]?[0-9])|(1[012]|0?[1-9])[:,.]([0-5]?[0-9])(?:\\s*([AP])[. ]?M\\.?))$");
  440.             (n = e.time.val().trim().toUpperCase().match(l)) && (t = parseInt(n[1] ? n[1] : n[3]), i = parseInt(n[2] ? n[2] : n[4]), "P" === n[5] && 12 !== t ? t += 12 : "A" === n[5] && 12 === t && (t -= 12), o = d([2001, 11, 24, t, i]), s = !0)
  441.         }
  442.         if (a.isValid()) {
  443.             var r = e.time.exists ? " " + o.format("HH:mm:00") : "";
  444.             e.data.val(a.format("YYYY-MM-DD") + r)
  445.         } else s ? e.data.val(d().format("YYYY-MM-DD") + " " + o.format("HH:mm:00")) : e.data.val("")
  446.     }
  447.     t.update = function() {
  448.         for (var e in a) a.hasOwnProperty(e) && o(a[e])
  449.     }, t.init = function() {
  450.         r = !d.localeData()._longDateFormat.LT.replace(/\[.+?\]/gi, "").match(/A/), l("input.datetime").each(function() {
  451.             var e, t, i, n = (e = l(this), t = e.closest(".datetime-container"), (i = {}).data = e, i.date = t.find("input.datepicker"), i.time = t.find("input.timepicker"), i.show = t.find("button.btn-tertiary"), i.clear = t.find("button.btn-default"), i.time.exists = 0 < i.time.length, i);
  452.             a.push(n),
  453.                 function(e) {
  454.                     var t = e.date.data("field-options"),
  455.                         i = {
  456.                             showOn: "none"
  457.                         };
  458.                     for (var n in t) t.hasOwnProperty(n) && (i[n] = t[n]);
  459.                     e.date.datepicker(i), e.show.click(function() {
  460.                         e.date.datepicker("show")
  461.                     }), e.clear.click(function() {
  462.                         e.data.val(""), o(e)
  463.                     })
  464.                 }(n), o(n), n.date.change(function() {
  465.                     s(n), o(n)
  466.                 }), n.time.change(function() {
  467.                     s(n), o(n)
  468.                 })
  469.         })
  470.     }, e.datetime = t
  471. }(Bolt || {}, jQuery, moment),
  472. function(r, d, c, u, o, p) {
  473.     "use strict";
  474.     var e = {};
  475.  
  476.     function i(e) {
  477.         var t;
  478.         return e.name && (t = d(e).val(), "select-multiple" === e.type && (t = JSON.stringify(t))), t
  479.     }
  480.  
  481.     function f() {
  482.         d('form[name="content_edit"]').find("input, textarea, select").each(function() {
  483.             if ("textarea" === this.type && d(this).hasClass("ckeditor")) p.instances[this.id].checkDirty() && (p.instances[this.id].updateElement(), p.instances[this.id].resetDirty());
  484.             else {
  485.                 var e = i(this);
  486.                 void 0 !== e && d(this).data("watch", e)
  487.             }
  488.         }), c.onbeforeunload = function() {
  489.             if (t = 0, d('form[name="content_edit"]').find("input, textarea, select").each(function() {
  490.                     if ("content_edit[save]" !== d(this).attr("name"))
  491.                         if ("textarea" === this.type && d(this).hasClass("ckeditor")) p.instances[this.id].checkDirty() && t++;
  492.                         else {
  493.                             var e = i(this);
  494.                             void 0 !== e && d(this).data("watch") !== e && t++
  495.                         }
  496.                 }), 0 < t || r.liveEditor.active) return r.data("editcontent.msg.change_quit");
  497.             var t
  498.         }
  499.     }
  500.  
  501.     function s() {
  502.         c.onbeforeunload = null
  503.     }
  504.  
  505.     function h() {
  506.         d("#sidebar_save, #content_edit_save, #live_editor_save").addClass("disabled"), d("#sidebar_save i, #content_edit_save i").addClass("fa-spin fa-spinner"), d("p.lastsaved").text(r.data("editcontent.msg.saving"))
  507.     }
  508.     e.init = function(e) {
  509.         var t, l, i, n, a;
  510.         (t = d('form[name="content_edit"]')).attr("novalidate", "novalidate").on("submit", function(e) {
  511.             var t = r.validation.run(this);
  512.             if (d(this).data("valid", t), !t) return e.preventDefault(), !1
  513.         }), t.on("boltvalidate", function() {
  514.             var e = r.validation.run(this);
  515.             return d(this).data("valid", e), e
  516.         }), l = e, d("#sidebar_save").bind("click", function() {
  517.             d("#content_edit_save").trigger("click")
  518.         }), d("#content_edit_save").bind("click", function(e) {
  519.             e.preventDefault();
  520.             var n = d('form[name="content_edit"]');
  521.             if (n.trigger("boltvalidate"), !n.data("valid")) return !1;
  522.             var t = l.newRecord,
  523.                 i = l.savedon,
  524.                 a = l.msgNotSaved;
  525.             if (h(), t) f(), r.liveEditor.active && r.liveEditor.stop(), l.duplicate && (c.onbeforeunload = null), r.actions.submit(n, this);
  526.             else {
  527.                 f(), r.events.fire("Bolt.Content.Save.Start");
  528.                 var o = d(e.target),
  529.                     s = n.serialize() + "&" + encodeURI(o.attr("name")) + "=" + encodeURI(o.attr("value"));
  530.                 d.post("", s).done(function(t) {
  531.                     r.events.fire("Bolt.Content.Save.Done", {
  532.                         form: t
  533.                     }), c.onbeforeunload = null, d("p.lastsaved").removeClass("alert alert-danger").html(i).find("strong").text(u(t.datechanged).format("MMM D, HH:mm")).end().find(".buic-moment").buicMoment().buicMoment("set", t.datechanged);
  534.                     var e = d("#statusselect").find("option:selected");
  535.                     d("a#lastsavedstatus strong").html('<i class="fa fa-circle status-' + e.val() + '"></i> ' + e.text()), d("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner fa-exclamation-triangle").addClass("fa-check"), "object" === d.type(t) && (d.each(t, function(i, e) {
  536.                         if ("object" === d.type(e)) d.each(e, function(e, t) {
  537.                             d(':input[name="' + i + "[" + e + ']"]').val(t)
  538.                         });
  539.                         else if ("array" === d.type(e));
  540.                         else {
  541.                             var t = d(n.name).find("[name=" + i + "]");
  542.                             "checkbox" === t.attr("type") ? t.prop("checked", "1" === e) : t.val(e), p && p.instances[i] && p.instances[i].setData(e, {
  543.                                 callback: function() {
  544.                                     this.resetDirty()
  545.                                 }
  546.                             })
  547.                         }
  548.                     }), d("a[data-href-placeholder]").each(function() {
  549.                         var e = d(this).data("href-placeholder").replace("__replaceme", t.slug);
  550.                         d(this).attr("href", e)
  551.                     })), r.datetime.update(), f()
  552.                 }).fail(function(e) {
  553.                     r.events.fire("Bolt.Content.Save.Fail");
  554.                     var t = d.parseJSON(e.responseText),
  555.                         i = "<b>" + a + "</b><br><small>" + t.error.message + "</small>";
  556.                     d("p.lastsaved").html(i).addClass("alert alert-danger"), d("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner").addClass("fa-exclamation-triangle")
  557.                 }).always(function() {
  558.                     r.events.fire("Bolt.Content.Save.Always"), c.setTimeout(function() {
  559.                         d("#sidebar_save, #content_edit_save, #live_editor_save").removeClass("disabled").blur()
  560.                     }, 1e3), c.setTimeout(function() {
  561.                         d("#sidebar_save i, #content_edit_save i").addClass("fa-flag")
  562.                     }, 5e3)
  563.                 })
  564.             }
  565.         }), d("#sidebar_save_return").bind("click", function() {
  566.             d("#content_edit_save_return").trigger("click")
  567.         }), d("#content_edit_save_return").bind("click", function() {
  568.             h(), s()
  569.         }), d("#sidebar_save_create").bind("click", function() {
  570.             d("#content_edit_save_create").trigger("click")
  571.         }), d("#content_edit_save_create").bind("click", function() {
  572.             h(), s(), r.actions.submit(d('form[name="content_edit"]'), this)
  573.         }), (i = d('form[name="content_edit"]')).find("#sidebar_preview").attr("disabled", !1), i.find("#content_edit_preview").attr("disabled", !1), d("#sidebar_preview").bind("click", function() {
  574.             d("#content_edit_preview").trigger("click")
  575.         }), d("#content_edit_preview").bind("click", function(e) {
  576.             var t = d(e.target).data("url");
  577.             e.preventDefault(), i.attr("action", t).attr("target", "_blank").submit(), i.attr("action", "").attr("target", "_self")
  578.         }), d("#sidebar_delete").bind("click", function() {
  579.             d("#content_edit_delete").trigger("click")
  580.         }), d("#content_edit_delete").bind("click", function(e) {
  581.             e.preventDefault();
  582.             var i = this;
  583.             o.confirm(r.data("editcontent.delete"), function(e) {
  584.                 if (d(".alert").alert(), !0 === e) {
  585.                     var t = d('form[name="content_edit"]');
  586.                     c.onbeforeunload = null, r.actions.submit(t, i)
  587.                 }
  588.             })
  589.         }), n = c.location.hash, a = d("#filtertabs"), n && a.find('a[href="#tab-' + n.replace(/^#/, "") + '"]').tab("show"), a.find("a").click(function() {
  590.             var e;
  591.             d(this).tab("show"), e = d("body").scrollTop(), c.location.hash = this.hash.replace(/^#tab-/, ""), d("html,body").scrollTop(e)
  592.         }), r.liveEditor.init(e), c.setTimeout(function() {
  593.             d("#content_edit_save").is("*") && (d("body, input").bind("keydown", "ctrl+s meta+s", function(e) {
  594.                 e.preventDefault(), f(), d("#content_edit_save").trigger("click")
  595.             }), c.setTimeout(function() {
  596.                 f()
  597.             }, 1e3))
  598.         }, 1e3)
  599.     }, r.editcontent = e
  600. }(Bolt || {}, jQuery, window, moment, bootbox, "undefined" != typeof CKEDITOR ? CKEDITOR : void 0),
  601. function(C, E) {
  602.     "use strict";
  603.     var T, t, e = {};
  604.  
  605.     function S(e) {
  606.         return E(".extend-bolt-container").find(e)
  607.     }
  608.  
  609.     function I(e) {
  610.         var t, i, n = "",
  611.             a = "",
  612.             o = "";
  613.         try {
  614.             n = E.parseJSON(e.responseText)
  615.         } catch (e) {}
  616.         void 0 === n.error ? (o = "This was the received response:\n\n<textarea>" + (t = e.responseText, ((i = E(t)).find("h1, h2, h3, p").text() || i.text()).trim().replace(/ +/g, " ").replace(/\s+\n/g, "\n")) + "</textarea>\n\nInspect the console output in the browser's Debug Inspector for more details.", a = C.data("extend.packages.error", {
  617.             "%ERROR_TYPE%": "Unknown Error",
  618.             "%ERROR_MESSAGE%": o,
  619.             "%ERROR_LOCATION%": ""
  620.         }), console.error(e)) : a = "Bolt\\Exception\\PackageManagerException" === n.error.type ? (o = n.error.message.replace(/(<http)/g, '<a href="http').replace(/(\w+>)/g, '">this link</a>'), C.data("extend.packages.error", {
  621.             "%ERROR_TYPE%": "Composer Error",
  622.             "%ERROR_MESSAGE%": o,
  623.             "%ERROR_LOCATION%": ""
  624.         })) : "Bolt\\Exception\\ExtensionsInfoServiceException" === n.error.type ? (o = n.error.message, C.data("extend.packages.error", {
  625.             "%ERROR_TYPE%": "Extension Site Error",
  626.             "%ERROR_MESSAGE%": o,
  627.             "%ERROR_LOCATION%": ""
  628.         })) : C.data("extend.packages.error", {
  629.             "%ERROR_TYPE%": "PHP Error",
  630.             "%ERROR_MESSAGE%": n.error.message,
  631.             "%ERROR_LOCATION%": "File: " + n.error.file + "::" + n.error.line
  632.         }), E(".modal").modal("hide"), bootbox.alert(a)
  633.     }
  634.  
  635.     function R() {
  636.         S(".installed-container").each(function() {
  637.             var n = E(this).find(".installed-list");
  638.             T = S(".installed-container .console"), E.get(C.data("extend.baseurl") + "installed", function(e) {
  639.                 var t = "";
  640.                 if ("object" == typeof e) {
  641.                     n.show(), n.find(".installed-list-items").html(""), S(".installed-container .console").hide();
  642.                     var i = !0;
  643.                     "object" == typeof e && (t += function(e) {
  644.                         var t = "";
  645.                         for (var i in e)
  646.                             if (e.hasOwnProperty(i)) {
  647.                                 var n = e[i],
  648.                                     a = C.data("extend.packages"),
  649.                                     o = [],
  650.                                     s = [],
  651.                                     l = 0;
  652.                                 if (n.authors && 0 < n.authors.length)
  653.                                     for (l = 0; l < n.authors.length; l++) o.push(a.author.subst({
  654.                                         "%AUTHOR%": n.authors[l].name
  655.                                     }));
  656.                                 if (o = o.length ? a.authors.subst({
  657.                                         "%AUTHORS%": o.join(", ")
  658.                                     }) : "", n.keywords && 0 < n.keywords.length)
  659.                                     for (l = 0; l < n.keywords.length; l++) s.push(a.keyword.subst({
  660.                                         "%KEYWORD%": n.keywords[l]
  661.                                     }));
  662.                                 s = s.length ? a.keywords.subst({
  663.                                     "%KEYWORDS%": s.join(" ")
  664.                                 }) : "", "wikimedia/composer-merge-plugin" === n.name && (n.title = "Local Extension Helper");
  665.                                 var r = "",
  666.                                     d = {
  667.                                         "%NAME%": n.name,
  668.                                         "%VERSION%": n.version,
  669.                                         "%BASEURL%": C.data("extend.baseurl"),
  670.                                         "%MARKETPLACE_URL%": "https://market.bolt.cm/view/" + n.name,
  671.                                         "%REPOSITORY_URL%": n.repositoryLink
  672.                                     };
  673.                                 r = "installed" === n.status && "composer-plugin" !== n.type ? a.manage_dropdown_installed.subst(d) : a.manage_dropdown_uninstalled.subst(d);
  674.                                 var c = a.left_buttons.subst({
  675.                                     "%README%": null !== n.readmeLink ? a.readme_button.subst({
  676.                                         "%README%": n.readmeLink
  677.                                     }) : "",
  678.                                     "%CONFIG%": null !== n.configLink ? a.config_button.subst({
  679.                                         "%CONFIG%": n.configLink
  680.                                     }) : "",
  681.                                     "%THEME%": "bolt-theme" === n.type ? a.theme_button.subst({
  682.                                         "%NAME%": n.name
  683.                                     }) : ""
  684.                                 });
  685.                                 t += a.item.subst({
  686.                                     "%TITLE%": n.title ? n.title : n.name,
  687.                                     "%NAME%": n.name,
  688.                                     "%VERSION%": n.version,
  689.                                     "%AUTHORS%": o,
  690.                                     "%TYPE%": n.type,
  691.                                     "%MANAGE%": r,
  692.                                     "%DETAILS%": c,
  693.                                     "%BASEURL%": C.data("extend.baseurl"),
  694.                                     "%DESCRIPTION%": n.description ? a.description.subst({
  695.                                         "%DESCRIPTION%": n.description
  696.                                     }) : "",
  697.                                     "%KEYWORDS%": s,
  698.                                     "%STATUS%": !1 === n.valid ? " — [INVALID] " : "",
  699.                                     "%ENABLED%": !1 === n.enabled ? " — [DISABLED] " : "",
  700.                                     "%CONSTRAINT%": null !== n.constraint ? '<i class="fa fa-cog fa-fw"></i> Requires Bolt ' + n.constraint : ""
  701.                                 })
  702.                             }
  703.                         return t
  704.                     }(e), i = !1), i && (t = C.data("extend.packages.empty"), T.hide()), n.find(".installed-list-items").append(t)
  705.                 } else T.html(C.data("extend.text.bad-json"))
  706.             }).fail(function(e) {
  707.                 I(e)
  708.             })
  709.         })
  710.     }
  711.     var i, A = (i = 0, function(e, t) {
  712.         clearTimeout(i), i = setTimeout(e, t)
  713.     });
  714.  
  715.     function D(e, t, i) {
  716.         var n = S(".update-container");
  717.         e && n.find(".update-output-title").html(e), t && (n.find(".update-output-console").find(".console").html(t), n.find(".update-output-console").show()), i && n.find(".update-output-notice").html(i).show(), n.show()
  718.     }
  719.  
  720.     function O(e, t) {
  721.         var i = S(".update-container");
  722.         e && i.find(".update-output-console").find(".console").html(e).show(), t && i.find(".update-output-notice").html(t).show()
  723.     }
  724.  
  725.     function o(e) {
  726.         var t, i, n = "";
  727.         for (var a in e) e.hasOwnProperty(a) && void 0 !== (t = e[a]) && (i = "approved" === t.buildStatus ? " label-success" : "", n += C.data("extend.packages.versions", {
  728.             "%NAME%": t.name,
  729.             "%VERSION%": t.version,
  730.             "%CLASS%%": i,
  731.             "%BUILDSTATUS%": t.buildStatus
  732.         }));
  733.         return n
  734.     }
  735.  
  736.     function $(e) {
  737.         T = S(".update-output"), E.get(C.data("extend.baseurl") + "installInfo?package=" + e, function(e) {
  738.             var t = e.dev,
  739.                 i = e.beta,
  740.                 n = e.RC,
  741.                 a = e.stable;
  742.             S(".dev-version-container .installed-version-item").html(""), 0 < a.length ? (S(".stable-version-container .installed-version-item").html(""), S(".stable-version-container .installed-version-item").append(o(a)), S(".latest-version-container .installed-version-item").html(""), S(".latest-version-container .installed-version-item").append(o([e.stable[0]])), S(".install-latest-container").show()) : S(".install-version-container").show(), 0 < n.length && S(".dev-version-container .installed-version-item").append(o(n)), 0 < i.length && S(".dev-version-container .installed-version-item").append(o(i)), 0 < t.length && S(".dev-version-container .installed-version-item").append(o(t)), S("#installModal .loader").hide()
  743.         }).fail(function(e) {
  744.             I(e)
  745.         })
  746.     }
  747.  
  748.     function B(e, t) {
  749.         E.get(C.data("extend.baseurl") + "packageInfo", {
  750.             package: e,
  751.             version: t
  752.         }).done(function(e) {
  753.             var t, i, n;
  754.             "bolt-extension" === e.type && (t = e, S(".extension-postinstall").show(), S(".extension-postinstall .modal-success").show(), S(".postinstall-footer .ext-link").attr("href", t.source), S(".postinstall-footer").show()), "bolt-theme" === e.type && (n = (i = e).name.split(/\/+/).pop(), S(".install-response-container").hide(), S(".theme-postinstall").show(), S(".theme-generation-container").show(), S(".theme-postinstall .theme-generator").data("theme", i.name), S(".theme-postinstall #theme-name").val(n), S(".postinstall-footer").show())
  755.         }).fail(function(e) {
  756.             I(e)
  757.         })
  758.     }
  759.     var n = function(e) {
  760.         var t, i, n, a, o, s, l, r, d, c, u, p, f, h, m, g, v, b, _, k, w, y, x;
  761.         switch (E(e.target).data("request")) {
  762.             case "update-check":
  763.                 S(".update-container").show(), x = S(".update-output-console").html(), S(".update-output-notice").html(x), S(".update-output-notice").find(".update-output-element").removeClass("update-output-element").addClass("update-output").show(), S(".update-list").hide(), (y = S(".update-list-items")).html(""), (T = S(".update-output")).html(C.data("extend.text.updating")), E.get(C.data("extend.baseurl") + "check", function(e) {
  764.                     if (0 < e.updates.length || 0 < e.installs.length) {
  765.                         var t, i;
  766.                         for (t in e.installs) e.installs.hasOwnProperty(t) && (i = e.installs[t], y.append(C.data("extend.packages.install_new", {
  767.                             "%PACKAGE%": i.name,
  768.                             "%VERSION%": i.version,
  769.                             "%PRETTYVERSION%": i.prettyversion
  770.                         })));
  771.                         for (t in e.updates) e.updates.hasOwnProperty(t) && (i = e.updates[t], y.append(C.data("extend.packages.install_update", {
  772.                             "%PACKAGE%": i.name,
  773.                             "%VERSION%": i.version,
  774.                             "%PRETTYVERSION%": i.prettyversion
  775.                         })));
  776.                         T.hide(), S(".update-list").show()
  777.                     } else T.html(C.data("extend.text.updated"))
  778.                 }).fail(function(e) {
  779.                     I(e)
  780.                 });
  781.                 break;
  782.             case "update-run":
  783.                 D(C.data("extend.text.running-update-all"), C.data("extend.text.running-update"), !1), E.get(C.data("extend.baseurl") + "update", function(e) {
  784.                     setTimeout(function() {
  785.                         S(".update-container").hide()
  786.                     }, 7e3), O(e), R()
  787.                 }).fail(function(e) {
  788.                     I(e)
  789.                 });
  790.                 break;
  791.             case "update-package":
  792.                 _ = e.originalEvent, k = S(".update-output").html(C.data("extend.text.updating")), w = E(_.target).data("package"), k.show(), T = k, E.get(C.data("extend.baseurl") + "update?package=" + w).success(function(e) {
  793.                     S(".update-output").html(e), S('.update-list-items tr[data-package="' + w + '"]').remove(), A(function() {
  794.                         T.hide()
  795.                     }, 4e3), S(".update-list-items tbody tr").length < 1 && S(".update-container").hide(), R()
  796.                 }).fail(function(e) {
  797.                     I(e)
  798.                 }), _.preventDefault();
  799.                 break;
  800.             case "check-package":
  801.                 g = e.originalEvent, v = S('input[name="check-package"]').val(), (b = S('input[name="check-package"]').data("packagename")) && (v = b), $(v), g.preventDefault();
  802.                 break;
  803.             case "uninstall-package":
  804.                 ! function(e) {
  805.                     var t = S(".installed-container .console").html(C.data("extend.text.removing"));
  806.                     if (!1 === confirm(C.data("extend.text.confirm-remove"))) return e.stopPropagation(), e.preventDefault();
  807.                     t.show(), T = t, E.get(E(e.target).attr("href")).done(function(e) {
  808.                         S(".installed-container .console").html(e), R(), A(function() {
  809.                             T.hide()
  810.                         }, 2e3)
  811.                     }).fail(function(e) {
  812.                         I(e)
  813.                     }), e.preventDefault()
  814.                 }(e.originalEvent);
  815.                 break;
  816.             case "install-package":
  817.                 f = e.originalEvent, h = E(f.target).data("package"), m = E(f.target).data("version"), S(".install-response-container").show(), S(".install-latest-container").hide(), S(".install-version-container").hide(), (T = S(".install-response-container .console")).html(C.data("extend.text.installing")), S("#installModal .loader .message").html(C.data("extend.text.installing")), E.get(C.data("extend.baseurl") + "install", {
  818.                     package: h,
  819.                     version: m
  820.                 }).done(function() {
  821.                     B(h, m), S(".install-response-container").hide(), S(".check-package").show(), S('input[name="check-package"]').val(""), R()
  822.                 }).fail(function(e) {
  823.                     I(e)
  824.                 }), f.preventDefault();
  825.                 break;
  826.             case "prefill-package":
  827.                 u = e.originalEvent, p = E(u.target), S('input[name="check-package"]').val(p.closest("a").text()), S('input[name="check-package"]').data("packagename", p.data("packagename")), S(".auto-search").hide();
  828.                 break;
  829.             case "install-run":
  830.                 c = e.originalEvent, D(C.data("extend.text.install-running"), C.data("extend.text.install-all"), !1), E.get(C.data("extend.baseurl") + "installAll", function(e) {
  831.                     A(function() {
  832.                         S(".update-container").hide()
  833.                     }, 7e3), O(e), R()
  834.                 }).fail(function(e) {
  835.                     I(e)
  836.                 }), c.stopPropagation(), c.preventDefault();
  837.                 break;
  838.             case "autoload-dump":
  839.                 d = e.originalEvent, D(C.data("extend.text.autoloader-update"), C.data("extend.text.autoloader-start") + " …", !1), E.get(C.data("extend.baseurl") + "dumpAutoload", function(e) {
  840.                     A(function() {
  841.                         S(".update-container").hide()
  842.                     }, 7e3), O(e)
  843.                 }).fail(function(e) {
  844.                     I(e)
  845.                 }), d.stopPropagation(), d.preventDefault();
  846.                 break;
  847.             case "generate-theme":
  848.                 s = e.originalEvent, l = E(s.target).data("theme"), r = S("#theme-name").val(), E.get(C.data("extend.baseurl") + "generateTheme", {
  849.                     theme: l,
  850.                     name: r
  851.                 }).done(function(e) {
  852.                     S(".theme-generate-response").html("<p>" + e + "</p>").show(), S(".theme-generation-container").hide()
  853.                 }).fail(function(e) {
  854.                     I(e)
  855.                 }), s.preventDefault();
  856.                 break;
  857.             case "package-available":
  858.                 o = e.originalEvent, $(E(o.target).data("available"));
  859.                 break;
  860.             case "package-copy":
  861.                 ! function(e) {
  862.                     var t = E(e.target).data("theme"),
  863.                         i = S("#theme-name").val();
  864.                     if (confirm(C.data("extend.text.overwrite"))) {
  865.                         var n = S(".installed-container .console").html(C.data("extend.text.copying"));
  866.                         n.show(), T = n, E.get(C.data("extend.baseurl") + "generateTheme", {
  867.                             theme: t,
  868.                             name: i
  869.                         }).done(function(e) {
  870.                             T.html(e), A(function() {
  871.                                 n.hide()
  872.                             }, 5e3)
  873.                         }).fail(function(e) {
  874.                             I(e)
  875.                         })
  876.                     }
  877.                     e.preventDefault()
  878.                 }(e.originalEvent);
  879.                 break;
  880.             case "package-readme":
  881.                 a = e.originalEvent, E.get(E(a.target).data("readme")).done(function(e) {
  882.                     bootbox.dialog({
  883.                         message: e || "Readme is empty."
  884.                     })
  885.                 }).fail(function(e) {
  886.                     I(e)
  887.                 }), a.preventDefault();
  888.                 break;
  889.             case "package-depends":
  890.                 t = e.originalEvent, i = E(t.target).data("needle"), n = E(t.target).data("constraint"), S(".dependency-response-container").show(), S(".install-latest-container").hide(), S(".install-version-container").hide(), (T = S(".dependency-response-container .console")).html(""), E.get(C.data("extend.baseurl") + "depends", {
  891.                     needle: i,
  892.                     constraint: n
  893.                 }).done(function(e) {
  894.                     S(".loader").hide(), S(".dependency-response-container").hide(), S(".check-package").show(), S('input[name="check-package"]').val("");
  895.                     var t = S("#installModal .extension-dependencies-list");
  896.                     t.html(""), e.forEach(function(e) {
  897.                         t.append("<li>" + e.link + "</li>")
  898.                     }), t.show(), S(".extension-dependencies").show(), S(".postinstall-footer").show()
  899.                 }).fail(function(e) {
  900.                     I(e)
  901.                 }), t.preventDefault();
  902.                 break;
  903.             case "show-all":
  904.                 e.originalEvent, S(".install-latest-container").hide(), S(".install-version-container").show()
  905.         }
  906.     };
  907.     e.init = function() {
  908.         var o, e = E(".extend-bolt-container");
  909.         e.length && (e.on("click", n), E(document).ajaxStart(function() {
  910.             t = setInterval(function() {
  911.                 T && T.append(".")
  912.             }, 1e3)
  913.         }).ajaxSuccess(function() {
  914.             clearInterval(t)
  915.         }).ajaxError(function() {
  916.             clearInterval(t)
  917.         }), R(), (o = S('input[name="check-package"]')).on("keyup", function() {
  918.             var e = E(this).val();
  919.             e.length < 3 || A(function() {
  920.                 E.ajax({
  921.                     url: C.data("extend.siteurl") + "list.json",
  922.                     dataType: "jsonp",
  923.                     data: {
  924.                         name: e,
  925.                         bolt: C.data("extend.sitever")
  926.                     }
  927.                 }).success(function(e) {
  928.                     if (e.packages.length) {
  929.                         var t = o.parent().find(".auto-search");
  930.                         for (var i in t.html("").show(), e.packages)
  931.                             if (e.packages.hasOwnProperty(i)) {
  932.                                 var n = e.packages[i],
  933.                                     a = 'data-request="prefill-package" data-packagename="' + n.name + '"';
  934.                                 t.append('<a class="btn btn-block btn-default prefill-package" ' + a + 'style="text-align: left;">' + n.title + " <small " + a + ">(" + n.authors + " - " + n.name + ")</small></a>")
  935.                             }
  936.                         o.on("blur", function() {
  937.                             t.fadeOut()
  938.                         })
  939.                     }
  940.                 })
  941.             }, 500)
  942.         }), E("#installModal").on("hide.bs.modal", function() {
  943.             S(".latest-version-container .installed-version-item").html('<tr><td colspan="3"><strong>' + C.data("extend.text.no-stable") + "</strong></td></tr>"), S(".stable-version-container .installed-version-item").html('<tr><td colspan="3"><strong>' + C.data("extend.text.no-stable") + "</strong></td></tr>"), S(".dev-version-container .installed-version-item").html('<tr><td colspan="3"><strong>' + C.data("extend.text.no-test") + "</strong></td></tr>"), S(".install-response-container .console").html(C.data("extend.text.installing")), S(".theme-postinstall").hide(), S(".theme-generate-response").hide(), S(".extension-postinstall").hide(), S(".install-response-container").hide(), S(".install-latest-container").hide(), S(".install-version-container").hide(), S(".postinstall-footer").hide(), S("#installModal .loader").show()
  944.         }))
  945.     }, C.extend = e
  946. }(Bolt || {}, jQuery),
  947. function(e, i) {
  948.     "use strict";
  949.     var t = {},
  950.         n = {},
  951.         a = /^([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?$/;
  952.     t.fire = function(e, t) {
  953.         var i = a.exec(e);
  954.         if (i && void 0 !== i[4])
  955.             for (; e;) n[e] && n[e].fire({
  956.                 namespace: i[1],
  957.                 domain: i[2],
  958.                 event: i[3],
  959.                 status: i[4]
  960.             }, t), e = e.replace(/\.?[a-zA-Z0-9_-]+$/, "")
  961.     }, t.on = function(e, t) {
  962.         a.exec(e) && (n[e] || (n[e] = i.Callbacks("unique")), n[e].add(t))
  963.     }, t.off = function(e, t) {
  964.         a.exec(e) && n[e] && n[e].remove(t)
  965.     }, e.events = t
  966. }(Bolt || {}, jQuery),
  967. function(a, o) {
  968.     "use strict";
  969.     var e = {};
  970.  
  971.     function s(e, t, i, n) {
  972.         var a = {
  973.             url: e,
  974.             type: "POST",
  975.             data: t,
  976.             success: function() {
  977.                 document.location.reload()
  978.             },
  979.             error: function(e) {
  980.                 alert(e.responseText), console.error(i)
  981.             }
  982.         };
  983.         n && (a.success = n), o.ajax(a)
  984.     }
  985.     e.createFile = function(e, t) {
  986.         var i = window.prompt(a.data("files.msg.create_file"));
  987.         i.length && s(a.data("url.file.create"), {
  988.             filename: i,
  989.             parentPath: t,
  990.             namespace: e
  991.         }, "Something went wrong creating this file!")
  992.     }, e.renameFile = function(e, t, i) {
  993.         var n = window.prompt(a.data("files.msg.rename_file"), i);
  994.         n.length && n !== i && s(a.data("url.file.rename"), {
  995.             namespace: e,
  996.             parent: t,
  997.             oldname: i,
  998.             newname: n
  999.         }, "Something went wrong renaming this file!")
  1000.     }, e.deleteFile = function(e, t, i) {
  1001.         confirm(a.data("files.msg.delete_file", {
  1002.             "%FILENAME%": t
  1003.         })) && s(a.data("url.file.delete"), {
  1004.             namespace: e,
  1005.             filename: t
  1006.         }, "Failed to delete the file from the server", function() {
  1007.             null !== i && o(i).closest("tr").slideUp()
  1008.         })
  1009.     }, e.duplicateFile = function(e, t) {
  1010.         s(a.data("url.file.duplicate"), {
  1011.             namespace: e,
  1012.             filename: t
  1013.         }, "Something went wrong duplicating this file!")
  1014.     }, e.createFolder = function(e, t) {
  1015.         var i = window.prompt(a.data("files.msg.create_folder"));
  1016.         i.length && s(a.data("url.folder.create"), {
  1017.             parent: t,
  1018.             foldername: i,
  1019.             namespace: e
  1020.         }, "Something went wrong renaming this folder!")
  1021.     }, e.renameFolder = function(e, t, i) {
  1022.         var n = window.prompt(a.data("files.msg.rename_folder"), i);
  1023.         n.length && n !== i && s(a.data("url.folder.rename"), {
  1024.             namespace: e,
  1025.             parent: t,
  1026.             oldname: i,
  1027.             newname: n
  1028.         }, "Something went wrong renaming this folder!")
  1029.     }, e.deleteFolder = function(e, t, i) {
  1030.         window.confirm(a.data("files.msg.delete_folder", {
  1031.             "%FOLDERNAME%": i
  1032.         })) && s(a.data("url.folder.delete"), {
  1033.             namespace: e,
  1034.             parent: t,
  1035.             foldername: i
  1036.         }, "Something went wrong renaming this folder!")
  1037.     }, a.files = e
  1038. }(Bolt || {}, jQuery),
  1039. function(i, a, n) {
  1040.     "use strict";
  1041.     var e = {};
  1042.  
  1043.     function t() {
  1044.         var n = a(this).val();
  1045.         a(".dashboardlisting").find("[data-bolt-browse-name]").each(function() {
  1046.             var i = a(this).data("bolt-browse-name"),
  1047.                 e = i.search(n) < 0;
  1048.             a(this).toggleClass("hidden", e), e || a(this).find(".name").each(function() {
  1049.                 var e, t;
  1050.                 a(this).html((t = "<mark>" + (e = n) + "</mark>", i.replace(new RegExp(e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"), "g"), t))), 0 === n.length && a(this).html(i)
  1051.             })
  1052.         })
  1053.     }
  1054.  
  1055.     function o() {
  1056.         for (var e = document.querySelectorAll("img[data-src]"), t = 0; t < e.length; t++) e[t].getAttribute("data-src") && (e[t].setAttribute("src", e[t].getAttribute("data-src")), e[t].removeAttribute("data-src"))
  1057.     }
  1058.  
  1059.     function s() {
  1060.         var e = a('form[name="file_upload"]').find("#file_upload__token").val(),
  1061.             t = new n(document.body, {
  1062.                 url: i.conf("uploadConfig.url"),
  1063.                 previewsContainer: "#dropzone-preview",
  1064.                 acceptedFiles: "." + i.conf("uploadConfig.acceptFilesTypes").join(",."),
  1065.                 uploadMultiple: "true",
  1066.                 enqueueForUpload: "true",
  1067.                 hiddenInputContainer: ".form-horizontal",
  1068.                 paramName: "file_upload[select]",
  1069.                 clickable: !1,
  1070.                 autoProcessQueue: !0,
  1071.                 params: {
  1072.                     "file_upload[_token]": e
  1073.                 },
  1074.                 init: function() {
  1075.                     var e, t, i;
  1076.                     e = this, t = a("body"), i = 0, t.bind({
  1077.                         dragenter: function(e) {
  1078.                             e.preventDefault(), i++, a(this).addClass("dropzone-active")
  1079.                         },
  1080.                         dragleave: function() {
  1081.                             0 == --i && a(this).removeClass("dropzone-active")
  1082.                         }
  1083.                     }), e.on("drop", function() {
  1084.                         t.removeClass("dropzone-active")
  1085.                     })
  1086.                 }
  1087.             });
  1088.         t.on("sending", function() {
  1089.             a(".panel-uploadprogress").removeClass("hidden")
  1090.         }), t.on("complete", function(e) {
  1091.             t.removeFile(e)
  1092.         }), t.on("totaluploadprogress", function(e) {
  1093.             100 === e && window.setTimeout(function() {
  1094.                 location.reload()
  1095.             }, 200)
  1096.         })
  1097.     }
  1098.     e.init = function() {
  1099.         n.autoDiscover = !1, null !== document.querySelector("div.file-manager") && (s(), document.getElementById("file-manager-search").addEventListener("keyup", t), a("#file_upload_select").addClass("btn-secondary").bootstrapFileInput(), document.getElementById("file_upload_select").addEventListener("change", function() {
  1100.             document.getElementById("file_upload_upload").removeAttribute("disabled")
  1101.         }), window.addEventListener("load", o))
  1102.     }, i.filemanager = e
  1103. }(Bolt || {}, jQuery, Dropzone),
  1104. function(d, c, e, o) {
  1105.     "use strict";
  1106.     var u = {},
  1107.         p = ["text", "html", "textarea"],
  1108.         a = null;
  1109.     u.init = function(e) {
  1110.         u.previewUrl = e.previewUrl, Modernizr.contenteditable ? (c("#sidebar_live_edit, #content_edit_live_edit").bind("click", u.start), c(".close-live-editor").bind("click", u.stop), c(".save-live-editor").bind("click", u.save)) : c(".live-editor, #sidebar_live_editor, #content_edit_live_edit").remove()
  1111.     }, u.start = function() {
  1112.         var l = c('form[name="content_edit"]');
  1113.         if (d.validation.run(l[0])) {
  1114.             var e = l.find("*[name=_live-editor-preview]"),
  1115.                 t = c("#navpage-primary").find(".navbar-header a"),
  1116.                 i = c("#live-editor-iframe"),
  1117.                 r = function(e) {
  1118.                     e.preventDefault()
  1119.                 },
  1120.                 n = function() {
  1121.                     var e = i[0],
  1122.                         n = e.contentWindow || e,
  1123.                         a = n.document,
  1124.                         t = c(a);
  1125.                     t.on("click", "a", r);
  1126.                     var o = d.ckeditor.initcke(n.CKEDITOR),
  1127.                         s = o.editorConfig;
  1128.                     o.editorConfig = function(e) {
  1129.                         for (var t in s.bind(this)(e), e.toolbar)
  1130.                             if ("tools" === e.toolbar[t].name) {
  1131.                                 var i = e.toolbar[t].items.indexOf("Source"); - 1 < i && delete e.toolbar[t].items[i]
  1132.                             }
  1133.                     }, o.disableAutoInline = !1, t.find("[data-bolt-field]").each(function() {
  1134.                         var e = l.find("*[name=" + u.escapejQuery(c(this).data("bolt-field")) + "]").closest("[data-bolt-fieldset]").data("bolt-fieldset");
  1135.                         if (c(this).addClass("bolt-editable"), !c(this).data("no-edit") && -1 !== p.indexOf(e))
  1136.                             if (c(this).attr("contenteditable", !0), "html" === e) {
  1137.                                 var t = o.inline(this, {
  1138.                                         allowedContent: ""
  1139.                                     }),
  1140.                                     i = d.utils.debounce(function() {
  1141.                                         t.element.data("src", t.getData())
  1142.                                     }, 500);
  1143.                                 t.on("instanceReady", i), t.on("change", i)
  1144.                             } else c(this).on("paste", function(e) {
  1145.                                 var t;
  1146.                                 e.preventDefault(), e.originalEvent.clipboardData ? (t = e.originalEvent.clipboardData.getData("text/plain"), a.execCommand("insertText", !1, t)) : n.clipboardData && (t = n.clipboardData.getData("Text"), n.getSelection && n.getSelection().getRangeAt(0).insertNode(a.createTextNode(t)))
  1147.                             }), "textarea" === e ? c(this).on("keypress", function(e) {
  1148.                                 13 === e.which && (e.preventDefault(), a.execCommand("insertHTML", !1, "<br><br>"))
  1149.                             }) : c(this).on("keypress", function(e) {
  1150.                                 return 13 !== e.which
  1151.                             }).on("focus blur", function() {
  1152.                                 c(this).html(c(this).text())
  1153.                             })
  1154.                     })
  1155.                 };
  1156.             i.on("load", n), d.liveEditor.active = !0, c("body").addClass("live-editor-active"), t.on("click", r), e.val("yes"), l.attr("action", u.previewUrl).attr("target", "live-editor-iframe").submit(), l.attr("action", "").attr("target", "_self"), e.val(""), a = function() {
  1157.                 i.off("load", n), t.off("click", r)
  1158.             }
  1159.         }
  1160.     }, u.save = function() {
  1161.         u.extractText(), c("#content_edit_save").trigger("click")
  1162.     }, u.stop = function() {
  1163.         var e = c("#live-editor-iframe")[0];
  1164.         u.extractText(), c(e).attr("src", ""), d.liveEditor.active = !1, c("body").removeClass("live-editor-active"), a()
  1165.     }, u.extractText = function() {
  1166.         var e = c("#live-editor-iframe")[0],
  1167.             t = (e.contentWindow || e).document;
  1168.         c(t).find("[data-bolt-field]").each(function() {
  1169.             var e = c('form[name="content_edit"]'),
  1170.                 t = c(this).data("bolt-field"),
  1171.                 i = e.find("[name=" + u.escapejQuery(t) + "]"),
  1172.                 n = i.closest("[data-bolt-fieldset]").data("bolt-fieldset");
  1173.             if ("html" === n) {
  1174.                 var a = i.attr("id");
  1175.                 o.instances.hasOwnProperty(a) && o.instances[a].setData(c(this).data("src"))
  1176.             } else i.val(u.cleanText(c(this), n))
  1177.         })
  1178.     }, u.cleanText = function(e, t) {
  1179.         return "textarea" === t && e.html(e.html().replace(/&nbsp;/g, " ").replace(/\s?<br.*?>\s?/g, "\n")), e.text()
  1180.     }, u.escapejQuery = function(e) {
  1181.         return e.replace(/[:\.\[\],]/g, "\\$1")
  1182.     }, u.active = !1, u.previewUrl = null, d.liveEditor = u
  1183. }(Bolt || {}, jQuery, window, "undefined" != typeof CKEDITOR ? CKEDITOR : void 0),
  1184. function(t, n, i) {
  1185.     "use strict";
  1186.     var e = {
  1187.         init: function() {
  1188.             var e = n(".omnisearch select");
  1189.             e.select2({
  1190.                 width: "100%",
  1191.                 placeholder: t.data("omnisearch.placeholder"),
  1192.                 minimumInputLength: 3,
  1193.                 multiple: !0,
  1194.                 ajax: {
  1195.                     delay: 600,
  1196.                     url: e.data("omnisearchUrl"),
  1197.                     dataType: "json",
  1198.                     data: function(e) {
  1199.                         return {
  1200.                             q: e.term
  1201.                         }
  1202.                     },
  1203.                     processResults: function(e) {
  1204.                         var i = [];
  1205.                         return n.each(e, function(e, t) {
  1206.                             i.push({
  1207.                                 id: t.path,
  1208.                                 path: t.path,
  1209.                                 text: t.label
  1210.                             })
  1211.                         }), {
  1212.                             results: i
  1213.                         }
  1214.                     }
  1215.                 },
  1216.                 templateResult: function(e) {
  1217.                     var t = e.path ? "<small>" + e.path + "</small>" : "";
  1218.                     return "<div>" + (e.loading ? '<i class="fa fa-spinner fa-spin"></i> ' : "") + e.text + "</div>" + t
  1219.                 },
  1220.                 templateSelection: function(e) {
  1221.                     return i.location.href = e.path, null
  1222.                 },
  1223.                 escapeMarkup: function(e) {
  1224.                     return e
  1225.                 }
  1226.             })
  1227.         }
  1228.     };
  1229.     t.omnisearch = e
  1230. }(Bolt || {}, jQuery, window),
  1231. function(e, s, l) {
  1232.     "use strict";
  1233.     var t = {},
  1234.         n = 0;
  1235.  
  1236.     function r() {
  1237.         var e = s("#navpage-content").outerHeight(),
  1238.             t = s("#navpage-secondary"),
  1239.             i = t.outerHeight(),
  1240.             n = s(document).height() - t.position().top,
  1241.             a = Math.max(e, n),
  1242.             o = 5e3;
  1243.         i !== a && (t.outerHeight(a), o = 500), l.setTimeout(r, o)
  1244.     }
  1245.     t.init = function() {
  1246.         var e = !s(".navbar-toggle").is(":visible");
  1247.         s(".navbar-toggle").on("click", function() {
  1248.             var e = s("#navpage-wrapper");
  1249.             e.hasClass("nav-secondary-opened") ? e.removeClass("nav-secondary-opened nav-secondary-collapsed") : e.removeClass("nav-secondary-collapsed").addClass("nav-secondary-opened")
  1250.         }), s(".nav-secondary-collapse a").on("click", function() {
  1251.             return s("#navpage-wrapper").removeClass("nav-secondary-opened").addClass("nav-secondary-collapsed"), setTimeout(function() {
  1252.                 s("#navpage-wrapper").addClass("nav-secondary-collapsed-hoverable")
  1253.             }, 300), s.cookie("sidebar", "collapsed", {
  1254.                 expires: 21,
  1255.                 path: "/"
  1256.             }), s("#bolt-footer").addClass("bolt-footer-hidden"), !1
  1257.         }), s(".nav-secondary-expand a").on("click", function() {
  1258.             return s("#navpage-wrapper").removeClass("nav-secondary-collapsed nav-secondary-opened nav-secondary-collapsed-hoverable"), s.removeCookie("sidebar", {
  1259.                 path: "/"
  1260.             }), s("#bolt-footer").removeClass("bolt-footer-hidden"), !1
  1261.         }), s("#navpage-secondary").length && r(), e ? s("#navpage-secondary").find("a.menu-pop").each(function() {
  1262.             var e = s(this),
  1263.                 t = "";
  1264.             e.nextAll(".submenu").children().each(function() {
  1265.                 s(this).hasClass("subdivider") && (t += "<hr>"), t += s(this).html().trim().replace(/[ \n]+/g, " ").replace(/(>) | (<)/g, "$1$2")
  1266.             }), e.popover({
  1267.                 trigger: "manual",
  1268.                 content: t,
  1269.                 html: !0
  1270.             }), e.on("mouseover focus click dblclick", function(e) {
  1271.                 var t = this,
  1272.                     i = 300;
  1273.                 "click" !== e.type || s(t).next().hasClass("popover") || (e.preventDefault(), i = 0), l.clearTimeout(n), n = l.setTimeout(function() {
  1274.                     s("#navpage-secondary a.menu-pop").not(t).popover("hide"), s(t).popover("show")
  1275.                 }, i)
  1276.             })
  1277.         }).end().on("mouseenter focus", ".popover", function() {
  1278.             l.clearTimeout(n)
  1279.         }).on("mouseleave blur", "a.menu-pop, .popover", function() {
  1280.             l.clearTimeout(n), n = l.setTimeout(function() {
  1281.                 s("#navpage-secondary a.menu-pop").popover("hide")
  1282.             }, 300)
  1283.         }) : s("#navpage-secondary a.menu-pop").on("click", function(e) {
  1284.             var t = s(this).nextAll(".submenu");
  1285.             e.preventDefault(), t.hasClass("show") ? t.removeClass("show") : (s("#navpage-secondary .submenu").removeClass("show"), t.addClass("show"))
  1286.         })
  1287.     }, e.secmenu = t
  1288. }(Bolt || {}, jQuery, window),
  1289. function(t, n) {
  1290.     "use strict";
  1291.     var a = {
  1292.         init: function() {
  1293.             n("a[data-bolt-addtostack]").each(function() {
  1294.                 n(this).on("click", function(e) {
  1295.                     var t = n(e.currentTarget),
  1296.                         i = t.data("bolt-addtostack");
  1297.                     e.preventDefault(), a.addToStack(i, t)
  1298.                 })
  1299.             })
  1300.         },
  1301.         addToStack: function(e, i) {
  1302.             n.post(t.conf("stackAddUrl"), {
  1303.                 filename: e
  1304.             }).done(function(t) {
  1305.                 i && n(i).addClass("disabled"), n(":bolt-buicStack").buicStack("prepend", t.panel, t.removed), t.removed && n(".select-from-stack [data-file]").each(function() {
  1306.                     n(this).data("file").fullPath === t.removed && n(this).remove()
  1307.                 }), n(".select-from-stack").each(function() {
  1308.                     var e = n(this).data("type");
  1309.                     e && t.type !== e || n(this).prepend(t.list)
  1310.                 })
  1311.             }).fail(function() {
  1312.                 console.error("Failed to add file to stack")
  1313.             })
  1314.         }
  1315.     };
  1316.     t.stack = a
  1317. }(Bolt || {}, jQuery),
  1318. function(i) {
  1319.     "use strict";
  1320.     var e = {
  1321.         humanBytes: function(e) {
  1322.             for (var t = -1; ++t < 8 && 1e3 <= Math.abs(e);) e /= 1e3;
  1323.             return (e = "object" == typeof Intl && Intl && "function" == typeof Intl.NumberFormat ? e.toLocaleString(i.conf("locale.long").replace(/_/g, "-"), {
  1324.                 maximumSignificantDigits: 3
  1325.             }) : e.toFixed(2)) + " " + " kMGTPEZY" [t].trim() + "B"
  1326.         },
  1327.         filterInt: function(e, t) {
  1328.             return /^(\-|\+)?([0-9]+|Infinity)$/.test(e) ? Number(e) : t || NaN
  1329.         },
  1330.         debounce: function(n, a, o) {
  1331.             var s;
  1332.             return function() {
  1333.                 var e = this,
  1334.                     t = arguments,
  1335.                     i = o && !s;
  1336.                 clearTimeout(s), s = setTimeout(function() {
  1337.                     s = null, o || n.apply(e, t)
  1338.                 }, a), i && n.apply(e, t)
  1339.             }
  1340.         }
  1341.     };
  1342.     i.utils = e
  1343. }(Bolt || {}),
  1344. function(e) {
  1345.     "use strict";
  1346.     jQuery.widget("bolt.baseField", {
  1347.         _create: function() {}
  1348.     })
  1349. }(),
  1350. function(a) {
  1351.     "use strict";
  1352.     var o = {};
  1353.     a.widget("bolt.baseInterval", {
  1354.         options: {
  1355.             delay: 1e4
  1356.         },
  1357.         _create: function() {
  1358.             var e = this,
  1359.                 t = this.widgetName;
  1360.             if (!o[t]) {
  1361.                 var i = a.Callbacks(),
  1362.                     n = setInterval(i.fire, this.options.delay);
  1363.                 o[t] = {
  1364.                     id: n,
  1365.                     delay: this.options.delay,
  1366.                     callbacks: i
  1367.                 }
  1368.             }
  1369.             this._fncUpdate = function() {
  1370.                 e._update()
  1371.             }, o[t].callbacks.add(this._fncUpdate)
  1372.         },
  1373.         _destroy: function() {
  1374.             var e = this.widgetName;
  1375.             o[e].callbacks.remove(this._fncUpdate), o[e].callbacks.has() || (clearInterval(o[e].id), delete o[e])
  1376.         }
  1377.     })
  1378. }(jQuery),
  1379. function(l) {
  1380.     "use strict";
  1381.     l.widget("bolt.buicBrowser", {
  1382.         options: {
  1383.             url: "",
  1384.             multiselect: !1
  1385.         },
  1386.         _create: function() {
  1387.             this._url = this.options.url, this._on({
  1388.                 click: function() {
  1389.                     this._browse()
  1390.                 }
  1391.             })
  1392.         },
  1393.         _browse: function() {
  1394.             var a = this,
  1395.                 e = {
  1396.                     multiselect: this.options.multiselect
  1397.                 },
  1398.                 o = [],
  1399.                 s = !1;
  1400.             l("body").buicModal({
  1401.                 size: "large",
  1402.                 remote: {
  1403.                     url: a._url,
  1404.                     data: e
  1405.                 },
  1406.                 loaded: function(e, n) {
  1407.                     var i = n.footer.find("[data-fbrowser-add-checked]");
  1408.                     n.header.on("click.bolt", "[data-fbrowser-chdir]", function(e) {
  1409.                         e.preventDefault(), a._url = l(this).data("fbrowser-chdir"), a._browse()
  1410.                     }), n.body.on("click.bolt", "[data-fbrowser-chdir]", function(e) {
  1411.                         e.preventDefault(), a._url = l(this).data("fbrowser-chdir"), a._browse()
  1412.                     }).on("click.bolt", "[data-file] a", function(e) {
  1413.                         e.preventDefault();
  1414.                         var t = l(this).closest("[data-file]").data("file");
  1415.                         a._trigger("selected", null, t), n.close()
  1416.                     }).on("click.bolt", "[aria-pressed]", function(e) {
  1417.                         var t = "false" === l(this).attr("aria-pressed"),
  1418.                             i = this.className.replace("toogle-", "");
  1419.                         l(this).attr("aria-pressed", t ? "true" : "false"), n.body.find("tbody." + i).toggleClass("hidden", !t), 0 < e.clientX && this.blur()
  1420.                     }).on("change", 'select[name="ext"]', function() {
  1421.                         a._filter(n)
  1422.                     }).keyup('input[name="filter"]', function() {
  1423.                         a._filter(n)
  1424.                     }).on("change", "[data-fbrowser-check]", function() {
  1425.                         var e = l(this).closest("[data-file]").data("file"),
  1426.                             t = o.indexOf(e.fullPath); - 1 < t ? (o.splice(t, 1), s = !1, 0 === o.length && i.addClass("disabled")) : (o.push(e.fullPath), i.removeClass("disabled"))
  1427.                     }), n.footer.on("click.bolt", ".toggle-all", function(e) {
  1428.                         e.preventDefault(), s ? (n.body.find("[data-fbrowser-check]").each(function() {
  1429.                             l(this).prop("checked", !1)
  1430.                         }), o.length = 0, s = !1, i.addClass("disabled")) : (n.body.find("[data-fbrowser-check]").each(function() {
  1431.                             l(this).prop("checked", !0);
  1432.                             var e = l(this).closest("[data-file]").data("file");
  1433.                             o.push(e.fullPath)
  1434.                         }), s = !0, i.removeClass("disabled"))
  1435.                     }).on("click.bolt", "[data-fbrowser-add-checked]:not(.disabled)", function(e) {
  1436.                         e.preventDefault(), n.body.find("[data-fbrowser-check]").each(function() {
  1437.                             if (l(this).prop("checked")) {
  1438.                                 var e = l(this).closest("[data-file]").data("file");
  1439.                                 a._trigger("selected", null, e)
  1440.                             }
  1441.                         }), n.close()
  1442.                     })
  1443.                 }
  1444.             })
  1445.         },
  1446.         _filter: function(e) {
  1447.             var t, i, n = e.body.find('input[name="filter"]').val(),
  1448.                 a = e.body.find('select[name="ext"]').val();
  1449.             e.body.find("[data-file],[data-folder]").each(function() {
  1450.                 t = l(this).data("file") || l(this).data("folder"), i = "" !== a && t.extension !== a || "" !== n && t.filename.search(n) < 0, l(this).toggleClass("hidden", i), i || l(this).find("a, span").each(function() {
  1451.                     l(this).html(t.filename.replace(n, "<mark>" + n + "</mark>"))
  1452.                 })
  1453.             })
  1454.         }
  1455.     })
  1456. }(jQuery),
  1457. function(e) {
  1458.     "use strict";
  1459.     jQuery.widget("bolt.buicCheckbox", {
  1460.         _create: function() {
  1461.             var e = this.element.find("button"),
  1462.                 t = this.element.find("input");
  1463.             this._on(e, {
  1464.                 click: function() {
  1465.                     t.prop("checked", !t.prop("checked"))
  1466.                 }
  1467.             })
  1468.         }
  1469.     })
  1470. }(),
  1471. function(l, r) {
  1472.     "use strict";
  1473.     l.widget("bolt.buicListing", {
  1474.         _create: function() {
  1475.             this.csrfToken = this.element.data("bolt_csrf_token"), this.contentType = this.element.data("contenttype"), this.contentTypeName = this.element.data("contenttype-name"), this.element.find("table.listing tbody").buicListingPart()
  1476.         },
  1477.         modifyRecords: function(e, t, i) {
  1478.             var n, a = this,
  1479.                 o = {},
  1480.                 s = {
  1481.                     delete: {
  1482.                         safe: !1,
  1483.                         name: r.data("recordlisting.action.delete", {
  1484.                             "%CTNAME%": this.contentTypeName
  1485.                         }),
  1486.                         cmd: {
  1487.                             delete: null
  1488.                         }
  1489.                     },
  1490.                     publish: {
  1491.                         safe: !0,
  1492.                         name: r.data("recordlisting.action.publish", {
  1493.                             "%CTNAME%": this.contentTypeName
  1494.                         }),
  1495.                         cmd: {
  1496.                             modify: {
  1497.                                 status: "published"
  1498.                             }
  1499.                         }
  1500.                     },
  1501.                     depublish: {
  1502.                         safe: !0,
  1503.                         name: r.data("recordlisting.action.depublish"),
  1504.                         cmd: {
  1505.                             modify: {
  1506.                                 status: "held"
  1507.                             }
  1508.                         }
  1509.                     },
  1510.                     draft: {
  1511.                         safe: !0,
  1512.                         name: r.data("recordlisting.action.draft"),
  1513.                         cmd: {
  1514.                             modify: {
  1515.                                 status: "draft"
  1516.                             }
  1517.                         }
  1518.                     }
  1519.                 };
  1520.             o[a.contentType] = {}, l(t).each(function() {
  1521.                 o[a.contentType][this] = s[e].cmd
  1522.             }), n = (n = 1 === t.length ? r.data("recordlisting.confirm.one") : r.data("recordlisting.confirm.multi", {
  1523.                 "%NUMBER%": "<b>" + t.length + "</b>"
  1524.             })) + "<br><br><b>" + r.data("recordlisting.confirm.no-undo") + "</b>", s[e].safe ? a._sendModifyRecordsQuery(o) : bootbox.dialog({
  1525.                 message: n,
  1526.                 title: s[e].name,
  1527.                 buttons: {
  1528.                     cancel: {
  1529.                         label: r.data("recordlisting.action.cancel"),
  1530.                         className: "btn-default"
  1531.                     },
  1532.                     ok: {
  1533.                         label: i,
  1534.                         className: "btn-danger",
  1535.                         callback: function() {
  1536.                             a._sendModifyRecordsQuery(o)
  1537.                         }
  1538.                     }
  1539.                 }
  1540.             })
  1541.         },
  1542.         _sendModifyRecordsQuery: function(e) {
  1543.             var t = this;
  1544.             l.ajax({
  1545.                 url: r.conf("contentActionUrl"),
  1546.                 type: "POST",
  1547.                 data: {
  1548.                     bolt_csrf_token: t.csrfToken,
  1549.                     contenttype: t.contentType,
  1550.                     actions: e
  1551.                 },
  1552.                 success: function(e) {
  1553.                     t.element.html(e), t.element.find("table.listing tbody").buicListingPart()
  1554.                 },
  1555.                 error: function(e, t, i) {
  1556.                     console.error(e.status + " (" + i + "):"), console.error(JSON.parse(e.responseText))
  1557.                 },
  1558.                 dataType: "html"
  1559.             })
  1560.         }
  1561.     })
  1562. }(jQuery, Bolt),
  1563. function(a) {
  1564.     "use strict";
  1565.     a.widget("bolt.buicListingPart", {
  1566.         _create: function() {
  1567.             var t = this;
  1568.             this.listing = this.element.closest(":bolt-buicListing"), this.toolbar = this.element.find("tr.selectiontoolbar"), this.toolbarCount = this.toolbar.find("div.count"), this.menu = this.element.find("tr.header th.menu"), this.menuOnlyOnSelection = this.menu.find("li:not(.select-all)"), this.menuSelectionCount = this.menu.find("li.dropdown-header"), this.menuSelectionCountTemplate = this.menuSelectionCount.text(), this.selectedIds = [], this.menu.find("li.select-all, li.select-none").on("click", function() {
  1569.                 var e = a(this).hasClass("select-all");
  1570.                 t.element.find('td input:checkbox[name="checkRow"]').each(function() {
  1571.                     this.checked = e, t._update(this)
  1572.                 })
  1573.             }), this.element.find('td input:checkbox[name="checkRow"]').on("click", function() {
  1574.                 t._update(this)
  1575.             }), this.toolbar.find('button[data-stb-cmd^="record:"]').on("click", function() {
  1576.                 t._modifyRecords(a(this).data("stb-cmd"), t.selectedIds, a(this).html())
  1577.             }), this.element.find('a[data-listing-cmd^="record:"]').on("click", function() {
  1578.                 t._modifyRecords(a(this).data("listing-cmd"), [a(this).parents("tr").attr("id").substr(5)], a(this).html())
  1579.             })
  1580.         },
  1581.         _modifyRecords: function(e, t, i) {
  1582.             0 < t.length && this.listing.buicListing("modifyRecords", e.replace(/^record:/, ""), t, i)
  1583.         },
  1584.         _update: function(e) {
  1585.             var t, i = a(e).closest("tr"),
  1586.                 n = i.attr("id").substr(5);
  1587.             e.checked ? (-1 === this.selectedIds.indexOf(n) && this.selectedIds.push(n), i.addClass("row-selected")) : (this.selectedIds.splice(this.selectedIds.indexOf(n), 1), i.removeClass("row-selected")), (t = this.selectedIds.length) ? (this.toolbar.removeClass("hidden"), this.menuOnlyOnSelection.removeClass("hidden")) : (this.toolbar.addClass("hidden"), this.menuOnlyOnSelection.addClass("hidden")), this.toolbarCount.text(t), this.menuSelectionCount.text(this.menuSelectionCountTemplate.replace("(#)", "(" + t + ")"))
  1588.         }
  1589.     })
  1590. }(jQuery),
  1591. function(l) {
  1592.     "use strict";
  1593.     l.widget("bolt.buicModal", {
  1594.         options: {
  1595.             size: void 0,
  1596.             closer: !1,
  1597.             classname: void 0,
  1598.             headline: void 0,
  1599.             header: void 0,
  1600.             body: void 0,
  1601.             footer: void 0,
  1602.             remote: void 0,
  1603.             loaded: void 0
  1604.         },
  1605.         _create: function() {
  1606.             var e = this,
  1607.                 t = l('<div class="modal-header hidden"/>'),
  1608.                 i = l("<div class=modal-body/>"),
  1609.                 n = l('<div class="modal-footer hidden"/>'),
  1610.                 a = l("<div class=modal-content/>").append(t, i, n),
  1611.                 o = l("<div class=modal-dialog role=document/>").append(a),
  1612.                 s = l('<div tabindex=-1 role=dialog class="modal fade buic-modal"/>').append(o);
  1613.             this._ui = {
  1614.                 header: t,
  1615.                 body: i,
  1616.                 footer: n,
  1617.                 content: a,
  1618.                 dialog: o,
  1619.                 modal: s
  1620.             }, this._on(this.element, {
  1621.                 "click .modal-retry": function() {
  1622.                     e._load()
  1623.                 }
  1624.             }), e.element.prepend(e._ui.modal), e._ui.modal.on("show.bs.modal", function() {
  1625.                 e._fire("show")
  1626.             }).on("shown.bs.modal", function() {
  1627.                 e._fire("shown")
  1628.             }).on("hide.bs.modal", function() {
  1629.                 e._fire("hide")
  1630.             }).on("hidden.bs.modal", function() {
  1631.                 e._fire("hidden"), e.destroy()
  1632.             }).modal("show")
  1633.         },
  1634.         _destroy: function() {
  1635.             this._ui.modal.data("modal", null).remove()
  1636.         },
  1637.         _fire: function(e) {
  1638.             var t = this;
  1639.             t._trigger(e, null, {
  1640.                 close: function() {
  1641.                     t._ui.modal.modal("hide")
  1642.                 },
  1643.                 header: t._ui.header,
  1644.                 body: t._ui.body,
  1645.                 footer: t._ui.footer
  1646.             })
  1647.         },
  1648.         _init: function() {
  1649.             this._ui.dialog.toggleClass("modal-sm", "small" === this.options.size).toggleClass("modal-lg", "large" === this.options.size), this.options.remote ? this._load() : this._update()
  1650.         },
  1651.         _load: function() {
  1652.             var a = this;
  1653.             a._ui.content.addClass("modal-loading"), l.get(a.options.remote.url, a.options.remote.data || {}).done(function(n) {
  1654.                 a.options.classname = l(n)[0].className, l.each(["header", "body", "footer"], function(e, t) {
  1655.                     var i = l(n).children(t.replace("body", "main"))[0];
  1656.                     a.options[t] = i ? i.innerHTML : void 0
  1657.                 }), a._update(), a._fire("loaded")
  1658.             }).fail(function() {
  1659.                 a.options.header = void 0, a.options.body = '<button type=button class="btn btn-default modal-retry"><i class="fa fa-refresh"></i></button>', a.options.footer = void 0, a._update()
  1660.             }).always(function() {
  1661.                 a._ui.content.removeClass("modal-loading")
  1662.             })
  1663.         },
  1664.         _update: function() {
  1665.             var i, n = this;
  1666.             void 0 !== this.options.headline && (this.options.header = l(), this.options.closer && (this.options.header = this.options.header.add('<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>')), this.options.header = this.options.header.add(l('<h4 class="modal-title"/>').append(this.options.headline))), this._ui.content.attr("class", "modal-content").addClass(this.options.classname), l.each(["header", "body", "footer"], function(e, t) {
  1667.                 i = l("<div>").append(n.options[t]).html() || "", n._ui[t].off().toggleClass("hidden", !i.length).html(i)
  1668.             }), this._ui.modal.modal("handleUpdate")
  1669.         }
  1670.     })
  1671. }(jQuery),
  1672. function(e, t) {
  1673.     "use strict";
  1674.     e.widget("bolt.buicMoment", e.bolt.baseInterval, {
  1675.         options: {
  1676.             delay: 15e3,
  1677.             titleFormat: "YYYY-MM-DD HH:mm:ss ZZ"
  1678.         },
  1679.         _create: function() {
  1680.             this.set(), this._super()
  1681.         },
  1682.         _update: function() {
  1683.             this.element.html(t(this.element.attr("datetime")).fromNow())
  1684.         },
  1685.         set: function(e) {
  1686.             e ? this.element.attr("datetime", t(e).format()) : e = this.element.attr("datetime"), this.element.attr("title", t(e).format(this.options.titleFormat)), this._update()
  1687.         }
  1688.     })
  1689. }(jQuery, moment),
  1690. function(n) {
  1691.     "use strict";
  1692.     n.widget("bolt.buicProgress", {
  1693.         _create: function() {
  1694.             this.bars = {}, this.element.addClass("buic-progress")
  1695.         },
  1696.         _set: function(e, t) {
  1697.             t = parseFloat(t), t = isNaN(t) ? 0 : Math.min(100, Math.max(0, Math.round(100 * t))), this.bars[e] && this.bars[e].find(".progress-bar").attr("aria-valuenow", t).css("width", t + "%")
  1698.         },
  1699.         add: function(e, t, i) {
  1700.             this.bars[e] || (this.bars[e] = n('<div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div></div>'), this.bars[e].attr("data-label", i || e).find(".progress-bar").text(i || e), this._set(e, t), this.element.append(this.bars[e]).show(), this.bars[e].show(300))
  1701.         },
  1702.         remove: function(e) {
  1703.             if (this.bars[e]) {
  1704.                 var t = this,
  1705.                     i = this.bars[e];
  1706.                 delete this.bars[e], i.hide(300, function() {
  1707.                     i.remove(), 0 === Object.keys(t.bars).length && t.element.hide()
  1708.                 })
  1709.             }
  1710.         },
  1711.         set: function(e, t) {
  1712.             this._set(e, t)
  1713.         }
  1714.     })
  1715. }(jQuery),
  1716. function(e) {
  1717.     "use strict";
  1718.     jQuery.widget("bolt.buicSelect", {
  1719.         _create: function() {
  1720.             this.select = this.element.find("select"), this.buttonAll = this.element.find(".select-all"), this.buttonNone = this.element.find(".select-none"), this.buttonAll.prop("title", this.buttonAll.text().trim()), this._on(this.buttonAll, {
  1721.                 click: function() {
  1722.                     this.all()
  1723.                 }
  1724.             }), this.buttonNone.prop("title", this.buttonNone.text().trim()), this._on(this.buttonNone, {
  1725.                 click: function() {
  1726.                     this.none()
  1727.                 }
  1728.             }), this._update(), this._on(this.select, {
  1729.                 change: function() {
  1730.                     this._update()
  1731.                 }
  1732.             })
  1733.         },
  1734.         _update: function() {
  1735.             var e = this.select.find("option"),
  1736.                 t = e.length,
  1737.                 i = e.filter(":selected").length,
  1738.                 n = this.select.prop("multiple") ? 0 === i : "" === this.select.val();
  1739.             this.buttonAll.prop("disabled", i === t), this.buttonNone.prop("disabled", n)
  1740.         },
  1741.         all: function() {
  1742.             this.select.find("option").prop("selected", !0).trigger("change")
  1743.         },
  1744.         none: function() {
  1745.             this.select.val(null).trigger("change")
  1746.         }
  1747.     })
  1748. }(),
  1749. function(i, n) {
  1750.     "use strict";
  1751.     i.widget("bolt.buicStack", {
  1752.         _addPath: function(e, t) {
  1753.             n.stack.addToStack(t.path)
  1754.         },
  1755.         _create: function() {
  1756.             var e = this.element;
  1757.             this._ui = {
  1758.                 holder: e.find(".stackholder")
  1759.             }, this._on({
  1760.                 buicbrowserselected: this._addPath,
  1761.                 buicuploaduploaded: this._addPath
  1762.             }), e.on("inserted.bs.popover", ".stackitem", function() {
  1763.                 n.app.initWidgets()
  1764.             }), e.buicUpload()
  1765.         },
  1766.         prepend: function(e, t) {
  1767.             t && this._ui.holder.find("[data-file]").each(function() {
  1768.                 i(this).data("file").fullPath === t && i(this).remove()
  1769.             }), this._ui.holder.find(".empty").remove(), this._ui.holder.prepend(e), this._ui.holder.find(".info-pop").popover({
  1770.                 trigger: "hover",
  1771.                 delay: {
  1772.                     show: 500,
  1773.                     hide: 200
  1774.                 }
  1775.             })
  1776.         }
  1777.     })
  1778. }(jQuery, Bolt),
  1779. function(l, r) {
  1780.     "use strict";
  1781.     l.widget("bolt.buicUpload", {
  1782.         _create: function() {
  1783.             var e = this.element,
  1784.                 t = l("input[type=file]", e),
  1785.                 i = l(".elm-dropzone", e),
  1786.                 n = l(t).attr("accept"),
  1787.                 a = n ? n.replace(/^\./, "").split(/,\./) : [],
  1788.                 o = new RegExp("(\\.|\\/)(" + a.join("|") + ")$", "i");
  1789.             if (null === this.options.maxSize) {
  1790.                 var s = Math.floor(r.conf("uploadConfig.maxSize"));
  1791.                 this.options.maxSize = r.utils.filterInt(s, 2e6)
  1792.             }
  1793.             this._ui = {
  1794.                 progress: null
  1795.             }, t.fileupload({
  1796.                 dataType: "json",
  1797.                 dropZone: i,
  1798.                 pasteZone: null,
  1799.                 maxFileSize: 0 < this.options.maxSize ? this.options.maxSize : void 0,
  1800.                 minFileSize: void 0,
  1801.                 acceptFileTypes: n ? o : void 0,
  1802.                 maxNumberOfFiles: void 0,
  1803.                 messages: {
  1804.                     maxFileSize: ">:" + r.utils.humanBytes(this.options.maxSize),
  1805.                     minFileSize: "<",
  1806.                     acceptFileTypes: "T:." + a.join(", ."),
  1807.                     maxNumberOfFiles: "#"
  1808.                 }
  1809.             }), this._on({
  1810.                 fileuploadprocessfail: this._onProcessFail,
  1811.                 fileuploadsubmit: this._onUploadSubmit,
  1812.                 fileuploadprogress: this._onUploadProgress,
  1813.                 fileuploadalways: this._onUploadAlways,
  1814.                 fileuploaddone: this._onUploadDone
  1815.             })
  1816.         },
  1817.         _onProcessFail: function(e, t) {
  1818.             var i, n = t.files[t.index],
  1819.                 a = n.error.substr(0, 1),
  1820.                 o = {
  1821.                     "%FILENAME%": n.name,
  1822.                     "%FILESIZE%": r.utils.humanBytes(n.size),
  1823.                     "%FILETYPE%": n.type,
  1824.                     "%ALLOWED%": n.error.substr(2)
  1825.                 };
  1826.             switch (a) {
  1827.                 case ">":
  1828.                     i = r.data("field.uploads.template.large-file", o);
  1829.                     break;
  1830.                 case "T":
  1831.                     i = r.data("field.uploads.template.wrong-type", o);
  1832.                     break;
  1833.                 default:
  1834.                     i = "<p>" + n.error + "</p>"
  1835.             }
  1836.             bootbox.alert(i)
  1837.         },
  1838.         _onUploadSubmit: function(e, t) {
  1839.             this._progress("add", t.files)
  1840.         },
  1841.         _onUploadProgress: function(e, t) {
  1842.             this._progress("set", t.files, t.loaded / t.total)
  1843.         },
  1844.         _onUploadAlways: function(e, t) {
  1845.             this._progress("remove", t.files)
  1846.         },
  1847.         _onUploadDone: function(i, e) {
  1848.             var n = this;
  1849.             l.each(e.result, function(e, t) {
  1850.                 t.error ? bootbox.alert(r.data("field.uploads.template.error", {
  1851.                     "%ERROR%": t.error
  1852.                 })) : n._trigger("uploaded", i, t)
  1853.             })
  1854.         },
  1855.         _progress: function(e, t, i) {
  1856.             var n = this;
  1857.             null === n._ui.progress && (n._ui.progress = l(":bolt-buicProgress", n.element)), l.each(t, function() {
  1858.                 n._ui.progress.buicProgress(e, this.name, i)
  1859.             })
  1860.         },
  1861.         options: {
  1862.             maxSize: null
  1863.         }
  1864.     })
  1865. }(jQuery, Bolt),
  1866. function(a, o, i) {
  1867.     "use strict";
  1868.     a.widget("bolt.fieldBlock", a.bolt.baseField, {
  1869.         options: {
  1870.             name: ""
  1871.         },
  1872.         _create: function() {
  1873.             var i = this;
  1874.             this._ui = {
  1875.                 add: i.element.find(".block-add .add-button"),
  1876.                 slot: i.element.find(".block-slot")
  1877.             }, this._templates = i.element.find('script[type="text/template"]'), i._ui.add.on("click", function(e) {
  1878.                 i._append(e)
  1879.             }), i.element.find(".block-slot").sortable({
  1880.                 cursor: "move",
  1881.                 handle: ".panel-heading",
  1882.                 stop: function(e, t) {
  1883.                     i._renumber(), i._resetEditors(t.item)
  1884.                 }
  1885.             }), i.element.on("click", ".delete-button", function() {
  1886.                 var t = a(this).closest(".block-group");
  1887.                 bootbox.confirm(o.data("editcontent.deleteset"), function(e) {
  1888.                     a(".alert").alert(), !0 === e && (t.remove(), i._renumber())
  1889.                 })
  1890.             }), i.element.on("click", ".move-up", function() {
  1891.                 var e = a(this).closest(".block-group");
  1892.                 e.insertBefore(e.prev(".block-group")), i._renumber(), i._resetEditors(e)
  1893.             }), i.element.on("click", ".move-down", function() {
  1894.                 var e = a(this).closest(".block-group");
  1895.                 e.insertAfter(e.next(".block-group")), i._renumber(), i._resetEditors(e)
  1896.             }), i.element.on("click", ".repeater-collapse", function() {
  1897.                 var e = a(this).closest(".block-group").find(".panel-body");
  1898.                 a(this).toggleClass("collapsed"), e.slideToggle()
  1899.             }), i.element.on("click", ".hide-all-blocks", function() {
  1900.                 var e = a(this).closest(".bolt-field-block"),
  1901.                     t = e.find(".panel-body");
  1902.                 e.find(".repeater-collapse").addClass("collapsed"), t.slideUp()
  1903.             }), i.element.on("click", ".show-all-blocks", function() {
  1904.                 var e = a(this).closest(".bolt-field-block"),
  1905.                     t = e.find(".panel-body");
  1906.                 e.find(".repeater-collapse").removeClass("collapsed"), t.slideDown()
  1907.             }), i.element.on("keyup change", "input[type=text]", function() {
  1908.                 if (a(this).closest(".bolt-field-text").length) {
  1909.                     var e = a(this).closest(".block-group"),
  1910.                         t = e.find(".bolt-field-text input:first"),
  1911.                         i = e.find(".block-heading"),
  1912.                         n = i.data("default");
  1913.                     i.text(a(t).val().substring(0, 60) || n)
  1914.                 }
  1915.             })
  1916.         },
  1917.         _append: function(e) {
  1918.             var i, n = a(e.target).data("block-type");
  1919.             a.each(this._templates, function(e, t) {
  1920.                 a(t).data("block-type") === n && (i = a(t).html())
  1921.             });
  1922.             var t = this._clone(i);
  1923.             t.data("block-type", n), this._ui.slot.append(t), this._renumber(), o.datetime.init(), o.ckeditor.init(), init.popOvers()
  1924.         },
  1925.         _clone: function(e) {
  1926.             var i = a(e).clone();
  1927.             return i.find("[id]").each(function() {
  1928.                 var e = a(this).attr("id"),
  1929.                     t = o.app.buid();
  1930.                 a(this).attr("id", t), i.find('[for="' + e + '"]').each(function() {
  1931.                     a(this).attr("for", t)
  1932.                 })
  1933.             }), o.app.initWidgets(i), i
  1934.         },
  1935.         _renumber: function() {
  1936.             var i = new RegExp("^([^\\[]+\\[)([#|\\d]+)(\\].*)$", "gi");
  1937.             this._ui.slot.find("div.block-group").each(function(e, t) {
  1938.                 a(t).find("[name]").each(function() {
  1939.                     this.name = this.name.replace(i, "$1" + e + "$3")
  1940.                 }), a(t).is(":first-of-type") ? a(t).find(".move-up").addClass("disabled") : a(t).find(".move-up").removeClass("disabled"), a(t).is(":last-of-type") ? a(t).find(".move-down").addClass("disabled") : a(t).find(".move-down").removeClass("disabled")
  1941.             })
  1942.         },
  1943.         _resetEditors: function(e) {
  1944.             e.find(".ckeditor").each(function(e, t) {
  1945.                 i.instances[t.id] && i.instances[t.id].destroy(), i.replace(t.id)
  1946.             })
  1947.         }
  1948.     })
  1949. }(jQuery, Bolt, "undefined" != typeof CKEDITOR ? CKEDITOR : void 0),
  1950. function(e, t) {
  1951.     "use strict";
  1952.     e.widget("bolt.fieldCategories", e.bolt.baseField, {
  1953.         _create: function() {
  1954.             this.element.find("select").select2({
  1955.                 width: "100%",
  1956.                 allowClear: !0,
  1957.                 placeholder: {
  1958.                     id: "",
  1959.                     text: t.data("field.categories.text.placeholder")
  1960.                 }
  1961.             })
  1962.         }
  1963.     })
  1964. }(jQuery, Bolt),
  1965. function(a, o) {
  1966.     "use strict";
  1967.     a.widget("bolt.fieldEmbed", a.bolt.baseField, {
  1968.         _create: function() {
  1969.             var e = this,
  1970.                 t = this.element,
  1971.                 i = 0;
  1972.             this._ui = {
  1973.                 url: t.find("input.url"),
  1974.                 width: t.find("input.width"),
  1975.                 height: t.find("input.height"),
  1976.                 html: t.find("input.html"),
  1977.                 ratio: t.find("input.ratio"),
  1978.                 authorName: t.find("input.author_name"),
  1979.                 authorUrl: t.find("input.author_url"),
  1980.                 provider_name: t.find("input.provider_name"),
  1981.                 thumbnailUrl: t.find("input.thumbnail_url"),
  1982.                 preview: t.find("img"),
  1983.                 play: t.find("button.preview"),
  1984.                 refresh: t.find("button.refresh"),
  1985.                 spinner: t.find("button.refresh i")
  1986.             }, e._ui.url.on("propertychange input", function() {
  1987.                 clearTimeout(i), i = setTimeout(function() {
  1988.                     e._update()
  1989.                 }, 1e3)
  1990.             }), e._ui.width.on("propertychange input", function() {
  1991.                 0 < e._ui.ratio.val() && e._ui.height.val(Math.round(e._ui.width.val() / e._ui.ratio.val()))
  1992.             }), e._ui.height.on("propertychange input", function() {
  1993.                 0 < e._ui.ratio.val() && e._ui.width.val(Math.round(e._ui.height.val() * e._ui.ratio.val()))
  1994.             }), e._ui.refresh.on("click", function() {
  1995.                 e._update()
  1996.             }), e._ui.play.on("click", function() {
  1997.                 a("body").buicModal({
  1998.                     size: "large",
  1999.                     closer: !0,
  2000.                     headline: e._ui.provider_name.val(),
  2001.                     body: e._ui.html.val()
  2002.                 })
  2003.             })
  2004.         },
  2005.         _update: function() {
  2006.             var t = this,
  2007.                 e = o.data("endpoint.embed"),
  2008.                 i = a("#id").closest("form").find('input[name="content_edit[_token]"]').val(),
  2009.                 n = {
  2010.                     format: "json",
  2011.                     url: t._ui.url.val(),
  2012.                     _token: i,
  2013.                     provider: "oembed"
  2014.                 };
  2015.             n.url.length < 2 ? t._set({}) : (this._ui.refresh.prop("disabled", !0), t._ui.spinner.addClass("fa-spin"), a.post(e, n).done(function(e) {
  2016.                 t._set(e)
  2017.             }).fail(function() {
  2018.                 t._set({})
  2019.             }).always(function() {
  2020.                 t._ui.spinner.removeClass("fa-spin")
  2021.             }))
  2022.         },
  2023.         _set: function(e) {
  2024.             this._ui.html.val(e.html || ""), this._ui.width.val(e.width || ""), this._ui.height.val(e.height || ""), this._ui.authorName.val(e.author_name || ""), this._ui.authorUrl.val(e.author_url || ""), this._ui.provider_name.val(e.provider_name || ""), this._ui.thumbnailUrl.val(e.thumbnail_url || this._ui.preview.data("defaultUrl")), this._ui.refresh.prop("disabled", this._ui.url.val().length <= 2 || 0 < this._ui.html.val().length)
  2025.         }
  2026.     })
  2027. }(jQuery, Bolt),
  2028. function(n, i) {
  2029.     "use strict";
  2030.     n.widget("bolt.fieldFile", n.bolt.baseField, {
  2031.         _create: function() {
  2032.             var i = this,
  2033.                 e = this.element,
  2034.                 t = n("input.path", e);
  2035.             t.data("selected", {
  2036.                 path: t.val()
  2037.             }), t.autocomplete({
  2038.                 source: e.find("[data-autocomplete-url]").data("autocompleteUrl"),
  2039.                 minLength: 2,
  2040.                 focus: function(e, t) {
  2041.                     return i._onPreview(e, t.item), !1
  2042.                 },
  2043.                 select: function(e, t) {
  2044.                     return i._onSelect(e, t.item), !1
  2045.                 },
  2046.                 close: function() {
  2047.                     i._onClose()
  2048.                 }
  2049.             }).autocomplete("instance")._renderItem = function(e, t) {
  2050.                 return n("<li>").append(t.path).appendTo(e)
  2051.             }, t.on("change", function() {
  2052.                 n(this).data("changeWithoutSelection", !0)
  2053.             }), t.on("blur", function() {
  2054.                 n(this).data("changeWithoutSelection") && ("" === n(this).val() ? i._onClear() : i._onClose())
  2055.             }), i._on({
  2056.                 "click.select-from-stack a": i._onSelectFromStack,
  2057.                 buicbrowserselected: i._onSelect,
  2058.                 buicuploaduploaded: i._onSelect
  2059.             }), e.buicUpload()
  2060.         },
  2061.         _onPreview: function(e, t) {
  2062.             n("input.path", this.element).val(t.path)
  2063.         },
  2064.         _onSelectFromStack: function(e) {
  2065.             var t = n(e.target),
  2066.                 i = t.parent("[data-file]");
  2067.             t.closest(".btn-group").removeClass("open"), this._onSelect(e, i.data("file")), e.preventDefault()
  2068.         },
  2069.         _onSelect: function(e, t) {
  2070.             n("input.path", this.element).data("changeWithoutSelection", !1).data("selected", t).val(t.path).trigger("change"), "click" !== e.type && i.stack.addToStack(t.path)
  2071.         },
  2072.         _onClose: function() {
  2073.             var e = n("input.path", this.element);
  2074.             e.val(e.data("selected").path)
  2075.         },
  2076.         _onClear: function() {
  2077.             var e = n("input.path", this.element);
  2078.             e.val(""), e.data("selected", {})
  2079.         }
  2080.     })
  2081. }(jQuery, Bolt),
  2082. function(d, o) {
  2083.     "use strict";
  2084.     d.widget("bolt.fieldFilelist", d.bolt.baseField, {
  2085.         _create: function() {
  2086.             var e = this,
  2087.                 r = this.element;
  2088.             this._ui = {
  2089.                 data: r.find("textarea"),
  2090.                 list: r.find(".list")
  2091.             }, this._lastClickIndex = 0, e.options.isImage = this.options.isImage || !1, e._ui.list.sortable({
  2092.                 helper: function(e, t) {
  2093.                     return t.addClass("selected"), d("<div/>")
  2094.                 },
  2095.                 start: function(e, t) {
  2096.                     var i = d(".selected", r).not(".ui-sortable-placeholder"),
  2097.                         n = i.length,
  2098.                         a = t.placeholder,
  2099.                         o = a.outerHeight(!0),
  2100.                         s = a.height(),
  2101.                         l = parseInt(a.css("margin-top")) + parseInt(a.css("margin-bottom"));
  2102.                     i.hide(), a.height(s + (n - 1) * o - l), t.item.data("items", i)
  2103.                 },
  2104.                 beforeStop: function(e, t) {
  2105.                     t.item.before(t.item.data("items"))
  2106.                 },
  2107.                 stop: function() {
  2108.                     d(".selected", r).show(), e._serialize()
  2109.                 },
  2110.                 axis: "y",
  2111.                 delay: 100,
  2112.                 distance: 5
  2113.             }), e._on(e._ui.list, {
  2114.                 "click.item": e._onSelect,
  2115.                 "click.remove": e._onRemove,
  2116.                 "change input": e._serialize
  2117.             }), d("input.title", e._ui.list).on("keyup", e._updateTitle), e._on({
  2118.                 "click.select-from-stack a": e._onSelectFromStack,
  2119.                 buicbrowserselected: e._onAddPath,
  2120.                 buicuploaduploaded: e._onAddPath
  2121.             }), r.buicUpload()
  2122.         },
  2123.         _onAddPath: function(e, t) {
  2124.             d(">p", this._ui.list).remove(), this._ui.list.append(d(Bolt.data(this.options.isImage ? "field.imagelist.template.item" : "field.filelist.template.item", {
  2125.                 "%TITLE_A%": t.path.replace(/\.[a-z0-9]+$/, ""),
  2126.                 "%FILEPATH_E%": d("<div>").text(t.path).html(),
  2127.                 "%FILEPATH_A%": t.path,
  2128.                 "%EXT_E%": t.extension.toUpperCase(),
  2129.                 "%PREVIEW_A%": t.previewListUrl,
  2130.                 "%URL_A%": t.url
  2131.             }))), this._serialize()
  2132.         },
  2133.         _onRemove: function(e) {
  2134.             var t = d(e.target).closest(".item"),
  2135.                 i = t.hasClass("selected") ? d(".selected", this._ui.list) : t,
  2136.                 n = this.options.isImage ? "field.imagelist.message.remove" : "field.filelist.message.remove",
  2137.                 a = this.options.isImage ? "field.imagelist.message.removeMulti" : "field.filelist.message.removeMulti";
  2138.             i.addClass("zombie"), confirm(o.data(1 < i.length ? a : n)) ? (d(e.target).closest(".item").remove(), this._serialize()) : i.removeClass("zombie"), e.preventDefault(), e.stopPropagation()
  2139.         },
  2140.         _onSelect: function(e) {
  2141.             var t = d(e.target);
  2142.             if (t.hasClass("item"))
  2143.                 if (e.shiftKey) {
  2144.                     var i = Math.min(this._lastClickIndex, t.index()),
  2145.                         n = Math.max(this._lastClickIndex, t.index());
  2146.                     this._ui.list.children().each(function(e, t) {
  2147.                         d(t).toggleClass("selected", i <= e && e <= n)
  2148.                     })
  2149.                 } else if (e.ctrlKey || e.metaKey) t.toggleClass("selected"), this._lastClickIndex = t.index();
  2150.             else {
  2151.                 var a = this._ui.list.children(".selected").not(t);
  2152.                 a.removeClass("selected"), t.toggleClass("selected", 0 < a.length || null), this._lastClickIndex = t.index()
  2153.             }
  2154.         },
  2155.         _onSelectFromStack: function(e) {
  2156.             var t = d(e.target),
  2157.                 i = t.closest("[data-file]");
  2158.             t.closest(".btn-group").removeClass("open"), this._onAddPath(e, i.data("file")), e.preventDefault()
  2159.         },
  2160.         _serialize: function() {
  2161.             var e = this.options.isImage ? "field.imagelist.template.empty" : "field.filelist.template.empty",
  2162.                 t = [];
  2163.             d(".item", this._ui.list).each(function() {
  2164.                 t.push({
  2165.                     filename: d("input.filename", this).val(),
  2166.                     title: d("input.title", this).val()
  2167.                 })
  2168.             }), this._ui.data.val(JSON.stringify(t)), 0 === t.length && this._ui.list.html(o.data(e))
  2169.         },
  2170.         _updateTitle: function(e) {
  2171.             var t = d(e.target).closest(".item");
  2172.             d("a", t).attr("title", d(".title", t).val())
  2173.         }
  2174.     })
  2175. }(jQuery, Bolt),
  2176. function(a, o) {
  2177.     "use strict";
  2178.     a.widget("bolt.fieldGeolocation", a.bolt.baseField, {
  2179.         options: {
  2180.             latitude: "",
  2181.             longitude: ""
  2182.         },
  2183.         _create: function() {
  2184.             var e = this,
  2185.                 t = e.element;
  2186.             this._ui = {
  2187.                 address: t.find(".address"),
  2188.                 matched: t.find(".matched"),
  2189.                 mapholder: t.find(".mapholder"),
  2190.                 spinner: t.find(".mapholder i"),
  2191.                 latitude: t.find(".latitude"),
  2192.                 longitude: t.find(".longitude"),
  2193.                 snap: t.find(".snap")
  2194.             }, this._map = null, this._marker = null, this._timeout = 0, e._on({
  2195.                 "click.expand": e._onExpand,
  2196.                 "click.compress": e._onExpand
  2197.             });
  2198.             var i = function() {
  2199.                 o.events.off("Bolt.GoogleMapsAPI.Load.Done", i), e._initGoogleMap(e.options.latitude, e.options.longitude)
  2200.             };
  2201.             o.events.on("Bolt.GoogleMapsAPI.Load.Done", i), o.events.on("Bolt.GoogleMapsAPI.Load.Fail", function() {
  2202.                 e._ui.spinner.removeClass("fa-spinner fa-spin").addClass("fa-refresh").one("click", function() {
  2203.                     e._ui.spinner.removeClass("fa-refresh").addClass("fa-spinner fa-spin"), o.events.fire("Bolt.GoogleMapsAPI.Load.Request")
  2204.                 })
  2205.             }), o.events.fire("Bolt.GoogleMapsAPI.Load.Request")
  2206.         },
  2207.         _geoCode: function(n) {
  2208.             var a = this;
  2209.             n && (new google.maps.Geocoder).geocode(n, function(e, t) {
  2210.                 var i;
  2211.                 t === google.maps.GeocoderStatus.OK && (i = n.latLng && !a._ui.snap.is(":checked") ? n.latLng : e[0].geometry.location, a._display(e[0].formatted_address, i.lat(), i.lng()), a._marker.setPosition(i), a._map.setCenter(i))
  2212.             }), a._display()
  2213.         },
  2214.         _display: function(e, t, i) {
  2215.             this._ui.matched.val(e || ""), this._ui.latitude.val(t || ""), this._ui.longitude.val(i || "")
  2216.         },
  2217.         _initGoogleMap: function(e, t) {
  2218.             var i = this,
  2219.                 n = {
  2220.                     zoom: 15,
  2221.                     mapTypeId: google.maps.MapTypeId.ROADMAP,
  2222.                     center: new google.maps.LatLng(e, t),
  2223.                     streetViewControl: !1
  2224.                 };
  2225.             i._map = new google.maps.Map(i._ui.mapholder[0], n), i._marker = new google.maps.Marker({
  2226.                 map: i._map,
  2227.                 position: n.center,
  2228.                 title: o.data("field.geolocation.marker"),
  2229.                 draggable: !0,
  2230.                 animation: google.maps.Animation.DROP,
  2231.                 icon: i.element.data("pin-icon")
  2232.             }), google.maps.event.addListener(i._marker, "mouseup", function() {
  2233.                 i._geoCode({
  2234.                     latLng: i._marker.getPosition()
  2235.                 })
  2236.             }), i._ui.address.on("propertychange input", function() {
  2237.                 clearTimeout(i._timeout), i._timeout = setTimeout(function() {
  2238.                     var e = i._ui.address.val();
  2239.                     i._geoCode(2 < e.length ? {
  2240.                         address: e
  2241.                     } : void 0)
  2242.                 }, 800)
  2243.             }), a('a[data-toggle="tab"]').on("shown.bs.tab", function() {
  2244.                 i._ui.mapholder.closest("div.tab-pane").hasClass("active") && google.maps.event.trigger(i._map, "resize")
  2245.             })
  2246.         },
  2247.         _onExpand: function() {
  2248.             var e = this._marker.getPosition();
  2249.             this._ui.mapholder.parent().toggleClass("expanded"), google.maps.event.trigger(this._map, "resize"), this._map.setCenter(e)
  2250.         }
  2251.     })
  2252. }(jQuery, Bolt),
  2253. function(e, t) {
  2254.     "use strict";
  2255.     e.widget("bolt.fieldHtml", e.bolt.baseField, {
  2256.         _create: function() {
  2257.             t.ckeditor.add(this.element.find(".ckeditor")[0])
  2258.         }
  2259.     })
  2260. }(jQuery, Bolt),
  2261. function(t) {
  2262.     "use strict";
  2263.     t.widget("bolt.fieldImage", t.bolt.fieldFile, {
  2264.         _create: function() {
  2265.             this._super(), t("input.path", this.element).data("selected").previewUrl = this.element.find("img").attr("src")
  2266.         },
  2267.         _onPreview: function(e, t) {
  2268.             this._super(e, t), this.element.find("img").attr("src", t.previewUrl)
  2269.         },
  2270.         _onSelect: function(e, t) {
  2271.             this._super(e, t), this.element.find("img").attr("src", t.previewUrl)
  2272.         },
  2273.         _onClose: function() {
  2274.             this._super();
  2275.             var e = t("input.path", this.element);
  2276.             this.element.find("img").attr("src", e.data("selected").previewUrl)
  2277.         },
  2278.         _onClear: function() {
  2279.             this._super();
  2280.             var e = this.element.find("img");
  2281.             e.attr("src", e.data("defaultUrl"))
  2282.         }
  2283.     })
  2284. }(jQuery),
  2285. function(e) {
  2286.     "use strict";
  2287.     e.widget("bolt.fieldImagelist", e.bolt.fieldFilelist, {
  2288.         _create: function() {
  2289.             this.options.isImage = !0, this._super()
  2290.         }
  2291.     })
  2292. }(jQuery),
  2293. function(e, t) {
  2294.     "use strict";
  2295.     e.widget("bolt.fieldMarkdown", e.bolt.baseField, {
  2296.         _create: function() {
  2297.             t.$("textarea[data-uk-htmleditor]", this.element).each(function() {
  2298.                 var e = t.$(this);
  2299.                 e.data("htmleditor") || t.htmleditor(e, t.Utils.options(e.attr("data-uk-htmleditor")))
  2300.             })
  2301.         }
  2302.     })
  2303. }(jQuery, "undefined" != typeof UIkit ? UIkit : void 0),
  2304. function(e) {
  2305.     "use strict";
  2306.     e.widget("bolt.fieldMeta", e.bolt.baseField, {
  2307.         _create: function() {
  2308.             var e = this.element.find("#statusselect"),
  2309.                 t = this.element.find("#ownerid");
  2310.             e.select2({
  2311.                 width: "50%",
  2312.                 minimumResultsForSearch: 1 / 0
  2313.             }), t.select2({
  2314.                 width: "50%",
  2315.                 minimumResultsForSearch: 1 / 0
  2316.             })
  2317.         }
  2318.     })
  2319. }(jQuery),
  2320. function(i, e) {
  2321.     "use strict";
  2322.     i.widget("bolt.fieldRelationship", i.bolt.baseField, {
  2323.         _create: function() {
  2324.             this.element.find("select").select2({
  2325.                 width: "100%",
  2326.                 placeholder: {
  2327.                     id: "",
  2328.                     text: e.data("field.relationship.text.placeholder")
  2329.                 },
  2330.                 allowClear: !0,
  2331.                 templateSelection: function(e) {
  2332.                     var t = i(e.element).parent().attr("label");
  2333.                     return (t ? t + ": " : "") + e.text
  2334.                 }
  2335.             })
  2336.         }
  2337.     })
  2338. }(jQuery, Bolt),
  2339. function(o, n, i) {
  2340.     "use strict";
  2341.     o.widget("bolt.fieldRepeater", o.bolt.baseField, {
  2342.         options: {
  2343.             minimum: 1,
  2344.             maximum: 1,
  2345.             name: ""
  2346.         },
  2347.         _create: function() {
  2348.             var i = this;
  2349.             for (this._ui = {
  2350.                     add: i.element.find(".add-button"),
  2351.                     slot: i.element.find(".repeater-slot")
  2352.                 }, this._template = o(i.element.find('script[type="text/template"]').html()), this._count = i._ui.slot.find("div.repeater-group").length, 0 === i.options.maximum && (i.options.maximum = 1 / 0), i._setCount(), i._ui.add.on("click", function() {
  2353.                     i._append()
  2354.                 }), i.element.on("click", ".duplicate-button", function() {
  2355.                     var e = o(this).closest(".repeater-group"),
  2356.                         a = i._clone(i._template);
  2357.                     o(e).find(":input").each(function(e) {
  2358.                         var t = o(this),
  2359.                             i = t.attr("id"),
  2360.                             n = t.val();
  2361.                         t.hasClass("ckeditor") && void 0 !== CKEDITOR.instances[i] ? o(a).find(":input").eq(e).val(CKEDITOR.instances[i].getData()) : n && o(a).find(":input").eq(e).val(n)
  2362.                     }), e.after(a), i._setCount(1), i._renumber()
  2363.                 }), i.element.find(".repeater-slot").sortable({
  2364.                     cursor: "move",
  2365.                     handle: ".panel-heading",
  2366.                     stop: function(e, t) {
  2367.                         i._renumber(), i._resetEditors(t.item)
  2368.                     }
  2369.                 }), i.element.on("click", ".delete-button", function() {
  2370.                     var t = o(this).closest(".repeater-group");
  2371.                     bootbox.confirm(n.data("editcontent.deleteset"), function(e) {
  2372.                         o(".alert").alert(), !0 === e && (t.remove(), i._setCount(-1), i._renumber())
  2373.                     })
  2374.                 }), i.element.on("click", ".move-up", function() {
  2375.                     var e = o(this).closest(".repeater-group");
  2376.                     e.insertBefore(e.prev(".repeater-group")), i._renumber(), i._resetEditors(e)
  2377.                 }), i.element.on("click", ".move-down", function() {
  2378.                     var e = o(this).closest(".repeater-group");
  2379.                     e.insertAfter(e.next(".repeater-group")), i._renumber(), i._resetEditors(e)
  2380.                 }), i.element.on("click", ".repeater-collapse", function() {
  2381.                     var e = o(this).closest(".repeater-group").find(".panel-body");
  2382.                     o(this).toggleClass("collapsed"), e.slideToggle()
  2383.                 }), i.element.on("click", ".hide-all-blocks", function() {
  2384.                     var e = o(this).closest(".bolt-field-repeater"),
  2385.                         t = e.find(".panel-body");
  2386.                     e.find(".repeater-collapse").addClass("collapsed"), t.slideUp()
  2387.                 }), i.element.on("click", ".show-all-blocks", function() {
  2388.                     var e = o(this).closest(".bolt-field-repeater"),
  2389.                         t = e.find(".panel-body");
  2390.                     e.find(".repeater-collapse").removeClass("collapsed"), t.slideDown()
  2391.                 }), i.element.on("keyup change", "input[type=text]", function() {
  2392.                     if (o(this).closest(".bolt-field-text").length) {
  2393.                         var e = o(this).closest(".repeater-group"),
  2394.                             t = e.find(".bolt-field-text input:first"),
  2395.                             i = e.find(".repeater-heading"),
  2396.                             n = i.data("default");
  2397.                         i.text(o(t).val().substring(0, 60) || n)
  2398.                     }
  2399.                 }); i._count < i.options.minimum;) i._append()
  2400.         },
  2401.         _append: function() {
  2402.             var e = this._clone(this._template);
  2403.             this._ui.slot.append(e), this._setCount(1), this._renumber(), n.datetime.init(), n.ckeditor.init(), init.popOvers()
  2404.         },
  2405.         _clone: function(e) {
  2406.             var i = o(e).clone();
  2407.             return i.find("[id]").each(function() {
  2408.                 var e = o(this).attr("id"),
  2409.                     t = n.app.buid();
  2410.                 o(this).attr("id", t), i.find('[for="' + e + '"]').each(function() {
  2411.                     o(this).attr("for", t)
  2412.                 })
  2413.             }), n.app.initWidgets(i), i
  2414.         },
  2415.         _renumber: function() {
  2416.             var i = this.options.name,
  2417.                 e = i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
  2418.                 n = new RegExp("^" + e + "\\[(#|\\d+)\\]");
  2419.             this._ui.slot.find("div.repeater-group").each(function(e, t) {
  2420.                 o(t).find("[name]").each(function() {
  2421.                     this.name = this.name.replace(n, i + "[" + e + "]")
  2422.                 }), o(t).is(":first-of-type") ? o(t).find(".move-up").addClass("disabled") : o(t).find(".move-up").removeClass("disabled"), o(t).is(":last-of-type") ? o(t).find(".move-down").addClass("disabled") : o(t).find(".move-down").removeClass("disabled")
  2423.             })
  2424.         },
  2425.         _resetEditors: function(e) {
  2426.             e.find(".ckeditor").each(function(e, t) {
  2427.                 i.instances[t.id] && i.instances[t.id].destroy(), i.replace(t.id)
  2428.             })
  2429.         },
  2430.         _setCount: function(e) {
  2431.             this._count += e || 0, this._count >= this.options.maximum ? (this._ui.add.addClass("disabled"), this._ui.add.prop("disabled", "disabled"), this.element.find(".duplicate-button").addClass("disabled"), this.element.find(".duplicate-button").prop("disabled", "disabled")) : (this._ui.add.removeClass("disabled"), this._ui.add.prop("disabled", !1), this.element.find(".duplicate-button").removeClass("disabled"), this.element.find(".duplicate-button").prop("disabled", !1)), this._count <= this.options.minimum ? (this.element.find(".delete-button").addClass("disabled"), this.element.find(".delete-button").prop("disabled", "disabled")) : (this.element.find(".delete-button").removeClass("disabled"), this.element.find(".delete-button").prop("disabled", !1))
  2432.         }
  2433.     })
  2434. }(jQuery, Bolt, "undefined" != typeof CKEDITOR ? CKEDITOR : void 0),
  2435. function(e, i) {
  2436.     "use strict";
  2437.     e.widget("bolt.fieldSelect", e.bolt.baseField, {
  2438.         options: {
  2439.             autocomplete: !1
  2440.         },
  2441.         _create: function() {
  2442.             var e = this.element.find("select"),
  2443.                 t = {
  2444.                     width: "100%",
  2445.                     placeholder: {
  2446.                         id: "",
  2447.                         text: i.data("field.select.text.placeholder")
  2448.                     },
  2449.                     allowClear: !0,
  2450.                     minimumResultsForSearch: this.options.autocomplete ? 0 : 1 / 0
  2451.                 };
  2452.             this.options.sortable ? e.select2Sortable(t) : e.select2(t)
  2453.         }
  2454.     })
  2455. }(jQuery, Bolt),
  2456. function(a) {
  2457.     "use strict";
  2458.     var o = 1,
  2459.         s = 2,
  2460.         l = 3;
  2461.     a.widget("bolt.fieldSlug", a.bolt.baseField, {
  2462.         options: {
  2463.             contentId: null,
  2464.             key: "",
  2465.             slug: "",
  2466.             uses: []
  2467.         },
  2468.         _create: function() {
  2469.             var e = this,
  2470.                 t = this.element;
  2471.             this._ui = {
  2472.                 form: this.element.closest("form"),
  2473.                 group: t.find(".input-group"),
  2474.                 data: t.find("input"),
  2475.                 uses: a()
  2476.             }, a("[name]", e._ui.form).each(function() {
  2477.                 0 <= e.options.uses.indexOf(this.name.replace(/\[\]$/, "")) && (e._ui.uses = e._ui.uses.add(a(this)))
  2478.             }), this._timeout = 0, this._mode = o, this._ui.group.hasClass("linked") ? this._setMode(s) : this._ui.group.hasClass("editable") && (this._mode = l), this._on({
  2479.                 "click li.lock": function(e) {
  2480.                     e.preventDefault(), this._setMode(o)
  2481.                 },
  2482.                 "click li.link": function(e) {
  2483.                     e.preventDefault(), this._setMode(s)
  2484.                 },
  2485.                 "click li.edit": function(e) {
  2486.                     e.preventDefault(), this._setMode(l), this.element.find("input").focus()
  2487.                 },
  2488.                 "focusout input": function() {
  2489.                     this._mode === l && this._setMode(o)
  2490.                 }
  2491.             })
  2492.         },
  2493.         _destroy: function() {
  2494.             clearTimeout(this._timeout)
  2495.         },
  2496.         _setMode: function(e) {
  2497.             var t = e === o,
  2498.                 i = e === s,
  2499.                 n = e === l;
  2500.             a("li.lock", this.element).toggleClass("disabled", t), a("li.link", this.element).toggleClass("disabled", i), a("li.edit", this.element).toggleClass("disabled", n), this._ui.group.toggleClass("locked", t).toggleClass("linked", i).toggleClass("edititable", n), a(".warning", this.element).toggleClass("hidden", !n), this._ui.data.prop("readonly", !n), i ? (this._buildSlug(), this._on(this._ui.uses, {
  2501.                 change: function() {
  2502.                     this._buildSlug()
  2503.                 },
  2504.                 input: function() {
  2505.                     this._buildSlug()
  2506.                 }
  2507.             })) : 0 < this._timeout && (clearTimeout(this._timeout), this._timeout = 0, this._off(this._ui.uses, "change"), this._off(this._ui.uses, "input")), this._mode = e
  2508.         },
  2509.         _buildSlug: function() {
  2510.             var i, e = this,
  2511.                 n = "";
  2512.             a.each(e.options.uses, function(e, t) {
  2513.                 (i = a("#" + t).val()) && (n += ("object" == typeof i ? i.join(" ") : i) + " ")
  2514.             }), clearTimeout(e._timeout), e._timeout = setTimeout(function() {
  2515.                 e._getUri(n.trim())
  2516.             }, 200)
  2517.         },
  2518.         _getUri: function(e) {
  2519.             var t = this,
  2520.                 i = {
  2521.                     title: e,
  2522.                     contenttypeslug: t.options.slug,
  2523.                     id: t.options.contentId,
  2524.                     slugfield: t.options.key,
  2525.                     fulluri: !1
  2526.                 };
  2527.             t._ui.group.addClass("loading"), a.get(t._ui.data.data("createSlugUrl"), i).done(function(e) {
  2528.                 t._mode === s && t._ui.data.val(e)
  2529.             }).fail(function() {
  2530.                 console.error("Failed to get URI for " + t.options.slug + "/" + t.options.contentId)
  2531.             }).always(function() {
  2532.                 t._ui.group.removeClass("loading")
  2533.             })
  2534.         }
  2535.     })
  2536. }(jQuery),
  2537. function(s) {
  2538.     "use strict";
  2539.     s.widget("bolt.fieldTags", s.bolt.baseField, {
  2540.         options: {
  2541.             allowSpaces: !1
  2542.         },
  2543.         _create: function() {
  2544.             var o = this.element.find("select"),
  2545.                 i = this.element.find(".tagcloud"),
  2546.                 e = [","];
  2547.             this.options.allowSpaces || e.push(" "), o.select2({
  2548.                 width: "100%",
  2549.                 tags: {},
  2550.                 minimumInputLength: 1,
  2551.                 tokenSeparators: e
  2552.             }), s.ajax({
  2553.                 url: this.element.data("tagsUrl"),
  2554.                 dataType: "json",
  2555.                 success: function(e) {
  2556.                     for (var t = o.val() || [], i = e.length, n = "", a = 0; a < i; a++) t.indexOf(e[a].name) < 0 && (t.push(e[a].name), n += '<option value="' + e[a].name + '">' + e[a].name + "</option>");
  2557.                     o.append(s(n)).trigger("change")
  2558.                 }
  2559.             }), i && s.ajax({
  2560.                 url: this.element.data("popularTagsUrl"),
  2561.                 dataType: "json",
  2562.                 data: {
  2563.                     limit: 40
  2564.                 },
  2565.                 success: function(e) {
  2566.                     0 < e.length && (s.each(e, function(e, t) {
  2567.                         i.append(s("<button/>", {
  2568.                             type: "button",
  2569.                             text: t.name,
  2570.                             rel: t.count
  2571.                         })).append("")
  2572.                     }), i.find("button").on("click", function() {
  2573.                         var e = s(this).text(),
  2574.                             t = o.find('option[value="' + e + '"]');
  2575.                         0 < t.length ? t = t.not(":selected").attr("selected", !0).trigger("change") : o.append(s("<option/>", {
  2576.                             value: e,
  2577.                             text: e,
  2578.                             selected: !0
  2579.                         })).trigger("change")
  2580.                     }), s.fn.tagcloud.defaults = {
  2581.                         size: {
  2582.                             start: 10,
  2583.                             end: 20,
  2584.                             unit: "px"
  2585.                         },
  2586.                         color: {
  2587.                             start: "#888",
  2588.                             end: "#194770"
  2589.                         }
  2590.                     }, i.find("button").tagcloud(), i.css("display", "block"))
  2591.                 }
  2592.             })
  2593.         }
  2594.     })
  2595. }(jQuery),
  2596. function(o, s) {
  2597.     "use strict";
  2598.     o.widget("bolt.fieldTemplateselect", o.bolt.baseField, {
  2599.         options: {
  2600.             currentHas: !1,
  2601.             current: "",
  2602.             fieldTemplates: []
  2603.         },
  2604.         _create: function() {
  2605.             var t = this,
  2606.                 i = t.element.find("select"),
  2607.                 n = t.element.find("p"),
  2608.                 a = n.parent();
  2609.             i.select2({
  2610.                 width: "100%",
  2611.                 allowClear: !0,
  2612.                 placeholder: {
  2613.                     id: "",
  2614.                     text: s.data("field.templateselect.text.default")
  2615.                 },
  2616.                 minimumResultsForSearch: 1 / 0
  2617.             }), i.on("change", function() {
  2618.                 if (a.addClass("hidden"), n.html("").removeClass("text-danger"), i.val() !== t.options.current)
  2619.                     if (t.options.currentHas) {
  2620.                         n.html(s.data("field.templateselect.template.warning", {
  2621.                             "%STATUS%": s.data("field.templateselect.message.status"),
  2622.                             "%MESSAGE%": s.data("field.templateselect.message.warning")
  2623.                         }));
  2624.                         var e = !0;
  2625.                         o('[name^="templatefields"]').each(function() {
  2626.                             "checkbox" !== o(this).attr("type") && "SELECT" !== o(this).prop("tagName") && "" !== o(this).val() && (e = !1), "checkbox" === o(this).attr("type") && o(this).prop("checked") && (e = !1)
  2627.                         }), e ? o("#tabindicator-tab-template").hide() : (n.addClass("text-danger"), a.removeClass("hidden"))
  2628.                     } else -1 < t.options.fieldTemplates.indexOf(i.val()) && (n.html(s.data("field.templateselect.message.change")), a.removeClass("hidden"), o("#tabindicator-tab-template").show())
  2629.             })
  2630.         }
  2631.     })
  2632. }(jQuery, Bolt),
  2633. function(e) {
  2634.     "use strict";
  2635.     e.widget("bolt.fieldText", e.bolt.baseField, {
  2636.         _create: function() {}
  2637.     })
  2638. }(jQuery),
  2639. function(e) {
  2640.     "use strict";
  2641.     e.widget("bolt.fieldTextarea", e.bolt.baseField, {
  2642.         _create: function() {}
  2643.     })
  2644. }(jQuery),
  2645. function(a, o) {
  2646.     "use strict";
  2647.     a.widget("bolt.fieldVideo", a.bolt.baseField, {
  2648.         _create: function() {
  2649.             var e = this,
  2650.                 t = this.element,
  2651.                 i = 0;
  2652.             this._ui = {
  2653.                 url: t.find("input.url"),
  2654.                 width: t.find("input.width"),
  2655.                 height: t.find("input.height"),
  2656.                 html: t.find("input.html"),
  2657.                 ratio: t.find("input.ratio"),
  2658.                 authorName: t.find("input.authorname"),
  2659.                 authorUrl: t.find("input.authorurl"),
  2660.                 title: t.find("input.title"),
  2661.                 thumbnailUrl: t.find("input.thumbnailurl"),
  2662.                 preview: t.find("img"),
  2663.                 play: t.find(".imageholder button"),
  2664.                 refresh: t.find("button.refresh"),
  2665.                 spinner: t.find("button.refresh i")
  2666.             }, e._ui.url.on("propertychange input", function() {
  2667.                 clearTimeout(i), i = setTimeout(function() {
  2668.                     e._update()
  2669.                 }, 1e3)
  2670.             }), e._ui.width.on("propertychange input", function() {
  2671.                 0 < e._ui.ratio.val() && e._ui.height.val(Math.round(e._ui.width.val() / e._ui.ratio.val()))
  2672.             }), e._ui.height.on("propertychange input", function() {
  2673.                 0 < e._ui.ratio.val() && e._ui.width.val(Math.round(e._ui.height.val() * e._ui.ratio.val()))
  2674.             }), e._ui.refresh.on("click", function() {
  2675.                 e._update()
  2676.             }), e._ui.play.on("click", function() {
  2677.                 a("body").buicModal({
  2678.                     size: "large",
  2679.                     closer: !0,
  2680.                     headline: e._ui.title.val(),
  2681.                     body: e._ui.html.val()
  2682.                 })
  2683.             })
  2684.         },
  2685.         _update: function() {
  2686.             var t = this,
  2687.                 e = o.data("endpoint.embed"),
  2688.                 i = a("#id").closest("form").find('input[name="content_edit[_token]"]').val(),
  2689.                 n = {
  2690.                     format: "json",
  2691.                     url: t._ui.url.val(),
  2692.                     _token: i,
  2693.                     provider: "oembed"
  2694.                 };
  2695.             n.url.length < 2 ? t._set({}) : (this._ui.refresh.prop("disabled", !0), t._ui.spinner.addClass("fa-spin"), a.post(e, n).done(function(e) {
  2696.                 t._set(e)
  2697.             }).fail(function() {
  2698.                 t._set({})
  2699.             }).always(function() {
  2700.                 t._ui.spinner.removeClass("fa-spin")
  2701.             }))
  2702.         },
  2703.         _set: function(e) {
  2704.             var t = e.thumbnail_url || this._ui.preview.data("defaultUrl");
  2705.             this._ui.html.val(e.html || ""), this._ui.width.val(e.width || ""), this._ui.height.val(e.height || ""), this._ui.ratio.val(e.width && e.height ? e.width / e.height : ""), this._ui.authorName.val(e.author_name || ""), this._ui.authorUrl.val(e.author_url || ""), this._ui.title.val(e.title || ""), this._ui.thumbnailUrl.val(e.thumbnail_url || ""), this._ui.preview.attr("src", t), e.html ? this._ui.play.removeClass("hidden") : this._ui.play.addClass("hidden"), this._ui.refresh.prop("disabled", this._ui.url.val().length <= 2 || 0 < this._ui.html.val().length)
  2706.         }
  2707.     })
  2708. }(jQuery, Bolt),
  2709. function(n, a) {
  2710.     "use strict";
  2711.     n.widget("bolt.panelActivity", n.bolt.baseInterval, {
  2712.         options: {
  2713.             delay: 3e4
  2714.         },
  2715.         _create: function() {
  2716.             this._super()
  2717.         },
  2718.         _update: function() {
  2719.             var i = this;
  2720.             n.get(i.element.data("url")).done(function(e) {
  2721.                 var t = n(e);
  2722.                 a.app.initWidgets(t), i.element.html(t)
  2723.             })
  2724.         }
  2725.     })
  2726. }(jQuery, Bolt), Bolt.validation = function() {
  2727.     "use strict";
  2728.  
  2729.     function E(e) {
  2730.         var t = !0,
  2731.             i = e.value,
  2732.             n = e.getAttribute("type"),
  2733.             a = "checkbox" === n || "radio" === n,
  2734.             o = e.getAttribute("required"),
  2735.             s = e.getAttribute("minlength"),
  2736.             l = e.getAttribute("maxlength"),
  2737.             r = e.getAttribute("pattern");
  2738.         return e.disabled || (t = (t = t && (!o || a && e.checked || !a && "" !== i)) && (a || (!s || i.length >= s) && (!l || i.length <= l))) && r && (t = (r = new RegExp("^(?:" + r + ")$")).test(i)), t
  2739.     }
  2740.  
  2741.     function T(e, t) {
  2742.         void 0 !== e.willValidate ? e.setCustomValidity(t) : e.validity.valid = "" === t
  2743.     }
  2744.  
  2745.     function o(e) {
  2746.         var t, i, n, a, o, s, l, r, d, c = void 0 !== e.willValidate,
  2747.             u = e.value,
  2748.             p = "",
  2749.             f = $(e).data("validate");
  2750.         if (f) {
  2751.             for (i in f)
  2752.                 if (f.hasOwnProperty(i)) {
  2753.                     switch (n = f[i], i) {
  2754.                         case "float":
  2755.                             p = "" === (d = u) || d.match(/^[-+]?[0-9]*[,.]?[0-9]+([eE][-+]?[0-9]+)?$/) ? "" : Bolt.data("validation.float");
  2756.                             break;
  2757.                         case "required":
  2758.                             r = u, p = !0 === n && "" === r ? Bolt.data("validation.required") : "";
  2759.                             break;
  2760.                         case "min":
  2761.                             l = n, p = "" !== (s = u) && Number(s.replace(",", ".")) < l ? Bolt.data("validation.min", {
  2762.                                 "%MINVAL%": l
  2763.                             }) : "";
  2764.                             break;
  2765.                         case "max":
  2766.                             o = n, p = "" !== (a = u) && Number(a.replace(",", ".")) > o ? Bolt.data("validation.max", {
  2767.                                 "%MAXVAL%": o
  2768.                             }) : "";
  2769.                             break;
  2770.                         default:
  2771.                             console.error("UNKNOWN VALIDATION" + i + " -> " + n)
  2772.                     }
  2773.                     if (p) break
  2774.                 }
  2775.             T(e, p)
  2776.         } else if (c ? ("INPUT" === e.nodeName && e.type !== e.getAttribute("type") && e.setCustomValidity(E(e) ? "" : "error"), e.checkValidity()) : (e.validity = e.validity || {}, e.validity.valid = E(e)), t = "TEXTAREA" === e.nodeName && $(e).hasClass("ckeditor")) {
  2777.             var h = CKEDITOR.instances[e.id];
  2778.             h && T(e, !0 === h._.required && "" === h.getData().trim() ? "Required" : "")
  2779.         }
  2780.         var m, g, v, b, _, k, w, y, x, C = "notice--" + e.id;
  2781.         return $("#" + C).remove(), e.validity.valid ? (y = e, x = t, $(y).removeClass("error"), x && $("#cke_" + y.id).removeClass("cke_error"), !0) : (k = e, w = t, $(k).addClass("error"), w && $("#cke_" + k.id).addClass("cke_error"), m = C, g = e, v = p, _ = (_ = $('label[for="' + g.id + '"]').contents().first().text().trim() || g.name).replace(/(.*):+$/g, "$1"), b = Bolt.data("validation.alertbox", {
  2782.             "%NOTICE_ID%": m,
  2783.             "%FIELD_ID%": g.id,
  2784.             "%FIELD_NAME%": _,
  2785.             "%MESSAGE%": v || $(g).data("errortext") || Bolt.data("validation.generic_msg")
  2786.         }), $(b).hide().insertAfter(".page-header").slideDown("fast"), !1)
  2787.     }
  2788.     return {
  2789.         run: function(e) {
  2790.             var t, i, n = e.elements.length,
  2791.                 a = !0;
  2792.             for (t = 0; t < n; t++) "INPUT" !== (i = e.elements[t]).nodeName && "TEXTAREA" !== i.nodeName && "SELECT" !== i.nodeName || ("INPUT" === i.nodeName && (i.value = i.value.trim()), !1 === o(i) && (a = !1));
  2793.             return a
  2794.         }
  2795.     }
  2796. }();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement