!function(){"use strict";function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,s,i=[],c=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(i.push(r.value),i.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw o}}return i}}(t,e)||function(t,e){var n;if(t)return"string"==typeof t?r(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var m,e,w,h,y,v,b,k,t,x,d,C=[].indexOf,i={},n={},S=function(t,e){return T(t,n[t]=e),Object.values(n).every(function(t){return"good"===t||"info"===t})?null!=(t=$("#newpassword").get(0))&&t.setCustomValidity(""):null!=(e=$("#newpassword").get(0))&&e.setCustomValidity(P("PE28")),O()},T=function(t,e){switch($("#"+t).removeClass("fa-times fa-check fa-spinner fa-pulse fa-info-circle fa-question-circle text-danger text-success text-info text-secondary"),$("#"+t).attr("role","status"),e){case"good":return $("#"+t).addClass("fa-check text-success");case"bad":return $("#"+t).addClass("fa-times text-danger"),$("#"+t).attr("role","alert");case"unknown":return $("#"+t).addClass("fa-question-circle text-secondary");case"waiting":return $("#"+t).addClass("fa-spinner fa-pulse text-secondary");case"info":return $("#"+t).addClass("fa-info-circle text-info")}},O=function(){var t;return null!=(t=$("#newpassword").get(0))&&t.checkValidity()&&null!=(t=$("#confirmpassword").get(0))&&t.checkValidity()?$(".ppolicy").removeClass("border-danger").addClass("border-success"):$(".ppolicy").removeClass("border-success").addClass("border-danger")},j=function(a){return a?window.currentLanguage=a:a=window.currentLanguage,$.getJSON("".concat(window.staticPrefix,"languages/").concat(a,".json"),function(t){var e,n,r,o;for(e in i=t,n=window.datas.trOver.all)o=n[e],i[e]=o;if(window.datas.trOver[a])for(e in r=window.datas.trOver[a])o=r[e],i[e]=o;return $("[trspan]").each(function(){for(var t=$(this).attr("trspan").split(","),e=P(t.shift()),n=0,r=t.length;n<r;n++)o=t[n],e=e.replace(/%[sd]/,o);return $(this).html(e)}),$("[trmsg]").each(function(){if($(this).html(P("PE".concat($(this).attr("trmsg")))),P("PE".concat($(this).attr("trmsg"))).match(/_hide_/))return $(this).parent().hide()}),$("[trattribute]").each(function(){for(var t=$(this).attr("trattribute").trim().split(/\s+/),e=0,n=t.length;e<n;e++){var r=s(t[e].split(":"),2),o=r[0],r=r[1];o&&r&&$(this).attr(o,P(r))}return!0}),$("[trplaceholder]").each(function(){var t=P($(this).attr("trplaceholder"));return $(this).attr("placeholder",t),$(this).attr("aria-label",t)}),$("[localtime]").each(function(){var t=new Date(1e3*$(this).attr("localtime"));return $(this).text(t.toLocaleString())})})},P=function(t){return i[t]||t};window.translate=P,window.translatePage=j,h=function(){var r={};return $("script[type='application/init']").each(function(){var t,e,n;try{for(t in n=JSON.parse($(this).text()),e=[],n)e.push(r[t]=n[t]);return e}catch(t){console.error("Parsing error",t),console.debug("JSON",$(this).text())}}),r},w=function(t){t=RegExp("[?&]"+t+"=([^&]*)").exec(window.location.search);return t?decodeURIComponent(t[1].replace(/\+/g," ")):null},d="#appslist",x=function(){return t("_appsListOrder",$(d).sortable("toArray").join())},v=function(t){return e("_oidcConsents",t,function(){return $("[partner='".concat(t,"']")).hide()},function(t,e,n){return alert("".concat(e," ").concat(n))})},t=function(e,n,r,o){return $.ajax({type:"GET",url:"".concat(scriptname,"mysession/?gettoken"),dataType:"json",error:o,success:function(t){t={token:t.token};return t[e]=n,$.ajax({type:"PUT",url:"".concat(scriptname,"mysession/persistent"),dataType:"json",data:t,success:r,error:o})}})},e=function(e,n,r,o){return $.ajax({type:"GET",url:"".concat(scriptname,"mysession/?gettoken"),dataType:"json",error:o,success:function(t){return $.ajax({type:"DELETE",url:"".concat(scriptname,"mysession/persistent/").concat(e,"?sub=").concat(n,"&token=").concat(t.token),dataType:"json",success:r,error:o})}})},b=function(){var t,e,n,r,o,a,s,i,c,l,u=$(d);if(null==u||!m.appslistorder)return null;for(t=m.appslistorder.split(","),i=[],e=0,a=(r=u.sortable("toArray")).length;e<a;e++)i[l=r[e]]=l;for(o=0,s=t.length;o<s;o++)i[c=t[o]]&&(n=i[c],n=$(d+".ui-sortable").children("#"+n),c=$(d+".ui-sortable").children("#"+c),n.remove(),$(d+".ui-sortable").filter(":first").append(c));return 1},y=function(){return $.ajax({type:"POST",url:scriptname,data:{ping:1},dataType:"json",success:function(t){return null!=t.result&&1===t.result?setTimeout(y,m.pingInterval):location.reload(!0)},error:function(t,e,n){return location.reload(!0)}})},window.ping=y,k=function(t,e,n){var r=m.sameSite,o=m.cookieSecure,t="".concat(t,"=").concat(e,"; path=/; SameSite=").concat(r);return n&&((e=new Date).setTime(e.getTime()+864e5*n),t+="; expires=".concat(e.toUTCString())),o&&(t+="; Secure"),document.cookie=t},m={},$(window).on("load",function(){var t,e,n,r,o,a,s,i,c,l,u,d,p,f;m=h(),"datas"in window&&"choicetab"in window.datas&&(m.choicetab=window.datas.choicetab),window.datas=m,$("#appslist").sortable({axis:"y",cursor:"move",opacity:.5,revert:!0,items:"> div.category",update:x}),b(),$("div.message").fadeIn("slow"),$("input[name=timezone]").val(-(new Date).getTimezoneOffset()/60),g=$("#menu").tabs({active:0}),f=w("tab"),p=$('#menu a[href="#'+f+'"]').parent().index(),g.tabs("option","active",p=p<0?0:p),g=$("#authMenu").tabs({active:0}),p=$('#authMenu a[href="#'+f+'"]').parent().index(),g.tabs("option","active",p=p<0?0:p),m.choicetab&&g.tabs("option","active",$('#authMenu a[href="#id_'+m.choicetab+'"]').parent().index()),0===$("input[autofocus]").length&&$("input[type=text], input[type=password]").first().focus(),m.newwindow&&$("#appslist a").attr("target","_blank"),$("p.removeOther").length&&(f=$("#form").attr("action"),p=$("#form").attr("method"),console.debug("method=",p),o="",$("#form input[type=hidden]")&&(console.debug("Parse hidden values"),$("#form input[type=hidden]").each(function(t){return console.debug(" ->",$(this).attr("name"),$(this).val()),o+="&"+$(this).attr("name")+"="+$(this).val()})),g="",f&&(console.debug("action=",f),-1!==f.indexOf("?")?f.substring(0,f.indexOf("?")):g=f+"?",g+=o,o=""),f=$("p.removeOther a").attr("href")+"&method="+p+o,g&&(f+="&url="+btoa(g)),$("p.removeOther a").attr("href",f)),window.location.search&&((l=w("llnglanguage"))&&console.debug("Get lang from parameter"),1===(d=w("setCookieLang")))&&console.debug("Set lang cookie"),s?C.call(window.availableLanguages,s)<0&&(s=window.datas.language,l||console.debug("Lang not available -> Get lang from server")):(s=window.datas.language)&&!l&&console.debug("Get lang from server"),l?(C.call(window.availableLanguages,l)<0&&(console.debug("Lang not available -> Get lang from server"),l=window.language),console.debug("Selected lang ->",l),d&&(console.debug("Set cookie lang ->",l),k("llnglanguage",l,3650)),j(l)):(console.debug("Selected lang ->",s),j(s)),i="";for(a=0,c=(u=window.availableLanguages).length;a<c;a++)t=u[a],i+='<img class="langicon" src="'.concat(window.staticPrefix,"common/").concat(t,'.png" title="').concat(t,'" alt="[').concat(t,']"> ');$("#languages").html(i),$(".langicon").on("click",function(){return s=$(this).attr("title"),k("llnglanguage",s,3650),j(s)}),e=function(t,e){var n=jQuery.Event("checkpassword"),t={password:t,evType:e,setResult:S};return $(document).trigger(n,t)},n=function(){var t;return null!=(t=$("#confirmpassword").get(0))&&t.value&&(null!=(t=$("#confirmpassword").get(0))?t.value:void 0)===(null!=(t=$("#newpassword").get(0))?t.value:void 0)?(null!=(t=$("#confirmpassword").get(0))&&t.setCustomValidity(""),T("samepassword-feedback","good"),O(),!0):(null!=(t=$("#confirmpassword").get(0))&&t.setCustomValidity(P("PE34")),T("samepassword-feedback","bad"),O(),!1)},null!=window.datas.ppolicy&&$("#newpassword").length&&(e(""),n(),$("#confirmpassword").keyup(function(t){n()}),$("#newpassword").keyup(function(t){e(t.target.value),n()}),$("#newpassword").focusout(function(t){e(t.target.value,"focusout"),n()})),p=function(t){return t.target.checked?($("#newpassword").off("keyup"),null!=(t=$("#newpassword").get(0))?t.setCustomValidity(""):void 0):($("#newpassword").keyup(function(t){e(t.target.value)}),e(""))},$("#newpassword").change(n),$("#confirmpassword").change(n),null!=window.datas.ppolicy&&$("#newpassword").length&&$("#reset").change(p),$(".localeDate").each(function(){var t=new Date(1e3*$(this).attr("val"));return $(this).text(t.toLocaleString())}),$(".oidcConsent").on("click",function(){return v($(this).attr("partner"))}),m.pingInterval&&0<m.pingInterval&&window.setTimeout(y,m.pingInterval),m.enablePasswordDisplay&&(r="",m.dontStorePassword?($(".toggle-password").on("mousedown touchstart",function(){return r=(r=$(this).attr("id")).replace(/^toggle_/,""),console.debug("Display",r),$(this).toggleClass("fa-eye fa-eye-slash"),$("input[name=".concat(r,"]")).attr("class","form-control")}),$(".toggle-password").on("mouseup touchend",function(){if($(this).toggleClass("fa-eye fa-eye-slash"),$("input[name=".concat(r,"]")).get(0).value)return $("input[name=".concat(r,"]")).attr("class","form-control key")})):($(".toggle-password").on("mousedown touchstart",function(){return r=(r=$(this).attr("id")).replace(/^toggle_/,""),console.debug("Display",r),$(this).toggleClass("fa-eye fa-eye-slash"),$("input[name=".concat(r,"]")).attr("type","text")}),$(".toggle-password").on("mouseup touchend",function(){return $(this).toggleClass("fa-eye fa-eye-slash"),$("input[name=".concat(r,"]")).attr("type","password")}))),$("#reset").change(function(){var t=$(this).prop("checked");return console.debug("Reset is checked",t),!0===t?($("#ppolicy").hide(),$("#newpasswords").hide(),$("#newpassword").removeAttr("required"),$("#confirmpassword").removeAttr("required"),null!=(t=$("#confirmpassword").get(0))?t.setCustomValidity(""):void 0):($("#ppolicy").show(),$("#newpasswords").show(),$("#newpassword").attr("required",!0),$("#confirmpassword").attr("required",!0),(null!=(t=$("#confirmpassword").get(0))?t.value:void 0)===(null!=(t=$("#newpassword").get(0))?t.value:void 0)?null!=(t=$("#confirmpassword").get(0))?t.setCustomValidity(""):void 0:null!=(t=$("#confirmpassword").get(0))?t.setCustomValidity(P("PE34")):void 0)}),$("#passwordfield").on("input",function(){return $("#passwordfield").get(0).value&&m.dontStorePassword?$("#passwordfield").attr("class","form-control key"):$("#passwordfield").attr("class","form-control")}),$("#oldpassword").on("input",function(){return $("#oldpassword").get(0).value&&m.dontStorePassword?$("#oldpassword").attr("class","form-control key"):$("#oldpassword").attr("class","form-control")}),$("#newpassword").on("input",function(){return $("#newpassword").get(0).value&&m.dontStorePassword?$("#newpassword").attr("class","form-control key"):$("#newpassword").attr("class","form-control")}),$("#confirmpassword").on("input",function(){return $("#confirmpassword").get(0).value&&m.dontStorePassword?$("#confirmpassword").attr("class","form-control key"):$("#confirmpassword").attr("class","form-control")}),$(".clear-finduser-field").on("click",function(){return $(this).parent().find(":input").each(function(){return console.debug("Clear search field ->",$(this).attr("name")),$(this).val("")})}),$("#closefinduserform").on("click",function(){return console.debug("Clear modal"),$("#finduserForm").trigger("reset")}),$("#finduserbutton").on("click",function(t){return t.preventDefault(),document.body.style.cursor="progress",t=$("#finduserForm").serialize(),console.debug("Send findUser request with parameters",t),$.ajax({type:"POST",url:"".concat(scriptname,"finduser"),dataType:"json",data:t,success:function(t){var e;if(document.body.style.cursor="default",e=t.user,console.debug("Suggested spoofId=",e),$("input[name=spoofId]").each(function(){return $(this).val(e)}),t.captcha&&$("#captcha").attr("src",t.captcha),t.token)return $("#finduserToken").val(t.token),$("#token").val(t.token)},error:function(t,e,n){var r;document.body.style.cursor="default",n&&console.error("Error",n),(r=t?JSON.parse(t.responseText):r)&&r.error&&console.error("Returned error",r)}})}),$("#btn-back-to-top").on("click",function(){return console.debug("Back to top"),document.body.scrollTop=0,document.documentElement.scrollTop=0}),$(window).on("scroll",function(){return m.scrollTop&&(document.body.scrollTop>Math.abs(m.scrollTop)||document.documentElement.scrollTop>Math.abs(m.scrollTop))?$("#btn-back-to-top").css("display","block"):$("#btn-back-to-top").css("display","none")}),$("form[data-property=single-submit]").on("submit",function(t){if(!0!==$(this).data("data-submitted"))return $(this).find(":submit").prop("disabled",!0),$(this).data("data-submitted",!0);t.preventDefault()}),$('.category[name="'.concat(m.floatingCategory,'"]')).appendTo("#floating-menu").find("i").remove(),$('.category[name="'.concat(m.floatingCategory,'"]')).draggable();var g=document.getElementById("floating-menu");return g&&g.querySelectorAll(".col-md-4").forEach(function(t,e){t.classList.remove("col-md-4"),t.classList.add("col-md-12")}),$(document).trigger("portalLoaded"),!0})}();