/*! For license information please see mng-digisubs.articleShare.bundle.js.LICENSE.txt */ (()=>{var e={7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;sc?c:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;ia)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|y(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(o)return r?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function N(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function x(e,t,n,r,o){F(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function U(e,t,n,r,o){F(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function B(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||k(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||k(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||k(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=$(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=$(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function F(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,o,i)}function K(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=j(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function V(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function $(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},251(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<>1,l=-7,d=n?o-1:0,h=n?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-l)-1,f>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),i-=u}return(f?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,p=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+f]=255&s,f+=p,s/=256,o-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,u-=8);e[n+f-p]|=128*y}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,n){var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function c(e,o,i,a){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return r(c,"_invoke",function(e,r,o){var i,a,s,c=0,l=o||[],d=!1,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return i=e,a=0,s=t,h.n=n,u}};function f(e,r){for(a=e,s=r,n=0;!d&&c&&!o&&n3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=e<2&&fr||r>p)&&(i[4]=e,i[5]=r,h.n=p,a=0))}if(o||e>1)return u;throw d=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,s)):h.n=s:h.v=s);try{if(c=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(d=h.n<0)?s:e.call(r,h))!==u)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:n,done:d}}}(e,i,a),!0),c}var u={};function l(){}function d(){}function h(){}n=Object.getPrototypeOf;var f=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=h.prototype=l.prototype=Object.create(f);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=h,r(p,"constructor",h),r(h,"constructor",d),d.displayName="GeneratorFunction",r(h,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,n){var r=n(887);e.exports=function(e,t,n,o,i){var a=r(e,t,n,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,a){return new o(r().w(e,t,n,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,n){var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,a,s){try{var c=t[e](o),u=c.value;return u instanceof r?n.resolve(u.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):n.resolve(u).then(function(e){c.value=e,a(c)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(n,r,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var r=n(5172),o=n(6993),i=n(5869),a=n(887),s=n(1791),c=n(4373),u=n(579);function l(){"use strict";var t=o(),n=t.m(l),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(h(t)?a:i)(p(e),t,n,r,o)},keys:c,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,n){var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,n){var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},3612(e,t,n){"use strict";var r,o,i,a,s;n.d(t,{A:()=>c}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const c={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableReaderDashboardv2:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardv2,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,enableDashboardBenefitHub:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardBenefitHub,enableEngageArticleGifting:"1"===(null===(r=window.authentication_config)||void 0===r?void 0:r.articleSharingEnabled)&&"1"===(null===(o=window.authentication_config)||void 0===o?void 0:o.isEngageArticleSharing),enableGiftedArticlesLink:"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.articleSharingEnabled)&&"1"!==(null===(a=window.authentication_config)||void 0===a?void 0:a.isEngageArticleSharing),enableSavedArticlesLink:"1"===(null===(s=window.authentication_config)||void 0===s?void 0:s.articleSavingEnabled),prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",enableUpgradeSubscription:!!window.authentication_config&&"1"===window.authentication_config.enableUpgradeSubscription,oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog,updatePaymentEnabled:!!window.authentication_config&&"1"===window.authentication_config.enableUpdatePayment}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};n.r(e),n.d(e,{hasBrowserEnv:()=>ea,hasStandardBrowserEnv:()=>na,hasStandardBrowserWebWorkerEnv:()=>ra,navigator:()=>ta,origin:()=>oa});var t=n(3612);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}g.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;Error;var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},E={},A={};Object.defineProperty(A,"__esModule",{value:!0});var b=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){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 r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();A.default=function(){return b.getInstance()};var v=m&&m.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},S=m&&m.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]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 v(this,void 0,void 0,function(){return S(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 v(this,void 0,void 0,function(){var n,r,o,i;return S(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?C:this.storageHandler,r=O+"-"+t,null===(o=n.getItemSync(r))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,T.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),T.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],i=0;;){var a=r.keySync(i);if(null===a)break;o.push(a),i++}for(var s=!1,c=0;c(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;L=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;de=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw te("The input to be decoded is not correctly encoded.",Q,e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw te("".concat(n," must be a non-negative number"),Q,o);return}throw te("".concat(n," must be a positive number"),Q,o)}catch(e){if(r)throw ge(e.message,r,o);throw e}}function ve(e,t,n,r){try{if("string"!=typeof e)throw te("".concat(t," must be a string"),ee,r);if(0===e.length)throw te("".concat(t," must not be empty"),Q,r)}catch(e){if(n)throw ge(e.message,n,r);throw e}}function Se(e){!function(e,t){if(qe(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2){const e=r.pop();"".concat(r.join(", "),", or ").concat(e)}else 2===r.length?"".concat(r[0]," or ").concat(r[1]):r[0];return ge(t,gt,e)}(e,t)}(e,"application/json")}function Re(){return fe(crypto.getRandomValues(new Uint8Array(32)))}function Te(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new pe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new pe("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new pe("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new pe("unsupported CryptoKey algorithm name",{cause:e})}}function Oe(e){const t=null==e?void 0:e[re];return"number"==typeof t&&Number.isFinite(t)?t:0}function Ce(e){const t=null==e?void 0:e[oe];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Ne(){return Math.floor(Date.now()/1e3)}function Ie(e){if("object"!=typeof e||null===e)throw te('"as" must be an object',ee);ve(e.issuer,'"as.issuer"')}function _e(e){if("object"!=typeof e||null===e)throw te('"client" must be an object',ee);ve(e.client_id,'"client.client_id"')}function Le(e){return ve(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function ke(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&ve(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw te("".concat(t," must be a CryptoKey"),ee)}(e,t),"private"!==e.type)throw te("".concat(t," must be a private CryptoKey"),Q)}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:Te(n),kid:r},u=function(e,t){const n=Ne()+Oe(t);return{jti:Re(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[ae]||void 0===s||s.call(t,c,u),i.set("client_id",o.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw te('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Q);const r="".concat(fe(le(JSON.stringify(e))),".").concat(fe(le(JSON.stringify(t)))),o=fe(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:Ct(e)};case"RSA-PSS":switch(Ot(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new pe("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Ot(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new pe("unsupported CryptoKey algorithm name",{cause:e})}(n),n,le(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Pe=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function xe(e,t){if(t&&"https:"!==e.protocol)throw ge("only requests to HTTPS are allowed",mt,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw ge("only HTTP and HTTPS requests are allowed",Et,e)}function Ue(e,t,n,r){let o;if("string"!=typeof e||!Pe(e))throw ge("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?St:Rt,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return xe(o,r),o}function Be(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Ue(e.mtls_endpoint_aliases[t],t,n,r):Ue(e[t],t,n,r)}class Me extends Error{constructor(e,t){var n;super(e,t),K(this,"cause",void 0),K(this,"code",void 0),K(this,"error",void 0),K(this,"status",void 0),K(this,"error_description",void 0),K(this,"response",void 0),this.name=this.constructor.name,this.code=dt,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}class De extends Error{constructor(e,t){var n,r;super(e,t),K(this,"cause",void 0),K(this,"code",void 0),K(this,"error",void 0),K(this,"error_description",void 0),this.name=this.constructor.name,this.code=ft,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==t.cause.get("error_description")&&void 0!==n?n:void 0,null===Error.captureStackTrace||void 0===r||r.call(Error,this,this.constructor)}}class He extends Error{constructor(e,t){var n;super(e,t),K(this,"cause",void 0),K(this,"code",void 0),K(this,"response",void 0),K(this,"status",void 0),this.name=this.constructor.name,this.code=lt,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}const Ge="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",je="("+Ge+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',Fe="("+Ge+")\\s*=\\s*("+Ge+")",Ke=new RegExp("^[,\\s]*("+Ge+")"),We=new RegExp("^[,\\s]*"+je+"[,\\s]*(.*)"),Xe=new RegExp("^[,\\s]*"+Fe+"[,\\s]*(.*)"),Ve=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Je(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!Z(e,Response))throw te('"response" must be an instance of Response',ee);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let r=t;for(;r;){var o;let t=r.match(Ke);const i=null===t||void 0===o?void 0:o[1].toLowerCase();if(!i)return;const a=r.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;s?s[1]:void 0;const u={};let l;if(c)for(;r;){let n,o;if(r.match(We)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(Xe)){if(r.match(Ve)){if(Object.keys(u).length)break;[,l,r]=t;break}return}[,n,o,r]=t,u[n.toLowerCase()]=o}}else 0;const d={scheme:i,parameters:u};l&&(d.token68=l),n.push(d)}return n.length?n:void 0}(e))throw new He("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),await async function(e){if(e.status>399&&e.status<500){Tt(e),Se(e);try{const t=await e.clone().json();if(we(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===e.body||void 0===r?void 0:r.cancel()),new Me("server responded with an error in the response body",{cause:t,response:e});throw ge('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),wt,e)}}function Ye(e){if(!ot.has(e))throw te('"options.DPoP" is not a valid DPoPHandle',Q)}function qe(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function ze(e,t,n,r,o,i,a){return await n(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[ie])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:Ee(r,null==a?void 0:a.signal)})}async function Ze(e,t,n,r,o,i){var a;const s=Be(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[ne]));o.set("grant_type",r);const c=me(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(Ye(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await ze(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const $e=new WeakMap,Qe=new WeakMap;function et(e){if(!e.id_token)return;const t=$e.get(e);if(!t)throw te('"ref" was already garbage collected or did not resolve from the proper sources',Q);return t}async function tt(e,t,n,r,o,i){if(Ie(e),_e(t),!Z(n,Response))throw te('"response" must be an instance of Response',ee);await Je(n,200,"Token Endpoint"),Tt(n);const a=await kt(n);if(ve(a.access_token,'"response" body "access_token" property',yt,{body:a}),ve(a.token_type,'"response" body "token_type" property',yt,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;be(e,!0,'"response" body "expires_in" property',yt,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&ve(a.refresh_token,'"response" body "refresh_token" property',yt,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw ge('"response" body "scope" property must be a string',yt,{body:a});if(void 0!==a.id_token){ve(a.id_token,'"response" body "id_token" property',yt,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(be(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=r&&r.length&&i.push(...r);const{claims:s,jwt:c}=await async function(e,t,n,r,o){let i,a,{0:s,1:c,length:u}=e.split(".");if(5===u){if(void 0===o)throw new pe("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw ge("Invalid JWT",yt,e);try{JSON.parse(le(fe(s)))}catch(e){throw ge("failed to parse JWT Header body as base64url encoded JSON",pt,e)}if(!we(i))throw ge("JWT Header must be a top level object",yt,e);if(t(i),void 0!==i.crit)throw new pe('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(le(fe(c)))}catch(e){throw ge("failed to parse JWT Payload body as base64url encoded JSON",pt,e)}if(!we(a))throw ge("JWT Payload must be a top level object",yt,e);const l=Ne()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw ge('unexpected JWT "exp" (expiration time) claim type',yt,{claims:a});if(a.exp<=l-r)throw ge('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',At,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw ge('unexpected JWT "iat" (issued at) claim type',yt,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw ge('unexpected JWT "iss" (issuer) claim type',yt,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw ge('unexpected JWT "nbf" (not before) claim type',yt,{claims:a});if(a.nbf>l+r)throw ge('unexpected JWT "nbf" (not before) claim value',At,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw ge('unexpected JWT "aud" (audience) claim type',yt,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,Nt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Oe(t),Ce(t),o).then(st.bind(void 0,i)).then(rt.bind(void 0,e)).then(nt.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw ge('ID Token "aud" (audience) claim includes additional untrusted audiences',bt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw ge('unexpected ID Token "azp" (authorized party) claim value',bt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&be(s.auth_time,!0,'ID Token "auth_time" (authentication time)',yt,{claims:s}),Qe.set(n,c),$e.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new pe("unsupported `token_type` value",{cause:{body:a}});return a}function nt(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw ge('unexpected JWT "aud" (audience) claim value',bt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw ge('unexpected JWT "aud" (audience) claim value',bt,{expected:e,claims:t.claims,claim:"aud"});return t}function rt(e,t){var n,r;const o=null!==(null===e[xt]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw ge('unexpected JWT "iss" (issuer) claim value',bt,{expected:o,claims:t.claims,claim:"iss"});return t}const ot=new WeakSet,it=Symbol(),at={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function st(e,t){for(const n of e)if(void 0===t.claims[n])throw ge('JWT "'.concat(n,'" (').concat(at[n],") claim missing"),yt,{claims:t.claims});return t}const ct=Symbol(),ut=Symbol();const lt="OAUTH_WWW_AUTHENTICATE_CHALLENGE",dt="OAUTH_RESPONSE_BODY_ERROR",ht="OAUTH_UNSUPPORTED_OPERATION",ft="OAUTH_AUTHORIZATION_RESPONSE_ERROR",pt="OAUTH_PARSE_ERROR",yt="OAUTH_INVALID_RESPONSE",gt="OAUTH_RESPONSE_IS_NOT_JSON",wt="OAUTH_RESPONSE_IS_NOT_CONFORM",mt="OAUTH_HTTP_REQUEST_FORBIDDEN",Et="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",At="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",bt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",vt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",St="OAUTH_MISSING_SERVER_METADATA",Rt="OAUTH_INVALID_SERVER_METADATA";function Tt(e){if(e.bodyUsed)throw te('"response" body has been used already',Q)}function Ot(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new pe("unsupported ".concat(t.name," modulusLength"),{cause:e})}function Ct(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new pe("unsupported ECDSA namedCurve",{cause:e})}}function Nt(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw ge('unexpected JWT "alg" header parameter',yt,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw ge('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?r.alg!==n:"function"==typeof n?!n(r.alg):!n.includes(r.alg))throw ge('unexpected JWT "alg" header parameter',yt,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw ge('unexpected JWT "alg" header parameter',yt,{header:r,expected:e,reason:"client configuration"})}function It(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw ge('"'.concat(t,'" parameter must be provided only once'),yt);return n}const _t=Symbol(),Lt=Symbol();async function kt(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Se;try{await e.json()}catch(t){throw n(e),ge('failed to parse "response" body as JSON',pt,t)}if(!we(t))throw ge('"response" body must be a top level object',yt,{body:t});return t}const Pt=Symbol(),xt=Symbol(),Ut=new TextEncoder,Bt=new TextDecoder;function Mt(e){const t=new Uint8Array(e.length);for(let n=0;n127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=r}return t}function Dt(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},jt=(e,t)=>e.name===t;function Ft(e,t){var n;if(e.hash,parseInt(n.name.slice(4),10)!==t)throw Gt("SHA-".concat(t),"algorithm.hash")}function Kt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o2){const t=r.pop();e+="one of type ".concat(r.join(", "),", or ").concat(t,".")}else 2===r.length?e+="one of type ".concat(r[0]," or ").concat(r[1],"."):e+="of type ".concat(r[0],".");if(null==t)e+=" Received ".concat(t);else if("function"==typeof t&&t.name)e+=" Received function ".concat(t.name);else if("object"==typeof t&&null!=t){var i;null!==(i=t.constructor)&&void 0!==i&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const Wt=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),K(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),K(this,"claim",void 0),K(this,"reason",void 0),K(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}K(Vt,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Jt extends Xt{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),K(this,"code","ERR_JWT_EXPIRED"),K(this,"claim",void 0),K(this,"reason",void 0),K(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}K(Jt,"code","ERR_JWT_EXPIRED");class Yt extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}K(Yt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class qt extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JOSE_NOT_SUPPORTED")}}K(qt,"code","ERR_JOSE_NOT_SUPPORTED"),K(class extends Xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),K(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),K(class extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class zt extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JWS_INVALID")}}K(zt,"code","ERR_JWS_INVALID");class Zt extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JWT_INVALID")}}K(Zt,"code","ERR_JWT_INVALID"),K(class extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class $t extends Xt{constructor(){super(...arguments),K(this,"code","ERR_JWKS_INVALID")}}K($t,"code","ERR_JWKS_INVALID");class Qt extends Xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),K(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}K(Qt,"code","ERR_JWKS_NO_MATCHING_KEY");class en extends Xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),K(this,Symbol.asyncIterator,void 0),K(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}K(en,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class tn extends Xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),K(this,"code","ERR_JWKS_TIMEOUT")}}K(tn,"code","ERR_JWKS_TIMEOUT");class nn extends Xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),K(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}K(nn,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const rn=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},on=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),an=e=>rn(e)||on(e);function sn(e,t,n){try{return Ht(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}function cn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const un=e=>cn(e)&&"string"==typeof e.kty;async function ln(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r3&&void 0!==arguments[3]&&arguments[3];pn||(pn=new WeakMap);let o=pn.get(e);if(null!=o&&o[n])return o[n];const i=await hn(X(X({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:pn.set(e,{[n]:i}),i};const gn=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n{const t=e.data[e.pos++];if(128&t){const n=127&t;let r=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(n)},En=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},An=(e,t,n)=>{var r;const o=(e=>Dt(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=n;return null!=t&&null!==(r=t.startsWith)&&void 0!==r&&r.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){mn(e,48,"Invalid PKCS#8 structure"),wn(e),mn(e,2,"Expected version field");const t=wn(e);e.pos+=t,mn(e,48,"Expected algorithm identifier");wn(e);e.pos}(t),(e=>{const t=(e=>{mn(e,6,"Expected algorithm OID");const t=wn(e);return En(e,t)})(e);if(gn(t,[43,101,110]))return"X25519";if(!gn(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");mn(e,6,"Expected curve OID");const n=wn(e),r=En(e,n);for(const{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(gn(r,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,n,r)=>{var o;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=r.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new qt("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new qt('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(o=null==r?void 0:r.extractable)&&void 0!==o?o:!!s,a)})("pkcs8",o,t,i)},bn=e=>null==e?void 0:e[Symbol.toStringTag],vn=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(e,'" when present'))}if(void 0!==t.alg&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var r,o;let i;switch(!0){case"sign"===n||"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===n?"wrapKey":"unwrapKey":n;break;case"encrypt"===n&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(r=t.key_ops)||void 0===r||null===(o=r.includes)||void 0===o?void 0:o.call(r,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var Sn,Rn;let Tn,On;if("undefined"==typeof navigator||null===(Sn=navigator.userAgent)||void 0===Sn||null===(Rn=Sn.startsWith)||void 0===Rn||!Rn.call(Sn,"Mozilla/5.0 ")){const e="v6.8.3";On="".concat("openid-client","/").concat(e),Tn={"user-agent":On}}const Cn=e=>Nn.get(e);let Nn,In;function _n(e){return void 0!==e?Le(e):(In||(In=new WeakMap),(e,t,n,r)=>{let o;return(o=In.get(t))||(function(e,t){if("string"!=typeof e)throw xn("".concat(t," must be a string"),Pn);if(0===e.length)throw xn("".concat(t," must not be empty"),kn)}(t.client_secret,'"metadata.client_secret"'),o=Le(t.client_secret),In.set(t,o)),o(e,t,n,r)})}const Ln=ie,kn="ERR_INVALID_ARG_VALUE",Pn="ERR_INVALID_ARG_TYPE";function xn(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class Un extends Error{constructor(e,t){var n;super(e,t),K(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}function Bn(e,t,n){return new Un(e,{cause:t,code:n})}function Mn(e){if(e instanceof TypeError||e instanceof Un||e instanceof Me||e instanceof De||e instanceof He)throw e;if(e instanceof ye)switch(e.code){case mt:throw Bn("only requests to HTTPS are allowed",e,e.code);case Et:throw Bn("only requests to HTTP or HTTPS are allowed",e,e.code);case wt:throw Bn("unexpected HTTP response status code",e.cause,e.code);case gt:throw Bn("unexpected response content-type",e.cause,e.code);case pt:throw Bn("parsing error occured",e,e.code);case yt:throw Bn("invalid response encountered",e,e.code);case bt:throw Bn("unexpected JWT claim value encountered",e,e.code);case vt:throw Bn("unexpected JSON attribute value encountered",e,e.code);case At:throw Bn("JWT timestamp claim value failed validation",e,e.code);default:throw Bn(e.message,e,e.code)}if(e instanceof pe)throw Bn("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Bn("runtime operation error",e,ht);case"NotSupportedError":throw Bn("runtime unsupported operation",e,ht);case"TimeoutError":throw Bn("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Bn("operation aborted",e,"OAUTH_ABORT")}throw new Un("something went wrong",{cause:e})}async function Dn(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw xn('"server" must be an instance of URL',Pn);const o=!e.href.includes("/.well-known/"),i=null!==(null==t?void 0:t.timeout)&&void 0!==n?n:30,a=AbortSignal.timeout(1e3*i),s=await(o?async function(e,t){return async function(e,t,n,r){if(!(e instanceof URL))throw te('"'.concat("issuerIdentifier",'" must be an instance of URL'),ee);xe(e,!0!==(null==r?void 0:r[ne]));const o=n(new URL(e.href)),i=me(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[ie])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:Ee(o,null==r?void 0:r.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=Ae("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=Ae("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw te('"options.algorithm" must be "oidc" (default), or "oauth2"',Q)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[ie]:null==t?void 0:t[Ln],[ne]:null==t||null===t.execute||void 0===r?void 0:r.includes(Vn),signal:a,headers:new Headers(Tn)}):((null==t?void 0:t[Ln])||fetch)((xe(e,null==t||null===t.execute||void 0===c||!c.includes(Vn)),e.href),{headers:Object.fromEntries(new Headers(X({accept:"application/json"},Tn)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==Pt)throw te('"expectedIssuerIdentifier" must be an instance of URL',ee);if(!Z(t,Response))throw te('"response" must be an instance of Response',ee);if(200!==t.status)throw ge('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',wt,t);Tt(t);const r=await kt(t);if(ve(r.issuer,'"response" body "issuer" property',yt,{body:r}),n!==Pt&&new URL(r.issuer).href!==n.href)throw ge('"response" body "issuer" property does not match the expected value',vt,{expected:n.href,body:r,attribute:"issuer"});return r}(Pt,e)).catch(Mn);var c;return o&&new URL(s.issuer).href!==e.href&&(function(e,t,n){return!("https://login.microsoftonline.com"!==e.origin||null!=n&&n.algorithm&&"oidc"!==n.algorithm||(t[Hn]=!0,0))}(e,s,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new Un("discovered metadata issuer does not match the expected issuer",{code:vt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Gn(i,t,n,r);let s=Cn(a);if(null!=o&&o[Ln]&&(s.fetch=o[Ln]),null!=o&&o.timeout&&(s.timeout=o.timeout),null!=o&&o.execute)for(const e of o.execute)e(a);return a}new TextDecoder;const Hn=Symbol();class Gn{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw xn('"clientId" must be a non-empty string',Pn);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(o=n)||void 0===o?void 0:o.client_id)&&t!==n.client_id)throw xn('"clientId" and "metadata.client_id" must be the same',kn);const u=X(X({},structuredClone(n)),{},{client_id:t});let l;u[re]=null!==(i=null===(a=n)||void 0===a?void 0:a[re])&&void 0!==i?i:0,u[oe]=null!==(s=null===(c=n)||void 0===c?void 0:c[oe])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?_n(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const h=structuredClone(e);Hn in e&&(h[xt]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let f=Object.freeze(h);Nn||(Nn=new WeakMap),Nn.set(this,{__proto__:null,as:f,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(Cn(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"S256";return!0===(null===(t=e.code_challenge_methods_supported)||void 0===t?void 0:t.includes(n))}}}}(e))}(e),e}clientMetadata(){return structuredClone(Cn(this).c)}get timeout(){return Cn(this).timeout}set timeout(e){Cn(this).timeout=e}get[Ln](){return Cn(this).fetch}set[Ln](e){Cn(this).fetch=e}}function jn(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const t=new Date;t.setSeconds(t.getSeconds()+e.expires_in),t.getTime()}return{expiresIn:{__proto__:null,value(){if(t){const e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return et(this)}catch(e){return}}}}}(e))}async function Fn(e,t,n){var r;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===e.headers.get("retry-after")||void 0===r?void 0:r.trim();if(void 0===i)return;let a;if(/^\d+$/.test(i))parseInt(i,10);else{const e=new Date(i);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&Math.ceil(n/1e3)}}if(o&&!Number.isFinite(a))throw new ye("invalid Retry-After header value",{cause:e});a>t&&await Kn(a-t,n)}function Kn(e,t){return new Promise((n,r)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void r(e)}if(e<=0)return void n();const i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function Wn(e,t){$n(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=Cn(e);return async function(e,t,n,r,o){Ie(e),_e(t);const i=Be(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[ne])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=me(null==o?void 0:o.headers);return s.set("accept","application/json"),ze(e,t,n,i,a,s,o)}(n,r,o,t,{[ie]:i,[ne]:!a,headers:new Headers(Tn),signal:Qn(s)}).then(e=>async function(e,t,n){if(Ie(e),_e(t),!Z(n,Response))throw te('"response" must be an instance of Response',ee);await Je(n,200,"Backchannel Authentication Endpoint"),Tt(n);const r=await kt(n);ve(r.auth_req_id,'"response" body "auth_req_id" property',yt,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return be(o,!0,'"response" body "expires_in" property',yt,{body:r}),r.expires_in=o,void 0!==r.interval&&be(r.interval,!1,'"response" body "interval" property',yt,{body:r}),r}(n,r,e)).catch(Mn)}async function Xn(e,t,n,r){var o,i;$n(e),new URLSearchParams(n);let a=null!==t.interval&&void 0!==o?o:5;const s=null!==(null==r?void 0:r.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await Kn(a,s)}catch(e){Mn(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:h,nonRepudiation:f,timeout:p,decrypt:y}=Cn(e),g=(o,i)=>Xn(e,X(X({},t),{},{interval:o}),n,X(X({},r),{},{signal:s,flag:i})),w=await async function(e,t,n,r,o){Ie(e),_e(t),ve(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Ze(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[ie]:d,[ne]:!h,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(Tn),signal:s.aborted?s:Qn(p)}).catch(Mn);var m;if(503===w.status&&w.headers.has("retry-after"))return await Fn(w,a,s,!0),await(null===w.body||void 0===m?void 0:m.cancel()),g(a);const E=async function(e,t,n,r){return tt(e,t,n,void 0,null==r?void 0:r[se],null==r?void 0:r.recognizedTokenTypes)}(c,u,w,{[se]:y});let A;try{await E}catch(e){if(er(e,r))return g(a,tr);if(e instanceof Me)switch(e.error){case"slow_down":0;case"authorization_pending":return await Fn(e.response,a,s),g(a)}Mn(e)}return A.id_token&&await(null==f?void 0:f(w)),jn(A),A}function Vn(e){Cn(e).tlsOnly=!1}async function Jn(e,t,n,r,o){if($n(e),!((null==o?void 0:o.flag)===tr||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw xn('"currentUrl" must be an instance of URL, or Request',Pn);let i,a;const{as:s,c,auth:u,fetch:l,tlsOnly:d,jarm:h,hybrid:f,nonRepudiation:p,timeout:y,decrypt:g,implicit:w}=Cn(e);if((null==o?void 0:o.flag)===tr)o.authResponse,o.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(new URL(t.url),e.method){case"GET":break;case"POST":const n=new URLSearchParams(await async function(e){if("POST"!==e.method)throw te("form_post responses are expected to use the POST method",Q,{cause:e});if("application/x-www-form-urlencoded"!==qe(e))throw te("form_post responses are expected to use the application/x-www-form-urlencoded content-type",Q,{cause:e});return async function(e){if(e.bodyUsed)throw te("form_post Request instances must contain a readable body",Q,{cause:e});return e.text()}(e)}(e));if(f)t.hash=n.toString();else for(const[e,r]of n.entries())t.searchParams.append(e,r);break;default:throw xn("unexpected Request HTTP method",kn)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!h:await h(t,null==n?void 0:n.expectedState);break;case!!f:await f(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!w:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,n,r){if(Ie(e),_e(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw te('"parameters" must be an instance of URLSearchParams, or URL',ee);if(It(n,"response"))throw ge('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',yt,{parameters:n});const o=It(n,"iss"),i=It(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw ge('response parameter "iss" (issuer) missing',yt,{parameters:n});if(o&&o!==e.issuer)throw ge('unexpected "iss" (issuer) response parameter value',yt,{expected:e.issuer,parameters:n});switch(r){case void 0:case Lt:if(void 0!==i)throw ge('unexpected "state" response parameter encountered',yt,{expected:void 0,parameters:n});break;case _t:break;default:if(ve(r,'"expectedState" argument'),i!==r)throw ge(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',yt,{expected:r,parameters:n})}if(It(n,"error"))throw new De("authorization response from the server is an error",{cause:n});const a=It(n,"id_token"),s=It(n,"token");if(void 0!==a||void 0!==s)throw new pe("implicit and hybrid flows are not supported");return new URLSearchParams(n),ot.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){Mn(e)}}}const m=await async function(e,t,n,r,o,i,a){if(Ie(e),_e(t),!ot.has(r))throw te('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Q);ve(o,'"redirectUri"');const s=It(r,"code");if(!s)throw ge('no authorization code in "callbackParameters"',yt);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==it&&(ve(i,'"codeVerifier"'),c.set("code_verifier",i)),Ze(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||it,{additionalParameters:r,[ie]:l,[ne]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(Tn),signal:Qn(y)}).catch(Mn);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const E=async function(e,t,n,r){return"string"==typeof(null==r?void 0:r.expectedNonce)||"number"==typeof(null==r?void 0:r.maxAge)||null!=r&&r.requireIdToken?async function(e,t,n,r,o,i,a){const s=[];switch(r){case void 0:0;break;case ct:break;default:ve(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case ut:break;default:be(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await tt(e,t,n,s,i,a);ve(c.id_token,'"response" body "id_token" property',yt,{body:c});const u=et(c);if(o!==ut){const e=Ne()+Oe(t),n=Ce(t);if(u.auth_time+o{let n;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&{n_a:()=>{}},async function(e,t,n,r){return tt(e,t,n,void 0,null==r?void 0:r[se],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[se]:l,recognizedTokenTypes:n})}).catch(Mn);return jn(d),d}async function rr(e,t,n){if(!cn(e))throw new zt("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new zt('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new zt("JWS Protected Header incorrect type");if(void 0===e.payload)throw new zt("JWS Payload missing");if("string"!=typeof e.signature)throw new zt("JWS Signature missing or incorrect type");if(void 0!==e.header&&!cn(e.header))throw new zt("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const t=Ht(e.protected);JSON.parse(Bt.decode(t))}catch(e){throw new zt("JWS Protected Header is invalid")}if(!function(){for(var e=arguments.length,t=new Array(e),n=0;n"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of r.crit){if(!i.has(t))throw new qt('Extension Header Parameter "'.concat(t,'" is not recognized'));if(void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(i.get(t)&&void 0===r[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(r.crit)}(zt,new Map([["b64",!0]]),null==n?void 0:n.crit,r,o);let a=!0;if(i.has("b64")&&(r.b64,"boolean"!=typeof a))throw new zt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new zt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError('"'.concat("algorithms",'" option must be an array of strings'));if(t)return new Set(t)}(0,n.algorithms);if(c&&!c.has(s))throw new Yt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new zt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new zt("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(await t(r,e),!0),function(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,n)=>{if(!(t instanceof Uint8Array)){if(un(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&vn(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!an(t))throw new TypeError(Wt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(bn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(un(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&vn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv)(t)&&vn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!an(t))throw new TypeError(Wt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(bn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(bn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(bn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(bn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(bn(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}(s,t,"verify");const l=function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{length:n}=t;return e+n},0),o=new Uint8Array(r);let i=0;for(const e of t)o.set(e,i),e.length;return o}(void 0!==e.protected?Mt(e.protected):new Uint8Array,Mt("."),"string"==typeof e.payload?a?Mt(e.payload):Ut.encode(e.payload):e.payload),d=sn(e.signature,"signature",zt),h=await async function(e,t){if(e instanceof Uint8Array)return e;if(rn(e))return e;if(on(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{pn||(pn=new WeakMap);let n=pn.get(e);if(null!=n&&n[t])return n[t];const r="public"===e.type,o=!!r;let i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError(fn)}e.toCryptoKey(e.asymmetricKeyType,o,r?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError(fn);e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError(fn);e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":0;break;case"RS256":case"PS256":case"RSA-OAEP-256":0;break;case"RS384":case"PS384":case"RSA-OAEP-384":0;break;case"RS512":case"PS512":case"RSA-OAEP-512":0;break;default:throw new TypeError(fn)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},o,r?["encrypt"]:["decrypt"]);e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},o,[r?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===e.asymmetricKeyDetails||void 0===a?void 0:a.namedCurve);if(!n)throw new TypeError(fn);const i={ES256:"P-256",ES384:"P-384",ES512:"P-521"};i[t]&&n===i[t]&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),t.startsWith("ECDH-ES")&&e.toCryptoKey({name:"ECDH",namedCurve:n},o,r?[]:["deriveBits"])}if(!i)throw new TypeError(fn);return n?n[t]=i:pn.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return yn(e,n,t)}if(un(e))return e.k?Ht(e.k):yn(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await ln(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,o);const i=function(e,t){const n="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new qt("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,n,r)}catch(e){return!1}}(s,h,d,l))throw new nn;let f;a?sn(e.payload,"payload",zt):"string"==typeof e.payload?Ut.encode(e.payload):e.payload;const p={payload:f};return void 0!==e.protected&&(p.protectedHeader=r),void 0!==e.header&&(p.unprotectedHeader=e.header),u?X(X({},p),{},{key:h}):p}const or=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function ir(e){const t=or.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let r;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":Math.round(3600*n);break;case"day":case"days":case"d":Math.round(86400*n);break;case"week":case"weeks":case"w":Math.round(604800*n);break;default:Math.round(31557600*n)}return"-"===t[1]||"ago"===t[4]?-r:r}const ar=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());function sr(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Bt.decode(t))}catch(e){}if(!cn(n))throw new Zt("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||ar(e.typ)!==ar(o)))throw new Vt('unexpected "typ" JWT header value',n,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r,l=[...i];void 0!==u&&l.push("iat"),void 0!==c&&l.push("aud"),void 0!==s&&l.push("sub"),void 0!==a&&l.push("iss");for(const e of new Set(l.reverse()))if(!(e in n))throw new Vt('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new Vt('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new Vt('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!("string"==typeof n.aud?h.includes(d):Array.isArray(d)&&h.some(Set.prototype.has.bind(new Set(d)))))throw new Vt('unexpected "aud" claim value',n,"aud","check_failed");var d,h;let f;switch(typeof r.clockTolerance){case"string":ir(r.clockTolerance);break;case"number":r.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:p}=r,y=(p||new Date,Math.floor(g.getTime()/1e3));var g;if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new Vt('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new Vt('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>y+f)throw new Vt('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new Vt('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=y-f)throw new Jt('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=y-n.iat;if(e-f>("number"==typeof u?u:ir(u)))throw new Jt('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-f)throw new Vt('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}function cr(e){return cn(e)}var ur,lr,dr=new WeakMap,hr=new WeakMap;class fr{constructor(e){if(j(this,dr,void 0),j(this,hr,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(cr)}(e))throw new $t("JSON Web Key Set malformed");F(dr,this,structuredClone(e))}jwks(){return G(dr,this)}async getKey(e,t){const{alg:n,kid:r}=X(X({},e),null==t?void 0:t.header),o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new qt('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=G(dr,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof r&&r===e.kid,!t||"string"!=typeof e.alg&&"AKP"!==o||n===e.alg,t&&"string"==typeof e.use&&"sig"===e.use,t&&Array.isArray(e.key_ops)&&e.key_ops.includes("verify"),t)switch(n){case"ES256":"P-256"===e.crv;break;case"ES384":"P-384"===e.crv;break;case"ES512":"P-521"===e.crv;break;case"Ed25519":case"EdDSA":"Ed25519"===e.crv}return t}),{0:a,length:s}=i;if(0===s)throw new Qt;if(1!==s){const e=new en,t=G(hr,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new J(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield D(pr(t,e,n))}catch(e){}}),e}return pr(G(hr,this),a,n)}}async function pr(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[n]){const e=await async function(e,t){if(!cn(e))throw new TypeError("JWK must be an object");let n;switch(null!=t||e.alg,null!=n||e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Ht(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new qt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return hn(X(X({},e),{},{alg:t,ext:n}));case"AKP":if("string"!=typeof e.alg||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return hn(X(X({},e),{},{ext:n}));case"EC":case"OKP":return hn(X(X({},e),{},{alg:t,ext:n}));default:throw new qt('Unsupported "kty" (Key Type) Parameter value')}}(X(X({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new $t("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function yr(e){const t=new fr(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let gr;if("undefined"==typeof navigator||null===(ur=navigator.userAgent)||void 0===ur||null===(lr=ur.startsWith)||void 0===lr||!lr.call(ur,"Mozilla/5.0 ")){const e="v6.2.2";gr="".concat("jose","/").concat(e)}const wr=Symbol(),mr=Symbol();var Er=new WeakMap,Ar=new WeakMap,br=new WeakMap,vr=new WeakMap,Sr=new WeakMap,Rr=new WeakMap,Tr=new WeakMap,Or=new WeakMap,Cr=new WeakMap,Nr=new WeakMap;class Ir{constructor(e,t){if(j(this,Er,void 0),j(this,Ar,void 0),j(this,br,void 0),j(this,vr,void 0),j(this,Sr,void 0),j(this,Rr,void 0),j(this,Tr,void 0),j(this,Or,void 0),j(this,Cr,void 0),j(this,Nr,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;F(Er,this,new URL(e.href)),F(Ar,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),F(br,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),F(vr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),F(Tr,this,new Headers(null==t?void 0:t.headers)),gr&&!G(Tr,this).has("User-Agent")&&G(Tr,this).set("User-Agent",gr),G(Tr,this).has("accept")||(G(Tr,this).set("accept","application/json"),G(Tr,this).append("accept","application/jwk-set+json")),F(Or,this,null==t?void 0:t[wr]),void 0!==(null==t?void 0:t[mr])&&(F(Nr,this,null==t?void 0:t[mr]),null==t?void 0:t[mr],G(vr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&cn(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,cn)&&(F(Sr,this,G(Nr,this).uat),F(Cr,this,yr(G(Nr,this).jwks))))}pendingFetch(){return!!G(Rr,this)}coolingDown(){return"number"==typeof G(Sr,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const o=await r(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new tn;throw e});if(200!==o.status)throw new Xt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Xt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(G(Er,this).href,G(Tr,this),AbortSignal.timeout(G(Ar,this)),G(Or,this)).then(e=>{F(Cr,this,yr(e)),G(Nr,this)&&(G(Nr,this).uat=Date.now(),G(Nr,this).jwks=e),F(Sr,this,Date.now()),F(Rr,this,void 0)}).catch(e=>{throw F(Rr,this,void 0),e})),await G(Rr,this)}}const _r=["mfaToken"],Lr=["mfaToken"];var kr,Pr,xr,Ur,Br,Mr,Dr,Hr,Gr,jr,Fr,Kr,Wr,Xr,Vr,Jr,Yr=class extends Error{constructor(e,t){super(t),K(this,"code",void 0),this.name="NotSupportedError",this.code=e}},qr=class extends Error{constructor(e,t,n){super(t),K(this,"cause",void 0),K(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},zr=class extends qr{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Zr=class extends qr{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},$r=class extends qr{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Qr=class extends qr{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},eo=class extends qr{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},to=class extends qr{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},no=class extends Error{constructor(e){super(e),K(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},ro=class extends qr{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),K(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},oo=class extends qr{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},io=class extends qr{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},ao=class extends qr{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},so=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),K(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function co(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>X(X({},e),{},{[t[0]]:t[1]}),{})}var uo=class extends Error{constructor(e,t,n){super(t),K(this,"cause",void 0),K(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},lo=class extends uo{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},ho=class extends uo{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},fo=class extends uo{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},po=class extends uo{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function yo(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var go=(kr=new WeakMap,Pr=new WeakMap,xr=new WeakMap,class{constructor(e){var t;j(this,kr,void 0),j(this,Pr,void 0),j(this,xr,void 0),F(kr,this,"https://".concat(e.domain)),F(Pr,this,e.clientId),F(xr,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(G(kr,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await G(xr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const e=await r.json();throw new lo(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(yo)}async enrollAuthenticator(e){const t="".concat(G(kr,this),"/mfa/associate"),{mfaToken:n}=e,r=V(e,_r),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);const i=await G(xr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new ho(e.error_description||"Failed to enroll authenticator",e)}return function(e){if("otp"===e.authenticator_type)return{authenticatorType:"otp",secret:e.secret,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes,id:e.id};if("oob"===e.authenticator_type)return{authenticatorType:"oob",oobChannel:e.oob_channel,oobCode:e.oob_code,bindingMethod:e.binding_method,id:e.id,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,r="".concat(G(kr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await G(xr,this).call(this,r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new fo(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(G(kr,this),"/mfa/challenge"),{mfaToken:n}=e,r=V(e,Lr),o={mfa_token:n,client_id:G(Pr,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await G(xr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new po(e.error_description||"Failed to challenge authenticator",e)}return function(e){const t={challengeType:e.challenge_type};return void 0!==e.oob_code&&(t.oobCode=e.oob_code),void 0!==e.binding_method&&(t.bindingMethod=e.binding_method),t}(await i.json())}}),wo=class e{constructor(e,t,n,r,o,i,a){K(this,"accessToken",void 0),K(this,"idToken",void 0),K(this,"refreshToken",void 0),K(this,"expiresAt",void 0),K(this,"scope",void 0),K(this,"claims",void 0),K(this,"authorizationDetails",void 0),K(this,"tokenType",void 0),K(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=r,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,r=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return r.tokenType=t.token_type,r.issuedTokenType=t.issued_token_type,r}},mo=(Ur=new WeakMap,Br=new WeakMap,Mr=new WeakMap,class{constructor(e,t){j(this,Ur,new Map),j(this,Br,void 0),j(this,Mr,void 0),F(Mr,this,Math.max(1,Math.floor(e))),F(Br,this,Math.max(0,Math.floor(t)))}get(e){const t=G(Ur,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return G(Ur,this).delete(e),G(Ur,this).set(e,t),t.value;G(Ur,this).delete(e)}}set(e,t){for(G(Ur,this).has(e)&&G(Ur,this).delete(e),G(Ur,this).set(e,{value:t,expiresAt:Date.now()+G(Br,this)});G(Ur,this).size>G(Mr,this);){const e=G(Ur,this).keys().next().value;if(void 0===e)break;G(Ur,this).delete(e)}}}),Eo=new Map;function Ao(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var bo=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,r=e.ttlMs,"".concat(n,":").concat(r));var n,r;let o=(i=t,Eo.get(i));var i;return o||(o=new mo(e.maxEntries,e.ttlMs),Eo.set(t,o)),o}static createJwksCache(){return{}}},vo="openid profile email offline_access",So=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function Ro(e){if(null==e)throw new to("subject_token is required");if("string"!=typeof e)throw new to("subject_token must be a string");if(0===e.trim().length)throw new to("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new to("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new to("subject_token must not include the 'Bearer ' prefix")}function To(e,t){if(t)for(const[n,r]of Object.entries(t))if(!So.has(n))if(Array.isArray(r)){if(r.length>20)throw new to("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}var Oo="urn:ietf:params:oauth:token-type:access_token";Dr=new WeakMap,Hr=new WeakMap,Gr=new WeakMap,jr=new WeakMap,Fr=new WeakMap,Kr=new WeakMap,Wr=new WeakMap,Xr=new WeakMap,Vr=new WeakMap,Jr=new WeakSet;function Co(){const e=G(jr,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(G(jr,this).useMtls?"1":"0")}async function No(e){const t=await M(Jr,this,ko).call(this),n=new Gn(e,G(jr,this).clientId,G(jr,this).clientSecret,t);return n[Ln]=G(Fr,this),n}async function Io(){if(G(Dr,this)&&G(Hr,this))return{configuration:G(Dr,this),serverMetadata:G(Hr,this)};const e=M(Jr,this,Co).call(this),t=G(Wr,this).get(e);if(t)return F(Hr,this,t.serverMetadata),F(Dr,this,await M(Jr,this,No).call(this,t.serverMetadata)),{configuration:G(Dr,this),serverMetadata:G(Hr,this)};const n=G(Xr,this).get(e);if(n){const e=await n;return F(Hr,this,e.serverMetadata),F(Dr,this,await M(Jr,this,No).call(this,e.serverMetadata)),{configuration:G(Dr,this),serverMetadata:G(Hr,this)}}const r=(async()=>{const t=await M(Jr,this,ko).call(this),n=await Dn(new URL("https://".concat(G(jr,this).domain)),G(jr,this).clientId,{use_mtls_endpoint_aliases:G(jr,this).useMtls},t,{[Ln]:G(Fr,this)}),r=n.serverMetadata();return G(Wr,this).set(e,{serverMetadata:r}),{configuration:n,serverMetadata:r}})(),o=r.then(e=>{let{serverMetadata:t}=e;return{serverMetadata:t}});o.catch(()=>{}),G(Xr,this).set(e,o);try{const{configuration:e,serverMetadata:t}=await r;F(Dr,this,e),F(Hr,this,t),G(Dr,this)[Ln]=G(Fr,this)}finally{G(Xr,this).delete(e)}return{configuration:G(Dr,this),serverMetadata:G(Hr,this)}}async function _o(e){var t,n;const{configuration:r}=await M(Jr,this,Io).call(this);if("audience"in e||"resource"in e)throw new to("audience and resource parameters are not supported for Token Vault exchanges");Ro(e.subjectToken);const o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==e.subjectTokenType&&void 0!==t?t:Oo,requested_token_type:null!==e.requestedTokenType&&void 0!==n?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&o.append("login_hint",e.loginHint),e.scope&&o.append("scope",e.scope),To(o,e.extra);try{const e=await nr(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return wo.fromTokenEndpointResponse(e)}catch(t){throw new to("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function Lo(e){const{configuration:t}=await M(Jr,this,Io).call(this);Ro(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),To(n,e.extra);try{const e=await nr(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return wo.fromTokenEndpointResponse(e)}catch(t){throw new to("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function ko(){return G(Gr,this)||F(Gr,this,(async()=>{if(!G(jr,this).clientSecret&&!G(jr,this).clientAssertionSigningKey&&!G(jr,this).useMtls)throw new so;if(G(jr,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=G(jr,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||await async function(e,t){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return An(e,t,void 0)}(e,G(jr,this).clientAssertionSigningAlg||"RS256"),e?function(e){return ke(e,void 0)}(e):_n(G(jr,this).clientSecret)})().catch(e=>{throw F(Gr,this,void 0),e})),G(Gr,this)}async function Po(e){const{configuration:t}=await M(Jr,this,Io).call(this),n=Re(),r=await function(e){return async function(e){return ve(e,"codeVerifier"),fe(await crypto.subtle.digest("SHA-256",le(e)))}(e)}(n),o=co(X(X({},G(jr,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(X(X({scope:vo},o),{},{client_id:G(jr,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Zn(t,i):await zn(t,i),codeVerifier:n}}function xo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Uo}=Object.prototype,{getPrototypeOf:Bo}=Object,{iterator:Mo,toStringTag:Do}=Symbol,Ho=(Go=Object.create(null),e=>{const t=Uo.call(e);return Go[t]||(Go[t]=t.slice(8,-1).toLowerCase())});var Go;const jo=e=>(e=e.toLowerCase(),t=>Ho(t)===e),Fo=e=>t=>typeof t===e,{isArray:Ko}=Array,Wo=Fo("undefined");function Xo(e){return null!==e&&!Wo(e)&&null!==e.constructor&&!Wo(e.constructor)&&Yo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Vo=jo("ArrayBuffer");const Jo=Fo("string"),Yo=Fo("function"),qo=Fo("number"),zo=e=>null!==e&&"object"==typeof e,Zo=e=>{if("object"!==Ho(e))return!1;const t=Bo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Do in e||Mo in e)},$o=jo("Date"),Qo=jo("File"),ei=jo("Blob"),ti=jo("FileList");const ni="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ri=void 0!==ni.FormData?ni.FormData:void 0,oi=jo("URLSearchParams"),[ii,ai,si,ci]=["ReadableStream","Request","Response","Headers"].map(jo);function ui(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ko(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const di="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,hi=e=>!Wo(e)&&e!==di;const fi=(pi="undefined"!=typeof Uint8Array&&Bo(Uint8Array),e=>pi&&e instanceof pi);var pi;const yi=jo("HTMLFormElement"),gi=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),wi=jo("RegExp"),mi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ui(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Ei=jo("AsyncFunction"),Ai=(bi="function"==typeof setImmediate,vi=Yo(di.postMessage),bi?setImmediate:vi?(Si=`axios@${Math.random()}`,Ri=[],di.addEventListener("message",({source:e,data:t})=>{e===di&&t===Si&&Ri.length&&Ri.shift()()},!1),e=>{Ri.push(e),di.postMessage(Si,"*")}):e=>setTimeout(e));var bi,vi,Si,Ri;const Ti="undefined"!=typeof queueMicrotask?queueMicrotask.bind(di):"undefined"!=typeof process&&process.nextTick||Ai,Oi={isArray:Ko,isArrayBuffer:Vo,isBuffer:Xo,isFormData:e=>{if(!e)return!1;if(ri&&e instanceof ri)return!0;const t=Bo(e);if(!t||t===Object.prototype)return!1;if(!Yo(e.append))return!1;const n=Ho(e);return"formdata"===n||"object"===n&&Yo(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Vo(e.buffer),t},isString:Jo,isNumber:qo,isBoolean:e=>!0===e||!1===e,isObject:zo,isPlainObject:Zo,isEmptyObject:e=>{if(!zo(e)||Xo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ii,isRequest:ai,isResponse:si,isHeaders:ci,isUndefined:Wo,isDate:$o,isFile:Qo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:ei,isRegExp:wi,isFunction:Yo,isStream:e=>zo(e)&&Yo(e.pipe),isURLSearchParams:oi,isTypedArray:fi,isFileList:ti,forEach:ui,merge:function e(...t){const{caseless:n,skipUndefined:r}=hi(this)&&this||{},o={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=n&&li(o,i)||i,s=gi(o,a)?o[a]:void 0;Zo(s)&&Zo(t)?o[a]=e(s,t):Zo(t)?o[a]=e({},t):Ko(t)?o[a]=t.slice():r&&Wo(t)||(o[a]=t)};for(let e=0,n=t.length;e(ui(t,(t,r)=>{n&&Yo(t)?Object.defineProperty(e,r,{__proto__:null,value:xo(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Bo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ho,kindOfTest:jo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ko(e))return e;let t=e.length;if(!qo(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Mo]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:yi,hasOwnProperty:gi,hasOwnProp:gi,reduceDescriptors:mi,freezeMethods:e=>{mi(e,(t,n)=>{if(Yo(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];Yo(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ko(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:li,global:di,isContextDefined:hi,isSpecCompliantForm:function(e){return!!(e&&Yo(e.append)&&"FormData"===e[Do]&&e[Mo])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(zo(e)){if(t.indexOf(e)>=0)return;if(Xo(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ko(e)?[]:{};return ui(e,(e,t)=>{const i=n(e,r+1);!Wo(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ei,isThenable:e=>e&&(zo(e)||Yo(e))&&Yo(e.then)&&Yo(e.catch),setImmediate:Ai,asap:Ti,isIterable:e=>null!=e&&Yo(e[Mo])},Ci=Oi.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ni=e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Ci[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};(Object.getOwnPropertyDescriptor(Ni,"name")||{}).writable||Object.defineProperty(Ni,"name",{value:"default",configurable:!0});const Ii=Symbol("internals"),_i=/[^\x09\x20-\x7E\x80-\xFF]/g;function Li(e){return e&&String(e).trim().toLowerCase()}function ki(e){return!1===e||null==e?e:Oi.isArray(e)?e.map(ki):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(_i,""))}function Pi(e,t,n,r,o){return Oi.isFunction(r)?r.call(this,t,n):(o&&(t=n),Oi.isString(t)?Oi.isString(r)?-1!==t.indexOf(r):Oi.isRegExp(r)?r.test(t):void 0:void 0)}class xi{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Li(t);if(!o)throw new Error("header name must be a non-empty string");const i=Oi.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=ki(e))}const i=(e,t)=>Oi.forEach(e,(e,n)=>o(e,n,t));if(Oi.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Oi.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(Ni(e),t);else if(Oi.isObject(e)&&Oi.isIterable(e)){let n,r,o={};for(const t of e){if(!Oi.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Oi.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Li(e)){const n=Oi.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Oi.isFunction(t))return t.call(this,e,n);if(Oi.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Li(e)){const n=Oi.findKey(this,e);return!(!n||void 0===this[n]||t&&!Pi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Li(e)){const o=Oi.findKey(n,e);!o||t&&!Pi(0,n[o],o,t)||(delete n[o],r=!0)}}return Oi.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Pi(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Oi.forEach(this,(r,o)=>{const i=Oi.findKey(n,o);if(i)return t[i]=ki(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=ki(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Oi.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Oi.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Ii]=this[Ii]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Li(e);t[r]||(!function(e,t){const n=Oi.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Oi.isArray(e)?e.forEach(r):r(e),this}}xi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Oi.reduceDescriptors(xi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Oi.freezeMethods(xi);const Ui=xi;function Bi(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Oi.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Ui&&(e=e.toJSON()),r.push(e),Oi.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);Oi.isUndefined(r)||(t[n]=r)});else{if(!Oi.isPlainObject(e)&&function(e){if(Oi.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Oi.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":o(i);Oi.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}class Mi extends Error{static from(e,t,n,r,o,i){const a=new Mi(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Oi.hasOwnProp(e,"redact")?e.redact:void 0,n=Oi.isArray(t)&&t.length>0?Bi(e,t):Oi.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}Mi.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Mi.ERR_BAD_OPTION="ERR_BAD_OPTION",Mi.ECONNABORTED="ECONNABORTED",Mi.ETIMEDOUT="ETIMEDOUT",Mi.ECONNREFUSED="ECONNREFUSED",Mi.ERR_NETWORK="ERR_NETWORK",Mi.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Mi.ERR_DEPRECATED="ERR_DEPRECATED",Mi.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Mi.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Mi.ERR_CANCELED="ERR_CANCELED",Mi.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Mi.ERR_INVALID_URL="ERR_INVALID_URL",Mi.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Di=Mi;var Hi=n(8287).hp;function Gi(e){return Oi.isPlainObject(e)||Oi.isArray(e)}function ji(e){return Oi.endsWith(e,"[]")?e.slice(0,-2):e}function Fi(e,t,n){return e?e.concat(t).map(function(e,t){return e=ji(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ki=Oi.toFlatObject(Oi,{},null,function(e){return/^is[A-Z]/.test(e)});const Wi=function(e,t,n){if(!Oi.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Oi.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Oi.isUndefined(t[e])})).metaTokens,o=n.visitor||d,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=s&&Oi.isSpecCompliantForm(t);if(!Oi.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Oi.isDate(e))return e.toISOString();if(Oi.isBoolean(e))return e.toString();if(!u&&Oi.isBlob(e))throw new Di("Blob is not supported. Use a Buffer instead.");return Oi.isArrayBuffer(e)||Oi.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Hi.from(e):e}function d(e,n,o){let s=e;if(Oi.isReactNative(t)&&Oi.isReactNativeBlob(e))return t.append(Fi(o,n,i),l(e)),!1;if(e&&!o&&"object"==typeof e)if(Oi.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Oi.isArray(e)&&function(e){return Oi.isArray(e)&&!e.some(Gi)}(e)||(Oi.isFileList(e)||Oi.endsWith(n,"[]"))&&(s=Oi.toArray(e)))return n=ji(n),s.forEach(function(e,r){!Oi.isUndefined(e)&&null!==e&&t.append(!0===a?Fi([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!Gi(e)||(t.append(Fi(o,n,i),l(e)),!1)}const h=[],f=Object.assign(Ki,{defaultVisitor:d,convertValue:l,isVisitable:Gi});if(!Oi.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!Oi.isUndefined(n)){if(i>c)throw new Di("Object is too deeply nested ("+i+" levels). Max depth: "+c,Di.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==h.indexOf(n))throw Error("Circular reference detected in "+r.join("."));h.push(n),Oi.forEach(n,function(n,a){!0===(!(Oi.isUndefined(n)||null===n)&&o.call(t,n,Oi.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],i+1)}),h.pop()}}(e),t};function Xi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Vi(e,t){this._pairs=[],e&&Wi(e,this,t)}const Ji=Vi.prototype;Ji.append=function(e,t){this._pairs.push([e,t])},Ji.toString=function(e){const t=e?function(t){return e.call(this,t,Xi)}:Xi;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Yi=Vi;function qi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function zi(e,t,n){if(!t)return e;const r=n&&n.encode||qi,o=Oi.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):Oi.isURLSearchParams(t)?t.toString():new Yi(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Zi=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Oi.forEach(this.handlers,function(t){null!==t&&e(t)})}},$i={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Qi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Yi,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ea="undefined"!=typeof window&&"undefined"!=typeof document,ta="object"==typeof navigator&&navigator||void 0,na=ea&&(!ta||["ReactNative","NativeScript","NS"].indexOf(ta.product)<0),ra="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,oa=ea&&window.location.href||"http://localhost",ia={...e,...Qi};const aa=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&Oi.isArray(r)?r.length:i,s)return Oi.hasOwnProp(r,i)?r[i]=Oi.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a;r[i]&&Oi.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Oi.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return Oi.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},sa=(e,t)=>null!=e&&Oi.hasOwnProp(e,t)?e[t]:void 0;const ca={transitional:$i,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Oi.isObject(e);o&&Oi.isHTMLForm(e)&&(e=new FormData(e));if(Oi.isFormData(e))return r?JSON.stringify(aa(e)):e;if(Oi.isArrayBuffer(e)||Oi.isBuffer(e)||Oi.isStream(e)||Oi.isFile(e)||Oi.isBlob(e)||Oi.isReadableStream(e))return e;if(Oi.isArrayBufferView(e))return e.buffer;if(Oi.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=sa(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Wi(e,new ia.classes.URLSearchParams,{visitor:function(e,t,n,r){return ia.isNode&&Oi.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=Oi.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=sa(this,"env"),r=n&&n.FormData;return Wi(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Oi.isString(e))try{return(t||JSON.parse)(e),Oi.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=sa(this,"transitional")||ca.transitional,n=t&&t.forcedJSONParsing,r=sa(this,"responseType"),o="json"===r;if(Oi.isResponse(e)||Oi.isReadableStream(e))return e;if(e&&Oi.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,sa(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Di.from(e,Di.ERR_BAD_RESPONSE,this,null,sa(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ia.classes.FormData,Blob:ia.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Oi.forEach(["delete","get","head","post","put","patch","query"],e=>{ca.headers[e]={}});const ua=ca;function la(e,t){const n=this||ua,r=t||n,o=Ui.from(r.headers);let i=r.data;return Oi.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function da(e){return!(!e||!e.__CANCEL__)}const ha=class extends Di{constructor(e,t,n){super(e??"canceled",Di.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function fa(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Di("Request failed with status code "+n.status,n.status>=400&&n.status<500?Di.ERR_BAD_REQUEST:Di.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const pa=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]},ga=(e,t,n=3)=>{let r=0;const o=pa(50,250);return ya(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);e({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},wa=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ma=e=>(...t)=>Oi.asap(()=>e(...t)),Ea=ia.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ia.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ia.origin),ia.navigator&&/(msie|trident)/i.test(ia.navigator.userAgent)):()=>!0,Aa=ia.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Oi.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Oi.isString(r)&&s.push(`path=${r}`),Oi.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Oi.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;nnull,remove(){}};function ba(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const va=e=>e instanceof Ui?{...e}:e;function Sa(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return Oi.isPlainObject(e)&&Oi.isPlainObject(t)?Oi.merge.call({caseless:r},e,t):Oi.isPlainObject(t)?Oi.merge({},t):Oi.isArray(t)?t.slice():t}function o(e,t,n,o){return Oi.isUndefined(t)?Oi.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Oi.isUndefined(t))return r(void 0,t)}function a(e,t){return Oi.isUndefined(t)?Oi.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Oi.hasOwnProp(t,i)?r(n,o):Oi.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(va(e),va(t),0,!0)};return Oi.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=Oi.hasOwnProp(c,r)?c[r]:o,a=i(Oi.hasOwnProp(e,r)?e[r]:void 0,Oi.hasOwnProp(t,r)?t[r]:void 0,r);Oi.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Ra=["content-type","content-length"];const Ta=e=>{const t=Sa({},e),n=e=>Oi.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const i=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const c=n("auth"),u=n("baseURL"),l=n("allowAbsoluteUrls"),d=n("url");var h;if(t.headers=s=Ui.from(s),t.url=zi(ba(u,d,l),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(h=c.password,encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))):""))),Oi.isFormData(r)&&(ia.hasStandardBrowserEnv||ia.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):Oi.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach(([t,n])=>{Ra.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),ia.hasStandardBrowserEnv){Oi.isFunction(o)&&(o=o(t));if(!0===o||null==o&&Ea(t.url)){const e=i&&a&&Aa.read(a);e&&s.set(i,e)}}return t};(Object.getOwnPropertyDescriptor(Ta,"name")||{}).writable||Object.defineProperty(Ta,"name",{value:"default",configurable:!0});const Oa="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ta(e);let o=r.data;const i=Ui.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:f}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function g(){if(!y)return;const r=Ui.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());fa(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&y.responseURL.startsWith("file:"))&&setTimeout(g)},y.onabort=function(){y&&(n(new Di("Request aborted",Di.ECONNABORTED,e,y)),p(),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Di(r,Di.ERR_NETWORK,e,y);o.event=t||null,n(o),p(),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||$i;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Di(t,o.clarifyTimeoutError?Di.ETIMEDOUT:Di.ECONNABORTED,e,y)),p(),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Oi.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Oi.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),f&&([c,l]=ga(f,!0),y.addEventListener("progress",c)),h&&y.upload&&([s,u]=ga(h),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new ha(null,e,y):t),y.abort(),p(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const w=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);!w||ia.protocols.includes(w)?y.send(o||null):n(new Di("Unsupported protocol "+w+":",Di.ERR_BAD_REQUEST,e))})},Ca=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Di?t:new ha(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Di(`timeout of ${t}ms exceeded`,Di.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Oi.asap(a),s}},Na=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Ia(e))yield*Na(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})};var La=n(8287).hp;const ka="1.16.0",{isFunction:Pa}=Oi,xa=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ua=e=>{const t=Oi.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Oi.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:i,Response:a}=e,s=o?Pa(o):"function"==typeof fetch,c=Pa(i),u=Pa(a);if(!s)return!1;const l=s&&Pa(n),d=s&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var h;const f=c&&l&&xa(()=>{let e=!1;const t=new i(ia.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),p=u&&l&&xa(()=>Oi.isReadableStream(new a("").body)),y={stream:p&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!y[e]&&(y[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Di(`Response type '${e}' is not supported`,Di.ERR_NOT_SUPPORT,n)})});const g=async(e,t)=>{const n=Oi.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(Oi.isBlob(e))return e.size;if(Oi.isSpecCompliantForm(e)){const t=new i(ia.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Oi.isArrayBufferView(e)||Oi.isArrayBuffer(e)?e.byteLength:(Oi.isURLSearchParams(e)&&(e+=""),Oi.isString(e)?(await d(e)).byteLength:void 0)})(t)};return async e=>{let{url:t,method:n,data:s,signal:u,cancelToken:l,timeout:d,onDownloadProgress:h,onUploadProgress:w,responseType:m,headers:E,withCredentials:A="same-origin",fetchOptions:b,maxContentLength:v,maxBodyLength:S}=Ta(e);const R=Oi.isNumber(v)&&v>-1,T=Oi.isNumber(S)&&S>-1;let O=o||fetch;m=m?(m+"").toLowerCase():"text";let C=Ca([u,l&&l.toAbortSignal()],d),N=null;const I=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let _;try{if(R&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(e-=2,n+=2)}let n=0,o=t-1;const i=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));o>=0&&(61===r.charCodeAt(o)?(n++,o--):i(o)&&(n++,o-=3)),1===n&&o>=0&&(61===r.charCodeAt(o)||i(o))&&n++;const a=3*Math.floor(e/4)-(n||0);return a>0?a:0}if(void 0!==La&&"function"==typeof La.byteLength)return La.byteLength(r,"utf8");let o=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o}(t);if(n>v)throw new Di("maxContentLength size of "+v+" exceeded",Di.ERR_BAD_RESPONSE,e,N)}if(T&&"get"!==n&&"head"!==n){const t=await g(E,s);if("number"==typeof t&&isFinite(t)&&t>S)throw new Di("Request body larger than maxBodyLength limit",Di.ERR_BAD_REQUEST,e,N)}if(w&&f&&"get"!==n&&"head"!==n&&0!==(_=await g(E,s))){let e,n=new i(t,{method:"POST",body:s,duplex:"half"});if(Oi.isFormData(s)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=wa(_,ga(ma(w)));s=_a(n.body,65536,e,t)}}Oi.isString(A)||(A=A?"include":"omit");const o=c&&"credentials"in i.prototype;if(Oi.isFormData(s)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/"+ka,!1);const u={...b,signal:C,method:n.toUpperCase(),headers:E.normalize().toJSON(),body:s,duplex:"half",credentials:o?A:void 0};N=c&&new i(t,u);let l=await(c?O(N,b):O(t,u));if(R){const t=Oi.toFiniteNumber(l.headers.get("content-length"));if(null!=t&&t>v)throw new Di("maxContentLength size of "+v+" exceeded",Di.ERR_BAD_RESPONSE,e,N)}const d=p&&("stream"===m||"response"===m);if(p&&l.body&&(h||R||d&&I)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=l[e]});const n=Oi.toFiniteNumber(l.headers.get("content-length")),[r,o]=h&&wa(n,ga(ma(h),!0))||[];let i=0;const s=t=>{if(R&&(i=t,i>v))throw new Di("maxContentLength size of "+v+" exceeded",Di.ERR_BAD_RESPONSE,e,N);r&&r(t)};l=new a(_a(l.body,65536,s,()=>{o&&o(),I&&I()}),t)}m=m||"text";let L=await y[Oi.findKey(y,m)||"text"](l,e);if(R&&!p&&!d){let t;if(null!=L&&("number"==typeof L.byteLength?t=L.byteLength:"number"==typeof L.size?t=L.size:"string"==typeof L&&(t="function"==typeof r?(new r).encode(L).byteLength:L.length)),"number"==typeof t&&t>v)throw new Di("maxContentLength size of "+v+" exceeded",Di.ERR_BAD_RESPONSE,e,N)}return!d&&I&&I(),await new Promise((t,n)=>{fa(t,n,{data:L,headers:Ui.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:N})})}catch(t){if(I&&I(),C&&C.aborted&&C.reason instanceof Di){const n=C.reason;throw n.config=e,N&&(n.request=N),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Di("Network Error",Di.ERR_NETWORK,e,N,t&&t.response),{cause:t.cause||t});throw Di.from(t,t&&t.code,e,N,t&&t.response)}}},Ba=new Map,Ma=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,c=i.length,u=Ba;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Ua(t)),u=s;return s},Da=(Ma(),{http:null,xhr:Oa,fetch:{get:Ma}});Oi.forEach(Da,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Ha=e=>`- ${e}`,Ga=e=>Oi.isFunction(e)||null===e||!1===e;const ja={getAdapter:function(e,t){e=Oi.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Ha).join("\n"):" "+Ha(e[0]):"as no adapter specified";throw new Di("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Da};function Fa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ha(null,e)}function Ka(e){Fa(e),e.headers=Ui.from(e.headers),e.data=la.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ja.getAdapter(e.adapter||ua.adapter,e)(e).then(function(t){Fa(e),e.response=t;try{t.data=la.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Ui.from(t.headers),t},function(t){if(!da(t)&&(Fa(e),t&&t.response)){e.response=t.response;try{t.response.data=la.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Ui.from(t.response.headers)}return Promise.reject(t)})}const Wa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Xa={};Wa.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ka+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Di(r(o," has been removed"+(t?" in "+t:"")),Di.ERR_DEPRECATED);return t&&!Xa[o]&&(Xa[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Wa.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Va={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Di("options must be an object",Di.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Di("option "+i+" must be "+n,Di.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Di("Unknown option "+i,Di.ERR_BAD_OPTION)}},validators:Wa},Ja=Va.validators;class Ya{constructor(e){this.defaults=e||{},this.interceptors={request:new Zi,response:new Zi}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Sa(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Va.assertOptions(n,{silentJSONParsing:Ja.transitional(Ja.boolean),forcedJSONParsing:Ja.transitional(Ja.boolean),clarifyTimeoutError:Ja.transitional(Ja.boolean),legacyInterceptorReqResOrdering:Ja.transitional(Ja.boolean)},!1),null!=r&&(Oi.isFunction(r)?t.paramsSerializer={serialize:r}:Va.assertOptions(r,{encode:Ja.function,serialize:Ja.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Va.assertOptions(t,{baseUrl:Ja.spelling("baseURL"),withXsrfToken:Ja.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Oi.merge(o.common,o[t.method]);o&&Oi.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete o[e]}),t.headers=Ui.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||$i;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!s){const e=[Ka.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new ha(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new za(function(t){e=t});return{token:t,cancel:e}}}const Za=za;const $a={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($a).forEach(([e,t])=>{$a[t]=e});const Qa=$a;const es=function e(t){const n=new qa(t),r=xo(qa.prototype.request,n);return Oi.extend(r,qa.prototype,n,{allOwnKeys:!0}),Oi.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Sa(t,n))},r}(ua);es.Axios=qa,es.CanceledError=ha,es.CancelToken=Za,es.isCancel=da,es.VERSION=ka,es.toFormData=Wi,es.AxiosError=Di,es.Cancel=es.CanceledError,es.all=function(e){return Promise.all(e)},es.spread=function(e){return function(t){return e.apply(null,t)}},es.isAxiosError=function(e){return Oi.isObject(e)&&!0===e.isAxiosError},es.mergeConfig=Sa,es.AxiosHeaders=Ui,es.formToJSON=e=>aa(Oi.isHTMLForm(e)?new FormData(e):e),es.getAdapter=ja.getAdapter,es.HttpStatusCode=Qa,es.default=es;function ts(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{}).timeout,r=Date.now();if(this.readyResolved&&!0===this.readyValue)return u.log("BlueConicUtils | blueConicReady | returning cached value:",this.readyValue),Promise.resolve(!0);if(this.readyPromise)return u.log("BlueConicUtils | blueConicReady | returning existing promise"),this.readyPromise;var o=null!=n?n:e.DEFAULT_TIMEOUT;return u.log("BlueConicUtils | blueConicReady | checking BC readiness"),this.readyPromise=new Promise(function(e){var n,i=setTimeout(function(){t.readyResolved||(u.log("BlueConicUtils | blueConicReady | timeout at:",(Date.now()-r)/1e3,"s"),t.resolveReady(!1,e))},o);if(null!==(n=window.blueConicClient)&&void 0!==n&&n.profile)return u.log("BlueConicUtils | blueConicReady | BC already ready"),void t.resolveReady(!0,e);var a=function(){var n;if(!t.readyResolved)if(null!==(n=window.blueConicClient)&&void 0!==n&&n.event){u.log("BlueConicUtils | blueConicReady | BC client detected");var o=window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){clearTimeout(i),u.log("BlueConicUtils | blueConicReady | onReady fired at:",(Date.now()-r)/1e3,"s"),null==o||o(),t.resolveReady(!0,e)})}else setTimeout(a,500)};a()}),this.readyPromise}},{key:"resolveReady",value:function(e,t){this.readyResolved||(u.log("BlueConicUtils | blueConicReady | resolved with:",e),this.readyResolved=!0,this.readyValue=e,t(e),!1===e&&(this.readyPromise=null,this.readyResolved=!1))}}])}();y(ns,"DEFAULT_TIMEOUT",3e3);new ns;var rs,os;function is(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function as(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=ss().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},ls=function(){return ss().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},ds=function(e){return function(e,t){if("string"!=typeof e)throw new g("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new g(`Invalid token specified: missing part #${n+1}`);let o;try{o=w(r)}catch(e){throw new g(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new g(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},hs=function(){var e=us();return["mcall.com","courant.com","sun-sentinel.com","orlandosentinel.com","growthspotter.com","dailypress.com","pilotonline.com","nydailynews.com","baltimoresun.com","capitalgazette.com","chicagotribune.com","trbdevcloud.com"].includes(e)},fs=function(){return"complete"===document.readyState},ps=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(fs())t();else{u.log("UIHandler: ","Waiting for the body to load...");var r=setInterval(s(c.mark(function o(){return c.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:e&&(n=fs()),document.querySelector("body")&&n&&(clearInterval(r),t(!0));case 1:case"end":return o.stop()}},o)})),200)}})},ys=function(){return new Promise(function(e){if(("interactive"===document.readyState||fs())&&window.dataLayer)u.log("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{u.log("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(s(c.mark(function n(){return c.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},gs=function(){return new Promise(function(e){if(fs())e();else{u.log("Utils digisubsMenuLoaded: ","Waiting for the digisubs dropdown to load...");var t=setInterval(s(c.mark(function n(){return c.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:document.getElementById("account-content")&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),200)}})},ws=function(){var e=s(c.mark(function e(t){var n,r,o;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,ys();case 1:return u.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",u.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return u.log("Utils dataLayerLoop: look for this element ",e),e[t]?(u.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(u.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},o=window.dataLayer.some(r),e.abrupt("return",o?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ms=function(){var e=s(c.mark(function e(){var t,n,r=arguments;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Page Type",e.next=1,ws(t);case 1:return n=e.sent,u.log("utils | pageType: page type is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Es=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(u.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(u.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};u.log("utils | Event: authentication ready: ",r),e(r)}catch(e){u.log(e),t(e)}},!1))})},As=function(){var e=s(c.mark(function e(){return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){return t.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(u.log("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(t){try{var r=t.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,u.log("Received entitlementsReady event:",r),e(r)}catch(e){u.error("Error handling entitlementsReady event:",e),n(e)}},{once:!0}):(u.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),bs=function(e){u.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return u.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=bs;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var vs=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)};var Ss=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var r={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},o=function(){var o=s(c.mark(function o(){var i,a,s,l,d,h,f,p,y,g,w;return c.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"1"!==(null===(i=window.sophi_config)||void 0===i?void 0:i.enableSophiSSPW)){o.next=1;break}if(!document.getElementById("server-paywall")){o.next=1;break}return r.sspw=!0,o.abrupt("return",t({paywall:!0,details:as({},r)}));case 1:return o.next=2,ms();case 2:return s=o.sent,o.next=3,ws("Paywall_Level");case 3:if(l=o.sent,"article"===s&&"free"!==l){o.next=4;break}return o.abrupt("return",t({paywall:!1,details:"article"!==s?"Page type is not an article":"Free article"}));case 4:return o.next=5,As();case 5:if(!(d=o.sent)||!d.isEntitled){o.next=6;break}return o.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){o.next=7;break}return o.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(h=null===(a=window.ConnextUtils)||void 0===a?void 0:a.runningSophi,u.log("checkPaywallStatus - Sophi is running: ",h),!h){o.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(r.sophiClient=!0,r.engageStatus=!0,r.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(r.sophiClient=!0),t({paywall:!0,details:as({},r)})},{once:!0}),o.next=12;break;case 8:if(h){o.next=12;break}return f=window.ConnextUtils.connextReady("onPaywallShown",!1),p=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),o.prev=9,o.next=10,Promise.race([f,p]);case 10:!0===(y=o.sent)?(r.engagePaywall=!0,r.engageStatus="Engage paywall detected"):(r.engagePaywall=!1,r.engageStatus="Engage response: ".concat(y)),o.next=12;break;case 11:o.prev=11,g=o.catch(9),r.engagePaywall=!1,r.engageStatus="Engage response: ".concat(g);case 12:return o.abrupt("return",t({paywall:Object.values(r).some(function(e){return e}),details:as({},r)}));case 13:o.prev=13,w=o.catch(0),n(w);case 14:case"end":return o.stop()}},o,null,[[0,13],[9,11]])}));return function(){return o.apply(this,arguments)}}();o()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Ss);var Rs=function(e){try{window.dataLayer.push({event:e}),u.log("ANALYTICS: ".concat(e," event")),u.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){u.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Ts="#main .article-share ul",Os=".dropdown-menu .account-settings",Cs=".nav-wrapper-secondary .article-share ul",Ns=function(){return document.querySelectorAll(Ts)},Is=function(){return document.querySelector(Os)},_s=function(){return document.querySelector(Cs)},Ls=n(8287).hp,ks=function(e){return Ls.from(e,"base64").toString("utf8")},Ps=function(){var e=window.localStorage.getItem(h),t=e&&ks(e)&&JSON.parse(ks(e),function(e,t){return e?function(e){try{var t=parseInt(e,10);return Number.isNaN(t)?e:t}catch(t){return e}}(JSON.parse(ks(t))):t});return u.log("Got encoded object hash with a value of ".concat(JSON.stringify(t))),t},xs=function(e){var t=Ps();return t&&t[e]},Us=function(e,t){var n=Ps()||{};n[e]=t,function(e){var t={};Object.keys(e).forEach(function(n){t[n]=Ls.from(JSON.stringify(e[n])).toString("base64")});var n=Ls.from(JSON.stringify(t)).toString("base64");window.localStorage.setItem("user-profile",n),u.log("Set encoded object hash for ".concat(e))}(n)};var Bs=function(e,t){var n=e,r=document.getElementById("article-share-copy-link-text".concat(t));"Link Copied"!==e&&"Link Updated"!==e&&(document.getElementById("article-share-copy-btn".concat(t)).disabled=!0);u.log("article sharing: user message inside share button: ",e,t),document.getElementById("articleCopyLinkSpinner".concat(t)).setAttribute("style","display:none"),document.getElementById("article-share-copy-btn".concat(t)).classList.remove("spinner-pad"),document.getElementById("articleCopyLinkSpinner".concat(t)).classList.remove("spring-spinner-mar"),document.getElementById("article-share-copy-link-text".concat(t)).setAttribute("style","display:flex;","align-items:center"),r.innerHTML="Link Copied"===e||"Link Updated"===e?'\n\t\n\t '.concat(n):e},Ms=function(){var e=s(c.mark(function e(){var t,n,r,o;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Es();case 1:if(t=e.sent,!(n=t.idToken)){e.next=2;break}return r=ds(n),o={uuid:r.sub},u.log("Article sharing: get user UUID",o.uuid),e.abrupt("return",o);case 2:return e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ds=function(e){return u.log("Article sharing: updating article count everywhere with ",e),document.querySelectorAll(".article-share-count").forEach(function(t){u.log("article sharing: updated article count! ",t),t.innerHTML=e}),u.log("Article sharing: update finished, return true"),!0},Hs=function(){u.log("Article sharing: User is being spoofed, retrieving uuid to check remaining articles");var e=JSON.parse(localStorage.getItem(l)).entitlementToken;u.log("Article sharing: spoofed jwtToken: ",e);var t=e?ds(e):"";return u.log("Article sharing: UUID: ",t.uuid),t},Gs=function(e){return new Promise(function(n){var r=t.A.entitlementsEndpoint,o=t.A.entitlementsApiKey,i="".concat(r,"articleSharing/checkRemaining");u.log("Article sharing: api data: ",o);var a=e.uuid;(u.log("Article sharing: callCheckRemainingEndpoint: check if user is spoofed"),window.localStorage.getItem("spoof-user"))&&(a=Hs().uuid);var l,h,f={uid:a,entitlementsToken:cs("mng-entitlements")};u.log("Article sharing: articles remaining api body: ",f),$.ajax({type:"POST",url:i,headers:{"X-Api-Key":t.A.entitlementsApiKey},data:JSON.stringify(f),success:(h=s(c.mark(function e(t){var r;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u.log("Article sharing: checkRemaining response: successful: ",t.remaining),r="10",r="This user does not exists in the database. Return 10 for sharesRemaining."===t.remaining?"10":t.remaining,Us(d,r),n(r);case 1:case"end":return e.stop()}},e)})),function(e){return h.apply(this,arguments)}),error:(l=s(c.mark(function e(t,r,o){return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:u.log("Article sharing: checkRemaining Failure: ",o),n(!1);case 1:case"end":return e.stop()}},e)})),function(e,t,n){return l.apply(this,arguments)})})})},js=function(){var e=s(c.mark(function e(t){var n,r,o,i,a=arguments;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.length>1&&void 0!==a[1]&&a[1],r=xs(d),n||!r){e.next=1;break}return e.abrupt("return",r);case 1:return e.next=2,Ms(t);case 2:return o=e.sent,e.next=3,Gs(o);case 3:return i=e.sent,e.abrupt("return",i);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Fs=function(){var e=s(c.mark(function e(n){var r,o,i,a,s,l,h,f,p,y,g,w,m,E;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=function(e){for(var t="",n=a.replace(/[^0-9a-zA-Z]+/gm,""),r=n.length,o=0;o?'),null==(s=document.querySelectorAll(".article-share-h6"))||s.forEach(function(e){e.insertAdjacentHTML("beforeend",a)}));case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Xs=function(e){var t,n=document.getElementById("share-icon-position".concat(e));"rgba(0, 0, 0, 0)"===window.getComputedStyle(document.querySelector("li.share-article")).backgroundColor?(n.classList.add("article-share-icon-invert"),t=window.getComputedStyle(document.getElementById("page")).getPropertyValue("--primary")):t="white";var r='\n\t\t\n\t\t'),o=window.btoa(r),i="url(data:image/svg+xml;base64,".concat(o,")");return n.style.background=i,"url(data:image/svg+xml;base64,".concat(o,")")},Vs=function(e){e.classList.contains("article-share-fixed")&&e.classList.remove("article-share-fixed")},Js=function(){var e=s(c.mark(function e(t){var n,r,o,a,l,d,h,f,p;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("Article sharing: build menu here"),e.next=1,ps();case 1:if(u.log(" Article Sharing: Build sharing menuz!"),n="",r=function(){var e=s(c.mark(function e(r){var o,i,a,s,l;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Rs("articleshare-openui"),o=document.getElementById("share-box-position".concat(r)),u.log("Article Sharing: i clicked this ",o,r),i=document.getElementById(o.id),u.log("article sharing: look for this box: ",o),o.classList.contains("show-article-sharing")||(u.log("article sharing: box already open, do not show spinner"),document.getElementById("articleShareBtnSpinner".concat(r)).setAttribute("style","display:block"),document.getElementById("share-icon-position".concat(r)).setAttribute("style","display:none!important;")),a=!1,t&&!o.classList.contains("show-article-sharing")){e.next=1;break}a=!0,e.next=4;break;case 1:return e.prev=1,e.next=2,js(r,!1);case 2:a=e.sent,Ds(a),e.next=4;break;case 3:e.prev=3,e.catch(1),u.log("Article share article count api error");case 4:u.log("article sharing: api request done, show results ",a),document.getElementById("share-icon-position".concat(r)).setAttribute("style","background:".concat(n,"; display:block!important;")),document.getElementById("articleShareBtnSpinner".concat(r)).setAttribute("style","display:none"),o.classList.toggle("show-article-sharing"),i.classList.toggle("show"),0!==r&&(vs(o)||o.classList.add("article-share-fixed")),s=document.querySelector("#article-share-position".concat(r," .article-share-link")),u.log("article sharing: accessible ",s),l=i.classList.contains("show"),u.log("article sharing: box isOpen ",l),l||(i.setAttribute("aria-expanded","false"),s.setAttribute("aria-press","false")),l&&(i.setAttribute("aria-expanded","true"),s.setAttribute("aria-press","true")),a<=0&&(u.log("article share: user out of free views ",a),Bs("No more shares left",r));case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),o='\n\t\n\t\n\t\n\tCopy The Shareable Link',a=function(e){var n=document.getElementById("share-box-position".concat(e)),i=document.getElementById("cancel-button-label".concat(e));if(i&&(i.childNodes[0].nodeValue="Cancel"),n&&n.classList.contains("show-article-sharing")){var a=document.getElementById("article-share-copy-link-text".concat(e));t&&a&&(a.innerHTML=o),r(e,"close"),0===e&&Vs(n)}},l=function(e,t){t&&t.addEventListener("click",function(){a(e)})},window.addEventListener("click",function(e){var n=e.target,r=n.closest(".article-share-link");if(t){var o=n.closest("#share-box-position0");null===(o&&o.classList.contains("show-article-sharing"))&&null===r&&a(0)}var i=n.closest("#share-box-position1");null===(i&&i.classList.contains("show-article-sharing"))&&null===r&&a(1);var s=n.closest("#share-box-position2");null===(s&&s.classList.contains("show-article-sharing"))&&null===r&&a(2)}),d=function(){var e=s(c.mark(function e(i){var a;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,ws("Page Title");case 1:a=e.sent,i.map(function(e,i){u.log("Article sharing: create button for this: ",e,i);var s=document.createElement("li");s.className="share-article",s.id="article-share-position".concat(i),s.setAttribute("tabindex","0");var c=document.createElement("button");c.className="article-share-link",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-controls","share-box-position".concat(i)),c.setAttribute("aria-label","Article Sharing Button"),c.setAttribute("tabindex","0"),s.append(c);var d=document.createElement("span");d.style.display="none",d.classList.add("spring-spinner"),d.id="articleShareBtnSpinner".concat(i),d.innerHTML='\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
';var h=document.querySelector("li.share-facebook"),f=window.getComputedStyle(h),p=document.createElement("span");u.log("article sharing: share icon color: ",f.backgroundColor),"rgba(0, 0, 0, 0)"===f.backgroundColor&&d.classList.add("spring-spinner-invert"),c.append(d),p.id="share-icon-position".concat(i),p.className="article-share-icon";var y=document.createElement("span");y.className="sharing-screen-reader-text",y.innerHTML="Click to share a free article with a friend",s.append(y),e.appendChild(s),c.append(p),n=Xs(i);var g=document.createElement("div");g.id="share-box-position".concat(i),g.className="article-share-box share-box-position".concat(i);var w,m="GIFT THIS ARTICLE",E='You have '.concat("10"," gift articles remaining this month");w=a,u.log(w),u.log("article sharing article title: ",w);var A=document.location.host;if(!1===t){g.classList.add("no-share");var b=A.replace("www.","").replace("develop.","").replace("preprod.",""),v=hs()?"https://subscription.".concat(b):"https://checkout.".concat(b);E='Subscibers get '.concat("10"," gift articles each month"),g.innerHTML='\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
').concat(m,"
\n\t\t\t\t\t
What is article sharing?
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t

Subscribers are entitled to 10 gift sharing articles each month. These can be shared with friends and family who are not subscribers.

\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t

Subscribe now! or Sign in to your account.

\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t')}else g.innerHTML='\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t
').concat(m,"
\n\t\t\t\t
").concat(E,"
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t

").concat(w,"

\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Copy the link
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t');e.appendChild(g);var S=document.getElementById("article-share-position".concat(i));S.addEventListener("click",function(){r(i,"open")}),S.addEventListener("keydown",function(e){"q"===e.key&&r(i,"open")});var R=document.getElementById("article-share-close".concat(i));l(i,R);var T=document.getElementById("cancel-button".concat(i));return l(i,T),document.getElementById("article-share-copy-btn".concat(i)).addEventListener("click",function(){Ys(i)}),"done"});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=[_s()].concat(i(Ns())),u.log("article sharing: target elements are ",h),h.filter(function(e){return null!==e}).length!==h.length){e.next=2;break}return e.next=2,d(h);case 2:if(u.log("Article Sharing: appending sticky nav too"),!t){e.next=4;break}return e.next=3,Ws();case 3:(f=document.querySelectorAll("#article-share-dropdown-article-page"))&&f.forEach(function(e){e.addEventListener("click",function(){r(0,"open")})}),(p=document.querySelector(".border-container #push-account-content #article-share-dropdown-article-page"))&&p.addEventListener("click",function(){document.getElementById("digisubs-toggle").click()});case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Ys=function(){var e=s(c.mark(function e(t){var n,r,o,i,a,s;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Fs(t);case 1:return n=e.sent,e.next=2,ws("URL");case 2:if(r=e.sent,u.log("Article sharing: check article endpoint response: successful: ",n),n.sharedCode&&"null"!==n.sharedCode&&void 0!==n.sharedCode){e.next=3;break}Bs("Network error, try again",t),e.next=11;break;case 3:if("Link Updated"===n.status?Bs("Link Updated",t):Bs("Link Copied",t),o="".concat(r,"?share=").concat(n.sharedCode),!document.hasFocus()){e.next=8;break}return e.prev=4,e.next=5,navigator.clipboard.writeText(o);case 5:u.log("Article sharing: Link Copied"),"Link Updated"===n.status?Bs("Link Updated",t):Bs("Link Copied",t),e.next=7;break;case 6:e.prev=6,s=e.catch(4),u.error("Clipboard write failed:",s),Bs("Copy failed. Try again.",t);case 7:e.next=9;break;case 8:u.warn("Clipboard copy blocked: document not focused"),Bs("Copy failed. Try again.",t);case 9:if((i=document.getElementById("cancel-button-label".concat(t)))&&(i.childNodes[0].nodeValue="Close"),"Link Updated"===n.status){e.next=11;break}return e.next=10,js(t);case 10:a=e.sent,Ds(a);case 11:case"end":return e.stop()}},e,null,[[4,6]])}));return function(t){return e.apply(this,arguments)}}(),qs=function(){var e=s(c.mark(function e(){var n,r,o,i,a,l,d,h,f;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.articleShareConvo=!1,window.MNGAuthentication.articleShare="",u.log("article sharing: code check: checking free article code"),n=window.location.search,r=new URLSearchParams(n),e.next=1,ws("Content ID");case 1:if(o=e.sent,i=ls(),u.log("article sharing: code check: url params array ",r.getAll("share")),0!==r.getAll("share").length){e.next=2;break}return u.log("No share search param"),e.abrupt("return",!1);case 2:return window.MNGAuthentication.articleShareConvo=!0,a=r.getAll("share"),Rs("articleshare-readingshare"),u.log("Article sharing: code check: check share code: ",a),l=t.A.entitlementsEndpoint,d=t.A.entitlementsApiKey,h="".concat(l,"articleSharing/checkArticleSharedLink"),f={articleName:o,publication:i,code:a[0]},e.abrupt("return",$.ajax({type:"POST",url:h,headers:{"X-Api-Key":d},data:JSON.stringify(f),success:function(e){if(u.log("Article sharing: code check: looking for valid share code: ",e),"nocodefound"===e)u.log("Article sharing: code check: code does not exist"),Rs("articleshare-readshare-codenotfound"),window.MNGAuthentication.articleShare="codenotfound";else{u.log("Article sharing: code check: time api timestamp response: ",e.sharedTimestamp);var t=new Date(e.sharedTimestamp),n=(t=t.setDate(t.getDate()+30))/1e3;u.log("Article sharing: code check: time api timestamp response expiration date ",n);var r=new Date;r=Math.floor(r.getTime()/1e3),u.log("Article sharing: code check: current unix time is, ",r),n0&&e.forEach(function(e){if(e&&e.classList.contains("show-article-sharing")){var t=window.scrollY,n=document.getElementById("sharing-bottom"),r=document.getElementById("sharing-top");if(n&&e.classList.contains("share-box-position2"))t/n.offsetTop*100>=93?Vs(e):e.classList.contains("article-share-fixed")||e.classList.add("article-share-fixed");if(r&&e.classList.contains("share-box-position1"))window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100>=11.5?Vs(e):e.classList.contains("article-share-fixed")||e.classList.add("article-share-fixed")}})}),e.next=1,Es();case 1:return t=e.sent,n=t.isAuthenticated,e.next=2,As();case 2:if(r=e.sent,!0!==n||void 0===window.MNGAuthentication||"function"!=typeof window.MNGAuthentication.isUserSubscriber||!r.isEntitled){e.next=7;break}return u.log("article sharing: subscriber, show sharing tool"),e.next=3,ms();case 3:if(o=e.sent,u.log("article sharing: page type is ",o),"article"!==o){e.next=5;break}return e.next=4,Js(!0);case 4:e.next=6;break;case 5:return e.next=6,Ws();case 6:e.next=9;break;case 7:return u.log("article sharing: not a logged in or a subscriber, show marketing message and check for share code"),e.next=8,qs();case 8:return e.next=9,Js(!1);case 9:window.addEventListener("updateArticlesRemainingUI",function(e){Ds(e.detail)});case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();var Zs=function(e){var t;"rgba(0, 0, 0, 0)"===window.getComputedStyle(document.querySelector("li.share-article")).backgroundColor?(e.classList.add("article-share-icon-invert"),t=window.getComputedStyle(document.getElementById("page")).getPropertyValue("--primary")):t="white";var n='\n\t\t\n\t\t');return"url(data:image/svg+xml;base64,".concat(window.btoa(n),")")},$s=function(){var e=s(c.mark(function e(){var t,n,r;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("engage gifting: waiting for body to load"),e.next=1,ps();case 1:null===(t=document.querySelector("style#engage-ga-style"))&&((t=document.createElement("style")).id="engage-ga-style",t.textContent="\n\t\t\t.share-article .engage-ga-share-popup { box-sizing: border-box; }\n\t\t\t.share-article .engage-ga-generate-link { color: white; background-color: var(--primary); }\n\t\t\t.share-article .engage-ga-generate-link:hover { background-color: var(--primary-light); }\n\t\t\t.share-article .engage-ga-generate-link:visited { text-decoration: none; }\n\t\t",document.head.appendChild(t),u.log("engage gifting: engage CSS overrides appended to head:",t)),n=function(e,t){if(null!==e.closest("#sharing-bottom")){u.log("engage gifting: create button for location ".concat(t,":"),e);var n=document.createElement("li");n.className="share-article",n.id="article-share-position".concat(t),n.setAttribute("tabindex","0"),n.setAttribute("data-mg2-action","giftArticleLink"),n.style.display="none";var r=document.createElement("button");r.className="article-share-link",r.setAttribute("aria-label","Article Gifting Button"),r.setAttribute("tabindex","0");var o=document.createElement("span");o.id="share-icon-position".concat(t),o.className="article-share-icon";var i=document.createElement("span");i.className="sharing-screen-reader-text",i.textContent="Click to share a free article with a friend",r.append(o),n.append(r,i),e.appendChild(n),o.style.background=Zs(o)}else u.log("engage gifting: skipping location ".concat(t,":"),e)},r=[_s()].concat(i(Ns())),u.log("engage gifting: target elements are ",r),r.filter(function(e){return null!==e}).length===r.length&&r.forEach(function(e,t){n(e,t)});case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Qs=function(){var e=s(c.mark(function e(){var t;return c.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.log("engage gifting: building Engage gifting buttons"),e.next=1,ms();case 1:if(t=e.sent,u.log("engage gifting: page type is",t),"article"!==t){e.next=2;break}return e.next=2,$s();case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();t.A.enableEngageArticleGifting?Qs():zs()})()})(); //# sourceMappingURL=mng-digisubs.articleShare.bundle.js.map; /*! For license information please see mng-digisubs.articleSave.bundle.js.LICENSE.txt */ (()=>{var e={893(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);ria}),"function"==typeof SuppressedError&&SuppressedError;const r={timeoutInSeconds:60},i=1e4,a="memory",s={name:"auth0-spa-js",version:"2.19.2"},c=()=>Date.now(),l="default";class u extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,u.prototype)}static fromPayload(e){let{error:t,error_description:n}=e;return new u(t,n)}}class d extends u{constructor(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super(e,t),this.state=n,this.appState=o,Object.setPrototypeOf(this,d.prototype)}}class p extends u{constructor(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=n,this.state=o,this.appState=r,Object.setPrototypeOf(this,p.prototype)}}class h extends u{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,h.prototype)}}class m extends h{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,m.prototype)}}class f extends u{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,f.prototype)}}class g extends u{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,g.prototype)}}class y extends u{constructor(e,t,n,o){super(e,t),this.mfa_token=n,this.mfa_requirements=o,Object.setPrototypeOf(this,y.prototype)}}class A extends u{constructor(e,t){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(v(e,["default"]),"', scope: '").concat(v(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,A.prototype)}}class w extends u{constructor(e,t){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(v(e,["default"]),"', missing scope: '").concat(v(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,w.prototype)}}class b extends u{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,b.prototype)}}function v(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}const S=()=>window.crypto,E=()=>{let e="";for(;e.length<43;){const t=S().getRandomValues(new Uint8Array(43-e.length));for(const n of t)e.length<43&&n<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[n%66])}return e},_=e=>btoa(e),T=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(e).reduce((n,o)=>{if(t&&"env"===o)return n;const r=T.find(e=>e.key===o);return r&&r.type.includes(typeof e[o])&&(n[o]=e[o]),n},{})},O=e=>{var{clientId:t}=e,n=o(e,["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:t},n))).toString()},C=async e=>{const t=S().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},I=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),P=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))};var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},N={},L={};Object.defineProperty(L,"__esModule",{value:!0});var D=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var o=e.locked.get(t);void 0===o?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(o.unshift(n),e.locked.set(t,o))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,o){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 o=n.pop();e.locked.set(t,n),void 0!==o&&setTimeout(o,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();L.default=function(){return D.getInstance()};var x=k&&k.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},U=k&&k.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]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 x(this,void 0,void 0,function(){return U(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 x(this,void 0,void 0,function(){var n,o,r,i;return U(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?j:this.storageHandler,o=H+"-"+t,null===(r=n.getItemSync(o))?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,B.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),B.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,o=t,r=[],i=0;;){var a=o.keySync(i);if(null===a)break;r.push(a),i++}for(var s=!1,c=0;co.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:o.signal},async e=>{if(clearTimeout(r),!e)throw new Error("Lock not available");return await n()})}catch(e){if(clearTimeout(r),"AbortError"===(null==e?void 0:e.name))throw new h;throw e}}}class z{constructor(){this.activeLocks=new Set,this.lock=new G,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,t,n){let o=!1;for(let n=0;n<10&&!o;n++)o=await this.lock.acquireLock(e,t);if(!o)throw new h;this.activeLocks.add(e),1===this.activeLocks.size&&"undefined"!=typeof window&&window.addEventListener("pagehide",this.pagehideHandler);try{return await n()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),0===this.activeLocks.size&&"undefined"!=typeof window&&window.removeEventListener("pagehide",this.pagehideHandler)}}}let J=null;const V=new TextEncoder,Z=new TextDecoder;function Y(e){return"string"==typeof e?V.encode(e):Z.decode(e)}function q(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new te(`${e.name} modulusLength must be at least 2048 bits`)}let Q;if(Uint8Array.prototype.toBase64)Q=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Q=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;onew Promise(function(n,o){const r=new MessageChannel;r.port1.onmessage=function(e){e.data.error?o(new Error(e.data.error)):n(e.data),r.port1.close()},t.postMessage(e,[r.port2])}),ue=(e,t,n)=>{const o=new AbortController;let r;return t.signal=o.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{r=setTimeout(()=>{o.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},de=async function(e,t,n,o,r,a){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:i;return r?(async(e,t,n,o,r,i,a,s)=>le({type:"refresh",auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:o,useFormData:a,useMrrt:s},i))(e,t,n,o,s,r,a,arguments.length>7?arguments[7]:void 0):(async(e,t,n)=>{const o=await ue(e,t,n);return{ok:o.ok,json:await o.json(),headers:(r=o.headers,[...r].reduce((e,t)=>{let[n,o]=t;return e[n]=o,e},{}))};var r})(e,o,s)};async function pe(e,t,n,r,i,a,s,c,l,d){if(l){const t=await l.generateProof({url:e,method:i.method||"GET",nonce:await l.getNonce()});i.headers=Object.assign(Object.assign({},i.headers),{dpop:t})}let p,h=null;for(let o=0;o<3;o++)try{p=await de(e,n,r,i,a,s,t,c),h=null;break}catch(e){h=e}if(h)throw h;const m=p.json,{error:f,error_description:g}=m,w=o(m,["error","error_description"]),{headers:v,ok:S}=p;let E;if(l&&(E=v[se],E&&await l.setNonce(E)),!S){const o=g||"HTTP error. Unable to fetch ".concat(e);if("mfa_required"===f)throw new y(f,o,w.mfa_token,w.mfa_requirements);if("missing_refresh_token"===f)throw new A(n,r);if("use_dpop_nonce"===f){if(!l||!E||d)throw new b(E);return pe(e,t,n,r,i,a,s,c,l,!0)}throw new u(f||"request_error",o)}return w}async function he(e,t){var{baseUrl:n,timeout:r,audience:i,scope:a,auth0Client:c,useFormData:u,useMrrt:d,dpop:p}=e,h=o(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const m="urn:ietf:params:oauth:grant-type:token-exchange"===h.grant_type,f="refresh_token"===h.grant_type&&d,g=Object.assign(Object.assign(Object.assign(Object.assign({},h),m&&i&&{audience:i}),m&&a&&{scope:a}),f&&{audience:i,scope:a}),y=u?O(g):JSON.stringify(g),A=(w=h.grant_type,ce.includes(w));var w;return await pe("".concat(n,"/oauth/token"),r,i||l,a,{method:"POST",body:y,headers:{"Content-Type":u?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(R(c||s)))}},t,u,d,A?p:void 0)}const me=function(){for(var e=arguments.length,t=new Array(e),n=0;n{let o;return n&&(o=e[n]),o||(o=e[l]),me(o,t)},ge="@@auth0spajs@@",ye="@@user@@";class Ae{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge,n=arguments.length>2?arguments[2]:void 0;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,o,r]=e.split("::");return new Ae({clientId:n,scope:r,audience:o},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:o}=e;return new Ae({scope:t,audience:n,clientId:o})}}class we{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(ge))}}class be{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 ve{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||c}async setIdToken(e,t,n){var o;const r=this.getIdTokenCacheKey(e);await this.cache.set(r,{id_token:t,decodedToken:n}),await(null===(o=this.keyManifest)||void 0===o?void 0:o.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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;var r;let i=await this.cache.get(e.toKey()),a=e;if(!i){const t=await this.getCacheKeys();if(!t)return;const r=this.matchExistingCacheKey(e,t);if(r&&(i=await this.cache.get(r),a=Ae.fromKey(r)),!i&&n&&"cache-only"!==o)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return i.expiresAt-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 Ae({clientId:e},ge,ye).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const o=Ae.fromKey(t),r=new Set(o.scope&&o.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=o.scope&&i.reduce((e,t)=>e&&r.has(t),!0);return o.prefix===ge&&o.clientId===e.clientId&&o.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const o of t){const t=Ae.fromKey(o);if(t.prefix===ge&&t.clientId===e.clientId){const e=await this.cache.get(o);if(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)return{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}}}async getRefreshTokensByAudience(e,t){var n;const o=await this.getCacheKeys();if(!o)return[];const r=new Set;for(const i of o){const o=Ae.fromKey(i);if(o.prefix===ge&&o.clientId===t&&o.audience===e){const e=await this.cache.get(i);(null===(n=null==e?void 0:e.body)||void 0===n?void 0:n.refresh_token)&&r.add(e.body.refresh_token)}}return Array.from(r)}async updateEntry(e,t){var n;const o=await this.getCacheKeys();if(o)for(const r of o){const o=await this.cache.get(r);(null===(n=null==o?void 0:o.body)||void 0===n?void 0:n.refresh_token)===e&&(o.body.refresh_token=t,await this.cache.set(r,o))}}}class Se{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey="".concat("a0.spajs.txs",".").concat(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 Ee=e=>"number"==typeof e,_e=["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 Te=k&&k.__assign||function(){return Te=Object.assign||function(e){for(var t,n=1,o=arguments.length;nke.get(e)||ke.get("".concat(Ne).concat(e)),save(e,t,n){let o={};"https:"===window.location.protocol&&(o={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(o.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(o.domain=n.cookieDomain),Ie("".concat(Ne).concat(e),JSON.stringify(t),o),ke.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Pe(e,n),ke.remove(e,t),ke.remove("".concat(Ne).concat(e),t)}},De={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 xe;!function(e){e.Code="code",e.ConnectCode="connect_code"}(xe||(xe={}));var Ue,Me=function(e){return Ue=Ue||function(e,t,n){var o=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var o=new Uint8Array(n.length),r=0,i=n.length;r0?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"".concat(ge,"::").concat(e)}}const je="auth0.is.authenticated",Ke={memory:()=>(new be).enclosedCache,localstorage:()=>new we},Fe=e=>Ke[e],We=e=>{const{openUrl:t,onRedirect:n}=e,r=o(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},Ge=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},Xe={NONCE:"nonce",KEYPAIR:"keypair"};class ze{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(Xe).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const o=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{o.onsuccess=()=>e(o.result),o.onerror=()=>t(o.error)})}buildKey(e){const t=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(t)}setNonce(e,t){return this.save(Xe.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(Xe.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(Xe.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Xe.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith("".concat(t,"::")))}clearNonces(){return this.deleteByClientId(Xe.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Xe.KEYPAIR,this.clientId)}}class Je{constructor(e){this.storage=new ze(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let o;return o={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(o,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function(e){let{keyPair:t,url:n,method:o,nonce:r,accessToken:i}=e;const a=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(n);return ie(t,a,o,r,i)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!re(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await ae(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new ee("unsupported JWK kty")}return $(await crypto.subtle.digest({name:"SHA-256"},Y(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Ve;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(Ve||(Ve={}));class Ze{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(t.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),o=e instanceof Request?new Request(n,e):n;return new Request(o,t)}setAuthorizationHeader(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ve.Bearer;e.headers.set("authorization","".concat(n," ").concat(t))}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),o=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",o)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let o,r;"string"==typeof n?(o=this.config.dpopNonceId?Ve.DPoP:Ve.Bearer,r=n):(o=n.token_type,r=n.access_token),this.setAuthorizationHeader(e,r,o),o===Ve.DPoP&&await this.setDpopProofHeader(e,r)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,se);if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new b(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,o){const r=this.buildBaseRequest(e,t);await this.prepareRequest(r,o);const i=await this.config.fetch(r);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const o={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},o),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,o,n)}}class Ye{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new qe({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new qe(t)}}class qe extends Error{constructor(e){let{type:t,status:n,title:o,detail:r,validation_errors:i}=e;super(r),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=o,this.detail=r,this.validation_errors=i,Object.setPrototypeOf(this,qe.prototype)}}const Qe={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};function $e(e,t){this.v=e,this.k=t}function et(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function tt(e){return new $e(e,0)}function nt(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ot(e,t){return e.get(et(e,t))}function rt(e,t,n){nt(e,t),t.set(e,n)}function it(e,t,n){return e.set(et(e,t),n),n}function at(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function ct(e){for(var t=1;t(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Ot=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw yt("The input to be decoded is not correctly encoded.",ft,e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw yt("".concat(n," must be a non-negative number"),ft,r);return}throw yt("".concat(n," must be a positive number"),ft,r)}catch(e){if(o)throw Nt(e.message,o,r);throw e}}function Bt(e,t,n,o){try{if("string"!=typeof e)throw yt("".concat(t," must be a string"),gt,o);if(0===e.length)throw yt("".concat(t," must not be empty"),ft,o)}catch(e){if(n)throw Nt(e.message,n,o);throw e}}function Ht(e){!function(e,t){if(pn(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r2){const e=o.pop();t+="".concat(o.join(", "),", or ").concat(e)}else 2===o.length?t+="".concat(o[0]," or ").concat(o[1]):t+=o[0];return Nt(t,Ln,e)}(e,t)}(e,"application/json")}function jt(){return It(crypto.getRandomValues(new Uint8Array(32)))}function Kt(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new Pt("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new Pt("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new Pt("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new Pt("unsupported CryptoKey algorithm name",{cause:e})}}function Ft(e){const t=null==e?void 0:e[wt];return"number"==typeof t&&Number.isFinite(t)?t:0}function Wt(e){const t=null==e?void 0:e[bt];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Gt(){return Math.floor(Date.now()/1e3)}function Xt(e){if("object"!=typeof e||null===e)throw yt('"as" must be an object',gt);Bt(e.issuer,'"as.issuer"')}function zt(e){if("object"!=typeof e||null===e)throw yt('"client" must be an object',gt);Bt(e.client_id,'"client.client_id"')}function Jt(e){return Bt(e,'"clientSecret"'),(t,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",e)}}function Vt(e,t){const{key:n,kid:o}=(r=e)instanceof CryptoKey?{key:r}:(null==r?void 0:r.key)instanceof CryptoKey?(void 0!==r.kid&&Bt(r.kid,'"kid"'),{key:r.key,kid:r.kid}):{};var r;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw yt("".concat(t," must be a CryptoKey"),gt)}(e,t),"private"!==e.type)throw yt("".concat(t," must be a private CryptoKey"),ft)}(n,'"clientPrivateKey.key"'),async(e,r,i,a)=>{var s;const c={alg:Kt(n),kid:o},l=function(e,t){const n=Gt()+Ft(t);return{jti:jt(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,r);null==t||null===(s=t[St])||void 0===s||s.call(t,c,l),i.set("client_id",r.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw yt('CryptoKey instances used for signing assertions must include "sign" in their "usages"',ft);const o="".concat(It(Rt(JSON.stringify(e))),".").concat(It(Rt(JSON.stringify(t)))),r=It(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:Gn(e)};case"RSA-PSS":switch(Wn(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new Pt("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Wn(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new Pt("unsupported CryptoKey algorithm name",{cause:e})}(n),n,Rt(o)));return"".concat(o,".").concat(r)}(c,l,n))}}const Zt=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Yt(e,t){if(t&&"https:"!==e.protocol)throw Nt("only requests to HTTPS are allowed",xn,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw Nt("only HTTP and HTTPS requests are allowed",Un,e)}function qt(e,t,n,o){let r;if("string"!=typeof e||!(r=Zt(e)))throw Nt("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?jn:Kn,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Yt(r,o),r}function Qt(e,t,n,o){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?qt(e.mtls_endpoint_aliases[t],t,n,o):qt(e[t],t,n,o)}class $t extends Error{constructor(e,t){var n;super(e,t),at(this,"cause",void 0),at(this,"code",void 0),at(this,"error",void 0),at(this,"status",void 0),at(this,"error_description",void 0),at(this,"response",void 0),this.name=this.constructor.name,this.code=Cn,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}class en extends Error{constructor(e,t){var n,o;super(e,t),at(this,"cause",void 0),at(this,"code",void 0),at(this,"error",void 0),at(this,"error_description",void 0),this.name=this.constructor.name,this.code=Pn,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==(n=t.cause.get("error_description"))&&void 0!==n?n:void 0,null===(o=Error.captureStackTrace)||void 0===o||o.call(Error,this,this.constructor)}}class tn extends Error{constructor(e,t){var n;super(e,t),at(this,"cause",void 0),at(this,"code",void 0),at(this,"response",void 0),at(this,"status",void 0),this.name=this.constructor.name,this.code=On,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}const nn="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",on="("+nn+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',rn="("+nn+")\\s*=\\s*("+nn+")",an=new RegExp("^[,\\s]*("+nn+")"),sn=new RegExp("^[,\\s]*"+on+"[,\\s]*(.*)"),cn=new RegExp("^[,\\s]*"+rn+"[,\\s]*(.*)"),ln=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function un(e,t,n){if(e.status!==t){let t;var o;if(function(e){let t;if(t=function(e){if(!mt(e,Response))throw yt('"response" must be an instance of Response',gt);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let o=t;for(;o;){var r;let t=o.match(an);const i=null===(r=t)||void 0===r?void 0:r[1].toLowerCase();if(!i)return;const a=o.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;o=s?s[1]:void 0;const l={};let u;if(c)for(;o;){let n,r;if(t=o.match(sn)){if([,n,r,o]=t,r.includes("\\"))try{r=JSON.parse('"'.concat(r,'"'))}catch(e){}l[n.toLowerCase()]=r}else{if(!(t=o.match(cn))){if(t=o.match(ln)){if(Object.keys(l).length)break;[,u,o]=t;break}return}[,n,r,o]=t,l[n.toLowerCase()]=r}}else o=a||void 0;const d={scheme:i,parameters:l};u&&(d.token68=u),n.push(d)}return n.length?n:void 0}(e))throw new tn("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),t=await async function(e){if(e.status>399&&e.status<500){Fn(e),Ht(e);try{const t=await e.clone().json();if(Lt(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===(o=e.body)||void 0===o?void 0:o.cancel()),new $t("server responded with an error in the response body",{cause:t,response:e});throw Nt('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Dn,e)}}function dn(e){if(!vn.has(e))throw yt('"options.DPoP" is not a valid DPoPHandle',ft)}function pn(e){var t;return null===(t=e.headers.get("content-type"))||void 0===t?void 0:t.split(";")[0]}async function hn(e,t,n,o,r,i,a){return await n(e,t,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[vt])||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:xt(o,null==a?void 0:a.signal)})}async function mn(e,t,n,o,r,i){var a;const s=Qt(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[At]));r.set("grant_type",o);const c=Dt(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(dn(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const l=await hn(e,t,n,s,r,c,i);return null==i||null===(a=i.DPoP)||void 0===a||a.cacheNonce(l,s),l}const fn=new WeakMap,gn=new WeakMap;function yn(e){if(!e.id_token)return;const t=fn.get(e);if(!t)throw yt('"ref" was already garbage collected or did not resolve from the proper sources',ft);return t}async function An(e,t,n,o,r,i){if(Xt(e),zt(t),!mt(n,Response))throw yt('"response" must be an instance of Response',gt);await un(n,200,"Token Endpoint"),Fn(n);const a=await Zn(n);if(Bt(a.access_token,'"response" body "access_token" property',Nn,{body:a}),Bt(a.token_type,'"response" body "token_type" property',Nn,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;Mt(e,!0,'"response" body "expires_in" property',Nn,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&Bt(a.refresh_token,'"response" body "refresh_token" property',Nn,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw Nt('"response" body "scope" property must be a string',Nn,{body:a});if(void 0!==a.id_token){Bt(a.id_token,'"response" body "id_token" property',Nn,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(Mt(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=o&&o.length&&i.push(...o);const{claims:s,jwt:c}=await async function(e,t,n,o,r){let i,a,{0:s,1:c,length:l}=e.split(".");if(5===l){if(void 0===r)throw new Pt("JWE decryption is not configured",{cause:e});e=await r(e),({0:s,1:c,length:l}=e.split("."))}if(3!==l)throw Nt("Invalid JWT",Nn,e);try{i=JSON.parse(Rt(It(s)))}catch(e){throw Nt("failed to parse JWT Header body as base64url encoded JSON",kn,e)}if(!Lt(i))throw Nt("JWT Header must be a top level object",Nn,e);if(t(i),void 0!==i.crit)throw new Pt('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{a=JSON.parse(Rt(It(c)))}catch(e){throw Nt("failed to parse JWT Payload body as base64url encoded JSON",kn,e)}if(!Lt(a))throw Nt("JWT Payload must be a top level object",Nn,e);const u=Gt()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw Nt('unexpected JWT "exp" (expiration time) claim type',Nn,{claims:a});if(a.exp<=u-o)throw Nt('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Mn,{claims:a,now:u,tolerance:o,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw Nt('unexpected JWT "iat" (issued at) claim type',Nn,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw Nt('unexpected JWT "iss" (issuer) claim type',Nn,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw Nt('unexpected JWT "nbf" (not before) claim type',Nn,{claims:a});if(a.nbf>u+o)throw Nt('unexpected JWT "nbf" (not before) claim value',Mn,{claims:a,now:u,tolerance:o,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw Nt('unexpected JWT "aud" (audience) claim type',Nn,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,Xn.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Ft(t),Wt(t),r).then(_n.bind(void 0,i)).then(bn.bind(void 0,e)).then(wn.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw Nt('ID Token "aud" (audience) claim includes additional untrusted audiences',Bn,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw Nt('unexpected ID Token "azp" (authorized party) claim value',Bn,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&Mt(s.auth_time,!0,'ID Token "auth_time" (authentication time)',Nn,{claims:s}),gn.set(n,c),fn.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new Pt("unsupported `token_type` value",{cause:{body:a}});return a}function wn(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Nt('unexpected JWT "aud" (audience) claim value',Bn,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Nt('unexpected JWT "aud" (audience) claim value',Bn,{expected:e,claims:t.claims,claim:"aud"});return t}function bn(e,t){var n,o;const r=null!==(n=null===(o=e[qn])||void 0===o?void 0:o.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==r)throw Nt('unexpected JWT "iss" (issuer) claim value',Bn,{expected:r,claims:t.claims,claim:"iss"});return t}const vn=new WeakSet,Sn=Symbol(),En={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function _n(e,t){for(const n of e)if(void 0===t.claims[n])throw Nt('JWT "'.concat(n,'" (').concat(En[n],") claim missing"),Nn,{claims:t.claims});return t}const Tn=Symbol(),Rn=Symbol();const On="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Cn="OAUTH_RESPONSE_BODY_ERROR",In="OAUTH_UNSUPPORTED_OPERATION",Pn="OAUTH_AUTHORIZATION_RESPONSE_ERROR",kn="OAUTH_PARSE_ERROR",Nn="OAUTH_INVALID_RESPONSE",Ln="OAUTH_RESPONSE_IS_NOT_JSON",Dn="OAUTH_RESPONSE_IS_NOT_CONFORM",xn="OAUTH_HTTP_REQUEST_FORBIDDEN",Un="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Mn="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Bn="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Hn="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",jn="OAUTH_MISSING_SERVER_METADATA",Kn="OAUTH_INVALID_SERVER_METADATA";function Fn(e){if(e.bodyUsed)throw yt('"response" body has been used already',ft)}function Wn(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new Pt("unsupported ".concat(t.name," modulusLength"),{cause:e})}function Gn(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Pt("unsupported ECDSA namedCurve",{cause:e})}}function Xn(e,t,n,o){if(void 0===e)if(Array.isArray(t)){if(!t.includes(o.alg))throw Nt('unexpected JWT "alg" header parameter',Nn,{header:o,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw Nt('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?o.alg!==n:"function"==typeof n?!n(o.alg):!n.includes(o.alg))throw Nt('unexpected JWT "alg" header parameter',Nn,{header:o,expected:n,reason:"default value"})}else if("string"==typeof e?o.alg!==e:!e.includes(o.alg))throw Nt('unexpected JWT "alg" header parameter',Nn,{header:o,expected:e,reason:"client configuration"})}function zn(e,t){const{0:n,length:o}=e.getAll(t);if(o>1)throw Nt('"'.concat(t,'" parameter must be provided only once'),Nn);return n}const Jn=Symbol(),Vn=Symbol();async function Zn(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ht;try{t=await e.json()}catch(t){throw n(e),Nt('failed to parse "response" body as JSON',kn,t)}if(!Lt(t))throw Nt('"response" body must be a top level object',Nn,{body:t});return t}const Yn=Symbol(),qn=Symbol(),Qn=new TextEncoder,$n=new TextDecoder;function eo(e){const t=new Uint8Array(e.length);for(let n=0;n127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=o}return t}function to(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},ro=(e,t)=>e.name===t;function io(e,t){var n;if(n=e.hash,parseInt(n.name.slice(4),10)!==t)throw oo("SHA-".concat(t),"algorithm.hash")}function ao(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r2){const t=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(t,".")}else 2===o.length?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");if(null==t)e+=" Received ".concat(t);else if("function"==typeof t&&t.name)e+=" Received function ".concat(t.name);else if("object"==typeof t&&null!=t){var i;null!==(i=t.constructor)&&void 0!==i&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const so=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r2&&void 0!==arguments[2]?arguments[2]:"unspecified",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:o,payload:t}}),at(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),at(this,"claim",void 0),at(this,"reason",void 0),at(this,"payload",void 0),this.claim=n,this.reason=o,this.payload=t}}at(lo,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class uo extends co{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:o,payload:t}}),at(this,"code","ERR_JWT_EXPIRED"),at(this,"claim",void 0),at(this,"reason",void 0),at(this,"payload",void 0),this.claim=n,this.reason=o,this.payload=t}}at(uo,"code","ERR_JWT_EXPIRED");class po extends co{constructor(){super(...arguments),at(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}at(po,"code","ERR_JOSE_ALG_NOT_ALLOWED");class ho extends co{constructor(){super(...arguments),at(this,"code","ERR_JOSE_NOT_SUPPORTED")}}at(ho,"code","ERR_JOSE_NOT_SUPPORTED"),at(class extends co{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),at(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),at(class extends co{constructor(){super(...arguments),at(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class mo extends co{constructor(){super(...arguments),at(this,"code","ERR_JWS_INVALID")}}at(mo,"code","ERR_JWS_INVALID");class fo extends co{constructor(){super(...arguments),at(this,"code","ERR_JWT_INVALID")}}at(fo,"code","ERR_JWT_INVALID"),at(class extends co{constructor(){super(...arguments),at(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class go extends co{constructor(){super(...arguments),at(this,"code","ERR_JWKS_INVALID")}}at(go,"code","ERR_JWKS_INVALID");class yo extends co{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),at(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}at(yo,"code","ERR_JWKS_NO_MATCHING_KEY");class Ao extends co{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),at(this,Symbol.asyncIterator,void 0),at(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}at(Ao,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class wo extends co{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),at(this,"code","ERR_JWKS_TIMEOUT")}}at(wo,"code","ERR_JWKS_TIMEOUT");class bo extends co{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),at(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}at(bo,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const vo=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},So=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),Eo=e=>vo(e)||So(e);function _o(e,t,n){try{return no(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}function To(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const Ro=e=>To(e)&&"string"==typeof e.kty;async function Oo(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o3&&void 0!==arguments[3]&&arguments[3];ko||(ko=new WeakMap);let r=ko.get(e);if(null!=r&&r[n])return r[n];const i=await Io(ct(ct({},t),{},{alg:n}));return o&&Object.freeze(e),r?r[n]=i:ko.set(e,{[n]:i}),i};const Lo=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n{const t=e.data[e.pos++];if(128&t){const n=127&t;let o=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(n)},Uo=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},Mo=(e,t,n)=>{var o;const r=(e=>to(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=n;return null!=t&&null!==(o=t.startsWith)&&void 0!==o&&o.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){xo(e,48,"Invalid PKCS#8 structure"),Do(e),xo(e,2,"Expected version field");const t=Do(e);e.pos+=t,xo(e,48,"Expected algorithm identifier");Do(e);e.pos}(t),(e=>{const t=(e=>{xo(e,6,"Expected algorithm OID");const t=Do(e);return Uo(e,t)})(e);if(Lo(t,[43,101,110]))return"X25519";if(!Lo(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");xo(e,6,"Expected curve OID");const n=Do(e),o=Uo(e,n);for(const{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Lo(o,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,n,o)=>{var r;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=o.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new ho("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new ho('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(r=null==o?void 0:o.extractable)&&void 0!==r?r:!!s,a)})("pkcs8",r,t,i)},Bo=e=>null==e?void 0:e[Symbol.toStringTag],Ho=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(e,'" when present'))}if(void 0!==t.alg&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var o,r;let i;switch(!0){case"sign"===n||"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===n?"wrapKey":"unwrapKey":n;break;case"encrypt"===n&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(o=t.key_ops)||void 0===o||null===(r=o.includes)||void 0===r?void 0:r.call(o,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var jo,Ko;let Fo,Wo;if("undefined"==typeof navigator||null===(jo=navigator.userAgent)||void 0===jo||null===(Ko=jo.startsWith)||void 0===Ko||!Ko.call(jo,"Mozilla/5.0 ")){const e="v6.8.3";Wo="".concat("openid-client","/").concat(e),Fo={"user-agent":Wo}}const Go=e=>Xo.get(e);let Xo,zo;function Jo(e){return void 0!==e?Jt(e):(zo||(zo=new WeakMap),(e,t,n,o)=>{let r;return(r=zo.get(t))||(function(e,t){if("string"!=typeof e)throw qo("".concat(t," must be a string"),Yo);if(0===e.length)throw qo("".concat(t," must not be empty"),Zo)}(t.client_secret,'"metadata.client_secret"'),r=Jt(t.client_secret),zo.set(t,r)),r(e,t,n,o)})}const Vo=vt,Zo="ERR_INVALID_ARG_VALUE",Yo="ERR_INVALID_ARG_TYPE";function qo(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}class Qo extends Error{constructor(e,t){var n;super(e,t),at(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===(n=Error.captureStackTrace)||void 0===n||n.call(Error,this,this.constructor)}}function $o(e,t,n){return new Qo(e,{cause:t,code:n})}function er(e){if(e instanceof TypeError||e instanceof Qo||e instanceof $t||e instanceof en||e instanceof tn)throw e;if(e instanceof kt)switch(e.code){case xn:throw $o("only requests to HTTPS are allowed",e,e.code);case Un:throw $o("only requests to HTTP or HTTPS are allowed",e,e.code);case Dn:throw $o("unexpected HTTP response status code",e.cause,e.code);case Ln:throw $o("unexpected response content-type",e.cause,e.code);case kn:throw $o("parsing error occured",e,e.code);case Nn:throw $o("invalid response encountered",e,e.code);case Bn:throw $o("unexpected JWT claim value encountered",e,e.code);case Hn:throw $o("unexpected JSON attribute value encountered",e,e.code);case Mn:throw $o("JWT timestamp claim value failed validation",e,e.code);default:throw $o(e.message,e,e.code)}if(e instanceof Pt)throw $o("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw $o("runtime operation error",e,In);case"NotSupportedError":throw $o("runtime unsupported operation",e,In);case"TimeoutError":throw $o("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw $o("operation aborted",e,"OAUTH_ABORT")}throw new Qo("something went wrong",{cause:e})}async function tr(e,t,n,o,r){const i=await async function(e,t){var n,o;if(!(e instanceof URL))throw qo('"server" must be an instance of URL',Yo);const r=!e.href.includes("/.well-known/"),i=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:30,a=AbortSignal.timeout(1e3*i),s=await(r?async function(e,t){return async function(e,t,n,o){if(!(e instanceof URL))throw yt('"'.concat("issuerIdentifier",'" must be an instance of URL'),gt);Yt(e,!0!==(null==o?void 0:o[At]));const r=n(new URL(e.href)),i=Dt(null==o?void 0:o.headers);return i.set("accept","application/json"),((null==o?void 0:o[vt])||fetch)(r.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:xt(r,null==o?void 0:o.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=Ut("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=Ut("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw yt('"options.algorithm" must be "oidc" (default), or "oauth2"',ft)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[vt]:null==t?void 0:t[Vo],[At]:null==t||null===(o=t.execute)||void 0===o?void 0:o.includes(lr),signal:a,headers:new Headers(Fo)}):((null==t?void 0:t[Vo])||fetch)((Yt(e,null==t||null===(c=t.execute)||void 0===c||!c.includes(lr)),e.href),{headers:Object.fromEntries(new Headers(ct({accept:"application/json"},Fo)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==Yn)throw yt('"expectedIssuerIdentifier" must be an instance of URL',gt);if(!mt(t,Response))throw yt('"response" must be an instance of Response',gt);if(200!==t.status)throw Nt('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Dn,t);Fn(t);const o=await Zn(t);if(Bt(o.issuer,'"response" body "issuer" property',Nn,{body:o}),n!==Yn&&new URL(o.issuer).href!==n.href)throw Nt('"response" body "issuer" property does not match the expected value',Hn,{expected:n.href,body:o,attribute:"issuer"});return o}(Yn,e)).catch(er);var c;return r&&new URL(s.issuer).href!==e.href&&(function(e,t,n){return!("https://login.microsoftonline.com"!==e.origin||null!=n&&n.algorithm&&"oidc"!==n.algorithm||(t[nr]=!0,0))}(e,s,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new Qo("discovered metadata issuer does not match the expected issuer",{code:Hn,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,r),a=new or(i,t,n,o);let s=Go(a);if(null!=r&&r[Vo]&&(s.fetch=r[Vo]),null!=r&&r.timeout&&(s.timeout=r.timeout),null!=r&&r.execute)for(const e of r.execute)e(a);return a}new TextDecoder;const nr=Symbol();class or{constructor(e,t,n,o){var r,i,a,s,c;if("string"!=typeof t||!t.length)throw qo('"clientId" must be a non-empty string',Yo);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(r=n)||void 0===r?void 0:r.client_id)&&t!==n.client_id)throw qo('"clientId" and "metadata.client_id" must be the same',Zo);const l=ct(ct({},structuredClone(n)),{},{client_id:t});let u;l[wt]=null!==(i=null===(a=n)||void 0===a?void 0:a[wt])&&void 0!==i?i:0,l[bt]=null!==(s=null===(c=n)||void 0===c?void 0:c[bt])&&void 0!==s?s:30,u=o||("string"==typeof l.client_secret&&l.client_secret.length?Jo(l.client_secret):(e,t,n,o)=>{n.set("client_id",t.client_id)});let d=Object.freeze(l);const p=structuredClone(e);nr in e&&(p[qn]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(p);Xo||(Xo=new WeakMap),Xo.set(this,{__proto__:null,as:h,c:d,auth:u,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(Go(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"S256";return!0===(null===(t=e.code_challenge_methods_supported)||void 0===t?void 0:t.includes(n))}}}}(e))}(e),e}clientMetadata(){return structuredClone(Go(this).c)}get timeout(){return Go(this).timeout}set timeout(e){Go(this).timeout=e}get[Vo](){return Go(this).fetch}set[Vo](e){Go(this).fetch=e}}function rr(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const n=new Date;n.setSeconds(n.getSeconds()+e.expires_in),t=n.getTime()}return{expiresIn:{__proto__:null,value(){if(t){const e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return yn(this)}catch(e){return}}}}}(e))}async function ir(e,t,n){var o;let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===(o=e.headers.get("retry-after"))||void 0===o?void 0:o.trim();if(void 0===i)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const e=new Date(i);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&(a=Math.ceil(n/1e3))}}if(r&&!Number.isFinite(a))throw new kt("invalid Retry-After header value",{cause:e});a>t&&await ar(a-t,n)}function ar(e,t){return new Promise((n,o)=>{const r=e=>{try{t.throwIfAborted()}catch(e){return void o(e)}if(e<=0)return void n();const i=Math.min(e,5);setTimeout(()=>r(e-i),1e3*i)};r(e)})}async function sr(e,t){fr(e);const{as:n,c:o,auth:r,fetch:i,tlsOnly:a,timeout:s}=Go(e);return async function(e,t,n,o,r){Xt(e),zt(t);const i=Qt(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==r?void 0:r[At])),a=new URLSearchParams(o);a.set("client_id",t.client_id);const s=Dt(null==r?void 0:r.headers);return s.set("accept","application/json"),hn(e,t,n,i,a,s,r)}(n,o,r,t,{[vt]:i,[At]:!a,headers:new Headers(Fo),signal:gr(s)}).then(e=>async function(e,t,n){if(Xt(e),zt(t),!mt(n,Response))throw yt('"response" must be an instance of Response',gt);await un(n,200,"Backchannel Authentication Endpoint"),Fn(n);const o=await Zn(n);Bt(o.auth_req_id,'"response" body "auth_req_id" property',Nn,{body:o});let r="number"!=typeof o.expires_in?parseFloat(o.expires_in):o.expires_in;return Mt(r,!0,'"response" body "expires_in" property',Nn,{body:o}),o.expires_in=r,void 0!==o.interval&&Mt(o.interval,!1,'"response" body "interval" property',Nn,{body:o}),o}(n,o,e)).catch(er)}async function cr(e,t,n,o){var r,i;fr(e),n=new URLSearchParams(n);let a=null!==(r=t.interval)&&void 0!==r?r:5;const s=null!==(i=null==o?void 0:o.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await ar(a,s)}catch(e){er(e)}const{as:c,c:l,auth:u,fetch:d,tlsOnly:p,nonRepudiation:h,timeout:m,decrypt:f}=Go(e),g=(r,i)=>cr(e,ct(ct({},t),{},{interval:r}),n,ct(ct({},o),{},{signal:s,flag:i})),y=await async function(e,t,n,o,r){Xt(e),zt(t),Bt(o,'"authReqId"');const i=new URLSearchParams(null==r?void 0:r.additionalParameters);return i.set("auth_req_id",o),mn(e,t,n,"urn:openid:params:grant-type:ciba",i,r)}(c,l,u,t.auth_req_id,{[vt]:d,[At]:!p,additionalParameters:n,DPoP:null==o?void 0:o.DPoP,headers:new Headers(Fo),signal:s.aborted?s:gr(m)}).catch(er);var A;if(503===y.status&&y.headers.has("retry-after"))return await ir(y,a,s,!0),await(null===(A=y.body)||void 0===A?void 0:A.cancel()),g(a);const w=async function(e,t,n,o){return An(e,t,n,void 0,null==o?void 0:o[Et],null==o?void 0:o.recognizedTokenTypes)}(c,l,y,{[Et]:f});let b;try{b=await w}catch(e){if(yr(e,o))return g(a,Ar);if(e instanceof $t)switch(e.error){case"slow_down":a+=5;case"authorization_pending":return await ir(e.response,a,s),g(a)}er(e)}return b.id_token&&await(null==h?void 0:h(y)),rr(b),b}function lr(e){Go(e).tlsOnly=!1}async function ur(e,t,n,o,r){if(fr(e),!((null==r?void 0:r.flag)===Ar||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw qo('"currentUrl" must be an instance of URL, or Request',Yo);let i,a;const{as:s,c,auth:l,fetch:u,tlsOnly:d,jarm:p,hybrid:h,nonRepudiation:m,timeout:f,decrypt:g,implicit:y}=Go(e);if((null==r?void 0:r.flag)===Ar)i=r.authResponse,a=r.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(t=new URL(t.url),e.method){case"GET":break;case"POST":const n=new URLSearchParams(await async function(e){if("POST"!==e.method)throw yt("form_post responses are expected to use the POST method",ft,{cause:e});if("application/x-www-form-urlencoded"!==pn(e))throw yt("form_post responses are expected to use the application/x-www-form-urlencoded content-type",ft,{cause:e});return async function(e){if(e.bodyUsed)throw yt("form_post Request instances must contain a readable body",ft,{cause:e});return e.text()}(e)}(e));if(h)t.hash=n.toString();else for(const[e,o]of n.entries())t.searchParams.append(e,o);break;default:throw qo("unexpected Request HTTP method",Zo)}}switch(a=function(e){return(e=new URL(e)).search="",e.hash="",e.href}(t),!0){case!!p:i=await p(t,null==n?void 0:n.expectedState);break;case!!h:i=await h(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!y:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=function(e,t,n,o){if(Xt(e),zt(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw yt('"parameters" must be an instance of URLSearchParams, or URL',gt);if(zn(n,"response"))throw Nt('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Nn,{parameters:n});const r=zn(n,"iss"),i=zn(n,"state");if(!r&&e.authorization_response_iss_parameter_supported)throw Nt('response parameter "iss" (issuer) missing',Nn,{parameters:n});if(r&&r!==e.issuer)throw Nt('unexpected "iss" (issuer) response parameter value',Nn,{expected:e.issuer,parameters:n});switch(o){case void 0:case Vn:if(void 0!==i)throw Nt('unexpected "state" response parameter encountered',Nn,{expected:void 0,parameters:n});break;case Jn:break;default:if(Bt(o,'"expectedState" argument'),i!==o)throw Nt(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',Nn,{expected:o,parameters:n})}if(zn(n,"error"))throw new en("authorization response from the server is an error",{cause:n});const a=zn(n,"id_token"),s=zn(n,"token");if(void 0!==a||void 0!==s)throw new Pt("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),vn.add(c),c;var c}(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){er(e)}}}const A=await async function(e,t,n,o,r,i,a){if(Xt(e),zt(t),!vn.has(o))throw yt('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',ft);Bt(r,'"redirectUri"');const s=zn(o,"code");if(!s)throw Nt('no authorization code in "callbackParameters"',Nn);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",r),c.set("code",s),i!==Sn&&(Bt(i,'"codeVerifier"'),c.set("code_verifier",i)),mn(e,t,n,"authorization_code",c,a)}(s,c,l,i,a,(null==n?void 0:n.pkceCodeVerifier)||Sn,{additionalParameters:o,[vt]:u,[At]:!d,DPoP:null==r?void 0:r.DPoP,headers:new Headers(Fo),signal:gr(f)}).catch(er);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const w=async function(e,t,n,o){return"string"==typeof(null==o?void 0:o.expectedNonce)||"number"==typeof(null==o?void 0:o.maxAge)||null!=o&&o.requireIdToken?async function(e,t,n,o,r,i,a){const s=[];switch(o){case void 0:o=Tn;break;case Tn:break;default:Bt(o,'"expectedNonce" argument'),s.push("nonce")}switch(null!=r||(r=t.default_max_age),r){case void 0:r=Rn;break;case Rn:break;default:Mt(r,!0,'"maxAge" argument'),s.push("auth_time")}const c=await An(e,t,n,s,i,a);Bt(c.id_token,'"response" body "id_token" property',Nn,{body:c});const l=yn(c);if(r!==Rn){const e=Gt()+Ft(t),n=Wt(t);if(l.auth_time+r{let n;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(n={n_a:()=>{}}),async function(e,t,n,o){return An(e,t,n,void 0,null==o?void 0:o[Et],null==o?void 0:o.recognizedTokenTypes)}(r,i,e,{[Et]:u,recognizedTokenTypes:n})}).catch(er);return rr(d),d}async function br(e,t,n){if(!To(e))throw new mo("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new mo('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new mo("JWS Protected Header incorrect type");if(void 0===e.payload)throw new mo("JWS Payload missing");if("string"!=typeof e.signature)throw new mo("JWS Signature missing or incorrect type");if(void 0!==e.header&&!To(e.header))throw new mo("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=no(e.protected);o=JSON.parse($n.decode(t))}catch(e){throw new mo("JWS Protected Header is invalid")}if(!function(){for(var e=arguments.length,t=new Array(e),n=0;n"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;i=void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of o.crit){if(!i.has(t))throw new ho('Extension Header Parameter "'.concat(t,'" is not recognized'));if(void 0===r[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(i.get(t)&&void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(o.crit)}(mo,new Map([["b64",!0]]),null==n?void 0:n.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,"boolean"!=typeof a))throw new mo('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if("string"!=typeof s||!s)throw new mo('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError('"'.concat("algorithms",'" option must be an array of strings'));if(t)return new Set(t)}(0,n.algorithms);if(c&&!c.has(s))throw new po('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new mo("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new mo("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t&&(t=await t(o,e),l=!0),function(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,n)=>{if(!(t instanceof Uint8Array)){if(Ro(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&Ho(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Eo(t))throw new TypeError(so(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(Bo(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(Ro(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&Ho(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv)(t)&&Ho(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Eo(t))throw new TypeError(so(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(Bo(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(Bo(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(Bo(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(Bo(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(Bo(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}(s,t,"verify");const u=function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{length:n}=t;return e+n},0),r=new Uint8Array(o);let i=0;for(const e of t)r.set(e,i),i+=e.length;return r}(void 0!==e.protected?eo(e.protected):new Uint8Array,eo("."),"string"==typeof e.payload?a?eo(e.payload):Qn.encode(e.payload):e.payload),d=_o(e.signature,"signature",mo),p=await async function(e,t){if(e instanceof Uint8Array)return e;if(vo(e))return e;if(So(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{ko||(ko=new WeakMap);let n=ko.get(e);if(null!=n&&n[t])return n[t];const o="public"===e.type,r=!!o;let i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError(Po)}i=e.toCryptoKey(e.asymmetricKeyType,r,o?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError(Po);i=e.toCryptoKey(e.asymmetricKeyType,r,[o?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError(Po);i=e.toCryptoKey(e.asymmetricKeyType,r,[o?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":n="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":n="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":n="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":n="SHA-512";break;default:throw new TypeError(Po)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},r,o?["encrypt"]:["decrypt"]);i=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},r,[o?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===(a=e.asymmetricKeyDetails)||void 0===a?void 0:a.namedCurve);if(!n)throw new TypeError(Po);const s={ES256:"P-256",ES384:"P-384",ES512:"P-521"};s[t]&&n===s[t]&&(i=e.toCryptoKey({name:"ECDSA",namedCurve:n},r,[o?"verify":"sign"])),t.startsWith("ECDH-ES")&&(i=e.toCryptoKey({name:"ECDH",namedCurve:n},r,o?[]:["deriveBits"]))}if(!i)throw new TypeError(Po);return n?n[t]=i:ko.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return No(e,n,t)}if(Ro(e))return e.k?no(e.k):No(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,o){const r=await Oo(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,r);const i=function(e,t){const n="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new ho("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch(e){return!1}}(s,p,d,u))throw new bo;let h;h=a?_o(e.payload,"payload",mo):"string"==typeof e.payload?Qn.encode(e.payload):e.payload;const m={payload:h};return void 0!==e.protected&&(m.protectedHeader=o),void 0!==e.header&&(m.unprotectedHeader=e.header),l?ct(ct({},m),{},{key:p}):m}const vr=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Sr(e){const t=vr.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let o;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(86400*n);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return"-"===t[1]||"ago"===t[4]?-o:o}const Er=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());function _r(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{n=JSON.parse($n.decode(t))}catch(e){}if(!To(n))throw new fo("JWT Claims Set must be a top-level JSON object");const{typ:r}=o;if(r&&("string"!=typeof e.typ||Er(e.typ)!==Er(r)))throw new lo('unexpected "typ" JWT header value',n,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=o,u=[...i];void 0!==l&&u.push("iat"),void 0!==c&&u.push("aud"),void 0!==s&&u.push("sub"),void 0!==a&&u.push("iss");for(const e of new Set(u.reverse()))if(!(e in n))throw new lo('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new lo('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new lo('unexpected "sub" claim value',n,"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(d=n.aud)?p.includes(d):Array.isArray(d)&&p.some(Set.prototype.has.bind(new Set(d))))))throw new lo('unexpected "aud" claim value',n,"aud","check_failed");var d,p;let h;switch(typeof o.clockTolerance){case"string":h=Sr(o.clockTolerance);break;case"number":h=o.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:m}=o,f=(g=m||new Date,Math.floor(g.getTime()/1e3));var g;if((void 0!==n.iat||l)&&"number"!=typeof n.iat)throw new lo('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new lo('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>f+h)throw new lo('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new lo('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=f-h)throw new uo('"exp" claim timestamp check failed',n,"exp","check_failed")}if(l){const e=f-n.iat;if(e-h>("number"==typeof l?l:Sr(l)))throw new uo('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-h)throw new lo('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}function Tr(e){return To(e)}var Rr,Or,Cr=new WeakMap,Ir=new WeakMap;class Pr{constructor(e){if(rt(this,Cr,void 0),rt(this,Ir,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Tr)}(e))throw new go("JSON Web Key Set malformed");it(Cr,this,structuredClone(e))}jwks(){return ot(Cr,this)}async getKey(e,t){const{alg:n,kid:o}=ct(ct({},e),null==t?void 0:t.header),r=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new ho('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=ot(Cr,this).keys.filter(e=>{let t=r===e.kty;if(t&&"string"==typeof o&&(t=o===e.kid),!t||"string"!=typeof e.alg&&"AKP"!==r||(t=n===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(n){case"ES256":t="P-256"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),{0:a,length:s}=i;if(0===s)throw new yo;if(1!==s){const e=new Ao,t=ot(Ir,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new ut(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield tt(kr(t,e,n))}catch(e){}}),e}return kr(ot(Ir,this),a,n)}}async function kr(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(void 0===o[n]){const e=await async function(e,t){if(!To(e))throw new TypeError("JWK must be an object");let n;switch(null!=t||(t=e.alg),null!=n||(n=e.ext),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return no(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new ho('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return Io(ct(ct({},e),{},{alg:t,ext:n}));case"AKP":if("string"!=typeof e.alg||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return Io(ct(ct({},e),{},{ext:n}));case"EC":case"OKP":return Io(ct(ct({},e),{},{alg:t,ext:n}));default:throw new ho('Unsupported "kty" (Key Type) Parameter value')}}(ct(ct({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new go("JSON Web Key Set members must be public keys");o[n]=e}return o[n]}function Nr(e){const t=new Pr(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let Lr;if("undefined"==typeof navigator||null===(Rr=navigator.userAgent)||void 0===Rr||null===(Or=Rr.startsWith)||void 0===Or||!Or.call(Rr,"Mozilla/5.0 ")){const e="v6.2.2";Lr="".concat("jose","/").concat(e)}const Dr=Symbol(),xr=Symbol();var Ur=new WeakMap,Mr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,jr=new WeakMap,Kr=new WeakMap,Fr=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Xr=new WeakMap;class zr{constructor(e,t){if(rt(this,Ur,void 0),rt(this,Mr,void 0),rt(this,Br,void 0),rt(this,Hr,void 0),rt(this,jr,void 0),rt(this,Kr,void 0),rt(this,Fr,void 0),rt(this,Wr,void 0),rt(this,Gr,void 0),rt(this,Xr,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,o;it(Ur,this,new URL(e.href)),it(Mr,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),it(Br,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),it(Hr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),it(Fr,this,new Headers(null==t?void 0:t.headers)),Lr&&!ot(Fr,this).has("User-Agent")&&ot(Fr,this).set("User-Agent",Lr),ot(Fr,this).has("accept")||(ot(Fr,this).set("accept","application/json"),ot(Fr,this).append("accept","application/jwk-set+json")),it(Wr,this,null==t?void 0:t[Dr]),void 0!==(null==t?void 0:t[xr])&&(it(Xr,this,null==t?void 0:t[xr]),n=null==t?void 0:t[xr],o=ot(Hr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=o)&&"jwks"in n&&To(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,To)&&(it(jr,this,ot(Xr,this).uat),it(Gr,this,Nr(ot(Xr,this).jwks))))}pendingFetch(){return!!ot(Kr,this)}coolingDown(){return"number"==typeof ot(jr,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const r=await o(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new wo;throw e});if(200!==r.status)throw new co("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await r.json()}catch(e){throw new co("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(ot(Ur,this).href,ot(Fr,this),AbortSignal.timeout(ot(Mr,this)),ot(Wr,this)).then(e=>{it(Gr,this,Nr(e)),ot(Xr,this)&&(ot(Xr,this).uat=Date.now(),ot(Xr,this).jwks=e),it(jr,this,Date.now()),it(Kr,this,void 0)}).catch(e=>{throw it(Kr,this,void 0),e})),await ot(Kr,this)}}const Jr=["mfaToken"],Vr=["mfaToken"];var Zr,Yr,qr,Qr,$r,ei,ti,ni,oi,ri,ii,ai,si,ci,li,ui,di=class extends Error{constructor(e,t){super(t),at(this,"code",void 0),this.name="NotSupportedError",this.code=e}},pi=class extends Error{constructor(e,t,n){super(t),at(this,"cause",void 0),at(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},hi=class extends pi{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},mi=class extends pi{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},fi=class extends pi{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},gi=class extends pi{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},yi=class extends pi{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Ai=class extends pi{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},wi=class extends Error{constructor(e){super(e),at(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},bi=class extends pi{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),at(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},vi=class extends pi{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Si=class extends pi{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Ei=class extends pi{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},_i=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),at(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Ti(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>ct(ct({},e),{},{[t[0]]:t[1]}),{})}var Ri=class extends Error{constructor(e,t,n){super(t),at(this,"cause",void 0),at(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Oi=class extends Ri{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Ci=class extends Ri{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},Ii=class extends Ri{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Pi=class extends Ri{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function ki(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Ni=(Zr=new WeakMap,Yr=new WeakMap,qr=new WeakMap,class{constructor(e){var t;rt(this,Zr,void 0),rt(this,Yr,void 0),rt(this,qr,void 0),it(Zr,this,"https://".concat(e.domain)),it(Yr,this,e.clientId),it(qr,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(ot(Zr,this),"/mfa/authenticators"),{mfaToken:n}=e,o=await ot(qr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new Oi(e.error_description||"Failed to list authenticators",e)}return(await o.json()).map(ki)}async enrollAuthenticator(e){const t="".concat(ot(Zr,this),"/mfa/associate"),{mfaToken:n}=e,o=lt(e,Jr),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await ot(qr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const e=await i.json();throw new Ci(e.error_description||"Failed to enroll authenticator",e)}return function(e){if("otp"===e.authenticator_type)return{authenticatorType:"otp",secret:e.secret,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes,id:e.id};if("oob"===e.authenticator_type)return{authenticatorType:"oob",oobChannel:e.oob_channel,oobCode:e.oob_code,bindingMethod:e.binding_method,id:e.id,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,o="".concat(ot(Zr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),r=await ot(qr,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const e=await r.json();throw new Ii(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(ot(Zr,this),"/mfa/challenge"),{mfaToken:n}=e,o=lt(e,Vr),r={mfa_token:n,client_id:ot(Yr,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await ot(qr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const e=await i.json();throw new Pi(e.error_description||"Failed to challenge authenticator",e)}return function(e){const t={challengeType:e.challenge_type};return void 0!==e.oob_code&&(t.oobCode=e.oob_code),void 0!==e.binding_method&&(t.bindingMethod=e.binding_method),t}(await i.json())}}),Li=class e{constructor(e,t,n,o,r,i,a){at(this,"accessToken",void 0),at(this,"idToken",void 0),at(this,"refreshToken",void 0),at(this,"expiresAt",void 0),at(this,"scope",void 0),at(this,"claims",void 0),at(this,"authorizationDetails",void 0),at(this,"tokenType",void 0),at(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=o,this.expiresAt=t,this.scope=r,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,o=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return o.tokenType=t.token_type,o.issuedTokenType=t.issued_token_type,o}},Di=(Qr=new WeakMap,$r=new WeakMap,ei=new WeakMap,class{constructor(e,t){rt(this,Qr,new Map),rt(this,$r,void 0),rt(this,ei,void 0),it(ei,this,Math.max(1,Math.floor(e))),it($r,this,Math.max(0,Math.floor(t)))}get(e){const t=ot(Qr,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return ot(Qr,this).delete(e),ot(Qr,this).set(e,t),t.value;ot(Qr,this).delete(e)}}set(e,t){for(ot(Qr,this).has(e)&&ot(Qr,this).delete(e),ot(Qr,this).set(e,{value:t,expiresAt:Date.now()+ot($r,this)});ot(Qr,this).size>ot(ei,this);){const e=ot(Qr,this).keys().next().value;if(void 0===e)break;ot(Qr,this).delete(e)}}}),xi=new Map;function Ui(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var Mi=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,o=e.ttlMs,"".concat(n,":").concat(o));var n,o;let r=(i=t,xi.get(i));var i;return r||(r=new Di(e.maxEntries,e.ttlMs),xi.set(t,r)),r}static createJwksCache(){return{}}},Bi="openid profile email offline_access",Hi=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function ji(e){if(null==e)throw new Ai("subject_token is required");if("string"!=typeof e)throw new Ai("subject_token must be a string");if(0===e.trim().length)throw new Ai("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Ai("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Ai("subject_token must not include the 'Bearer ' prefix")}function Ki(e,t){if(t)for(const[n,o]of Object.entries(t))if(!Hi.has(n))if(Array.isArray(o)){if(o.length>20)throw new Ai("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));o.forEach(t=>{e.append(n,t)})}else e.append(n,o)}var Fi="urn:ietf:params:oauth:token-type:access_token",Wi=(ti=new WeakMap,ni=new WeakMap,oi=new WeakMap,ri=new WeakMap,ii=new WeakMap,ai=new WeakMap,si=new WeakMap,ci=new WeakMap,li=new WeakMap,ui=new WeakSet,class{constructor(e){var t,n,o,r;if(function(e,t){nt(e,t),t.add(e)}(this,ui),rt(this,ti,void 0),rt(this,ni,void 0),rt(this,oi,void 0),rt(this,ri,void 0),rt(this,ii,void 0),rt(this,ai,void 0),rt(this,si,void 0),rt(this,ci,void 0),rt(this,li,void 0),at(this,"mfa",void 0),it(ri,this,e),e.useMtls&&!e.customFetch)throw new di("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");it(ii,this,function(e,t){if(!1===t.enabled)return e;const n={name:t.name,version:t.version},o=btoa(JSON.stringify(n));return async(t,n)=>{const r=t instanceof Request?new Headers(t.headers):new Headers;return null!=n&&n.headers&&new Headers(n.headers).forEach((e,t)=>{r.set(t,e)}),r.set("Auth0-Client",o),e(t,ct(ct({},n),{},{headers:r}))}}(null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)},!1===(null==(n=e.telemetry)?void 0:n.enabled)?n:{enabled:!0,name:null!==(o=null==n?void 0:n.name)&&void 0!==o?o:"@auth0/auth0-auth-js",version:null!==(r=null==n?void 0:n.version)&&void 0!==r?r:"1.6.0"}));const i=Ui(e.discoveryCache);it(si,this,Mi.createDiscoveryCache(i)),it(ci,this,new Map),it(li,this,Mi.createJwksCache()),this.mfa=new Ni({domain:ot(ri,this).domain,clientId:ot(ri,this).clientId,customFetch:ot(ii,this)})}async getServerMetadata(){const{serverMetadata:e}=await et(ui,this,zi).call(this);return e}async buildAuthorizationUrl(e){const{serverMetadata:t}=await et(ui,this,zi).call(this);if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new di("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await et(ui,this,Yi).call(this,e)}catch(e){throw new vi(e)}}async buildLinkUserUrl(e){try{const t=await et(ui,this,Yi).call(this,{authorizationParams:ct(ct({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new Si(e)}}async buildUnlinkUserUrl(e){try{const t=await et(ui,this,Yi).call(this,{authorizationParams:ct(ct({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new Ei(e)}}async backchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await et(ui,this,zi).call(this),o=Ti(ct(ct({},ot(ri,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(ct(ct({scope:Bi},o),{},{client_id:ot(ri,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const e=await sr(t,r),n=await cr(t,e);return Li.fromTokenEndpointResponse(n)}catch(e){throw new bi(e)}}async initiateBackchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await et(ui,this,zi).call(this),o=Ti(ct(ct({},ot(ri,this).authorizationParams),null==e?void 0:e.authorizationParams)),r=new URLSearchParams(ct(ct({scope:Bi},o),{},{client_id:ot(ri,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const e=await sr(t,r);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){throw new bi(e)}}async backchannelAuthenticationGrant(e){let{authReqId:t}=e;const{configuration:n}=await et(ui,this,zi).call(this),o=new URLSearchParams({auth_req_id:t});try{const e=await wr(n,"urn:openid:params:grant-type:ciba",o);return Li.fromTokenEndpointResponse(e)}catch(e){throw new bi(e)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new yi("Either a refresh or access token should be specified, but not both.");const n=null!==(t=e.accessToken)&&void 0!==t?t:e.refreshToken;if(!n)throw new yi("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?Fi:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(e){if(e instanceof Ai)throw new yi(e.message,e.cause);throw e}}async exchangeToken(e){return"connection"in e?et(ui,this,Ji).call(this,e):et(ui,this,Vi).call(this,e)}async getTokenByCode(e,t){const{configuration:n}=await et(ui,this,zi).call(this);try{const o=await ur(n,e,{pkceCodeVerifier:t.codeVerifier});return Li.fromTokenEndpointResponse(o)}catch(e){throw new hi("There was an error while trying to request a token.",e)}}async getTokenByRefreshToken(e){const{configuration:t}=await et(ui,this,zi).call(this),n=new URLSearchParams;e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope);try{const o=await dr(t,e.refreshToken,n);return Li.fromTokenEndpointResponse(o)}catch(e){throw new fi("The access token has expired and there was an error while trying to refresh it.",e)}}async getTokenByPassword(e){const{configuration:t}=await et(ui,this,zi).call(this),n=new URLSearchParams({username:e.username,password:e.password});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.realm&&n.append("realm",e.realm);let o=t;if(e.auth0ForwardedFor){const n=await et(ui,this,Zi).call(this);o=new or(t.serverMetadata(),ot(ri,this).clientId,ot(ri,this).clientSecret,n),o[Vo]=(t,n)=>ot(ii,this).call(this,t,ct(ct({},n),{},{headers:ct(ct({},n.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}try{const e=await wr(o,"password",n);return Li.fromTokenEndpointResponse(e)}catch(e){throw new gi("There was an error while trying to request a token.",e)}}async getTokenByClientCredentials(e){const{configuration:t}=await et(ui,this,zi).call(this);try{const n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);const o=await pr(t,n);return Li.fromTokenEndpointResponse(o)}catch(e){throw new mi("There was an error while trying to request a token.",e)}}async buildLogoutUrl(e){const{configuration:t,serverMetadata:n}=await et(ui,this,zi).call(this);if(!n.end_session_endpoint){const t=new URL("https://".concat(ot(ri,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",ot(ri,this).clientId),t}return function(e,t){fr(e);const{as:n,c:o,tlsOnly:r}=Go(e),i=Qt(n,"end_session_endpoint",!1,r);(t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id);for(const[e,n]of t.entries())i.searchParams.append(e,n);return i}(t,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const{serverMetadata:t}=await et(ui,this,zi).call(this),n=Ui(ot(ri,this).discoveryCache),o=t.jwks_uri;ot(ai,this)||it(ai,this,function(e,t){const n=new zr(e,t),o=async(e,t)=>n.getKey(e,t);return Object.defineProperties(o,{coolingDown:{get:()=>n.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>n.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>n.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>n.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>n.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}(new URL(o),{cacheMaxAge:n.ttlMs,[Dr]:ot(ii,this),[xr]:ot(li,this)}));const{payload:r}=await async function(e,t,n){var o;const r=await async function(e,t,n){if(e instanceof Uint8Array&&(e=$n.decode(e)),"string"!=typeof e)throw new mo("Compact JWS must be a string or Uint8Array");const{0:o,1:r,2:i,length:a}=e.split(".");if(3!==a)throw new mo("Invalid Compact JWS");const s=await br({payload:r,protected:o,signature:i},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?ct(ct({},c),{},{key:s.key}):c}(e,t,n);if(null!==(o=r.protectedHeader.crit)&&void 0!==o&&o.includes("b64")&&!1===r.protectedHeader.b64)throw new fo("JWTs MUST NOT use unencoded payload");const i={payload:_r(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return"function"==typeof t?ct(ct({},i),{},{key:r.key}):i}(e.logoutToken,ot(ai,this),{issuer:t.issuer,audience:ot(ri,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in r)&&!("sub"in r))throw new wi('either "sid" or "sub" (or both) claims must be present');if("sid"in r&&"string"!=typeof r.sid)throw new wi('"sid" claim must be a string');if("sub"in r&&"string"!=typeof r.sub)throw new wi('"sub" claim must be a string');if("nonce"in r)throw new wi('"nonce" claim is prohibited');if(!("events"in r))throw new wi('"events" claim is missing');if("object"!=typeof r.events||null===r.events)throw new wi('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in r.events))throw new wi('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof r.events["http://schemas.openid.net/event/backchannel-logout"])throw new wi('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:r.sid,sub:r.sub}}});function Gi(){const e=ot(ri,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(ot(ri,this).useMtls?"1":"0")}async function Xi(e){const t=await et(ui,this,Zi).call(this),n=new or(e,ot(ri,this).clientId,ot(ri,this).clientSecret,t);return n[Vo]=ot(ii,this),n}async function zi(){if(ot(ti,this)&&ot(ni,this))return{configuration:ot(ti,this),serverMetadata:ot(ni,this)};const e=et(ui,this,Gi).call(this),t=ot(si,this).get(e);if(t)return it(ni,this,t.serverMetadata),it(ti,this,await et(ui,this,Xi).call(this,t.serverMetadata)),{configuration:ot(ti,this),serverMetadata:ot(ni,this)};const n=ot(ci,this).get(e);if(n){const e=await n;return it(ni,this,e.serverMetadata),it(ti,this,await et(ui,this,Xi).call(this,e.serverMetadata)),{configuration:ot(ti,this),serverMetadata:ot(ni,this)}}const o=(async()=>{const t=await et(ui,this,Zi).call(this),n=await tr(new URL("https://".concat(ot(ri,this).domain)),ot(ri,this).clientId,{use_mtls_endpoint_aliases:ot(ri,this).useMtls},t,{[Vo]:ot(ii,this)}),o=n.serverMetadata();return ot(si,this).set(e,{serverMetadata:o}),{configuration:n,serverMetadata:o}})(),r=o.then(e=>{let{serverMetadata:t}=e;return{serverMetadata:t}});r.catch(()=>{}),ot(ci,this).set(e,r);try{const{configuration:e,serverMetadata:t}=await o;it(ti,this,e),it(ni,this,t),ot(ti,this)[Vo]=ot(ii,this)}finally{ot(ci,this).delete(e)}return{configuration:ot(ti,this),serverMetadata:ot(ni,this)}}async function Ji(e){var t,n;const{configuration:o}=await et(ui,this,zi).call(this);if("audience"in e||"resource"in e)throw new Ai("audience and resource parameters are not supported for Token Vault exchanges");ji(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==(t=e.subjectTokenType)&&void 0!==t?t:Fi,requested_token_type:null!==(n=e.requestedTokenType)&&void 0!==n?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),Ki(r,e.extra);try{const e=await wr(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return Li.fromTokenEndpointResponse(e)}catch(t){throw new Ai("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function Vi(e){const{configuration:t}=await et(ui,this,zi).call(this);ji(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),Ki(n,e.extra);try{const e=await wr(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Li.fromTokenEndpointResponse(e)}catch(t){throw new Ai("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function Zi(){return ot(oi,this)||it(oi,this,(async()=>{if(!ot(ri,this).clientSecret&&!ot(ri,this).clientAssertionSigningKey&&!ot(ri,this).useMtls)throw new _i;if(ot(ri,this).useMtls)return(e,t,n,o)=>{n.set("client_id",t.client_id)};let e=ot(ri,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await async function(e,t){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return Mo(e,t,void 0)}(e,ot(ri,this).clientAssertionSigningAlg||"RS256")),e?function(e){return Vt(e,void 0)}(e):Jo(ot(ri,this).clientSecret)})().catch(e=>{throw it(oi,this,void 0),e})),ot(oi,this)}async function Yi(e){const{configuration:t}=await et(ui,this,zi).call(this),n=jt(),o=await function(e){return async function(e){return Bt(e,"codeVerifier"),It(await crypto.subtle.digest("SHA-256",Rt(e)))}(e)}(n),r=Ti(ct(ct({},ot(ri,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(ct(ct({scope:Bi},r),{},{client_id:ot(ri,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await mr(t,i):await hr(t,i),codeVerifier:n}}class qi extends u{constructor(e,t){super(e,t),Object.setPrototypeOf(this,qi.prototype)}static fromPayload(e){let{error:t,error_description:n}=e;return new qi(t,n)}}class Qi extends qi{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Qi.prototype)}}class $i extends qi{constructor(e,t){super(e,t),Object.setPrototypeOf(this,$i.prototype)}}class ea extends qi{constructor(e,t){super(e,t),Object.setPrototypeOf(this,ea.prototype)}}class ta extends qi{constructor(e,t){super(e,t),Object.setPrototypeOf(this,ta.prototype)}}class na extends qi{constructor(e,t){super(e,t),Object.setPrototypeOf(this,na.prototype)}}class oa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,t){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({},t),{createdAt:Date.now()}))}get(e){const t=this.contexts.get(e);if(t){if(!(Date.now()-t.createdAt>this.ttlMs))return t;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const[t,n]of this.contexts)e-n.createdAt>this.ttlMs&&this.contexts.delete(t)}get size(){return this.contexts.size}}class ra{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new oa}setMFAAuthDetails(e,t,n,o){this.contextManager.set(e,{scope:t,audience:n,mfaRequirements:o})}async getAuthenticators(e){var t,n;const o=this.contextManager.get(e);if(!(null===(t=null==o?void 0:o.mfaRequirements)||void 0===t?void 0:t.challenge)||0===o.mfaRequirements.challenge.length)throw new Qi("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const r=o.mfaRequirements.challenge.map(e=>e.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:e})).filter(e=>!!e.type&&r.includes(e.type))}catch(e){if(e instanceof Oi)throw new Qi(null===(n=e.cause)||void 0===n?void 0:n.error,e.message);throw e}}async enroll(e){var t;const n=function(e){const t=Qe[e.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:e.mfaToken,authenticatorTypes:t.authenticatorTypes},t.oobChannels&&{oobChannels:t.oobChannels}),"phoneNumber"in e&&{phoneNumber:e.phoneNumber}),"email"in e&&{email:e.email})}(e);try{return await this.authJsMfaClient.enrollAuthenticator(n)}catch(e){if(e instanceof Ci)throw new $i(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async challenge(e){var t;try{const t={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(t.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(t)}catch(e){if(e instanceof Pi)throw new ea(null===(t=e.cause)||void 0===t?void 0:t.error,e.message);throw e}}async getEnrollmentFactors(e){const t=this.contextManager.get(e);if(!t||!t.mfaRequirements)throw new na("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return t.mfaRequirements.enroll&&0!==t.mfaRequirements.enroll.length?t.mfaRequirements.enroll:[]}async verify(e){const t=this.contextManager.get(e.mfaToken);if(!t)throw new ta("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const n=function(e){return"otp"in e&&e.otp?"http://auth0.com/oauth/grant-type/mfa-otp":"oobCode"in e&&e.oobCode?"http://auth0.com/oauth/grant-type/mfa-oob":"recoveryCode"in e&&e.recoveryCode?"http://auth0.com/oauth/grant-type/mfa-recovery-code":void 0}(e);if(!n)throw new ta("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const o=t.scope,r=t.audience;try{const t=await this.auth0Client._requestTokenForMfa({grant_type:n,mfaToken:e.mfaToken,scope:o,audience:r,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),t}catch(e){if(e instanceof y)this.setMFAAuthDetails(e.mfa_token,o,r,e.mfa_requirements);else if(e instanceof ta)throw new ta(e.error,e.error_description);throw e}}}class ia{constructor(e){let t,n;if(this.userCache=(new be).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},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(!S())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===S().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 ")})(),this.lockManager=(J||(J=function(){return"undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.locks)||void 0===e?void 0:e.request)?new X:new z;var e}()),J),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||a,!Fe(t))throw new Error('Invalid cache location "'.concat(t,'"'));n=Fe(t)()}var o;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:i,this.cookieStorage=!1===e.legacySameSiteCookie?ke:Le,this.orgHintCookieName=(o=this.options.clientId,"auth0.".concat(o,".organization_hint")),this.isAuthenticatedCookieName=(e=>"auth0.".concat(e,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:De;var s;this.scope=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r{const r=e[n];i[n]=me(t,r,...o)}),i}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Se(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||c,this.cacheManager=new ve(n,n.allKeys?void 0:new He(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Je(this.options.clientId):void 0,this.domainUrl=(s=this.options.domain,/^https?:\/\//.test(s)?s:"https://".concat(s)),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:"https://".concat(e,"/"):"".concat(t,"/"))(this.options.issuer,this.domainUrl);const u="".concat(this.domainUrl,"/me/"),d=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:u},detailedResponse:!0})}));this.myAccountApi=new Ye(d,u),this.authJsClient=new Wi({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new ra(this.authJsClient.mfa,this),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&t===a&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Me,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const t=this.options.auth0Client||s,n=R(t,!0),o=encodeURIComponent(btoa(JSON.stringify(n)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(o)}_authorizeUrl(e){return this._url("/authorize?".concat(O(e)))}async _verifyIdToken(e,t,n){const o=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,o,r]=t;if(3!==t.length||!n||!o||!r)throw new Error("ID token could not be decoded");const i=JSON.parse(I(o)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],_e.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:o,signature:r},header:JSON.parse(I(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 "'.concat(e.iss,'", found "').concat(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 "'.concat(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 "'.concat(e.aud,'" but was not one of "').concat(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 "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(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 "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Ee(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||!Ee(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ee(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,o=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(null!=t.claims.nbf&&Ee(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),or)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 (".concat(o,") is after last auth at ").concat(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 "'.concat(e,'", found "').concat(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 "'.concat(e,'", found "').concat(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:o});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})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t.toString()))}catch(e){}}_applySessionTransferToken(e){const t=this.options.sessionTransferTokenQueryParamName;if(!t||e.session_transfer_token)return e;const n=this._extractSessionTransferToken(t);return n?(this._clearSessionTransferTokenFromUrl(t),Object.assign(Object.assign({},e),{session_transfer_token:n})):e}async _prepareAuthorizeUrl(e,t,n){var o;const r=_(E()),i=_(E()),a=E(),s=await C(a),c=P(s),u=await(null===(o=this.dpop)||void 0===o?void 0:o.calculateThumbprint()),d=((e,t,n,o,r,i,a,s,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:fe(t,n.scope,n.audience),response_type:"code",response_mode:s||"query",state:o,nonce:r,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,r,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),p=this._authorizeUrl(d);return{nonce:i,code_verifier:a,scope:d.scope,audience:d.audience||l,redirect_uri:d.redirect_uri,state:r,url:p}}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=".concat(e,",top=").concat(t,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(),!t.popup))throw new g;const o=this._applySessionTransferToken(e.authorizationParams||{}),r=await this._prepareAuthorizeUrl(o,{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const i=await((e,t)=>new Promise((n,o)=>{let r;const i=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(i),clearTimeout(a),window.removeEventListener("message",r,!1),o(new f(e.popup)))},1e3),a=setTimeout(()=>{clearInterval(i),o(new m(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(s){if(s.origin===t&&s.data&&"authorization_response"===s.data.type){if(clearTimeout(a),clearInterval(i),window.removeEventListener("message",r,!1),!1!==e.closePopup&&e.popup.close(),s.data.response.error)return o(u.fromPayload(s.data.response));n(s.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(r.url).origin);if(r.state!==i.state)throw new u("state_mismatch","Invalid state");const a=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}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(){var e;const t=We(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{openUrl:n,fragment:r,appState:i}=t,a=o(t,["openUrl","fragment","appState"]),s=(null===(e=a.authorizationParams)||void 0===e?void 0:e.organization)||this.options.authorizationParams.organization,c=this._applySessionTransferToken(a.authorizationParams||{}),l=await this._prepareAuthorizeUrl(c),{url:u}=l,d=o(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:i,response_type:xe.Code}),s&&{organization:s}));const p=r?"".concat(u,"#").concat(r):u;n?await n(p):window.location.assign(p)}async handleRedirectCallback(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href).split("?").slice(1);if(0===e.length)throw new Error("There are no query params available for parsing.");const t=this.transactionManager.get();if(!t)throw new u("missing_transaction","Invalid state");this.transactionManager.remove();const n=(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,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(e.join(""));return t.response_type===xe.ConnectCode?this._handleConnectAccountRedirectCallback(n,t):this._handleLoginRedirectCallback(n,t)}async _handleLoginRedirectCallback(e,t){const{code:n,state:o,error:r,error_description:i}=e;if(r)throw new d(r,i||r,o,t.appState);if(!t.code_verifier||t.state&&t.state!==o)throw new u("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:xe.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:o,error:r,error_description:i}=e;if(r)throw new p(r,i||r,t.connection,o,t.appState);if(!n)throw new u("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===o))throw new u("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:xe.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(je))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(je)}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,n;const o=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:fe(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),r=await((e,t)=>{let n=Be[t];return n||(n=e().finally(()=>{delete Be[t],n=null}),Be[t]=n),n})(()=>this._getTokenSilently(o),"".concat(this.options.clientId,"::").concat(o.authorizationParams.audience,"::").concat(o.authorizationParams.scope));return e.detailedResponse?r:null==r?void 0:r.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=o(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||l,clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=(i=this.options.clientId,a=n.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;try{return await this.lockManager.runWithLock(r,5e3,async()=>{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||l,clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:o,token_type:r,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:o,token_type:r,access_token:i},a?{scope:a}:null),{expires_in:s})})}catch(e){if(this._isInteractiveError(e)&&"popup"===this.options.interactiveErrorHandler)return await this._handleInteractiveErrorWithPopup(n);throw e}}_isInteractiveError(e){return e instanceof y||e instanceof u&&this._isIframeMfaError(e)}_isIframeMfaError(e){return"login_required"===e.error&&"Multifactor authentication required"===e.error_description}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const t=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||l,clientId:this.options.clientId});if(!t)throw new u("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return t}catch(e){throw e}}async getTokenWithPopup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,o;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:fe(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(o=e.authorizationParams)||void 0===o?void 0:o.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},r),t),await this.loginWithPopup(i,t),(await this.cacheManager.get(new Ae({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||l,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=o(t,["federated"]),i=n?"&federated":"";return this._url("/v2/logout?".concat(O(Object.assign({clientId:e.clientId},r))))+i}async revokeRefreshToken(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.options.useRefreshTokens)return;const t=e.audience||this.options.authorizationParams.audience||l,n=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let{baseUrl:n,timeout:o,auth0Client:r,useFormData:a,refreshTokens:c,audience:d,client_id:p,onRefreshTokenRevoked:h}=e;const m=o||i,f="refresh_token",g="".concat(n,"/oauth/revoke"),y={"Content-Type":a?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(R(r||s)))};if(t){const n={client_id:p,token_type_hint:f},o=a?O(n):JSON.stringify(n);try{return await le({type:"revoke",timeout:m,fetchUrl:g,fetchOptions:{method:"POST",body:o,headers:y},useFormData:a,auth:{audience:null!=d?d:l}},t)}catch(e){throw new u("revoke_error",e.message)}}for(const t of c){const n={client_id:p,token_type_hint:f,token:t},o=a?O(n):JSON.stringify(n),r=await ue(g,{method:"POST",body:o,headers:y},m);if(!r.ok){let t,n;try{({error:t,error_description:n}=JSON.parse(await r.text()))}catch(e){}throw new u(t||"revoke_error",n||"HTTP error ".concat(r.status))}await(null==h?void 0:h(t))}}({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:n,audience:t,onRefreshTokenRevoked:e=>this.cacheManager.stripRefreshToken(e)},this.worker)}async logout(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;const n=We(e),{openUrl:r}=n,i=o(n,["openUrl"]);if(null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.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(ye),await(null===(t=this.dpop)||void 0===t?void 0:t.clear()),this.worker)try{await le({type:"clear"},this.worker)}catch(e){}const a=this._buildLogoutUrl(i);r?await r(a):!1!==r&&window.location.assign(a)}async _getTokenFromIFrame(e){const t=(n=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(n));var n;try{return await this.lockManager.runWithLock(t,5e3,async()=>{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:o,state:r,nonce:i,code_verifier:a,redirect_uri:s,scope:c,audience:l}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new u("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let p;try{p=new URL(this.domainUrl).origin}catch(e){p=this.domainUrl}const m=await function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;return new Promise((o,r)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),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(u.fromPayload(e.data.response)):o(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)})}(o,p,d);if(r!==m.state)throw new u("state_mismatch","Invalid state");const f=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:m.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},f),{scope:c,oauthTokenScope:f.scope,audience:l})})}catch(e){throw"login_required"===e.error&&(e instanceof u&&this._isIframeMfaError(e)&&"popup"===this.options.interactiveErrorHandler||this.logout({openUrl:!1})),e}}async _getTokenUsingRefreshToken(e){var t,n;const o=await this.cacheManager.get(new Ae({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||l,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(o&&o.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new A(e.authorizationParams.audience||l,e.authorizationParams.scope)}const r=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,i="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,a=((e,t,n,o)=>{var r;if(e&&n&&o){if(t.audience!==n)return t.scope;const e=o.split(" "),i=(null===(r=t.scope)||void 0===r?void 0:r.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?o:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==o?void 0:o.audience,null==o?void 0:o.scope);try{const t=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:o&&o.refresh_token,redirect_uri:r}),i&&{timeout:i}),{scopesToRequest:a});if(t.refresh_token&&(null==o?void 0:o.refresh_token)&&await this.cacheManager.updateEntry(o.refresh_token,t.refresh_token),this.options.useMrrt&&!(s=null==o?void 0:o.audience,c=null==o?void 0:o.scope,u=e.authorizationParams.audience,d=e.authorizationParams.scope,s===u&&Ge(d,c)||Ge(a,t.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const n=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],o=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==o.indexOf(e)).join(",")})(a,t.scope);throw new w(e.authorizationParams.audience||"default",n)}return Object.assign(Object.assign({},t),{scope:e.authorizationParams.scope,oauthTokenScope:t.scope,audience:e.authorizationParams.audience||l})}catch(o){if(o.message){if(o.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),o;if((o.message.includes("Missing Refresh Token")||o.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw o instanceof y&&this.mfa.setMFAAuthDetails(o.mfa_token,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.audience,o.mfa_requirements),o}var s,c,u,d}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=o(e,["id_token","decodedToken"]);this.userCache.set(ye,{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||l,t=this.scope[e],n=await this.cacheManager.getIdToken(new Ae({clientId:this.options.clientId,audience:e,scope:t})),o=this.userCache.get(ye);return n&&n.id_token===(null==o?void 0:o.id_token)?o:(this.userCache.set(ye,n),n)}async _getEntryFromCache(e){let{scope:t,audience:n,clientId:o,cacheMode:r}=e;const i=await this.cacheManager.get(new Ae({scope:t,audience:n,clientId:o}),60,this.options.useMrrt,r);if(i&&i.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:o}=i,r=await this._getIdTokenFromCache();return r&&Object.assign(Object.assign({id_token:r.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:o})}}async _requestToken(e,t){var n,o;const{nonceIn:r,organization:i,scopesToRequest:a}=t||{},s=await he(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:a||e.scope}),this.worker),c=await this._verifyIdToken(s.id_token,r,i);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(o=null===(n=null==e?void 0:e.decodedToken)||void 0===n?void 0:n.claims)||void 0===o?void 0:o.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(ye))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:c,scope:e.scope,audience:e.audience||l}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(i||c.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:c})}async loginWithCustomTokenExchange(e){return this._requestToken(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:fe(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization}))}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ze(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:o,scopes:r,authorization_params:i,redirectUri:a=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!o)throw new Error("connection is required");const s=_(E()),c=E(),l=await C(c),u=P(l),{connect_uri:d,connect_params:p,auth_session:h}=await this.myAccountApi.connectAccount({connection:o,scopes:r,redirect_uri:a,state:s,code_challenge:u,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:h,redirect_uri:a,appState:n,connection:o,response_type:xe.ConnectCode});const m=new URL(d);m.searchParams.set("ticket",p.ticket),t?await t(m.toString()):window.location.assign(m)}async _requestTokenForMfa(e,t){const{mfaToken:n}=e,r=o(e,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:n}),t)}}},7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],o=t[1];return 3*(n+o)/4-o},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],l=new r(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),u=0,d=c>0?a-4:a;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===c&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,l[u++]=255&t);1===c&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,o=e.length,r=o%3,i=[],a=16383,s=0,c=o-r;sc?c:s+a));1===r?(t=e[o-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[o-2]<<8)+e[o-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],o=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],o[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function l(e,t,n){for(var o,r=[],i=t;ia)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|f(e,t);let o=s(n);const r=o.write(e,t);r!==n&&(o=o.slice(0,r));return o}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return c.from(o,t,n);const r=function(e){if(c.isBuffer(e)){const t=0|m(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),s(e<0?0:0|m(e))}function p(e){const t=e.length<0?0:0|m(e.length),n=s(t);for(let o=0;o=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return o?-1:z(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){let o=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function y(e,t,n){const o=e[t];e[t]=e[n],e[n]=o}function A(e,t,n,o,r){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,o)),c.isBuffer(t))return 0===t.length?-1:w(e,t,n,o,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,o,r){let i,a=1,s=e.length,c=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){let o=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let o=0;or&&(o=r):o=r;const i=t.length;let a;for(o>i/2&&(o=i/2),a=0;a>8,r=n%256,i.push(r),i.push(o);return i}(t,e.length-n),e,n,o)}function T(e,t,n){return 0===t&&n===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);const o=[];let r=t;for(;r239?4:t>223?3:t>191?2:1;if(r+a<=n){let n,o,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[r+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[r+1],o=e[r+2],128==(192&n)&&128==(192&o)&&(c=(15&t)<<12|(63&n)<<6|63&o,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[r+1],o=e[r+2],s=e[r+3],128==(192&n)&&128==(192&o)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&o)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,o.push(i>>>10&1023|55296),i=56320|1023&i),o.push(i),r+=a}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let n="",o=0;for(;oo.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(o,r)):Uint8Array.prototype.set.call(o,t,r);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(o,r)}r+=t.length}return o},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,o,r){if(Z(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),t<0||n>e.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&t>=n)return 0;if(o>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(r>>>=0)-(o>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(o,r),u=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let i=!1;for(;;)switch(o){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function C(e,t,n){let o="";n=Math.min(e.length,n);for(let r=t;ro)&&(n=o);let r="";for(let o=t;on)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,o,r,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function D(e,t,n,o,r){F(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function x(e,t,n,o,r){F(t,o,r,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function U(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,o,i){return t=+t,n>>>=0,i||U(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function B(e,t,n,o,i){return t=+t,n>>>=0,i||U(e,0,n,8),r.write(e,t,n,o,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||N(e,t,this.length);let o=this[e],r=1,i=0;for(;++i>>=0,t>>>=0,n||N(e,t,this.length);let o=this[e+--t],r=1;for(;t>0&&(r*=256);)o+=this[e+--t]*r;return o},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q(function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const o=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(o)+(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const o=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(o)<>>=0,t>>>=0,n||N(e,t,this.length);let o=this[e],r=1,i=0;for(;++i=r&&(o-=Math.pow(2,8*t)),o},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);let o=t,r=1,i=this[e+--o];for(;o>0&&(r*=256);)i+=this[e+--o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q(function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const o=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||G(e,this.length-8);const o=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(o)<>>=0,t||N(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,o){if(e=+e,t>>>=0,n>>>=0,!o){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!o){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=n-1,i=1;for(this[t+r]=255&e;--r>=0&&(i*=256);)this[t+r]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,o){if(e=+e,t>>>=0,!o){const o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}let r=0,i=1,a=0;for(this[t]=255&e;++r>>=0,!o){const o=Math.pow(2,8*n-1);L(this,e,t,n,o-1,-o)}let r=n-1,i=1,a=0;for(this[t+r]=255&e;--r>=0&&(i*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Q(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,o){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r=o+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function F(e,t,n,o,r,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${o} and < 2${o} ** ${8*(i+1)}${o}`:`>= -(2${o} ** ${8*(i+1)-1}${o}) and < 2 ** ${8*(i+1)-1}${o}`:`>= ${t}${o} and <= ${n}${o}`,new H.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||G(t,e.length-(n+1))}(o,r,i)}function W(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,n){if(Math.floor(e)!==e)throw W(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j("ERR_OUT_OF_RANGE",function(e,t,n){let o=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=K(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=K(r)),r+="n"),o+=` It must be ${t}. Received ${r}`,o},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const o=e.length;let r=null;const i=[];for(let a=0;a55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,o){let r;for(r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const q=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const o=16*n;for(let r=0;r<16;++r)t[o+r]=e[n]+e[r]}return t}();function Q(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},251(e,t){t.read=function(e,t,n,o,r){var i,a,s=8*r-o-1,c=(1<>1,u=-7,d=n?r-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=o;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,o),i-=l}return(h?-1:1)*a*Math.pow(2,i-o)},t.write=function(e,t,n,o,r,i){var a,s,c,l=8*i-r-1,u=(1<>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=o?0:i-1,m=o?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*c-1)*Math.pow(2,r),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,r),a=0));r>=8;e[n+h]=255&s,h+=m,s/=256,r-=8);for(a=a<0;e[n+h]=255&a,h+=m,a/=256,l-=8);e[n+h-m]|=128*f}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},6993(e,t,n){var o=n(5546);function r(){var t,n,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function c(e,r,i,a){var s=r&&r.prototype instanceof u?r:u,c=Object.create(s.prototype);return o(c,"_invoke",function(e,o,r){var i,a,s,c=0,u=r||[],d=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,p.n=n,l}};function h(e,o){for(a=e,s=o,n=0;!d&&c&&!r&&n3?(r=m===o)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((r=e<2&&ho||o>m)&&(i[4]=e,i[5]=o,p.n=m,a=0))}if(r||e>1)return l;throw d=!0,o}return function(r,u,m){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,m),a=u,s=m;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(r="next"),n=i[r]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),a=1);i=t}else if((n=(d=p.n<0)?s:e.call(o,p))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:n,done:d}}}(e,i,a),!0),c}var l={};function u(){}function d(){}function p(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(o(n={},a,function(){return this}),n),m=p.prototype=u.prototype=Object.create(h);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,o(e,s,"GeneratorFunction")),e.prototype=Object.create(m),e}return d.prototype=p,o(m,"constructor",p),o(p,"constructor",d),d.displayName="GeneratorFunction",o(p,s,"GeneratorFunction"),o(m),o(m,s,"Generator"),o(m,a,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(e.exports=r=function(){return{w:c,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,n){var o=n(887);e.exports=function(e,t,n,r,i){var a=o(e,t,n,r,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},887(e,t,n){var o=n(6993),r=n(1791);e.exports=function(e,t,n,i,a){return new r(o().w(e,t,n,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,n){var o=n(5172),r=n(5546);e.exports=function e(t,n){function i(e,r,a,s){try{var c=t[e](r),l=c.value;return l instanceof o?n.resolve(l.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):n.resolve(l).then(function(e){c.value=e,a(c)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(r(e.prototype),r(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),r(this,"_invoke",function(e,t,o){function r(){return new n(function(t,n){i(e,o,t,n)})}return a=a?a.then(r,r):r()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(n,o,r,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,o,r){function i(n,o){t(e,n,function(e){return this._invoke(n,o,e)})}n?a?a(e,n,{value:o,enumerable:!r,configurable:!r,writable:!r}):e[n]=o:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,o,r,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var o in t)n.unshift(o);return function e(){for(;n.length;)if((o=n.pop())in t)return e.value=o,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,n){var o=n(5172),r=n(6993),i=n(5869),a=n(887),s=n(1791),c=n(4373),l=n(579);function u(){"use strict";var t=r(),n=t.m(u),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function m(e){var t,n;return function(o){t||(t={stop:function(){return n(o.a,2)},catch:function(){return o.v},abrupt:function(e,t){return n(o.a,h[e],t)},delegateYield:function(e,r,i){return t.resultName=r,n(o.d,l(e),i)},finish:function(e){return n(o.f,e)}},n=function(e,n,r){o.p=t.prev,o.n=t.next;try{return e(n,r)}finally{t.next=o.n}}),t.resultName&&(t[t.resultName]=o.v,t.resultName=void 0),t.sent=o.v,t.next=o.n;try{return e.call(this,t)}finally{o.p=t.prev,o.n=t.next}}}return(e.exports=u=function(){return{wrap:function(e,n,o,r){return t.w(m(e),n,o,r&&r.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new o(e,t)},AsyncIterator:s,async:function(e,t,n,o,r){return(p(t)?a:i)(m(e),t,n,o,r)},keys:c,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},579(e,t,n){var o=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(o(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,n){var o=n(4633)();e.exports=o;try{regeneratorRuntime=o}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},3145(e,t,n){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);no})},6369(e,t,n){"use strict";function o(e){if(Array.isArray(e))return e}n.d(t,{A:()=>o})},467(e,t,n){"use strict";function o(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}function r(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)})}}n.d(t,{A:()=>r})},3029(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>o})},2901(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(9922);function r(e,t){for(var n=0;nr});var o=n(9922);function r(e,t,n){return(t=(0,o.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},6986(e,t,n){"use strict";function o(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}n.d(t,{A:()=>o})},6562(e,t,n){"use strict";function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{A:()=>o})},3453(e,t,n){"use strict";n.d(t,{A:()=>s});var o=n(6369),r=n(6986),i=n(7800),a=n(6562);function s(e,t){return(0,o.A)(e)||(0,r.A)(e,t)||(0,i.A)(e,t)||(0,a.A)()}},2327(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(2284);function r(e,t){if("object"!=(0,o.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=(0,o.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},9922(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(2284),r=n(2327);function i(e){var t=(0,r.A)(e,"string");return"symbol"==(0,o.A)(t)?t:t+""}},2284(e,t,n){"use strict";function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}n.d(t,{A:()=>o})},7800(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(3145);function r(e,t){if(e){if("string"==typeof e)return(0,o.A)(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,o.A)(e,t):void 0}}},6263(e,t,n){"use strict";n.d(t,{A:()=>d});var o=n(7275),r=n(3119),i=n(7013),a=n(7960),s=n(4062);const c={http:r.A,xhr:i.A,fetch:{get:a.J}};o.A.forEach(c,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const l=e=>`- ${e}`,u=e=>o.A.isFunction(e)||null===e||!1===e;const d={getAdapter:function(e,t){e=o.A.isArray(e)?e:[e];const{length:n}=e;let r,i;const a={};for(let l=0;l`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(l).join("\n"):" "+l(e[0]):"as no adapter specified";throw new s.A("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:c}},7960(e,t,n){"use strict";n.d(t,{J:()=>A});var o=n(3820),r=n(7275),i=n(4062),a=n(2723),s=n(4172),c=n(7110),l=n(7837),u=n(8382),d=n(3853),p=n(1526),h=n(9888);const{isFunction:m}=r.A,f=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},g=e=>{const t=r.A.global??globalThis,{ReadableStream:n,TextEncoder:g}=t;e=r.A.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:y,Request:A,Response:w}=e,b=y?m(y):"function"==typeof fetch,v=m(A),S=m(w);if(!b)return!1;const E=b&&m(n),_=b&&("function"==typeof g?(T=new g,e=>T.encode(e)):async e=>new Uint8Array(await new A(e).arrayBuffer()));var T;const R=v&&E&&f(()=>{let e=!1;const t=new A(o.A.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),O=S&&E&&f(()=>r.A.isReadableStream(new w("").body)),C={stream:O&&(e=>e.body)};b&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!C[e]&&(C[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new i.A(`Response type '${e}' is not supported`,i.A.ERR_NOT_SUPPORT,n)})});const I=async(e,t)=>{const n=r.A.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(r.A.isBlob(e))return e.size;if(r.A.isSpecCompliantForm(e)){const t=new A(o.A.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return r.A.isArrayBufferView(e)||r.A.isArrayBuffer(e)?e.byteLength:(r.A.isURLSearchParams(e)&&(e+=""),r.A.isString(e)?(await _(e)).byteLength:void 0)})(t)};return async e=>{let{url:t,method:n,data:o,signal:m,cancelToken:f,timeout:b,onDownloadProgress:S,onUploadProgress:E,responseType:_,headers:T,withCredentials:P="same-origin",fetchOptions:k,maxContentLength:N,maxBodyLength:L}=(0,u.A)(e);const D=r.A.isNumber(N)&&N>-1,x=r.A.isNumber(L)&&L>-1;let U=y||fetch;_=_?(_+"").toLowerCase():"text";let M=(0,a.A)([m,f&&f.toAbortSignal()],b),B=null;const H=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let j;try{if(D&&"string"==typeof t&&t.startsWith("data:")){if((0,p.A)(t)>N)throw new i.A("maxContentLength size of "+N+" exceeded",i.A.ERR_BAD_RESPONSE,e,B)}if(x&&"get"!==n&&"head"!==n){const t=await I(T,o);if("number"==typeof t&&isFinite(t)&&t>L)throw new i.A("Request body larger than maxBodyLength limit",i.A.ERR_BAD_REQUEST,e,B)}if(E&&R&&"get"!==n&&"head"!==n&&0!==(j=await I(T,o))){let e,n=new A(t,{method:"POST",body:o,duplex:"half"});if(r.A.isFormData(o)&&(e=n.headers.get("content-type"))&&T.setContentType(e),n.body){const[e,t]=(0,l.Vj)(j,(0,l.C1)((0,l.mM)(E)));o=(0,s.E9)(n.body,65536,e,t)}}r.A.isString(P)||(P=P?"include":"omit");const a=v&&"credentials"in A.prototype;if(r.A.isFormData(o)){const e=T.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&T.delete("content-type")}T.set("User-Agent","axios/"+h.x,!1);const u={...k,signal:M,method:n.toUpperCase(),headers:T.normalize().toJSON(),body:o,duplex:"half",credentials:a?P:void 0};B=v&&new A(t,u);let m=await(v?U(B,k):U(t,u));if(D){const t=r.A.toFiniteNumber(m.headers.get("content-length"));if(null!=t&&t>N)throw new i.A("maxContentLength size of "+N+" exceeded",i.A.ERR_BAD_RESPONSE,e,B)}const f=O&&("stream"===_||"response"===_);if(O&&m.body&&(S||D||f&&H)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=m[e]});const n=r.A.toFiniteNumber(m.headers.get("content-length")),[o,a]=S&&(0,l.Vj)(n,(0,l.C1)((0,l.mM)(S),!0))||[];let c=0;const u=t=>{if(D&&(c=t,c>N))throw new i.A("maxContentLength size of "+N+" exceeded",i.A.ERR_BAD_RESPONSE,e,B);o&&o(t)};m=new w((0,s.E9)(m.body,65536,u,()=>{a&&a(),H&&H()}),t)}_=_||"text";let y=await C[r.A.findKey(C,_)||"text"](m,e);if(D&&!O&&!f){let t;if(null!=y&&("number"==typeof y.byteLength?t=y.byteLength:"number"==typeof y.size?t=y.size:"string"==typeof y&&(t="function"==typeof g?(new g).encode(y).byteLength:y.length)),"number"==typeof t&&t>N)throw new i.A("maxContentLength size of "+N+" exceeded",i.A.ERR_BAD_RESPONSE,e,B)}return!f&&H&&H(),await new Promise((t,n)=>{(0,d.A)(t,n,{data:y,headers:c.A.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:B})})}catch(t){if(H&&H(),M&&M.aborted&&M.reason instanceof i.A){const n=M.reason;throw n.config=e,B&&(n.request=B),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new i.A("Network Error",i.A.ERR_NETWORK,e,B,t&&t.response),{cause:t.cause||t});throw i.A.from(t,t&&t.code,e,B,t&&t.response)}}},y=new Map,A=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:r}=t,i=[o,r,n];let a,s,c=i.length,l=y;for(;c--;)a=i[c],s=l.get(a),void 0===s&&l.set(a,s=c?new Map:g(t)),l=s;return s};A()},7013(e,t,n){"use strict";n.d(t,{A:()=>h});var o=n(7275),r=n(3853),i=n(807),a=n(4062),s=n(8458),c=n(5579),l=n(3820),u=n(7110),d=n(7837),p=n(8382);const h="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const h=(0,p.A)(e);let m=h.data;const f=u.A.from(h.headers).normalize();let g,y,A,w,b,{responseType:v,onUploadProgress:S,onDownloadProgress:E}=h;function _(){w&&w(),b&&b(),h.cancelToken&&h.cancelToken.unsubscribe(g),h.signal&&h.signal.removeEventListener("abort",g)}let T=new XMLHttpRequest;function R(){if(!T)return;const o=u.A.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),i={data:v&&"text"!==v&&"json"!==v?T.response:T.responseText,status:T.status,statusText:T.statusText,headers:o,config:e,request:T};(0,r.A)(function(e){t(e),_()},function(e){n(e),_()},i),T=null}T.open(h.method.toUpperCase(),h.url,!0),T.timeout=h.timeout,"onloadend"in T?T.onloadend=R:T.onreadystatechange=function(){T&&4===T.readyState&&(0!==T.status||T.responseURL&&T.responseURL.startsWith("file:"))&&setTimeout(R)},T.onabort=function(){T&&(n(new a.A("Request aborted",a.A.ECONNABORTED,e,T)),_(),T=null)},T.onerror=function(t){const o=t&&t.message?t.message:"Network Error",r=new a.A(o,a.A.ERR_NETWORK,e,T);r.event=t||null,n(r),_(),T=null},T.ontimeout=function(){let t=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded";const o=h.transitional||i.A;h.timeoutErrorMessage&&(t=h.timeoutErrorMessage),n(new a.A(t,o.clarifyTimeoutError?a.A.ETIMEDOUT:a.A.ECONNABORTED,e,T)),_(),T=null},void 0===m&&f.setContentType(null),"setRequestHeader"in T&&o.A.forEach(f.toJSON(),function(e,t){T.setRequestHeader(t,e)}),o.A.isUndefined(h.withCredentials)||(T.withCredentials=!!h.withCredentials),v&&"json"!==v&&(T.responseType=h.responseType),E&&([A,b]=(0,d.C1)(E,!0),T.addEventListener("progress",A)),S&&T.upload&&([y,w]=(0,d.C1)(S),T.upload.addEventListener("progress",y),T.upload.addEventListener("loadend",w)),(h.cancelToken||h.signal)&&(g=t=>{T&&(n(!t||t.type?new s.A(null,e,T):t),T.abort(),_(),T=null)},h.cancelToken&&h.cancelToken.subscribe(g),h.signal&&(h.signal.aborted?g():h.signal.addEventListener("abort",g)));const O=(0,c.A)(h.url);!O||l.A.protocols.includes(O)?T.send(m||null):n(new a.A("Unsupported protocol "+O+":",a.A.ERR_BAD_REQUEST,e))})}},7536(e,t,n){"use strict";n.d(t,{A:()=>v});var o=n(7275),r=n(2125),i=n(5978),a=n(4662),s=n(6013),c=n(7887),l=n(8458),u=n(4874),d=n(9575),p=n(9888),h=n(665),m=n(4062),f=n(605),g=n(8562),y=n(7110),A=n(6263),w=n(7693);const b=function e(t){const n=new i.A(t),s=(0,r.A)(i.A.prototype.request,n);return o.A.extend(s,i.A.prototype,n,{allOwnKeys:!0}),o.A.extend(s,n,null,{allOwnKeys:!0}),s.create=function(n){return e((0,a.A)(t,n))},s}(s.A);b.Axios=i.A,b.CanceledError=l.A,b.CancelToken=u.A,b.isCancel=d.A,b.VERSION=p.x,b.toFormData=h.A,b.AxiosError=m.A,b.Cancel=b.CanceledError,b.all=function(e){return Promise.all(e)},b.spread=f.A,b.isAxiosError=g.A,b.mergeConfig=a.A,b.AxiosHeaders=y.A,b.formToJSON=e=>(0,c.A)(o.A.isHTMLForm(e)?new FormData(e):e),b.getAdapter=A.A.getAdapter,b.HttpStatusCode=w.A,b.default=b;const v=b},4874(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(8458);class r{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,r,i){n.reason||(n.reason=new o.A(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new r(function(t){e=t}),cancel:e}}}const i=r},8458(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(4062);class r extends o.A{constructor(e,t,n){super(e??"canceled",o.A.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}}const i=r},9575(e,t,n){"use strict";function o(e){return!(!e||!e.__CANCEL__)}n.d(t,{A:()=>o})},5978(e,t,n){"use strict";n.d(t,{A:()=>m});var o=n(7275),r=n(3967),i=n(7352),a=n(8683),s=n(4662),c=n(8262),l=n(3390),u=n(7110),d=n(807);const p=l.A.validators;class h{constructor(e){this.defaults=e||{},this.interceptors={request:new i.A,response:new i.A}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),r=-1===o?"":n.slice(o+1);String(e.stack).endsWith(r)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=(0,s.A)(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&l.A.assertOptions(n,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean),legacyInterceptorReqResOrdering:p.transitional(p.boolean)},!1),null!=r&&(o.A.isFunction(r)?t.paramsSerializer={serialize:r}:l.A.assertOptions(r,{encode:p.function,serialize:p.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),l.A.assertOptions(t,{baseUrl:p.spelling("baseURL"),withXsrfToken:p.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let c=i&&o.A.merge(i.common,i[t.method]);i&&o.A.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete i[e]}),t.headers=u.A.concat(c,i);const h=[];let m=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;m=m&&e.synchronous;const n=t.transitional||d.A;n&&n.legacyInterceptorReqResOrdering?h.unshift(e.fulfilled,e.rejected):h.push(e.fulfilled,e.rejected)});const f=[];let g;this.interceptors.response.forEach(function(e){f.push(e.fulfilled,e.rejected)});let y,A=0;if(!m){const e=[a.A.bind(this),void 0];for(e.unshift(...h),e.push(...f),y=e.length,g=Promise.resolve(t);As});var o=n(7275),r=n(7110);function i(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),i=[],a=e=>{if(null===e||"object"!=typeof e)return e;if(o.A.isBuffer(e))return e;if(-1!==i.indexOf(e))return;let t;if(e instanceof r.A&&(e=e.toJSON()),i.push(e),o.A.isArray(e))t=[],e.forEach((e,n)=>{const r=a(e);o.A.isUndefined(r)||(t[n]=r)});else{if(!o.A.isPlainObject(e)&&function(e){if(o.A.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(o.A.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return i.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":a(i);o.A.isUndefined(e)||(t[r]=e)}}return i.pop(),t};return a(e)}class a extends Error{static from(e,t,n,o,r,i){const s=new a(e.message,t||e.code,n,o,r);return s.cause=e,s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),i&&Object.assign(s,i),s}constructor(e,t,n,o,r){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r,this.status=r.status)}toJSON(){const e=this.config,t=e&&o.A.hasOwnProp(e,"redact")?e.redact:void 0,n=o.A.isArray(t)&&t.length>0?i(e,t):o.A.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}a.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",a.ERR_BAD_OPTION="ERR_BAD_OPTION",a.ECONNABORTED="ECONNABORTED",a.ETIMEDOUT="ETIMEDOUT",a.ECONNREFUSED="ECONNREFUSED",a.ERR_NETWORK="ERR_NETWORK",a.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",a.ERR_DEPRECATED="ERR_DEPRECATED",a.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",a.ERR_BAD_REQUEST="ERR_BAD_REQUEST",a.ERR_CANCELED="ERR_CANCELED",a.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",a.ERR_INVALID_URL="ERR_INVALID_URL",a.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const s=a},7110(e,t,n){"use strict";n.d(t,{A:()=>d});var o=n(7275),r=n(3325);const i=Symbol("internals"),a=/[^\x09\x20-\x7E\x80-\xFF]/g;function s(e){return e&&String(e).trim().toLowerCase()}function c(e){return!1===e||null==e?e:o.A.isArray(e)?e.map(c):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(a,""))}function l(e,t,n,r,i){return o.A.isFunction(r)?r.call(this,t,n):(i&&(t=n),o.A.isString(t)?o.A.isString(r)?-1!==t.indexOf(r):o.A.isRegExp(r)?r.test(t):void 0:void 0)}class u{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function a(e,t,n){const r=s(t);if(!r)throw new Error("header name must be a non-empty string");const a=o.A.findKey(i,r);(!a||void 0===i[a]||!0===n||void 0===n&&!1!==i[a])&&(i[a||t]=c(e))}const l=(e,t)=>o.A.forEach(e,(e,n)=>a(e,n,t));if(o.A.isPlainObject(e)||e instanceof this.constructor)l(e,t);else if(o.A.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))l((0,r.A)(e),t);else if(o.A.isObject(e)&&o.A.isIterable(e)){let n,r,i={};for(const t of e){if(!o.A.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?o.A.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}l(i,t)}else null!=e&&a(t,e,n);return this}get(e,t){if(e=s(e)){const n=o.A.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(o.A.isFunction(t))return t.call(this,e,n);if(o.A.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=s(e)){const n=o.A.findKey(this,e);return!(!n||void 0===this[n]||t&&!l(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=s(e)){const i=o.A.findKey(n,e);!i||t&&!l(0,n[i],i,t)||(delete n[i],r=!0)}}return o.A.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const r=t[n];e&&!l(0,this[r],r,e,!0)||(delete this[r],o=!0)}return o}normalize(e){const t=this,n={};return o.A.forEach(this,(r,i)=>{const a=o.A.findKey(n,i);if(a)return t[a]=c(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=c(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return o.A.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&o.A.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[i]=this[i]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=s(e);t[r]||(!function(e,t){const n=o.A.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(e,n,r){return this[o].call(this,t,e,n,r)},configurable:!0})})}(n,e),t[r]=!0)}return o.A.isArray(e)?e.forEach(r):r(e),this}}u.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),o.A.reduceDescriptors(u.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),o.A.freezeMethods(u);const d=u},7352(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(7275);const r=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){o.A.forEach(this.handlers,function(t){null!==t&&e(t)})}}},8262(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(9034),r=n(6787);function i(e,t,n){let i=!(0,o.A)(t);return e&&(i||!1===n)?(0,r.A)(e,t):t}},8683(e,t,n){"use strict";n.d(t,{A:()=>u});var o=n(9152),r=n(9575),i=n(6013),a=n(8458),s=n(7110),c=n(6263);function l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a.A(null,e)}function u(e){l(e),e.headers=s.A.from(e.headers),e.data=o.A.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return c.A.getAdapter(e.adapter||i.A.adapter,e)(e).then(function(t){l(e),e.response=t;try{t.data=o.A.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=s.A.from(t.headers),t},function(t){if(!(0,r.A)(t)&&(l(e),t&&t.response)){e.response=t.response;try{t.response.data=o.A.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=s.A.from(t.response.headers)}return Promise.reject(t)})}},4662(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(7275),r=n(7110);const i=e=>e instanceof r.A?{...e}:e;function a(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return o.A.isPlainObject(e)&&o.A.isPlainObject(t)?o.A.merge.call({caseless:r},e,t):o.A.isPlainObject(t)?o.A.merge({},t):o.A.isArray(t)?t.slice():t}function a(e,t,n,i){return o.A.isUndefined(t)?o.A.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function s(e,t){if(!o.A.isUndefined(t))return r(void 0,t)}function c(e,t){return o.A.isUndefined(t)?o.A.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,i,a){return o.A.hasOwnProp(t,a)?r(n,i):o.A.hasOwnProp(e,a)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const u={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,allowedSocketPaths:c,responseEncoding:c,validateStatus:l,headers:(e,t,n)=>a(i(e),i(t),0,!0)};return o.A.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=o.A.hasOwnProp(u,r)?u[r]:a,s=i(o.A.hasOwnProp(e,r)?e[r]:void 0,o.A.hasOwnProp(t,r)?t[r]:void 0,r);o.A.isUndefined(s)&&i!==l||(n[r]=s)}),n}},3853(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(4062);function r(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new o.A("Request failed with status code "+n.status,n.status>=400&&n.status<500?o.A.ERR_BAD_REQUEST:o.A.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}},9152(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(7275),r=n(6013),i=n(7110);function a(e,t){const n=this||r.A,a=t||n,s=i.A.from(a.headers);let c=a.data;return o.A.forEach(e,function(e){c=e.call(n,c,s.normalize(),t?t.status:void 0)}),s.normalize(),c}},6013(e,t,n){"use strict";n.d(t,{A:()=>p});var o=n(7275),r=n(4062),i=n(807),a=n(665),s=n(1076),c=n(3820),l=n(7887);const u=(e,t)=>null!=e&&o.A.hasOwnProp(e,t)?e[t]:void 0;const d={transitional:i.A,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=o.A.isObject(e);i&&o.A.isHTMLForm(e)&&(e=new FormData(e));if(o.A.isFormData(e))return r?JSON.stringify((0,l.A)(e)):e;if(o.A.isArrayBuffer(e)||o.A.isBuffer(e)||o.A.isStream(e)||o.A.isFile(e)||o.A.isBlob(e)||o.A.isReadableStream(e))return e;if(o.A.isArrayBufferView(e))return e.buffer;if(o.A.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){const t=u(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return(0,s.A)(e,t).toString();if((c=o.A.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=u(this,"env"),o=n&&n.FormData;return(0,a.A)(c?{"files[]":e}:e,o&&new o,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(o.A.isString(e))try{return(t||JSON.parse)(e),o.A.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=u(this,"transitional")||d.transitional,n=t&&t.forcedJSONParsing,i=u(this,"responseType"),a="json"===i;if(o.A.isResponse(e)||o.A.isReadableStream(e))return e;if(e&&o.A.isString(e)&&(n&&!i||a)){const n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,u(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw r.A.from(e,r.A.ERR_BAD_RESPONSE,this,null,u(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.A.classes.FormData,Blob:c.A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};o.A.forEach(["delete","get","head","post","put","patch","query"],e=>{d.headers[e]={}});const p=d},807(e,t,n){"use strict";n.d(t,{A:()=>o});const o={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}},9888(e,t,n){"use strict";n.d(t,{x:()=>o});const o="1.16.0"},5267(e,t,n){"use strict";n.d(t,{A:()=>s});var o=n(665);function r(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function i(e,t){this._pairs=[],e&&(0,o.A)(e,this,t)}const a=i.prototype;a.append=function(e,t){this._pairs.push([e,t])},a.toString=function(e){const t=e?function(t){return e.call(this,t,r)}:r;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const s=i},7693(e,t,n){"use strict";n.d(t,{A:()=>r});const o={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(o).forEach(([e,t])=>{o[t]=e});const r=o},2125(e,t,n){"use strict";function o(e,t){return function(){return e.apply(t,arguments)}}n.d(t,{A:()=>o})},3967(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(7275),r=n(5267);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function a(e,t,n){if(!t)return e;const a=n&&n.encode||i,s=o.A.isFunction(n)?{serialize:n}:n,c=s&&s.serialize;let l;if(l=c?c(t,s):o.A.isURLSearchParams(t)?t.toString():new r.A(t,s).toString(a),l){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+l}return e}},6787(e,t,n){"use strict";function o(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}n.d(t,{A:()=>o})},2723(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(8458),r=n(4062),i=n(7275);const a=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,a=new AbortController;const s=function(e){if(!n){n=!0,l();const t=e instanceof Error?e:this.reason;a.abort(t instanceof r.A?t:new o.A(t instanceof Error?t.message:t))}};let c=t&&setTimeout(()=>{c=null,s(new r.A(`timeout of ${t}ms exceeded`,r.A.ETIMEDOUT))},t);const l=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:u}=a;return u.unsubscribe=()=>i.A.asap(l),u}}},9887(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(7275);const r=n(3820).A.hasStandardBrowserEnv?{write(e,t,n,r,i,a,s){if("undefined"==typeof document)return;const c=[`${e}=${encodeURIComponent(t)}`];o.A.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),o.A.isString(r)&&c.push(`path=${r}`),o.A.isString(i)&&c.push(`domain=${i}`),!0===a&&c.push("secure"),o.A.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;nnull,remove(){}}},1526(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(8287).hp;function r(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(e-=2,n+=2)}let n=0,o=t-1;const i=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));o>=0&&(61===r.charCodeAt(o)?(n++,o--):i(o)&&(n++,o-=3)),1===n&&o>=0&&(61===r.charCodeAt(o)||i(o))&&n++;const a=3*Math.floor(e/4)-(n||0);return a>0?a:0}if(void 0!==o&&"function"==typeof o.byteLength)return o.byteLength(r,"utf8");let i=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}},7887(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(7275);const r=function(e){function t(e,n,r,i){let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),c=i>=e.length;if(a=!a&&o.A.isArray(r)?r.length:a,c)return o.A.hasOwnProp(r,a)?r[a]=o.A.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!s;r[a]&&o.A.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&o.A.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let o;const r=n.length;let i;for(o=0;o{t(function(e){return o.A.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}},9034(e,t,n){"use strict";function o(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}n.d(t,{A:()=>o})},8562(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(7275);function r(e){return o.A.isObject(e)&&!0===e.isAxiosError}},6305(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(3820);const r=o.A.hasStandardBrowserEnv?(i=new URL(o.A.origin),a=o.A.navigator&&/(msie|trident)/i.test(o.A.navigator.userAgent),e=>(e=new URL(e,o.A.origin),i.protocol===e.protocol&&i.host===e.host&&(a||i.port===e.port))):()=>!0;var i,a},3119(e,t,n){"use strict";n.d(t,{A:()=>o});const o=null},3325(e,t,n){"use strict";n.d(t,{A:()=>r});const o=n(7275).A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),r=e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&o[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};(Object.getOwnPropertyDescriptor(r,"name")||{}).writable||Object.defineProperty(r,"name",{value:"default",configurable:!0})},5579(e,t,n){"use strict";function o(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}n.d(t,{A:()=>o})},7837(e,t,n){"use strict";n.d(t,{C1:()=>a,Vj:()=>s,mM:()=>c});var o=n(3873),r=n(66),i=n(7275);const a=(e,t,n=3)=>{let i=0;const a=(0,o.A)(50,250);return(0,r.A)(n=>{const o=n.loaded,r=n.lengthComputable?n.total:void 0,s=null!=r?Math.min(o,r):o,c=Math.max(0,s-i),l=a(c);i=Math.max(i,s);e({loaded:s,total:r,progress:r?s/r:void 0,bytes:c,rate:l||void 0,estimated:l&&r?(r-s)/l:void 0,event:n,lengthComputable:null!=r,[t?"download":"upload"]:!0})},n)},s=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},c=e=>(...t)=>i.A.asap(()=>e(...t))},8382(e,t,n){"use strict";n.d(t,{A:()=>p});var o=n(3820),r=n(7275),i=n(6305),a=n(9887),s=n(8262),c=n(4662),l=n(7110),u=n(3967);const d=["content-type","content-length"];const p=e=>{const t=(0,c.A)({},e),n=e=>r.A.hasOwnProp(t,e)?t[e]:void 0,p=n("data");let h=n("withXSRFToken");const m=n("xsrfHeaderName"),f=n("xsrfCookieName");let g=n("headers");const y=n("auth"),A=n("baseURL"),w=n("allowAbsoluteUrls"),b=n("url");var v;if(t.headers=g=l.A.from(g),t.url=(0,u.A)((0,s.A)(A,b,w),e.params,e.paramsSerializer),y&&g.set("Authorization","Basic "+btoa((y.username||"")+":"+(y.password?(v=y.password,encodeURIComponent(v).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))):""))),r.A.isFormData(p)&&(o.A.hasStandardBrowserEnv||o.A.hasStandardBrowserWebWorkerEnv?g.setContentType(void 0):r.A.isFunction(p.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach(([t,n])=>{d.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(g,p.getHeaders(),n("formDataHeaderPolicy"))),o.A.hasStandardBrowserEnv){r.A.isFunction(h)&&(h=h(t));if(!0===h||null==h&&(0,i.A)(t.url)){const e=m&&f&&a.A.read(f);e&&g.set(m,e)}}return t};(Object.getOwnPropertyDescriptor(p,"name")||{}).writable||Object.defineProperty(p,"name",{value:"default",configurable:!0})},3873(e,t,n){"use strict";n.d(t,{A:()=>o});const o=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=o[a];r||(r=c),n[i]=s,o[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-ro})},66(e,t,n){"use strict";n.d(t,{A:()=>o});const o=function(e,t){let n,o,r=0,i=1e3/t;const a=(t,i=Date.now())=>{r=i,n=null,o&&(clearTimeout(o),o=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-r;s>=i?a(e,t):(n=e,o||(o=setTimeout(()=>{o=null,a(n)},i-s)))},()=>n&&a(n)]}},665(e,t,n){"use strict";n.d(t,{A:()=>d});var o=n(7275),r=n(4062),i=n(3119),a=n(8287).hp;function s(e){return o.A.isPlainObject(e)||o.A.isArray(e)}function c(e){return o.A.endsWith(e,"[]")?e.slice(0,-2):e}function l(e,t,n){return e?e.concat(t).map(function(e,t){return e=c(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const u=o.A.toFlatObject(o.A,{},null,function(e){return/^is[A-Z]/.test(e)});const d=function(e,t,n){if(!o.A.isObject(e))throw new TypeError("target must be an object");t=t||new(i.A||FormData);const d=(n=o.A.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!o.A.isUndefined(t[e])})).metaTokens,p=n.visitor||w,h=n.dots,m=n.indexes,f=n.Blob||"undefined"!=typeof Blob&&Blob,g=void 0===n.maxDepth?100:n.maxDepth,y=f&&o.A.isSpecCompliantForm(t);if(!o.A.isFunction(p))throw new TypeError("visitor must be a function");function A(e){if(null===e)return"";if(o.A.isDate(e))return e.toISOString();if(o.A.isBoolean(e))return e.toString();if(!y&&o.A.isBlob(e))throw new r.A("Blob is not supported. Use a Buffer instead.");return o.A.isArrayBuffer(e)||o.A.isTypedArray(e)?y&&"function"==typeof Blob?new Blob([e]):a.from(e):e}function w(e,n,r){let i=e;if(o.A.isReactNative(t)&&o.A.isReactNativeBlob(e))return t.append(l(r,n,h),A(e)),!1;if(e&&!r&&"object"==typeof e)if(o.A.endsWith(n,"{}"))n=d?n:n.slice(0,-2),e=JSON.stringify(e);else if(o.A.isArray(e)&&function(e){return o.A.isArray(e)&&!e.some(s)}(e)||(o.A.isFileList(e)||o.A.endsWith(n,"[]"))&&(i=o.A.toArray(e)))return n=c(n),i.forEach(function(e,r){!o.A.isUndefined(e)&&null!==e&&t.append(!0===m?l([n],r,h):null===m?n:n+"[]",A(e))}),!1;return!!s(e)||(t.append(l(r,n,h),A(e)),!1)}const b=[],v=Object.assign(u,{defaultVisitor:w,convertValue:A,isVisitable:s});if(!o.A.isObject(e))throw new TypeError("data must be an object");return function e(n,i,a=0){if(!o.A.isUndefined(n)){if(a>g)throw new r.A("Object is too deeply nested ("+a+" levels). Max depth: "+g,r.A.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==b.indexOf(n))throw Error("Circular reference detected in "+i.join("."));b.push(n),o.A.forEach(n,function(n,r){!0===(!(o.A.isUndefined(n)||null===n)&&p.call(t,n,o.A.isString(r)?r.trim():r,i,v))&&e(n,i?i.concat(r):[r],a+1)}),b.pop()}}(e),t}},1076(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(7275),r=n(665),i=n(3820);function a(e,t){return(0,r.A)(e,new i.A.classes.URLSearchParams,{visitor:function(e,t,n,r){return i.A.isNode&&o.A.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}},4172(e,t,n){"use strict";n.d(t,{E9:()=>i});const o=function*(e,t){let n=e.byteLength;if(!t||n{const a=async function*(e,t){for await(const n of r(e))yield*o(n,t)}(e,t);let s,c=0,l=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await a.next();if(t)return l(),void e.close();let r=o.byteLength;if(n){let e=c+=r;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw l(e),e}},cancel:e=>(l(e),a.return())},{highWaterMark:2})}},3390(e,t,n){"use strict";n.d(t,{A:()=>s});var o=n(9888),r=n(4062);const i={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const a={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+o.x+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new r.A(i(o," has been removed"+(t?" in "+t:"")),r.A.ERR_DEPRECATED);return t&&!a[o]&&(a[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},i.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const s={assertOptions:function(e,t,n){if("object"!=typeof e)throw new r.A("options must be an object",r.A.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(s){const t=e[a],n=void 0===t||s(t,a,e);if(!0!==n)throw new r.A("option "+a+" must be "+n,r.A.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new r.A("Unknown option "+a,r.A.ERR_BAD_OPTION)}},validators:i}},6501(e,t,n){"use strict";n.d(t,{A:()=>o});const o="undefined"!=typeof Blob?Blob:null},8556(e,t,n){"use strict";n.d(t,{A:()=>o});const o="undefined"!=typeof FormData?FormData:null},139(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(5267);const r="undefined"!=typeof URLSearchParams?URLSearchParams:o.A},6847(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(139),r=n(8556),i=n(6501);const a={isBrowser:!0,classes:{URLSearchParams:o.A,FormData:r.A,Blob:i.A},protocols:["http","https","file","blob","url","data"]}},2569(e,t,n){"use strict";n.r(t),n.d(t,{hasBrowserEnv:()=>o,hasStandardBrowserEnv:()=>i,hasStandardBrowserWebWorkerEnv:()=>a,navigator:()=>r,origin:()=>s});const o="undefined"!=typeof window&&"undefined"!=typeof document,r="object"==typeof navigator&&navigator||void 0,i=o&&(!r||["ReactNative","NativeScript","NS"].indexOf(r.product)<0),a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,s=o&&window.location.href||"http://localhost"},3820(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(6847);const r={...n(2569),...o.A}},7275(e,t,n){"use strict";n.d(t,{A:()=>Z});var o=n(2125);const{toString:r}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:a,toStringTag:s}=Symbol,c=(l=Object.create(null),e=>{const t=r.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const u=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:p}=Array,h=d("undefined");function m(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const f=u("ArrayBuffer");const g=d("string"),y=d("function"),A=d("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||s in e||a in e)},v=u("Date"),S=u("File"),E=u("Blob"),_=u("FileList");const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},R=void 0!==T.FormData?T.FormData:void 0,O=u("URLSearchParams"),[C,I,P,k]=["ReadableStream","Request","Response","Headers"].map(u);function N(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,r;if("object"!=typeof e&&(e=[e]),p(e))for(o=0,r=e.length;o0;)if(o=n[r],t===o.toLowerCase())return o;return null}const D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,x=e=>!h(e)&&e!==D;const U=(M="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>M&&e instanceof M);var M;const B=u("HTMLFormElement"),H=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),j=u("RegExp"),K=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};N(n,(n,r)=>{let i;!1!==(i=t(n,r,e))&&(o[r]=i||n)}),Object.defineProperties(e,o)};const F=u("AsyncFunction"),W=(G="function"==typeof setImmediate,X=y(D.postMessage),G?setImmediate:X?(z=`axios@${Math.random()}`,J=[],D.addEventListener("message",({source:e,data:t})=>{e===D&&t===z&&J.length&&J.shift()()},!1),e=>{J.push(e),D.postMessage(z,"*")}):e=>setTimeout(e));var G,X,z,J;const V="undefined"!=typeof queueMicrotask?queueMicrotask.bind(D):"undefined"!=typeof process&&process.nextTick||W,Z={isArray:p,isArrayBuffer:f,isBuffer:m,isFormData:e=>{if(!e)return!1;if(R&&e instanceof R)return!0;const t=i(e);if(!t||t===Object.prototype)return!1;if(!y(e.append))return!1;const n=c(e);return"formdata"===n||"object"===n&&y(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:g,isNumber:A,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isEmptyObject:e=>{if(!w(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:C,isRequest:I,isResponse:P,isHeaders:k,isUndefined:h,isDate:v,isFile:S,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:E,isRegExp:j,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:O,isTypedArray:U,isFileList:_,forEach:N,merge:function e(...t){const{caseless:n,skipUndefined:o}=x(this)&&this||{},r={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=n&&L(r,i)||i,s=H(r,a)?r[a]:void 0;b(s)&&b(t)?r[a]=e(s,t):b(t)?r[a]=e({},t):p(t)?r[a]=t.slice():o&&h(t)||(r[a]=t)};for(let e=0,n=t.length;e(N(t,(t,r)=>{n&&y(t)?Object.defineProperty(e,r,{__proto__:null,value:(0,o.A)(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let r,a,s;const c={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),a=r.length;a-- >0;)s=r[a],o&&!o(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!A(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:B,hasOwnProperty:H,hasOwnProp:H,reduceDescriptors:K,freezeMethods:e=>{K(e,(t,n)=>{if(y(e)&&["arguments","caller","callee"].includes(n))return!1;const o=e[n];y(o)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach(e=>{n[e]=!0})};return p(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:L,global:D,isContextDefined:x,isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new Array(10),n=(e,o)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(m(e))return e;if(!("toJSON"in e)){t[o]=e;const r=p(e)?[]:{};return N(e,(e,t)=>{const i=n(e,o+1);!h(i)&&(r[t]=i)}),t[o]=void 0,r}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch),setImmediate:W,asap:V,isIterable:e=>null!=e&&y(e[a])}},8479(e,t,n){"use strict";n.d(t,{A:()=>c});var o=n(3029),r=n(2901),i=n(4467),a=n(3153),s=function(){function e(){(0,o.A)(this,e),(0,i.A)(this,"readyPromise",null),(0,i.A)(this,"readyResolved",!1),(0,i.A)(this,"readyValue",!1)}return(0,r.A)(e,[{key:"blueConicReady",value:function(){var t=this,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).timeout,o=Date.now();if(this.readyResolved&&!0===this.readyValue)return a.A.log("BlueConicUtils | blueConicReady | returning cached value:",this.readyValue),Promise.resolve(!0);if(this.readyPromise)return a.A.log("BlueConicUtils | blueConicReady | returning existing promise"),this.readyPromise;var r=null!=n?n:e.DEFAULT_TIMEOUT;return a.A.log("BlueConicUtils | blueConicReady | checking BC readiness"),this.readyPromise=new Promise(function(e){var n,i=setTimeout(function(){t.readyResolved||(a.A.log("BlueConicUtils | blueConicReady | timeout at:",(Date.now()-o)/1e3,"s"),t.resolveReady(!1,e))},r);if(null!==(n=window.blueConicClient)&&void 0!==n&&n.profile)return a.A.log("BlueConicUtils | blueConicReady | BC already ready"),void t.resolveReady(!0,e);var s=function(){var n;if(!t.readyResolved)if(null!==(n=window.blueConicClient)&&void 0!==n&&n.event){a.A.log("BlueConicUtils | blueConicReady | BC client detected");var r=window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){clearTimeout(i),a.A.log("BlueConicUtils | blueConicReady | onReady fired at:",(Date.now()-o)/1e3,"s"),null==r||r(),t.resolveReady(!0,e)})}else setTimeout(s,500)};s()}),this.readyPromise}},{key:"resolveReady",value:function(e,t){this.readyResolved||(a.A.log("BlueConicUtils | blueConicReady | resolved with:",e),this.readyResolved=!0,this.readyValue=e,t(e),!1===e&&(this.readyPromise=null,this.readyResolved=!1))}}])}();(0,i.A)(s,"DEFAULT_TIMEOUT",3e3);const c=new s},2936(){"use strict"},3153(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(3612);const r={log:function(){if(o.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;rc}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const c={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableReaderDashboardv2:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardv2,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,enableDashboardBenefitHub:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardBenefitHub,enableEngageArticleGifting:"1"===(null===(o=window.authentication_config)||void 0===o?void 0:o.articleSharingEnabled)&&"1"===(null===(r=window.authentication_config)||void 0===r?void 0:r.isEngageArticleSharing),enableGiftedArticlesLink:"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.articleSharingEnabled)&&"1"!==(null===(a=window.authentication_config)||void 0===a?void 0:a.isEngageArticleSharing),enableSavedArticlesLink:"1"===(null===(s=window.authentication_config)||void 0===s?void 0:s.articleSavingEnabled),prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",enableUpgradeSubscription:!!window.authentication_config&&"1"===window.authentication_config.enableUpgradeSubscription,oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog,updatePaymentEnabled:!!window.authentication_config&&"1"===window.authentication_config.enableUpdatePayment}},9532(e,t,n){"use strict";n.d(t,{L4:()=>g,aG:()=>A,gQ:()=>y,mP:()=>b,oL:()=>h});var o,r,i=n(4467),a=(n(2284),n(467)),s=(n(3453),n(4756)),c=n(5537),l=(n(893),n(7536),n(3153)),u=n(3612);n(2936),n(8479);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function p(e){for(var t=1;t2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},g=function(){var e=(0,a.A)(s.mark(function e(t){var n,o,r;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,f();case 1:return l.A.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",l.A.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),o=function(e){return l.A.log("Utils dataLayerLoop: look for this element ",e),e[t]?(l.A.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(l.A.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},r=window.dataLayer.some(o),e.abrupt("return",r?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),y=function(){var e=(0,a.A)(s.mark(function e(){var t,n,o=arguments;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"Page Type",e.next=1,g(t);case 1:return n=e.sent,l.A.log("utils | pageType: page type is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),A=function(){var e=(0,a.A)(s.mark(function e(){return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return u.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(l.A.log("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var o=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=o,l.A.log("Received entitlementsReady event:",o),e(o)}catch(e){l.A.error("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(l.A.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),w=function(e){l.A.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return l.A.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=w;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var b=function(e){var t=e.text,n=e.boldText,o=void 0!==n&&n,r=e.title,i=e.legal,a=void 0===i?"":i,s=e.id,c=e.fullScreen,l=e.appendToId,u=e.closeConfirm,d=e.buttonText,p=e.autoDismiss,h=void 0===p||p,m=e.embedded,f=void 0!==m&&m,g=e.loginModal,y=void 0!==g&&g,A=e.homePage,w=e.canonicalURL,b=document.querySelector("#".concat(s)),S="";if(y){var E=encodeURIComponent(w);S='
\n
\n
\n
\n
\n
\n

').concat(r||"",'

\n
\n
\n\t\t\t\t\t\t\t\t\t').concat(t||"",'\n
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t').concat(a||"",'\n
\n
\n
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t
\n \t
\n \t
\n \t
\n \t
")}else S='
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t

').concat(r||"",'

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t').concat(t||"",'\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t').concat(a||"","\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t").concat(u?'
\n\t\t\t\t\t\t\t\t
"):"","\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
");(b||((b=document.createElement("div")).id=s,b.classList="digisubs-mainModalWrapper"),b.innerHTML="",b.innerHTML=S,y)||b.querySelector("#digisubs-modal-button-container").addEventListener("click",function(){b.remove()});u&&b.querySelector(".digisubs-optional-button-container").addEventListener("click",function(){b.remove()});if(l){var _=document.querySelector("#".concat(l));if(_&&f){var T=document.getElementById("userProfileEntriesContainer").querySelectorAll(".user-profile-item-row");if(T.length>=2)T[1].parentNode.insertBefore(b,T[1].nextSibling)}else _.append(b)}var R=b.querySelector("#modalContainer");if(R&&R.addEventListener("click",v),h){var O=Math.min(Math.max(55*t.length,2500),7e3);O=O>2800?O:3500,setTimeout(function(){var e;(e=b).classList.add("fade-out"),setTimeout(function(){e.remove()},200)},O)}return b};function v(e){var t=document.getElementById("modalContainer"),n=document.getElementById("modal-wrap");t&&n&&e.target===t&&(t.classList.add("fade-out"),setTimeout(function(){t.style.display="none";var n=document.elementFromPoint(e.clientX,e.clientY);if(t.style.display="",t.remove(),n&&"A"===n.tagName)try{var o=new URL(n.href,window.location.origin);"http:"!==o.protocol&&"https:"!==o.protocol||window.location.assign(o.href)}catch(e){console.warn("URL no válida:",e)}},200))}var S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var o={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},r=function(){var r=(0,a.A)(s.mark(function r(){var i,a,c,u,d,h,m,f,w,b,v;return s.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(i=window.sophi_config)||void 0===i?void 0:i.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return o.sspw=!0,r.abrupt("return",t({paywall:!0,details:p({},o)}));case 1:return r.next=2,y();case 2:return c=r.sent,r.next=3,g("Paywall_Level");case 3:if(u=r.sent,"article"===c&&"free"!==u){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==c?"Page type is not an article":"Free article"}));case 4:return r.next=5,A();case 5:if(!(d=r.sent)||!d.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==u){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(h=null===(a=window.ConnextUtils)||void 0===a?void 0:a.runningSophi,l.A.log("checkPaywallStatus - Sophi is running: ",h),!h){r.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(o.sophiClient=!0,o.engageStatus=!0,o.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(o.sophiClient=!0),t({paywall:!0,details:p({},o)})},{once:!0}),r.next=12;break;case 8:if(h){r.next=12;break}return m=window.ConnextUtils.connextReady("onPaywallShown",!1),f=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),r.prev=9,r.next=10,Promise.race([m,f]);case 10:!0===(w=r.sent)?(o.engagePaywall=!0,o.engageStatus="Engage paywall detected"):(o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(w)),r.next=12;break;case 11:r.prev=11,b=r.catch(9),o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(b);case 12:return r.abrupt("return",t({paywall:Object.values(o).some(function(e){return e}),details:p({},o)}));case 13:r.prev=13,v=r.catch(0),n(v);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return r.apply(this,arguments)}}();r()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=S)},5537(e,t,n){"use strict";n.d(t,{s:()=>i});class o extends Error{}function r(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}function i(e,t){if("string"!=typeof e)throw new o("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,i=e.split(".")[n];if("string"!=typeof i)throw new o(`Invalid token specified: missing part #${n+1}`);let a;try{a=r(i)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(a)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}o.prototype.name="InvalidTokenError"},2450(e){"use strict";e.exports=JSON.parse('{"macombdaily.com":{"code":"MD","logo":"MD_Logo.png","title":"Macomb Daily","tribune":false,"cluster":["themorningsun.com","theoaklandpress.com"],"clusterName":"Michigan","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-977-3677","email":"service@macombdaily.com","address1":"6250 Metropolitan Parkway, Dock D","address2":"Sterling Heights, MI 48312","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 3 p.m. Sat. 7 a.m. – 10 a.m. Sun. 7 a.m. – 12 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/macomb-daily-for-iphone/id520209090?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.macombdaily"}]},"themorningsun.com":{"code":"MSUN","logo":"MS_Logo.png","title":"Mount Pleasant Morning","tribune":false,"cluster":["macombdaily.com","theoaklandpress.com"],"clusterName":"Michigan","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"989-779-6000","email":"customerservice@oakpress.com","address1":"","address2":"","timeZone":"Eastern","supportHours":" Mon.-Fri. 8:30 a.m. – 5:00 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-morning-sun-for-iphone/id520224707?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.morningsun"}]},"theoaklandpress.com":{"code":"OP","logo":"OP_Logo.png","title":"Daily Oakland","tribune":false,"cluster":["macombdaily.com","themorningsun.com"],"clusterName":"Michigan","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-977-3677","email":"customerservice@oakpress.com","address1":"6250 Metropolitan Parkway, Dock D","address2":"Sterling Heights, MI 48312","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 3 p.m. Sat. 7 a.m. – 10 a.m. Sun. 7 a.m. – 12 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-oakland-press-for-iphone/id520210301?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.oaklandpress"}]},"thenewsherald.com":{"code":"TNH","logo":"TNH_Logo.png","title":"The News-Herald","tribune":false,"cluster":[],"clusterName":"Michigan Weeklies","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-977-3677","email":"customerservice@oakpress.com","address1":"6250 Metropolitan Parkway, Dock D","address2":"Sterling Heights, MI 48312","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 3 p.m. Sat. 7 a.m. – 10 a.m. Sun. 7 a.m. – 12 p.m."},"apps":[{"app_store":"","play_store":""}]},"dailyfreeman.com":{"code":"KF","logo":"DF_Logo.png","title":"Kingston Daily Freeman","tribune":false,"cluster":["oneidadispatch.com","saratogian.com","troyrecord.com"],"clusterName":"New York","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-699-7699","email":" circulation@freemanonline.com","address1":"P.O. Box 4470","address2":"Kingston, NY 12401","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 6 p.m. Sat. 6:30 a.m. – 11 a.m. Sun. 6:30 a.m. – 12 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/daily-freeman-for-iphone/id520227762?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.dailyfreeman"}]},"oneidadispatch.com":{"code":"OD","logo":"OD_Logo.png","title":"Oneida Daily Dispatch","tribune":false,"cluster":["dailyfreeman.com","saratogian.com","troyrecord.com"],"clusterName":"New York","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-699-7699","email":"customerservice@oneidadispatch.com","address1":"P.O. Box 4470","address2":"Kingston, NY 12401","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 6 p.m. Sat. 6:30 a.m. – 11 a.m. Sun. 6:30 a.m. – 12 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/oneida-dispatch-for-iphone/id520233872?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.oneidadispatch"}]},"saratogian.com":{"code":"SA","logo":"SRT_Logo.png","title":"The Saratogian","tribune":false,"cluster":["oneidadispatch.com","dailyfreeman.com","troyrecord.com"],"clusterName":"New York","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-599-0499","email":"circulation@saratogian.com","address1":"P.O. Box 4004","address2":"Westford, MA 01886","timeZone":"Eastern","supportHours":" Monday – Friday 7:30 a.m.–6 p.m. Saturday 6:30 a.m.–11 a.m. Sunday 6:30 a.m.-12 p.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/saratogian-for-iphone/id520229775?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.saratogian"}]},"troyrecord.com":{"code":"TR","logo":"TROY_Logo.png","title":"The Troy Record","tribune":false,"cluster":["oneidadispatch.com","dailyfreeman.com","saratogian.com"],"clusterName":"New York","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-599-0499","email":"circulation@saratogian.com","address1":"P.O. Box 4470","address2":"Kingston, NY 12401","timeZone":"Eastern","supportHours":" Monday – Friday 7:30 a.m. – 6:00 p.m. \\\\n Saturday 6:30 a.m. – 11:00 a.m. \\\\n Sunday 6:30 a.m. – 12:00 noon"},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-record-for-iphone/id520232370?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.record"}]},"morningjournal.com":{"code":"MJ","logo":"MOJ_Logo.png","title":"Lorain Morning Journal","tribune":false,"cluster":["news-herald.com"],"clusterName":"Ohio","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-888-757-0727","email":"subscribe@morningjournal.com","address1":"401 Broadway Ave., Suite B","address2":"Lorain, Ohio 44052","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 3 p.m. Sat. 6:30 a.m. – 10 a.m. Sun. 6:30 a.m. – 10 a.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/morning-journal-for-iphone/id520205939?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.morningjournal"}]},"news-herald.com":{"code":"NH","logo":"NH_Logo.png","title":"Lake County News-Herald","tribune":false,"cluster":["morningjournal.com"],"clusterName":"Ohio","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-787-0717","email":"circulation@news-herald.com","address1":"36625 Vine St. Suite 4","address2":"Willoughby, Ohio 44094","timeZone":"Eastern","supportHours":" Mon.-Fri. 6 a.m. – 3 p.m. Sat. 6:30 a.m. – 10 a.m. Sun. 6:30 a.m. – 10 a.m."},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-news-herald-for-iphone/id520206415?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.newsherald"}]},"delcotimes.com":{"code":"DCDT","logo":"DEL_Logo.png","title":"Delaware County Times","tribune":false,"cluster":["readingeagle.com","thereporteronline.com","timesherald.com","pottsmerc.com","trentonian.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-799-6299","email":"epapersupport@21st-centurymedia.com","address1":"390 Eagleview Blvd.","address2":"Exton, PA 19341","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/delaware-county-daily-times/id508962453?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.thedelawarecountydailytimes"}]},"readingeagle.com":{"code":"EAGLE","logo":"RE_Logo.png","title":"Reading Eagle","tribune":false,"cluster":["delcotimes.com","thereporteronline.com","timesherald.com","pottsmerc.com","trentonian.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"610-371-5122","email":"ecustomerservice@readingeagle.com","address1":"390 Eagleview Blvd.","address2":"Exton, PA 19341","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/us/app/reading-eagle/id950379194?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.readingeagle.eversify"}]},"thereporteronline.com":{"code":"LANS","logo":"TRO_Logo.png","title":"The Lansdale Reporter","tribune":false,"cluster":["delcotimes.com","readingeagle.com","timesherald.com","pottsmerc.com","trentonian.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-955-0355","email":"epapersupport@21st-centurymedia.com","address1":"307 Derstine Ave.","address2":"Lansdale, PA 19446","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-reporter-for-iphone/id525105540?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.reporter"}]},"timesherald.com":{"code":"NORR","logo":"TH_Logo.png","title":"Norristown Times Herald","tribune":false,"cluster":["delcotimes.com","readingeagle.com","thereporteronline.com","pottsmerc.com","trentonian.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-933-4233","email":"epapersupport@21st-centurymedia.com","address1":"390 Eagleview Blvd.","address2":"Exton, PA 19341","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-times-herald-for-iphone/id525130019?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.timesherald"}]},"pottsmerc.com":{"code":"PMERC","logo":"PM_Logo.png","title":"The Pottstown Mercury","tribune":false,"cluster":["delcotimes.com","readingeagle.com","thereporteronline.com","timesherald.com","trentonian.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-933-5133","email":"epapersupport@21st-centurymedia.com","address1":"390 Eagleview Blvd.","address2":"Exton, PA 19341","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-mercury-for-iphone/id525118208?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.mercury"}]},"trentonian.com":{"code":"TREN","logo":"TRT_Logo.png","title":"The Trentonian","tribune":false,"cluster":["delcotimes.com","readingeagle.com","thereporteronline.com","timesherald.com","pottsmerc.com","dailylocal.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-489-8189","email":"epapersupport@21st-centurymedia.com","address1":"127 Rte 206 South, Suite 27","address2":"Trenton, NJ 08610","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/the-trentonian-for-iphone/id503293221?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.trentonian"}]},"dailylocal.com":{"code":"WCDL","logo":"DL_Logo.png","title":"West Chester Daily Local","tribune":false,"cluster":["delcotimes.com","readingeagle.com","thereporteronline.com","timesherald.com","pottsmerc.com","trentonian.com"],"clusterName":"Pennsylvania","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"888-744-2144","email":"epapersupport@21st-centurymedia.com","address1":"390 Eagleview Blvd.","address2":"Exton, PA 19341","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"http://itunes.apple.com/us/app/daily-local-for-iphone/id525116294?mt=8","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.dailylocalnews"}]},"marinij.com":{"code":"MIJ","logo":"MJ_Logo.png","title":"Marin Independent Journal","tribune":false,"cluster":["eastbaytimes.com","mercurynews.com"],"clusterName":"BANG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"415-937-7222","email":"subscriberservices@bayareanewsgroup.net","address1":"103 Shoreline Parkway, Suite 201","address2":"San Rafael, CA 94901","timeZone":"Pacific","supportHours":" Monday through Friday: 6:30a.m. – 5:00 p.m. \\\\n Saturday: 7:00a.m. – 10:30a.m. \\\\n Sunday: 8:00a.m. – 10:30a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/marin-independent-journal-news/id499674553?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.marinindependentjournal"}]},"eastbaytimes.com":{"code":"EBT","logo":"EBT_Logo.png","title":"East Bay Times","tribune":false,"cluster":["marinij.com","mercurynews.com"],"clusterName":"BANG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"925-276-9254","email":"subscriberservices@bayareanewsgroup.net","address1":"208 Lindbergh Avenue","address2":"Livermore, CA 94551-9512","timeZone":"Pacific","supportHours":" Monday through Friday: 6:30 a.m. – 5:00 p.m. \\\\n Saturday: 7:00 a.m. – 10:30 a.m. \\\\n Sunday: 8:00 a.m. – 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/east-bay-times-for-mobile/id479676946?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.contracostatimes"}]},"mercurynews.com":{"code":"MERC","logo":"SJMN_Logo.png","title":"The Mercury News","tribune":false,"cluster":["marinij.com","eastbaytimes.com"],"clusterName":"BANG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"408-508-5554","email":"subscriberservices@bayareanewsgroup.net","address1":"75 E. Santa Clara Street, Suite 1100","address2":"San Jose, CA 95113","timeZone":"Pacific","supportHours":" Monday through Friday: 6:30 a.m. – 5:00 p.m. \\\\n Saturday: 7:00 a.m. – 10:30 a.m. \\\\n Sunday: 8:00 a.m. – 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/the-mercury-news-for-mobile/id4799551.9959?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.sanjosemercurynews"}]},"bostonherald.com":{"code":"BH","logo":"BH_Logo.png","title":"Boston Herald","tribune":false,"cluster":["lowellsun.com","sentinelandenterprise.com"],"clusterName":"Boston","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"617-619-6265","email":"circulation@bostonherald.com","address1":"P.O. Box 4004","address2":"Westford, MA 01886","timeZone":"Eastern","supportHours":" Monday – Friday 7:30 a.m. – 6:00 p.m. \\\\n Saturday 6:30 a.m. – 11:00 a.m. \\\\n Sunday 6:30 a.m. – 12:00 12 p.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/boston-herald/id1471216824?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.doapps.android.mln.MLN_42b39fdb198522d2bfc6b1f64cd98365"}]},"lowellsun.com":{"code":"LS","logo":"LS_Logo.png","title":"Lowell Sun","tribune":false,"cluster":["bostonherald.com","sentinelandenterprise.com"],"clusterName":"Boston","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"978-459-1300","email":"circulation@lowellsun.com","address1":"P.O. Box 4004","address2":"Westford, MA 01886","timeZone":"Eastern","supportHours":" Monday – Friday 7:30 a.m. – 6 p.m. \\\\n Saturday 6:30 a.m. – 11 a.m. \\\\n Sunday 6:30 a.m. – 12 p.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/lowell-sun-news-for-mobile/id502959997?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.lowellsunnews"}]},"sentinelandenterprise.com":{"code":"SE","logo":"SE_Logo.png","title":"Sentinel & Enterprise","tribune":false,"cluster":["bostonherald.com","lowellsun.com"],"clusterName":"Boston","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"978-343-6911","email":"circulation@sentinelandenterprise.com","address1":"P.O. Box 4004","address2":"Westford, MA 01886","timeZone":"Eastern","supportHours":" Monday – Friday: 7:30 a.m. to 6 p.m. \\\\n Saturday – Sunday: 6:30 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/sentinel-and-enterprise/id507306870?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.sentinelenterprise"}]},"denverpost.com":{"code":"DP","logo":"DP_Logo.png","title":"The Denver Post","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","reporterherald.com","timescall.com","canoncitydailyrecord.com","eptrail.com","fortmorgantimes.com","journal-advocate.com","mercurynews.com","ocregister.com","bostonherald.com","twincities.com","readingeagle.com"],"clusterName":"Denver","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"303-832-3232","email":"memberservices@denverpost.com","address1":"5990 Washington St.","address2":"Denver, CO 80216","timeZone":"Mountain","supportHours":" Monday - Friday: 6:30 a.m. - 5 p.m. \\\\n Saturday & holidays: 7 a.m. - 10 a.m. \\\\n Sunday: 8:30 a.m. - 11 a.m. "},"apps":[{"app_store":"https://apps.apple.com/us/app/denver-post/id375264133?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.ap.denverpost"}]},"dailycamera.com":{"code":"BDC","logo":"BDC_Logo.png","title":"Boulder Daily Camera","tribune":false,"cluster":["greeleytribune.com","reporterherald.com","timescall.com","canoncitydailyrecord.com","eptrail.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"303-444-3444","email":"circulation@dailycamera.com","address1":"PO Box 19199","address2":"Boulder CO, 80308","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/us/app/boulder-daily-camera/id405275092?mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.dailycamera"}]},"greeleytribune.com":{"code":"GRE","logo":"GRE_Logo.png","title":"Greeley Tribune","tribune":false,"cluster":["dailycamera.com","reporterherald.com","timescall.com","canoncitydailyrecord.com","eptrail.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"970-352-8089","email":"circulation@greeleytribune.com","address1":"PO Box 337228","address2":"Greeley, CO 80633-7228","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"","play_store":""}]},"reporterherald.com":{"code":"LRH","logo":"LRH_Logo.png","title":"Loveland Reporter-Herald","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","timescall.com","canoncitydailyrecord.com","eptrail.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"970-635-3660","email":"rhcirculation@prairiemountainmedia.com","address1":"P.O. Box 59","address2":"Loveland, CO 80539","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/us/app/loveland-reporter-herald-for/id514599798?mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.lovelandreporterherald"}]},"timescall.com":{"code":"LTC","logo":"LTC_Logo.png","title":"Longmont Times Call","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","reporterherald.com","canoncitydailyrecord.com","eptrail.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"303-684-5358","email":"tccirculation@dailycamera.com","address1":"P.O. Box 299","address2":"Longmont, CO 80502","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/us/app/longmont-times-call-for-mobile/id514597776?mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.longmonttimescall"}]},"canoncitydailyrecord.com":{"code":"CDR","logo":"CDR_Logo.png","title":"Cañon City Daily Record","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","reporterherald.com","timescall.com","eptrail.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"719-275-7565","email":"","address1":"The Hive, 729 Main St.","address2":"Cañon City, CO. 81212","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/us/app/canon-city-daily-record/id514585870?mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.canoncitydailyrecord"}]},"eptrail.com":{"code":"EP","logo":"EP_Logo.png","title":"Estes Park Trail-Gazette","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","reporterherald.com","timescall.com","canoncitydailyrecord.com","fortmorgantimes.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"970-586-3356","email":"circulation@eptrail.com","address1":"P.O. Box 1707","address2":"Estes Park, CO 80517","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"","play_store":""}]},"fortmorgantimes.com":{"code":"FMT","logo":"FMT_Logo.png","title":"Fort Morgan Times","tribune":false,"cluster":["dailycamera.com","greeleytribune.com","reporterherald.com","timescall.com","canoncitydailyrecord.com","eptrail.com","journal-advocate.com"],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"970-867-5651","email":"","address1":"P.O. Box 495","address2":"Sterling, CO 80751","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/co/app/fort-morgan-times-for-mobile/id509595449?l=en&mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.fortmorgantimes"}]},"journal-advocate.com":{"code":"SJA","logo":"SJC_Logo.png","title":"Sterling Journal Advocate","tribune":false,"cluster":[],"clusterName":"PMP","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"970-522-1990","email":"","address1":"P.O. Box 495","address2":"Sterling, CO 80751","timeZone":"Mountain","supportHours":" Mon. – Fri. 6:30 a.m. – 3 p.m. \\\\n Sat. 7 a.m. – 10 a.m. \\\\n Sun. 8:30 a.m. – 11a.m. \\\\n Holidays 7 a.m. – 10 a.m."},"apps":[{"app_store":"https://itunes.apple.com/us/app/journal-advocate/id509598546?mt=8","play_store":"https://market.android.com/details?id=com.spreedinc.providers.digitalfirstmedia.journaladvocate"}]},"chicoer.com":{"code":"ER","logo":"EP_Logo.png","title":"Estes Park Trail-Gazette","tribune":false,"cluster":["orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"530-879-7888","email":"delivery@chicoer.com","address1":"400 E. Park Ave.","address2":"Chico, CA 95928","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday, 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/chico-enterprise-record/id499663248?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.chicoenterpriserecord"}]},"orovillemr.com":{"code":"MR","logo":"ORO_Logo.png","title":"Oroville Mercury Register","tribune":false,"cluster":["chicoer.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"530-879-7888","email":"udjcirc@ukiahdj.com","address1":"400 E. Park Ave.","address2":"Chico, CA 95928","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 5:00 p.m. \\\\n Saturday: Closed \\\\n Sunday: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"","play_store":""}]},"redbluffdailynews.com":{"code":"RB","logo":"RBDN_Logo.png","title":"Red Bluff Daily News","tribune":false,"cluster":["chicoer.com","orovillemr.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"530-737-5047","email":"circ@redbluffdailynews.com","address1":"PO Box 885","address2":"Red Bluff, CA 96080","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"","play_store":""}]},"record-bee.com":{"code":"BEE","logo":"RB_Logo.png","title":"Lake County Record-Bee","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"707-263-5636","email":"gdeboth@record-bee.com","address1":"","address2":"","timeZone":"Pacific","supportHours":" Monday - Friday: 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"","play_store":""}]},"montereyherald.com":{"code":"HERALD","logo":"MH_Logo.png","title":"Monterey Herald","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"831-646-1808","email":"circservices@montereyherald.com","address1":"2555 Garden Road Suite D","address2":"Monterey, CA 93940","timeZone":"Pacific","supportHours":" Monday - Friday: 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/monterey-county-herald/id507305181?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.montereyherald"}]},"santacruzsentinel.com":{"code":"SCS","logo":"SCS_Logo.png","title":"Santa Cruz Sentinel","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"831-706-3201","email":"circulation@santacruzsentinel.com","address1":"318 Encinal St.","address2":"Santa Cruz, CA 95060","timeZone":"Pacific","supportHours":" Monday - Friday: 7:00 a.m. to 5:00 p.m. \\\\n Saturday: Closed \\\\n Sunday & holidays: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/santa-cruz-sentinel-for-mobile/id499677382?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.santacruzsentinel"}]},"times-standard.com":{"code":"TS","logo":"TSTD_Logo.png","title":"Eureka Times-Standard","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"707-441-0550","email":"circulation@times-standard.com","address1":"39 Fifth St.","address2":"Eureka, CA 95501","timeZone":"Pacific","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/us/app/eureka-times-standard/id499669816?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.eurekatimesstandard"}]},"ukiahdailyjournal.com":{"code":"UK","logo":"UK_Logo.png","title":"Ukiah Daily Journal","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","thereporter.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"707-468-3500","email":"udjcirc@ukiahdj.com","address1":"415 Talmage Road Ste A","address2":"Ukiah, CA 95482","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday, 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/ukiah-daily-journal/id503016816?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.ukiahdailyjournal"}]},"thereporter.com":{"code":"VR","logo":"TR_Logo.png","title":"Vacaville Reporter","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","timesheraldonline.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"707-448-8566","email":"subscribe@thereporter.com","address1":"57 Commerce Place, Ste. A","address2":"Vacaville, CA 95687","timeZone":"Pacific","supportHours":" Monday 8:00 a.m. to 4:00 p.m. \\\\n Tuesday through Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/vacaville-reporter/id499680399?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.californianewspaperpartnership.vacavillereporter"}]},"timesheraldonline.com":{"code":"VT","logo":"THO_Logo.png","title":"Vallejo Times-Herald","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","dailydemocrat.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"707-644-5478","email":"services@timesheraldonline.com","address1":"425A Virginia St.","address2":"Vallejo, CA 94590","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday, 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/vallejo-times-herald-news/id508566566?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.vallejotimesherald"}]},"dailydemocrat.com":{"code":"WD","logo":"DD_Logo.png","title":"Woodland Daily Democrat","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","paradisepost.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"530-406-6205","email":"udjcirc@ukiahdj.com","address1":"725 Main Street, Suite 222","address2":"Woodland, CA 95695","timeZone":"Pacific","supportHours":" Monday 8:00 a.m. to 4:00 p.m. \\\\n Tuesday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/daily-democrat-for-mobile/id507295340?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.dailydemocrat"}]},"paradisepost.com":{"code":"PP","logo":"PP_Logo.png","title":"Paradise Post","tribune":false,"cluster":["chicoer.com","orovillemr.com","redbluffdailynews.com","record-bee.com","montereyherald.com","santacruzsentinel.com","times-standard.com","ukiahdailyjournal.com","thereporter.com","timesheraldonline.com","dailydemocrat.com"],"clusterName":"Norcal","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"530-879-7888","email":"","address1":"P.O. Box 9","address2":"Chico, CA 95927","timeZone":"Pacific","supportHours":" Monday - Friday 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday, 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"","play_store":""}]},"dailybulletin.com":{"code":"IVDB","logo":"DBU_Logo.png","title":"Inland Valley Daily Bulletin","tribune":false,"cluster":["dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"909-987-9900","email":"service@scng.com","address1":"3200 Guasti Rd. Suite 100","address2":"Ontario, CA 91761","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/inland-valley-daily-bulletin/id503648014?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstemedia.inlandvalleydailybulletin"}]},"sandiegouniontribune.com":{"code":"SDUT","logo":"SDUT_Logo.png","title":"San Diego Union Tribune","tribune":false,"cluster":["dailybulletin.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","dailynews.com"],"clusterName":"SCNG","benefits":["e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"(619) 299-4141","email":"scustomer.service@sduniontribune.com","address1":"600 B St","address2":"San Diego, CA 92101","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/the-san-diego-union-tribune/id1145952888","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.sdut&hl=en_US&pli=1"}]},"dailynews.com":{"code":"LADN","logo":"DN_Logo.png","title":"SDUT","tribune":false,"cluster":["dailybulletin.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"818-713-3000","email":"service@scng.com","address1":"181 E. Huntington Drive, Suite 209","address2":"Monrovia, CA 91016","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/los-angeles-daily-news/id502957174?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.ladailynews"}]},"presstelegram.com":{"code":"LBPT","logo":"PT_Logo.png","title":"Long Beach Press-Telegram","tribune":false,"cluster":["dailybulletin.com","dailynews.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"562-435-1161","email":"service@scng.com","address1":"5150 E. Pacific Coast Highway, Suite 200","address2":"Long Beach CA 90804","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/long-beach-press-telegram/id502958939?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.longbeachpresstelegram"}]},"ocregister.com":{"code":"OCR","logo":"OCR_Logo.png","title":"Orange County Register","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"714-796-7000","email":"service@scng.com","address1":"1920 Main Street, Suite 225","address2":"Irvine, CA 92614","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/ocregister/id380372599?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.freedom.ocregister"}]},"pressenterprise.com":{"code":"PE","logo":"PE_Logo.png","title":"Press Enterprise","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"951-368-9000","email":"service@scng.com","address1":"3512 14th Street","address2":"Riverside, CA 92501","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/the-press-enterprise/id1218912043?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.doapps.android.mln.MLN_7c590f01490190db0ed02a5070e20f01"}]},"pasadenastarnews.com":{"code":"PSN","logo":"PSN_Logo.png","title":"Pasadena Star-News","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"626-578-6300","email":"service@scng.com","address1":"177 E. Colorado Blvd.","address2":"Pasadena, CA 91105","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/ocregister/id380372599?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.pasadenastarnews"}]},"redlandsdailyfacts.com":{"code":"RDF","logo":"RDF_Logo.png","title":"Redlands Daily Facts","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","sbsun.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"909-353-1641","email":"service@scng.com","address1":"1255 W. Colton Ave.","address2":"Redlands, CA 92374","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/redlands-daily-facts/id502960941?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.redlandsdailyfacts"}]},"sbsun.com":{"code":"SBS","logo":"SBS_Logo.png","title":"San Bernardino Sun","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sgvtribune.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"909-889-9666","email":"service@scng.com","address1":"473 E. Carnegie Drive, Suite 250","address2":"San Bernardino, CA 92408","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/silicon-valley-for-mobile/id502964313?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.sanbernardinosun"}]},"sgvtribune.com":{"code":"SGVT","logo":"SGV_Logo.png","title":"San Gabriel Valley Tribune","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","dailybreeze.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"626-598-8826","email":"service@scng.com","address1":"181 W. Huntington Drive, Suite 209","address2":"Monrovia, CA 91016","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/san-gabriel-valley-tribune/id50302551.998?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.sangabrielvalleytribune"}]},"dailybreeze.com":{"code":"TODB","logo":"DBR_Logo.png","title":"Torrance Daily Breeze","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","whittierdailynews.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"310-540-5511","email":"service@scng.com","address1":"2615 Pacific Coast Highway #329","address2":"Hermosa Beach CA 90254","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/daily-breeze/id503015160?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.torrancedailybreeze"}]},"whittierdailynews.com":{"code":"WDN","logo":"WDN_Logo.png","title":"Whittier Daily News","tribune":false,"cluster":["dailybulletin.com","dailynews.com","presstelegram.com","ocregister.com","pressenterprise.com","pasadenastarnews.com","redlandsdailyfacts.com","sbsun.com","sgvtribune.com","dailybreeze.com","sandiegouniontribune.com"],"clusterName":"SCNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Reader Rewards","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"626-962-8811","email":"service@scng.com","address1":"181 W. Huntington Drive, Suite 209","address2":"Monrovia, CA 91016","timeZone":"Pacific","supportHours":" Monday through Friday: 7 a.m. to 4 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/whittier-daily-news/id503668140?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.whittierdailynews"}]},"twincities.com":{"code":"PPST","logo":"TC_Logo.png","title":"St. Paul Pioneer Press","tribune":false,"cluster":[],"clusterName":"St. Paul","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts","Events"],"customerService":{"phone":"651-717-7377","email":"customerservice@pioneerpress.com","address1":"1 West Water St., Suite 200","address2":"St. Paul, MN 55107","timeZone":"Central","supportHours":" Monday through Friday: 6:30 a.m. to 5 p.m. \\\\n Saturday and holidays: 7 a.m. to 10 a.m. \\\\n Sunday: 8:30 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/st-paul-pioneer-press/id603264610?ls=1","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.digitalfirstmedia.stpaulpioneerpress"}]},"baltimoresun.com":{"code":"200","logo":"BS_Logo.png","title":"The Baltimore Sun","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"443-692-9011","email":"customersatisfactions@baltsun.com","address1":"PO Box 1377","address2":"Baltimore, MD 21278","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id496681035?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.bs&hl=en_US&gl=US"}]},"capitalgazette.com":{"code":"247","logo":"CG_Logo.png","title":"Capital Gazette","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"410-268-4800","email":"circulations@capgaznews.com","address1":"PO Box 1377","address2":"Baltimore, MD 21278","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"","play_store":""}]},"chicagotribune.com":{"code":"3CHITRIB","logo":"CTR_Logo.png","title":"Chicago Tribune","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"312-546-7900","email":"consumerservices@chicagotribune.com","address1":"1000 Albion Avenue","address2":"Schaumburg, IL 60193-4549","timeZone":"Central","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id383137151?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.ct"}]},"courant.com":{"code":"6HrtCrnt","logo":"HC_Logo.png","title":"Hartford Courant","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"860-525-5555","email":"custserv@courant.com","address1":"PO Box 569","address2":"Hartford, CT 06141","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id391113483?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.hc&hl=en_US&gl=US"}]},"dailypress.com":{"code":"7DPress","logo":"","title":"Daily Press","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"757 247-4800","email":"customerservice@dailypress.com","address1":"P.O. Box 2820","address2":"Norfolk, VA 23501","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id397500600?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.hrdp"}]},"growthspotter.com":{"code":"5GrowSpt","logo":"","title":"","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"","email":"","address1":"P.O. Box 2833","address2":"Orlando, FL 32803","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"","play_store":""}]},"mcall.com":{"code":"800","logo":"MC_Logo.png","title":"The Morning Call","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"610-820-6601","email":"circweb@mcall.com","address1":"P.O. Box 1260","address2":"Allentown, PA 18105-1260","timeZone":"Eastern","supportHours":" Monday - Friday: 7:00 a.m. to 4:00 p.m. \\\\n Saturday: Closed \\\\n Sunday: 7:30 a.m. to 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id501096172?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.amc"}]},"nydailynews.com":{"code":"850","logo":"NYDN_Logo.png","title":"New York Daily News","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"201-521-2851","email":"customerservice@nydailynews.com","address1":"PO Box 7180","address2":"New York, NY 10008","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id354730788?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.freerange360.mpp.NYDN"}]},"orlandosentinel.com":{"code":"5OrlSent","logo":"OOS_Logo.png","title":"Orlando Sentinel","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"407-420-5353","email":"customerservice@orlandosentinel.com","address1":"PO Box 2833","address2":"Orlando, FL 32802","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id402223551?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.os"}]},"pilotonline.com":{"code":"7VAPilot","logo":"","title":"","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"757-446-9000","email":"customerservice@pilotonline.com","address1":"PO Box 2833","address2":"Orlando, FL 32802","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"","play_store":""}]},"sun-sentinel.com":{"code":"4SunSent","logo":"SS_Logo.png","title":"Sun Sentinel","tribune":true,"cluster":[],"clusterName":"Tribune","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"954-375-2018","email":"customerservice@sunsentinel.com","address1":"333 SW 12th Ave.","address2":"Deerfield Beach, FL 33442","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/app/apple-store/id402230662?pt=30532&ct=our-app-email&mt=8","play_store":"https://play.google.com/store/apps/details?id=com.apptivateme.next.sfss"}]},"republicanherald.com":{"code":"PR","logo":"PR_Logo.png","title":"Republican Herald","tribune":false,"cluster":["standardspeaker.com","citizensvoice.com","thetimes-tribune.com","wcexaminer.com"],"clusterName":"NEPA","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"570-622-3456 | 1-800-622-1737","email":"customerservice@srepublicanherald.com","address1":"23 S. Centre St., 2nd Floor","address2":"Pottsville, PA 17901","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/us/app/pottsville-republican-herald/id821007739","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.timesshamrockcommunications.republicanherald&hl=en_US&pli=1"}]},"standardspeaker.com":{"code":"SS","logo":"SSK_Logo.png","title":"Standard-Speaker","tribune":false,"cluster":["republicanherald.com","citizensvoice.com","thetimes-tribune.com","wcexaminer.com"],"clusterName":"NEPA","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"570-455-3636 | 800-843-6680","email":"customerservice@standardspeaker.com","address1":"21 N. Wyoming St.","address2":"Hazleton, PA 18201","timeZone":"Eastern","supportHours":""},"apps":[{"app_store":"https://apps.apple.com/us/app/the-hazleton-standard-speaker/id821012052","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.timesshamrockcommunications.standardspeaker&hl=en_US"}]},"citizensvoice.com":{"code":"CV","logo":"CV_Logo.png","title":"Citizens\' Voice","tribune":false,"cluster":["republicanherald.com","standardspeaker.com","thetimes-tribune.com","wcexaminer.com"],"clusterName":"NEPA","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":" (570) 821-2010","email":"customerservice@citizensvoice.com","address1":"75 N. Washington St.","address2":"Wilkes-Barre, PA 18701","timeZone":"Eastern","supportHours":"Monday through Friday, 7 a.m. to 4 p.m.Sunday, 7 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/citizens-voice/id859248069","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.timesshamrockcommunications.citizensvoice&hl=en_US"}]},"thetimes-tribune.com":{"code":"ST","logo":"ST_Logo.png","title":"Scranton Times-Tribune","tribune":false,"cluster":["republicanherald.com","standardspeaker.com","citizensvoice.com","wcexaminer.com"],"clusterName":"NEPA","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"1-800-228-4637","email":"customerservice@thetimes-tribune.com","address1":"305 Linden St.","address2":"Scranton, PA 18503","timeZone":"Eastern","supportHours":"Monday through Friday, 7 a.m. to 4 p.m.Sunday, 7 a.m. to 11 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/citizens-voice/id859248069","play_store":"https://play.google.com/store/apps/details?id=com.spreedinc.providers.timesshamrockcommunications.citizensvoice&hl=en_US"}]},"wcexaminer.com":{"code":"WCE","logo":"WCE_Logo.png","title":"Wyoming County Examiner","tribune":false,"cluster":["republicanherald.com","standardspeaker.com","thetimes-tribune.com","citizensvoice.com"],"clusterName":"NEPA","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"(570) 836-2123","email":"customerservice@wcexaminer.com","address1":"16 East Tioga St.","address2":"Tunkhannock, PA 18657","timeZone":"Eastern","supportHours":"Monday through Friday, 7 a.m. to 4 p.m.Sunday, 7 a.m. to 11 a.m."},"apps":[]},"pressdemocrat.com":{"code":"PD","logo":"PD_Logo.png","title":"The Press Democrat","tribune":false,"cluster":["sonomanews.com","petalumanews.com"],"clusterName":"PDNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"(707) 575-7500","email":"help@pressdemocrat.com","address1":"416 B Street","address2":"Santa Rosa, CA 95401","timeZone":"Pacific","supportHours":"Monday - Friday 7:00 a.m. - 5:00 p.m. \\\\n Saturday 7:00 a.m. - 10:30 a.m. \\\\n Sunday 7:30 a.m. - 10:30 a.m. \\\\n Holidays 7:30 a.m. - 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/the-press-democrat-eedition/id591168598","play_store":"https://play.google.com/store/apps/details?id=com.santarosapressdemocrat.android.prod"}]},"sonomanews.com":{"code":"SIT","logo":"SIT_Logo.png","title":"Sonoma Index-Tribune","tribune":false,"cluster":["pressdemocrat.com","petalumanews.com"],"clusterName":"PDNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"(707) 575-7500","email":"help@sonomanews.com","address1":"416 B Street","address2":"Santa Rosa, CA 95401","timeZone":"Pacific","supportHours":"Monday - Friday 7:00 a.m. - 5:00 p.m. \\\\n Saturday 7:00 a.m. - 10:30 a.m. \\\\n Sunday 7:30 a.m. - 10:30 a.m. \\\\n Holidays 7:30 a.m. - 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/the-sonoma-index-tribune/id959583528","play_store":"https://play.google.com/store/apps/details?id=com.sonomaindextribune.android.prod"}]},"petalumanews.com":{"code":"AC","logo":"AC_Logo.png","title":"Petaluma Argus Courier","tribune":false,"cluster":["pressdemocrat.com","sonomanews.com"],"clusterName":"PDNG","benefits":["e-Edition Archives","e-Edition","Account Sharing","Article Sharing","Ad-free Reading","Digital Access to 50+ Pubs","Home Delivery","Coupon & Inserts"],"customerService":{"phone":"(707) 575-7500","email":"help@arguscourier.com","address1":"416 B Street","address2":"Santa Rosa, CA 95401","timeZone":"Pacific","supportHours":"Monday - Friday 7:00 a.m. - 5:00 p.m. \\\\n Saturday 7:00 a.m. - 10:30 a.m. \\\\n Sunday 7:30 a.m. - 10:30 a.m. \\\\n Holidays 7:30 a.m. - 10:30 a.m."},"apps":[{"app_store":"https://apps.apple.com/us/app/petaluma-argus-courier/id787425680","play_store":"https://play.google.com/store/apps/details?id=com.petalumaarguscourier.android.prod"}]}}')}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e,t,o,r=n(467),i=n(4756),a=n(3153),s=n(3612),c=n(9532),l=n(2450),u={},d=window.location.hostname,p=l[d=d.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.","").replace("local","com").replace("vipdev.lndo.site","com")],h="https://ui-static-assets-prod.s3.us-west-1.amazonaws.com/img/",m=s.A.enableReaderDashboardv2?"/dashboard/support":"/user-tools/dashboard/#billing-payment-container",f='An error has occurred. Please try again.
\n\t
\n\tIf the issue persists,\n\tplease contact customer service.'),g=function(){var e=(0,r.A)(i.mark(function e(){var t,n,o,r,s;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a.A.log("Article Saving | init"),e.next=1,(0,c.gQ)();case 1:if("page"!==(n=e.sent)){e.next=2;break}return a.A.log("Article Saving | page type is not home, section, article, exit"),e.abrupt("return");case 2:return e.next=3,(0,c.aG)();case 3:if((o=e.sent).token&&o.adfree){e.next=4;break}return a.A.log("Article Saving | not a premium subscriber, exit"),e.abrupt("return");case 4:return e.next=5,S(o);case 5:if(null!==(u=JSON.parse(sessionStorage.getItem("articleIds")))&&null!==(t=u)&&void 0!==t&&t.timestamp){e.next=7;break}return u={},e.next=6,y();case 6:e.next=8;break;case 7:E(u.timestamp);case 8:if(a.A.log("Article Saving | page type is ",n),"article"===n){e.next=9;break}return a.A.log("Article Saving | page type is not article, exit"),e.abrupt("return");case 9:return a.A.log("Article Saving | page type is ",n),r=R,e.next=10,w();case 10:r(e.sent),e.next=12;break;case 11:throw e.prev=11,s=e.catch(0),a.A.error("Error during Article Saving initialization:",s),new Error("Article Saving initialization failed");case 12:case"end":return e.stop()}},e,null,[[0,11]])}));return function(){return e.apply(this,arguments)}}(),y=function(){var t=(0,r.A)(i.mark(function t(){var n,o,r,l,u;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a.A.log("Article Saving | session data expired or missing - fetch articles ",e),e){t.next=1;break}return a.A.log("Article Saving | unable to get decodedUser - exit fetch"),t.abrupt("return");case 1:return t.next=2,(0,c.L4)("Publisher Domain");case 2:return n=t.sent,o=encodeURIComponent(e.uuid),r="".concat(s.A.entitlementsEndpoint,"savedArticles/?authId=").concat(o,"&domain=").concat(n),t.next=3,fetch(r,{method:"GET",headers:{"X-Api-Key":s.A.entitlementsApiKey}});case 3:if(200!==(l=t.sent).status){t.next=5;break}return t.next=4,l.json();case 4:u=t.sent,A(u.articles),t.next=6;break;case 5:a.A.log("Article Saving | error in fetch");case 6:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),A=function(e){var t=new Date;u.timestamp=t.getTime(),u.articles=e,a.A.log("Article Saving | set session data ",u),sessionStorage.setItem("articleIds",JSON.stringify(u))},w=function(){var e=(0,r.A)(i.mark(function e(){var n,r,s,l,d,p,h;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.A.log("Article Saving | create button"),n=document.querySelector(".articleSave"),r=!0,null===n&&(r=!1,n=document.createElement("span")),s=document.querySelector("#articleSaveContainer"),l=document.querySelector("#stickyArticleSaveContainer"),s?s.replaceChildren():(s=document.createElement("div")).setAttribute("id","articleSaveContainer"),l?l.replaceChildren():(l=document.createElement("div")).setAttribute("id","stickyArticleSaveContainer"),e.next=1,(0,c.L4)("Content ID");case 1:return t=e.sent,o=u.articles.find(function(e){return e.contentId===t}),a.A.log("Article Saving | check if article already saved ",u,o),o?(n.className="icon-bookmark2 removeSavedArticleButton articleSave",n.setAttribute("aria-pressed","true"),n.setAttribute("data-mng-click","remove-article-saved"),n.setAttribute("data-mng-category","saved-articles"),n.setAttribute("data-mng-action","remove-article-saved"),n.setAttribute("aria-label","This article is saved. Click again to remove from your saved list"),n.setAttribute("title","This article is saved. Click again to remove from your saved list."),d="deleteArticle"):(n.className="icon-bookmark3 saveArticleButton articleSave",n.setAttribute("aria-pressed","false"),n.setAttribute("data-mng-click","save-article"),n.setAttribute("data-mng-category","saved-articles"),n.setAttribute("data-mng-action","save-article"),n.setAttribute("aria-label","Save this article to read later."),n.setAttribute("title","Save this article to read later."),d="saveArticle"),n.setAttribute("tabindex","0"),r||(p=document.querySelector(".article-bottom-share .sd-sharing-enabled"),h=document.querySelector(".article-share .sd-sharing-enabled"),s.append(n.cloneNode(!0)),l.append(n),p&&p.insertBefore(s,p.firstChild),h&&h.insertBefore(l,h.firstChild)),e.abrupt("return",d);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),b=function(){var n=(0,r.A)(i.mark(function n(){var o,r,l,d,m,g,y,v,S,E,O,C;return i.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(a.A.log("Article Saving | begin article save"),o=Array.from(document.querySelectorAll(".saveArticleButton")),e){n.next=1;break}return a.A.log("Article Saving | unable to get decodedUser - exit save"),(0,c.mP)({title:"Please try logging in again.",text:"",id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,buttonText:"OK!"}),n.abrupt("return",!1);case 1:if(!u){n.next=2;break}if(10!==u.articles.length){n.next=2;break}return a.A.log("Article Saving | reached max articles"),r=s.A.enableReaderDashboardv2?"/dashboard/saved-articles":"/user-tools/dashboard/#subscriber-benefits-container/?openOnLoad=ArticleSection",(0,c.mP)({title:"Out of Space",text:'You are out of space in your Saved Articles List.
\n\t\t\t\t
\n\t\t\t\tPlease remove articles from your list on the Reader Dashboard.'),id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,buttonText:"I'll do this later.",autoDismiss:!1,closeButtonIcon:!0}),n.abrupt("return",!1);case 2:return o.forEach(function(e){e.removeEventListener("click",b)}),_(".icon-bookmark3.saveArticleButton"),l="".concat(s.A.entitlementsEndpoint,"savedArticles"),n.next=3,(0,c.L4)("Publisher Domain");case 3:return d=n.sent,m={userId:e.uuid,publication:d,contentId:t},a.A.log("Article saving | attempting save the request is",m,l),n.prev=4,n.next=5,fetch(l,{method:"POST",headers:{"X-Api-Key":s.A.entitlementsApiKey},body:JSON.stringify(m)});case 5:return g=n.sent,n.next=6,g.json();case 6:if(y=n.sent,200!==g.status){n.next=8;break}return u&&A(y.upDatedArticleList),n.next=7,w();case 7:return v=n.sent,Array.from(document.querySelectorAll(".articleSave")).forEach(function(e){T(e,"article-save-click-success")}),R(v),a.A.log("Updated Saved Article list",y.upDatedArticleList.length),10===y.upDatedArticleList.length?(S=s.A.enableReaderDashboardv2?"/dashboard/saved-articles":"/user-tools/dashboard/#billing-payment-container?openOnLoad=ArticleSection",(0,c.mP)({title:"This article has been saved.",text:'This article has been saved.
\n\t\t\t\t\t
\n\t\t\t\t\tYou are now out of space in your\n\t\t\t\t\tSaved Articles list.\n\t\t\t\t\tYou will need to remove items from the list before you can add more.
\n\t\t\t\t\t
\n\t\t\t\t\tYou can save even more articles on our mobile app.\n\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t').concat(p.apps[0].play_store?"\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t"):"","\n\t\t\t\t\t\t\t").concat(p.apps[0].app_store?"\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t"):"","\n\t\t\t\t\t\t
\n\t\t\t\t\t
"),id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,buttonText:"I'll do this later.",autoDismiss:!1,closeButtonIcon:!0})):(0,c.mP)({title:"",text:"This article has been saved.",boldText:!0,id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,autoDismiss:!0,buttonText:"OK!"}),a.A.log("Article saving | Success! The response is",y),n.abrupt("return",y);case 8:if(422!==g.status){n.next=10;break}return a.A.log("Article Saving |reached max articles"),E=s.A.enableReaderDashboardv2?"/dashboard/saved-articles":"/user-tools/dashboard/#billing-payment-container/?openOnLoad=ArticleSection",(0,c.mP)({title:"Out of Space",text:'You are out of space in your Saved Articles List.
\n\t\t\t\t\t
\n\t\t\t\t\tPlease remove articles from your list on the Reader Dashboard.
\n\t\t\t\t\t
\n\t\t\t\t\tYou can save even more articles on our mobile app.\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t"),id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,buttonText:"I'll do this later.",autoDismiss:!1,closeButtonIcon:!0}),o.forEach(function(e){e.addEventListener("click",b)}),n.next=9,w();case 9:return O=n.sent,Array.from(document.querySelectorAll(".articleSave")).forEach(function(e){T(e,"article-save-422")}),R(O),n.abrupt("return",y);case 10:if(g.ok){n.next=11;break}return(0,c.mP)({title:"",text:f,id:"saveArticleModal",fullScreen:!1,appendToId:"page"}),Array.from(document.querySelectorAll(".articleSave")).forEach(function(e){e.setAttribute("data-mng-click","article-save-fail")}),o.forEach(function(e){e.addEventListener("click",b)}),a.A.log("Article saving | the response is",g.statusText),n.abrupt("return",y);case 11:return n.abrupt("return",!1);case 12:return n.prev=12,C=n.catch(4),(0,c.mP)({title:"",text:f,id:"saveArticleModal",fullScreen:!1,appendToId:"page"}),a.A.log("Article saving | save endpoint Failure: ",C),n.abrupt("return",new Error("Article saving | save article endpoint failure"));case 13:case"end":return n.stop()}},n,null,[[4,12]])}));return function(){return n.apply(this,arguments)}}(),v=function(){var t=(0,r.A)(i.mark(function t(){var n,r,l,d,p,h,m,g;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a.A.log("Article Saving | begin article delete"),document.querySelectorAll(".removeSavedArticleButton").forEach(function(e){e.removeEventListener("click",v)}),e){t.next=1;break}return a.A.log("Article Saving | unable to get decodedUser - exit save"),(0,c.mP)({title:"",text:"Please log in again.",boldText:!0,id:"saveArticleModal",fullScreen:!1,appendToId:"page"}),t.abrupt("return",!1);case 1:return n="".concat(s.A.entitlementsEndpoint,"savedArticles"),_(".icon-bookmark2.removeSavedArticleButton"),t.next=2,(0,c.L4)("Publisher Domain");case 2:return r=t.sent,l={userId:e.uuid,savedDate:o.savedDate,publication:r},a.A.log("Article saving | attempting delete the request is",l,n),t.prev=3,t.next=4,fetch(n,{method:"DELETE",headers:{"X-Api-Key":s.A.entitlementsApiKey},body:JSON.stringify(l)});case 4:return d=t.sent,t.next=5,d.json();case 5:if(p=t.sent,200!==d.status){t.next=7;break}return a.A.log("Article saving | delete success",p),u&&A(p.upDatedArticleList),h=R,t.next=6,w();case 6:return h(t.sent),(0,c.mP)({title:"",text:"This article has been removed from your Saved Articles list.",boldText:!0,id:"saveArticleModal",fullScreen:!1,appendToId:"page",closeConfirm:!0,buttonText:"OK!",autoDismiss:!0}),t.abrupt("return",p);case 7:if(d.ok){t.next=9;break}return(0,c.mP)({title:"",text:f,id:"saveArticleModal",fullScreen:!1,appendToId:"page"}),a.A.log("Article saving | delete ERROR the response is",d.statusText),m=R,t.next=8,w();case 8:return m(t.sent),t.abrupt("return",p);case 9:return t.abrupt("return",!1);case 10:return t.prev=10,g=t.catch(3),(0,c.mP)({title:"",text:f,id:"saveArticleModal",fullScreen:!1,appendToId:"page"}),a.A.log("Article saving | deleteArticle endpoint Failure: ",g),t.abrupt("return",new Error("Article saving | delete article endpoint failure"));case 11:case"end":return t.stop()}},t,null,[[3,10]])}));return function(){return t.apply(this,arguments)}}(),S=function(){var t=(0,r.A)(i.mark(function t(n){return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,(0,c.oL)(n.token);case 1:e=t.sent;case 2:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),E=function(e){a.A.log("Article Saving | checking time stamp, ",e);var t=(new Date-new Date(e))/6e4;a.A.log("Article Saving | time difference is ",t),t>3&&(a.A.log("Article Saving | session outdated, fetching"),y())},_=function(e){Array.from(document.querySelectorAll(e)).forEach(function(e){var t=document.createElement("div");t.classList.add("spring-spinner"),t.id="articleSaveSpinner",t.innerHTML='\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
',e.parentNode.replaceChild(t,e)})},T=function(e,t){e.setAttribute("data-mng-click",t),e.click(),e.removeAttribute("data-mng-click")},R=function(e){Array.from(document.querySelectorAll(".articleSave")).forEach(function(t){"saveArticle"===e?t.addEventListener("click",b):"deleteArticle"===e&&t.addEventListener("click",v)})};document.addEventListener("DOMContentLoaded",g)})()})(); //# sourceMappingURL=mng-digisubs.articleSave.bundle.js.map;