$(document).ready((function(){var t=document.cookie.split(";"),e={};t.forEach((function(t){var a=t.split("="),n=a[0],i=a[1];"true"!==i&&"false"!==i||(i="true"===i),e[n]=i}));var a="none"!==$("nav-gem").css("display"),n=!1;$("nav-gem").click((function(t){t.stopPropagation(),$("nav").addClass("visible"),$(document).css("cursor","pointer"),n=!0})),$("#pencil li").click((function(t){switch(t.stopImmediatePropagation(),t.preventDefault(),$("a",this).attr("action")){case"new":$("edit input").each((function(){$(this).val("")})),$("edit textarea").each((function(){$(this).val("").empty()}));case"edit":$("edit").fadeIn();break;case"clear-cache":$.post("/clear-cache");break;case"exit":$.post("/logout")}return!1})),$("nav ul li.dropdown a").mouseover((function(){var t=$(this).closest(".dropdown"),e=$("a:first",t).text();$("a:first",t).text(e.replace("+","-")),t.addClass("visible")})),$("nav ul li.dropdown").mouseleave((function(){var t=$(this).closest(".dropdown"),e=$("a:first",t).text();$("a:first",t).text(e.replace("-","+")),t.removeClass("visible")})),$("nav ul li:not(.dropdown)").click((function(){window.location.href=$("a",this).attr("href")})),$(document).click((function(t){n&&!$(t.target).closest("nav").length&&$("nav").removeClass("visible"),$("menu").fadeOut()})),$("main img:not([link])").click((function(){if(n)return $(document).click(),!1;var t=$(this),e=t.attr("src"),i=t.attr("type");if(i.match(/^(borderless|banner)/gi))return!1;$("lightbox img").attr("src",e).attr("type",i),a&&$("lightbox").css("display","flex").hide(),$("lightbox").fadeIn()})),$("lightbox").click((function(){$(this).fadeOut()})),$("button[link], gallery img[link], header #logo").click((function(){if(n)return $(document).click(),!1;var t=$(this).attr("link");"/back"===t?window.history.back():window.location.href=t})),$("#login > button").click((function(){$.ajax({url:"/login",method:"POST",data:{username:$('input[type="text"]').val(),password:$('input[type="password"]').val()},statusCode:{401:function(){$("h1").html("| 401 ...Behind The Wall")},403:function(){$("h1").html("| 403 ...Lockout")},200:function(t){window.location.href=t.destination}}})})),$("edit [action]").click((function(){switch($(this).attr("action")){case"cancel":window.location.reload();break;case"save":var t={};$("edit input, edit textarea").each((function(){var e=$(this),a=e.attr("name"),n="";n="content"===a?{text:e.val()}:e.val(),t[a]=n})),$.ajax({url:"/page",method:"POST",data:t,statusCode:{401:function(){alert("Must be authenticated to create/edit pages.")},500:function(t){alert("Encountered a database error: "+t.message)},200:function(t){window.location.href=t.destination}}})}})),$("edit textarea").keyup((function(){var t=$(this),e=t.next("counter");if(0!==e.length){var a=e.attr("default"),n=t.val().length;e.text(a-n),a-n<0?e.addClass("warning"):e.removeClass("warning")}})),$("edit textarea").trigger("keyup");var i=$("block.half + br, block.half + br + br");i.next("br + block.half, block.half").length&&i.remove();var o,r=["you know you want to...","how long are you going to hover here?","press... down.","your behavior is incorrigible."],c=0;if($("button[link]").mouseover((function(){var t=$(this);t.next("strong").length&&(t.next("strong").text(r[c++]),o=setInterval((function(){t.next("strong").text(r[c++])}),4e3))})),$("button[link]").mouseout((function(){var t=$(this);t.next("strong").length&&(clearInterval(o),c=0,t.next("strong").text("click this button"))})),$("type").length){var s=$("type"),l=s.text().split("");s.text("").css("opacity",1);var u=setInterval((function(){var t=s.text(),e=l.shift();if("["===e){var a="";for(e=l.shift();"]"!==e;)a+=e,e=l.shift();var n=0;switch(a){case"short-wait":n=160;break;case"medi-wait":n=320;break;case"long-wait":n=640}for(var i=0;i