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