dash-button-web 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ export { s as setNonce } from './index-46149754.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
6
+ return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"menuLinks":[1,"menu-links"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };
@@ -14,7 +14,7 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
17
+ return bootstrapLazy([["dash-button",[[1,"dash-button",{"showPostLoginText":[4,"show-post-login-text"],"silentCheckSso":[4,"silent-check-sso"],"redirectUri":[1,"redirect-uri"],"authMethod":[1,"auth-method"],"keycloakUri":[1,"keycloak-uri"],"realm":[1],"clientId":[1,"client-id"],"appId":[1,"app-id"],"portalUrl":[1,"portal-url"],"marketplaceUrl":[1,"marketplace-url"],"plmUrl":[1,"plm-url"],"usageTrackingUrl":[1,"usage-tracking-url"],"showUnauthorizedModal":[4,"show-unauthorized-modal"],"postTextDelayDuration":[2,"post-text-delay-duration"],"primaryColor":[1,"primary-color"],"accentColor":[1,"accent-color"],"menuLinks":[1,"menu-links"],"keycloak":[32],"isAuth":[32],"givenUserName":[32],"silentCheckSsoRedirectUri":[32],"appList":[32],"menuLinkList":[32],"showPostLoginLoadingSpinner":[32],"avatarSvg":[32]}]]]], options);
18
18
  });
19
19
 
20
20
  //# sourceMappingURL=web-compnont.js.map
@@ -16,11 +16,13 @@ export declare class DashButtonComponent {
16
16
  postTextDelayDuration: number;
17
17
  primaryColor: string;
18
18
  accentColor: string;
19
+ menuLinks: string;
19
20
  keycloak: any;
20
21
  isAuth: boolean;
21
22
  givenUserName: string;
22
23
  silentCheckSsoRedirectUri: string;
23
24
  appList: any[];
25
+ menuLinkList: any[];
24
26
  showPostLoginLoadingSpinner: boolean;
25
27
  avatarSvg: string;
26
28
  componentWillLoad(): void;
@@ -13,6 +13,7 @@ export namespace Components {
13
13
  "clientId": string;
14
14
  "keycloakUri": string;
15
15
  "marketplaceUrl": string;
16
+ "menuLinks": string;
16
17
  "plmUrl": string;
17
18
  "portalUrl": string;
18
19
  "postTextDelayDuration": number;
@@ -44,6 +45,7 @@ declare namespace LocalJSX {
44
45
  "clientId"?: string;
45
46
  "keycloakUri"?: string;
46
47
  "marketplaceUrl"?: string;
48
+ "menuLinks"?: string;
47
49
  "plmUrl"?: string;
48
50
  "portalUrl"?: string;
49
51
  "postTextDelayDuration"?: number;
@@ -0,0 +1,10 @@
1
+ import{r as t,h as e,g as r}from"./p-db53c3e9.js";var n=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function i(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:true,get:function(){return t[r]}})}));return e}var o={};o.byteLength=h;o.toByteArray=v;o.fromByteArray=w;var a=[];var s=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var u=0,l=c.length;u<l;++u){a[u]=c[u];s[c.charCodeAt(u)]=u}s["-".charCodeAt(0)]=62;s["_".charCodeAt(0)]=63;function d(t){var e=t.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var n=r===e?0:4-r%4;return[r,n]}function h(t){var e=d(t);var r=e[0];var n=e[1];return(r+n)*3/4-n}function p(t,e,r){return(e+r)*3/4-r}function v(t){var e;var r=d(t);var n=r[0];var i=r[1];var o=new f(p(t,n,i));var a=0;var c=i>0?n-4:n;var u;for(u=0;u<c;u+=4){e=s[t.charCodeAt(u)]<<18|s[t.charCodeAt(u+1)]<<12|s[t.charCodeAt(u+2)]<<6|s[t.charCodeAt(u+3)];o[a++]=e>>16&255;o[a++]=e>>8&255;o[a++]=e&255}if(i===2){e=s[t.charCodeAt(u)]<<2|s[t.charCodeAt(u+1)]>>4;o[a++]=e&255}if(i===1){e=s[t.charCodeAt(u)]<<10|s[t.charCodeAt(u+1)]<<4|s[t.charCodeAt(u+2)]>>2;o[a++]=e>>8&255;o[a++]=e&255}return o}function g(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[t&63]}function b(t,e,r){var n;var i=[];for(var o=e;o<r;o+=3){n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255);i.push(g(n))}return i.join("")}function w(t){var e;var r=t.length;var n=r%3;var i=[];var o=16383;for(var s=0,f=r-n;s<f;s+=o){i.push(b(t,s,s+o>f?f:s+o))}if(n===1){e=t[r-1];i.push(a[e>>2]+a[e<<4&63]+"==")}else if(n===2){e=(t[r-2]<<8)+t[r-1];i.push(a[e>>10]+a[e>>4&63]+a[e<<2&63]+"=")}return i.join("")}var m={exports:{}};const x={};const k=Object.freeze({__proto__:null,default:x});const y=i(k);
2
+ /**
3
+ * [js-sha256]{@link https://github.com/emn178/js-sha256}
4
+ *
5
+ * @version 0.10.1
6
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
7
+ * @copyright Chen, Yi-Cyuan 2014-2023
8
+ * @license MIT
9
+ */(function(t){(function(){var e="input is invalid type";var r=typeof window==="object";var i=r?window:{};if(i.JS_SHA256_NO_WINDOW){r=false}var o=!r&&typeof self==="object";var a=!i.JS_SHA256_NO_NODE_JS&&typeof process==="object"&&process.versions&&process.versions.node;if(a){i=n}else if(o){i=self}var s=!i.JS_SHA256_NO_COMMON_JS&&"object"==="object"&&t.exports;var f=!i.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!=="undefined";var c="0123456789abcdef".split("");var u=[-2147483648,8388608,32768,128];var l=[24,16,8,0];var d=[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];var h=["hex","array","digest","arrayBuffer"];var p=[];if(i.JS_SHA256_NO_NODE_JS||!Array.isArray){Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}}if(f&&(i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)){ArrayBuffer.isView=function(t){return typeof t==="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer}}var v=function(t,e){return function(r){return new x(e,true).update(r)[t]()}};var g=function(t){var e=v("hex",t);if(a){e=b(e,t)}e.create=function(){return new x(t)};e.update=function(t){return e.create().update(t)};for(var r=0;r<h.length;++r){var n=h[r];e[n]=v(n,t)}return e};var b=function(t,r){var n=y;var o=y.Buffer;var a=r?"sha224":"sha256";var s;if(o.from&&!i.JS_SHA256_NO_BUFFER_FROM){s=o.from}else{s=function(t){return new o(t)}}var f=function(r){if(typeof r==="string"){return n.createHash(a).update(r,"utf8").digest("hex")}else{if(r===null||r===undefined){throw new Error(e)}else if(r.constructor===ArrayBuffer){r=new Uint8Array(r)}}if(Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===o){return n.createHash(a).update(s(r)).digest("hex")}else{return t(r)}};return f};var w=function(t,e){return function(r,n){return new k(r,e,true).update(n)[t]()}};var m=function(t){var e=w("hex",t);e.create=function(e){return new k(e,t)};e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<h.length;++r){var n=h[r];e[n]=w(n,t)}return e};function x(t,e){if(e){p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0;this.blocks=p}else{this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}if(t){this.h0=3238371032;this.h1=914150663;this.h2=812702999;this.h3=4144912697;this.h4=4290775857;this.h5=1750603025;this.h6=1694076839;this.h7=3204075428}else{this.h0=1779033703;this.h1=3144134277;this.h2=1013904242;this.h3=2773480762;this.h4=1359893119;this.h5=2600822924;this.h6=528734635;this.h7=1541459225}this.block=this.start=this.bytes=this.hBytes=0;this.finalized=this.hashed=false;this.first=true;this.is224=t}x.prototype.update=function(t){if(this.finalized){return}var r,n=typeof t;if(n!=="string"){if(n==="object"){if(t===null){throw new Error(e)}else if(f&&t.constructor===ArrayBuffer){t=new Uint8Array(t)}else if(!Array.isArray(t)){if(!f||!ArrayBuffer.isView(t)){throw new Error(e)}}}else{throw new Error(e)}r=true}var i,o=0,a,s=t.length,c=this.blocks;while(o<s){if(this.hashed){this.hashed=false;c[0]=this.block;c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0}if(r){for(a=this.start;o<s&&a<64;++o){c[a>>2]|=t[o]<<l[a++&3]}}else{for(a=this.start;o<s&&a<64;++o){i=t.charCodeAt(o);if(i<128){c[a>>2]|=i<<l[a++&3]}else if(i<2048){c[a>>2]|=(192|i>>6)<<l[a++&3];c[a>>2]|=(128|i&63)<<l[a++&3]}else if(i<55296||i>=57344){c[a>>2]|=(224|i>>12)<<l[a++&3];c[a>>2]|=(128|i>>6&63)<<l[a++&3];c[a>>2]|=(128|i&63)<<l[a++&3]}else{i=65536+((i&1023)<<10|t.charCodeAt(++o)&1023);c[a>>2]|=(240|i>>18)<<l[a++&3];c[a>>2]|=(128|i>>12&63)<<l[a++&3];c[a>>2]|=(128|i>>6&63)<<l[a++&3];c[a>>2]|=(128|i&63)<<l[a++&3]}}}this.lastByteIndex=a;this.bytes+=a-this.start;if(a>=64){this.block=c[16];this.start=a-64;this.hash();this.hashed=true}else{this.start=a}}if(this.bytes>4294967295){this.hBytes+=this.bytes/4294967296<<0;this.bytes=this.bytes%4294967296}return this};x.prototype.finalize=function(){if(this.finalized){return}this.finalized=true;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block;t[e>>2]|=u[e&3];this.block=t[16];if(e>=56){if(!this.hashed){this.hash()}t[0]=this.block;t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0}t[14]=this.hBytes<<3|this.bytes>>>29;t[15]=this.bytes<<3;this.hash()};x.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,f=this.blocks,c,u,l,h,p,v,g,b,w,m,x;for(c=16;c<64;++c){p=f[c-15];u=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;p=f[c-2];l=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;f[c]=f[c-16]+u+f[c-7]+l<<0}x=e&r;for(c=0;c<64;c+=4){if(this.first){if(this.is224){b=300032;p=f[0]-1413257819;s=p-150054599<<0;n=p+24177077<<0}else{b=704751109;p=f[0]-210244248;s=p-1521486534<<0;n=p+143694565<<0}this.first=false}else{u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10);l=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7);b=t&e;h=b^t&r^x;g=i&o^~i&a;p=s+l+g+d[c]+f[c];v=u+h;s=n+p<<0;n=p+v<<0}u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10);l=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7);w=n&t;h=w^n&e^b;g=s&i^~s&o;p=a+l+g+d[c+1]+f[c+1];v=u+h;a=r+p<<0;r=p+v<<0;u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10);l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7);m=r&n;h=m^r&t^w;g=a&s^~a&i;p=o+l+g+d[c+2]+f[c+2];v=u+h;o=e+p<<0;e=p+v<<0;u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10);l=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7);x=e&r;h=x^e&n^m;g=o&a^~o&s;p=i+l+g+d[c+3]+f[c+3];v=u+h;i=t+p<<0;t=p+v<<0;this.chromeBugWorkAround=true}this.h0=this.h0+t<<0;this.h1=this.h1+e<<0;this.h2=this.h2+r<<0;this.h3=this.h3+n<<0;this.h4=this.h4+i<<0;this.h5=this.h5+o<<0;this.h6=this.h6+a<<0;this.h7=this.h7+s<<0};x.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7;var f=c[t>>28&15]+c[t>>24&15]+c[t>>20&15]+c[t>>16&15]+c[t>>12&15]+c[t>>8&15]+c[t>>4&15]+c[t&15]+c[e>>28&15]+c[e>>24&15]+c[e>>20&15]+c[e>>16&15]+c[e>>12&15]+c[e>>8&15]+c[e>>4&15]+c[e&15]+c[r>>28&15]+c[r>>24&15]+c[r>>20&15]+c[r>>16&15]+c[r>>12&15]+c[r>>8&15]+c[r>>4&15]+c[r&15]+c[n>>28&15]+c[n>>24&15]+c[n>>20&15]+c[n>>16&15]+c[n>>12&15]+c[n>>8&15]+c[n>>4&15]+c[n&15]+c[i>>28&15]+c[i>>24&15]+c[i>>20&15]+c[i>>16&15]+c[i>>12&15]+c[i>>8&15]+c[i>>4&15]+c[i&15]+c[o>>28&15]+c[o>>24&15]+c[o>>20&15]+c[o>>16&15]+c[o>>12&15]+c[o>>8&15]+c[o>>4&15]+c[o&15]+c[a>>28&15]+c[a>>24&15]+c[a>>20&15]+c[a>>16&15]+c[a>>12&15]+c[a>>8&15]+c[a>>4&15]+c[a&15];if(!this.is224){f+=c[s>>28&15]+c[s>>24&15]+c[s>>20&15]+c[s>>16&15]+c[s>>12&15]+c[s>>8&15]+c[s>>4&15]+c[s&15]}return f};x.prototype.toString=x.prototype.hex;x.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7;var f=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255,a>>24&255,a>>16&255,a>>8&255,a&255];if(!this.is224){f.push(s>>24&255,s>>16&255,s>>8&255,s&255)}return f};x.prototype.array=x.prototype.digest;x.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32);var e=new DataView(t);e.setUint32(0,this.h0);e.setUint32(4,this.h1);e.setUint32(8,this.h2);e.setUint32(12,this.h3);e.setUint32(16,this.h4);e.setUint32(20,this.h5);e.setUint32(24,this.h6);if(!this.is224){e.setUint32(28,this.h7)}return t};function k(t,r,n){var i,o=typeof t;if(o==="string"){var a=[],s=t.length,c=0,u;for(i=0;i<s;++i){u=t.charCodeAt(i);if(u<128){a[c++]=u}else if(u<2048){a[c++]=192|u>>6;a[c++]=128|u&63}else if(u<55296||u>=57344){a[c++]=224|u>>12;a[c++]=128|u>>6&63;a[c++]=128|u&63}else{u=65536+((u&1023)<<10|t.charCodeAt(++i)&1023);a[c++]=240|u>>18;a[c++]=128|u>>12&63;a[c++]=128|u>>6&63;a[c++]=128|u&63}}t=a}else{if(o==="object"){if(t===null){throw new Error(e)}else if(f&&t.constructor===ArrayBuffer){t=new Uint8Array(t)}else if(!Array.isArray(t)){if(!f||!ArrayBuffer.isView(t)){throw new Error(e)}}}else{throw new Error(e)}}if(t.length>64){t=new x(r,true).update(t).array()}var l=[],d=[];for(i=0;i<64;++i){var h=t[i]||0;l[i]=92^h;d[i]=54^h}x.call(this,r,n);this.update(d);this.oKeyPad=l;this.inner=true;this.sharedMemory=n}k.prototype=new x;k.prototype.finalize=function(){x.prototype.finalize.call(this);if(this.inner){this.inner=false;var t=this.array();x.call(this,this.is224,this.sharedMemory);this.update(this.oKeyPad);this.update(t);x.prototype.finalize.call(this)}};var A=g();A.sha256=A;A.sha224=g(true);A.sha256.hmac=m();A.sha224.hmac=m(true);if(s){t.exports=A}else{i.sha256=A.sha256;i.sha224=A.sha224}})()})(m);const A=m.exports;class C extends Error{}C.prototype.name="InvalidTokenError";function O(t){return decodeURIComponent(atob(t).replace(/(.)/g,((t,e)=>{let r=e.charCodeAt(0).toString(16).toUpperCase();if(r.length<2){r="0"+r}return"%"+r})))}function I(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return O(e)}catch(t){return atob(e)}}function j(t,e){if(typeof t!=="string"){throw new C("Invalid token specified: must be a string")}e||(e={});const r=e.header===true?0:1;const n=t.split(".")[r];if(typeof n!=="string"){throw new C(`Invalid token specified: missing part #${r+1}`)}let i;try{i=I(n)}catch(t){throw new C(`Invalid token specified: invalid base64 for part #${r+1} (${t.message})`)}try{return JSON.parse(i)}catch(t){throw new C(`Invalid token specified: invalid json for part #${r+1} (${t.message})`)}}if(typeof Promise==="undefined"){throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.")}function S(t){if(!(this instanceof S)){throw new Error("The 'Keycloak' constructor must be invoked with 'new'.")}var e=this;var r;var n=[];var i;var a={enable:true,callbackList:[],interval:5};var s=document.getElementsByTagName("script");for(var f=0;f<s.length;f++){if((s[f].src.indexOf("keycloak.js")!==-1||s[f].src.indexOf("keycloak.min.js")!==-1)&&s[f].src.indexOf("version=")!==-1){e.iframeVersion=s[f].src.substring(s[f].src.indexOf("version=")+8).split("&")[0]}}var c=true;var u=J(console.info);var l=J(console.warn);e.init=function(t){if(e.didInitialize){throw new Error("A 'Keycloak' instance can only be initialized once.")}e.didInitialize=true;e.authenticated=false;i=Y();var n=["default","cordova","cordova-native"];if(t&&n.indexOf(t.adapter)>-1){r=E(t.adapter)}else if(t&&typeof t.adapter==="object"){r=t.adapter}else{if(window.Cordova||window.cordova){r=E("cordova")}else{r=E()}}if(t){if(typeof t.useNonce!=="undefined"){c=t.useNonce}if(typeof t.checkLoginIframe!=="undefined"){a.enable=t.checkLoginIframe}if(t.checkLoginIframeInterval){a.interval=t.checkLoginIframeInterval}if(t.onLoad==="login-required"){e.loginRequired=true}if(t.responseMode){if(t.responseMode==="query"||t.responseMode==="fragment"){e.responseMode=t.responseMode}else{throw"Invalid value for responseMode"}}if(t.flow){switch(t.flow){case"standard":e.responseType="code";break;case"implicit":e.responseType="id_token token";break;case"hybrid":e.responseType="code id_token token";break;default:throw"Invalid value for flow"}e.flow=t.flow}if(t.timeSkew!=null){e.timeSkew=t.timeSkew}if(t.redirectUri){e.redirectUri=t.redirectUri}if(t.silentCheckSsoRedirectUri){e.silentCheckSsoRedirectUri=t.silentCheckSsoRedirectUri}if(typeof t.silentCheckSsoFallback==="boolean"){e.silentCheckSsoFallback=t.silentCheckSsoFallback}else{e.silentCheckSsoFallback=true}if(t.pkceMethod){if(t.pkceMethod!=="S256"){throw"Invalid value for pkceMethod"}e.pkceMethod=t.pkceMethod}if(typeof t.enableLogging==="boolean"){e.enableLogging=t.enableLogging}else{e.enableLogging=false}if(typeof t.scope==="string"){e.scope=t.scope}if(typeof t.acrValues==="string"){e.acrValues=t.acrValues}if(typeof t.messageReceiveTimeout==="number"&&t.messageReceiveTimeout>0){e.messageReceiveTimeout=t.messageReceiveTimeout}else{e.messageReceiveTimeout=1e4}}if(!e.responseMode){e.responseMode="fragment"}if(!e.responseType){e.responseType="code";e.flow="standard"}var o=z();var s=z();s.promise.then((function(){e.onReady&&e.onReady(e.authenticated);o.setSuccess(e.authenticated)})).catch((function(t){o.setError(t)}));var f=x();function u(){var r=function(r){if(!r){i.prompt="none"}if(t&&t.locale){i.locale=t.locale}e.login(i).then((function(){s.setSuccess()})).catch((function(t){s.setError(t)}))};var n=function(){var t=document.createElement("iframe");var r=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});t.setAttribute("src",r);t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin");t.setAttribute("title","keycloak-silent-check-sso");t.style.display="none";document.body.appendChild(t);var n=function(e){if(e.origin!==window.location.origin||t.contentWindow!==e.source){return}var r=O(e.data);m(r,s);document.body.removeChild(t);window.removeEventListener("message",n)};window.addEventListener("message",n)};var i={};switch(t.onLoad){case"check-sso":if(a.enable){N().then((function(){U().then((function(t){if(!t){e.silentCheckSsoRedirectUri?n():r(false)}else{s.setSuccess()}})).catch((function(t){s.setError(t)}))}))}else{e.silentCheckSsoRedirectUri?n():r(false)}break;case"login-required":r(true);break;default:throw"Invalid value for onLoad"}}function l(){var r=O(window.location.href);if(r){window.history.replaceState(window.history.state,null,r.newUrl)}if(r&&r.valid){return N().then((function(){m(r,s)})).catch((function(t){s.setError(t)}))}else if(t){if(t.token&&t.refreshToken){y(t.token,t.refreshToken,t.idToken);if(a.enable){N().then((function(){U().then((function(t){if(t){e.onAuthSuccess&&e.onAuthSuccess();s.setSuccess();L()}else{s.setSuccess()}})).catch((function(t){s.setError(t)}))}))}else{e.updateToken(-1).then((function(){e.onAuthSuccess&&e.onAuthSuccess();s.setSuccess()})).catch((function(r){e.onAuthError&&e.onAuthError();if(t.onLoad){u()}else{s.setError(r)}}))}}else if(t.onLoad){u()}else{s.setSuccess()}}else{s.setSuccess()}}function d(){var t=z();var e=function(){if(document.readyState==="interactive"||document.readyState==="complete"){document.removeEventListener("readystatechange",e);t.setSuccess()}};document.addEventListener("readystatechange",e);e();return t.promise}f.then((function(){d().then(M).then(l).catch((function(t){o.setError(t)}))}));f.catch((function(t){o.setError(t)}));return o.promise};e.login=function(t){return r.login(t)};function d(t){var e=null;var r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array){e=new Uint8Array(t);r.getRandomValues(e);return e}e=new Array(t);for(var n=0;n<e.length;n++){e[n]=Math.floor(256*Math.random())}return e}function h(t){return p(t,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function p(t,e){var r=d(t);var n=new Array(t);for(var i=0;i<t;i++){n[i]=e.charCodeAt(r[i]%e.length)}return String.fromCharCode.apply(null,n)}function v(t,e){switch(t){case"S256":var r=new Uint8Array(A.arrayBuffer(e));var n=o.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return n;default:throw"Invalid value for pkceMethod"}}function g(t){var e={id_token:{acr:t}};return JSON.stringify(e)}e.createLoginUrl=function(t){var n=C();var o=C();var a=r.redirectUri(t);var s={state:n,nonce:o,redirectUri:encodeURIComponent(a)};if(t&&t.prompt){s.prompt=t.prompt}var f;if(t&&t.action=="register"){f=e.endpoints.register()}else{f=e.endpoints.authorize()}var u=t&&t.scope||e.scope;if(!u){u="openid"}else if(u.indexOf("openid")===-1){u="openid "+u}var l=f+"?client_id="+encodeURIComponent(e.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(n)+"&response_mode="+encodeURIComponent(e.responseMode)+"&response_type="+encodeURIComponent(e.responseType)+"&scope="+encodeURIComponent(u);if(c){l=l+"&nonce="+encodeURIComponent(o)}if(t&&t.prompt){l+="&prompt="+encodeURIComponent(t.prompt)}if(t&&t.maxAge){l+="&max_age="+encodeURIComponent(t.maxAge)}if(t&&t.loginHint){l+="&login_hint="+encodeURIComponent(t.loginHint)}if(t&&t.idpHint){l+="&kc_idp_hint="+encodeURIComponent(t.idpHint)}if(t&&t.action&&t.action!="register"){l+="&kc_action="+encodeURIComponent(t.action)}if(t&&t.locale){l+="&ui_locales="+encodeURIComponent(t.locale)}if(t&&t.acr){var d=g(t.acr);l+="&claims="+encodeURIComponent(d)}if(t&&t.acrValues||e.acrValues){l+="&acr_values="+encodeURIComponent(t.acrValues||e.acrValues)}if(e.pkceMethod){var p=h(96);s.pkceCodeVerifier=p;var b=v(e.pkceMethod,p);l+="&code_challenge="+b;l+="&code_challenge_method="+e.pkceMethod}i.add(s);return l};e.logout=function(t){return r.logout(t)};e.createLogoutUrl=function(t){var n=e.endpoints.logout()+"?client_id="+encodeURIComponent(e.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(r.redirectUri(t,false));if(e.idToken){n+="&id_token_hint="+encodeURIComponent(e.idToken)}return n};e.register=function(t){return r.register(t)};e.createRegisterUrl=function(t){if(!t){t={}}t.action="register";return e.createLoginUrl(t)};e.createAccountUrl=function(t){var n=b();var i=undefined;if(typeof n!=="undefined"){i=n+"/account"+"?referrer="+encodeURIComponent(e.clientId)+"&referrer_uri="+encodeURIComponent(r.redirectUri(t))}return i};e.accountManagement=function(){return r.accountManagement()};e.hasRealmRole=function(t){var r=e.realmAccess;return!!r&&r.roles.indexOf(t)>=0};e.hasResourceRole=function(t,r){if(!e.resourceAccess){return false}var n=e.resourceAccess[r||e.clientId];return!!n&&n.roles.indexOf(t)>=0};e.loadUserProfile=function(){var t=b()+"/account";var r=new XMLHttpRequest;r.open("GET",t,true);r.setRequestHeader("Accept","application/json");r.setRequestHeader("Authorization","bearer "+e.token);var n=z();r.onreadystatechange=function(){if(r.readyState==4){if(r.status==200){e.profile=JSON.parse(r.responseText);n.setSuccess(e.profile)}else{n.setError()}}};r.send();return n.promise};e.loadUserInfo=function(){var t=e.endpoints.userinfo();var r=new XMLHttpRequest;r.open("GET",t,true);r.setRequestHeader("Accept","application/json");r.setRequestHeader("Authorization","bearer "+e.token);var n=z();r.onreadystatechange=function(){if(r.readyState==4){if(r.status==200){e.userInfo=JSON.parse(r.responseText);n.setSuccess(e.userInfo)}else{n.setError()}}};r.send();return n.promise};e.isTokenExpired=function(t){if(!e.tokenParsed||!e.refreshToken&&e.flow!="implicit"){throw"Not authenticated"}if(e.timeSkew==null){u("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set");return true}var r=e.tokenParsed["exp"]-Math.ceil((new Date).getTime()/1e3)+e.timeSkew;if(t){if(isNaN(t)){throw"Invalid minValidity"}r-=t}return r<0};e.updateToken=function(t){var r=z();if(!e.refreshToken){r.setError();return r.promise}t=t||5;var i=function(){var i=false;if(t==-1){i=true;u("[KEYCLOAK] Refreshing token: forced refresh")}else if(!e.tokenParsed||e.isTokenExpired(t)){i=true;u("[KEYCLOAK] Refreshing token: token expired")}if(!i){r.setSuccess(false)}else{var o="grant_type=refresh_token&"+"refresh_token="+e.refreshToken;var a=e.endpoints.token();n.push(r);if(n.length==1){var s=new XMLHttpRequest;s.open("POST",a,true);s.setRequestHeader("Content-type","application/x-www-form-urlencoded");s.withCredentials=true;o+="&client_id="+encodeURIComponent(e.clientId);var f=(new Date).getTime();s.onreadystatechange=function(){if(s.readyState==4){if(s.status==200){u("[KEYCLOAK] Token refreshed");f=(f+(new Date).getTime())/2;var t=JSON.parse(s.responseText);y(t["access_token"],t["refresh_token"],t["id_token"],f);e.onAuthRefreshSuccess&&e.onAuthRefreshSuccess();for(var r=n.pop();r!=null;r=n.pop()){r.setSuccess(true)}}else{l("[KEYCLOAK] Failed to refresh token");if(s.status==400){e.clearToken()}e.onAuthRefreshError&&e.onAuthRefreshError();for(var r=n.pop();r!=null;r=n.pop()){r.setError(true)}}}};s.send(o)}}};if(a.enable){var o=U();o.then((function(){i()})).catch((function(t){r.setError(t)}))}else{i()}return r.promise};e.clearToken=function(){if(e.token){y(null,null,null);e.onAuthLogout&&e.onAuthLogout();if(e.loginRequired){e.login()}}};function b(){if(typeof e.authServerUrl!=="undefined"){if(e.authServerUrl.charAt(e.authServerUrl.length-1)=="/"){return e.authServerUrl+"realms/"+encodeURIComponent(e.realm)}else{return e.authServerUrl+"/realms/"+encodeURIComponent(e.realm)}}else{return undefined}}function w(){if(!window.location.origin){return window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}else{return window.location.origin}}function m(t,r){var n=t.code;var i=t.error;var o=t.prompt;var a=(new Date).getTime();if(t["kc_action_status"]){e.onActionUpdate&&e.onActionUpdate(t["kc_action_status"])}if(i){if(o!="none"){var s={error:i,error_description:t.error_description};e.onAuthError&&e.onAuthError(s);r&&r.setError(s)}else{r&&r.setSuccess()}return}else if(e.flow!="standard"&&(t.access_token||t.id_token)){h(t.access_token,null,t.id_token,true)}if(e.flow!="implicit"&&n){var f="code="+n+"&grant_type=authorization_code";var l=e.endpoints.token();var d=new XMLHttpRequest;d.open("POST",l,true);d.setRequestHeader("Content-type","application/x-www-form-urlencoded");f+="&client_id="+encodeURIComponent(e.clientId);f+="&redirect_uri="+t.redirectUri;if(t.pkceCodeVerifier){f+="&code_verifier="+t.pkceCodeVerifier}d.withCredentials=true;d.onreadystatechange=function(){if(d.readyState==4){if(d.status==200){var t=JSON.parse(d.responseText);h(t["access_token"],t["refresh_token"],t["id_token"],e.flow==="standard");L()}else{e.onAuthError&&e.onAuthError();r&&r.setError()}}};d.send(f)}function h(n,i,o,s){a=(a+(new Date).getTime())/2;y(n,i,o,a);if(c&&(e.tokenParsed&&e.tokenParsed.nonce!=t.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=t.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=t.storedNonce)){u("[KEYCLOAK] Invalid nonce, clearing token");e.clearToken();r&&r.setError()}else{if(s){e.onAuthSuccess&&e.onAuthSuccess();r&&r.setSuccess()}}}}function x(r){var n=z();var i;if(!t){i="keycloak.json"}else if(typeof t==="string"){i=t}function o(t){if(!t){e.endpoints={authorize:function(){return b()+"/protocol/openid-connect/auth"},token:function(){return b()+"/protocol/openid-connect/token"},logout:function(){return b()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var t=b()+"/protocol/openid-connect/login-status-iframe.html";if(e.iframeVersion){t=t+"?version="+e.iframeVersion}return t},thirdPartyCookiesIframe:function(){var t=b()+"/protocol/openid-connect/3p-cookies/step1.html";if(e.iframeVersion){t=t+"?version="+e.iframeVersion}return t},register:function(){return b()+"/protocol/openid-connect/registrations"},userinfo:function(){return b()+"/protocol/openid-connect/userinfo"}}}else{e.endpoints={authorize:function(){return t.authorization_endpoint},token:function(){return t.token_endpoint},logout:function(){if(!t.end_session_endpoint){throw"Not supported by the OIDC server"}return t.end_session_endpoint},checkSessionIframe:function(){if(!t.check_session_iframe){throw"Not supported by the OIDC server"}return t.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!t.userinfo_endpoint){throw"Not supported by the OIDC server"}return t.userinfo_endpoint}}}}if(i){var a=new XMLHttpRequest;a.open("GET",i,true);a.setRequestHeader("Accept","application/json");a.onreadystatechange=function(){if(a.readyState==4){if(a.status==200||k(a)){var t=JSON.parse(a.responseText);e.authServerUrl=t["auth-server-url"];e.realm=t["realm"];e.clientId=t["resource"];o(null);n.setSuccess()}else{n.setError()}}};a.send()}else{if(!t.clientId){throw"clientId missing"}e.clientId=t.clientId;var s=t["oidcProvider"];if(!s){if(!t["url"]){var f=document.getElementsByTagName("script");for(var c=0;c<f.length;c++){if(f[c].src.match(/.*keycloak\.js/)){t.url=f[c].src.substr(0,f[c].src.indexOf("/js/keycloak.js"));break}}}if(!t.realm){throw"realm missing"}e.authServerUrl=t.url;e.realm=t.realm;o(null);n.setSuccess()}else{if(typeof s==="string"){var u;if(s.charAt(s.length-1)=="/"){u=s+".well-known/openid-configuration"}else{u=s+"/.well-known/openid-configuration"}var a=new XMLHttpRequest;a.open("GET",u,true);a.setRequestHeader("Accept","application/json");a.onreadystatechange=function(){if(a.readyState==4){if(a.status==200||k(a)){var t=JSON.parse(a.responseText);o(t);n.setSuccess()}else{n.setError()}}};a.send()}else{o(s);n.setSuccess()}}}return n.promise}function k(t){return t.status==0&&t.responseText&&t.responseURL.startsWith("file:")}function y(t,r,n,i){if(e.tokenTimeoutHandle){clearTimeout(e.tokenTimeoutHandle);e.tokenTimeoutHandle=null}if(r){e.refreshToken=r;e.refreshTokenParsed=j(r)}else{delete e.refreshToken;delete e.refreshTokenParsed}if(n){e.idToken=n;e.idTokenParsed=j(n)}else{delete e.idToken;delete e.idTokenParsed}if(t){e.token=t;e.tokenParsed=j(t);e.sessionId=e.tokenParsed.session_state;e.authenticated=true;e.subject=e.tokenParsed.sub;e.realmAccess=e.tokenParsed.realm_access;e.resourceAccess=e.tokenParsed.resource_access;if(i){e.timeSkew=Math.floor(i/1e3)-e.tokenParsed.iat}if(e.timeSkew!=null){u("[KEYCLOAK] Estimated time difference between browser and server is "+e.timeSkew+" seconds");if(e.onTokenExpired){var o=(e.tokenParsed["exp"]-(new Date).getTime()/1e3+e.timeSkew)*1e3;u("[KEYCLOAK] Token expires in "+Math.round(o/1e3)+" s");if(o<=0){e.onTokenExpired()}else{e.tokenTimeoutHandle=setTimeout(e.onTokenExpired,o)}}}}else{delete e.token;delete e.tokenParsed;delete e.subject;delete e.realmAccess;delete e.resourceAccess;e.authenticated=false}}function C(){var t="0123456789abcdef";var e=p(36,t).split("");e[14]="4";e[19]=t.substr(e[19]&3|8,1);e[8]=e[13]=e[18]=e[23]="-";var r=e.join("");return r}function O(t){var e=I(t);if(!e){return}var r=i.get(e.state);if(r){e.valid=true;e.redirectUri=r.redirectUri;e.storedNonce=r.nonce;e.prompt=r.prompt;e.pkceCodeVerifier=r.pkceCodeVerifier}return e}function I(t){var r;switch(e.flow){case"standard":r=["code","state","session_state","kc_action_status","iss"];break;case"implicit":r=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":r=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}r.push("error");r.push("error_description");r.push("error_uri");var n=t.indexOf("?");var i=t.indexOf("#");var o;var a;if(e.responseMode==="query"&&n!==-1){o=t.substring(0,n);a=_(t.substring(n+1,i!==-1?i:t.length),r);if(a.paramsString!==""){o+="?"+a.paramsString}if(i!==-1){o+=t.substring(i)}}else if(e.responseMode==="fragment"&&i!==-1){o=t.substring(0,i);a=_(t.substring(i+1),r);if(a.paramsString!==""){o+="#"+a.paramsString}}if(a&&a.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((a.oauthParams.code||a.oauthParams.error)&&a.oauthParams.state){a.oauthParams.newUrl=o;return a.oauthParams}}else if(e.flow==="implicit"){if((a.oauthParams.access_token||a.oauthParams.error)&&a.oauthParams.state){a.oauthParams.newUrl=o;return a.oauthParams}}}}function _(t,e){var r=t.split("&");var n={paramsString:"",oauthParams:{}};for(var i=0;i<r.length;i++){var o=r[i].indexOf("=");var a=r[i].slice(0,o);if(e.indexOf(a)!==-1){n.oauthParams[a]=r[i].slice(o+1)}else{if(n.paramsString!==""){n.paramsString+="&"}n.paramsString+=r[i]}}return n}function z(){var t={setSuccess:function(e){t.resolve(e)},setError:function(e){t.reject(e)}};t.promise=new Promise((function(e,r){t.resolve=e;t.reject=r}));return t}function R(t,e,r){var n=null;var i=new Promise((function(t,i){n=setTimeout((function(){i({error:r||"Promise is not settled within timeout of "+e+"ms"})}),e)}));return Promise.race([t,i]).finally((function(){clearTimeout(n)}))}function N(){var t=z();if(!a.enable){t.setSuccess();return t.promise}if(a.iframe){t.setSuccess();return t.promise}var r=document.createElement("iframe");a.iframe=r;r.onload=function(){var r=e.endpoints.authorize();if(r.charAt(0)==="/"){a.iframeOrigin=w()}else{a.iframeOrigin=r.substring(0,r.indexOf("/",8))}t.setSuccess()};var n=e.endpoints.checkSessionIframe();r.setAttribute("src",n);r.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin");r.setAttribute("title","keycloak-session-iframe");r.style.display="none";document.body.appendChild(r);var i=function(t){if(t.origin!==a.iframeOrigin||a.iframe.contentWindow!==t.source){return}if(!(t.data=="unchanged"||t.data=="changed"||t.data=="error")){return}if(t.data!="unchanged"){e.clearToken()}var r=a.callbackList.splice(0,a.callbackList.length);for(var n=r.length-1;n>=0;--n){var i=r[n];if(t.data=="error"){i.setError()}else{i.setSuccess(t.data=="unchanged")}}};window.addEventListener("message",i,false);return t.promise}function L(){if(a.enable){if(e.token){setTimeout((function(){U().then((function(t){if(t){L()}}))}),a.interval*1e3)}}}function U(){var t=z();if(a.iframe&&a.iframeOrigin){var r=e.clientId+" "+(e.sessionId?e.sessionId:"");a.callbackList.push(t);var n=a.iframeOrigin;if(a.callbackList.length==1){a.iframe.contentWindow.postMessage(r,n)}}else{t.setSuccess()}return t.promise}function M(){var t=z();if(a.enable||e.silentCheckSsoRedirectUri){var r=document.createElement("iframe");r.setAttribute("src",e.endpoints.thirdPartyCookiesIframe());r.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin");r.setAttribute("title","keycloak-3p-check-iframe");r.style.display="none";document.body.appendChild(r);var n=function(i){if(r.contentWindow!==i.source){return}if(i.data!=="supported"&&i.data!=="unsupported"){return}else if(i.data==="unsupported"){l("[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\n"+"For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers");a.enable=false;if(e.silentCheckSsoFallback){e.silentCheckSsoRedirectUri=false}}document.body.removeChild(r);window.removeEventListener("message",n);t.setSuccess()};window.addEventListener("message",n,false)}else{t.setSuccess()}return R(t.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function E(t){if(!t||t=="default"){return{login:function(t){window.location.assign(e.createLoginUrl(t));return z().promise},logout:function(t){window.location.replace(e.createLogoutUrl(t));return z().promise},register:function(t){window.location.assign(e.createRegisterUrl(t));return z().promise},accountManagement:function(){var t=e.createAccountUrl();if(typeof t!=="undefined"){window.location.href=t}else{throw"Not supported by the OIDC server"}return z().promise},redirectUri:function(t,r){if(t&&t.redirectUri){return t.redirectUri}else if(e.redirectUri){return e.redirectUri}else{return location.href}}}}if(t=="cordova"){a.enable=false;var r=function(t,e,r){if(window.cordova&&window.cordova.InAppBrowser){return window.cordova.InAppBrowser.open(t,e,r)}else{return window.open(t,e,r)}};var n=function(t){if(t&&t.cordovaOptions){return Object.keys(t.cordovaOptions).reduce((function(e,r){e[r]=t.cordovaOptions[r];return e}),{})}else{return{}}};var i=function(t){return Object.keys(t).reduce((function(e,r){e.push(r+"="+t[r]);return e}),[]).join(",")};var o=function(t){var e=n(t);e.location="no";if(t&&t.prompt=="none"){e.hidden="yes"}return i(e)};var s=function(){return e.redirectUri||"http://localhost"};return{login:function(t){var n=z();var i=o(t);var a=e.createLoginUrl(t);var f=r(a,"_blank",i);var c=false;var u=false;var l=function(){u=true;f.close()};f.addEventListener("loadstart",(function(t){if(t.url.indexOf(s())==0){var e=O(t.url);m(e,n);l();c=true}}));f.addEventListener("loaderror",(function(t){if(!c){if(t.url.indexOf(s())==0){var e=O(t.url);m(e,n);l();c=true}else{n.setError();l()}}}));f.addEventListener("exit",(function(t){if(!u){n.setError({reason:"closed_by_user"})}}));return n.promise},logout:function(t){var n=z();var i=e.createLogoutUrl(t);var o=r(i,"_blank","location=no,hidden=yes,clearcache=yes");var a;o.addEventListener("loadstart",(function(t){if(t.url.indexOf(s())==0){o.close()}}));o.addEventListener("loaderror",(function(t){if(t.url.indexOf(s())==0){o.close()}else{a=true;o.close()}}));o.addEventListener("exit",(function(t){if(a){n.setError()}else{e.clearToken();n.setSuccess()}}));return n.promise},register:function(t){var n=z();var i=e.createRegisterUrl();var a=o(t);var f=r(i,"_blank",a);f.addEventListener("loadstart",(function(t){if(t.url.indexOf(s())==0){f.close();var e=O(t.url);m(e,n)}}));return n.promise},accountManagement:function(){var t=e.createAccountUrl();if(typeof t!=="undefined"){var n=r(t,"_blank","location=no");n.addEventListener("loadstart",(function(t){if(t.url.indexOf(s())==0){n.close()}}))}else{throw"Not supported by the OIDC server"}},redirectUri:function(t){return s()}}}if(t=="cordova-native"){a.enable=false;return{login:function(t){var r=z();var n=e.createLoginUrl(t);universalLinks.subscribe("keycloak",(function(t){universalLinks.unsubscribe("keycloak");window.cordova.plugins.browsertab.close();var e=O(t.url);m(e,r)}));window.cordova.plugins.browsertab.openUrl(n);return r.promise},logout:function(t){var r=z();var n=e.createLogoutUrl(t);universalLinks.subscribe("keycloak",(function(t){universalLinks.unsubscribe("keycloak");window.cordova.plugins.browsertab.close();e.clearToken();r.setSuccess()}));window.cordova.plugins.browsertab.openUrl(n);return r.promise},register:function(t){var r=z();var n=e.createRegisterUrl(t);universalLinks.subscribe("keycloak",(function(t){universalLinks.unsubscribe("keycloak");window.cordova.plugins.browsertab.close();var e=O(t.url);m(e,r)}));window.cordova.plugins.browsertab.openUrl(n);return r.promise},accountManagement:function(){var t=e.createAccountUrl();if(typeof t!=="undefined"){window.cordova.plugins.browsertab.openUrl(t)}else{throw"Not supported by the OIDC server"}},redirectUri:function(t){if(t&&t.redirectUri){return t.redirectUri}else if(e.redirectUri){return e.redirectUri}else{return"http://localhost"}}}}throw"invalid adapter type: "+t}var T=function(){if(!(this instanceof T)){return new T}localStorage.setItem("kc-test","test");localStorage.removeItem("kc-test");var t=this;function e(){var t=(new Date).getTime();for(var e=0;e<localStorage.length;e++){var r=localStorage.key(e);if(r&&r.indexOf("kc-callback-")==0){var n=localStorage.getItem(r);if(n){try{var i=JSON.parse(n).expires;if(!i||i<t){localStorage.removeItem(r)}}catch(t){localStorage.removeItem(r)}}}}}t.get=function(t){if(!t){return}var r="kc-callback-"+t;var n=localStorage.getItem(r);if(n){localStorage.removeItem(r);n=JSON.parse(n)}e();return n};t.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+60*60*1e3;localStorage.setItem(r,JSON.stringify(t))}};var K=function(){if(!(this instanceof K)){return new K}var t=this;t.get=function(t){if(!t){return}var i=r("kc-callback-"+t);n("kc-callback-"+t,"",e(-100));if(i){return JSON.parse(i)}};t.add=function(t){n("kc-callback-"+t.state,JSON.stringify(t),e(60))};t.removeItem=function(t){n(t,"",e(-100))};var e=function(t){var e=new Date;e.setTime(e.getTime()+t*60*1e3);return e};var r=function(t){var e=t+"=";var r=document.cookie.split(";");for(var n=0;n<r.length;n++){var i=r[n];while(i.charAt(0)==" "){i=i.substring(1)}if(i.indexOf(e)==0){return i.substring(e.length,i.length)}}return""};var n=function(t,e,r){var n=t+"="+e+"; "+"expires="+r.toUTCString()+"; ";document.cookie=n}};function Y(){try{return new T}catch(t){}return new K}function J(t){return function(){if(e.enableLogging){t.apply(console,Array.prototype.slice.call(arguments))}}}}function _(t,e,r){return parseInt(t.substr(e,r),16)}function z(t){t|=0;return t<0?"00":t<16?"0"+t.toString(16):t<256?t.toString(16):"ff"}function R(t,e,r){r=r<0?r+6:r>6?r-6:r;return z(255*(r<1?t+(e-t)*r:r<3?e:r<4?t+(e-t)*(4-r):t))}function N(t){if(/^#[0-9a-f]{3,8}$/i.test(t)){var e;var r=t.length;if(r<6){var n=t[1],i=t[2],o=t[3],a=t[4]||"";e="#"+n+n+i+i+o+o+a+a}if(r==7||r>8){e=t}return e}}function L(t){var e=_(t,7,2);var r;if(isNaN(e)){r=t}else{var n=_(t,1,2),i=_(t,3,2),o=_(t,5,2);r="rgba("+n+","+i+","+o+","+(e/255).toFixed(2)+")"}return r}function U(t,e,r){var n;if(e==0){var i=z(r*255);n=i+i+i}else{var o=r<=.5?r*(e+1):r+e-r*e,a=r*2-o;n=R(a,o,t*6+2)+R(a,o,t*6)+R(a,o,t*6-2)}return"#"+n}function M(t,e,r){var n=[.55,.5,.5,.46,.6,.55,.55],i=n[t*6+.5|0];r=r<.5?r*i*2:i+(r-.5)*(1-i)*2;return U(t,e,r)}var E=typeof window!=="undefined"?window:typeof self!=="undefined"?self:typeof n!=="undefined"?n:{};var T={W:"jdenticon_config",n:"config"};var K={};function Y(t){K=t}function J(t){if(arguments.length){K[T.n]=t}return K[T.n]}function W(t,e){var r=typeof t=="object"&&t||K[T.n]||E[T.W]||{},n=r["lightness"]||{},i=r["saturation"]||{},o="color"in i?i["color"]:i,a=i["grayscale"],s=r["backColor"],f=r["padding"];function c(t,e){var r=n[t];if(!(r&&r.length>1)){r=e}return function(t){t=r[0]+t*(r[1]-r[0]);return t<0?0:t>1?1:t}}function u(t){var e=r["hues"];var n;if(e&&e.length>0){n=e[0|.999*t*e.length]}return typeof n=="number"?(n/360%1+1)%1:t}return{X:u,o:typeof o=="number"?o:.5,F:typeof a=="number"?a:0,p:c("color",[.4,.8]),G:c("grayscale",[.3,.9]),H:N(s),Y:typeof t=="number"?t:typeof f=="number"?f:e}}function P(t,e){this.x=t;this.y=e}function B(t,e,r,n){this.q=t;this.t=e;this.I=r;this.Z=n}B.prototype.J=function t(e,r,n,i){var o=this.q+this.I,a=this.t+this.I,s=this.Z;return s===1?new P(o-r-(i||0),this.t+e):s===2?new P(o-e-(n||0),a-r-(i||0)):s===3?new P(this.q+r,a-e-(n||0)):new P(this.q+e,this.t+r)};var D=new B(0,0,0,0);function G(t){this.K=t;this.u=D}var H=G.prototype;H.g=function t(e,r){var n=this;var i=r?-2:2,o=[];for(var a=r?e.length-2:0;a<e.length&&a>=0;a+=i){o.push(n.u.J(e[a],e[a+1]))}this.K.g(o)};H.h=function t(e,r,n,i){var o=this.u.J(e,r,n,n);this.K.h(o,n,i)};H.i=function t(e,r,n,i,o){this.g([e,r,e+n,r,e+n,r+i,e,r+i],o)};H.j=function t(e,r,n,i,o,a){var s=[e+n,r,e+n,r+i,e,r+i,e,r];s.splice((o||0)%4*2,2);this.g(s,a)};H.L=function t(e,r,n,i,o){this.g([e+n/2,r,e+n,r+i/2,e+n/2,r+i,e,r+i/2],o)};function F(t,e,r,n){t=t%14;var i,o,a,s,f,c;!t?(i=r*.42,e.g([0,0,r,0,r,r-i*2,r-i,r,0,r])):t==1?(a=0|r*.5,s=0|r*.8,e.j(r-a,0,a,s,2)):t==2?(a=0|r/3,e.i(a,a,r-a,r-a)):t==3?(f=r*.1,c=r<6?1:r<8?2:0|r*.25,f=f>1?0|f:f>.5?1:f,e.i(c,c,r-f-c,r-f-c)):t==4?(o=0|r*.15,a=0|r*.5,e.h(r-a-o,r-a-o,a)):t==5?(f=r*.1,c=f*4,c>3&&(c=0|c),e.i(0,0,r,r),e.g([c,c,r-f,c,c+(r-c-f)/2,r-f],true)):t==6?e.g([0,0,r,0,r,r*.7,r*.4,r*.4,r*.7,r,0,r]):t==7?e.j(r/2,r/2,r/2,r/2,3):t==8?(e.i(0,0,r,r/2),e.i(0,r/2,r/2,r/2),e.j(r/2,r/2,r/2,r/2,1)):t==9?(f=r*.14,c=r<4?1:r<6?2:0|r*.35,f=r<8?f:0|f,e.i(0,0,r,r),e.i(c,c,r-c-f,r-c-f,true)):t==10?(f=r*.12,c=f*3,e.i(0,0,r,r),e.h(c,c,r-f-c,true)):t==11?e.j(r/2,r/2,r/2,r/2,3):t==12?(o=r*.25,e.i(0,0,r,r),e.L(o,o,r-o,r-o,true)):!n&&(o=r*.4,a=r*1.2,e.h(o,o,a))}function q(t,e,r){t=t%4;var n;!t?e.j(0,0,r,r,0):t==1?e.j(0,r/2,r,r/2,0):t==2?e.L(0,0,r,r):(n=r/6,e.h(n,n,r-2*n))}function Z(t,e){t=e.X(t);return[M(t,e.F,e.G(0)),M(t,e.o,e.p(.5)),M(t,e.F,e.G(1)),M(t,e.o,e.p(1)),M(t,e.o,e.p(0))]}function X(t,e,r){var n=W(r,.08);if(n.H){t.m(n.H)}var i=t.k;var o=.5+i*n.Y|0;i-=o*2;var a=new G(t);var s=0|i/4;var f=0|o+i/2-s*2;var c=0|o+i/2-s*2;function u(r,n,i,o,u){var l=_(e,i,1);var p=o?_(e,o,1):0;t.M(d[h[r]]);for(var v=0;v<u.length;v++){a.u=new B(f+u[v][0]*s,c+u[v][1]*s,s,p++%4);n(l,a,s,v)}t.N()}var l=_(e,-7)/268435455,d=Z(l,n),h=[];var p;function v(t){if(t.indexOf(p)>=0){for(var e=0;e<t.length;e++){if(h.indexOf(t[e])>=0){return true}}}}for(var g=0;g<3;g++){p=_(e,8+g,1)%d.length;if(v([0,4])||v([2,3])){p=1}h.push(p)}u(0,q,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]);u(1,q,4,5,[[0,0],[3,0],[3,3],[0,3]]);u(2,F,1,null,[[1,1],[2,1],[2,2],[1,2]]);t.finish()}function Q(t){var e=40;var r=16;var n=0,i=0,o=encodeURI(t)+"%80",a=[],s,f=[],c=1732584193,u=4023233417,l=~c,d=~u,h=3285377520,p=[c,u,l,d,h],v=0,g="";function b(t,e){return t<<e|t>>>32-e}for(;n<o.length;i++){a[i>>2]=a[i>>2]|(o[n]=="%"?parseInt(o.substring(n+1,n+=3),16):o.charCodeAt(n++))<<(3-(i&3))*8}s=((i+7>>6)+1)*r;a[s-1]=i*8-8;for(;v<s;v+=r){for(n=0;n<80;n++){i=b(c,5)+h+(n<20?(u&l^~u&d)+1518500249:n<40?(u^l^d)+1859775393:n<60?(u&l^u&d^l&d)+2400959708:(u^l^d)+3395469782)+(f[n]=n<r?a[v+n]|0:b(f[n-3]^f[n-8]^f[n-14]^f[n-16],1));h=d;d=l;l=b(u,30);u=c;c=i}p[0]=c=p[0]+c|0;p[1]=u=p[1]+u|0;p[2]=l=p[2]+l|0;p[3]=d=p[3]+d|0;p[4]=h=p[4]+h|0}for(n=0;n<e;n++){g+=(p[n>>3]>>>(7-(n&7))*4&15).toString(16)}return g}function V(t){return/^[0-9a-f]{11,}$/i.test(t)&&t}function $(t){return Q(t==null?"":""+t)}function tt(t,e){var r=t.canvas;var n=r.width;var i=r.height;t.save();if(!e){e=Math.min(n,i);t.translate((n-e)/2|0,(i-e)/2|0)}this.l=t;this.k=e;t.clearRect(0,0,e,e)}var et=tt.prototype;et.m=function t(e){var r=this.l;var n=this.k;r.fillStyle=L(e);r.fillRect(0,0,n,n)};et.M=function t(e){var r=this.l;r.fillStyle=L(e);r.beginPath()};et.N=function t(){this.l.fill()};et.g=function t(e){var r=this.l;r.moveTo(e[0].x,e[0].y);for(var n=1;n<e.length;n++){r.lineTo(e[n].x,e[n].y)}r.closePath()};et.h=function t(e,r,n){var i=this.l,o=r/2;i.moveTo(e.x+o,e.y+o);i.arc(e.x+o,e.y+o,o,0,Math.PI*2,n);i.closePath()};et.finish=function t(){this.l.restore()};var rt=1;var nt=2;var it={O:"data-jdenticon-hash",v:"data-jdenticon-value"};var ot="jdenticonRendered";var at="["+it.O+"],["+it.v+"]";var st=typeof document!=="undefined"&&document.querySelectorAll.bind(document);function ft(t){if(t){var e=t["tagName"];if(/^svg$/i.test(e)){return rt}if(/^canvas$/i.test(e)&&"getContext"in t){return nt}}}function ct(t,e,r,n){if(!t){throw new Error("No canvas specified.")}X(new tt(t,r),V(e)||$(e),n);var i=t.canvas;if(i){i[ot]=true}}function ut(t){return(t*10+.5|0)/10}function lt(){this.A=""}var dt=lt.prototype;dt.g=function t(e){var r="";for(var n=0;n<e.length;n++){r+=(n?"L":"M")+ut(e[n].x)+" "+ut(e[n].y)}this.A+=r+"Z"};dt.h=function t(e,r,n){var i=n?0:1,o=ut(r/2),a=ut(r),s="a"+o+","+o+" 0 1,"+i+" ";this.A+="M"+ut(e.x)+" "+ut(e.y+r/2)+s+a+",0"+s+-a+",0"};function ht(t){this.C={};this.P=t;this.k=t.k}var pt=ht.prototype;pt.m=function t(e){var r=/^(#......)(..)?/.exec(e),n=r[2]?_(r[2],0)/255:1;this.P.m(r[1],n)};pt.M=function t(e){this.B=this.C[e]||(this.C[e]=new lt)};pt.N=function t(){};pt.g=function t(e){this.B.g(e)};pt.h=function t(e,r,n){this.B.h(e,r,n)};pt.finish=function t(){var e=this;var r=this.C;for(var n in r){if(r.hasOwnProperty(n)){e.P.R(n,r[n].A)}}};var vt={S:"http://www.w3.org/2000/svg",T:"width",U:"height"};function gt(t){this.k=t;this.D='<svg xmlns="'+vt.S+'" width="'+t+'" height="'+t+'" viewBox="0 0 '+t+" "+t+'">'}var bt=gt.prototype;bt.m=function t(e,r){if(r){this.D+='<rect width="100%" height="100%" fill="'+e+'" opacity="'+r.toFixed(2)+'"/>'}};bt.R=function t(e,r){this.D+='<path fill="'+e+'" d="'+r+'"/>'};bt.toString=function t(){return this.D+"</svg>"};function wt(t,e,r){var n=new gt(e);X(new ht(n),V(t)||$(t),r);return n.toString()}function mt(t,e){var r=[],n=arguments.length-2;while(n-- >0)r[n]=arguments[n+2];var i=document.createElementNS(vt.S,e);for(var o=0;o+1<r.length;o+=2){i.setAttribute(r[o],r[o+1])}t.appendChild(i)}function xt(t){var e=this.k=Math.min(Number(t.getAttribute(vt.T))||100,Number(t.getAttribute(vt.U))||100);this.V=t;while(t.firstChild){t.removeChild(t.firstChild)}t.setAttribute("viewBox","0 0 "+e+" "+e);t.setAttribute("preserveAspectRatio","xMidYMid meet")}var kt=xt.prototype;kt.m=function t(e,r){if(r){mt(this.V,"rect",vt.T,"100%",vt.U,"100%","fill",e,"opacity",r)}};kt.R=function t(e,r){mt(this.V,"path","fill",e,"d",r)};function yt(){if(st){At(at)}}function At(t,e,r){It(t,e,r,(function(t,e){if(e){return e==rt?new ht(new xt(t)):new tt(t.getContext("2d"))}}))}function Ct(t,e,r){It(t,e,r,(function(t,e){if(e==nt){return new tt(t.getContext("2d"))}}))}function Ot(t,e,r){It(t,e,r,(function(t,e){if(e==rt){return new ht(new xt(t))}}))}function It(t,e,r,n){if(typeof t==="string"){if(st){var i=st(t);for(var o=0;o<i.length;o++){It(i[o],e,r,n)}}return}var a=V(e)||e!=null&&$(e)||V(t.getAttribute(it.O))||t.hasAttribute(it.v)&&$(t.getAttribute(it.v));if(!a){return}var s=n(t,ft(t));if(s){X(s,a,r);t[ot]=true}}var jt=yt;Y(jt);jt["configure"]=J;jt["drawIcon"]=ct;jt["toSvg"]=wt;jt["update"]=At;jt["updateCanvas"]=Ct;jt["updateSvg"]=Ot;jt["version"]="3.3.0";jt["bundle"]="browser-cjs";var St=jt;const _t='.button{display:flex;height:50px;padding:0;background:#3e7671;border:none;outline:none;border-radius:5px;overflow:hidden;font-size:16px;font-weight:500;cursor:pointer;min-width:220px;max-width:220px}.button:hover{background:#008168}.button:active{background:#3e7671}.button-text{display:block;margin:auto;padding:0 10px;color:#fff;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:50%;text-transform:capitalize}.button-icon{margin:auto;padding:10px}.button-profile{margin:auto}.button-profile svg{display:flex;margin-left:4px;background-color:#fff;border-radius:4px}.button-text-full-width{width:auto!important}.button-link{text-decoration:none!important}.gg-menu-grid-r{color:#fff;box-sizing:border-box;position:relative;display:block;transform:scale(var(--ggs,1));width:16px;height:16px}.gg-menu-grid-r::before{content:"";display:block;box-sizing:border-box;position:absolute;width:4px;height:4px;background:currentColor;box-shadow:0 6px 0,\n 6px 6px 0,\n 12px 6px 0,\n 6px 12px 0,\n 12px 12px 0,\n 6px 0 0,\n 12px 0 0,\n 0 12px 0}.dropdown{position:relative;display:inline-block}.dropdown-content{display:none;position:absolute;right:0;background-color:#f9f9f9;min-width:180px;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);z-index:1;border-radius:5px;text-align:left!important}.dropdown-content a{color:#71797E;padding:16px 20px;text-decoration:none;display:block;cursor:pointer;font-size:1rem!important}.dropdown-content a:hover{background-color:#f1f1f1;color:#000;opacity:0.7}.dropdown:hover .dropdown-content{display:block}.modal{display:none;position:fixed;z-index:1;padding-top:100px;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4);text-align:center}.modal-content{background-color:#fefefe;margin:auto;padding:20px;border:1px solid #888;width:40%}.modal-body{max-height:50vh;overflow-y:auto}.close{color:#aaaaaa;float:right;font-size:28px;font-weight:bold}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}.modal-app{background-color:#c3e9bc;padding:15px;margin:10px;border-radius:5px}.external-app-link{text-decoration:none;color:#000}.gray-text{color:#606060}.green-text{color:#3e7671}#countdown{position:relative;margin:auto;margin-top:30px;height:40px;width:40px;text-align:center}#countdown-number{color:#2e2e2e;display:inline-block;line-height:40px}#countdown svg{position:absolute;top:0;right:0;width:40px;height:40px;transform:rotateY(-180deg) rotateZ(-90deg)}#countdown svg circle{stroke-dasharray:113px;stroke-dashoffset:0px;stroke-linecap:round;stroke-width:4px;stroke:#008168;fill:none;animation:countdown 6s linear infinite forwards}@keyframes countdown{from{stroke-dashoffset:0px}to{stroke-dashoffset:113px}}.lds-ring{color:#fff}.lds-ring{display:flex;justify-content:center;align-items:center;margin:auto;position:relative}.lds-ring div{box-sizing:border-box;display:block;position:absolute;width:30px;height:30px;margin:3px;border:3px solid currentColor;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;border-color:currentColor transparent transparent transparent}.lds-ring div:nth-child(1){animation-delay:-0.45s}.lds-ring div:nth-child(2){animation-delay:-0.3s}.lds-ring div:nth-child(3){animation-delay:-0.15s}@keyframes lds-ring{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.dropdown-content .dropdown-user-profile{padding:12px 10px 8px 18px;border-bottom:1px solid #aaaaaa}.dropdown-content .dropdown-user-profile .username{font-size:16px;color:#2e2e2e;text-transform:capitalize}.dropdown-content .dropdown-user-profile .first-last-name{font-size:13px;color:#606060}.menu-bar-icons{color:#008168;display:inline-block;margin-bottom:-3px}.gg-microsoft{transform:scale(var(--ggs,1));margin-right:12px}.gg-microsoft,.gg-microsoft::after,.gg-microsoft::before{box-sizing:border-box;position:relative;width:18px;height:18px}.gg-microsoft::after,.gg-microsoft::before{content:"";position:absolute;width:8px;border-top:8px solid;border-bottom:8px solid}.gg-microsoft::after{right:0}.gg-ereader{box-sizing:border-box;position:relative;transform:scale(var(--ggs,1));width:20px;height:18px;border:2px solid;border-radius:3px;margin-right:9px}.gg-ereader::after,.gg-ereader::before{content:"";display:block;box-sizing:border-box;position:absolute;border-radius:3px;width:2px;height:18px;right:9px;top:-2px;background:currentColor}.gg-ereader::after{width:5px;height:2px;box-shadow:0 4px 0,0 8px 0;top:2px;right:2px}.gg-display-flex{box-sizing:border-box;position:relative;transform:scale(var(--ggs,1));height:14px;width:16px;border:2px solid transparent;margin-right:11px;margin-left:2px;margin-bottom:0px!important;box-shadow:0 0 0 2px,\n inset -2px 0 0 0,\n inset 2px 0 0 0}.gg-align-bottom{box-sizing:border-box;position:relative;height:12px;width:12px;border-bottom:2px solid;transform:scale(var(--ggs,1));margin-bottom:-1px;margin-right:12px;margin-left:4px}.gg-align-bottom::after,.gg-align-bottom::before{content:"";display:block;box-sizing:border-box;position:absolute;width:4px;background:currentColor;bottom:2px}.gg-align-bottom::before{left:1px;height:12px}.gg-align-bottom::after{height:6px;right:1px;opacity:.5}.gg-log-out{box-sizing:border-box;position:relative;width:6px;height:16px;border:2px solid;transform:scale(var(--ggs,1));border-right:0;border-top-left-radius:2px;border-bottom-left-radius:2px;margin-right:21px;margin-left:2px;margin-bottom:-2px}.gg-log-out::after,.gg-log-out::before{content:"";display:block;box-sizing:border-box;position:absolute}.gg-log-out::after{border-top:2px solid;border-left:2px solid;transform:rotate(-45deg);width:8px;height:8px;left:4px;bottom:2px}.gg-log-out::before{border-radius:3px;width:10px;height:2px;background:currentColor;left:5px;bottom:5px}.gg-link{box-sizing:border-box;position:relative;transform:rotate(-45deg) scale(var(--ggs, 1));width:8px;height:2px;border-bottom:2px solid;margin-bottom:5px;margin-right:14px;margin-left:6px}.gg-link::after,.gg-link::before{content:"";display:block;box-sizing:border-box;position:absolute;border-radius:3px;width:8px;height:10px;border:2px solid;top:-4px}.gg-link::before{border-right:0;border-top-left-radius:40px;border-bottom-left-radius:40px;left:-6px}.gg-link::after{border-left:0;border-top-right-radius:40px;border-bottom-right-radius:40px;right:-6px}';const zt=_t;const Rt=class{constructor(e){t(this,e);this.showPostLoginText=false;this.silentCheckSso=false;this.redirectUri=undefined;this.authMethod="check-sso";this.keycloakUri="http://localhost:8080";this.realm="";this.clientId="";this.appId="";this.portalUrl="";this.marketplaceUrl="https://marketplace-zdzw.cloud.zdzw-project.com";this.plmUrl="https://productlicensemanager-zdzw.cloud.zdzw-project.com";this.usageTrackingUrl="https://usage-tracking-ui-zdzw.cloud.zdzw-project.com";this.showUnauthorizedModal=false;this.postTextDelayDuration=undefined;this.primaryColor="";this.accentColor="";this.menuLinks=undefined;this.keycloak=new S({url:this.keycloakUri,realm:this.realm,clientId:this.clientId});this.isAuth=false;this.givenUserName="";this.silentCheckSsoRedirectUri=window.location.origin+"/assets/verificar-sso.html";this.appList=[];this.menuLinkList=[];this.showPostLoginLoadingSpinner=false;this.avatarSvg=St.toSvg("init-avatar",40)}componentWillLoad(){if(this.postTextDelayDuration>0){this.showPostLoginLoadingSpinner=true;setTimeout((()=>{this.showPostLoginLoadingSpinner=false}),this.postTextDelayDuration)}this.initKeycloak().then((()=>{if(this.isAuth){const t=JSON.parse(localStorage.getItem("keycloak")).token;this.getAppList(t).then((t=>{this.appList=t;if(this.appId){const t=this.appId.replace(/'/g,"").split(",");const n=this.appList.map((t=>t["shortname"]));if(t.filter((t=>n.includes(t))).length==0){localStorage.setItem("ZDZW_app_permission",JSON.stringify(false));const t=this.el.shadowRoot.querySelector("#appPermissionErrorModal");t.style.display="block";if(this.portalUrl&&this.showUnauthorizedModal){var e=this.el.shadowRoot.getElementById("countdown-number");var r=6;e.textContent=r.toString();setInterval((()=>{r=--r<=0?6:r;e.textContent=r.toString();if(r==1){window.location.replace(this.portalUrl.toString())}}),1e3)}}else{localStorage.setItem("ZDZW_app_permission",JSON.stringify(true))}}}))}}));if(this.menuLinks){this.menuLinkList=JSON.parse(this.menuLinks)}}async initKeycloak(){localStorage.removeItem("ZDZW_app_permission");await this.keycloak.init({onLoad:this.authMethod,checkLoginIframe:false,silentCheckSsoRedirectUri:this.silentCheckSso?this.silentCheckSsoRedirectUri:""}).then((t=>{if(t){this.isAuth=true;localStorage.setItem("keycloak",JSON.stringify(this.keycloak));document.cookie="ZDZW_cookie="+JSON.parse(localStorage.getItem("keycloak")).token;this.givenUserName=JSON.parse(localStorage.getItem("keycloak")).idTokenParsed.preferred_username;this.avatarSvg=St.toSvg(JSON.parse(localStorage.getItem("keycloak")).idTokenParsed.sub,40)}}))}async getAppList(t){const e=await fetch(this.plmUrl+"/api/v1/product/nameAndShortNameOrg",{headers:new Headers({Authorization:"Bearer "+t})});const r=await e.json();return r}login(){this.keycloak.login()}logout(){localStorage.removeItem("keycloak");document.cookie="ZDZW_cookie=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";this.keycloak.logout()}showModal(){const t=this.el.shadowRoot.querySelector("#appListModal");t.style.display="block"}closeModal(){const t=this.el.shadowRoot.querySelector("#appListModal");t.style.display="none"}render(){return e("div",{key:"4ffe6bf7bb6dc9703cd60f069f1aa7a381a3e9a3"},e("div",{key:"e145284b85c1bf6a148d33707d1e0f5de4a0c67e"},(()=>{if(this.isAuth&&this.showPostLoginText){if(this.showPostLoginLoadingSpinner){return e("a",{id:"login-btn",class:"button button-link"},e("div",{class:"lds-ring"},e("div",null),e("div",null),e("div",null),e("div",null)))}else{return e("a",{style:{background:this.primaryColor!=undefined?this.primaryColor:""},href:this.redirectUri,id:"login-btn",class:"button button-link"},e("span",{style:{color:this.accentColor!=undefined?this.accentColor:""},class:"button-text button-text-full-width"},"Go to Dashboard"))}}else if(this.isAuth){return e("div",{id:"profile-btn",class:"dropdown"},e("button",{style:{background:this.primaryColor!=undefined?this.primaryColor:""},type:"button",class:"button"},e("span",{class:"button-profile"},e("div",{innerHTML:this.avatarSvg})),e("span",{style:{color:this.accentColor!=undefined?this.accentColor:""},id:"given-name",class:"button-text"},this.givenUserName),e("div",{class:"button-icon"},e("span",{class:"gg-menu-grid-r"}))),e("div",{class:"dropdown-content"},e("div",{class:"dropdown-user-profile"},e("div",{class:"username"},"@",this.givenUserName),e("div",{class:"first-last-name"},JSON.parse(localStorage.getItem("keycloak")).idTokenParsed.name)),e("a",{onClick:this.showModal.bind(this),id:"applications-btn"},e("i",{style:{color:this.primaryColor!=undefined?this.primaryColor:""},class:"menu-bar-icons gg-microsoft"}),"Applications"),e("a",{href:this.portalUrl,target:"_blank",id:"applications-btn"},e("i",{style:{color:this.primaryColor!=undefined?this.primaryColor:""},class:"menu-bar-icons gg-ereader"}),"Portal"),e("a",{href:this.marketplaceUrl,target:"_blank",id:"applications-btn"},e("i",{style:{color:this.primaryColor!=undefined?this.primaryColor:""},class:"menu-bar-icons gg-display-flex"}),"Marketplace"),this.menuLinkList.map((t=>e("a",{href:t.url,target:"_blank",id:"applications-btn"},e("i",{style:{color:this.primaryColor!=undefined?this.primaryColor:""},class:"menu-bar-icons gg-link"}),t.name))),e("a",{onClick:this.logout.bind(this),id:"logout-btn"},e("i",{style:{color:this.primaryColor!=undefined?this.primaryColor:""},class:"menu-bar-icons gg-log-out"}),"Logout")))}else{return e("button",{style:{background:this.primaryColor!=undefined?this.primaryColor:""},onClick:this.login.bind(this),id:"login-btn",type:"button",class:"button"},e("span",{style:{color:this.accentColor!=undefined?this.accentColor:""},class:"button-text"},"Login"))}})()),e("div",{key:"b9eed96128cc7c202f29250493606f3074dcb621",id:"appListModal",class:"modal"},e("div",{key:"14e6c8fa44e4d02dbadcd5d6b3109e8b6be23e5d",class:"modal-content"},e("span",{key:"2e71edc089ff02a8c20ca6f3c1150bf549683573",onClick:this.closeModal.bind(this),class:"close"},"×"),e("h3",{key:"d48754c31b21d8d865ca4e5c966428c433729232"},"Applications"),e("div",{key:"b2c072aa61557dd7effea954c3e66f728d10fec1",class:"modal-body"},this.appList.length>0?this.appList.map((t=>e("a",{class:"external-app-link",target:"_blank",href:"https://"+t.shortname+"-zdzw"+this.portalUrl.replace(/(^\w+:|^)\/\//,"").replace("portal-frontend-zdzw","")},e("div",{class:"modal-app"},e("div",null,t.name))))):e("div",null,e("h3",{class:"gray-text"},"Not installed application found.")," ",e("p",{class:"gray-text"},"Please contact administration."))))),e("div",{key:"ec12c499f90bdc5245546a828688b97cfe1fcfca",id:"appPermissionErrorModal",class:"modal"},e("div",{key:"edb81d2dff00172db83ef2ea1b60b45e16d5a18f",class:"modal-content"},e("img",{key:"b34a97a339b056c0a38f61553122078c14edaa19",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGD0lEQVR4nO2cbU8TWRTH/W5WEAmF4nNiieFFoeBjYhQUWzUWYkpbDfGFCR9CoolvQF9aWgG3kMCG8LACC1ikuCuUh7bH/M/MmW131S2ZqTDjPcmkdub2tvPj3HP/55yJR44oU6ZMmTJlyg7YOsL9pI7+shkogGFzDqMAhhVAOsiQozwwrACS8sCwfXd+tYTDCiApDwwf/FJUSzisAJKjNhFlPzYF0KQpgCZNATRpCqBJUwBNmgJo0hRAk6YAmjQF0KkAs4uLtPz8OU2HQpRqaaFkQwPFq6v5SHo8fA7XVgYGKLu0dGC/81ABLORylB4cpInLl+nt0aP7OiauXKH00BAV8vlfE2AmkaCxpiYDSKK6mqaammjx+nX6FAzS348e0VYkwgf+jXO4Nun18lj53PuLF2kjmfx1AOa3t2mmt9cAkDxxghauXaPN3l7KxmJlHRgLmKNutzHPTCTCczsa4G4mQ6nWVr7h4WPHaL6trQTc+r17NOf30/iZMzTmdtNwVRWPA2Scm/H56FMgQNlolMfDO/9ob+cxmDPl99PuxoYzAe5mMrzcxOvWAALgolFauXmTxurry45/gPvnjRsG+LW7d3lOWdKVhHggAPPb24bnvW9ooL96evjGP4dC9NvJkwaY0fPnaa6vjzLJJG19+ED5bJY/u5NOUyYep/lnz2jk3Ll/4p/Hw/B4ru5unls8Mb+z4xyAM3rMg5cIvHRXFyVqavg8oKy+elXWjooxqy9f0luXy5gTm4xAFE+cjcWcATCTSGgxr6rKWLaAF9fj1u+BAOW2tsqeL7+7S5OdnRq8mhpaf/CA5xSI8EiJiRsjI/YGWMjlDKmCDUOWrXje3NOnRIWCaXh45biqL+f59nYjHlqtE38qwPTgoLHMeLeNRo2YB8+zEp7ExK1olI+Rujo+t/b6tX0BTugZBnQebha7rcQ8K5Ytw9O9WWKi7M7QiZKx2BJgdnHRyDDE+0SqYMOwEt7k7dvaxqJLHHwXvpMzFpeLtpeX7QdwZWCAbwjpmYhkkSrlxqVy4WEc4q1IHBbbsRhNXrjA71devLAfwOlQiH88lhJuBhkGbxx9fZbDE4NO5LTO5+OxCB14P93dbT+AKZ9P84ZgkG8GqRjeQ9ZUAh4MYhvXxs+e5fHwRBbWra32A5j0ePjHf9H1mST+2YWFisCDba+u8vV3tbWGNuT3jY32AxjXS06QFLgZKUH9aPct7O3RVFfXf+BlHj6kZG2tBq+j47tpGs5LoYKrNpGI9v74cfsDHNazg+/dvFl4sNzmprHz2x5g8l9LWMTuzsePli7bYkMBgqVMfb39l3CqpeXbm0g8XhF439xEgkGjOmN7GTOjA4XU2Be8zs6y4MFmnzzRpJLfXypjenrsK6Qnvd4SSQGxCyFtNbxiIb1+/74mpL1e+wrp7NISp1ElqZwuZZB2WQkPZqRyevz7Eg5zCc22qVxxMUGWMRL94sTfKnjYfd+dPq15261bpcWEq1fJvuWsoSEt/3W7tRZlNMolJylxWQEPJTGRP6lTpwz5YpSz3ryxcUE1nzcaSeieFTeArIKH3Fq8GSX9koJqc7O9C6owNL0lO5CKsZTfzS7bqTt3+LPxornxKu2Cz6Oj5IymUkTLCOB54iWAKOIaMRE7JXbS/zOMwYYhMQ9/gOLOnPxBZh8/dlhb06+Vs9B6FIi4cYmJInGgEyGIkbHgc8idkWHgHHRecVsTMU/mwuuY3tYcv3TJWW1NGJrdJY113WtkdxaJU84BqSK7rRFXdc/Dd+w5rbFeDHG8rc2IiQj2UmwQsY1iKFIxlKSg46AjARfnkGGISOZHO6JRnkNiHjzPsY92iGFZoultLNu6OtZs+3m4CCIZnxGpIjGvUsv2UAEUQ9NblrSUoNDDQP4KT+TH2/QWJT/eFgjwNaRnnGHI4x3NzRXZbQ89QBg0GsQ2Wo+SnZR1uFycYbBI3kdv2XEAiw35KqQMGkDoYaCeaDzi29jIuziuYYyVua1jANrFFECTpgCaNAXQpCmAJk0BNGkKoElTACsNUB39ZTFQAMMW/78xypQpU6ZMmbIjP9e+AkAlsBlIjsPOAAAAAElFTkSuQmCC"}),e("h2",{key:"07a16b783f8d2977de1468d8366ecdd6251fd44f",class:"green-text margin-b"},"You don't have permission to access this application."),e("h3",{key:"bdce074c1bf2dab81516075f72e429a7b5012011",class:"green-text"},"Please contact the administration."),this.portalUrl&&this.showUnauthorizedModal?e("div",null,e("h4",{class:"gray-text"},"You will be automatically redirected to the portal."),e("div",{id:"countdown"},e("div",{id:"countdown-number"}),e("svg",null,e("circle",{r:"18",cx:"20",cy:"20"})))):e("div",null))))}get el(){return r(this)}};Rt.style=zt;export{Rt as dash_button};
10
+ //# sourceMappingURL=p-cd93443d.entry.js.map