1 line
125 KiB
JavaScript
1 line
125 KiB
JavaScript
(()=>{var e={21:function(e,t,n){var i;e.exports=(i=i||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==n.g&&n.g.crypto&&(t=n.g.crypto),!t)try{t=n(477)}catch(e){}var i=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},s=a.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(var s=0;s<r;s+=4)t[i+s>>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),u=o.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,t)}},h=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,o);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(r,d);n=r.splice(0,u),i.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(a.Hasher=f.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),o.algo={});return o}(Math),i)},25:function(e,t,n){var i,r,o;e.exports=(r=(i=n(21)).lib.Base,o=i.enc.Utf8,void(i.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),a=this._iKey=t.clone(),s=r.words,c=a.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;r.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))},112:()=>{"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(e,t){(arguments.length?this.then.apply(this,arguments):this).then(null,(function(e){setTimeout((function(){throw e}),0)}))})},165:function(e,t,n){var i,r,o,a,s,c,u,l,d,h,f,p,m,v,g,y,w,b,S;e.exports=(i=n(21),n(506),void(i.lib.Cipher||(r=i,o=r.lib,a=o.Base,s=o.WordArray,c=o.BufferedBlockAlgorithm,u=r.enc,u.Utf8,l=u.Base64,d=r.algo.EvpKDF,h=o.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?S:w}return function(t){return{encrypt:function(n,i,r){return e(i).encrypt(t,n,i,r)},decrypt:function(n,i,r){return e(i).decrypt(t,n,i,r)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=r.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),m=f.CBC=function(){var e=p.extend();function t(e,t,n){var i,r=this._iv;r?(i=r,this._iv=void 0):i=this._prevBlock;for(var o=0;o<n;o++)e[t+o]^=i[o]}return e.Encryptor=e.extend({processBlock:function(e,n){var i=this._cipher,r=i.blockSize;t.call(this,e,n,r),i.encryptBlock(e,n),this._prevBlock=e.slice(n,n+r)}}),e.Decryptor=e.extend({processBlock:function(e,n){var i=this._cipher,r=i.blockSize,o=e.slice(n,n+r);i.decryptBlock(e,n),t.call(this,e,n,r),this._prevBlock=o}}),e}(),v=(r.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,r=i<<24|i<<16|i<<8|i,o=[],a=0;a<i;a+=4)o.push(r);var c=s.create(o,i);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var e;h.reset.call(this);var t=this.cfg,n=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(i,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),g=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(t):t).toString(l)},parse:function(e){var t,n=l.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=s.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},w=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i),o=r.finalize(t),a=r.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(r.kdf={}).OpenSSL={execute:function(e,t,n,i,r){if(i||(i=s.random(8)),r)o=d.create({keySize:t+n,hasher:r}).compute(e,i);else var o=d.create({keySize:t+n}).compute(e,i);var a=s.create(o.words.slice(t),4*n);return o.sigBytes=4*t,g.create({key:o,iv:a,salt:i})}},S=o.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:b}),encrypt:function(e,t,n,i){var r=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize,i.salt,i.hasher);i.iv=r.iv;var o=w.encrypt.call(this,e,t,r.key,i);return o.mixIn(r),o},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var r=i.kdf.execute(n,e.keySize,e.ivSize,t.salt,i.hasher);return i.iv=r.iv,w.decrypt.call(this,e,t,r.key,i)}}))))},178:function(e,t,n){e.exports=n(21).enc.Utf8},236:(e,t,n)=>{"use strict";var i=n(795),r=[],o=[],a=i.makeRequestCallFromTimer((function(){if(o.length)throw o.shift()}));function s(e){var t;(t=r.length?r.pop():new c).task=e,i(t)}function c(){this.task=null}e.exports=s,c.prototype.call=function(){try{this.task.call()}catch(e){s.onerror?s.onerror(e):(o.push(e),a())}finally{this.task=null,r[r.length]=this}}},471:function(e,t,n){var i,r,o,a,s,c,u,l;e.exports=(r=(i=l=n(21)).lib,o=r.WordArray,a=r.Hasher,s=i.algo,c=[],u=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=0;u<80;u++){if(u<16)c[u]=0|e[t+u];else{var l=c[u-3]^c[u-8]^c[u-14]^c[u-16];c[u]=l<<1|l>>>31}var d=(i<<5|i>>>27)+s+c[u];d+=u<20?1518500249+(r&o|~r&a):u<40?1859775393+(r^o^a):u<60?(r&o|r&a|o&a)-1894007588:(r^o^a)-899497514,s=a,a=o,o=r<<30|r>>>2,r=i,i=d}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=a._createHelper(u),i.HmacSHA1=a._createHmacHelper(u),l.SHA1)},477:()=>{},506:function(e,t,n){var i,r,o,a,s,c,u,l;e.exports=(l=n(21),n(471),n(25),o=(r=(i=l).lib).Base,a=r.WordArray,c=(s=i.algo).MD5,u=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,i=this.cfg,r=i.hasher.create(),o=a.create(),s=o.words,c=i.keySize,u=i.iterations;s.length<c;){n&&r.update(n),n=r.update(e).finalize(t),r.reset();for(var l=1;l<u;l++)n=r.finalize(n),r.reset();o.concat(n)}return o.sigBytes=4*c,o}}),i.EvpKDF=function(e,t,n){return u.create(n).compute(e,t)},l.EvpKDF)},551:(e,t,n)=>{"use strict";var i=n(795);function r(){}var o=null,a={};function s(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._x=0,this._y=0,this._z=null,this._A=null,e!==r&&f(e,this)}function c(e,t){for(;3===e._y;)e=e._z;if(s._B&&s._B(e),0===e._y)return 0===e._x?(e._x=1,void(e._A=t)):1===e._x?(e._x=2,void(e._A=[e._A,t])):void e._A.push(t);!function(e,t){i((function(){var n=1===e._y?t.onFulfilled:t.onRejected;if(null!==n){var i=function(e,t){try{return e(t)}catch(e){return o=e,a}}(n,e._z);i===a?l(t.promise,o):u(t.promise,i)}else 1===e._y?u(t.promise,e._z):l(t.promise,e._z)}))}(e,t)}function u(e,t){if(t===e)return l(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var n=function(e){try{return e.then}catch(e){return o=e,a}}(t);if(n===a)return l(e,o);if(n===e.then&&t instanceof s)return e._y=3,e._z=t,void d(e);if("function"==typeof n)return void f(n.bind(t),e)}e._y=1,e._z=t,d(e)}function l(e,t){e._y=2,e._z=t,s._C&&s._C(e,t),d(e)}function d(e){if(1===e._x&&(c(e,e._A),e._A=null),2===e._x){for(var t=0;t<e._A.length;t++)c(e,e._A[t]);e._A=null}}function h(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1,i=function(e){try{e((function(e){n||(n=!0,u(t,e))}),(function(e){n||(n=!0,l(t,e))}))}catch(e){return o=e,a}}(e);n||i!==a||(n=!0,l(t,o))}e.exports=s,s._B=null,s._C=null,s._D=r,s.prototype.then=function(e,t){if(this.constructor!==s)return function(e,t,n){return new e.constructor((function(i,o){var a=new s(r);a.then(i,o),c(e,new h(t,n,a))}))}(this,e,t);var n=new s(r);return c(this,new h(e,t,n)),n}},635:(e,t,n)=>{"use strict";var i=n(551);e.exports=i;var r=l(!0),o=l(!1),a=l(null),s=l(void 0),c=l(0),u=l("");function l(e){var t=new i(i._D);return t._y=1,t._z=e,t}i.resolve=function(e){if(e instanceof i)return e;if(null===e)return a;if(void 0===e)return s;if(!0===e)return r;if(!1===e)return o;if(0===e)return c;if(""===e)return u;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new i(t.bind(e))}catch(e){return new i((function(t,n){n(e)}))}return l(e)};var d=function(e){return"function"==typeof Array.from?(d=Array.from,Array.from(e)):(d=function(e){return Array.prototype.slice.call(e)},Array.prototype.slice.call(e))};function h(e){return{status:"fulfilled",value:e}}function f(e){return{status:"rejected",reason:e}}function p(e){if(e&&("object"==typeof e||"function"==typeof e)){if(e instanceof i&&e.then===i.prototype.then)return e.then(h,f);var t=e.then;if("function"==typeof t)return new i(t.bind(e)).then(h,f)}return h(e)}function m(e){if("function"==typeof AggregateError)return new AggregateError(e,"All promises were rejected");var t=new Error("All promises were rejected");return t.name="AggregateError",t.errors=e,t}i.all=function(e){var t=d(e);return new i((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(a,s){if(s&&("object"==typeof s||"function"==typeof s)){if(s instanceof i&&s.then===i.prototype.then){for(;3===s._y;)s=s._z;return 1===s._y?o(a,s._z):(2===s._y&&n(s._z),void s.then((function(e){o(a,e)}),n))}var c=s.then;if("function"==typeof c)return void new i(c.bind(s)).then((function(e){o(a,e)}),n)}t[a]=s,0==--r&&e(t)}for(var a=0;a<t.length;a++)o(a,t[a])}))},i.allSettled=function(e){return i.all(d(e).map(p))},i.reject=function(e){return new i((function(t,n){n(e)}))},i.race=function(e){return new i((function(t,n){d(e).forEach((function(e){i.resolve(e).then(t,n)}))}))},i.prototype.catch=function(e){return this.then(null,e)},i.any=function(e){return new i((function(t,n){var r=d(e),o=!1,a=[];function s(e){o||(o=!0,t(e))}function c(e){a.push(e),a.length===r.length&&n(m(a))}0===r.length?n(m(a)):r.forEach((function(e){i.resolve(e).then(s,c)}))}))}},636:function(e,t,n){var i;e.exports=(i=n(21),function(e){var t=i,n=t.lib,r=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,r=e[i];e[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],m=e[t+4],v=e[t+5],g=e[t+6],y=e[t+7],w=e[t+8],b=e[t+9],S=e[t+10],_=e[t+11],k=e[t+12],C=e[t+13],O=e[t+14],I=e[t+15],T=o[0],x=o[1],j=o[2],L=o[3];T=u(T,x,j,L,a,7,s[0]),L=u(L,T,x,j,c,12,s[1]),j=u(j,L,T,x,f,17,s[2]),x=u(x,j,L,T,p,22,s[3]),T=u(T,x,j,L,m,7,s[4]),L=u(L,T,x,j,v,12,s[5]),j=u(j,L,T,x,g,17,s[6]),x=u(x,j,L,T,y,22,s[7]),T=u(T,x,j,L,w,7,s[8]),L=u(L,T,x,j,b,12,s[9]),j=u(j,L,T,x,S,17,s[10]),x=u(x,j,L,T,_,22,s[11]),T=u(T,x,j,L,k,7,s[12]),L=u(L,T,x,j,C,12,s[13]),j=u(j,L,T,x,O,17,s[14]),T=l(T,x=u(x,j,L,T,I,22,s[15]),j,L,c,5,s[16]),L=l(L,T,x,j,g,9,s[17]),j=l(j,L,T,x,_,14,s[18]),x=l(x,j,L,T,a,20,s[19]),T=l(T,x,j,L,v,5,s[20]),L=l(L,T,x,j,S,9,s[21]),j=l(j,L,T,x,I,14,s[22]),x=l(x,j,L,T,m,20,s[23]),T=l(T,x,j,L,b,5,s[24]),L=l(L,T,x,j,O,9,s[25]),j=l(j,L,T,x,p,14,s[26]),x=l(x,j,L,T,w,20,s[27]),T=l(T,x,j,L,C,5,s[28]),L=l(L,T,x,j,f,9,s[29]),j=l(j,L,T,x,y,14,s[30]),T=d(T,x=l(x,j,L,T,k,20,s[31]),j,L,v,4,s[32]),L=d(L,T,x,j,w,11,s[33]),j=d(j,L,T,x,_,16,s[34]),x=d(x,j,L,T,O,23,s[35]),T=d(T,x,j,L,c,4,s[36]),L=d(L,T,x,j,m,11,s[37]),j=d(j,L,T,x,y,16,s[38]),x=d(x,j,L,T,S,23,s[39]),T=d(T,x,j,L,C,4,s[40]),L=d(L,T,x,j,a,11,s[41]),j=d(j,L,T,x,p,16,s[42]),x=d(x,j,L,T,g,23,s[43]),T=d(T,x,j,L,b,4,s[44]),L=d(L,T,x,j,k,11,s[45]),j=d(j,L,T,x,I,16,s[46]),T=h(T,x=d(x,j,L,T,f,23,s[47]),j,L,a,6,s[48]),L=h(L,T,x,j,y,10,s[49]),j=h(j,L,T,x,O,15,s[50]),x=h(x,j,L,T,v,21,s[51]),T=h(T,x,j,L,k,6,s[52]),L=h(L,T,x,j,p,10,s[53]),j=h(j,L,T,x,S,15,s[54]),x=h(x,j,L,T,c,21,s[55]),T=h(T,x,j,L,w,6,s[56]),L=h(L,T,x,j,I,10,s[57]),j=h(j,L,T,x,g,15,s[58]),x=h(x,j,L,T,C,21,s[59]),T=h(T,x,j,L,m,6,s[60]),L=h(L,T,x,j,_,10,s[61]),j=h(j,L,T,x,f,15,s[62]),x=h(x,j,L,T,b,21,s[63]),o[0]=o[0]+T|0,o[1]=o[1]+x|0,o[2]=o[2]+j|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;var o=e.floor(i/4294967296),a=i;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,i,r,o,a){var s=e+(t&n|~t&i)+r+a;return(s<<o|s>>>32-o)+t}function l(e,t,n,i,r,o,a){var s=e+(t&i|n&~i)+r+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,i,r,o,a){var s=e+(t^n^i)+r+a;return(s<<o|s>>>32-o)+t}function h(e,t,n,i,r,o,a){var s=e+(n^(t|~i))+r+a;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),i.MD5)},754:function(e,t,n){var i,r,o;e.exports=(i=n(21),o=(r=i).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)r.push(i.charAt(a>>>6*(3-s)&63));var c=i.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r<n.length;r++)i[n.charCodeAt(r)]=r}var a=n.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,n){for(var i=[],r=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;i[r>>>2]|=s<<24-r%4*8,r++}return o.create(i,r)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},795:(e,t,n)=>{"use strict";function i(e){o.length||r(),o[o.length]=e}e.exports=i;var r,o=[],a=0;function s(){for(;a<o.length;){var e=a;if(a+=1,o[e].call(),a>1024){for(var t=0,n=o.length-a;t<n;t++)o[t]=o[t+a];o.length-=a,a=0}}o.length=0,a=0}var c,u,l,d=void 0!==n.g?n.g:self,h=d.MutationObserver||d.WebKitMutationObserver;function f(e){return function(){var t=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(t),clearInterval(n),e()}}}"function"==typeof h?(c=1,u=new h(s),l=document.createTextNode(""),u.observe(l,{characterData:!0}),r=function(){c=-c,l.data=c}):r=f(s),i.requestFlush=r,i.makeRequestCallFromTimer=f},831:(e,t,n)=>{n(236),"undefined"==typeof Promise&&(Promise=n(551),n(635)),n(112)},955:function(e,t,n){var i;e.exports=(i=n(21),n(754),n(636),n(506),n(165),function(){var e=i,t=e.lib.BlockCipher,n=e.algo,r=[],o=[],a=[],s=[],c=[],u=[],l=[],d=[],h=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,i=0;for(t=0;t<256;t++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,r[n]=p,o[p]=n;var m=e[n],v=e[m],g=e[v],y=257*e[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,u[n]=y,y=16843009*g^65537*v^257*m^16843008*n,l[p]=y<<24|y>>>8,d[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,f[p]=y,n?(n=m^e[e[e[g^m]]],i^=e[e[i]]):n=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,i=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<i;a++)a<n?o[a]=t[a]:(u=o[a-1],a%n?n>6&&a%n==4&&(u=r[u>>>24]<<24|r[u>>>16&255]<<16|r[u>>>8&255]<<8|r[255&u]):(u=r[(u=u<<8|u>>>24)>>>24]<<24|r[u>>>16&255]<<16|r[u>>>8&255]<<8|r[255&u],u^=p[a/n|0]<<24),o[a]=o[a-n]^u);for(var s=this._invKeySchedule=[],c=0;c<i;c++){if(a=i-c,c%4)var u=o[a];else u=o[a-4];s[c]=c<4||a<=4?u:l[r[u>>>24]]^d[r[u>>>16&255]]^h[r[u>>>8&255]]^f[r[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,d,h,f,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,r,o,a,s){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],d=e[t+2]^n[2],h=e[t+3]^n[3],f=4,p=1;p<c;p++){var m=i[u>>>24]^r[l>>>16&255]^o[d>>>8&255]^a[255&h]^n[f++],v=i[l>>>24]^r[d>>>16&255]^o[h>>>8&255]^a[255&u]^n[f++],g=i[d>>>24]^r[h>>>16&255]^o[u>>>8&255]^a[255&l]^n[f++],y=i[h>>>24]^r[u>>>16&255]^o[l>>>8&255]^a[255&d]^n[f++];u=m,l=v,d=g,h=y}m=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&h])^n[f++],v=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^n[f++],g=(s[d>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^n[f++],y=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^n[f++],e[t]=m,e[t+1]=v,e[t+2]=g,e[t+3]=y},keySize:8});e.AES=t._createHelper(m)}(),i.AES)},972:function(e){e.exports=(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{default:()=>d});const n=(...e)=>{},i=e=>null!==e&&"Object"===(null==e?void 0:e.constructor.name);let r,o;const a=()=>{if(!r){r=!0;try{o=u.storage||localStorage,o.getItem("")}catch{o=(()=>{const e={getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{t[e]=void 0},clear:()=>{t={__proto__:e}}};let t={__proto__:e};return t})()}l()}},s=String.fromCharCode(0),c=(e,t,n=!0)=>n?[...JSON.stringify(e)].map((e=>String.fromCharCode(e.charCodeAt(0)+t))).join(""):JSON.parse([...e].map((e=>String.fromCharCode(e.charCodeAt(0)-t))).join("")),u={ttl:null,encrypt:!1,encrypter:c,decrypter:(e,t)=>c(e,t,!1),secret:75,storage:void 0};Object.seal(u);const l=(e=!1)=>{a();for(const t of Object.keys(o)){const n=o.getItem(t);let r;try{r=JSON.parse(n||"")}catch{continue}i(r)&&s in r&&(Date.now()>r.ttl||e)&&o.removeItem(t)}},d={config:u,set:(e,t,i={})=>{a();const r={...u,...i,encrypt:!1!==i.encrypt&&(i.encrypt||u.encrypt),ttl:null===i.ttl?null:i.ttl||u.ttl};try{const i=r.ttl&&!isNaN(r.ttl)&&r.ttl>0;let a=i?{[s]:t,ttl:Date.now()+1e3*r.ttl}:t;r.encrypt&&(i?a[s]=(r.encrypter||n)(a[s],r.secret):a=(r.encrypter||n)(a,r.secret)),o.setItem(e,JSON.stringify(a))}catch{return!1}},get:(e,t={})=>{a();const r=o.getItem(e),c={...u,...t,encrypt:!1!==t.encrypt&&(t.encrypt||u.encrypt),ttl:null===t.ttl?null:t.ttl||u.ttl};let l,d;try{l=JSON.parse(r||""),d=i(l)&&s in l,(c.decrypt||c.encrypt)&&(d?l[s]=(c.decrypter||n)(l[s],c.secret):l=(c.decrypter||n)(l,c.secret))}catch{}return d?Date.now()>l.ttl?(o.removeItem(e),null):l[s]:void 0!==l?l:r},flush:l,clear:()=>{a(),o.clear()},remove:e=>{a(),o.removeItem(e)}};return t.default})()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}n(831),"function"==typeof SuppressedError&&SuppressedError;var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var o=r((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var i=e.locked.get(t);void 0===i?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(i.unshift(n),e.locked.set(t,i))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,i){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var i=n.pop();e.locked.set(t,n),void 0!==i&&setTimeout(i,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}}));i(o);var a=i(r((function(e,n){var i=t&&t.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,s)}c((i=i.apply(e,t||[])).next())}))},r=t&&t.__generator||function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},a=t;Object.defineProperty(n,"__esModule",{value:!0});var s="browser-tabs-lock-key",c={key:function(e){return i(a,void 0,void 0,(function(){return r(this,(function(e){throw new Error("Unsupported")}))}))},getItem:function(e){return i(a,void 0,void 0,(function(){return r(this,(function(e){throw new Error("Unsupported")}))}))},clear:function(){return i(a,void 0,void 0,(function(){return r(this,(function(e){return[2,window.localStorage.clear()]}))}))},removeItem:function(e){return i(a,void 0,void 0,(function(){return r(this,(function(e){throw new Error("Unsupported")}))}))},setItem:function(e,t){return i(a,void 0,void 0,(function(){return r(this,(function(e){throw new Error("Unsupported")}))}))},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function u(e){return new Promise((function(t){return setTimeout(t,e)}))}function l(e){for(var t="",n=0;n<e;n++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var d=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return void 0===n&&(n=5e3),i(this,void 0,void 0,(function(){var i,o,a,d,h,f,p;return r(this,(function(r){switch(r.label){case 0:i=Date.now()+l(4),o=Date.now()+n,a=s+"-"+t,d=void 0===this.storageHandler?c:this.storageHandler,r.label=1;case 1:return Date.now()<o?[4,u(30)]:[3,8];case 2:return r.sent(),null!==d.getItemSync(a)?[3,5]:(h=this.id+"-"+t+"-"+i,[4,u(Math.floor(25*Math.random()))]);case 3:return r.sent(),d.setItemSync(a,JSON.stringify({id:this.id,iat:i,timeoutKey:h,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,u(30)];case 4:return r.sent(),null!==(f=d.getItemSync(a))&&(p=JSON.parse(f)).id===this.id&&p.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(a,i),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?c:this.storageHandler),[4,this.waitForSomethingToChange(o)];case 6:r.sent(),r.label=7;case 7:return i=Date.now()+l(4),[3,1];case 8:return[2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return i(this,void 0,void 0,(function(){var n=this;return r(this,(function(a){return setTimeout((function(){return i(n,void 0,void 0,(function(){var n,i,a;return r(this,(function(r){switch(r.label){case 0:return[4,o.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?c:this.storageHandler,null===(i=n.getItemSync(e))?(o.default().unlock(t),[2]):((a=JSON.parse(i)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(a)),o.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(o.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return i(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n){var i=!1,r=Date.now(),o=!1;function a(){if(o||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(s),o=!0),!i){i=!0;var t=50-(Date.now()-r);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return i(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return i(this,void 0,void 0,(function(){var n,i,a,u;return r(this,(function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?c:this.storageHandler,i=s+"-"+t,null===(a=n.getItemSync(i))?[2]:(u=JSON.parse(a)).id!==this.id?[3,2]:[4,o.default().lock(u.iat)];case 1:r.sent(),this.acquiredIatSet.delete(u.iat),n.removeItemSync(i),o.default().unlock(u.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(t){for(var n=Date.now()-5e3,i=t,r=[],o=0;;){var a=i.keySync(o);if(null===a)break;r.push(a),o++}for(var c=!1,u=0;u<r.length;u++){var l=r[u];if(l.includes(s)){var d=i.getItemSync(l);if(null!==d){var h=JSON.parse(d);(void 0===h.timeRefreshed&&h.timeAcquired<n||void 0!==h.timeRefreshed&&h.timeRefreshed<n)&&(i.removeItemSync(l),c=!0)}}}c&&e.notifyWaiters()},e.waiters=void 0,e}();n.default=d})));const s={timeoutInSeconds:60},c={name:"auth0-spa-js",version:"2.1.3"},u=()=>Date.now();class l extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,l.prototype)}static fromPayload({error:e,error_description:t}){return new l(e,t)}}class d extends l{constructor(e,t,n,i=null){super(e,t),this.state=n,this.appState=i,Object.setPrototypeOf(this,d.prototype)}}class h extends l{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,h.prototype)}}class f extends h{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,f.prototype)}}class p extends l{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,p.prototype)}}class m extends l{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,m.prototype)}}class v extends l{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${g(e,["default"])}', scope: '${g(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,v.prototype)}}function g(e,t=[]){return e&&!t.includes(e)?e:""}const y=()=>window.crypto,w=()=>{let e="";return Array.from(y().getRandomValues(new Uint8Array(43))).forEach((t=>e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[t%66])),e},b=e=>btoa(e),S=t=>{var{clientId:n}=t,i=e(t,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter((t=>void 0!==e[t])).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{}))(Object.assign({client_id:n},i))).toString()},_=e=>(e=>decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),k=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},C=async(e,t,n,i,r,o,a=1e4)=>r?(async(e,t,n,i,r,o,a)=>{return s={auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:i,useFormData:a},c=o,new Promise((function(e,t){const n=new MessageChannel;n.port1.onmessage=function(i){i.data.error?t(new Error(i.data.error)):e(i.data),n.port1.close()},c.postMessage(s,[n.port2])}));var s,c})(e,t,n,i,a,r,o):(async(e,t,n)=>{const i=new AbortController;let r;return t.signal=i.signal,Promise.race([k(e,t),new Promise(((e,t)=>{r=setTimeout((()=>{i.abort(),t(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((()=>{clearTimeout(r)}))})(e,i,a);async function O(t,n){var{baseUrl:i,timeout:r,audience:o,scope:a,auth0Client:s,useFormData:u}=t,d=e(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const h=u?S(d):JSON.stringify(d);return await async function(t,n,i,r,o,a,s){let c,u=null;for(let e=0;e<3;e++)try{c=await C(t,i,r,o,a,s,n),u=null;break}catch(e){u=e}if(u)throw u;const d=c.json,{error:h,error_description:f}=d,p=e(d,["error","error_description"]),{ok:g}=c;if(!g){const e=f||`HTTP error. Unable to fetch ${t}`;if("mfa_required"===h)throw new m(h,e,p.mfa_token);if("missing_refresh_token"===h)throw new v(i,r);throw new l(h||"request_error",e)}return p}(`${i}/oauth/token`,r,o||"default",a,{method:"POST",body:h,headers:{"Content-Type":u?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(s||c))}},n,u)}const I=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class T{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,i,r]=e.split("::");return new T({clientId:n,scope:r,audience:i},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:i}=e;return new T({scope:t,audience:n,clientId:i})}}class x{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}}class j{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class L{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||u}async setIdToken(e,t,n){var i;const r=this.getIdTokenCacheKey(e);await this.cache.set(r,{id_token:t,decodedToken:n}),await(null===(i=this.keyManifest)||void 0===i?void 0:i.add(r))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0){var n;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const n=this.matchExistingCacheKey(e,t);n&&(i=await this.cache.get(n))}if(!i)return;const r=await this.nowProvider(),o=Math.floor(r/1e3);return i.expiresAt-t<o?i.body.refresh_token?(i.body={refresh_token:i.body.refresh_token},await this.cache.set(e.toKey(),i),i.body):(await this.cache.remove(e.toKey()),void await(null===(n=this.keyManifest)||void 0===n?void 0:n.remove(e.toKey()))):i.body}async set(e){var t;const n=new T({clientId:e.client_id,scope:e.scope,audience:e.audience}),i=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),i),await(null===(t=this.keyManifest)||void 0===t?void 0:t.add(n.toKey()))}async clear(e){var t;const n=await this.getCacheKeys();n&&(await n.filter((t=>!e||t.includes(e))).reduce((async(e,t)=>{await e,await this.cache.remove(t)}),Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new T({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter((t=>{var n;const i=T.fromKey(t),r=new Set(i.scope&&i.scope.split(" ")),o=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=i.scope&&o.reduce(((e,t)=>e&&r.has(t)),!0);return"@@auth0spajs@@"===i.prefix&&i.clientId===e.clientId&&i.audience===e.audience&&a}))[0]}}class A{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const E=e=>"number"==typeof e,P=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var W=r((function(e,n){var i=t&&t.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function a(e){for(var t={},n=e?e.split("; "):[],i=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var o=n[r].split("="),a=o.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[o[0].replace(i,decodeURIComponent)]=a.replace(i,decodeURIComponent)}catch(e){}}return t}function s(){return a(document.cookie)}function c(e,t,n){document.cookie=o(e,t,i({path:"/"},n))}n.__esModule=!0,n.encode=o,n.parse=a,n.getAll=s,n.get=function(e){return s()[e]},n.set=c,n.remove=function(e,t){c(e,"",i(i({},t),{expires:-1}))}}));i(W),W.encode,W.parse,W.getAll;var R=W.get,z=W.set,Z=W.remove;const V={get(e){const t=R(e);if(void 0!==t)return JSON.parse(t)},save(e,t,n){let i={};"https:"===window.location.protocol&&(i={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(i.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(i.domain=n.cookieDomain),z(e,JSON.stringify(t),i)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Z(e,n)}},D={get:e=>V.get(e)||V.get(`_legacy_${e}`),save(e,t,n){let i={};"https:"===window.location.protocol&&(i={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(i.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(i.domain=n.cookieDomain),z(`_legacy_${e}`,JSON.stringify(t),i),V.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Z(e,n),V.remove(e,t),V.remove(`_legacy_${e}`,t)}},U={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var M,N=function(e){return M=M||function(){var e=function(e){var t=atob(e);return t}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo="),t=e.indexOf("\n",10)+1,n=e.substring(t)+"",i=new Blob([n],{type:"application/javascript"});return URL.createObjectURL(i)}(),new Worker(M,e)};const F={};class X{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;const n=new Set((null===(t=await this.cache.get(this.manifestKey))||void 0===t?void 0:t.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const t=await this.cache.get(this.manifestKey);if(t){const n=new Set(t.keys);return n.delete(e),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const H={memory:()=>(new j).enclosedCache,localstorage:()=>new x},B=e=>H[e],G=t=>{const{openUrl:n,onRedirect:i}=t,r=e(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===n||n?n:i})},Y=new a;class J{constructor(e){let t,n;if(this.userCache=(new j).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await Y.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!y())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===y().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!B(t))throw new Error(`Invalid cache location "${t}"`);n=B(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?V:D,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const i=e.useCookiesForTransactions?this.cookieStorage:U;var r;this.scope=I("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new A(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||u,this.cacheManager=new L(n,n.allKeys?void 0:new X(n,this.options.clientId),this.nowProvider),this.domainUrl=(r=this.options.domain,/^https?:\/\//.test(r)?r:`https://${r}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new N)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||c)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${S(e)}`)}async _verifyIdToken(e,t,n){const i=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,i,r]=t;if(3!==t.length||!n||!i||!r)throw new Error("ID token could not be decoded");const o=JSON.parse(_(i)),a={__raw:e},s={};return Object.keys(o).forEach((e=>{a[e]=o[e],P.includes(e)||(s[e]=o[e])})),{encoded:{header:n,payload:i,signature:r},header:JSON.parse(_(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!E(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!E(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!E(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,i=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),i>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${i}) is after expiration time (${r})`);if(null!=t.claims.nbf&&E(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),i<e)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${i}) is before ${e}`)}if(null!=t.claims.auth_time&&E(t.claims.auth_time)){const r=new Date(0);if(r.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),i>r)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${i}) is after last auth at ${r}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(r=this.options.authorizationParams.max_age,"string"!=typeof r?r:parseInt(r,10)||void 0),now:i});var r}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){const i=b(w()),r=b(w()),o=w(),a=(e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,(e=>t[e]))})(window.btoa(String.fromCharCode(...Array.from(t))))})(await(async e=>{const t=y().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t})(o)),s=((e,t,n,i,r,o,a,s)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:I(t,n.scope),response_type:"code",response_mode:s||"query",state:i,nonce:r,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:o,code_challenge_method:"S256"}))(this.options,this.scope,e,i,r,a,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode),c=this._authorizeUrl(s);return{nonce:r,code_verifier:o,scope:s.scope,audience:s.audience||"default",redirect_uri:s.redirect_uri,state:i,url:c}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const i=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=i.url;const r=await(e=>new Promise(((t,n)=>{let i;const r=setInterval((()=>{e.popup&&e.popup.closed&&(clearInterval(r),clearTimeout(o),window.removeEventListener("message",i,!1),n(new p(e.popup)))}),1e3),o=setTimeout((()=>{clearInterval(r),n(new f(e.popup)),window.removeEventListener("message",i,!1)}),1e3*(e.timeoutInSeconds||60));i=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(o),clearInterval(r),window.removeEventListener("message",i,!1),e.popup.close(),a.data.response.error)return n(l.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",i)})))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==r.state)throw new l("state_mismatch","Invalid state");const o=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:r.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organization:o})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(t={}){var n;const i=G(t),{openUrl:r,fragment:o,appState:a}=i,s=e(i,["openUrl","fragment","appState"]),c=(null===(n=s.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=u,d=e(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:a}),c&&{organization:c}));const h=o?`${l}#${o}`:l;r?await r(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const{state:n,code:i,error:r,error_description:o}=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join("")),a=this.transactionManager.get();if(!a)throw new l("missing_transaction","Invalid state");if(this.transactionManager.remove(),r)throw new d(r,o||r,n,a.appState);if(!a.code_verifier||a.state&&a.state!==n)throw new l("state_mismatch","Invalid state");const s=a.organization,c=a.nonce,u=a.redirect_uri;return await this._requestToken(Object.assign({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:a.appState}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t;const n=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:I(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope)})}),i=await((e,t)=>{let n=F[t];return n||(n=e().finally((()=>{delete F[t],n=null})),F[t]=n),n})((()=>this._getTokenSilently(n)),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return e.detailedResponse?i:null==i?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,i=e(t,["cacheMode"]);if("off"!==n){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}if("cache-only"!==n){if(!await(async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1})((()=>Y.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new h;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"off"!==n){const e=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(i):await this._getTokenFromIFrame(i),{id_token:t,access_token:r,oauthTokenScope:o,expires_in:a}=e;return Object.assign(Object.assign({id_token:t,access_token:r},o?{scope:o}:null),{expires_in:a})}finally{await Y.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(e={},t={}){var n;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:I(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope)})});return t=Object.assign(Object.assign({},s),t),await this.loginWithPopup(i,t),(await this.cacheManager.get(new T({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){null!==t.clientId?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:i}=n,r=e(n,["federated"]),o=i?"&federated":"";return this._url(`/v2/logout?${S(Object.assign({clientId:t.clientId},r))}`)+o}async logout(t={}){const n=G(t),{openUrl:i}=n,r=e(n,["openUrl"]);null===t.clientId?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const o=this._buildLogoutUrl(r);i?await i(o):!1!==i&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:i,state:r,nonce:o,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new l("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((e,t,n=60)=>new Promise(((i,r)=>{const o=window.document.createElement("iframe");o.setAttribute("width","0"),o.setAttribute("height","0"),o.style.display="none";const a=()=>{window.document.body.contains(o)&&(window.document.body.removeChild(o),window.removeEventListener("message",s,!1))};let s;const c=setTimeout((()=>{r(new h),a()}),1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?r(l.fromPayload(e.data.response)):i(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(o),o.setAttribute("src",e)})))(i,this.domainUrl,n);if(r!==d.state)throw new l("state_mismatch","Invalid state");const f=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:d.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:t.organization});return Object.assign(Object.assign({},f),{scope:c,oauthTokenScope:f.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new T({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new v(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null;try{const r=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),i&&{timeout:i}));return Object.assign(Object.assign({},r),{scope:e.authorizationParams.scope,oauthTokenScope:r.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}}async _saveEntryInCache(t){const{id_token:n,decodedToken:i}=t,r=e(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:i}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=await this.cacheManager.getIdToken(new T({clientId:this.options.clientId,audience:e,scope:this.scope})),n=this.userCache.get("@@user@@");return t&&t.id_token===(null==n?void 0:n.id_token)?n:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:e,audience:t,clientId:n}){const i=await this.cacheManager.get(new T({scope:e,audience:t,clientId:n}),60);if(i&&i.access_token){const{access_token:e,oauthTokenScope:t,expires_in:n}=i,r=await this._getIdTokenFromCache();return r&&Object.assign(Object.assign({id_token:r.id_token,access_token:e},t?{scope:t}:null),{expires_in:n})}}async _requestToken(e,t){const{nonceIn:n,organization:i}=t||{},r=await O(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},e),this.worker),o=await this._verifyIdToken(r.id_token,n,i);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},r),{decodedToken:o,scope:e.scope,audience:e.audience||"default"}),r.scope?{oauthTokenScope:r.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(i||o.claims.org_id),Object.assign(Object.assign({},r),{decodedToken:o})}}var K,$;!function(e){e.PROD="prod",e.SANDBOX="sandbox",e.VTEST="vtest",e.STEST="stest",e.PTEST="ptest",e.DEV="dev",e.PLAYPEN="playpen",e.LOCALHOST="localhost"}(K||(K={})),function(e){e.PROD="https://auspost.com.au",e.SANDBOX="https://ptest.npe.auspost.com.au",e.VTEST="https://vtest.npe.auspost.com.au",e.STEST="https://stest.npe.auspost.com.au",e.PTEST="https://ptest.npe.auspost.com.au",e.DEV="https://pdev.npe.auspost.com.au",e.PLAYPEN="https://ptest.npe.auspost.com.au",e.LOCALHOST="http://localhost:4000"}($||($={}));const q={[K.PROD]:$.PROD,[K.SANDBOX]:$.SANDBOX,[K.VTEST]:$.VTEST,[K.STEST]:$.STEST,[K.PTEST]:$.PTEST,[K.DEV]:$.DEV,[K.PLAYPEN]:$.PLAYPEN,[K.LOCALHOST]:$.LOCALHOST},Q="AUTH0",ee=["TRACK","CYCL","ONLINE_SHOP_AP","ONLINE_SHOP_ST","AEM_AUS_POST_WEBSITE","CONTEXTUAL_HELP"];const te=e=>function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const t=document.createElement("iframe");t.style.display="none",t.src=e;const n=()=>document.body.contains(t)&&document.body.removeChild(t);return new Promise(((e,i)=>{t.onload=()=>{n(),e()},t.onerror=()=>{n(),i(new Error("Failed to load URL"))},document.body.appendChild(t)}))}));class ne{get nativeWindow(){const e=window;return e.__AUSPOST__=e.__AUSPOST__?e.__AUSPOST__:{},e}}var ie;class re extends Error{constructor(e,t){super(`${e.status}: ${e.statusText}`),this.url=e.url,this.message=`${e.status}: ${e.statusText}`,this.status=e.status,this.statusText=e.statusText,this.error=t,Object.setPrototypeOf(this,re.prototype)}static createHttpError(e){return function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=yield e.json().then((e=>e&&e instanceof Array?e[0]:e)).catch((()=>{}));return new re(e,t)}))}}!function(e){e.PROD="https://digitalapi.auspost.com.au",e.SANDBOX="https://digitalapi.auspost.com.au",e.VTEST="https://digitalapi-vtest.npe.auspost.com.au",e.STEST="https://digitalapi-stest.npe.auspost.com.au",e.PTEST="https://digitalapi-ptest.npe.auspost.com.au",e.DEV="https://digitalapi-ptest.npe.auspost.com.au",e.PLAYPEN="https://digitalapi-ptest.npe.auspost.com.au",e.LOCALHOST="http://localhost:4000"}(ie||(ie={}));const oe={[K.PROD]:ie.PROD,[K.SANDBOX]:ie.SANDBOX,[K.VTEST]:ie.VTEST,[K.STEST]:ie.STEST,[K.PTEST]:ie.PTEST,[K.DEV]:ie.DEV,[K.PLAYPEN]:ie.PLAYPEN,[K.LOCALHOST]:ie.LOCALHOST};var ae,se;!function(e){e.APP_JSON="application/json"}(ae||(ae={})),function(e){e.GET="GET",e.DELETE="DELETE"}(se||(se={}));const ce={"Content-Type":ae.APP_JSON,Accept:ae.APP_JSON,AP_APP_ID:"UIIM"};var ue,le;!function(e){e.PROD="welcome.auspost.com.au",e.SANDBOX="welcome.sandbox.auspost.com.au",e.VTEST="welcome.vtest.auspost.com.au",e.STEST="welcome.stest.auspost.com.au",e.PTEST="welcome.ptest.auspost.com.au",e.DEV="welcome.dev.auspost.com.au",e.PLAYPEN="welcome.playpen.auspost.com.au",e.LOCALHOST="localhost:8080"}(ue||(ue={})),function(e){e.NONE="none",e.CONSENT="consent",e.LOGIN="login",e.SELECT_ACCOUNT="select_account"}(le||(le={}));var de=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class he extends J{constructor(e){super(e),this.auth0ClientOptions=e,this.windowRefService=new ne}createAuth0Client(){return de(this,void 0,void 0,(function*(){yield this._fetchMock("createAuth0Client")}))}isAuthenticated(){return de(this,void 0,void 0,(function*(){return this._fetchMock("isAuthenticated").then((e=>e.isAuthenticated))}))}getTokenSilently(){return de(this,arguments,void 0,(function*(e={}){return this._fetchMock("getTokenSilently").then((e=>e.accessToken))}))}loginWithRedirect(e){return de(this,void 0,void 0,(function*(){var t;yield this._fetchMock("loginWithRedirect"),(null===(t=null==e?void 0:e.authorizationParams)||void 0===t?void 0:t.prompt)!==le.LOGIN&&(yield this.isAuthenticated())||(this.windowRefService.nativeWindow.location.replace(`http://${this.auth0ClientOptions.domain}/auth0/login`),yield new Promise((e=>setTimeout(e,1e3))))}))}logout(e){return de(this,void 0,void 0,(function*(){var t;yield this._fetchMock("logout"),(null===(t=null==e?void 0:e.logoutParams)||void 0===t?void 0:t.returnTo)&&(this.windowRefService.nativeWindow.location.replace(e.logoutParams.returnTo),yield new Promise((e=>setTimeout(e,1e3))))}))}handleRedirectCallback(e){return de(this,void 0,void 0,(function*(){return yield this._fetchMock("handleRedirectCallback")}))}getUser(){return de(this,void 0,void 0,(function*(){return this._fetchMock("getUser").then((e=>e.user))}))}getIdTokenClaims(){return de(this,void 0,void 0,(function*(){return this._fetchMock("getIdTokenClaims").then((e=>e.claims))}))}_fetchMock(e){return de(this,void 0,void 0,(function*(){const t=yield fetch(`http://${this.auth0ClientOptions.domain}/auth0/${e}`,{method:se.GET});if(!t.ok)throw yield re.createHttpError(t);return t.json().catch((()=>({})))}))}}var fe=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class pe{get auth0Client(){if(!this._auth0Client)throw new Error("auth0Client not defined");return this._auth0Client}set auth0Client(e){this._auth0Client=e}initialise(e){return fe(this,arguments,void 0,(function*(e,t=!1){try{!t&&e.domain.startsWith(K.LOCALHOST)?(console.info("running in LOCALHOST with MOCK"),this.auth0Client=new he(e),yield this.auth0Client.createAuth0Client()):this.auth0Client=yield async function(e){const t=new J(e);return await t.checkSession(),t}(Object.assign(Object.assign({},e),{useRefreshTokens:!0,useRefreshTokensFallback:!0,useCookiesForTransactions:!0}))}catch(e){throw console.warn("Error when initialising Auth0 Client",e.message),e}}))}isAuthenticated(){return this.auth0Client.isAuthenticated()}getAccessTokenSilently(e){return this.auth0Client.getTokenSilently(e)}login(e){return fe(this,void 0,void 0,(function*(){return yield this.auth0Client.loginWithRedirect(e),new Promise((e=>setTimeout(e,1e3)))}))}logout(e,t,n){return fe(this,void 0,void 0,(function*(){const i=t?{openUrl:te,logoutParams:{returnTo:e}}:{logoutParams:{returnTo:e}};(n||null===n)&&(i.clientId=n),yield this.auth0Client.logout(i)}))}handleRedirectCallback(){return fe(this,void 0,void 0,(function*(){yield this.auth0Client.handleRedirectCallback()}))}getUser(){return fe(this,void 0,void 0,(function*(){return yield this.auth0Client.getUser()}))}getIdTokenClaims(){return fe(this,void 0,void 0,(function*(){return this.auth0Client.getIdTokenClaims()}))}}var me=function(){return me=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},me.apply(this,arguments)};function ve(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function ge(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ye(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var we="3.4.2";function be(e,t){return new Promise((function(n){return setTimeout(n,e,t)}))}function Se(e){return!!e&&"function"==typeof e.then}function _e(e,t){try{var n=e();Se(n)?n.then((function(e){return t(!0,e)}),(function(e){return t(!1,e)})):t(!0,n)}catch(e){t(!1,e)}}function ke(e,t,n){return void 0===n&&(n=16),ve(this,void 0,void 0,(function(){var i,r,o,a;return ge(this,(function(s){switch(s.label){case 0:i=Array(e.length),r=Date.now(),o=0,s.label=1;case 1:return o<e.length?(i[o]=t(e[o],o),(a=Date.now())>=r+n?(r=a,[4,be(0)]):[3,3]):[3,4];case 2:s.sent(),s.label=3;case 3:return++o,[3,1];case 4:return[2,i]}}))}))}function Ce(e){e.then(void 0,(function(){}))}function Oe(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Ie(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Te(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function xe(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function je(e,t){return[e[0]^t[0],e[1]^t[1]]}function Le(e){return e=je(e,[0,e[0]>>>1]),e=je(e=Ie(e,[4283543511,3981806797]),[0,e[0]>>>1]),je(e=Ie(e,[3301882366,444984403]),[0,e[0]>>>1])}function Ae(e){return parseInt(e)}function Ee(e){return parseFloat(e)}function Pe(e,t){return"number"==typeof e&&isNaN(e)?t:e}function We(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function Re(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function ze(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Ze(e,t,n){var i=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return!0;return!1}(n,e)})),r=ke(i,(function(n){return function(e,t){var n=new Promise((function(n){var i=Date.now();_e(e.bind(null,t),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Date.now()-i;if(!e[0])return n((function(){return{error:ze(e[1]),duration:r}}));var o=e[1];if(function(e){return"function"!=typeof e}(o))return n((function(){return{value:o,duration:r}}));n((function(){return new Promise((function(e){var t=Date.now();_e(o,(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r+Date.now()-t;if(!n[0])return e({error:ze(n[1]),duration:o});e({value:n[1],duration:o})}))}))}))}))}));return Ce(n),function(){return n.then((function(e){return e()}))}}(e[n],t)}));return Ce(r),function(){return ve(this,void 0,void 0,(function(){var e,t,n,o;return ge(this,(function(a){switch(a.label){case 0:return[4,r];case 1:return[4,ke(a.sent(),(function(e){var t=e();return Ce(t),t}))];case 2:return e=a.sent(),[4,Promise.all(e)];case 3:for(t=a.sent(),n={},o=0;o<i.length;++o)n[i[o]]=t[o];return[2,n]}}))}))}}function Ve(){var e=window,t=navigator;return We(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function De(){var e=window,t=navigator;return We(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ue(){var e=window,t=navigator;return We(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Me(){var e=window;return We(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Ne(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Fe(){var e=De(),t=function(){var e,t,n=window;return We(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}();if(!e&&!t)return!1;var n=window;return We(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function Xe(e){var t=new Error(e);return t.name=e,t}function He(e,t,n){var i,r,o;return void 0===n&&(n=50),ve(this,void 0,void 0,(function(){var a,s;return ge(this,(function(c){switch(c.label){case 0:a=document,c.label=1;case 1:return a.body?[3,3]:[4,be(n)];case 2:return c.sent(),[3,1];case 3:s=a.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise((function(e,n){var i=!1,r=function(){i=!0,e()};s.onload=r,s.onerror=function(e){i=!0,n(e)};var o=s.style;o.setProperty("display","block","important"),o.position="absolute",o.top="0",o.left="0",o.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);var c=function(){var e,t;i||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?r():setTimeout(c,10))};c()}))];case 5:c.sent(),c.label=6;case 6:return(null===(r=null===(i=s.contentWindow)||void 0===i?void 0:i.document)||void 0===r?void 0:r.body)?[3,8]:[4,be(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,c.sent()];case 10:return null===(o=s.parentNode)||void 0===o||o.removeChild(s),[7];case 11:return[2]}}))}))}function Be(e){for(var t=function(e){for(var t,n,i="Unexpected syntax '".concat(e,"'"),r=/^\s*([a-z-]*)(.*)$/i.exec(e),o=r[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var u=s.exec(r[2]);if(!u)break;var l=u[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!d)throw new Error(i);c(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(i)}}return[o,a]}(e),n=t[0],i=t[1],r=document.createElement(null!=n?n:"div"),o=0,a=Object.keys(i);o<a.length;o++){var s=a[o],c=i[s].join(" ");"style"===s?Ge(r.style,c):r.setAttribute(s,c)}return r}function Ge(e,t){for(var n=0,i=t.split(";");n<i.length;n++){var r=i[n],o=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(r);if(o){var a=o[1],s=o[2],c=o[4];e.setProperty(a,s,c||"")}}}var Ye,Je,Ke=["monospace","sans-serif","serif"],$e=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function qe(e){return e.toDataURL()}function Qe(){var e=screen;return[Pe(Ee(e.availTop),null),Pe(Ee(e.width)-Ee(e.availWidth)-Pe(Ee(e.availLeft),0),null),Pe(Ee(e.height)-Ee(e.availHeight)-Pe(Ee(e.availTop),0),null),Pe(Ee(e.availLeft),null)]}function et(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function tt(e){var t;return ve(this,void 0,void 0,(function(){var n,i,r,o,a,s,c;return ge(this,(function(u){switch(u.label){case 0:for(n=document,i=n.createElement("div"),r=new Array(e.length),o={},nt(i),c=0;c<e.length;++c)"DIALOG"===(a=Be(e[c])).tagName&&a.show(),nt(s=n.createElement("div")),s.appendChild(a),i.appendChild(s),r[c]=a;u.label=1;case 1:return n.body?[3,3]:[4,be(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(i);try{for(c=0;c<e.length;++c)r[c].offsetParent||(o[e[c]]=!0)}finally{null===(t=i.parentNode)||void 0===t||t.removeChild(i)}return[2,o]}}))}))}function nt(e){e.style.setProperty("display","block","important")}function it(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function rt(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}function ot(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function at(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function st(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var ct=Math,ut=function(){return 0},lt={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]},dt={fonts:function(){return He((function(e,t){var n=t.document,i=n.body;i.style.fontSize="48px";var r=n.createElement("div"),o={},a={},s=function(e){var t=n.createElement("span"),i=t.style;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,t.textContent="mmMwWLliI0O&1",r.appendChild(t),t},c=Ke.map(s),u=function(){for(var e={},t=function(t){e[t]=Ke.map((function(e){return function(e,t){return s("'".concat(e,"',").concat(t))}(t,e)}))},n=0,i=$e;n<i.length;n++)t(i[n]);return e}();i.appendChild(r);for(var l=0;l<Ke.length;l++)o[Ke[l]]=c[l].offsetWidth,a[Ke[l]]=c[l].offsetHeight;return $e.filter((function(e){return t=u[e],Ke.some((function(e,n){return t[n].offsetWidth!==o[e]||t[n].offsetHeight!==a[e]}));var t}))}))},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return ve(this,void 0,void 0,(function(){var e,n,i,r,o;return ge(this,(function(a){switch(a.label){case 0:return Ue()||Fe()?(s=atob,e={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',s("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",s("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",s("LnNwb25zb3JpdA=="),".ylamainos",s("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",s("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",s("LmhlYWRlci1ibG9ja2VkLWFk"),s("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",s("I2FkXzMwMFgyNTA="),s("I2Jhbm5lcmZsb2F0MjI="),s("I2NhbXBhaWduLWJhbm5lcg=="),s("I0FkLUNvbnRlbnQ=")],adGuardChinese:[s("LlppX2FkX2FfSA=="),s("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",s("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),s("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",s("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",s("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",s("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),s("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),s("LmFkZ29vZ2xl"),s("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[s("YW1wLWF1dG8tYWRz"),s("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",s("I2FkX2ludmlld19hcmVh")],adGuardRussian:[s("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),s("LnJlY2xhbWE="),'div[id^="smi2adblock"]',s("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[s("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),s("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",s("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),s("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),s("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",s("I3Jla2xhbWk="),s("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),s("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),s("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[s("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",s("LndpZGdldF9wb19hZHNfd2lkZ2V0"),s("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",s("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[s("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),s("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",s("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",s("I3Jla2xhbW5pLWJveA=="),s("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",s("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[s("I2FkdmVydGVudGll"),s("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",s("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",s("LnNwb25zb3JsaW5rZ3J1ZW4="),s("I3dlcmJ1bmdza3k="),s("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),s("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[s("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",s("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[s("LnJla2xhbW9zX3RhcnBhcw=="),s("LnJla2xhbW9zX251b3JvZG9z"),s("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),s("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),s("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[s("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[s("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),s("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",s("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[s("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),s("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),s("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",s("LmFkX19tYWlu"),s("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[s("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),s("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[s("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),s("I2xpdmVyZUFkV3JhcHBlcg=="),s("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),s("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[s("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",s("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),s("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),s("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[s("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),s("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),s("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",s("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),s("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),s("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),s("ZGl2I3NrYXBpZWNfYWQ=")],ro:[s("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),s("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),s("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[s("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),s("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),s("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",s("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),s("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",s("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]},n=Object.keys(e),[4,tt((o=[]).concat.apply(o,n.map((function(t){return e[t]}))))]):[2,void 0];case 1:return i=a.sent(),t&&function(e,t){for(var n="DOM blockers debug:\n```",i=0,r=Object.keys(e);i<r.length;i++){var o=r[i];n+="\n".concat(o,":");for(var a=0,s=e[o];a<s.length;a++){var c=s[a];n+="\n ".concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}(e,i),(r=n.filter((function(t){var n=e[t];return We(n.map((function(e){return i[e]})))>.6*n.length}))).sort(),[2,r]}var s}))}))},fontPreferences:function(){return void 0===e&&(e=4e3),He((function(t,n){var i=n.document,r=i.body,o=r.style;o.width="".concat(e,"px"),o.webkitTextSizeAdjust=o.textSizeAdjust="none",De()?r.style.zoom="".concat(1/n.devicePixelRatio):Ue()&&(r.style.zoom="reset");var a=i.createElement("div");return a.textContent=ye([],Array(e/20|0),!0).map((function(){return"word"})).join(" "),r.appendChild(a),function(e,t){for(var n={},i={},r=0,o=Object.keys(lt);r<o.length;r++){var a=o[r],s=lt[a],c=s[0],u=void 0===c?{}:c,l=s[1],d=void 0===l?"mmMwWLliI0fiflO&1":l,h=e.createElement("span");h.textContent=d,h.style.whiteSpace="nowrap";for(var f=0,p=Object.keys(u);f<p.length;f++){var m=p[f],v=u[m];void 0!==v&&(h.style[m]=v)}n[a]=h,t.appendChild(e.createElement("br")),t.appendChild(h)}for(var g=0,y=Object.keys(lt);g<y.length;g++)i[a=y[g]]=n[a].getBoundingClientRect().width;return i}(i,r)}),'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ue()&&!Me()&&!function(){var e=window;return We(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),i=n.createOscillator();i.type="triangle",i.frequency.value=1e4;var r=n.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(n.destination),i.start(0);var o=function(e){var t=function(){};return[new Promise((function(n,i){var r=!1,o=0,a=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var s=function(){setTimeout((function(){return i(Xe("timeout"))}),Math.min(500,a+5e3-Date.now()))},c=function(){try{var t=e.startRendering();switch(Se(t)&&Ce(t),e.state){case"running":a=Date.now(),r&&s();break;case"suspended":document.hidden||o++,r&&o>=3?i(Xe("suspended")):setTimeout(c,500)}}catch(e){i(e)}};c(),t=function(){r||(r=!0,a>0&&s())}})),t]}(n),a=o[0],s=o[1],c=a.then((function(e){return function(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(4500))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return Ce(c),function(){return s(),c}},screenFrame:function(){var e=this,t=function(){var e=this;return function(){if(void 0===Je){var e=function(){var t=Qe();et(t)?Je=setTimeout(e,2500):(Ye=t,Je=void 0)};e()}}(),function(){return ve(e,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return et(e=Qe())?Ye?[2,ye([],Ye,!0)]:function(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}()?[4,Ne()]:[3,2]:[3,2];case 1:t.sent(),e=Qe(),t.label=2;case 2:return et(e)||(Ye=e),[2,e]}}))}))}}();return function(){return ve(e,void 0,void 0,(function(){var e,n;return ge(this,(function(i){switch(i.label){case 0:return[4,t()];case 1:return e=i.sent(),[2,[(n=function(e){return null===e?null:Re(e,10)})(e[0]),n(e[1]),n(e[2]),n(e[3])]]}}))}))}},osCpu:function(){return navigator.oscpu},languages:function(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))De()&&function(){var e=window;return We([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){var i=e.languages;i&&t.push(i.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Pe(Ee(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Pe(Ae(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return Pe(Ae(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var i,r=(i=(new Date).getFullYear(),-Math.max(Ee(new Date(i,0,1).getTimezoneOffset()),Ee(new Date(i,6,1).getTimezoneOffset())));return"UTC".concat(r>=0?"+":"").concat(Math.abs(r))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Ve()&&!function(){var e=window,t=navigator;return We(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Ve()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Ue()&&!Me()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return We(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var i=e[n];if(i){for(var r=[],o=0;o<i.length;++o){var a=i[o];r.push({type:a.type,suffixes:a.suffixes})}t.push({name:i.name,description:i.description,mimeTypes:r})}}return t}},canvas:function(){var e,t,n=!1,i=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),r=i[0],o=i[1];if(function(e,t){return!(!t||!e.toDataURL)}(r,o)){n=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(o),function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat(String.fromCharCode(55357,56835));t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(r,o);var a=qe(r);a!==qe(r)?e=t="unstable":(t=a,function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,i=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<i.length;n++){var r=i[n],o=r[0],a=r[1],s=r[2];t.fillStyle=o,t.beginPath(),t.arc(a,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(r,o),e=qe(r))}else e=t="";return{winding:n,geometry:e,text:t}},touchSupport:function(){var e,t=navigator,n=0;void 0!==t.maxTouchPoints?n=Ae(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(n=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:n,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var i=n[t],r=window[i];r&&"object"==typeof r&&e.push(i)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}},invertedColors:function(){return!!it("inverted")||!it("none")&&void 0},forcedColors:function(){return!!rt("active")||!rt("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}},contrast:function(){return ot("no-preference")?0:ot("high")||ot("more")?1:ot("low")||ot("less")?-1:ot("forced")?10:void 0},reducedMotion:function(){return!!at("reduce")||!at("no-preference")&&void 0},hdr:function(){return!!st("high")||!st("standard")&&void 0},math:function(){var e,t=ct.acos||ut,n=ct.acosh||ut,i=ct.asin||ut,r=ct.asinh||ut,o=ct.atanh||ut,a=ct.atan||ut,s=ct.sin||ut,c=ct.sinh||ut,u=ct.cos||ut,l=ct.cosh||ut,d=ct.tan||ut,h=ct.tanh||ut,f=ct.exp||ut,p=ct.expm1||ut,m=ct.log1p||ut;return{acos:t(.12312423423423424),acosh:n(1e308),acoshPf:(e=1e154,ct.log(e+ct.sqrt(e*e-1))),asin:i(.12312423423423424),asinh:r(1),asinhPf:ct.log(1+ct.sqrt(2)),atanh:o(.5),atanhPf:ct.log(3)/2,atan:a(.5),sin:s(-1e300),sinh:c(1),sinhPf:ct.exp(1)-1/ct.exp(1)/2,cos:u(10.000000000123),cosh:l(1),coshPf:(ct.exp(1)+1/ct.exp(1))/2,tan:d(-1e300),tanh:h(1),tanhPf:(ct.exp(2)-1)/(ct.exp(2)+1),exp:f(1),expm1:p(1),expm1Pf:ct.exp(1)-1,log1p:m(10),log1pPf:ct.log(11),powPI:ct.pow(ct.PI,-100)}},videoCard:function(){var e,t=document.createElement("canvas"),n=null!==(e=t.getContext("webgl"))&&void 0!==e?e:t.getContext("experimental-webgl");if(n&&"getExtension"in n){var i=n.getExtension("WEBGL_debug_renderer_info");if(i)return{vendor:(n.getParameter(i.UNMASKED_VENDOR_WEBGL)||"").toString(),renderer:(n.getParameter(i.UNMASKED_RENDERER_WEBGL)||"").toString()}}},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}};function ht(e){return JSON.stringify(e,(function(e,t){return t instanceof Error?me({name:(n=t).name,message:n.message,stack:null===(i=n.stack)||void 0===i?void 0:i.split("\n")},n):t;var n,i}),2)}function ft(e){return function(e,t){t=t||0;var n,i=(e=e||"").length%16,r=e.length-i,o=[0,t],a=[0,t],s=[0,0],c=[0,0],u=[2277735313,289559509],l=[1291169091,658871167];for(n=0;n<r;n+=16)s=[255&e.charCodeAt(n+4)|(255&e.charCodeAt(n+5))<<8|(255&e.charCodeAt(n+6))<<16|(255&e.charCodeAt(n+7))<<24,255&e.charCodeAt(n)|(255&e.charCodeAt(n+1))<<8|(255&e.charCodeAt(n+2))<<16|(255&e.charCodeAt(n+3))<<24],c=[255&e.charCodeAt(n+12)|(255&e.charCodeAt(n+13))<<8|(255&e.charCodeAt(n+14))<<16|(255&e.charCodeAt(n+15))<<24,255&e.charCodeAt(n+8)|(255&e.charCodeAt(n+9))<<8|(255&e.charCodeAt(n+10))<<16|(255&e.charCodeAt(n+11))<<24],s=Te(s=Ie(s,u),31),o=Oe(o=Te(o=je(o,s=Ie(s,l)),27),a),o=Oe(Ie(o,[0,5]),[0,1390208809]),c=Te(c=Ie(c,l),33),a=Oe(a=Te(a=je(a,c=Ie(c,u)),31),o),a=Oe(Ie(a,[0,5]),[0,944331445]);switch(s=[0,0],c=[0,0],i){case 15:c=je(c,xe([0,e.charCodeAt(n+14)],48));case 14:c=je(c,xe([0,e.charCodeAt(n+13)],40));case 13:c=je(c,xe([0,e.charCodeAt(n+12)],32));case 12:c=je(c,xe([0,e.charCodeAt(n+11)],24));case 11:c=je(c,xe([0,e.charCodeAt(n+10)],16));case 10:c=je(c,xe([0,e.charCodeAt(n+9)],8));case 9:c=Ie(c=je(c,[0,e.charCodeAt(n+8)]),l),a=je(a,c=Ie(c=Te(c,33),u));case 8:s=je(s,xe([0,e.charCodeAt(n+7)],56));case 7:s=je(s,xe([0,e.charCodeAt(n+6)],48));case 6:s=je(s,xe([0,e.charCodeAt(n+5)],40));case 5:s=je(s,xe([0,e.charCodeAt(n+4)],32));case 4:s=je(s,xe([0,e.charCodeAt(n+3)],24));case 3:s=je(s,xe([0,e.charCodeAt(n+2)],16));case 2:s=je(s,xe([0,e.charCodeAt(n+1)],8));case 1:s=Ie(s=je(s,[0,e.charCodeAt(n)]),u),o=je(o,s=Ie(s=Te(s,31),l))}return o=Oe(o=je(o,[0,e.length]),a=je(a,[0,e.length])),a=Oe(a,o),o=Oe(o=Le(o),a=Le(a)),a=Oe(a,o),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",n=0,i=Object.keys(e).sort();n<i.length;n++){var r=i[n],o=e[r],a=o.error?"error":JSON.stringify(o.value);t+="".concat(t?"|":"").concat(r.replace(/([:|\\])/g,"\\$1"),":").concat(a)}return t}(e))}function pt(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise((function(e){return n.call(window,(function(){return e()}),{timeout:t})})):be(Math.min(e,t))}(e,2*e)}function mt(e,t){var n=Date.now();return{get:function(i){return ve(this,void 0,void 0,(function(){var r,o,a;return ge(this,(function(s){switch(s.label){case 0:return r=Date.now(),[4,e()];case 1:return o=s.sent(),a=function(e){var t,n=function(e){var t=function(e){if(Fe())return.4;if(Ue())return Me()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}(e),n=function(e){return Re(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,"".concat(n))}}(e);return{get visitorId(){return void 0===t&&(t=ft(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:we}}(o),(t||(null==i?void 0:i.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(a.version,"\nuserAgent: ").concat(navigator.userAgent,"\ntimeBetweenLoadAndGet: ").concat(r-n,"\nvisitorId: ").concat(a.visitorId,"\ncomponents: ").concat(ht(o),"\n```")),[2,a]}}))}))}}}var vt={load:function(e){var t=void 0===e?{}:e,n=t.delayFallback,i=t.debug,r=t.monitoring,o=void 0===r||r;return ve(this,void 0,void 0,(function(){return ge(this,(function(e){switch(e.label){case 0:return o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(we,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,pt(n)];case 1:return e.sent(),[2,mt(Ze(dt,{debug:i},[]),i)]}}))}))},hashComponents:ft,componentsToDebugString:ht},gt=n(955),yt=n.n(gt),wt=n(178),bt=n.n(wt),St=n(972),_t=n.n(St);const kt="appState";class Ct{initialise(){return function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=yield vt.load(),t=yield e.get();_t().config.encrypt=!0,_t().config.secret=t.visitorId,_t().config.encrypter=(e,t)=>yt().encrypt(JSON.stringify(e),t).toString(),_t().config.decrypter=(e,t)=>JSON.parse(yt().decrypt(e,t).toString(bt()))}))}setAppState(e){e&&Object.keys(e).length>0?_t().set(kt,e,{ttl:3600}):this.removeAppState()}getAppState(){return _t().get(kt)||{}}removeAppState(){_t().remove(kt)}}class Ot{constructor(e){this.serviceFactory=e,this.auth0SdkService=e.getService(pe.name),this.windowRefService=e.getService(ne.name)}reauthenticate(e){return function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(null==e?void 0:e.stepUpOnReauth){const t=window.btoa(JSON.stringify(e)),n=encodeURIComponent(t);return this.windowRefService.nativeWindow.location.replace(`${q[e.env]}/customersetup/session/reauth?config=${n}`),Promise.resolve()}yield this.auth0SdkService.login({authorizationParams:Object.assign(Object.assign(Object.assign({max_age:0,prompt:"login"},!(!e||!e.caller)&&{"ext-caller":e.caller}),!(!e||!e.channel)&&{"ext-channel":e.channel}),!(!e||!e.product)&&{"ext-product":e.product})})}))}}const It=[/^https:\/\/(?:[^/]+?\.)?auspost(?:\.com\.au)?(?:\/?|\/.*)$/],Tt=/^(?:http(s)?:\/\/(?:www\.)?|www\.)[a-z0-9]+(?:[-.][a-z0-9]+)*\.[a-z]{2,5}(?::[0-9]{1,5})?(?:\/\S*)?$/,xt=/^http(s)?:\/\/localhost:[0-9]{4,5}(?:.*\/\S*)?$/,jt=/^localhost:[0-9]{4,5}(?:.*\/\S*)?$/,Lt=["<",">","%3e","%3c","javascript"],At=/^[a-zA-Z0-9_-]*$/;class Et{validateAuthWebConfig(e){this._validateClientId(e.clientId),this._validateEnv(e.env),this._validateRedirectUrl(e.redirectUrl,"authWebConfig.redirectUrl"),e.caller&&this._validateReportingProperty(e.caller,"authWebConfig.caller"),e.channel&&this._validateReportingProperty(e.channel,"authWebConfig.channel"),e.product&&this._validateReportingProperty(e.product,"authWebConfig.product"),e.audience&&this._validateInvalidChars(e.audience,"authWebConfig.audience"),e.scope&&this._validateInvalidChars(e.scope,"authWebConfig.scope"),e.stubDomain&&this._validateStubDomain(e.stubDomain),e.stubApiBaseUrl&&this._validateStubApiBaseUrl(e.stubApiBaseUrl)}validateLoginConfig(e){e.audience&&this._validateInvalidChars(e.audience,"loginConfig.audience"),e.scope&&this._validateInvalidChars(e.scope,"loginConfig.scope"),e.emailAddress&&this._validateInvalidChars(e.emailAddress,"loginConfig.emailAddress"),e.redirectUrl&&this._validateRedirectUrl(e.redirectUrl,"loginConfig.redirectUrl"),e.appState&&this._validateAppState(e.appState)}validateLogoutUrl(e){this._validateInvalidChars(e,"logoutUrl"),!this._isLocalhostUrl(e)&&this._validateUrlRegex(e,"logoutUrl")}validateGetTokenConfig(e){e.audience&&this._validateInvalidChars(e.audience,"getTokenConfig.audience"),e.scope&&this._validateInvalidChars(e.scope,"getTokenConfig.scope")}validateTargetUrl(e){this._validateUrl(e,"appState.targetUrl",!0)}_validateUrl(e,t,n=!1){this._isLocalhostUrl(e)||(this._validateUrlRegex(e,t),n&&this._validateUrlWhitelist(e,t)),this._validateTextLength(e,500,t),this._validateInvalidChars(e,t)}_validateClientId(e){if(!e)throw new Error("authWebConfig.clientId is required");this._validateLetterDigitsDashUnderScore(e,"authWebConfig.clientId")}_validateEnv(e){if(!e)throw new Error("authWebConfig.env is required");if(t=e,!(null===(n=Object.entries(K).find((([e,n])=>n===t)))||void 0===n?void 0:n[0]))throw new Error("authWebConfig.env is invalid");var t,n}_validateRedirectUrl(e,t){if(!e)throw new Error(`${t} is required`);this._validateInvalidChars(e,t),!this._isLocalhostUrl(e)&&this._validateUrlRegex(e,t)}_validateStubDomain(e){if(!jt.test(e))throw new Error("authWebConfig.stubDomain is invalid")}_validateStubApiBaseUrl(e){if(!this._isLocalhostUrl(e))throw new Error("authWebConfig.stubApiBaseUrl is invalid");this._validateInvalidChars(e,"authWebConfig.stubApiBaseUrl")}_validateAppState(e){e.caller&&this._validateReportingProperty(e.caller,"loginConfig.appState.caller"),e.channel&&this._validateReportingProperty(e.channel,"loginConfig.appState.channel"),e.product&&this._validateReportingProperty(e.product,"loginConfig.appState.product"),e.signupUrl&&this._validateUrl(e.signupUrl,"loginConfig.appState.signupUrl",!0),e.targetUrl&&this.validateTargetUrl(e.targetUrl)}_validateReportingProperty(e,t){this._validateTextLength(e,30,t),this._validateLetterDigitsDashUnderScore(e,t)}_validateUrlRegex(e,t){if(!Tt.test(e))throw new Error(`${t} is invalid`)}_validateUrlWhitelist(e,t){if(!It.some((t=>t.test(e))))throw new Error(`${t} domain not whitelisted`)}_validateInvalidChars(e,t){if(Lt.some((t=>e.toLowerCase().includes(t))))throw new Error(`${t} is invalid`)}_validateLetterDigitsDashUnderScore(e,t){if(!At.test(e))throw new Error(`${t} is invalid`)}_validateTextLength(e,t,n){if(e.length>t)throw new Error(`${n} length limit exceeded`)}_isLocalhostUrl(e){return xt.test(e)}}const Pt="login_required",Wt="reauth-required",Rt="invalid_grant";class zt extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,zt.prototype)}static createLoginRequiredError(){return new zt(Pt,"Login required")}static createReauthRequiredError(){return new zt(Wt,"Reauth required")}static createInvalidGrantError(){return new zt(Rt,"Invalid refresh token.")}isLoginRequiredError(){return this.error===Pt}isReauthRequiredError(){return this.error===Wt}isInvalidGrantError(){return this.error===Rt}}var Zt=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Vt{constructor(e){this.serviceFactory=e,this.auth0SdkService=e.getService(pe.name),this.localStorageService=e.getService(Ct.name),this.validatorService=e.getService(Et.name),this.windowRefService=e.getService(ne.name),this.reauthService=e.getService(Ot.name)}handleRedirectIfNeeded(e){return Zt(this,arguments,void 0,(function*(e,t=!0){let n={};const i={authorizationParams:Object.assign(Object.assign(Object.assign({max_age:0,prompt:"login"},!(!e||!e.caller)&&{"ext-caller":e.caller}),!(!e||!e.channel)&&{"ext-channel":e.channel}),!(!e||!e.product)&&{"ext-product":e.product})},[r,o]=this.windowRefService.nativeWindow.location.href.split("?");if(!o)return{appState:n};if(o.includes("error=")&&o.includes("error_description=")){const n=new URLSearchParams(o),r=n.get("error"),a=n.get("error_description");if(!t)throw new zt(r,a);if("reauth-required"===a)console.log("Auth0: reauth required error"),yield this.reauthService.reauthenticate(e);else if("invalid_grant"===r)console.log("Auth0: invalid refresh token error"),yield this.auth0SdkService.login(i);else if("stepup-error"===a)console.log("Auth0: error on reauth step up page. Skipping."),yield this.auth0SdkService.login(i);else{const e=`${this.windowRefService.nativeWindow.location.origin}/autherror?error=${r}`;this.windowRefService.nativeWindow.location.replace(e)}}return o.includes("code=")&&o.includes("state=")&&(yield this._parseAuth0Result(r),n=this.localStorageService.getAppState(),this.localStorageService.removeAppState(),yield this._redirectToTargetIfDefined(n)),{appState:n}}))}_parseAuth0Result(e){return Zt(this,void 0,void 0,(function*(){try{yield this.auth0SdkService.handleRedirectCallback()}catch(e){console.warn("Error when parsing redirect from Auth0:",e.message)}this.windowRefService.nativeWindow.history.replaceState({},document.title,e)}))}_redirectToTargetIfDefined(e){return Zt(this,void 0,void 0,(function*(){const{targetUrl:t}=e;t&&this.validatorService.validateTargetUrl(t),t&&!e.skipUrlReload&&this.windowRefService.nativeWindow.location.href!==t&&(this.windowRefService.nativeWindow.location.replace(t),yield new Promise((e=>setTimeout(e,2e3))))}))}}var Dt=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Ut{initialise(e,t){this.apiBaseUrl=t||oe[e]}get(e){return Dt(this,arguments,void 0,(function*(e,t={}){const n=this._buildHttpOptions(t);return yield this.fetch(`${this.apiBaseUrl}${e}`,n)}))}delete(e){return Dt(this,void 0,void 0,(function*(){const t=this._buildHttpOptions(void 0,se.DELETE);yield this.fetch(`${this.apiBaseUrl}${e}`,t)}))}_buildHttpOptions(e={},t=se.GET,n){return{method:t,headers:new Headers(Object.assign(Object.assign({},ce),e)),credentials:"include",body:n?JSON.stringify(n):void 0}}fetch(e,t){return Dt(this,void 0,void 0,(function*(){const n=yield fetch(e,t);if(!n.ok)throw yield re.createHttpError(n);return n.json().catch((()=>({})))}))}}const Mt="https://auspost/apcn",Nt="https://auspost/cnumber",Ft={[K.PROD]:ue.PROD,[K.SANDBOX]:ue.SANDBOX,[K.VTEST]:ue.VTEST,[K.STEST]:ue.STEST,[K.PTEST]:ue.PTEST,[K.DEV]:ue.DEV,[K.PLAYPEN]:ue.PLAYPEN,[K.LOCALHOST]:ue.LOCALHOST};class Xt{transformAuthWebConfig(e){const t=e.stubDomain?e.stubDomain:Ft[e.env],{clientId:n,audience:i,redirectUrl:r,scope:o,useLocalStorage:a,maxAge:s,screenHint:c}=e;return Object.assign(Object.assign({clientId:n,domain:t,authorizationParams:Object.assign(Object.assign(Object.assign(Object.assign({redirect_uri:r},!!i&&{audience:i}),!!o&&{scope:`${o} email profile`}),!!s&&{max_age:s}),!!c&&{screen_hint:c})},e.env===K.LOCALHOST&&{authorizeTimeoutInSeconds:1,httpTimeoutInSeconds:1}),a&&{cacheLocation:"localstorage"})}transformAppState(e,t){const{caller:n,channel:i,product:r,skipUrlReload:o,signupUrl:a,targetUrl:s,maxAge:c}=e.appState||{},u=e.redirectUrl||t.redirectUrl,l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},!!n&&{caller:n}||!!t.caller&&{caller:t.caller}),!!i&&{channel:i}||!!t.channel&&{channel:t.channel}),!!r&&{product:r}||!!t.product&&{product:t.product}),!!a&&{signupUrl:a}),!!s&&{targetUrl:s}),!!o&&{skipUrlReload:o}),!!u&&{_redirectUrl:u}),!!c&&{maxAge:c}||!!t.maxAge&&{max_age:t.maxAge});return Object.keys(l).length>0?l:void 0}transformLoginConfig(e){const t=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},!!e.audience&&{audience:e.audience}),!!e.scope&&{scope:e.scope}),!!e.redirectUrl&&{redirect_uri:e.redirectUrl}),!!e.emailAddress&&{login_hint:e.emailAddress}),!!e.forceLogin&&{prompt:le.LOGIN,max_age:0}),!!e.maxAge&&{max_age:e.maxAge}),!!e.screenHint&&{screen_hint:e.screenHint}),!!e.prompt&&{prompt:le.LOGIN}),!!e.caller&&{"ext-caller":e.caller}),!!e.channel&&{"ext-channel":e.channel}),!!e.product&&{"ext-product":e.product}),this._transformUlpCustomQueryParam(e)),n=Object.assign({},Object.keys(t).length>0&&{authorizationParams:t});return Object.keys(n).length>0?n:void 0}transformLogoutConfig(e,t=!1){let n={};return"string"==typeof e||void 0===e?(console.warn("!!! WARNING: this method of calling logout with the [url], [skipRedirect] parameters is considered legacy and will be removed in future UIIM versions. Please refer to the UIIM docs and make the necessary to changes your application !!!"),n=Object.assign(Object.assign({logoutType:Q},e&&{url:e}),{skipRedirect:t})):e&&(n=Object.assign(Object.assign(Object.assign(Object.assign({},e.logoutType?{logoutType:e.logoutType}:{logoutType:Q}),e.url&&{url:e.url}),{skipRedirect:e.skipRedirect||!1}),(e.clientId||null===e.clientId)&&{clientId:e.clientId}),(e.clientId||null===e.clientId)&&(n.clientId=e.clientId)),n}transformGetTokenConfig(e){if(e){const t=Object.assign(Object.assign({},!!e.audience&&{audience:e.audience}),!!e.scope&&{scope:e.scope}),n=Object.assign(Object.assign({},Object.keys(t).length>0&&{authorizationParams:t}),!!e.cacheMode&&{cacheMode:e.cacheMode});return Object.keys(n).length>0?n:void 0}}transformIdToken(e){if(e)return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({__raw:e.__raw},!!e.updated_at&&{updated_at:e.updated_at}),!!e.iss&&{iss:e.iss}),!!e.aud&&{aud:e.aud}),!!e.iat&&{iat:e.iat}),!!e.sub&&{sub:e.sub}),!!e.exp&&{exp:e.exp}),!!e.auth_time&&{auth_time:e.auth_time}),!!e.sid&&{sid:e.sid}),!!e.nonce&&{nonce:e.nonce})}transformUser(e){if(e)return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({email:e.email},!!e.email_verified&&{emailVerified:e.email_verified}),!!e.family_name&&{surname:e.family_name}),!!e.given_name&&{firstName:e.given_name}),!!e[Mt]&&{apcn:e[Mt]}),!!e[Nt]&&{cNumber:e[Nt]})}transformAuth0Error(e){return e instanceof l&&"login_required"===e.error?zt.createLoginRequiredError():e instanceof l&&"reauth-required"===e.message?zt.createReauthRequiredError():e instanceof l&&"invalid_grant"===e.message?zt.createInvalidGrantError():e}_transformUlpCustomQueryParam(e){const t=e.appState||{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},!!e.hideSignup&&{"ext-hide_signup":"true"}),!!e.emailAlreadyRegistered&&{"ext-email_already_registered":"true"}),!!t.caller&&{"ext-caller":t.caller}),!!t.channel&&{"ext-channel":t.channel}),!!t.product&&{"ext-product":t.product})}}var Ht=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{c(i.next(e))}catch(e){o(e)}}function s(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))};class Bt{constructor(e){this.serviceFactory=e,this.auth0SdkService=e.getService(pe.name),this.auth0CallbackService=e.getService(Vt.name),this.httpService=e.getService(Ut.name),this.localStorageService=e.getService(Ct.name),this.optionsTransformerService=e.getService(Xt.name),this.validatorService=e.getService(Et.name),this.reauthService=e.getService(Ot.name),this.windowRefService=e.getService(ne.name)}initialise(e){return Ht(this,void 0,void 0,(function*(){void 0===e.redirectOnAnonymous&&(e.redirectOnAnonymous=!0),this.authWebConfig=e,this.validatorService.validateAuthWebConfig(e),this.httpService.initialise(e.env,e.stubApiBaseUrl),yield this.localStorageService.initialise(),yield this.auth0SdkService.initialise(this.optionsTransformerService.transformAuthWebConfig(e),e.skipAuth0SdkMock),this.authWebConfig.verifyAuthenticationOnFocus&&this._verifyAuthenticationOnFocus();const t=this._isRedirectRequired(e),n=yield this.auth0CallbackService.handleRedirectIfNeeded(e,t);return n.loginRequired&&(yield this.login(Object.assign(Object.assign(Object.assign({audience:e.audience,maxAge:0,prompt:"login",appState:n.appState},!(!e||!e.caller)&&{caller:e.caller}),!(!e||!e.channel)&&{channel:e.channel}),!(!e||!e.product)&&{product:e.product}))),n.appState}))}login(){return Ht(this,arguments,void 0,(function*(e={}){this.validatorService.validateLoginConfig(e),e.appState=this.optionsTransformerService.transformAppState(e,this.authWebConfig),this.localStorageService.setAppState(e.appState),yield this.auth0SdkService.login(this.optionsTransformerService.transformLoginConfig(e)).catch((e=>Ht(this,void 0,void 0,(function*(){const t=this.optionsTransformerService.transformAuth0Error(e),n={authorizationParams:Object.assign(Object.assign(Object.assign({max_age:0,prompt:"login"},!(!this.authWebConfig||!this.authWebConfig.caller)&&{"ext-caller":this.authWebConfig.caller}),!(!this.authWebConfig||!this.authWebConfig.channel)&&{"ext-channel":this.authWebConfig.channel}),!(!this.authWebConfig||!this.authWebConfig.product)&&{"ext-product":this.authWebConfig.product})};t instanceof zt&&t.isLoginRequiredError()?yield this._handleLogin(n):t instanceof zt&&t.isReauthRequiredError()&&(yield this.reauthService.reauthenticate(this.authWebConfig))}))))}))}logout(e,t){return Ht(this,void 0,void 0,(function*(){const n=this.optionsTransformerService.transformLogoutConfig(e,null!=t&&t);Object.keys(localStorage).filter((e=>e.includes("@@auth0spajs@@"))).forEach((e=>{localStorage.removeItem(e)})),(()=>{const e=document.cookie.split("; ").reduce(((e,t)=>{const[n,...i]=t.split("=");return e[n]=i.join("="),e}),{});Object.keys(e).filter((e=>e.includes("auth0"))).forEach((e=>{document.cookie=`${e}=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;`}))})(),"OIDC"===n.logoutType&&(yield this._logoutOidc(n.url)),n.logoutType===Q&&(yield this._logoutAuth0(n.url,n.skipRedirect,n.clientId))}))}_logoutAuth0(e,t,n){return Ht(this,void 0,void 0,(function*(){e&&this.validatorService.validateLogoutUrl(e),yield this.auth0SdkService.logout(e||void 0,t,n)}))}_logoutOidc(e){return Ht(this,void 0,void 0,(function*(){e&&this.validatorService.validateLogoutUrl(e);const t=this.optionsTransformerService.transformAuthWebConfig(this.authWebConfig),n=yield this.getIdToken().then((n=>{const i=Object.assign(Object.assign({client_id:t.clientId},!!n&&{id_token_hint:n.__raw}),e?{post_logout_redirect_uri:e}:{post_logout_redirect_uri:`${q[this.authWebConfig.env]}`});return((e,t)=>{const n=new URL(e);for(const[e,i]of Object.entries(t))n.searchParams.append(e,i);return n.href})(`https://${t.domain}/oidc/logout`,i)}));this.windowRefService.nativeWindow.location.assign(n)}))}signup(){return Ht(this,void 0,void 0,(function*(){yield this.login({screenHint:"signup"})}))}isAuthenticated(){return Ht(this,arguments,void 0,(function*(e=!1){return(yield this._isAuth0SessionValid(e))||!1}))}getAccessTokenSilently(e){return Ht(this,void 0,void 0,(function*(){return e&&this.validatorService.validateGetTokenConfig(e),(yield this.auth0SdkService.getAccessTokenSilently(this.optionsTransformerService.transformGetTokenConfig(e)).catch((e=>Ht(this,void 0,void 0,(function*(){var t;const n=this.optionsTransformerService.transformAuth0Error(e);if(this._isRedirectRequired(this.authWebConfig)){if(n instanceof zt&&(n.isReauthRequiredError()||n.isInvalidGrantError())){if(null===(t=this.authWebConfig)||void 0===t?void 0:t.preserveAppStateOnLogin){const e=this.localStorageService.getAppState()||{};e.targetUrl||(e.targetUrl=this.windowRefService.nativeWindow.location.href),this.localStorageService.setAppState(e)}return yield this.reauthService.reauthenticate(this.authWebConfig)}return n instanceof zt&&n.isLoginRequiredError(),this._handleGetTokenError(e)}throw n})))))||""}))}getIdToken(){return Ht(this,void 0,void 0,(function*(){return this.optionsTransformerService.transformIdToken(yield this.auth0SdkService.getIdTokenClaims())}))}getUser(){return Ht(this,void 0,void 0,(function*(){const e=yield this.auth0SdkService.getUser();if(e)return this.optionsTransformerService.transformUser(e);if(!(yield this.auth0SdkService.isAuthenticated()))throw zt.createLoginRequiredError()}))}getAppState(e=!1){const t=this.localStorageService.getAppState();return e&&this.localStorageService.removeAppState(),t}_isAuth0SessionValid(e){return Ht(this,void 0,void 0,(function*(){return(yield this.auth0SdkService.isAuthenticated())||!!(yield this.auth0SdkService.getAccessTokenSilently().catch((t=>Ht(this,void 0,void 0,(function*(){if(e)return!1;const n=this.optionsTransformerService.transformAuth0Error(t),i=this._isRedirectRequired(this.authWebConfig),r={authorizationParams:Object.assign(Object.assign(Object.assign({max_age:0,prompt:"login"},!(!this.authWebConfig||!this.authWebConfig.caller)&&{"ext-caller":this.authWebConfig.caller}),!(!this.authWebConfig||!this.authWebConfig.channel)&&{"ext-channel":this.authWebConfig.channel}),!(!this.authWebConfig||!this.authWebConfig.product)&&{"ext-product":this.authWebConfig.product})};return!!(i&&n instanceof zt)&&(n.isReauthRequiredError()?yield this.reauthService.reauthenticate(this.authWebConfig):(n.isLoginRequiredError()||n.isInvalidGrantError())&&(yield this.auth0SdkService.login(r)),!1)})))))}))}_handleGetTokenError(e){throw this.optionsTransformerService.transformAuth0Error(e)}_verifyAuthenticationOnFocus(){window.addEventListener("focus",(()=>{document.hidden||(()=>{Ht(this,void 0,void 0,(function*(){yield this.auth0SdkService.initialise(this.optionsTransformerService.transformAuthWebConfig(this.authWebConfig));const e={authorizationParams:Object.assign(Object.assign(Object.assign({max_age:0,prompt:"login"},!(!this.authWebConfig||!this.authWebConfig.caller)&&{"ext-caller":this.authWebConfig.caller}),!(!this.authWebConfig||!this.authWebConfig.channel)&&{"ext-channel":this.authWebConfig.channel}),!(!this.authWebConfig||!this.authWebConfig.product)&&{"ext-product":this.authWebConfig.product})};!(yield this.auth0SdkService.isAuthenticated())&&(yield this._handleLogin(e))}))})()}))}_isRedirectRequired(e){return!(ee.includes(e.caller)||!e.redirectOnAnonymous)}_handleLogin(e){return Ht(this,void 0,void 0,(function*(){var t;(null===(t=this.authWebConfig)||void 0===t?void 0:t.preserveAppStateOnLogin)?yield this._loginWithAppStatePreservation(e):yield this.auth0SdkService.login(e)}))}_loginWithAppStatePreservation(e){return Ht(this,void 0,void 0,(function*(){const t=this.localStorageService.getAppState()||{};t.targetUrl||(t.targetUrl=this.windowRefService.nativeWindow.location.href),e.appState||(e.appState=t),this.localStorageService.setAppState(e.appState),yield this.auth0SdkService.login(e)}))}}class Gt{getService(e){switch(e){case Bt.name:return this.authWebService||(this.authWebService=new Bt(this));case Vt.name:return this.auth0CallbackService||(this.auth0CallbackService=new Vt(this));case pe.name:return this.auth0SdkService||(this.auth0SdkService=new pe);case Ut.name:return this.httpService||(this.httpService=new Ut);case Ct.name:return this.localStorageService||(this.localStorageService=new Ct);case Xt.name:return this.optionsTransformerService||(this.optionsTransformerService=new Xt);case Et.name:return this.validatorService||(this.validatorService=new Et);case ne.name:return this.windowRefService||(this.windowRefService=new ne);case Ot.name:return this.reauthService||(this.reauthService=new Ot(this))}}}(new class{constructor(){this.windowRefService=new ne}initialise(){this.windowRefService.nativeWindow.__AUSPOST__.createAuthWebService=()=>(new Gt).getService(Bt.name)}}).initialise()})()})(); |