!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}([function(e,t,r){var n=r(8)();e.exports=n;try{regeneratorRuntime=n}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t){function r(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,c,"next",e)}function c(e){r(a,o,i,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecode=t.InvalidTokenError=void 0;class n extends Error{}function o(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(r){return atob(t)}}t.InvalidTokenError=n,n.prototype.name="InvalidTokenError",t.jwtDecode=function(e,t){if("string"!==typeof e)throw new n("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,i=e.split(".")[r];if("string"!==typeof i)throw new n(`Invalid token specified: missing part #${r+1}`);let a;try{a=o(i)}catch(s){throw new n(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(a)}catch(s){throw new n(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(6);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){(function(t,n){var o;!function(){"use strict";var i="input is invalid type",a="object"===typeof window,s=a?window:{};s.JS_SHA256_NO_WINDOW&&(a=!1);var c=!a&&"object"===typeof self,u=!s.JS_SHA256_NO_NODE_JS&&"object"===typeof t&&t.versions&&t.versions.node;u?s=n:c&&(s=self);var l=!s.JS_SHA256_NO_COMMON_JS&&"object"===typeof e&&e.exports,d=r(11),f=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],m=[24,16,8,0],w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],v=["hex","array","digest","arrayBuffer"],g=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(r){return new x(t,!0).update(r)[e]()}},k=function(e){var t=y("hex",e);u&&(t=b(t,e)),t.create=function(){return new x(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r>>6,s[u++]=128|63&a):a<55296||a>=57344?(s[u++]=224|a>>>12,s[u++]=128|a>>>6&63,s[u++]=128|63&a):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++n)),s[u++]=240|a>>>18,s[u++]=128|a>>>12&63,s[u++]=128|a>>>6&63,s[u++]=128|63&a);e=s}else{if("object"!==o)throw new Error(i);if(null===e)throw new Error(i);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(i)}e.length>64&&(e=new x(t,!0).update(e).array());var l=[],d=[];for(n=0;n<64;++n){var h=e[n]||0;l[n]=92^h,d[n]=54^h}x.call(this,t,r),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=r}x.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=0,s=e.length,c=this.blocks;a>>2]|=e[a]<>>2]|=n<>>2]|=(192|n>>>6)<>>2]|=(128|63&n)<=57344?(c[o>>>2]|=(224|n>>>12)<>>2]|=(128|n>>>6&63)<>>2]|=(128|63&n)<>>2]|=(240|n>>>18)<>>2]|=(128|n>>>12&63)<>>2]|=(128|n>>>6&63)<>>2]|=(128|63&n)<=64?(this.block=c[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=p[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},x.prototype.hash=function(){var e,t,r,n,o,i,a,s,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,p=this.h5,m=this.h6,v=this.h7,g=this.blocks;for(e=16;e<64;++e)t=((o=g[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=g[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,g[e]=g[e-16]+t+g[e-7]+r<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=g[0]-1413257819)-150054599<<0,f=o+24177077<<0):(i=704751109,v=(o=g[0]-210244248)-1521486534<<0,f=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&d^c,v=f+(o=v+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&p^~h&m)+w[e]+g[e])<<0,f=o+(t+n)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(a=f&u)^f&l^i,m=d+(o=m+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&h^~v&p)+w[e+1]+g[e+1])<<0,t=((d=o+(t+n)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(s=d&f)^d&u^a,p=l+(o=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&h)+w[e+2]+g[e+2])<<0,t=((l=o+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&d)^l&f^s,h=u+(o=h+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&v)+w[e+3]+g[e+3])<<0,u=o+(t+n)<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+d<<0,this.h3=this.h3+f<<0,this.h4=this.h4+h<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+v<<0},x.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=h[e>>>28&15]+h[e>>>24&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>4&15]+h[15&e]+h[t>>>28&15]+h[t>>>24&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>4&15]+h[15&t]+h[r>>>28&15]+h[r>>>24&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>4&15]+h[15&r]+h[n>>>28&15]+h[n>>>24&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>4&15]+h[15&n]+h[o>>>28&15]+h[o>>>24&15]+h[o>>>20&15]+h[o>>>16&15]+h[o>>>12&15]+h[o>>>8&15]+h[o>>>4&15]+h[15&o]+h[i>>>28&15]+h[i>>>24&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>4&15]+h[15&i]+h[a>>>28&15]+h[a>>>24&15]+h[a>>>20&15]+h[a>>>16&15]+h[a>>>12&15]+h[a>>>8&15]+h[a>>>4&15]+h[15&a];return this.is224||(c+=h[s>>>28&15]+h[s>>>24&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>4&15]+h[15&s]),c},x.prototype.toString=x.prototype.hex,x.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||c.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),c},x.prototype.array=x.prototype.digest,x.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},E.prototype=new x,E.prototype.finalize=function(){if(x.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();x.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),x.prototype.finalize.call(this)}};var T=k();T.sha256=T,T.sha224=k(!0),T.sha256.hmac=_(),T.sha224.hmac=_(!0),l?e.exports=T:(s.sha256=T.sha256,s.sha224=T.sha224,d&&(void 0===(o=function(){return T}.call(T,r,T,e))||(e.exports=o)))}()}).call(this,r(9),r(10))},function(e,t,r){var n=r(3).default,o=r(7);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(3).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(3).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(L){d=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),s=new O(n||[]);return a(i,"_invoke",{value:x(e,r,s)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}t.wrap=f;var p={};function m(){}function w(){}function v(){}var g={};d(g,c,(function(){return this}));var y=Object.getPrototypeOf,k=y&&y(y(I([])));k&&k!==r&&i.call(k,c)&&(g=k);var b=v.prototype=m.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,a,s,c){var u=h(e[o],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return U()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"===typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d1)for(var r=1;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e?n():setTimeout(r.bind(this,n,o),30)}))};var g=window.rapplerKeycloak,y=g.url,k=g.realm,b=g.client_id,S=new function e(t){if(!(this instanceof e))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var r,n,o=this,i=[],a={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),c=0;c=0;--r){var n=t[r];"error"==e.data?n.setError():n.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function O(){a.enable&&o.token&&setTimeout((function(){I().then((function(e){e&&O()}))}),1e3*a.interval)}function I(){var e=T();if(a.iframe&&a.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");a.callbackList.push(e);var r=a.iframeOrigin;1==a.callbackList.length&&a.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function U(){var e=T();if(a.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);window.addEventListener("message",(function r(n){t.contentWindow===n.source&&("supported"!==n.data&&"unsupported"!==n.data||("unsupported"===n.data&&(w("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),a.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))}),!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new Promise((function(e,o){n=setTimeout((function(){o({error:r})}),t)}));return Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function L(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),T().promise},logout:function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("GET"!==(null!==(n=null===t||void 0===t?void 0:t.logoutMethod)&&void 0!==n?n:o.logoutMethod)){e.next=4;break}return window.location.replace(o.createLogoutUrl(t)),e.abrupt("return");case 4:return i=o.createLogoutUrl(t),e.next=7,fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:r.redirectUri(t,!1)})});case 7:if(!(a=e.sent).redirected){e.next=11;break}return window.location.href=a.url,e.abrupt("return");case 11:if(!a.ok){e.next=14;break}return window.location.reload(),e.abrupt("return");case 14:throw new Error("Logout failed, request returned an error code.");case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,s,"next",e)}function s(e){p(i,n,o,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),register:function(e){return window.location.assign(o.createRegisterUrl(e)),T().promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof e)throw"Not supported by the OIDC server";return window.location.href=e,T().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){a.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},n=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)},i=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var r=T(),a=n(e),s=o.createLoginUrl(e),c=t(s,"_blank",a),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(k(x(e.url),r),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(i())?(k(x(e.url),r),d(),u=!0):(r.setError(),d()))})),c.addEventListener("exit",(function(e){l||r.setError({reason:"closed_by_user"})})),r.promise},logout:function(e){var r,n=T(),a=o.createLogoutUrl(e),s=t(a,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf(i())||(r=!0),s.close()})),s.addEventListener("exit",(function(e){r?n.setError():(o.clearToken(),n.setSuccess())})),n.promise},register:function(e){var r=T(),a=o.createRegisterUrl(),s=n(e),c=t(a,"_blank",s);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(c.close(),k(x(e.url),r))})),r.promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&r.close()}))},redirectUri:function(e){return i()}}}if("cordova-native"==e)return a.enable=!1,{login:function(e){var t=T(),r=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),k(x(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=T(),r=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=T(),r=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),k(x(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(e){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new C}catch(e){}return new R}();if(r=e&&["default","cordova","cordova-native"].indexOf(e.adapter)>-1?L(e.adapter):e&&"object"===m(e.adapter)?e.adapter:window.Cordova||window.cordova?L("cordova"):L(),e){if("undefined"!==typeof e.useNonce&&(u=e.useNonce),"undefined"!==typeof e.checkLoginIframe&&(a.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(a.interval=e.checkLoginIframeInterval),"login-required"===e.onLoad&&(o.loginRequired=!0),e.responseMode){if("query"!==e.responseMode&&"fragment"!==e.responseMode)throw"Invalid value for responseMode";o.responseMode=e.responseMode}if(e.flow){switch(e.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=e.flow}if(null!=e.timeSkew&&(o.timeSkew=e.timeSkew),e.redirectUri&&(o.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),"boolean"===typeof e.silentCheckSsoFallback?o.silentCheckSsoFallback=e.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,"undefined"!==typeof e.pkceMethod){if("S256"!==e.pkceMethod&&!1!==e.pkceMethod)throw new TypeError("Invalid value for pkceMethod', expected 'S256' or false but got ".concat(e.pkceMethod,"."));o.pkceMethod=e.pkceMethod}else o.pkceMethod="S256";"boolean"===typeof e.enableLogging?o.enableLogging=e.enableLogging:o.enableLogging=!1,"POST"===e.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"===typeof e.scope&&(o.scope=e.scope),"string"===typeof e.acrValues&&(o.acrValues=e.acrValues),"number"===typeof e.messageReceiveTimeout&&e.messageReceiveTimeout>0?o.messageReceiveTimeout=e.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var i=T(),s=T();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),i.setSuccess(o.authenticated)})).catch((function(e){i.setError(e)}));var c=function(e){var r,n=T();t?"string"===typeof t&&(r=t):r="keycloak.json";function i(e){o.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return y()+"/protocol/openid-connect/auth"},token:function(){return y()+"/protocol/openid-connect/token"},logout:function(){return y()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=y()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=y()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return y()+"/protocol/openid-connect/registrations"},userinfo:function(){return y()+"/protocol/openid-connect/userinfo"}}}if(r){(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||b(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),n.setSuccess()}else n.setError()},c.send()}else{if(!t.clientId)throw"clientId missing";o.clientId=t.clientId;var a=t.oidcProvider;if(a){var s,c;if("string"===typeof a)s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",s,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||b(c)?(i(JSON.parse(c.responseText)),n.setSuccess()):n.setError())},c.send();else i(a),n.setSuccess()}else{if(!t.url)for(var u=document.getElementsByTagName("script"),l=0;l=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var r=o.resourceAccess[t||o.clientId];return!!r&&r.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=y()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var r=T();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),r.setSuccess(o.profile)):r.setError())},t.send(),r.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var r=T();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),r.setSuccess(o.userInfo)):r.setError())},t.send(),r.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return h("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=T();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,h("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(r=!0,h("[KEYCLOAK] Refreshing token: token expired")),r){var n="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,n+="&client_id="+encodeURIComponent(o.clientId);var c=(new Date).getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){h("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);S(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{w("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(n)}}else t.setSuccess(!1)};a.enable?I().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},o.clearToken=function(){o.token&&(S(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var C=function e(){if(!(this instanceof e))return new e;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function t(){for(var e=(new Date).getTime(),t=0;t64&&document.querySelector(".masthead__profile-dropdown").classList.remove("show")})),n.querySelector(".piano-logout").addEventListener("click",(function(){window.rapplerLogout()})),r.querySelector(".masthead__profile--logged-out").remove(),r.appendChild(n)}}function A(){var e=document.querySelector(".masthead__profile--logged-out"),t=document.querySelector(".masthead__profile button");e&&t&&(e.style.opacity=1,t.style.cursor="pointer",t.addEventListener("click",(function(){window.rapplerPianoSignIn()})))}function O(){window.localStorage.removeItem("kc-token"),window.localStorage.removeItem("kc-refreshToken"),window.localStorage.removeItem("kc-idToken")}S.onTokenExpired=a()(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,S.updateToken(5);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),window.location.reload();case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),S.onAuthSuccess=function(){window.tp=window.tp||[],window.tp.push(["init",function(){window.tp.push(["setExternalJWT",S.idToken])}])},S.onReady=function(){window.keycloak.isAdapterInitialized=!0},S.onAuthLogout=function(){O(),window.location.reload()},S.isSafari=function(){return/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!==typeof safari&&window.safari.pushNotification).toString()},window.rapplerPianoSignIn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"login";if(!S.authenticated||"UPDATE_PASSWORD"===e){var t=document.getElementById("keycloak-login-page");if(!t&&["login","register","UPDATE_PASSWORD"].includes(e)){var r={redirectUri:window.location.origin+"/sso-redirect/",action:"login"===e?void 0:e};if(window.keycloak.isSafari())return S.login(r);window.localStorage.setItem("ra-keycloak-redirect",window.location.href);var n=S.createLoginUrl(r),o=document.createElement("div");o.id="keycloak-login-page";var i=document.createElement("div");i.classList.add("container");var a=document.createElement("iframe");a.src=n;var s=document.createElement("div");s.classList.add("close"),s.addEventListener("click",(function(){document.body.style.overflow="auto",document.body.removeChild(o)})),o.addEventListener("click",(function(e){e.target===o&&(document.body.style.overflow="auto",document.body.removeChild(o))})),i.appendChild(a),i.appendChild(s),o.appendChild(i),document.body.style.overflow="hidden",document.body.appendChild(o)}}},window.rapplerLogout=function(){window.tp=window.tp||[],window.tp.push(["init",a()(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.tp.push(["setExternalJWT",null]),window.localStorage.removeItem("ra-user-role"),window.localStorage.removeItem("ra-keycloak-redirect"),O(),e.next=6,S.logout({redirectUri:window.location.href});case 6:case"end":return e.stop()}}),e)})))])},window.rapplerPianoGetUser=function(){var e=null===S||void 0===S?void 0:S.idTokenParsed;if(e)return v(v({},e),{},{firstName:e.given_name,lastName:e.family_name})},window.rapplerNameWithInitial=function(){var e=window.rapplerPianoGetUser(),t=e.firstName,r=e.lastName,n="";return r&&(n=r.charAt(0)),"".concat(t," ").concat(n)},window.rapplerNameInitials=function(){var e=window.rapplerPianoGetUser(),t=e.firstName.charAt(0),r=e.lastName,n="";return r&&(n=r.charAt(0)),"".concat(t).concat(n)},window.rapplerPianoGetToken=function(){return null===S||void 0===S?void 0:S.idToken},window.rapplerPianoIsLoggedIn=function(){return(null===S||void 0===S?void 0:S.authenticated)||!1},window.addEventListener("message",(function(e){if(e.origin===y&&"resize"===e.data.event){var t=document.querySelector("#keycloak-login-page .container");t&&(t.style.height=e.data.value)}}),!1),a()(c.a.mark((function e(){var t,r,n,o,i,a,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t={onLoad:"check-sso",silentCheckSsoRedirectUri:window.location.origin+"/silent-check-sso/"},_()&&(null===(r=document.querySelector(".burger-nav__profile-top-url"))||void 0===r||r.classList.add("hide"),t.token=null!==(n=window.localStorage.getItem("kc-token"))&&void 0!==n?n:void 0,t.refreshToken=null!==(o=window.localStorage.getItem("kc-refreshToken"))&&void 0!==o?o:void 0,t.idToken=null!==(i=window.localStorage.getItem("kc-idToken"))&&void 0!==i?i:void 0,t.checkLoginIframe=!1),e.next=5,S.init(t);case 5:if(a=e.sent,!window.location.pathname.includes("sso-redirect")){e.next=20;break}if(!a){e.next=16;break}if(window.parent===window.self){e.next=11;break}return window.parent.location.reload(),e.abrupt("return");case 11:return s=window.localStorage.getItem("ra-keycloak-redirect"),window.location.href=s||window.location.origin,e.abrupt("return");case 16:return window.location.href=window.location.origin,e.abrupt("return");case 18:e.next=21;break;case 20:a?a&&T():A();case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(0),console.error("Failed to initialize keycloak adapter",e.t0);case 26:case"end":return e.stop()}}),e,null,[[0,23]])})))(),window.keycloak=S}]);