diff --git a/package.json b/package.json index 62776987..64dca3ad 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "start": "yarn buildConfig && yarn serve", "buildConfig": "webpack --entry ./src/luigi-config/luigi-config.es6.js --output-path ./public/assets --output-filename luigi-config.js --mode production", "serve": "vue-cli-service serve --port 9000", - "build": "vue-cli-service build && yarn build-wc", + "build": "vue-cli-service build", "lint": "vue-cli-service lint", - "build-wc": "vue-cli-service build --target wc --inline-vue --name side-bar ./src/components/Sidebar.vue,./src/components/navbar.vue" + "build-wc": "vue-cli-service build --target wc --inline-vue --name side-bar ./src/components/Sidebar.vue,./src/components/navbar.vue --dest public/sidebar" }, "dependencies": { "@luigi-project/client": "^1.5.0", @@ -17,11 +17,11 @@ "@luigi-project/plugin-auth-oidc": "^1.5.0", "@sap-theming/theming-base-content": "^11.1.22", "@vue/web-component-wrapper": "^1.2.0", - "axios": "^0.21.0", + "axios": "^0.21.1", "core-js": "^3.6.5", "fundamental-styles": "^0.12.0", "keycloak-js": "^11.0.3", - "unnic-system-beta": "^0.0.10", + "unnic-system-beta": "^0.0.20", "vue": "^2.6.11", "vue-router": "^3.4.8", "vuex": "^3.5.1" diff --git a/public/assets/luigi-config.js b/public/assets/luigi-config.js index 9d168ef0..bd321232 100644 --- a/public/assets/luigi-config.js +++ b/public/assets/luigi-config.js @@ -40,4 +40,4 @@ var ut=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(? * @author Feross Aboukhadijeh * @license MIT */ -var n=r(29),i=r(30),o=r(31);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,f=0;fi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function U(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return o||U(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||U(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(28))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=c(t),n=r[0],s=r[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),u=0,h=s>0?n-4:n,l=0;l>16&255,a[u++]=e>>8&255,a[u++]=255&e;return 2===s&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,a[u++]=255&e),1===s&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e),a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=t[e+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,r=t.KeyUtil,i=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,u=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function t(r){n.Log.debug("JoseUtil.parseJwt");try{var i=e.JWS.parse(r);return{header:i.headerObj,payload:i.payloadObj}}catch(t){n.Log.error(t)}},t.validateJwt=function(e,o,s,u,c,h,l){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=r.getKey(o);else{if(!o.x5c||!o.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var f=a(o.x5c[0]);o=i.getPublicKeyFromCertHex(f)}else{if("EC"!==o.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=r.getKey(o)}return t._validateJwt(e,o,s,u,c,h,l)}catch(t){return n.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,r,i,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var u=t.parseJwt(e).payload;if(!u.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==r)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===i||Array.isArray(u.aud)&&u.aud.indexOf(i)>=0))return n.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==i)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var c=s+o,h=s-o;if(!u.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c>>((3&e)<<3)&255;return i}}},function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,i=r;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"#";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=i.UrlUtility.parseUrlFragment(e,r);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.expires_in}return n(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var n=r(0),i=r(3),o=r(8);e.SignoutRequest=function t(e){var r=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,u=e.data,c=e.extraQueryParams,h=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var l in s&&(r=i.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=i.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),u&&(this.state=new o.State({data:u,request_type:h}),r=i.UrlUtility.addQueryParam(r,"state",this.state.id))),c)r=i.UrlUtility.addQueryParam(r,l,c[l]);this.url=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var n=r(3);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=n.UrlUtility.parseUrlFragment(e,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.JoseUtil;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var v=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return v._events=new u.UserManagerEvents(r),v._silentRenewService=new n(v),v.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new o(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new p(v._settings),v._joseUtil=g,v}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then((function(e){return e?(i.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),t}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){i.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},e)).request_type="si:s",this._loadUser().then((function(r){return r&&r.refresh_token?(e.refresh_token=r.refresh_token,t._useRefreshToken(e)):(e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&r&&r.id_token,r&&t._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",r.profile.sub),e.current_sub=r.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(r){if(r){var n=Promise.resolve();return e.id_token&&(n=t._validateIdTokenFromTokenRefreshToken(r.profile,e.id_token)),n.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=e.id_token,r.access_token=e.access_token,r.refresh_token=e.refresh_token||r.refresh_token,r.expires_in=e.expires_in,t.storeUser(r).then((function(){return t._events.load(r),r}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var r=this;return this._metadataService.getIssuer().then((function(n){return r._joseUtil.validateJwtAttributes(e,n,r._settings.client_id,r._settings.clockSkew).then((function(e){return e?e.sub!==t.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):e.auth_time&&e.auth_time!==t.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):e.azp&&e.azp!==t.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!e.azp&&t.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),t}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(r){var n=r.state;return r.response,"si:r"===n.request_type?e.signinRedirectCallback(t):"si:p"===n.request_type?e.signinPopupCallback(t):"si:s"===n.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var r=this;return this.readSignoutResponseState(t).then((function(n){var i=n.state,o=n.response;return i?"so:r"===i.request_type?r.signoutRedirectCallback(t):"so:p"===i.request_type?r.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var r=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(e.redirect_uri=r,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:r,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,n).then((function(e){return r._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(n).then((function(e){return i.Log.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(t).then((function(t){return i.Log.debug("UserManager._signinStart: got signin request"),n.url=t.url,n.id=t.state.id,e.navigate(n)})).catch((function(t){throw e.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){i.Log.debug("UserManager._signinEnd: got signin response");var n=new a.User(t);if(r.current_sub){if(r.current_sub!==n.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",n.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(n).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),e._events.load(n),n}))}))},e.prototype._signinCallback=function(t,e){return i.Log.debug("UserManager._signinCallback"),e.callback(t)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var r={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,r).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return i.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,n).then((function(t){return r._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,r=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(n).then((function(r){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(o):Promise.resolve()).then((function(){var s=t.id_token_hint||o&&o.id_token;return s&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return i.Log.debug("UserManager._signoutStart: got signout request"),n.url=t.url,t.state&&(n.id=t.state.id),r.navigate(n)}))}))}))})).catch((function(t){throw r.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return i.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(r){if(r)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function(t,e){var r=this;if(t){var n=t.access_token,o=t.refresh_token;return this._revokeAccessTokenInternal(n,e).then((function(t){return r._revokeRefreshTokenInternal(o,e).then((function(e){return t||e||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(i.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){i.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(e,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(o.OidcClient)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=r.popup_redirect_uri,i=r.popup_post_logout_redirect_uri,l=r.popupWindowFeatures,f=r.popupWindowTarget,d=r.silent_redirect_uri,p=r.silentRequestTimeout,g=r.automaticSilentRenew,v=void 0!==g&&g,y=r.validateSubOnSilentRenew,m=void 0!==y&&y,_=r.includeIdTokenInSilentRenew,S=void 0===_||_,b=r.monitorSession,w=void 0===b||b,F=r.monitorAnonymousSession,E=void 0!==F&&F,x=r.checkSessionInterval,k=void 0===x?2e3:x,A=r.stopCheckSessionOnError,P=void 0===A||A,C=r.query_status_response_type,T=r.revokeAccessTokenOnSignout,R=void 0!==T&&T,I=r.accessTokenExpiringNotificationTime,L=void 0===I?60:I,D=r.redirectNavigator,U=void 0===D?new o.RedirectNavigator:D,O=r.popupNavigator,N=void 0===O?new s.PopupNavigator:O,B=r.iframeNavigator,j=void 0===B?new a.IFrameNavigator:B,M=r.userStore,H=void 0===M?new u.WebStorageStateStore({store:c.Global.sessionStorage}):M;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var V=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,arguments[0]));return V._popup_redirect_uri=n,V._popup_post_logout_redirect_uri=i,V._popupWindowFeatures=l,V._popupWindowTarget=f,V._silent_redirect_uri=d,V._silentRequestTimeout=p,V._automaticSilentRenew=v,V._validateSubOnSilentRenew=m,V._includeIdTokenInSilentRenew=S,V._accessTokenExpiringNotificationTime=L,V._monitorSession=w,V._monitorAnonymousSession=E,V._checkSessionInterval=k,V._stopCheckSessionOnError=P,C?V._query_status_response_type=C:arguments[0]&&arguments[0].response_type?V._query_status_response_type=h.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":V._query_status_response_type="id_token",V._revokeAccessTokenOnSignout=R,V._redirectNavigator=U,V._popupNavigator=N,V._iframeNavigator=j,V._userStore=H,V}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),e}(i.OidcClientSettings)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),r&&this._userLoaded.raise(e)},e.prototype.unload=function(){n.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){n.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(i.AccessTokenEvents)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return s._timer=n,s._nowFunc=i||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var r=5;t=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return p}));var n=r(6),i=r.n(n),o=r(7),s=r.n(o),a=r(0),u=r.n(a),c=r(1),h=r.n(c),l=r(4),f=r(2),d="not_checked";window.addEventListener("message",(function(t){"luigi.tpcDisabled"===t.data?(console.warn("Third party cookies are not supported! Silent token renewal might not work!"),d="disabled"):"luigi.tpcEnabled"===t.data&&(d="enabled")}),!1);var p=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,t);var n={redirect_uri:window.location.origin,post_logout_redirect_uri:window.location.origin+"/logout.html",response_type:"id_token token",filterProtocolClaims:!0,loadUserInfo:!1,automaticSilentRenew:!1,accessTokenExpiringNotificationTime:60,thirdPartyCookiesScriptLocation:"",logoutUrl:window.location.origin+"/logout.html",silent_redirect_uri:window.location.origin+"/assets/auth-oidc/silent-callback.html"},o=f.a.deepMerge(n,r);["redirect_uri","post_logout_redirect_uri"].forEach((function(t){o[t]=f.a.prependOrigin(o[t])}));var a=Luigi.getConfigValue("auth.storage"),c=["none","sessionStorage","localStorage"].includes(a);return c&&"none"==a?(o.userStore=new l.WebStorageStateStore({store:new l.InMemoryWebStorage}),o.stateStore=new l.WebStorageStateStore({store:new l.InMemoryWebStorage})):c&&(o.stateStore=new l.WebStorageStateStore({store:window[a]})),this.settings=o,this.client=new l.UserManager(this.settings),this.client.events.addUserLoaded(function(){var t=s()(i.a.mark((function t(e){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.profile,!e.profile||!Luigi.getConfigValue("auth.openIdConnect.profileStorageInterceptorFn")){t.next=5;break}return t.next=4,Luigi.executeConfigFnAsync("auth.openIdConnect.profileStorageInterceptorFn",!0,e.profile);case 4:r=t.sent;case 5:n={accessToken:e.access_token,accessTokenExpirationDate:1e3*e.expires_at,scope:e.scope,idToken:e.id_token,profile:r},Luigi.auth().store.setAuthData(n),window.postMessage({msg:"luigi.auth.tokenIssued",authData:n},window.location.origin);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Promise.all([this._processLoginResponse(),this._processLogoutResponse()]).then((function(){return e}))}var e;return h()(t,[{key:"login",value:function(){return this.client.signinRedirect(this.settings).catch((function(t){return console.error("[OIDC] login() Error",t),t}))}},{key:"logout",value:function(t,e){var r={id_token_hint:t&&t.idToken,state:window.location.href};return this.client.createSignoutRequest(r).then((function(t){e(),window.location=t.url})).catch((function(t){console.error("[OIDC] logout() Error",t),e()}))}},{key:"setTokenExpirationAction",value:function(){var t=this;if(this.settings.automaticSilentRenew||this.client.events.addAccessTokenExpired((function(){Luigi.auth().handleAuthEvent("onAuthExpired",t.settings,void 0,t.settings.logoutUrl+"?error=tokenExpired")})),this.settings.thirdPartyCookiesScriptLocation){var e=document.createElement("iframe");e.src=this.settings.thirdPartyCookiesScriptLocation,e.style.display="none",document.body.appendChild(e)}this.client.events.addSilentRenewError((function(e){var r;switch(e.message){case"interaction_required":case"login_required":case"account_selection_required":case"consent_required":r=t.settings.logoutUrl+"?error=tokenExpired&thirdPartyCookies="+d+"&errorDescription="+e.message;break;default:console.error("[OIDC] addSilentRenewError Error",e),r=t.settings.logoutUrl+"?error=tokenExpired&errorDescription="+e.message}Luigi.auth().handleAuthEvent("onAuthError",t.settings,e,r)}))}},{key:"setTokenExpireSoonAction",value:function(){var t=this;this.client.events.addAccessTokenExpiring((function(){Luigi.auth().handleAuthEvent("onAuthExpireSoon",t.settings)}))}},{key:"_processLogoutResponse",value:function(){var t=this;return new Promise((function(e,r){window.location.href.indexOf("?logout")>=0&&t.client.processSignoutResponse().then((function(t){Luigi.auth().store.removeAuthData(),e(t)})).catch((function(t){r(response),console.error("[OIDC] Logout Error",t)})),e(!0)}))}},{key:"_processLoginResponse",value:function(){var t=this;return new Promise((function(e,r){var n,i,o=t.settings.response_type,s=t.settings.response_mode;if(o.indexOf("code")>-1?(n="code",i=s&&"fragment"===s?"hash":"search"):(n="access_token",i=s?"fragment"===s?"hash":"search":"hash"),-1===window.location[i].indexOf(n))return e(!0);t.tryToSignIn().then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.error)return console.error("[OIDC] Error",t.error,t.error_description,t);setTimeout((function(){t.state?history.pushState("",document.title,decodeURIComponent(t.state)):history.pushState("",document.title,window.location.pathname+window.location.search),e(!0)}),50)})).catch((function(e){console.error("[OIDC] tryToSignIn Error",e),Luigi.auth().store.removeAuthData(),Luigi.auth().handleAuthEvent("onAuthExpired",t.settings,e,t.settings.logoutUrl+"?error=loginError")}))}))}},{key:"tryToSignIn",value:(e=s()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.signinRedirectCallback();case 3:console.debug("[OIDC] User was redirected via the sign-in page. Now signed in."),t.next=12;break;case 6:return t.prev=6,t.t0=t.catch(0),console.debug("[OIDC] Error. Sign-in redirect callback doesn't work. Let's try a silent sign-in.",t.t0),t.next=11,this.client.signinSilent();case 11:console.debug("[OIDC] Silent sign-in completed.");case 12:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(){return e.apply(this,arguments)})}]),t}()}]).default},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=async(t,e,r)=>{fetch(t+"api/v1/login/",{method:"POST",body:JSON.stringify({serviceName:"keycloak",accessToken:r,expiresIn:200}),headers:{"Content-type":"application/json; charset=UTF-8"}}).then(r=>r.json().then(r=>{e.contentWindow.postMessage({event:"login-with-token",loginToken:r.data.authToken},t)}))},s=async(t,e,r)=>{e.contentWindow.postMessage({event:"login-with-token",token:"Bearer "+r},t),console.log("posted message")};Luigi.setConfig({navigation:{nodes:()=>[{pathSegment:"dashboard",label:"h",viewUrl:"/sampleapp.html#/home",anonymousAccess:!0,children:[{pathSegment:"home",label:"Home",icon:"house-2-2",viewUrl:"/sampleapp.html#/home",category:"Main menu",anonymousAccess:!0},{pathSegment:"login",label:"Login",icon:"gauge-dashboard-2",viewUrl:"/sampleapp.html#/login",category:"Main menu",anonymousAccess:!0},{pathSegment:"bothub",label:"Bothub",icon:"science-fiction-robot-2",viewUrl:"http://localhost:8081/",category:"Systems",loadingIndicator:{enabled:!1},anonymousAccess:!0},{pathSegment:"push",label:"Push",icon:"hierarchy-3-2",viewUrl:"https://rp-connect.push.al/oidc/authenticate/",category:"Systems",loadingIndicator:{enabled:!1,hideAutomatically:!0},anonymousAccess:!0},{pathSegment:"rocketchat",label:"RocketChat",icon:"messaging-we-chat-2",viewUrl:"https://platform-rocket-test.push.al/",category:"Systems",loadingIndicator:{enabled:!1,hideAutomatically:!0},anonymousAccess:!0}]}]},settings:{hideNavigation:!0,responsiveNavigation:"semiCollapsible",iframeCreationInterceptor:(t,e,r,n)=>{const i=Luigi.auth().store.getAuthData();var a=null;i&&i.accessToken&&("rocketchat"==r.pathSegment?a=()=>{const e=Luigi.elements().getCurrentMicrofrontendIframe();e.src===t.src&&o(t.src,e,i.accessToken)}:"bothub"==r.pathSegment&&(a=()=>{const e=Luigi.elements().getCurrentMicrofrontendIframe();e.src===t.src&&s(t.src,e,i.accessToken)})),t.onload=a},appLoadingIndicator:{hideAutomatically:!0},header:{title:"Ilhasoft",logo:"/logo.png"}},communication:{customMessagesListeners:{"on login":t=>{console.log({data:t}),Luigi.auth().login()},"on logout":()=>{Luigi.auth().logout()}}},lifecycleHooks:{luigiAfterInit:()=>{console.log(document.getElementById("navbar")),console.log(document.getElementById("app")),document.getElementById("navbar").appendChild(document.getElementsByClassName("iframeContainer")[0])}},auth:{use:"openIdConnect",openIdConnect:{idpProvider:i.a,authority:"http://keycloak-connect.push.al/auth/realms/ilhasoft/",client_id:"connect-frontend",response_type:"code",response_mode:"fragment",automaticSilentRenew:!0,userInfoFn:async(t,e)=>({name:"name",email:"email"}),accessTokenExpiringNotificationTime:60},disableAutoLogin:!0}})}]); \ No newline at end of file +var n=r(29),i=r(30),o=r(31);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return M(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,f=0;fi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,l=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function U(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,n,o){return o||U(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||U(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||R(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(28))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=c(t),n=r[0],s=r[1],a=new o(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),u=0,h=s>0?n-4:n,l=0;l>16&255,a[u++]=e>>8&255,a[u++]=255&e;return 2===s&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,a[u++]=255&e),1===s&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e),a},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;sa?a:s+16383));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,h=-7,l=r?i-1:0,f=r?-1:1,d=t[e+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+l],l+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.jws,r=t.KeyUtil,i=t.X509,o=t.crypto,s=t.hextob64u,a=t.b64tohex,u=t.AllowedSigningAlgs;return function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return t.parseJwt=function t(r){n.Log.debug("JoseUtil.parseJwt");try{var i=e.JWS.parse(r);return{header:i.headerObj,payload:i.payloadObj}}catch(t){n.Log.error(t)}},t.validateJwt=function(e,o,s,u,c,h,l){n.Log.debug("JoseUtil.validateJwt");try{if("RSA"===o.kty)if(o.e&&o.n)o=r.getKey(o);else{if(!o.x5c||!o.x5c.length)return n.Log.error("JoseUtil.validateJwt: RSA key missing key material",o),Promise.reject(new Error("RSA key missing key material"));var f=a(o.x5c[0]);o=i.getPublicKeyFromCertHex(f)}else{if("EC"!==o.kty)return n.Log.error("JoseUtil.validateJwt: Unsupported key type",o&&o.kty),Promise.reject(new Error(o.kty));if(!(o.crv&&o.x&&o.y))return n.Log.error("JoseUtil.validateJwt: EC key missing key material",o),Promise.reject(new Error("EC key missing key material"));o=r.getKey(o)}return t._validateJwt(e,o,s,u,c,h,l)}catch(t){return n.Log.error(t&&t.message||t),Promise.reject("JWT validation failed")}},t.validateJwtAttributes=function(e,r,i,o,s,a){o||(o=0),s||(s=parseInt(Date.now()/1e3));var u=t.parseJwt(e).payload;if(!u.iss)return n.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(u.iss!==r)return n.Log.error("JoseUtil._validateJwt: Invalid issuer in token",u.iss),Promise.reject(new Error("Invalid issuer in token: "+u.iss));if(!u.aud)return n.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(u.aud===i||Array.isArray(u.aud)&&u.aud.indexOf(i)>=0))return n.Log.error("JoseUtil._validateJwt: Invalid audience in token",u.aud),Promise.reject(new Error("Invalid audience in token: "+u.aud));if(u.azp&&u.azp!==i)return n.Log.error("JoseUtil._validateJwt: Invalid azp in token",u.azp),Promise.reject(new Error("Invalid azp in token: "+u.azp));if(!a){var c=s+o,h=s-o;if(!u.iat)return n.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c>>((3&e)<<3)&255;return i}}},function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,i=r;return[i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],"-",i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]],i[t[n++]]].join("")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SigninResponse=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"#";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=i.UrlUtility.parseUrlFragment(e,r);this.error=n.error,this.error_description=n.error_description,this.error_uri=n.error_uri,this.code=n.code,this.state=n.state,this.id_token=n.id_token,this.session_state=n.session_state,this.access_token=n.access_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=void 0,this.expires_in=n.expires_in}return n(t,[{key:"expires_in",get:function(){if(this.expires_at){var t=parseInt(Date.now()/1e3);return this.expires_at-t}},set:function(t){var e=parseInt(t);if("number"==typeof e&&e>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+e}}},{key:"expired",get:function(){var t=this.expires_in;if(void 0!==t)return t<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),t}()},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutRequest=void 0;var n=r(0),i=r(3),o=r(8);e.SignoutRequest=function t(e){var r=e.url,s=e.id_token_hint,a=e.post_logout_redirect_uri,u=e.data,c=e.extraQueryParams,h=e.request_type;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!r)throw n.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var l in s&&(r=i.UrlUtility.addQueryParam(r,"id_token_hint",s)),a&&(r=i.UrlUtility.addQueryParam(r,"post_logout_redirect_uri",a),u&&(this.state=new o.State({data:u,request_type:h}),r=i.UrlUtility.addQueryParam(r,"state",this.state.id))),c)r=i.UrlUtility.addQueryParam(r,l,c[l]);this.url=r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignoutResponse=void 0;var n=r(3);e.SignoutResponse=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=n.UrlUtility.parseUrlFragment(e,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryWebStorage=void 0;var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.SessionMonitor,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.TokenRevocationClient,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.TokenClient,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:d.JoseUtil;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r instanceof s.UserManagerSettings||(r=new s.UserManagerSettings(r));var v=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return v._events=new u.UserManagerEvents(r),v._silentRenewService=new n(v),v.settings.automaticSilentRenew&&(i.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),v.startSilentRenew()),v.settings.monitorSession&&(i.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),v._sessionMonitor=new o(v)),v._tokenRevocationClient=new a(v._settings),v._tokenClient=new p(v._settings),v._joseUtil=g,v}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.getUser=function(){var t=this;return this._loadUser().then((function(e){return e?(i.Log.info("UserManager.getUser: user loaded"),t._events.load(e,!1),e):(i.Log.info("UserManager.getUser: user not found in storage"),null)}))},e.prototype.removeUser=function(){var t=this;return this.storeUser(null).then((function(){i.Log.info("UserManager.removeUser: user removed from storage"),t._events.unload()}))},e.prototype.signinRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:r";var e={useReplaceToNavigate:t.useReplaceToNavigate};return this._signinStart(t,this._redirectNavigator,e).then((function(){i.Log.info("UserManager.signinRedirect: successful")}))},e.prototype.signinRedirectCallback=function(t){return this._signinEnd(t||this._redirectNavigator.url).then((function(t){return t.profile&&t.profile.sub?i.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinRedirectCallback: no sub"),t}))},e.prototype.signinPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="si:p";var e=t.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.display="popup",this._signin(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinPopup: no sub")),t}))):(i.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},e.prototype.signinPopupCallback=function(t){return this._signinCallback(t,this._popupNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinPopupCallback: no sub")),t})).catch((function(t){i.Log.error(t.message)}))},e.prototype.signinSilent=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e=Object.assign({},e)).request_type="si:s",this._loadUser().then((function(r){return r&&r.refresh_token?(e.refresh_token=r.refresh_token,t._useRefreshToken(e)):(e.id_token_hint=e.id_token_hint||t.settings.includeIdTokenInSilentRenew&&r&&r.id_token,r&&t._settings.validateSubOnSilentRenew&&(i.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",r.profile.sub),e.current_sub=r.profile.sub),t._signinSilentIframe(e))}))},e.prototype._useRefreshToken=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(e).then((function(e){return e?e.access_token?t._loadUser().then((function(r){if(r){var n=Promise.resolve();return e.id_token&&(n=t._validateIdTokenFromTokenRefreshToken(r.profile,e.id_token)),n.then((function(){return i.Log.debug("UserManager._useRefreshToken: refresh token response success"),r.id_token=e.id_token,r.access_token=e.access_token,r.refresh_token=e.refresh_token||r.refresh_token,r.expires_in=e.expires_in,t.storeUser(r).then((function(){return t._events.load(r),r}))}))}return null})):(i.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(i.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))},e.prototype._validateIdTokenFromTokenRefreshToken=function(t,e){var r=this;return this._metadataService.getIssuer().then((function(n){return r._joseUtil.validateJwtAttributes(e,n,r._settings.client_id,r._settings.clockSkew).then((function(e){return e?e.sub!==t.sub?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):e.auth_time&&e.auth_time!==t.auth_time?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):e.azp&&e.azp!==t.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!e.azp&&t.azp?(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(i.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))},e.prototype._signinSilentIframe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return e?(t.redirect_uri=e,t.prompt=t.prompt||"none",this._signin(t,this._iframeNavigator,{startUrl:e,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinSilent: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinSilent: no sub")),t}))):(i.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype.signinSilentCallback=function(t){return this._signinCallback(t,this._iframeNavigator).then((function(t){return t&&(t.profile&&t.profile.sub?i.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",t.profile.sub):i.Log.info("UserManager.signinSilentCallback: no sub")),t}))},e.prototype.signinCallback=function(t){var e=this;return this.readSigninResponseState(t).then((function(r){var n=r.state;return r.response,"si:r"===n.request_type?e.signinRedirectCallback(t):"si:p"===n.request_type?e.signinPopupCallback(t):"si:s"===n.request_type?e.signinSilentCallback(t):Promise.reject(new Error("invalid response_type in state"))}))},e.prototype.signoutCallback=function(t,e){var r=this;return this.readSignoutResponseState(t).then((function(n){var i=n.state,o=n.response;return i?"so:r"===i.request_type?r.signoutRedirectCallback(t):"so:p"===i.request_type?r.signoutPopupCallback(t,e):Promise.reject(new Error("invalid response_type in state")):o}))},e.prototype.querySessionStatus=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(e=Object.assign({},e)).request_type="si:s";var r=e.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return r?(e.redirect_uri=r,e.prompt="none",e.response_type=e.response_type||this.settings.query_status_response_type,e.scope=e.scope||"openid",e.skipUserInfo=!0,this._signinStart(e,this._iframeNavigator,{startUrl:r,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return t.processSigninResponse(e.url).then((function(t){if(i.Log.debug("UserManager.querySessionStatus: got signin response"),t.session_state&&t.profile.sub)return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",t.profile.sub),{session_state:t.session_state,sub:t.profile.sub,sid:t.profile.sid};i.Log.info("querySessionStatus successful, user not authenticated")})).catch((function(e){if(e.session_state&&t.settings.monitorAnonymousSession&&("login_required"==e.message||"consent_required"==e.message||"interaction_required"==e.message||"account_selection_required"==e.message))return i.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:e.session_state};throw e}))}))):(i.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},e.prototype._signin=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(t,e,n).then((function(e){return r._signinEnd(e.url,t)}))},e.prototype._signinStart=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.prepare(n).then((function(e){return i.Log.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(t).then((function(t){return i.Log.debug("UserManager._signinStart: got signin request"),n.url=t.url,n.id=t.state.id,e.navigate(n)})).catch((function(t){throw e.close&&(i.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),e.close()),t}))}))},e.prototype._signinEnd=function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(t).then((function(t){i.Log.debug("UserManager._signinEnd: got signin response");var n=new a.User(t);if(r.current_sub){if(r.current_sub!==n.profile.sub)return i.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",n.profile.sub),Promise.reject(new Error("login_required"));i.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return e.storeUser(n).then((function(){return i.Log.debug("UserManager._signinEnd: user stored"),e._events.load(n),n}))}))},e.prototype._signinCallback=function(t,e){return i.Log.debug("UserManager._signinCallback"),e.callback(t)},e.prototype.signoutRedirect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:r";var e=t.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;e&&(t.post_logout_redirect_uri=e);var r={useReplaceToNavigate:t.useReplaceToNavigate};return this._signoutStart(t,this._redirectNavigator,r).then((function(){i.Log.info("UserManager.signoutRedirect: successful")}))},e.prototype.signoutRedirectCallback=function(t){return this._signoutEnd(t||this._redirectNavigator.url).then((function(t){return i.Log.info("UserManager.signoutRedirectCallback: successful"),t}))},e.prototype.signoutPopup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(t=Object.assign({},t)).request_type="so:p";var e=t.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t.post_logout_redirect_uri=e,t.display="popup",t.post_logout_redirect_uri&&(t.state=t.state||{}),this._signout(t,this._popupNavigator,{startUrl:e,popupWindowFeatures:t.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:t.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){i.Log.info("UserManager.signoutPopup: successful")}))},e.prototype.signoutPopupCallback=function(t,e){return void 0===e&&"boolean"==typeof t&&(e=t,t=null),this._popupNavigator.callback(t,e,"?").then((function(){i.Log.info("UserManager.signoutPopupCallback: successful")}))},e.prototype._signout=function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(t,e,n).then((function(t){return r._signoutEnd(t.url)}))},e.prototype._signoutStart=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this,r=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(n).then((function(r){return i.Log.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(o){return i.Log.debug("UserManager._signoutStart: loaded current user from storage"),(e._settings.revokeAccessTokenOnSignout?e._revokeInternal(o):Promise.resolve()).then((function(){var s=t.id_token_hint||o&&o.id_token;return s&&(i.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return i.Log.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest(t).then((function(t){return i.Log.debug("UserManager._signoutStart: got signout request"),n.url=t.url,t.state&&(n.id=t.state.id),r.navigate(n)}))}))}))})).catch((function(t){throw r.close&&(i.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),t}))}))},e.prototype._signoutEnd=function(t){return this.processSignoutResponse(t).then((function(t){return i.Log.debug("UserManager._signoutEnd: got signout response"),t}))},e.prototype.revokeAccessToken=function(){var t=this;return this._loadUser().then((function(e){return t._revokeInternal(e,!0).then((function(r){if(r)return i.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),e.access_token=null,e.refresh_token=null,e.expires_at=null,e.token_type=null,t.storeUser(e).then((function(){i.Log.debug("UserManager.revokeAccessToken: user stored"),t._events.load(e)}))}))})).then((function(){i.Log.info("UserManager.revokeAccessToken: access token revoked successfully")}))},e.prototype._revokeInternal=function(t,e){var r=this;if(t){var n=t.access_token,o=t.refresh_token;return this._revokeAccessTokenInternal(n,e).then((function(t){return r._revokeRefreshTokenInternal(o,e).then((function(e){return t||e||i.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),t||e}))}))}return Promise.resolve(!1)},e.prototype._revokeAccessTokenInternal=function(t,e){return!t||t.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(t,e).then((function(){return!0}))},e.prototype._revokeRefreshTokenInternal=function(t,e){return t?this._tokenRevocationClient.revoke(t,e,"refresh_token").then((function(){return!0})):Promise.resolve(!1)},e.prototype.startSilentRenew=function(){this._silentRenewService.start()},e.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},e.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then((function(t){return t?(i.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(t)):(i.Log.debug("UserManager._loadUser: no user storageString"),null)}))},e.prototype.storeUser=function(t){if(t){i.Log.debug("UserManager.storeUser: storing user");var e=t.toStorageString();return this._userStore.set(this._userStoreKey,e)}return i.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},n(e,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),e}(o.OidcClient)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserManagerSettings=void 0;var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},n=r.popup_redirect_uri,i=r.popup_post_logout_redirect_uri,l=r.popupWindowFeatures,f=r.popupWindowTarget,d=r.silent_redirect_uri,p=r.silentRequestTimeout,g=r.automaticSilentRenew,v=void 0!==g&&g,y=r.validateSubOnSilentRenew,m=void 0!==y&&y,_=r.includeIdTokenInSilentRenew,S=void 0===_||_,b=r.monitorSession,w=void 0===b||b,F=r.monitorAnonymousSession,E=void 0!==F&&F,x=r.checkSessionInterval,k=void 0===x?2e3:x,A=r.stopCheckSessionOnError,P=void 0===A||A,C=r.query_status_response_type,T=r.revokeAccessTokenOnSignout,R=void 0!==T&&T,I=r.accessTokenExpiringNotificationTime,L=void 0===I?60:I,D=r.redirectNavigator,U=void 0===D?new o.RedirectNavigator:D,O=r.popupNavigator,N=void 0===O?new s.PopupNavigator:O,B=r.iframeNavigator,j=void 0===B?new a.IFrameNavigator:B,M=r.userStore,H=void 0===M?new u.WebStorageStateStore({store:c.Global.sessionStorage}):M;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var V=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,arguments[0]));return V._popup_redirect_uri=n,V._popup_post_logout_redirect_uri=i,V._popupWindowFeatures=l,V._popupWindowTarget=f,V._silent_redirect_uri=d,V._silentRequestTimeout=p,V._automaticSilentRenew=v,V._validateSubOnSilentRenew=m,V._includeIdTokenInSilentRenew=S,V._accessTokenExpiringNotificationTime=L,V._monitorSession=w,V._monitorAnonymousSession=E,V._checkSessionInterval=k,V._stopCheckSessionOnError=P,C?V._query_status_response_type=C:arguments[0]&&arguments[0].response_type?V._query_status_response_type=h.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":V._query_status_response_type="id_token",V._revokeAccessTokenOnSignout=R,V._redirectNavigator=U,V._popupNavigator=N,V._iframeNavigator=j,V._userStore=H,V}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),n(e,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),e}(i.OidcClientSettings)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RedirectNavigator=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1])||arguments[1];n.Log.debug("UserManagerEvents.load"),t.prototype.load.call(this,e),r&&this._userLoaded.raise(e)},e.prototype.unload=function(){n.Log.debug("UserManagerEvents.unload"),t.prototype.unload.call(this),this._userUnloaded.raise()},e.prototype.addUserLoaded=function(t){this._userLoaded.addHandler(t)},e.prototype.removeUserLoaded=function(t){this._userLoaded.removeHandler(t)},e.prototype.addUserUnloaded=function(t){this._userUnloaded.addHandler(t)},e.prototype.removeUserUnloaded=function(t){this._userUnloaded.removeHandler(t)},e.prototype.addSilentRenewError=function(t){this._silentRenewError.addHandler(t)},e.prototype.removeSilentRenewError=function(t){this._silentRenewError.removeHandler(t)},e.prototype._raiseSilentRenewError=function(t){n.Log.debug("UserManagerEvents._raiseSilentRenewError",t.message),this._silentRenewError.raise(t)},e.prototype.addUserSignedIn=function(t){this._userSignedIn.addHandler(t)},e.prototype.removeUserSignedIn=function(t){this._userSignedIn.removeHandler(t)},e.prototype._raiseUserSignedIn=function(){n.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},e.prototype.addUserSignedOut=function(t){this._userSignedOut.addHandler(t)},e.prototype.removeUserSignedOut=function(t){this._userSignedOut.removeHandler(t)},e.prototype._raiseUserSignedOut=function(){n.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},e.prototype.addUserSessionChanged=function(t){this._userSessionChanged.addHandler(t)},e.prototype.removeUserSessionChanged=function(t){this._userSessionChanged.removeHandler(t)},e.prototype._raiseUserSessionChanged=function(){n.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},e}(i.AccessTokenEvents)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Timer=void 0;var n=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:o.Global.timer,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,r));return s._timer=n,s._nowFunc=i||function(){return Date.now()/1e3},s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.init=function(t){t<=0&&(t=1),t=parseInt(t);var e=this.now+t;if(this.expiration===e&&this._timerHandle)i.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),i.Log.debug("Timer.init timer "+this._name+" for duration:",t),this._expiration=e;var r=5;t=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;b(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return p}));var n=r(6),i=r.n(n),o=r(7),s=r.n(o),a=r(0),u=r.n(a),c=r(1),h=r.n(c),l=r(4),f=r(2),d="not_checked";window.addEventListener("message",(function(t){"luigi.tpcDisabled"===t.data?(console.warn("Third party cookies are not supported! Silent token renewal might not work!"),d="disabled"):"luigi.tpcEnabled"===t.data&&(d="enabled")}),!1);var p=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,t);var n={redirect_uri:window.location.origin,post_logout_redirect_uri:window.location.origin+"/logout.html",response_type:"id_token token",filterProtocolClaims:!0,loadUserInfo:!1,automaticSilentRenew:!1,accessTokenExpiringNotificationTime:60,thirdPartyCookiesScriptLocation:"",logoutUrl:window.location.origin+"/logout.html",silent_redirect_uri:window.location.origin+"/assets/auth-oidc/silent-callback.html"},o=f.a.deepMerge(n,r);["redirect_uri","post_logout_redirect_uri"].forEach((function(t){o[t]=f.a.prependOrigin(o[t])}));var a=Luigi.getConfigValue("auth.storage"),c=["none","sessionStorage","localStorage"].includes(a);return c&&"none"==a?(o.userStore=new l.WebStorageStateStore({store:new l.InMemoryWebStorage}),o.stateStore=new l.WebStorageStateStore({store:new l.InMemoryWebStorage})):c&&(o.stateStore=new l.WebStorageStateStore({store:window[a]})),this.settings=o,this.client=new l.UserManager(this.settings),this.client.events.addUserLoaded(function(){var t=s()(i.a.mark((function t(e){var r,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.profile,!e.profile||!Luigi.getConfigValue("auth.openIdConnect.profileStorageInterceptorFn")){t.next=5;break}return t.next=4,Luigi.executeConfigFnAsync("auth.openIdConnect.profileStorageInterceptorFn",!0,e.profile);case 4:r=t.sent;case 5:n={accessToken:e.access_token,accessTokenExpirationDate:1e3*e.expires_at,scope:e.scope,idToken:e.id_token,profile:r},Luigi.auth().store.setAuthData(n),window.postMessage({msg:"luigi.auth.tokenIssued",authData:n},window.location.origin);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Promise.all([this._processLoginResponse(),this._processLogoutResponse()]).then((function(){return e}))}var e;return h()(t,[{key:"login",value:function(){return this.client.signinRedirect(this.settings).catch((function(t){return console.error("[OIDC] login() Error",t),t}))}},{key:"logout",value:function(t,e){var r={id_token_hint:t&&t.idToken,state:window.location.href};return this.client.createSignoutRequest(r).then((function(t){e(),window.location=t.url})).catch((function(t){console.error("[OIDC] logout() Error",t),e()}))}},{key:"setTokenExpirationAction",value:function(){var t=this;if(this.settings.automaticSilentRenew||this.client.events.addAccessTokenExpired((function(){Luigi.auth().handleAuthEvent("onAuthExpired",t.settings,void 0,t.settings.logoutUrl+"?error=tokenExpired")})),this.settings.thirdPartyCookiesScriptLocation){var e=document.createElement("iframe");e.src=this.settings.thirdPartyCookiesScriptLocation,e.style.display="none",document.body.appendChild(e)}this.client.events.addSilentRenewError((function(e){var r;switch(e.message){case"interaction_required":case"login_required":case"account_selection_required":case"consent_required":r=t.settings.logoutUrl+"?error=tokenExpired&thirdPartyCookies="+d+"&errorDescription="+e.message;break;default:console.error("[OIDC] addSilentRenewError Error",e),r=t.settings.logoutUrl+"?error=tokenExpired&errorDescription="+e.message}Luigi.auth().handleAuthEvent("onAuthError",t.settings,e,r)}))}},{key:"setTokenExpireSoonAction",value:function(){var t=this;this.client.events.addAccessTokenExpiring((function(){Luigi.auth().handleAuthEvent("onAuthExpireSoon",t.settings)}))}},{key:"_processLogoutResponse",value:function(){var t=this;return new Promise((function(e,r){window.location.href.indexOf("?logout")>=0&&t.client.processSignoutResponse().then((function(t){Luigi.auth().store.removeAuthData(),e(t)})).catch((function(t){r(response),console.error("[OIDC] Logout Error",t)})),e(!0)}))}},{key:"_processLoginResponse",value:function(){var t=this;return new Promise((function(e,r){var n,i,o=t.settings.response_type,s=t.settings.response_mode;if(o.indexOf("code")>-1?(n="code",i=s&&"fragment"===s?"hash":"search"):(n="access_token",i=s?"fragment"===s?"hash":"search":"hash"),-1===window.location[i].indexOf(n))return e(!0);t.tryToSignIn().then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.error)return console.error("[OIDC] Error",t.error,t.error_description,t);setTimeout((function(){t.state?history.pushState("",document.title,decodeURIComponent(t.state)):history.pushState("",document.title,window.location.pathname+window.location.search),e(!0)}),50)})).catch((function(e){console.error("[OIDC] tryToSignIn Error",e),Luigi.auth().store.removeAuthData(),Luigi.auth().handleAuthEvent("onAuthExpired",t.settings,e,t.settings.logoutUrl+"?error=loginError")}))}))}},{key:"tryToSignIn",value:(e=s()(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.signinRedirectCallback();case 3:console.debug("[OIDC] User was redirected via the sign-in page. Now signed in."),t.next=12;break;case 6:return t.prev=6,t.t0=t.catch(0),console.debug("[OIDC] Error. Sign-in redirect callback doesn't work. Let's try a silent sign-in.",t.t0),t.next=11,this.client.signinSilent();case 11:console.debug("[OIDC] Silent sign-in completed.");case 12:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(){return e.apply(this,arguments)})}]),t}()}]).default},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=async(t,e,r)=>{fetch(t+"api/v1/login/",{method:"POST",body:JSON.stringify({serviceName:"keycloak",accessToken:r,expiresIn:200}),headers:{"Content-type":"application/json; charset=UTF-8"}}).then(r=>r.json().then(r=>{e.contentWindow.postMessage({event:"login-with-token",loginToken:r.data.authToken},t)}))},s=async(t,e,r)=>{e.contentWindow.postMessage({event:"login-with-token",token:"Bearer "+r},t),console.log("posted message")};Luigi.setConfig({navigation:{nodes:()=>[{pathSegment:"dashboard",label:"h",viewUrl:"/sampleapp.html#/home",anonymousAccess:!0,children:[{pathSegment:"home",label:"Home",icon:"house-2-2",viewUrl:"/sampleapp.html#/home",category:"Main menu",anonymousAccess:!0},{pathSegment:"login",label:"Login",icon:"gauge-dashboard-2",viewUrl:"/sampleapp.html#/login",category:"Main menu",anonymousAccess:!0},{pathSegment:"bothub",label:"Bothub",icon:"science-fiction-robot-2",viewUrl:"http://localhost:8081/",category:"Systems",loadingIndicator:{enabled:!1},anonymousAccess:!0},{pathSegment:"push",label:"Push",icon:"hierarchy-3-2",viewUrl:"https://rp-connect.push.al/oidc/authenticate/",category:"Systems",loadingIndicator:{enabled:!1,hideAutomatically:!0},anonymousAccess:!0},{pathSegment:"rocketchat",label:"RocketChat",icon:"messaging-we-chat-2",viewUrl:"https://platform-rocket-test.push.al/",category:"Systems",loadingIndicator:{enabled:!1,hideAutomatically:!0},anonymousAccess:!0}]}]},settings:{hideNavigation:!0,responsiveNavigation:"semiCollapsible",iframeCreationInterceptor:(t,e,r,n)=>{const i=Luigi.auth().store.getAuthData();var a=null;i&&i.accessToken&&("rocketchat"==r.pathSegment?a=()=>{const e=Luigi.elements().getCurrentMicrofrontendIframe();e.src===t.src&&o(t.src,e,i.accessToken)}:"bothub"==r.pathSegment&&(a=()=>{const e=Luigi.elements().getCurrentMicrofrontendIframe();e.src===t.src&&s(t.src,e,i.accessToken)})),t.onload=a},appLoadingIndicator:{hideAutomatically:!0},header:{title:"Weni",logo:"/logo.png"}},communication:{customMessagesListeners:{"on login":t=>{console.log({data:t}),Luigi.auth().login()},"on logout":()=>{Luigi.auth().logout()}}},lifecycleHooks:{luigiAfterInit:()=>{document.getElementById("navbar").appendChild(document.getElementsByClassName("iframeContainer")[0])}},auth:{use:"openIdConnect",openIdConnect:{idpProvider:i.a,authority:"http://keycloak-connect.push.al/auth/realms/ilhasoft/",client_id:"connect-frontend",response_type:"code",response_mode:"fragment",automaticSilentRenew:!0,userInfoFn:async(t,e)=>({name:"name",email:"email"}),accessTokenExpiringNotificationTime:60},disableAutoLogin:!0}})}]); \ No newline at end of file diff --git a/public/auth/callback.html b/public/auth/callback.html deleted file mode 100644 index 1ce0758f..00000000 --- a/public/auth/callback.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/auth/idpmock/implicit.html b/public/auth/idpmock/implicit.html deleted file mode 100644 index 89b5ad3c..00000000 --- a/public/auth/idpmock/implicit.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - Luigi Mock Identity Provider - - - - - - - - - diff --git a/public/auth/idpmock/implicit.js b/public/auth/idpmock/implicit.js deleted file mode 100644 index 3050c32f..00000000 --- a/public/auth/idpmock/implicit.js +++ /dev/null @@ -1,24 +0,0 @@ -window.onload = function () { - const loginButton = document.getElementById('login-button'); - const expiresIn = 3600; - const state = encodeURIComponent(new URLSearchParams(window.location.search).get("state")); - const goTo = (scope) => { - return `/auth/callback.html# - expires_in=${expiresIn}& - state=${state}& - scope=${scope}& - access_token=thisisanaccesstokenthatisnotreallyneeded& - id_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. - eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAiLCJzdWIiOiJtYXNrb3BhdG9sIiwiZXhwIjoxNjQzNzY0OTIwLCJhe - nAiOiJtYXNrb3BhdG9sIiwibm9uY2UiOiJidE5rWVZzc1FldVlWNmEyR1RVZm1wWVFFelBRN3c1ZENCbU54SG54IiwiZW - 1haWwiOiJsdWlnaXVzZXJAa3ltYS5jeCJ9.80GanA3z-Rl67VQAb-lvMNpDZKcVI32CQZIoM9imF5w& - token_type=bearer`; - } - - loginButton.addEventListener('click', function (ev) { - ev.preventDefault(); - const username = document.getElementById('username').value; - const scope = (username == 'admin') ? 'admin' : 'viewer'; - window.location.replace(goTo(scope).replace(/\s\s+/g, '')); - }); -}; diff --git a/public/auth/idpmock/logout.html b/public/auth/idpmock/logout.html deleted file mode 100644 index 02b0968b..00000000 --- a/public/auth/idpmock/logout.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Luigi Mock Identity Provider - - - - Logging out... - - - - \ No newline at end of file diff --git a/public/auth/logout.html b/public/auth/logout.html deleted file mode 100644 index 300d8282..00000000 --- a/public/auth/logout.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - Logout successful - - - - - - - -
-
- -
- Logout successful -
-
- -
-
- - - \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico index df36fcfb..3af02f9c 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index f079aab6..e7eb8ac7 100644 --- a/public/index.html +++ b/public/index.html @@ -8,22 +8,15 @@ /> - + - - +