"use strict";function_classCallCheck(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionsetInputSelection(e,t,a){if(e.focus(),"undefined"!=typeofe.selectionStart)e.selectionStart=t,e.selectionEnd=a;elseif(document.selection&&document.selection.createRange){e.select();varo=document.selection.createRange();o.collapse(!0),o.moveEnd("character",a),o.moveStart("character",t),o.select()}}functionmakeSafePath(e){vart=_.split(_.trim(e),"/");returnt=_.map(t,function(e){return_.kebabCase(_.deburr(_.trim(e)))}),_.join(_.filter(t,function(e){return!_.isEmpty(e)}),"/")}var_createClass=function(){functione(e,t){for(vara=0;a<t.length;a++){varo=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}returnfunction(t,a,o){returna&&e(t.prototype,a),o&&e(t,o),t}}();jQuery(document).ready(function(e){e("a").smoothScroll({speed:400,offset:-70});newSticky(".stickyscroll");e(window).bind("beforeunload",function(){e("#notifload").addClass("active")}),e(document).ajaxSend(function(){e("#notifload").addClass("active")}).ajaxComplete(function(){e("#notifload").removeClass("active")});vart=newAlerts;alertsData&&_.forEach(alertsData,function(e){t.push(e)});vara=io(ioHost);if(e("#search-input").length){e("#search-input").focus(),e(".searchresults").css("display","block");varo=newVue({el:"#header-container",data:{searchq:"",searchres:[],searchsuggest:[],searchload:0,searchactive:!1,searchmoveidx:0,searchmovekey:"",searchmovearr:[]},watch:{searchq:function(e,t){o.searchmoveidx=0,e.length>=3?(o.searchactive=!0,o.searchload++,a.emit("search",{terms:e},function(e){o.searchres=e.match,o.searchsuggest=e.suggest,o.searchmovearr=_.concat([],o.searchres,o.searchsuggest),o.searchload>0&&o.searchload--})):(o.searchactive=!1,o.searchres=[],o.searchsuggest=[],o.searchmovearr=[],o.searchload=0)},searchmoveidx:function(e,t){e>0?o.searchmovekey=o.searchmovearr[e-1]?"res."+o.searchmovearr[e-1]._id:"sug."+o.searchmovearr[e-1]:o.searchmovekey=""}},methods:{useSuggestion:function(e){o.searchq=e},closeSearch:function(){o.searchq=""},moveSelectSearch:function(){if(!(o.searchmoveidx<1)){vare=o.searchmoveidx-1;o.searchmovearr[e]?window.location.assign("/"+o.searchmovearr[e]._id):o.searchq=o.searchmovearr[e]}},moveDownSearch:function(){o.searchmoveidx<o.searchmovearr.length&&o.searchmoveidx++},moveUpSearch:function(){o.searchmoveidx>0&&o.searchmoveidx--}}});e("main").on("click",o.closeSearch)}if(e("#page-type-view").length&&!function(){vara="home"!==e("#page-type-view").data("entrypath")?e("#page-type-view").data("entrypath"):"",o=a+"/new-page";e(".btn-create-prompt").on("click",function(t){e("#txt-create-prompt").val(o),e("#modal-create-prompt").toggleClass("is-active"),setInputSelection(e("#txt-create-prompt").get(0),a.length+1,o.length),e("#txt-create-prompt").removeClass("is-danger").next().addClass("is-hidden")}),e("#txt-create-prompt").on("keypress",function(t){13===t.which&&e(".btn-create-go").trigger("click")}),e(".btn-create-go").on("click",function(t){vara=makeSafePath(e("#txt-create-prompt").val());_.isEmpty(a)?e("#txt-create-prompt").addClass("is-danger").next().removeClass("is-hidden"):(e("#txt-create-prompt").parent().addClass("is-loading"),window.location.assign("/create/"+a))}),""!==a&&e(".btn-move-prompt").removeClass("is-hidden");varn=_.lastIndexOf(a,"/")+1;e(".btn-move-prompt").on("click",function(t){e("#txt-move-prompt").val(a),e("#modal-move-prompt").toggleClass("is-active"),setInputSelection(e("#txt-move-prompt").get(0),n,a.length),e("#txt-move-prompt").removeClass("is-danger").next().addClass("is-hidden")}),e("#txt-move-prompt").on("keypress",function(t){13===t.which&&e(".btn-move-go").trigger("click")}),e(".btn-move-go").on("click",function(o){varn=makeSafePath(e("#txt-move-prompt").val());_.isEmpty(n)||n===a||"home"===n?e("#txt-move-prompt").addClass("is-danger").next().removeClass("is-hidden"):(e("#txt-move-prompt").parent().addClass("is-loading"),e.ajax(window.location.href,{data:{move:n},dataType:"json",method:"PUT"}).then(