function saveCookie(n,t,i,r){var u=new Date,f;u.setTime(u.getTime());i&&(i=i*864e5);f=new Date(u.getTime()+i);document.cookie=n+”=”+escape(t)+(i?”;expires=”+f.toUTCString():””)+”;path=”+r+”;samesite=lax”}function getCookie(n){var i=document.cookie.indexOf(n+”=”),r=i+n.length+1,t;return!i&&n!=document.cookie.substring(0,n.length)?null:i==-1?null:(t=document.cookie.indexOf(“;”,r),t==-1&&(t=document.cookie.length),unescape(document.cookie.substring(r,t)))}function readCookie(n){var t=RegExp(“”+n+”[^;]+”).exec(document.cookie);return decodeURIComponent(!t?””:t.toString().replace(/^[^=]+./,””))}function deleteCookie(n){document.cookie=n+”=; expires=Thu, 01 Jan 1970 00:00:01 GMT;”}function queryString(n){if(hu=window.location.search.substring(1),r=””,hu!=””){for(gy=hu.split(“&”),i=0;i0&&n)return window.location.pathname;var i=window.location,t=window.location.port;return i.protocol+”//”+i.hostname+(t!=””&&t!=”80″&&t!=”443″?”:”+t:””)+i.pathname}function getCheckVal(n){var t=$(“#”+n);return t.is(“:checked”)?encodeURIComponent(t.val()):””}function getCheckValGroup(n){var t=””;return $(“input[name='”+n+”‘]:checked”).each(function(){t+=t?”,”+$(this).val():$(this).val()}),t}function getRadioVal(n){return encodeURIComponent($(“input[name='”+n+”‘]:checked”).val())}function disableButton(n,t){var i=$(“#”+n);i.attr(“data-orig-text”,i.html());i.html(t);i.attr(“disabled”,”disabled”).addClass(“disabled”)}function reenableButton(n){var t=$(“#”+n);t.html(t.attr(“data-orig-text”));t.removeAttr(“data-orig-text”).removeAttr(“disabled”).removeClass(“disabled”)}function getSecToken(){return encodeURIComponent($(“input[name=__RequestVerificationToken]”).val())}function getSecTokenRaw(){return $(“input[name=__RequestVerificationToken]”).val()}function serializeSecToken(n){return n==!0?”__RequestVerificationToken=”+getSecToken():”&__RequestVerificationToken=”+getSecToken()}function handleResponseError(n){isAdmin=window.location.toString().indexOf(“/admin”)>-1?!0:!1;n.errType?window.location=(isAdmin?”/admin”:””)+”/error/?err=”+n.errType:n.redirect&&(window.location=n.redirect)}function formObj(){this.onStart=function(){disableButton(this.button,this.disabledText)};this.reenableForm=function(){reenableButton(this.button)};this.clearFields=function(){$(“#”+this.button).closest(“form”).find(“input”).each(function(){var n=$(this),t;n.val(“”);n.attr(“type”)==”password”&&(t=$(“#”+n.attr(“id”)+”-temp”),t.length>0&&(n.hide(),t.show()))})};this.onSuccess=function(){var n=this.resp;return n.errType?window.location=(this.isAdmin?”/admin”:””)+”/error/?err=”+n.errType:n.redirect?window.location=n.redirect:this.callback(n),n.IsValid?(this.formRedirects||this.reenableForm(),unhideCode(this.button),(!n.Data||n.Data&&!n.Data.overrideReset==!0)&&resetAction(this.button)):this.reenableForm(),!1};this.initForm=function(n){var t=this;$(“#”+t.button).click(function(){if(!$(this).is(“:visible”)&&t.checkButtonVisibility||n&&!confirm(n))return!1;try{return removeFeedback(),t.onStart(),$.ajax({type:”POST”,cache:!1,dataType:”json”,url:t.service,data:t.data()+serializeSecToken(),timeout:t.timeout,success:function(n){t.resp=n;t.onSuccess()},error:function(){alert(“An error occurred”);t.reenableForm()}}),!1}catch(i){return t.reenableForm(),!1}})}}function showPopover(n,t,i,r){var u=$(“#”+n),f,o,e;i&&!u.is(“:visible”)&&(u=$(“#”+i));r&&!u.is(“:visible”)&&(u=$(“#”+r));f=u.data(“popover”);f?(f.$tip.find(“.content p”).html(t),f.$tip.show()):(u.popover({content:t,trigger:”manual”}),u.popover(“show”),window.pageYOffset>0&&(o=u.data(“popover”).$tip,e=parseInt(o.css(“top”).replace(“px”,””)),e=e-window.pageYOffset,o.css(“top”,e+”px”)))}function showAlert(n,t,i,r){i||(i=”alert-error”);t||(t=”fa fa-times-circle fa-spacer”);r||(r=”alert”);$(“#”+r).after(‘

‘+n+””);window.location=”#”}function showValidationError(n,t,i){var r,u,f;arguments.length===3?(u=$(“#”+i+””),r=u.find(“#”+n+””)):r=$(“#”+n+””);document.location.href.indexOf(“/admin/”)>-1?(r.closest(“.control-group”).addClass(“error”),t&&(r.after(‘‘+t+””),f=r.closest(“.controls”),f.children(“.code”).hide())):(r.closest(“.form-group”).addClass(“has-error”),r.is(“input”)&&(r.is(“input[type=hidden],input[type=checkbox]”)||r.closest(“.form-group”).length&&(r.closest(“.form-group”).addClass(“has-feedback”),r.after(‘