/*! For license information please see mng-digisubs.apple.bundle.js.LICENSE.txt */ (()=>{var e={7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],c=i[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),u=0,d=c>0?a-4:a;for(r=0;r>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[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 r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,r){for(var n,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,r){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,r)}function l(e,t,r){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 r=0|f(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){const t=new Uint8Array(e);return m(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 m(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||q(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(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,r);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|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n=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 r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-c),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},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;tr&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),l=this.slice(n,o),u=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,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 k(e,t,r,n,o){j(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function U(e,t,r,n,o){j(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function B(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,i){return t=+t,r>>>=0,i||B(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function x(e,t,r,n,i){return t=+t,r>>>=0,i||B(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(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||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(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||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||D(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||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,r){return e=+e,t>>>=0,r||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,r){return e=+e,t>>>=0,r||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,r){return e=+e,t>>>=0,r||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=$(function(e,t=0){return k(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,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=r-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+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||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,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||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,r){return e=+e,t>>>=0,r||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=$(function(e,t=0){return k(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,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function j(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function W(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new H.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?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,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=F(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=F(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+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,r,n,o){var i,a,s=8*o-n-1,c=(1<>1,u=-7,d=r?o-1:0,p=r?-1:1,m=e[t+d];for(d+=p,i=m&(1<<-u)-1,m>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;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*(m?-1:1);a+=Math.pow(2,n),i-=l}return(m?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,c,l=8*i-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,h=n?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,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+m]=255&s,m+=h,s/=256,o-=8);for(a=a<0;e[r+m]=255&a,m+=h,a/=256,l-=8);e[r+m-h]|=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,r){var n=r(5546);function o(){var t,r,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 u?o:u,c=Object.create(s.prototype);return n(c,"_invoke",function(e,n,o){var i,a,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,r){return i=e,a=0,s=t,p.n=r,l}};function m(e,n){for(a=e,s=n,r=0;!d&&c&&!o&&r3?(o=h===n)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=m&&((o=e<2&&mn||n>h)&&(i[4]=e,i[5]=n,p.n=h,a=0))}if(o||e>1)return l;throw d=!0,n}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,h),a=u,s=h;(r=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(p.n=-1),m(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(o="next"),r=i[o]){if(!(r=r.call(i,s)))throw TypeError("iterator result is not an object");if(!r.done)return r;s=r.value,a<2&&(a=0)}else 1===a&&(r=i.return)&&r.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((r=(d=p.n<0)?s:e.call(n,p))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:r,done:d}}}(e,i,a),!0),c}var l={};function u(){}function d(){}function p(){}r=Object.getPrototypeOf;var m=[][a]?r(r([][a]())):(n(r={},a,function(){return this}),r),h=p.prototype=u.prototype=Object.create(m);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,s,"GeneratorFunction")),e.prototype=Object.create(h),e}return d.prototype=p,n(h,"constructor",p),n(p,"constructor",d),d.displayName="GeneratorFunction",n(p,s,"GeneratorFunction"),n(h),n(h,s,"Generator"),n(h,a,function(){return this}),n(h,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},5869(e,t,r){var n=r(887);e.exports=function(e,t,r,o,i){var a=n(e,t,r,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,r){var n=r(6993),o=r(1791);e.exports=function(e,t,r,i,a){return new o(n().w(e,t,r,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791(e,t,r){var n=r(5172),o=r(5546);e.exports=function e(t,r){function i(e,o,a,s){try{var c=t[e](o),l=c.value;return l instanceof n?r.resolve(l.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):r.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||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,n){function o(){return new r(function(t,r){i(e,n,t,r)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},5546(e){function t(r,n,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){function i(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373(e){e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633(e,t,r){var n=r(5172),o=r(6993),i=r(5869),a=r(887),s=r(1791),c=r(4373),l=r(579);function u(){"use strict";var t=o(),r=t.m(u),d=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var m={throw:1,return:2,break:3,continue:3};function h(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,m[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,l(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=u=function(){return{wrap:function(e,r,n,o){return t.w(h(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:s,async:function(e,t,r,n,o){return(p(t)?a:i)(h(e),t,r,n,o)},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,r){var n=r(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},3738(e){function t(r){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(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756(e,t,r){var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},3612(e,t,r){"use strict";var n,o,i,a,s;r.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,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,enableDashboardBenefitHub:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardBenefitHub,enableEngageArticleGifting:"1"===(null===(n=window.authentication_config)||void 0===n?void 0:n.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}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,i){var a=e.apply(r,n);function s(e){t(a,o,i,s,c,"next",e)}function c(e){t(a,o,i,s,c,"throw",e)}s(void 0)})}}r.r(e),r.d(e,{hasBrowserEnv:()=>mi,hasStandardBrowserEnv:()=>fi,hasStandardBrowserWebWorkerEnv:()=>yi,navigator:()=>hi,origin:()=>gi});var o=r(4756);function i(e){return i="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},i(e)}function a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return atob(t)}}u.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;Error;var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{},m={},h={};Object.defineProperty(h,"__esModule",{value:!0});var f=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,r){var n=e.locked.get(t);void 0===n?void 0===r?e.locked.set(t,[]):e.locked.set(t,[r]):void 0!==r&&(n.unshift(r),e.locked.set(t,n))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(r,n){e.isLocked(t)?e.addToLocked(t,r):(e.addToLocked(t),r())})},this.unlock=function(t){var r=e.locked.get(t);if(void 0!==r&&0!==r.length){var n=r.pop();e.locked.set(t,r),void 0!==n&&setTimeout(n,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();h.default=function(){return f.getInstance()};var y=p&&p.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new r(function(t){t(e.value)}).then(a,s)}c((n=n.apply(e,t||[])).next())})},g=p&&p.__generator||function(e,t){var r,n,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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=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++,n=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(r,t):r(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return r.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 y(this,void 0,void 0,function(){return g(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 y(this,void 0,void 0,function(){var r,n,o,i;return g(this,function(a){switch(a.label){case 0:return r=void 0===this.storageHandler?b:this.storageHandler,n="browser-tabs-lock-key-"+t,null===(o=r.getItemSync(n))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,w.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),r.removeItemSync(n),w.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var r=Date.now()-5e3,n=t,o=[],i=0;;){var a=n.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;R=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const r=[];for(let n=0;n(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;re=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const r=[];for(let n=0;n{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw Y("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw Y("".concat(r," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw Y("".concat(r," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(n)throw se(e.message,n,o);throw e}}function me(e,t,r,n){try{if("string"!=typeof e)throw Y("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",n);if(0===e.length)throw Y("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",n)}catch(e){if(r)throw se(e.message,r,n);throw e}}function he(e){!function(e,t){if(Me(e)!==t)throw function(e){let t='"response" content-type must be ';for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o2){const e=n.pop();"".concat(n.join(", "),", or ").concat(e)}else 2===n.length?"".concat(n[0]," or ").concat(n[1]):n[0];return se(t,ot,e)}(e,t)}(e,"application/json")}function fe(){return oe(crypto.getRandomValues(new Uint8Array(32)))}function ye(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 ie("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 ie("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 ie("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 ie("unsupported CryptoKey algorithm name",{cause:e})}}function ge(e){const t=null==e?void 0:e[V];return"number"==typeof t&&Number.isFinite(t)?t:0}function Ae(e){const t=null==e?void 0:e[J];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function we(){return Math.floor(Date.now()/1e3)}function be(e){if("object"!=typeof e||null===e)throw Y('"as" must be an object',"ERR_INVALID_ARG_TYPE");me(e.issuer,'"as.issuer"')}function Se(e){if("object"!=typeof e||null===e)throw Y('"client" must be an object',"ERR_INVALID_ARG_TYPE");me(e.client_id,'"client.client_id"')}function ve(e){return me(e,'"clientSecret"'),(t,r,n,o)=>{n.set("client_id",r.client_id),n.set("client_secret",e)}}function Ee(e,t){const{key:r,kid:n}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&me(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Y("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw Y("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(r,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:ye(r),kid:n},l=function(e,t){const r=we()+ge(t);return{jti:fe(),aud:e.issuer,exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[q]||void 0===s||s.call(t,c,l),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,r){if(!r.usages.includes("sign"))throw Y('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const n="".concat(oe(te(JSON.stringify(e))),".").concat(oe(te(JSON.stringify(t)))),o=oe(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:ft(e)};case"RSA-PSS":switch(ht(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 ie("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return ht(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new ie("unsupported CryptoKey algorithm name",{cause:e})}(r),r,te(n)));return"".concat(n,".").concat(o)}(c,l,r))}}const Re=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Te(e,t){if(t&&"https:"!==e.protocol)throw se("only requests to HTTPS are allowed",at,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw se("only HTTP and HTTPS requests are allowed",st,e)}function Pe(e,t,r,n){let o;if("string"!=typeof e||!Re(e))throw se("authorization server metadata does not contain a valid ".concat(r?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?dt:pt,{attribute:r?"mtls_endpoint_aliases.".concat(t):t});return Te(o,n),o}function _e(e,t,r,n){return r&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Pe(e.mtls_endpoint_aliases[t],t,r,n):Pe(e[t],t,r,n)}class Ie extends Error{constructor(e,t){var r;super(e,t),B(this,"cause",void 0),B(this,"code",void 0),B(this,"error",void 0),B(this,"status",void 0),B(this,"error_description",void 0),B(this,"response",void 0),this.name=this.constructor.name,this.code=Qe,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===r||r.call(Error,this,this.constructor)}}class Oe extends Error{constructor(e,t){var r,n;super(e,t),B(this,"cause",void 0),B(this,"code",void 0),B(this,"error",void 0),B(this,"error_description",void 0),this.name=this.constructor.name,this.code=tt,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==t.cause.get("error_description")&&void 0!==r?r:void 0,null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}class Ne extends Error{constructor(e,t){var r;super(e,t),B(this,"cause",void 0),B(this,"code",void 0),B(this,"response",void 0),B(this,"status",void 0),this.name=this.constructor.name,this.code=$e,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===Error.captureStackTrace||void 0===r||r.call(Error,this,this.constructor)}}const Ce=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),De=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),Le=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),ke=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Ue(e,t,r){if(e.status!==t){let t;var n;if(function(e){let t;if(function(e){if(!K(e,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const t=e.headers.get("www-authenticate");if(null===t)return;const r=[];let n=t;for(;n;){var o;let t=n.match(Ce);const i=null===t||void 0===o?void 0:o[1].toLowerCase();if(!i)return;const a=n.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;s?s[1]:void 0;const l={};let u;if(c)for(;n;){let r,o;if(n.match(De)){if([,r,o,n]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}l[r.toLowerCase()]=o}else{if(!n.match(Le)){if(n.match(ke)){if(Object.keys(l).length)break;[,u,n]=t;break}return}[,r,o,n]=t,l[r.toLowerCase()]=o}}else 0;const d={scheme:i,parameters:l};u&&(d.token68=u),r.push(d)}return r.length?r:void 0}(e))throw new Ne("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){mt(e),he(e);try{const t=await e.clone().json();if(ce(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===e.body||void 0===n?void 0:n.cancel()),new Ie("server responded with an error in the response body",{cause:t,response:e});throw se('"response" is not a conform '.concat(r," response (unexpected HTTP status code)"),it,e)}}function Be(e){if(!Xe.has(e))throw Y('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function Me(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function xe(e,t,r,n,o,i,a){return await r(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[z])||fetch)(n.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:ue(n,null==a?void 0:a.signal)})}async function He(e,t,r,n,o,i){var a;const s=_e(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[X]));o.set("grant_type",n);const c=le(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(Be(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const l=await xe(e,t,r,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(l,s),l}const Ge=new WeakMap,Fe=new WeakMap;function je(e){if(!e.id_token)return;const t=Ge.get(e);if(!t)throw Y('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function We(e,t,r,n,o,i){if(be(e),Se(t),!K(r,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Ue(r,200,"Token Endpoint"),mt(r);const a=await bt(r);if(me(a.access_token,'"response" body "access_token" property',nt,{body:a}),me(a.token_type,'"response" body "token_type" property',nt,{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;pe(e,!0,'"response" body "expires_in" property',nt,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&me(a.refresh_token,'"response" body "refresh_token" property',nt,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw se('"response" body "scope" property must be a string',nt,{body:a});if(void 0!==a.id_token){me(a.id_token,'"response" body "id_token" property',nt,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(pe(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=n&&n.length&&i.push(...n);const{claims:s,jwt:c}=await async function(e,t,r,n,o){let i,a,{0:s,1:c,length:l}=e.split(".");if(5===l){if(void 0===o)throw new ie("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:l}=e.split("."))}if(3!==l)throw se("Invalid JWT",nt,e);try{JSON.parse(te(oe(s)))}catch(e){throw se("failed to parse JWT Header body as base64url encoded JSON",rt,e)}if(!ce(i))throw se("JWT Header must be a top level object",nt,e);if(t(i),void 0!==i.crit)throw new ie('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(te(oe(c)))}catch(e){throw se("failed to parse JWT Payload body as base64url encoded JSON",rt,e)}if(!ce(a))throw se("JWT Payload must be a top level object",nt,e);const u=we()+r;if(void 0!==a.exp){if("number"!=typeof a.exp)throw se('unexpected JWT "exp" (expiration time) claim type',nt,{claims:a});if(a.exp<=u-n)throw se('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',ct,{claims:a,now:u,tolerance:n,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw se('unexpected JWT "iat" (issued at) claim type',nt,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw se('unexpected JWT "iss" (issuer) claim type',nt,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw se('unexpected JWT "nbf" (not before) claim type',nt,{claims:a});if(a.nbf>u+n)throw se('unexpected JWT "nbf" (not before) claim value',ct,{claims:a,now:u,tolerance:n,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw se('unexpected JWT "aud" (audience) claim type',nt,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,yt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),ge(t),Ae(t),o).then(ze.bind(void 0,i)).then(Ye.bind(void 0,e)).then(Ke.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw se('ID Token "aud" (audience) claim includes additional untrusted audiences',lt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw se('unexpected ID Token "azp" (authorized party) claim value',lt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&pe(s.auth_time,!0,'ID Token "auth_time" (authentication time)',nt,{claims:s}),Fe.set(r,c),Ge.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](r,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new ie("unsupported `token_type` value",{cause:{body:a}});return a}function Ke(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw se('unexpected JWT "aud" (audience) claim value',lt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw se('unexpected JWT "aud" (audience) claim value',lt,{expected:e,claims:t.claims,claim:"aud"});return t}function Ye(e,t){var r,n;const o=null!==(null===e[vt]||void 0===n?void 0:n.call(e,t))&&void 0!==r?r:e.issuer;if(t.claims.iss!==o)throw se('unexpected JWT "iss" (issuer) claim value',lt,{expected:o,claims:t.claims,claim:"iss"});return t}const Xe=new WeakSet,Ve=Symbol(),Je={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 ze(e,t){for(const r of e)if(void 0===t.claims[r])throw se('JWT "'.concat(r,'" (').concat(Je[r],") claim missing"),nt,{claims:t.claims});return t}const qe=Symbol(),Ze=Symbol();const $e="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Qe="OAUTH_RESPONSE_BODY_ERROR",et="OAUTH_UNSUPPORTED_OPERATION",tt="OAUTH_AUTHORIZATION_RESPONSE_ERROR",rt="OAUTH_PARSE_ERROR",nt="OAUTH_INVALID_RESPONSE",ot="OAUTH_RESPONSE_IS_NOT_JSON",it="OAUTH_RESPONSE_IS_NOT_CONFORM",at="OAUTH_HTTP_REQUEST_FORBIDDEN",st="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",ct="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",lt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",ut="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",dt="OAUTH_MISSING_SERVER_METADATA",pt="OAUTH_INVALID_SERVER_METADATA";function mt(e){if(e.bodyUsed)throw Y('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function ht(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new ie("unsupported ".concat(t.name," modulusLength"),{cause:e})}function ft(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 ie("unsupported ECDSA namedCurve",{cause:e})}}function yt(e,t,r,n){if(void 0===e)if(Array.isArray(t)){if(!t.includes(n.alg))throw se('unexpected JWT "alg" header parameter',nt,{header:n,expected:t,reason:"authorization server metadata"})}else{if(void 0===r)throw se('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:r});if("string"==typeof r?n.alg!==r:"function"==typeof r?!r(n.alg):!r.includes(n.alg))throw se('unexpected JWT "alg" header parameter',nt,{header:n,expected:r,reason:"default value"})}else if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw se('unexpected JWT "alg" header parameter',nt,{header:n,expected:e,reason:"client configuration"})}function gt(e,t){const{0:r,length:n}=e.getAll(t);if(n>1)throw se('"'.concat(t,'" parameter must be provided only once'),nt);return r}const At=Symbol(),wt=Symbol();async function bt(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:he;try{await e.json()}catch(t){throw r(e),se('failed to parse "response" body as JSON',rt,t)}if(!ce(t))throw se('"response" body must be a top level object',nt,{body:t});return t}const St=Symbol(),vt=Symbol(),Et=new TextEncoder,Rt=new TextDecoder;function Tt(e){const t=new Uint8Array(e.length);for(let r=0;r127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function Pt(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:"unspecified",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:n,payload:t}}),B(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),B(this,"claim",void 0),B(this,"reason",void 0),B(this,"payload",void 0),this.claim=r,this.reason=n,this.payload=t}}B(Ot,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Nt extends It{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:r,reason:n,payload:t}}),B(this,"code","ERR_JWT_EXPIRED"),B(this,"claim",void 0),B(this,"reason",void 0),B(this,"payload",void 0),this.claim=r,this.reason=n,this.payload=t}}B(Nt,"code","ERR_JWT_EXPIRED");class Ct extends It{constructor(){super(...arguments),B(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}B(Ct,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Dt extends It{constructor(){super(...arguments),B(this,"code","ERR_JOSE_NOT_SUPPORTED")}}B(Dt,"code","ERR_JOSE_NOT_SUPPORTED"),B(class extends It{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),B(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),B(class extends It{constructor(){super(...arguments),B(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Lt extends It{constructor(){super(...arguments),B(this,"code","ERR_JWS_INVALID")}}B(Lt,"code","ERR_JWS_INVALID");class kt extends It{constructor(){super(...arguments),B(this,"code","ERR_JWT_INVALID")}}B(kt,"code","ERR_JWT_INVALID"),B(class extends It{constructor(){super(...arguments),B(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Ut extends It{constructor(){super(...arguments),B(this,"code","ERR_JWKS_INVALID")}}B(Ut,"code","ERR_JWKS_INVALID");class Bt extends It{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),B(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}B(Bt,"code","ERR_JWKS_NO_MATCHING_KEY");class Mt extends It{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),B(this,Symbol.asyncIterator,void 0),B(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}B(Mt,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class xt extends It{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),B(this,"code","ERR_JWKS_TIMEOUT")}}B(xt,"code","ERR_JWKS_TIMEOUT");class Ht extends It{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),B(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}B(Ht,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Gt=function(e){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},Ft=(e,t)=>e.name===t;function jt(e){return parseInt(e.name.slice(4),10)}function Wt(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o2){const t=n.pop();e+="one of type ".concat(n.join(", "),", or ").concat(t,".")}else 2===n.length?e+="one of type ".concat(n[0]," or ").concat(n[1],"."):e+="of type ".concat(n[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 Kt=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},Xt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),Vt=e=>Yt(e)||Xt(e);function Jt(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 r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const zt=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r{const t=e.data[e.pos++];if(128&t){const r=127&t;let n=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(r)},$t=(e,t)=>{const r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},Qt=(e,t,r)=>{var n;const o=(e=>Pt(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=r;return null!=t&&null!==(n=t.startsWith)&&void 0!==n&&n.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){Zt(e,48,"Invalid PKCS#8 structure"),qt(e),Zt(e,2,"Expected version field");const t=qt(e);e.pos+=t,Zt(e,48,"Expected algorithm identifier");qt(e);e.pos}(t),(e=>{const t=(e=>{Zt(e,6,"Expected algorithm OID");const t=qt(e);return $t(e,t)})(e);if(zt(t,[43,101,110]))return"X25519";if(!zt(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Zt(e,6,"Expected curve OID");const r=qt(e),n=$t(e,r);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(zt(n,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,r,n)=>{var o;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(r.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(r.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(r.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"}[r]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=n.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new Dt("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:r},a=c();break;default:throw new Dt('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(o=null==n?void 0:n.extractable)&&void 0!==o?o:!!s,a)})("pkcs8",o,t,i)};async function er(e){var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(e.alg.slice(-3),10)||1)},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Dt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Dt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),i=x({},e);return"AKP"!==i.kty&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,n,null!==(t=e.ext)&&void 0!==t?t:!e.d&&!e.priv,null!==(r=e.key_ops)&&void 0!==r?r:o)}const tr=e=>Jt(e)&&"string"==typeof e.kty;let rr;const nr=async function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];rr||(rr=new WeakMap);let o=rr.get(e);if(null!=o&&o[r])return o[r];const i=await er(x(x({},t),{},{alg:r}));return n&&Object.freeze(e),o?o[r]=i:rr.set(e,{[r]:i}),i};const or=e=>null==e?void 0:e[Symbol.toStringTag],ir=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){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 n,o;let i;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):i=r;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===r:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(n=t.key_ops)||void 0===n||null===(o=n.includes)||void 0===o?void 0:o.call(n,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var ar,sr;let cr,lr;if("undefined"==typeof navigator||null===(ar=navigator.userAgent)||void 0===ar||null===(sr=ar.startsWith)||void 0===sr||!sr.call(ar,"Mozilla/5.0 ")){const e="v6.8.1";lr="".concat("openid-client","/").concat(e),cr={"user-agent":lr}}const ur=e=>dr.get(e);let dr,pr;function mr(e){return void 0!==e?ve(e):(pr||(pr=new WeakMap),(e,t,r,n)=>{let o;return(o=pr.get(t))||(function(e,t){if("string"!=typeof e)throw gr("".concat(t," must be a string"),yr);if(0===e.length)throw gr("".concat(t," must not be empty"),fr)}(t.client_secret,'"metadata.client_secret"'),o=ve(t.client_secret),pr.set(t,o)),o(e,t,r,n)})}const hr=z,fr="ERR_INVALID_ARG_VALUE",yr="ERR_INVALID_ARG_TYPE";function gr(e,t,r){const n=new TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}class Ar extends Error{constructor(e,t){var r;super(e,t),B(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===Error.captureStackTrace||void 0===r||r.call(Error,this,this.constructor)}}function wr(e,t,r){return new Ar(e,{cause:t,code:r})}function br(e){if(e instanceof TypeError||e instanceof Ar||e instanceof Ie||e instanceof Oe||e instanceof Ne)throw e;if(e instanceof ae)switch(e.code){case at:throw wr("only requests to HTTPS are allowed",e,e.code);case st:throw wr("only requests to HTTP or HTTPS are allowed",e,e.code);case it:throw wr("unexpected HTTP response status code",e.cause,e.code);case ot:throw wr("unexpected response content-type",e.cause,e.code);case rt:throw wr("parsing error occured",e,e.code);case nt:throw wr("invalid response encountered",e,e.code);case lt:throw wr("unexpected JWT claim value encountered",e,e.code);case ut:throw wr("unexpected JSON attribute value encountered",e,e.code);case ct:throw wr("JWT timestamp claim value failed validation",e,e.code);default:throw wr(e.message,e,e.code)}if(e instanceof ie)throw wr("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw wr("runtime operation error",e,et);case"NotSupportedError":throw wr("runtime unsupported operation",e,et);case"TimeoutError":throw wr("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw wr("operation aborted",e,"OAUTH_ABORT")}throw new Ar("something went wrong",{cause:e})}async function Sr(e,t,r,n,o){const i=await async function(e,t){var r,n;if(!(e instanceof URL))throw gr('"server" must be an instance of URL',yr);const o=!e.href.includes("/.well-known/"),i=null!==(null==t?void 0:t.timeout)&&void 0!==r?r:30,a=AbortSignal.timeout(1e3*i),s=await(o?async function(e,t){return async function(e,t,r,n){if(!(e instanceof URL))throw Y('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");Te(e,!0!==(null==n?void 0:n[X]));const o=r(new URL(e.href)),i=le(null==n?void 0:n.headers);return i.set("accept","application/json"),((null==n?void 0:n[z])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:ue(o,null==n?void 0:n.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=de("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=de("".concat(t,"/").concat(r?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Y('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[z]:null==t?void 0:t[hr],[X]:null==t||null===t.execute||void 0===n?void 0:n.includes(Or),signal:a,headers:new Headers(cr)}):((null==t?void 0:t[hr])||fetch)((Te(e,null==t||null===t.execute||void 0===c||!c.includes(Or)),e.href),{headers:Object.fromEntries(new Headers(x({accept:"application/json"},cr)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const r=e;if(!(r instanceof URL)&&r!==St)throw Y('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!K(t,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(200!==t.status)throw se('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',it,t);mt(t);const n=await bt(t);if(me(n.issuer,'"response" body "issuer" property',nt,{body:n}),r!==St&&new URL(n.issuer).href!==r.href)throw se('"response" body "issuer" property does not match the expected value',ut,{expected:r.href,body:n,attribute:"issuer"});return n}(St,e)).catch(br);var c;return o&&new URL(s.issuer).href!==e.href&&(function(e,t,r){return!("https://login.microsoftonline.com"!==e.origin||null!=r&&r.algorithm&&"oidc"!==r.algorithm||(t[vr]=!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 Ar("discovered metadata issuer does not match the expected issuer",{code:ut,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Er(i,t,r,n);let s=ur(a);if(null!=o&&o[hr]&&(s.fetch=o[hr]),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 vr=Symbol();class Er{constructor(e,t,r,n){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw gr('"clientId" must be a non-empty string',yr);if("string"==typeof r&&(r={client_secret:r}),void 0!==(null===(o=r)||void 0===o?void 0:o.client_id)&&t!==r.client_id)throw gr('"clientId" and "metadata.client_id" must be the same',fr);const l=x(x({},structuredClone(r)),{},{client_id:t});let u;l[V]=null!==(i=null===(a=r)||void 0===a?void 0:a[V])&&void 0!==i?i:0,l[J]=null!==(s=null===(c=r)||void 0===c?void 0:c[J])&&void 0!==s?s:30,u=n||("string"==typeof l.client_secret&&l.client_secret.length?mr(l.client_secret):(e,t,r,n)=>{r.set("client_id",t.client_id)});let d=Object.freeze(l);const p=structuredClone(e);vr in e&&(p[vt]=t=>{let{claims:{tid:r}}=t;return e.issuer.replace("{tenantid}",r)});let m=Object.freeze(p);dr||(dr=new WeakMap),dr.set(this,{__proto__:null,as:m,c:d,auth:u,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(ur(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let r=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(r))}}}}(e))}(e),e}clientMetadata(){return structuredClone(ur(this).c)}get timeout(){return ur(this).timeout}set timeout(e){ur(this).timeout=e}get[hr](){return ur(this).fetch}set[hr](e){ur(this).fetch=e}}function Rr(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 je(this)}catch(e){return}}}}}(e))}async function Tr(e,t,r){var n;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===e.headers.get("retry-after")||void 0===n?void 0:n.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,r=e.getTime()-t.getTime();r>0&&Math.ceil(r/1e3)}}if(o&&!Number.isFinite(a))throw new ae("invalid Retry-After header value",{cause:e});a>t&&await Pr(a-t,r)}function Pr(e,t){return new Promise((r,n)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void n(e)}if(e<=0)return void r();const i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function _r(e,t){Ur(e);const{as:r,c:n,auth:o,fetch:i,tlsOnly:a,timeout:s}=ur(e);return async function(e,t,r,n,o){be(e),Se(t);const i=_e(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[X])),a=new URLSearchParams(n);a.set("client_id",t.client_id);const s=le(null==o?void 0:o.headers);return s.set("accept","application/json"),xe(e,t,r,i,a,s,o)}(r,n,o,t,{[z]:i,[X]:!a,headers:new Headers(cr),signal:Br(s)}).then(e=>async function(e,t,r){if(be(e),Se(t),!K(r,Response))throw Y('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Ue(r,200,"Backchannel Authentication Endpoint"),mt(r);const n=await bt(r);me(n.auth_req_id,'"response" body "auth_req_id" property',nt,{body:n});let o="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return pe(o,!0,'"response" body "expires_in" property',nt,{body:n}),n.expires_in=o,void 0!==n.interval&&pe(n.interval,!1,'"response" body "interval" property',nt,{body:n}),n}(r,n,e)).catch(br)}async function Ir(e,t,r,n){var o,i;Ur(e),new URLSearchParams(r);let a=null!==t.interval&&void 0!==o?o:5;const s=null!==(null==n?void 0:n.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await Pr(a,s)}catch(e){br(e)}const{as:c,c:l,auth:u,fetch:d,tlsOnly:p,nonRepudiation:m,timeout:h,decrypt:f}=ur(e),y=(o,i)=>Ir(e,x(x({},t),{},{interval:o}),r,x(x({},n),{},{signal:s,flag:i})),g=await async function(e,t,r,n,o){be(e),Se(t),me(n,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",n),He(e,t,r,"urn:openid:params:grant-type:ciba",i,o)}(c,l,u,t.auth_req_id,{[z]:d,[X]:!p,additionalParameters:r,DPoP:null==n?void 0:n.DPoP,headers:new Headers(cr),signal:s.aborted?s:Br(h)}).catch(br);var A;if(503===g.status&&g.headers.has("retry-after"))return await Tr(g,a,s,!0),await(null===g.body||void 0===A?void 0:A.cancel()),y(a);const w=async function(e,t,r,n){return We(e,t,r,void 0,null==n?void 0:n[Z],null==n?void 0:n.recognizedTokenTypes)}(c,l,g,{[Z]:f});let b;try{await w}catch(e){if(Mr(e,n))return y(a,xr);if(e instanceof Ie)switch(e.error){case"slow_down":0;case"authorization_pending":return await Tr(e.response,a,s),y(a)}br(e)}return b.id_token&&await(null==m?void 0:m(g)),Rr(b),b}function Or(e){ur(e).tlsOnly=!1}async function Nr(e,t,r,n,o){if(Ur(e),!((null==o?void 0:o.flag)===xr||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw gr('"currentUrl" must be an instance of URL, or Request',yr);let i,a;const{as:s,c,auth:l,fetch:u,tlsOnly:d,jarm:p,hybrid:m,nonRepudiation:h,timeout:f,decrypt:y,implicit:g}=ur(e);if((null==o?void 0:o.flag)===xr)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 r=new URLSearchParams(await async function(e){if("POST"!==e.method)throw Y("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==Me(e))throw Y("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(e){if(e.bodyUsed)throw Y("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:e});return e.text()}(e)}(e));if(m)t.hash=r.toString();else for(const[e,n]of r.entries())t.searchParams.append(e,n);break;default:throw gr("unexpected Request HTTP method",fr)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!p:await p(t,null==r?void 0:r.expectedState);break;case!!m:await m(t,null==r?void 0:r.expectedNonce,null==r?void 0:r.expectedState,null==r?void 0:r.maxAge);break;case!!g:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,r,n){if(be(e),Se(t),r instanceof URL&&r.searchParams,!(r instanceof URLSearchParams))throw Y('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(gt(r,"response"))throw se('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',nt,{parameters:r});const o=gt(r,"iss"),i=gt(r,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw se('response parameter "iss" (issuer) missing',nt,{parameters:r});if(o&&o!==e.issuer)throw se('unexpected "iss" (issuer) response parameter value',nt,{expected:e.issuer,parameters:r});switch(n){case void 0:case wt:if(void 0!==i)throw se('unexpected "state" response parameter encountered',nt,{expected:void 0,parameters:r});break;case At:break;default:if(me(n,'"expectedState" argument'),i!==n)throw se(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',nt,{expected:n,parameters:r})}if(gt(r,"error"))throw new Oe("authorization response from the server is an error",{cause:r});const a=gt(r,"id_token"),s=gt(r,"token");if(void 0!==a||void 0!==s)throw new ie("implicit and hybrid flows are not supported");return new URLSearchParams(r),Xe.add(c),c;var c})(s,c,t.searchParams,null==r?void 0:r.expectedState)}catch(e){br(e)}}}const A=await async function(e,t,r,n,o,i,a){if(be(e),Se(t),!Xe.has(n))throw Y('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");me(o,'"redirectUri"');const s=gt(n,"code");if(!s)throw se('no authorization code in "callbackParameters"',nt);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==Ve&&(me(i,'"codeVerifier"'),c.set("code_verifier",i)),He(e,t,r,"authorization_code",c,a)}(s,c,l,i,a,(null==r?void 0:r.pkceCodeVerifier)||Ve,{additionalParameters:n,[z]:u,[X]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(cr),signal:Br(f)}).catch(br);"string"!=typeof(null==r?void 0:r.expectedNonce)&&"number"!=typeof(null==r?void 0:r.maxAge)||(r.idTokenExpected=!0);const w=async function(e,t,r,n){return"string"==typeof(null==n?void 0:n.expectedNonce)||"number"==typeof(null==n?void 0:n.maxAge)||null!=n&&n.requireIdToken?async function(e,t,r,n,o,i,a){const s=[];switch(n){case void 0:0;break;case qe:break;default:me(n,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case Ze:break;default:pe(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await We(e,t,r,s,i,a);me(c.id_token,'"response" body "id_token" property',nt,{body:c});const l=je(c);if(o!==Ze){const e=we()+ge(t),r=Ae(t);if(l.auth_time+o{let r;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&{n_a:()=>{}},async function(e,t,r,n){return We(e,t,r,void 0,null==n?void 0:n[Z],null==n?void 0:n.recognizedTokenTypes)}(o,i,e,{[Z]:u,recognizedTokenTypes:r})}).catch(br);return Rr(d),d}async function Gr(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;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!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!i.has(t))throw new Dt('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===n[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(n.crit)}(Lt,new Map([["b64",!0]]),null==r?void 0:r.crit,n,o);let a=!0;if(i.has("b64")&&(n.b64,"boolean"!=typeof a))throw new Lt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Lt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&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,r.algorithms);if(c&&!c.has(s))throw new Ct('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Lt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Lt("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t&&(await t(n,e),!0),function(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if(tr(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&ir(e,t,r))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(!Vt(t))throw new TypeError(Kt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(or(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,r);break;default:((e,t,r)=>{if(tr(t))switch(r){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&ir(e,t,r))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)&&ir(e,t,r))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Vt(t))throw new TypeError(Kt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(or(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(r){case"sign":throw new TypeError("".concat(or(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(or(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(r){case"verify":throw new TypeError("".concat(or(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(or(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,r)}}(s,t,"verify");const u=function(){for(var e=arguments.length,t=new Array(e),r=0;r{let{length:r}=t;return e+r},0),o=new Uint8Array(n);let i=0;for(const e of t)o.set(e,i),e.length;return o}(void 0!==e.protected?Tt(e.protected):new Uint8Array,Tt("."),"string"==typeof e.payload?a?Tt(e.payload):Et.encode(e.payload):e.payload);let d;try{_t(e.signature)}catch(e){throw new Lt("Failed to base64url decode the signature")}const p=await async function(e,t){if(e instanceof Uint8Array)return e;if(Yt(e))return e;if(Xt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{rr||(rr=new WeakMap);let r=rr.get(e);if(null!=r&&r[t])return r[t];const n="public"===e.type,o=!!n;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("given KeyObject instance cannot be used for this algorithm")}e.toCryptoKey(e.asymmetricKeyType,o,n?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError("given KeyObject instance cannot be used for this algorithm");e.toCryptoKey(e.asymmetricKeyType,o,[n?"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("given KeyObject instance cannot be used for this algorithm");e.toCryptoKey(e.asymmetricKeyType,o,[n?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let r;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("given KeyObject instance cannot be used for this algorithm")}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:r},o,n?["encrypt"]:["decrypt"]);e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:r},o,[n?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const r=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===e.asymmetricKeyDetails||void 0===a?void 0:a.namedCurve);if(!r)throw new TypeError("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),"ES384"===t&&"P-384"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),"ES512"===t&&"P-521"===r&&e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[n?"verify":"sign"]),t.startsWith("ECDH-ES")&&e.toCryptoKey({name:"ECDH",namedCurve:r},o,n?[]:["deriveBits"])}if(!i)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return r?r[t]=i:rr.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return nr(e,r,t)}if(tr(e))return e.k?_t(e.k):nr(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,r,n){const o=await Gr(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,o);const i=function(e,t){const r="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,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 Dt("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,r,n)}catch(e){return!1}}(s,p,d,u))throw new Ht;let m;if(a)try{_t(e.payload)}catch(e){throw new Lt("Failed to base64url decode the payload")}else"string"==typeof e.payload?Et.encode(e.payload):e.payload;const h={payload:m};return void 0!==e.protected&&(h.protectedHeader=n),void 0!==e.header&&(h.unprotectedHeader=e.header),l?x(x({},h),{},{key:p}):h}const jr=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Wr(e){const t=jr.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const r=parseFloat(t[2]);let n;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":Math.round(60*r);break;case"hour":case"hours":case"hr":case"hrs":case"h":Math.round(3600*r);break;case"day":case"days":case"d":Math.round(86400*r);break;case"week":case"weeks":case"w":Math.round(604800*r);break;default:Math.round(31557600*r)}return"-"===t[1]||"ago"===t[4]?-n:n}const Kr=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function Yr(e,t,r){var n;const o=await async function(e,t,r){if(e instanceof Uint8Array&&Rt.decode(e),"string"!=typeof e)throw new Lt("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new Lt("Invalid Compact JWS");const s=await Fr({payload:o,protected:n,signature:i},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?x(x({},c),{},{key:s.key}):c}(e,t,r);if(null!==o.protectedHeader.crit&&void 0!==n&&n.includes("b64")&&!1===o.protectedHeader.b64)throw new kt("JWTs MUST NOT use unencoded payload");const i=function(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Rt.decode(t))}catch(e){}if(!Jt(r))throw new kt("JWT Claims Set must be a top-level JSON object");const{typ:o}=n;if(o&&("string"!=typeof e.typ||Kr(e.typ)!==Kr(o)))throw new Ot('unexpected "typ" JWT header value',r,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:l}=n,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 r))throw new Ot('missing required "'.concat(e,'" claim'),r,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(r.iss))throw new Ot('unexpected "iss" claim value',r,"iss","check_failed");if(s&&r.sub!==s)throw new Ot('unexpected "sub" claim value',r,"sub","check_failed");if(c&&!((e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))))(r.aud,"string"==typeof c?[c]:c))throw new Ot('unexpected "aud" claim value',r,"aud","check_failed");let d;switch(typeof n.clockTolerance){case"string":Wr(n.clockTolerance);break;case"number":n.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:p}=n,m=(e=>Math.floor(e.getTime()/1e3))(p||new Date);if((void 0!==r.iat||l)&&"number"!=typeof r.iat)throw new Ot('"iat" claim must be a number',r,"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new Ot('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+d)throw new Ot('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new Ot('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-d)throw new Nt('"exp" claim timestamp check failed',r,"exp","check_failed")}if(l){const e=m-r.iat;if(e-d>("number"==typeof l?l:Wr(l)))throw new Nt('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(e<0-d)throw new Ot('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r}(o.protectedHeader,o.payload,r),a={payload:i,protectedHeader:o.protectedHeader};return"function"==typeof t?x(x({},a),{},{key:o.key}):a}function Xr(e){return Jt(e)}var Vr,Jr,zr=new WeakMap,qr=new WeakMap;class Zr{constructor(e){if(k(this,zr,void 0),k(this,qr,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Xr)}(e))throw new Ut("JSON Web Key Set malformed");U(zr,this,structuredClone(e))}jwks(){return L(zr,this)}async getKey(e,t){const{alg:r,kid:n}=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 Dt('Unsupported "alg" value for a JSON Web Key Set')}}(r),i=L(zr,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof n&&n===e.kid,!t||"string"!=typeof e.alg&&"AKP"!==o||r===e.alg,t&&"string"==typeof e.use&&"sig"===e.use,t&&Array.isArray(e.key_ops)&&e.key_ops.includes("verify"),t)switch(r){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 Bt;if(1!==s){const e=new Mt,t=L(qr,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new G(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield C($r(t,e,r))}catch(e){}}),e}return $r(L(qr,this),a,r)}}async function $r(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await async function(e,t){if(!Jt(e))throw new TypeError("JWK must be an object");let r;switch(null!=t||e.alg,null!=r||e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return _t(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Dt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return er(x(x({},e),{},{alg:t,ext:r}));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 er(x(x({},e),{},{ext:r}));case"EC":case"OKP":return er(x(x({},e),{},{alg:t,ext:r}));default:throw new Dt('Unsupported "kty" (Key Type) Parameter value')}}(x(x({},t),{},{ext:!0}),r);if(e instanceof Uint8Array||"public"!==e.type)throw new Ut("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function Qr(e){const t=new Zr(e),r=async(e,r)=>t.getKey(e,r);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}let en;if("undefined"==typeof navigator||null===(Vr=navigator.userAgent)||void 0===Vr||null===(Jr=Vr.startsWith)||void 0===Jr||!Jr.call(Vr,"Mozilla/5.0 ")){const e="v6.1.3";en="".concat("jose","/").concat(e)}const tn=Symbol(),rn=Symbol();var nn=new WeakMap,on=new WeakMap,an=new WeakMap,sn=new WeakMap,cn=new WeakMap,ln=new WeakMap,un=new WeakMap,dn=new WeakMap,pn=new WeakMap,mn=new WeakMap;class hn{constructor(e,t){if(k(this,nn,void 0),k(this,on,void 0),k(this,an,void 0),k(this,sn,void 0),k(this,cn,void 0),k(this,ln,void 0),k(this,un,void 0),k(this,dn,void 0),k(this,pn,void 0),k(this,mn,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var r,n;U(nn,this,new URL(e.href)),U(on,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),U(an,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),U(sn,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),U(un,this,new Headers(null==t?void 0:t.headers)),en&&!L(un,this).has("User-Agent")&&L(un,this).set("User-Agent",en),L(un,this).has("accept")||(L(un,this).set("accept","application/json"),L(un,this).append("accept","application/jwk-set+json")),U(dn,this,null==t?void 0:t[tn]),void 0!==(null==t?void 0:t[rn])&&(U(mn,this,null==t?void 0:t[rn]),null==t?void 0:t[rn],L(sn,this),"object"==typeof r&&null!==r&&"uat"in r&&"number"==typeof r.uat&&!(Date.now()-r.uat>=n)&&"jwks"in r&&Jt(r.jwks)&&Array.isArray(r.jwks.keys)&&Array.prototype.every.call(r.jwks.keys,Jt)&&(U(cn,this,L(mn,this).uat),U(pn,this,Qr(L(mn,this).jwks))))}pendingFetch(){return!!L(ln,this)}coolingDown(){return"number"==typeof L(cn,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const o=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new xt;throw e});if(200!==o.status)throw new It("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new It("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(L(nn,this).href,L(un,this),AbortSignal.timeout(L(on,this)),L(dn,this)).then(e=>{U(pn,this,Qr(e)),L(mn,this)&&(L(mn,this).uat=Date.now(),L(mn,this).jwks=e),U(cn,this,Date.now()),U(ln,this,void 0)}).catch(e=>{throw U(ln,this,void 0),e})),await L(ln,this)}}const fn=["mfaToken"],yn=["mfaToken"];var gn,An,wn,bn,Sn,vn,En,Rn,Tn=class extends Error{constructor(e,t){super(t),B(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Pn=class extends Error{constructor(e,t,r){super(t),B(this,"cause",void 0),B(this,"code",void 0),this.code=e,this.cause=r&&{error:r.error,error_description:r.error_description,message:r.message}}},_n=class extends Pn{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},In=class extends Pn{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},On=class extends Pn{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Nn=class extends Pn{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Cn=class extends Pn{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Dn=class extends Error{constructor(e){super(e),B(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Ln=class extends Pn{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),B(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},kn=class extends Pn{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Un=class extends Pn{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Bn=class extends Pn{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},Mn=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),B(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function xn(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 Hn=class extends Error{constructor(e,t,r){super(t),B(this,"cause",void 0),B(this,"code",void 0),this.code=e,this.cause=r&&{error:r.error,error_description:r.error_description,message:r.message}}},Gn=class extends Hn{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Fn=class extends Hn{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},jn=class extends Hn{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Wn=class extends Hn{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Kn(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Yn=(gn=new WeakMap,An=new WeakMap,wn=new WeakMap,class{constructor(e){var t;k(this,gn,void 0),k(this,An,void 0),k(this,wn,void 0),U(gn,this,"https://".concat(e.domain)),U(An,this,e.clientId),U(wn,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(L(gn,this),"/mfa/authenticators"),{mfaToken:r}=e,n=await L(wn,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!n.ok){const e=await n.json();throw new Gn(e.error_description||"Failed to list authenticators",e)}return(await n.json()).map(Kn)}async enrollAuthenticator(e){const t="".concat(L(gn,this),"/mfa/associate"),{mfaToken:r}=e,n=H(e,fn),o={authenticator_types:n.authenticatorTypes};"oobChannels"in n&&(o.oob_channels=n.oobChannels),"phoneNumber"in n&&n.phoneNumber&&(o.phone_number=n.phoneNumber),"email"in n&&n.email&&(o.email=n.email);const i=await L(wn,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new Fn(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};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:r}=e,n="".concat(L(gn,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await L(wn,this).call(this,n,{method:"DELETE",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new jn(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(L(gn,this),"/mfa/challenge"),{mfaToken:r}=e,n=H(e,yn),o={mfa_token:r,client_id:L(An,this),challenge_type:n.challengeType};n.authenticatorId&&(o.authenticator_id=n.authenticatorId);const i=await L(wn,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 Wn(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())}}),Xn=class e{constructor(e,t,r,n,o,i,a){B(this,"accessToken",void 0),B(this,"idToken",void 0),B(this,"refreshToken",void 0),B(this,"expiresAt",void 0),B(this,"scope",void 0),B(this,"claims",void 0),B(this,"authorizationDetails",void 0),B(this,"tokenType",void 0),B(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=r,this.refreshToken=n,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const r=t.id_token?t.claims():void 0,n=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,r,t.authorization_details);return n.tokenType=t.token_type,n.issuedTokenType=t.issued_token_type,n}},Vn="openid profile email offline_access",Jn=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 zn(e){if(null==e)throw new Cn("subject_token is required");if("string"!=typeof e)throw new Cn("subject_token must be a string");if(0===e.trim().length)throw new Cn("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Cn("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Cn("subject_token must not include the 'Bearer ' prefix")}function qn(e,t){if(t)for(const[r,n]of Object.entries(t))if(!Jn.has(r))if(Array.isArray(n)){if(n.length>20)throw new Cn("Parameter '".concat(r,"' exceeds maximum array size of ").concat(20));n.forEach(t=>{e.append(r,t)})}else e.append(r,n)}bn=new WeakMap,Sn=new WeakMap,vn=new WeakMap,En=new WeakMap,Rn=new WeakSet;async function Zn(){if(L(bn,this)&&L(Sn,this))return{configuration:L(bn,this),serverMetadata:L(Sn,this)};const e=await N(Rn,this,eo).call(this);return U(bn,this,await Sr(new URL("https://".concat(L(vn,this).domain)),L(vn,this).clientId,{use_mtls_endpoint_aliases:L(vn,this).useMtls},e,{[hr]:L(vn,this).customFetch})),U(Sn,this,L(bn,this).serverMetadata()),L(bn,this)[hr]=L(vn,this).customFetch||fetch,{configuration:L(bn,this),serverMetadata:L(Sn,this)}}async function $n(e){var t,r;const{configuration:n}=await N(Rn,this,Zn).call(this);if("audience"in e||"resource"in e)throw new Cn("audience and resource parameters are not supported for Token Vault exchanges");zn(e.subjectToken);const o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==e.subjectTokenType&&void 0!==t?t:"urn:ietf:params:oauth:token-type:access_token",requested_token_type:null!==e.requestedTokenType&&void 0!==r?r:"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),qn(o,e.extra);try{const e=await Hr(n,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return Xn.fromTokenEndpointResponse(e)}catch(t){throw new Cn("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function Qn(e){const{configuration:t}=await N(Rn,this,Zn).call(this);zn(e.subjectToken);const r=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&r.append("audience",e.audience),e.scope&&r.append("scope",e.scope),e.requestedTokenType&&r.append("requested_token_type",e.requestedTokenType),e.organization&&r.append("organization",e.organization),qn(r,e.extra);try{const e=await Hr(t,"urn:ietf:params:oauth:grant-type:token-exchange",r);return Xn.fromTokenEndpointResponse(e)}catch(t){throw new Cn("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function eo(){if(!L(vn,this).clientSecret&&!L(vn,this).clientAssertionSigningKey&&!L(vn,this).useMtls)throw new Mn;if(L(vn,this).useMtls)return(e,t,r,n)=>{r.set("client_id",t.client_id)};let e=L(vn,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 Qt(e,t,void 0)}(e,L(vn,this).clientAssertionSigningAlg||"RS256"),e?function(e){return Ee(e,void 0)}(e):mr(L(vn,this).clientSecret)}async function to(e){const{configuration:t}=await N(Rn,this,Zn).call(this),r=fe(),n=await function(e){return async function(e){return me(e,"codeVerifier"),oe(await crypto.subtle.digest("SHA-256",te(e)))}(e)}(r),o=xn(x(x({},L(vn,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(x(x({scope:Vn},o),{},{client_id:L(vn,this).clientId,code_challenge:n,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await kr(t,i):await Lr(t,i),codeVerifier:r}}function ro(e,t){return function(){return e.apply(t,arguments)}}const{toString:no}=Object.prototype,{getPrototypeOf:oo}=Object,{iterator:io,toStringTag:ao}=Symbol,so=(co=Object.create(null),e=>{const t=no.call(e);return co[t]||(co[t]=t.slice(8,-1).toLowerCase())});var co;const lo=e=>(e=e.toLowerCase(),t=>so(t)===e),uo=e=>t=>typeof t===e,{isArray:po}=Array,mo=uo("undefined");function ho(e){return null!==e&&!mo(e)&&null!==e.constructor&&!mo(e.constructor)&&go(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const fo=lo("ArrayBuffer");const yo=uo("string"),go=uo("function"),Ao=uo("number"),wo=e=>null!==e&&"object"==typeof e,bo=e=>{if("object"!==so(e))return!1;const t=oo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ao in e||io in e)},So=lo("Date"),vo=lo("File"),Eo=lo("Blob"),Ro=lo("FileList");const To="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{},Po=void 0!==To.FormData?To.FormData:void 0,_o=lo("URLSearchParams"),[Io,Oo,No,Co]=["ReadableStream","Request","Response","Headers"].map(lo);function Do(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),po(e))for(n=0,o=e.length;n0;)if(n=r[o],t===n.toLowerCase())return n;return null}const ko="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,Uo=e=>!mo(e)&&e!==ko;const Bo=(Mo="undefined"!=typeof Uint8Array&&oo(Uint8Array),e=>Mo&&e instanceof Mo);var Mo;const xo=lo("HTMLFormElement"),Ho=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Go=lo("RegExp"),Fo=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Do(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)};const jo=lo("AsyncFunction"),Wo=(Ko="function"==typeof setImmediate,Yo=go(ko.postMessage),Ko?setImmediate:Yo?(Xo=`axios@${Math.random()}`,Vo=[],ko.addEventListener("message",({source:e,data:t})=>{e===ko&&t===Xo&&Vo.length&&Vo.shift()()},!1),e=>{Vo.push(e),ko.postMessage(Xo,"*")}):e=>setTimeout(e));var Ko,Yo,Xo,Vo;const Jo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ko):"undefined"!=typeof process&&process.nextTick||Wo,zo={isArray:po,isArrayBuffer:fo,isBuffer:ho,isFormData:e=>{let t;return e&&(Po&&e instanceof Po||go(e.append)&&("formdata"===(t=so(e))||"object"===t&&go(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&fo(e.buffer),t},isString:yo,isNumber:Ao,isBoolean:e=>!0===e||!1===e,isObject:wo,isPlainObject:bo,isEmptyObject:e=>{if(!wo(e)||ho(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Io,isRequest:Oo,isResponse:No,isHeaders:Co,isUndefined:mo,isDate:So,isFile:vo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Eo,isRegExp:Go,isFunction:go,isStream:e=>wo(e)&&go(e.pipe),isURLSearchParams:_o,isTypedArray:Bo,isFileList:Ro,forEach:Do,merge:function e(){const{caseless:t,skipUndefined:r}=Uo(this)&&this||{},n={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=t&&Lo(n,i)||i;bo(n[a])&&bo(o)?n[a]=e(n[a],o):bo(o)?n[a]=e({},o):po(o)?n[a]=o.slice():r&&mo(o)||(n[a]=o)};for(let e=0,t=arguments.length;e(Do(t,(t,n)=>{r&&go(t)?Object.defineProperty(e,n,{value:ro(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&oo(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:so,kindOfTest:lo,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(po(e))return e;let t=e.length;if(!Ao(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[io]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:xo,hasOwnProperty:Ho,hasOwnProp:Ho,reduceDescriptors:Fo,freezeMethods:e=>{Fo(e,(t,r)=>{if(go(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];go(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return po(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Lo,global:ko,isContextDefined:Uo,isSpecCompliantForm:function(e){return!!(e&&go(e.append)&&"FormData"===e[ao]&&e[io])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(wo(e)){if(t.indexOf(e)>=0)return;if(ho(e))return e;if(!("toJSON"in e)){t[n]=e;const o=po(e)?[]:{};return Do(e,(e,t)=>{const i=r(e,n+1);!mo(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:jo,isThenable:e=>e&&(wo(e)||go(e))&&go(e.then)&&go(e.catch),setImmediate:Wo,asap:Jo,isIterable:e=>null!=e&&go(e[io])};class qo extends Error{static from(e,t,r,n,o,i){const a=new qo(e.message,t||e.code,r,n,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,r,n,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){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:zo.toJSONObject(this.config),code:this.code,status:this.status}}}qo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",qo.ERR_BAD_OPTION="ERR_BAD_OPTION",qo.ECONNABORTED="ECONNABORTED",qo.ETIMEDOUT="ETIMEDOUT",qo.ERR_NETWORK="ERR_NETWORK",qo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",qo.ERR_DEPRECATED="ERR_DEPRECATED",qo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",qo.ERR_BAD_REQUEST="ERR_BAD_REQUEST",qo.ERR_CANCELED="ERR_CANCELED",qo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",qo.ERR_INVALID_URL="ERR_INVALID_URL";const Zo=qo;var $o=r(8287).hp;function Qo(e){return zo.isPlainObject(e)||zo.isArray(e)}function ei(e){return zo.endsWith(e,"[]")?e.slice(0,-2):e}function ti(e,t,r){return e?e.concat(t).map(function(e,t){return e=ei(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const ri=zo.toFlatObject(zo,{},null,function(e){return/^is[A-Z]/.test(e)});const ni=function(e,t,r){if(!zo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=zo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!zo.isUndefined(t[e])})).metaTokens,o=r.visitor||l,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&zo.isSpecCompliantForm(t);if(!zo.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(zo.isDate(e))return e.toISOString();if(zo.isBoolean(e))return e.toString();if(!s&&zo.isBlob(e))throw new Zo("Blob is not supported. Use a Buffer instead.");return zo.isArrayBuffer(e)||zo.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):$o.from(e):e}function l(e,r,o){let s=e;if(zo.isReactNative(t)&&zo.isReactNativeBlob(e))return t.append(ti(o,r,i),c(e)),!1;if(e&&!o&&"object"==typeof e)if(zo.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(zo.isArray(e)&&function(e){return zo.isArray(e)&&!e.some(Qo)}(e)||(zo.isFileList(e)||zo.endsWith(r,"[]"))&&(s=zo.toArray(e)))return r=ei(r),s.forEach(function(e,n){!zo.isUndefined(e)&&null!==e&&t.append(!0===a?ti([r],n,i):null===a?r:r+"[]",c(e))}),!1;return!!Qo(e)||(t.append(ti(o,r,i),c(e)),!1)}const u=[],d=Object.assign(ri,{defaultVisitor:l,convertValue:c,isVisitable:Qo});if(!zo.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!zo.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),zo.forEach(r,function(r,i){!0===(!(zo.isUndefined(r)||null===r)&&o.call(t,r,zo.isString(i)?i.trim():i,n,d))&&e(r,n?n.concat(i):[i])}),u.pop()}}(e),t};function oi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ii(e,t){this._pairs=[],e&&ni(e,this,t)}const ai=ii.prototype;ai.append=function(e,t){this._pairs.push([e,t])},ai.toString=function(e){const t=e?function(t){return e.call(this,t,oi)}:oi;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const si=ii;function ci(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function li(e,t,r){if(!t)return e;const n=r&&r.encode||ci,o=zo.isFunction(r)?{serialize:r}:r,i=o&&o.serialize;let a;if(a=i?i(t,o):zo.isURLSearchParams(t)?t.toString():new si(t,o).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const ui=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){zo.forEach(this.handlers,function(t){null!==t&&e(t)})}},di={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},pi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:si,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},mi="undefined"!=typeof window&&"undefined"!=typeof document,hi="object"==typeof navigator&&navigator||void 0,fi=mi&&(!hi||["ReactNative","NativeScript","NS"].indexOf(hi.product)<0),yi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gi=mi&&window.location.href||"http://localhost",Ai={...e,...pi};const wi=function(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&zo.isArray(n)?n.length:i,s)return zo.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&zo.isObject(n[i])||(n[i]=[]);return t(e,r,n[i],o)&&zo.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n{t(function(e){return zo.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null};const bi={transitional:di,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=zo.isObject(e);o&&zo.isHTMLForm(e)&&(e=new FormData(e));if(zo.isFormData(e))return n?JSON.stringify(wi(e)):e;if(zo.isArrayBuffer(e)||zo.isBuffer(e)||zo.isStream(e)||zo.isFile(e)||zo.isBlob(e)||zo.isReadableStream(e))return e;if(zo.isArrayBufferView(e))return e.buffer;if(zo.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ni(e,new Ai.classes.URLSearchParams,{visitor:function(e,t,r,n){return Ai.isNode&&zo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=zo.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ni(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(zo.isString(e))try{return(t||JSON.parse)(e),zo.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||bi.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(zo.isResponse(e)||zo.isReadableStream(e))return e;if(e&&zo.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Zo.from(e,Zo.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ai.classes.FormData,Blob:Ai.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};zo.forEach(["delete","get","head","post","put","patch"],e=>{bi.headers[e]={}});const Si=bi,vi=zo.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"]),Ei=Symbol("internals");function Ri(e){return e&&String(e).trim().toLowerCase()}function Ti(e){return!1===e||null==e?e:zo.isArray(e)?e.map(Ti):String(e)}function Pi(e,t,r,n,o){return zo.isFunction(n)?n.call(this,t,r):(o&&(t=r),zo.isString(t)?zo.isString(n)?-1!==t.indexOf(n):zo.isRegExp(n)?n.test(t):void 0:void 0)}class _i{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=Ri(t);if(!o)throw new Error("header name must be a non-empty string");const i=zo.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Ti(e))}const i=(e,t)=>zo.forEach(e,(e,r)=>o(e,r,t));if(zo.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(zo.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&vi[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(zo.isObject(e)&&zo.isIterable(e)){let r,n,o={};for(const t of e){if(!zo.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?zo.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=Ri(e)){const r=zo.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(zo.isFunction(t))return t.call(this,e,r);if(zo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ri(e)){const r=zo.findKey(this,e);return!(!r||void 0===this[r]||t&&!Pi(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=Ri(e)){const o=zo.findKey(r,e);!o||t&&!Pi(0,r[o],o,t)||(delete r[o],n=!0)}}return zo.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Pi(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return zo.forEach(this,(n,o)=>{const i=zo.findKey(r,o);if(i)return t[i]=Ti(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Ti(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return zo.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&zo.isArray(r)?r.join(", "):r)}),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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ei]=this[Ei]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ri(e);t[n]||(!function(e,t){const r=zo.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return zo.isArray(e)?e.forEach(n):n(e),this}}_i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),zo.reduceDescriptors(_i.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),zo.freezeMethods(_i);const Ii=_i;function Oi(e,t){const r=this||Si,n=t||r,o=Ii.from(n.headers);let i=n.data;return zo.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ni(e){return!(!e||!e.__CANCEL__)}const Ci=class extends Zo{constructor(e,t,r){super(null==e?"canceled":e,Zo.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function Di(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Zo("Request failed with status code "+r.status,[Zo.ERR_BAD_REQUEST,Zo.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Li=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=n[a];o||(o=c),r[i]=s,n[i]=c;let u=a,d=0;for(;u!==i;)d+=r[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]},Ui=(e,t,r=3)=>{let n=0;const o=Li(50,250);return ki(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},Bi=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Mi=e=>(...t)=>zo.asap(()=>e(...t)),xi=Ai.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Ai.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Ai.origin),Ai.navigator&&/(msie|trident)/i.test(Ai.navigator.userAgent)):()=>!0,Hi=Ai.hasStandardBrowserEnv?{write(e,t,r,n,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];zo.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),zo.isString(n)&&s.push(`path=${n}`),zo.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),zo.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Gi(e,t,r){let n=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fi=e=>e instanceof Ii?{...e}:e;function ji(e,t){t=t||{};const r={};function n(e,t,r,n){return zo.isPlainObject(e)&&zo.isPlainObject(t)?zo.merge.call({caseless:n},e,t):zo.isPlainObject(t)?zo.merge({},t):zo.isArray(t)?t.slice():t}function o(e,t,r,o){return zo.isUndefined(t)?zo.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!zo.isUndefined(t))return n(void 0,t)}function a(e,t){return zo.isUndefined(t)?zo.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 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,responseEncoding:a,validateStatus:s,headers:(e,t,r)=>o(Fi(e),Fi(t),0,!0)};return zo.forEach(Object.keys({...e,...t}),function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;const i=zo.hasOwnProp(c,n)?c[n]:o,a=i(e[n],t[n],n);zo.isUndefined(a)&&i!==s||(r[n]=a)}),r}const Wi=e=>{const t=ji({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ii.from(a),t.url=li(Gi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),zo.isFormData(r))if(Ai.hasStandardBrowserEnv||Ai.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(zo.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(Ai.hasStandardBrowserEnv&&(n&&zo.isFunction(n)&&(n=n(t)),n||!1!==n&&xi(t.url))){const e=o&&i&&Hi.read(i);e&&a.set(o,e)}return t},Ki="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Wi(e);let o=n.data;const i=Ii.from(n.headers).normalize();let a,s,c,l,u,{responseType:d,onUploadProgress:p,onDownloadProgress:m}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let f=new XMLHttpRequest;function y(){if(!f)return;const n=Ii.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Di(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f}),f=null}f.open(n.method.toUpperCase(),n.url,!0),f.timeout=n.timeout,"onloadend"in f?f.onloadend=y:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(y)},f.onabort=function(){f&&(r(new Zo("Request aborted",Zo.ECONNABORTED,e,f)),f=null)},f.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new Zo(n,Zo.ERR_NETWORK,e,f);o.event=t||null,r(o),f=null},f.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||di;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Zo(t,o.clarifyTimeoutError?Zo.ETIMEDOUT:Zo.ECONNABORTED,e,f)),f=null},void 0===o&&i.setContentType(null),"setRequestHeader"in f&&zo.forEach(i.toJSON(),function(e,t){f.setRequestHeader(t,e)}),zo.isUndefined(n.withCredentials)||(f.withCredentials=!!n.withCredentials),d&&"json"!==d&&(f.responseType=n.responseType),m&&([c,u]=Ui(m,!0),f.addEventListener("progress",c)),p&&f.upload&&([s,l]=Ui(p),f.upload.addEventListener("progress",s),f.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(a=t=>{f&&(r(!t||t.type?new Ci(null,e,f):t),f.abort(),f=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Ai.protocols.indexOf(g)?r(new Zo("Unsupported protocol "+g+":",Zo.ERR_BAD_REQUEST,e)):f.send(o||null)})},Yi=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Zo?t:new Ci(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Zo(`timeout of ${t}ms exceeded`,Zo.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}=n;return s.unsubscribe=()=>zo.asap(a),s}},Xi=function*(e,t){let r=e.byteLength;if(!t||r{const o=async function*(e,t){for await(const r of Vi(e))yield*Xi(r,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:zi}=zo,qi=(({Request:e,Response:t})=>({Request:e,Response:t}))(zo.global),{ReadableStream:Zi,TextEncoder:$i}=zo.global,Qi=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ea=e=>{e=zo.merge.call({skipUndefined:!0},qi,e);const{fetch:t,Request:r,Response:n}=e,o=t?zi(t):"function"==typeof fetch,i=zi(r),a=zi(n);if(!o)return!1;const s=o&&zi(Zi),c=o&&("function"==typeof $i?(l=new $i,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=i&&s&&Qi(()=>{let e=!1;const t=new r(Ai.origin,{body:new Zi,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Qi(()=>zo.isReadableStream(new n("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Zo(`Response type '${e}' is not supported`,Zo.ERR_NOT_SUPPORT,r)})});const m=async(e,t)=>{const n=zo.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(zo.isBlob(e))return e.size;if(zo.isSpecCompliantForm(e)){const t=new r(Ai.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return zo.isArrayBufferView(e)||zo.isArrayBuffer(e)?e.byteLength:(zo.isURLSearchParams(e)&&(e+=""),zo.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:l,timeout:h,onDownloadProgress:f,onUploadProgress:y,responseType:g,headers:A,withCredentials:w="same-origin",fetchOptions:b}=Wi(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let v=Yi([c,l&&l.toAbortSignal()],h),E=null;const R=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let T;try{if(y&&u&&"get"!==a&&"head"!==a&&0!==(T=await m(A,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(zo.isFormData(s)&&(e=t.headers.get("content-type"))&&A.setContentType(e),t.body){const[e,r]=Bi(T,Ui(Mi(y)));s=Ji(t.body,65536,e,r)}}zo.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in r.prototype,c={...b,signal:v,method:a.toUpperCase(),headers:A.normalize().toJSON(),body:s,duplex:"half",credentials:t?w:void 0};E=i&&new r(o,c);let l=await(i?S(E,b):S(o,c));const h=d&&("stream"===g||"response"===g);if(d&&(f||h&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=zo.toFiniteNumber(l.headers.get("content-length")),[r,o]=f&&Bi(t,Ui(Mi(f),!0))||[];l=new n(Ji(l.body,65536,r,()=>{o&&o(),R&&R()}),e)}g=g||"text";let P=await p[zo.findKey(p,g)||"text"](l,e);return!h&&R&&R(),await new Promise((t,r)=>{Di(t,r,{data:P,headers:Ii.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:E})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Zo("Network Error",Zo.ERR_NETWORK,e,E,t&&t.response),{cause:t.cause||t});throw Zo.from(t,t&&t.code,e,E,t&&t.response)}}},ta=new Map,ra=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let a,s,c=i.length,l=ta;for(;c--;)a=i[c],s=l.get(a),void 0===s&&l.set(a,s=c?new Map:ea(t)),l=s;return s},na=(ra(),{http:null,xhr:Ki,fetch:{get:ra}});zo.forEach(na,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const oa=e=>`- ${e}`,ia=e=>zo.isFunction(e)||null===e||!1===e;const aa={getAdapter:function(e,t){e=zo.isArray(e)?e:[e];const{length:r}=e;let n,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=r?e.length>1?"since :\n"+e.map(oa).join("\n"):" "+oa(e[0]):"as no adapter specified";throw new Zo("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:na};function sa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ci(null,e)}function ca(e){sa(e),e.headers=Ii.from(e.headers),e.data=Oi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return aa.getAdapter(e.adapter||Si.adapter,e)(e).then(function(t){return sa(e),t.data=Oi.call(e,e.transformResponse,t),t.headers=Ii.from(t.headers),t},function(t){return Ni(t)||(sa(e),t&&t.response&&(t.response.data=Oi.call(e,e.transformResponse,t.response),t.response.headers=Ii.from(t.response.headers))),Promise.reject(t)})}const la="1.13.6",ua={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ua[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const da={};ua.transitional=function(e,t,r){function n(e,t){return"[Axios v"+la+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new Zo(n(o," has been removed"+(t?" in "+t:"")),Zo.ERR_DEPRECATED);return t&&!da[o]&&(da[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},ua.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const pa={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Zo("options must be an object",Zo.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new Zo("option "+i+" must be "+r,Zo.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Zo("Unknown option "+i,Zo.ERR_BAD_OPTION)}},validators:ua},ma=pa.validators;class ha{constructor(e){this.defaults=e||{},this.interceptors={request:new ui,response:new ui}}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 r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ji(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&pa.assertOptions(r,{silentJSONParsing:ma.transitional(ma.boolean),forcedJSONParsing:ma.transitional(ma.boolean),clarifyTimeoutError:ma.transitional(ma.boolean),legacyInterceptorReqResOrdering:ma.transitional(ma.boolean)},!1),null!=n&&(zo.isFunction(n)?t.paramsSerializer={serialize:n}:pa.assertOptions(n,{encode:ma.function,serialize:ma.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pa.assertOptions(t,{baseUrl:ma.spelling("baseURL"),withXsrfToken:ma.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&zo.merge(o.common,o[t.method]);o&&zo.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ii.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 r=t.transitional||di;r&&r.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!s){const e=[ca.bind(this),void 0];for(e.unshift(...a),e.push(...c),u=e.length,l=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Ci(e,n,o),t(r.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 ya(function(t){e=t});return{token:t,cancel:e}}}const ga=ya;const Aa={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(Aa).forEach(([e,t])=>{Aa[t]=e});const wa=Aa;const ba=function e(t){const r=new fa(t),n=ro(fa.prototype.request,r);return zo.extend(n,fa.prototype,r,{allOwnKeys:!0}),zo.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(ji(t,r))},n}(Si);ba.Axios=fa,ba.CanceledError=Ci,ba.CancelToken=ga,ba.isCancel=Ni,ba.VERSION=la,ba.toFormData=ni,ba.AxiosError=Zo,ba.Cancel=ba.CanceledError,ba.all=function(e){return Promise.all(e)},ba.spread=function(e){return function(t){return e.apply(null,t)}},ba.isAxiosError=function(e){return zo.isObject(e)&&!0===e.isAxiosError},ba.mergeConfig=ji,ba.AxiosHeaders=Ii,ba.formToJSON=e=>wi(zo.isHTMLForm(e)?new FormData(e):e),ba.getAdapter=aa.getAdapter,ba.HttpStatusCode=wa,ba.default=ba;const Sa=ba;var va=r(3612);const Ea=function(){if(va.A.debug){for(var e,t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:"",t=La().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var r=t.split(".");return"".concat(r[r.length-2],".").concat(r[r.length-1])},Ba=function(){var e=Ua();return".".concat(e)},Ma=function(e,t,r){var n="".concat(e,"=").concat(t,";");void 0!==r?(Ea("Setting cookie with options: ",r),Object.entries(r).forEach(function(e){var t=l(e,2),r=t[0],o=t[1];if("expires"===r){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),n+="expires=".concat(i.toUTCString(),";")}else n+="".concat(r,"=").concat(o,";")})):n+="path=/;",document.cookie=n},xa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=Ua(),i=[o,"www".concat(o),".www".concat(o)];r&&i.push(r),Object.entries(t).forEach(function(e){var t=l(e,2),r=t[0],o=t[1];n+="".concat(r,"=").concat(o,";")}),0===Object.keys(t).length&&(n+="path=/;"),document.cookie=n,i.forEach(function(e){document.cookie=n.concat("domain=",e,";")})},Ha=function(){return La().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Ga=function(e){return function(e,t){if("string"!=typeof e)throw new u("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new u(`Invalid token specified: missing part #${r+1}`);let o;try{o=d(n)}catch(e){throw new u(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new u(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}(e)},Fa=function(){var e=Ua();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)},ja=function(){return"complete"===document.readyState},Wa=function(){return new Promise(function(e){if(("interactive"===document.readyState||ja())&&window.dataLayer)Ea("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{Ea("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(n(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return r.stop()}},r)})),50)}})},Ka=function(){var e=n(o.mark(function e(t){var r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Wa();case 1:return Ea("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],r="",Ea("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),n=function(e){return Ea("Utils dataLayerLoop: look for this element ",e),e[t]?(Ea("Utils dataLayerLoop: found ",e[t]),r=e[t],e[t]):(Ea("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(n),e.abrupt("return",i?r:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Ya=function(){var e=n(o.mark(function e(){var t,r,n=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:"Page Type",e.next=1,Ka(t);case 1:return r=e.sent,Ea("utils | pageType: page type is ",r),e.abrupt("return",r);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Xa=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(Ea("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(Ea("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(r){try{var n=r.detail||{};Ea("utils | Event: authentication ready: ",n),e(n)}catch(e){Ea(e),t(e)}},!1))})},Va=function(){var e=n(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return va.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(Ea("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(r){try{var n=r.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=n,Ea("Received entitlementsReady event:",n),e(n)}catch(e){Ra("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(Ea("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ja=function(){Ea("Clearing entitlements...");try{xa(Pa,{path:"/"})}catch(e){Ea("Failed to delete legacy cookie: ",e)}try{xa(Pa,{path:"/",domain:Ua(),expires:365,secure:!0})}catch(e){Ea("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(_a)}catch(e){Ea("Failed to remove local storage: ",e)}},za=function(e){Ea("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(),r=["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 Ea("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{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=za;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var qa=function(e){va.A.datadogEnabled&&window.DD_RUM.addTiming(e)},Za=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,r){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},a=function(){var a=n(o.mark(function n(){var a,s,c,l,u,d,p,m,h,f,y;return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"1"!==(null===(a=window.sophi_config)||void 0===a?void 0:a.enableSophiSSPW)){n.next=1;break}if(!document.getElementById("server-paywall")){n.next=1;break}return i.sspw=!0,n.abrupt("return",t({paywall:!0,details:Da({},i)}));case 1:return n.next=2,Ya();case 2:return c=n.sent,n.next=3,Ka("Paywall_Level");case 3:if(l=n.sent,"article"===c&&"free"!==l){n.next=4;break}return n.abrupt("return",t({paywall:!1,details:"article"!==c?"Page type is not an article":"Free article"}));case 4:return n.next=5,Va();case 5:if(!(u=n.sent)||!u.isEntitled){n.next=6;break}return n.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){n.next=7;break}return n.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(s=window.ConnextUtils)||void 0===s?void 0:s.runningSophi,Ea("checkPaywallStatus - Sophi is running: ",d),!d){n.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(i.sophiClient=!0,i.engageStatus=!0,i.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(i.sophiClient=!0),t({paywall:!0,details:Da({},i)})},{once:!0}),n.next=12;break;case 8:if(d){n.next=12;break}return p=window.ConnextUtils.connextReady("onPaywallShown",!1),m=new Promise(function(t,r){return setTimeout(function(){return r(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),n.prev=9,n.next=10,Promise.race([p,m]);case 10:!0===(h=n.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(h)),n.next=12;break;case 11:n.prev=11,f=n.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(f);case 12:return n.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:Da({},i)}));case 13:n.prev=13,y=n.catch(0),r(y);case 14:case"end":return n.stop()}},n,null,[[0,13],[9,11]])}));return function(){return a.apply(this,arguments)}}();a()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Za);function $a(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:".apple-pay-button",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Apple";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.paymentSource=r,this.buttonSelector=t,this.dynamicOfferCodeId="",this.siteName=Ha(),this.siteNameParsed=this.siteName.replace("www.","").replace("preprod.","").replace("develop.","").replace("local","com").replace("staging.",""),this.offerGroup=null,this.offerId=null,this.terms="",this.tokenReady=!1,this.paywayRequestToken=null,this.transactionName="",this.site=ds[this.siteNameParsed],this.siteCode=this.site.code,this.loggedInUserData=null,this.email="",this.uuid="",this.offerDetails=null,this.sourceId=0,this.serviceUrl="https://paywayws.com/PaywayWS/AccessTokens",this.billingUrl="https://paywayws.com/PaywayWS/CreditCards",this.safeURL="",this.onApplePayClick=this.thirdPartyPaymentButtonClicked.bind(this)},[{key:"queuePaywaySession",value:(i=n(o.mark(function e(){var t,r,n,i,a,s,c,l;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ea("APPLE PAY | queue session started"),t=document.querySelector(this.buttonSelector)){e.next=1;break}return Ea("APPLE PAY | no button found, exiting queue"),e.abrupt("return");case 1:return r=document.querySelector(".terms"),e.next=2,Ka("URL");case 2:if(this.safeURL=e.sent,this.safeURL.includes("staging")||this.safeURL.includes("develop")?(this.serviceUrl="https://paywaywsdev.com/PaywayWS/AccessTokens",this.billingUrl="https://paywaywsdev.com/PaywayWS/CreditCards",this.offerGroup="4214",this.offerId="11082",this.terms=r.textContent):(this.offerGroup=t.dataset.offergroup,this.offerId=t.dataset.offercode,this.terms=r.textContent),this.sourceId=window.apple_config.sourceId?parseInt(window.apple_config.sourceId,10):0,this.offerDetails=this.getBillingDataLocallyWithOfferCode(this.offerGroup,this.offerId,this.sourceId),Ea("APPLE PAY | offer ",this.offerDetails),t&&(t.style.cursor="not-allowed !important"),!window.MNGAuthentication){e.next=4;break}return e.next=3,MNGAuthentication.getUserInfo();case 3:this.loggedInUserData=e.sent,this.uuid=this.loggedInUserData.userId,this.email=this.loggedInUserData.email;case 4:return n="".concat(va.A.entitlementsEndpoint,"payway/queue_transaction"),e.prev=5,i=this.offerDetails.promo.amount.replace(".",""),a={amount:i,eciType:1,sourceId:this.sourceId,tax:"0",transactionNotes1:"",transactionNotes2:"",transactionNotes3:"",request:"queueSale"},Ea("APPLE PAY | sending queue object "),e.next=6,fetch(n,{method:"POST",headers:{"X-Api-Key":va.A.entitlementsApiKey},body:JSON.stringify(a)});case 6:return s=e.sent,e.next=7,s.json();case 7:c=e.sent,Ea("APPLE PAY |request token received from entitler"),this.paywayRequestToken=c.data.paywayRequestToken,this.transactionName=c.data.transactionName,c.data.paywayRequestToken&&(Ea("APPLE PAY | queue session success, showing button "),t.style.setProperty("display","block","important"),t.removeEventListener("click",this.onApplePayClick),t.addEventListener("click",this.onApplePayClick,{once:!0}),t.disabled=!1,Ea("APPLE PAY | queue success "),window.MG2DL.push({event:"g2i_action_shown",actionType:"paywall",actionName:"apple_pay"})),e.next=9;break;case 8:e.prev=8,l=e.catch(5),Ea("APPLE PAY ERROR | queue failed category ",l.error.category),Ea("APPLE PAY ERROR | queue failed custom status code ",l.error.customStatusCode),Ea("APPLE PAY ERROR | queue failed message ",l.error.message),Ea("APPLE PAY ERROR | queue failed message ",l.error.errCode),document.querySelector(".error").style.display="block";case 9:case"end":return e.stop()}},e,this,[[5,8]])})),function(){return i.apply(this,arguments)})},{key:"getBillingDataLocallyWithOfferCode",value:function(e,t){var r={1852:{4638:{billingAgreement:'AUTOMATIC RENEWAL TERMS: After the 1-year $1.00 introductory rate, your payment method will be automatically charged $21.99 every Month. \n\t\t\t\t\tBy subscribing, you agree to the Automatic Renewal Terms of this offer, the Terms of Use, and Arbitration and Refund Terms. Your subscription will renew automatically, and you will be charged up to seven days in advance of your renewal date until you cancel. \n\t\t\t\t\tYou may cancel at any time by calling Subscriber Services at 570-628-5985 or by selecting "Cancel Subscription" in your account settings. \n\t\t\t\t\tThe cancellation goes into effect at the start of your following billing cycle.',offerId:4638,promoDuration:"1 year",paymentDescription:"$1.00 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",paymentTiming:"recurring"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"28"}}},2789:{21866:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21865:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21867:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}},21868:{billingAgreement:this.terms,offerId:21866,promoDuration:"1 year",paymentDescription:"$0.01 for 1-year of access, then $21.99 per month subscription",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30"}}},2889:{22798:{billingAgreement:this.terms,offerId:22798,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22797:{billingAgreement:this.terms,offerId:22797,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22799:{billingAgreement:this.terms,offerId:22799,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},22800:{billingAgreement:this.terms,offerId:22800,promoDuration:"1 year",paymentDescription:"$3 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"3.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}},2965:{23494:{billingAgreement:this.terms,offerId:23494,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23495:{billingAgreement:this.terms,offerId:23495,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23496:{billingAgreement:this.terms,offerId:23496,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23497:{billingAgreement:this.terms,offerId:23497,promoDuration:"1 year",paymentDescription:"$1 for 1 year introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}},2966:{23498:{billingAgreement:this.terms,offerId:23498,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23499:{billingAgreement:this.terms,offerId:23499,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23500:{billingAgreement:this.terms,offerId:23500,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23501:{billingAgreement:this.terms,offerId:23501,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}}},23499:{billingAgreement:this.terms,offerId:23499,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23500:{billingAgreement:this.terms,offerId:23500,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},23501:{billingAgreement:this.terms,offerId:23501,promoDuration:"2 year",paymentDescription:"$2 for 2 years introductory rate, then your payment method will be charged $21.99 monthly",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"2.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"2",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"21.99",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"30",type:"final"}},4214:{11082:{billingAgreement:this.terms,offerId:11082,promoDuration:"1 year",paymentDescription:"$0.01 for 1 year introductory rate, then your payment method will be charged $19.96 every four weeks",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"19.96",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"28",type:"final"}}},10493:{22449:{billingAgreement:this.terms,offerId:22449,promoDuration:"1 year",paymentDescription:"$0.01 for 1 year introductory rate, then your payment method will be charged $19.96 every four weeks",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"0.01",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"19.96",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"28",type:"final"}}},10511:{22498:{billingAgreement:this.terms,offerId:22498,promoDuration:"1 year",paymentDescription:"$1.00 for 1 year introductory rate, then your payment method will be charged $4.99 per week, billed every 4 weeks ($19.96 total)",trialIsRecurring:!0,promo:{label:"Standard Digital: 1 Year Trial",amount:"1.00",type:"final",paymentTiming:"recurring",recurringPaymentIntervalUnit:"year",recurringPaymentIntervalCount:"1",recurringPaymentCount:"1"},regularBilling:{label:"Regular Billing",amount:"19.96",paymentTiming:"recurring",recurringPaymentIntervalUnit:"day",recurringPaymentIntervalCount:"28",type:"final"}}}};if(r[e]&&r[e][t]){var n=r[e][t],o=n.promoDuration,i=this.getFutureDate(o);return n.regularBilling.recurringPaymentStartDate=i,n.trialIsRecurring&&(n.promo.recurringPaymentEndDate=i),n}return null}},{key:"getFutureDate",value:function(e){var t=l(e.split(" "),2),r=t[0],n=t[1],o=parseInt(r,10),i=new Date,a=n.toLowerCase();return a.startsWith("year")?i.setFullYear(i.getFullYear()+o):a.startsWith("month")?i.setMonth(i.getMonth()+o):a.startsWith("week")?i.setDate(i.getDate()+7*o):a.startsWith("day")&&i.setDate(i.getDate()+o),i.toISOString()}},{key:"thirdPartyPaymentButtonClicked",value:(r=n(o.mark(function e(){var t,r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{Ea("APPLE PAY | transaction button clicked - payment processing started"),t=Fa()?"TribuneCEP":"MNG",r=this.paywayRequestToken,(new Date).toISOString(),n=[],console.log("rq apple offer details ",this.offerDetails),this.offerDetails.promo&&n.push(this.offerDetails.promo),n.push(this.offerDetails.regularBilling),i={requiredBillingContactFields:["postalAddress","phone"],countryCode:"US",currencyCode:"USD",merchantCapabilities:["supports3DS","supportsDebit","supportsCredit"],supportedNetworks:["visa","masterCard","amex","discover"],lineItems:n,recurringPaymentRequest:{paymentDescription:this.offerDetails.paymentDescription,regularBilling:this.offerDetails.regularBilling,trialBilling:this.offerDetails.promo,billingAgreement:this.offerDetails.billingAgreement,managementURL:"https://myaccount.".concat(this.siteNameParsed),tokenNotificationURL:"https://aws-mng-prod.subscriberconcierge.com/Webhooks/Apple/V2/".concat(t,"/").concat(this.siteCode,"/").concat(this.siteCode)},total:{label:this.offerDetails.promo.label,amount:this.offerDetails.promo.amount}},this.initApplePaySession(i,r)}catch(e){document.querySelector(".error").style.display="block",Ea("APPLE PAY ERROR | Failed to initialize payment options",e)}case 1:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"initApplePaySession",value:(t=n(o.mark(function e(t,r){var i,a,s,c,l=this;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{Ea("APPLE PAY | Apple Pay startign session with req object ",t),i=new ApplePaySession(1,t),a="".concat(va.A.entitlementsEndpoint,"payway/create_subscription"),s=new URL(this.safeURL),c=s.hostname,i.onvalidatemerchant=function(){var e=n(o.mark(function e(t){var n,a,s,u,d,p;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Ea("APPLE PAY | Apple Pay validating merchant ",t),e.prev=1,n={request:"getApplePaySession",url:t.validationURL,domain:c,merchantIdentifier:"merchant.com.payway.mng",paywayRequestToken:r},a=JSON.stringify(n),Ea("APPLE PAY | Apple Pay validating merchant req body ",n),e.next=2,fetch(l.serviceUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:a});case 2:if((s=e.sent).ok){e.next=4;break}return e.next=3,s.text();case 3:return u=e.sent,document.querySelector(".error").style.display="block",Ea("APPLE PAY ERROR | Merchant validation error: ".concat(s.status," ").concat(u)),e.abrupt("return");case 4:return e.next=5,s.text();case 5:d=e.sent,d=JSON.parse(d);try{i.completeMerchantValidation(JSON.parse(d.appleSessionToken))}catch(e){document.querySelector(".error").style.display="block",Ea("APPLE PAY ERROR | Cannot init complete merch validation ",e)}e.next=7;break;case 6:e.prev=6,p=e.catch(1),document.querySelector(".error").style.display="block",Ea("APPLE PAY ERROR | Apple Validation reply error: ".concat(p.message));case 7:case"end":return e.stop()}},e,null,[[1,6]])}));return function(t){return e.apply(this,arguments)}}(),i.onpaymentauthorized=function(){var e=n(o.mark(function e(t){var n,s,c,u,d,p,m,h,f,y,g,A,w,b,S,v,E,R,T,P,_;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return w={accountInputMode:"applePay",paywayRequestToken:l.paywayRequestToken,transactionName:l.transactionName,transactionSourceId:window.apple_config.sourceId?parseInt(window.apple_config.sourceId,10):"0",request:"sendQueuedTransaction",applePayToken:t.payment.token.paymentData,merchantIdentifier:"merchant.com.payway.mng",cardAccount:{firstName:(null===(n=t.payment.billingContact)||void 0===n?void 0:n.givenName)||"",lastName:(null===(s=t.payment.billingContact)||void 0===s?void 0:s.familyName)||"",address:(null===(c=t.payment.billingContact)||void 0===c||null===(c=c.addressLines)||void 0===c?void 0:c.join(" "))||"",city:(null===(u=t.payment.billingContact)||void 0===u?void 0:u.locality)||"",state:(null===(d=t.payment.billingContact)||void 0===d?void 0:d.administrativeArea)||"",zip:(null===(p=t.payment.billingContact)||void 0===p?void 0:p.postalCode)||"",email:l.loggedInUserData.email||"",phone:t.payment.billingContact.phoneNumber}},b={paywayRequestToken:r,applePayData:t.payment,firstName:(null===(m=t.payment.billingContact)||void 0===m?void 0:m.givenName)||"",lastName:(null===(h=t.payment.billingContact)||void 0===h?void 0:h.familyName)||"",address:(null===(f=t.payment.billingContact)||void 0===f||null===(f=f.addressLines)||void 0===f?void 0:f.join(" "))||"",city:(null===(y=t.payment.billingContact)||void 0===y?void 0:y.locality)||"",state:(null===(g=t.payment.billingContact)||void 0===g?void 0:g.administrativeArea)||"",zip:(null===(A=t.payment.billingContact)||void 0===A?void 0:A.postalCode)||"",email:l.email||"",offerId:l.offerId,offerGroupId:l.offerGroup,uuid:l.uuid||"",domain:l.siteNameParsed,paymentAmount:l.offerDetails.promo.amount,sourceId:l.sourceId,phone:t.payment.billingContact.phoneNumber?t.payment.billingContact.phoneNumber:""},e.prev=1,(S=document.querySelector(l.buttonSelector)).style.setProperty("display","none","important"),S.removeEventListener("click",l.onApplePayClick),l.addLoadMessage(),e.next=2,fetch(l.billingUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});case 2:return v=e.sent,e.next=3,v.text();case 3:if(e.sent,Ea("APPLE PAY | Response from Payway"),e.prev=4,Ea("APPLE PAY | starting entitler req to naviga for new sub start",b),!v.ok){e.next=11;break}return i.completePayment(ApplePaySession.STATUS_SUCCESS),e.next=5,fetch(a,{method:"POST",headers:{"X-Api-Key":va.A.entitlementsApiKey},body:JSON.stringify(b)});case 5:if(e.sent.ok){e.next=6;break}return Ea("APPLE PAY | response from entitler NOT OK!!"),document.querySelector(".error").style.display="block",e.abrupt("return");case 6:return window.MG2DL.push({event:"g2i_subscription_success",payment_type:null===(E=l.offerDetails)||void 0===E||null===(E=E.regularBilling)||void 0===E?void 0:E.paymentTiming,sp_offerPlanName:"apple_pay"}),Ea("APPLE PAY | response from entitler and refreshing token"),e.next=7,Xa();case 7:if(R=e.sent,Ea("APPLE PAY | getting tokens auth data"),!R){e.next=10;break}return e.next=8,cs({idToken:R.idToken});case 8:if(!(T=e.sent)){e.next=10;break}return Ea("APPLE PAY | Created new token for new Apple subscriber user"),e.next=9,us();case 9:ls(T),window.Connext.CloseTemplates();case 10:e.next=12;break;case 11:document.querySelector(".error").style.display="block",i.completePayment(ApplePaySession.STATUS_FAILURE);case 12:e.next=14;break;case 13:e.prev=13,P=e.catch(4),document.querySelector(".error").style.display="block",Ea("APPLE PAY ERROR | Naviga failed category ",P.error.category),Ea("APPLE PAY ERROR | Naviga failed custom status code ",P.error.customStatusCode),Ea("APPLE PAY ERROR | Naviga failed message ",P.error.message),Ea("APPLE PAY ERROR | Naviga failed message ",P.error.errCode);case 14:e.next=16;break;case 15:e.prev=15,_=e.catch(1),Ea("APPLE PAY ERROR | Payment error: ".concat(_));case 16:case"end":return e.stop()}},e,null,[[1,15],[4,13]])}));return function(t){return e.apply(this,arguments)}}(),i.oncancel=function(e){Ea("APPLE PAY | User canceled Apple Pay session.")};try{i.begin()}catch(e){Ea("APPLE PAY ERROR | Apple Pay session failed to start:",e)}}catch(e){Ea("APPLE PAY ERROR | Apple Failed to process payment",e)}case 1:case"end":return e.stop()}},e,this)})),function(e,r){return t.apply(this,arguments)})},{key:"getBillingDataFromEntitlerWithOfferCode",value:(e=n(o.mark(function e(){var t,r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(va.A.entitlementsEndpoint,"getNavigaoffer"),r={offerIdCode:this.offerCodeId,offerGroupCode:"1234"},e.next=1,fetch(t,{method:"POST",headers:{"X-Api-Key":va.A.entitlementsApiKey},body:JSON.stringify(r)});case 1:return n=e.sent,e.next=2,n.json();case 2:return i=e.sent,e.abrupt("return",i);case 3:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"addLoadMessage",value:function(){var e=document.querySelector("#adhoc__newbody"),t=document.createElement("div");t.id="creatingSubtext",t.textContent="Creating Your Subscription...",t.style.fontWeight="700",t.style.fontSize="20px",t.style.padding="1rem 0";var r=e.querySelector("p.terms");r?r.insertAdjacentElement("afterend",t):e.appendChild(t)}}]);var e,t,r,i}();const ms=ps;var hs=function(){document.addEventListener("onPaywallShown",function(){var e=n(o.mark(function e(t){var r,n,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ea("APPLE PAY | Apple Pay script loaded - Paywall shown, check for apple pay button and hide"),(r=document.querySelector(".error"))&&(r.style.display="none"),(n=document.querySelector(".apple-pay-button"))&&n.style.setProperty("display","none","important"),!window.ApplePaySession){e.next=2;break}return Ea("APPLE PAY | Apple Pay session exists on window, continue"),e.next=1,Xa();case 1:i=e.sent,i.idToken?window.ApplePaySession.canMakePaymentsWithActiveCard("merchant.com.payway.mng")?(Ea("APPLE PAY | User logged in and can make payments - show button"),new ms(".apple-pay-button","Apple").queuePaywaySession()):Ea("APPLE PAY | Apple pay pay not set up exit"):(Ea("APPLE PAY | not logged in, exit"),window.MG2DL.push({event:"g2i_action_not_shown",actionType:"paywall",actionName:"apple_pay"})),e.next=3;break;case 2:Ea("APPLE PAY | Apple Pay session NOT on window, exit"),n.remove(),window.MG2DL.push({event:"g2i_action_not_shown",actionType:"paywall",actionName:"apple_pay"});case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",hs,{once:!0}):hs()})()})(); //# sourceMappingURL=mng-digisubs.apple.bundle.js.map; /*! 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 X(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:X(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 C(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 _(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 m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(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:A(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):A(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(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<=I)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 E(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 I=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){j(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){j(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 D(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 M(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){F(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){F(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 D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(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 j(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){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,o,i)}function F(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 F(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=K(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function X(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(V,"")).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,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}}},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:()=>Ai,hasStandardBrowserEnv:()=>bi,hasStandardBrowserWebWorkerEnv:()=>vi,navigator:()=>Ei,origin:()=>Si});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 w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},A={},E={};Object.defineProperty(E,"__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}();E.default=function(){return b.getInstance()};var v=w&&w.__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=w&&w.__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?O:this.storageHandler,r="browser-tabs-lock-key-"+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;C=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;ce=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 Z("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",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 Z("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",o);return}throw Z("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",o)}catch(e){if(r)throw fe(e.message,r,o);throw e}}function Ae(e,t,n,r){try{if("string"!=typeof e)throw Z("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",r);if(0===e.length)throw Z("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",r)}catch(e){if(n)throw fe(e.message,n,r);throw e}}function Ee(e){!function(e,t){if(Fe(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 fe(t,lt,e)}(e,t)}(e,"application/json")}function be(){return le(crypto.getRandomValues(new Uint8Array(32)))}function ve(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 de("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 de("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 de("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 de("unsupported CryptoKey algorithm name",{cause:e})}}function Se(e){const t=null==e?void 0:e[ee];return"number"==typeof t&&Number.isFinite(t)?t:0}function Re(e){const t=null==e?void 0:e[te];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function Te(){return Math.floor(Date.now()/1e3)}function Oe(e){if("object"!=typeof e||null===e)throw Z('"as" must be an object',"ERR_INVALID_ARG_TYPE");Ae(e.issuer,'"as.issuer"')}function Ie(e){if("object"!=typeof e||null===e)throw Z('"client" must be an object',"ERR_INVALID_ARG_TYPE");Ae(e.client_id,'"client.client_id"')}function Ne(e){return Ae(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function _e(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&Ae(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw Z("".concat(t," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),"private"!==e.type)throw Z("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:ve(n),kid:r},u=function(e,t){const n=Te()+Se(t);return{jti:be(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[re]||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 Z('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const r="".concat(le(se(JSON.stringify(e))),".").concat(le(se(JSON.stringify(t)))),o=le(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:bt(e)};case"RSA-PSS":switch(Et(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 de("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return Et(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new de("unsupported CryptoKey algorithm name",{cause:e})}(n),n,se(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Ce=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Le(e,t){if(t&&"https:"!==e.protocol)throw fe("only requests to HTTPS are allowed",ht,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw fe("only HTTP and HTTPS requests are allowed",ft,e)}function ke(e,t,n,r){let o;if("string"!=typeof e||!Ce(e))throw fe("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?mt:wt,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Le(o,r),o}function Pe(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?ke(e.mtls_endpoint_aliases[t],t,n,r):ke(e[t],t,n,r)}class xe extends Error{constructor(e,t){var n;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"error",void 0),j(this,"status",void 0),j(this,"error_description",void 0),j(this,"response",void 0),this.name=this.constructor.name,this.code=it,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 Ue extends Error{constructor(e,t){var n,r;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"error",void 0),j(this,"error_description",void 0),this.name=this.constructor.name,this.code=st,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 Be extends Error{constructor(e,t){var n;super(e,t),j(this,"cause",void 0),j(this,"code",void 0),j(this,"response",void 0),j(this,"status",void 0),this.name=this.constructor.name,this.code=ot,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 De=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),Me=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),He=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),Ge=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Ke(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!z(e,Response))throw Z('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let r=t;for(;r;){var o;let t=r.match(De);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(Me)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(He)){if(r.match(Ge)){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 Be("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){At(e),Ee(e);try{const t=await e.clone().json();if(pe(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 xe("server responded with an error in the response body",{cause:t,response:e});throw fe('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),dt,e)}}function je(e){if(!$e.has(e))throw Z('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function Fe(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function We(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[ne])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:ge(r,null==a?void 0:a.signal)})}async function Ve(e,t,n,r,o,i){var a;const s=Pe(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[Q]));o.set("grant_type",r);const c=ye(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(je(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await We(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const Xe=new WeakMap,Je=new WeakMap;function Ye(e){if(!e.id_token)return;const t=Xe.get(e);if(!t)throw Z('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function qe(e,t,n,r,o,i){if(Oe(e),Ie(t),!z(n,Response))throw Z('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Ke(n,200,"Token Endpoint"),At(n);const a=await Ot(n);if(Ae(a.access_token,'"response" body "access_token" property',ut,{body:a}),Ae(a.token_type,'"response" body "token_type" property',ut,{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;we(e,!0,'"response" body "expires_in" property',ut,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&Ae(a.refresh_token,'"response" body "refresh_token" property',ut,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw fe('"response" body "scope" property must be a string',ut,{body:a});if(void 0!==a.id_token){Ae(a.id_token,'"response" body "id_token" property',ut,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(we(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 de("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw fe("Invalid JWT",ut,e);try{JSON.parse(se(le(s)))}catch(e){throw fe("failed to parse JWT Header body as base64url encoded JSON",ct,e)}if(!pe(i))throw fe("JWT Header must be a top level object",ut,e);if(t(i),void 0!==i.crit)throw new de('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(se(le(c)))}catch(e){throw fe("failed to parse JWT Payload body as base64url encoded JSON",ct,e)}if(!pe(a))throw fe("JWT Payload must be a top level object",ut,e);const l=Te()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw fe('unexpected JWT "exp" (expiration time) claim type',ut,{claims:a});if(a.exp<=l-r)throw fe('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',pt,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw fe('unexpected JWT "iat" (issued at) claim type',ut,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw fe('unexpected JWT "iss" (issuer) claim type',ut,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw fe('unexpected JWT "nbf" (not before) claim type',ut,{claims:a});if(a.nbf>l+r)throw fe('unexpected JWT "nbf" (not before) claim value',pt,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw fe('unexpected JWT "aud" (audience) claim type',ut,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,vt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Se(t),Re(t),o).then(tt.bind(void 0,i)).then(Ze.bind(void 0,e)).then(ze.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw fe('ID Token "aud" (audience) claim includes additional untrusted audiences',yt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw fe('unexpected ID Token "azp" (authorized party) claim value',yt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&we(s.auth_time,!0,'ID Token "auth_time" (authentication time)',ut,{claims:s}),Je.set(n,c),Xe.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 de("unsupported `token_type` value",{cause:{body:a}});return a}function ze(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw fe('unexpected JWT "aud" (audience) claim value',yt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw fe('unexpected JWT "aud" (audience) claim value',yt,{expected:e,claims:t.claims,claim:"aud"});return t}function Ze(e,t){var n,r;const o=null!==(null===e[Nt]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw fe('unexpected JWT "iss" (issuer) claim value',yt,{expected:o,claims:t.claims,claim:"iss"});return t}const $e=new WeakSet,Qe=Symbol(),et={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 tt(e,t){for(const n of e)if(void 0===t.claims[n])throw fe('JWT "'.concat(n,'" (').concat(et[n],") claim missing"),ut,{claims:t.claims});return t}const nt=Symbol(),rt=Symbol();const ot="OAUTH_WWW_AUTHENTICATE_CHALLENGE",it="OAUTH_RESPONSE_BODY_ERROR",at="OAUTH_UNSUPPORTED_OPERATION",st="OAUTH_AUTHORIZATION_RESPONSE_ERROR",ct="OAUTH_PARSE_ERROR",ut="OAUTH_INVALID_RESPONSE",lt="OAUTH_RESPONSE_IS_NOT_JSON",dt="OAUTH_RESPONSE_IS_NOT_CONFORM",ht="OAUTH_HTTP_REQUEST_FORBIDDEN",ft="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",pt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",yt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",gt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",mt="OAUTH_MISSING_SERVER_METADATA",wt="OAUTH_INVALID_SERVER_METADATA";function At(e){if(e.bodyUsed)throw Z('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function Et(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new de("unsupported ".concat(t.name," modulusLength"),{cause:e})}function bt(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 de("unsupported ECDSA namedCurve",{cause:e})}}function vt(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw fe('unexpected JWT "alg" header parameter',ut,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw fe('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 fe('unexpected JWT "alg" header parameter',ut,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw fe('unexpected JWT "alg" header parameter',ut,{header:r,expected:e,reason:"client configuration"})}function St(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw fe('"'.concat(t,'" parameter must be provided only once'),ut);return n}const Rt=Symbol(),Tt=Symbol();async function Ot(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ee;try{await e.json()}catch(t){throw n(e),fe('failed to parse "response" body as JSON',ct,t)}if(!pe(t))throw fe('"response" body must be a top level object',ut,{body:t});return t}const It=Symbol(),Nt=Symbol(),_t=new TextEncoder,Ct=new TextDecoder;function Lt(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 kt(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e2&&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}}),j(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),j(this,"claim",void 0),j(this,"reason",void 0),j(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}j(Ut,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Bt 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}}),j(this,"code","ERR_JWT_EXPIRED"),j(this,"claim",void 0),j(this,"reason",void 0),j(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}j(Bt,"code","ERR_JWT_EXPIRED");class Dt extends xt{constructor(){super(...arguments),j(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}j(Dt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Mt extends xt{constructor(){super(...arguments),j(this,"code","ERR_JOSE_NOT_SUPPORTED")}}j(Mt,"code","ERR_JOSE_NOT_SUPPORTED"),j(class extends xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),j(class extends xt{constructor(){super(...arguments),j(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Ht extends xt{constructor(){super(...arguments),j(this,"code","ERR_JWS_INVALID")}}j(Ht,"code","ERR_JWS_INVALID");class Gt extends xt{constructor(){super(...arguments),j(this,"code","ERR_JWT_INVALID")}}j(Gt,"code","ERR_JWT_INVALID"),j(class extends xt{constructor(){super(...arguments),j(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Kt extends xt{constructor(){super(...arguments),j(this,"code","ERR_JWKS_INVALID")}}j(Kt,"code","ERR_JWKS_INVALID");class jt 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),j(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}j(jt,"code","ERR_JWKS_NO_MATCHING_KEY");class Ft 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),j(this,Symbol.asyncIterator,void 0),j(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}j(Ft,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Wt extends xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWKS_TIMEOUT")}}j(Wt,"code","ERR_JWKS_TIMEOUT");class Vt extends xt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),j(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}j(Vt,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Xt=function(e){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},Jt=(e,t)=>e.name===t;function Yt(e){return parseInt(e.name.slice(4),10)}function qt(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 zt=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},$t=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),Qt=e=>Zt(e)||$t(e);function en(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 tn=(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)},on=(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=>kt(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){rn(e,48,"Invalid PKCS#8 structure"),nn(e),rn(e,2,"Expected version field");const t=nn(e);e.pos+=t,rn(e,48,"Expected algorithm identifier");nn(e);e.pos}(t),(e=>{const t=(e=>{rn(e,6,"Expected algorithm OID");const t=nn(e);return on(e,t)})(e);if(tn(t,[43,101,110]))return"X25519";if(!tn(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");rn(e,6,"Expected curve OID");const n=nn(e),r=on(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(tn(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 Mt("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 Mt('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)};async function sn(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:r,keyUsages:o}=function(e){let t,n;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},n=e.priv?["sign"]:["verify"];break;default:throw new Mt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(e.alg.slice(-3),10)||1)},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Mt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},n=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},n=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Mt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new Mt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Mt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),i=W({},e);return"AKP"!==i.kty&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,null!==(t=e.ext)&&void 0!==t?t:!e.d&&!e.priv,null!==(n=e.key_ops)&&void 0!==n?n:o)}const cn=e=>en(e)&&"string"==typeof e.kty;let un;const ln=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];un||(un=new WeakMap);let o=un.get(e);if(null!=o&&o[n])return o[n];const i=await sn(W(W({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:un.set(e,{[n]:i}),i};const dn=e=>null==e?void 0:e[Symbol.toStringTag],hn=(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 fn,pn;let yn,gn;if("undefined"==typeof navigator||null===(fn=navigator.userAgent)||void 0===fn||null===(pn=fn.startsWith)||void 0===pn||!pn.call(fn,"Mozilla/5.0 ")){const e="v6.8.1";gn="".concat("openid-client","/").concat(e),yn={"user-agent":gn}}const mn=e=>wn.get(e);let wn,An;function En(e){return void 0!==e?Ne(e):(An||(An=new WeakMap),(e,t,n,r)=>{let o;return(o=An.get(t))||(function(e,t){if("string"!=typeof e)throw Rn("".concat(t," must be a string"),Sn);if(0===e.length)throw Rn("".concat(t," must not be empty"),vn)}(t.client_secret,'"metadata.client_secret"'),o=Ne(t.client_secret),An.set(t,o)),o(e,t,n,r)})}const bn=ne,vn="ERR_INVALID_ARG_VALUE",Sn="ERR_INVALID_ARG_TYPE";function Rn(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class Tn extends Error{constructor(e,t){var n;super(e,t),j(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 On(e,t,n){return new Tn(e,{cause:t,code:n})}function In(e){if(e instanceof TypeError||e instanceof Tn||e instanceof xe||e instanceof Ue||e instanceof Be)throw e;if(e instanceof he)switch(e.code){case ht:throw On("only requests to HTTPS are allowed",e,e.code);case ft:throw On("only requests to HTTP or HTTPS are allowed",e,e.code);case dt:throw On("unexpected HTTP response status code",e.cause,e.code);case lt:throw On("unexpected response content-type",e.cause,e.code);case ct:throw On("parsing error occured",e,e.code);case ut:throw On("invalid response encountered",e,e.code);case yt:throw On("unexpected JWT claim value encountered",e,e.code);case gt:throw On("unexpected JSON attribute value encountered",e,e.code);case pt:throw On("JWT timestamp claim value failed validation",e,e.code);default:throw On(e.message,e,e.code)}if(e instanceof de)throw On("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw On("runtime operation error",e,at);case"NotSupportedError":throw On("runtime unsupported operation",e,at);case"TimeoutError":throw On("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw On("operation aborted",e,"OAUTH_ABORT")}throw new Tn("something went wrong",{cause:e})}async function Nn(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw Rn('"server" must be an instance of URL',Sn);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 Z('"'.concat("issuerIdentifier",'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");Le(e,!0!==(null==r?void 0:r[Q]));const o=n(new URL(e.href)),i=ye(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[ne])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:ge(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=me("".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=me("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw Z('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[ne]:null==t?void 0:t[bn],[Q]:null==t||null===t.execute||void 0===r?void 0:r.includes(Bn),signal:a,headers:new Headers(yn)}):((null==t?void 0:t[bn])||fetch)((Le(e,null==t||null===t.execute||void 0===c||!c.includes(Bn)),e.href),{headers:Object.fromEntries(new Headers(W({accept:"application/json"},yn)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==It)throw Z('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!z(t,Response))throw Z('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(200!==t.status)throw fe('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',dt,t);At(t);const r=await Ot(t);if(Ae(r.issuer,'"response" body "issuer" property',ut,{body:r}),n!==It&&new URL(r.issuer).href!==n.href)throw fe('"response" body "issuer" property does not match the expected value',gt,{expected:n.href,body:r,attribute:"issuer"});return r}(It,e)).catch(In);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[_n]=!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 Tn("discovered metadata issuer does not match the expected issuer",{code:gt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Cn(i,t,n,r);let s=mn(a);if(null!=o&&o[bn]&&(s.fetch=o[bn]),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 _n=Symbol();class Cn{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw Rn('"clientId" must be a non-empty string',Sn);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 Rn('"clientId" and "metadata.client_id" must be the same',vn);const u=W(W({},structuredClone(n)),{},{client_id:t});let l;u[ee]=null!==(i=null===(a=n)||void 0===a?void 0:a[ee])&&void 0!==i?i:0,u[te]=null!==(s=null===(c=n)||void 0===c?void 0:c[te])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?En(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const h=structuredClone(e);_n in e&&(h[Nt]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let f=Object.freeze(h);wn||(wn=new WeakMap),wn.set(this,{__proto__:null,as:f,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(mn(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(mn(this).c)}get timeout(){return mn(this).timeout}set timeout(e){mn(this).timeout=e}get[bn](){return mn(this).fetch}set[bn](e){mn(this).fetch=e}}function Ln(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 Ye(this)}catch(e){return}}}}}(e))}async function kn(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 he("invalid Retry-After header value",{cause:e});a>t&&await Pn(a-t,n)}function Pn(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 xn(e,t){jn(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=mn(e);return async function(e,t,n,r,o){Oe(e),Ie(t);const i=Pe(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[Q])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=ye(null==o?void 0:o.headers);return s.set("accept","application/json"),We(e,t,n,i,a,s,o)}(n,r,o,t,{[ne]:i,[Q]:!a,headers:new Headers(yn),signal:Fn(s)}).then(e=>async function(e,t,n){if(Oe(e),Ie(t),!z(n,Response))throw Z('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Ke(n,200,"Backchannel Authentication Endpoint"),At(n);const r=await Ot(n);Ae(r.auth_req_id,'"response" body "auth_req_id" property',ut,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return we(o,!0,'"response" body "expires_in" property',ut,{body:r}),r.expires_in=o,void 0!==r.interval&&we(r.interval,!1,'"response" body "interval" property',ut,{body:r}),r}(n,r,e)).catch(In)}async function Un(e,t,n,r){var o,i;jn(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 Pn(a,s)}catch(e){In(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:h,nonRepudiation:f,timeout:p,decrypt:y}=mn(e),g=(o,i)=>Un(e,W(W({},t),{},{interval:o}),n,W(W({},r),{},{signal:s,flag:i})),m=await async function(e,t,n,r,o){Oe(e),Ie(t),Ae(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Ve(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[ne]:d,[Q]:!h,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(yn),signal:s.aborted?s:Fn(p)}).catch(In);var w;if(503===m.status&&m.headers.has("retry-after"))return await kn(m,a,s,!0),await(null===m.body||void 0===w?void 0:w.cancel()),g(a);const A=async function(e,t,n,r){return qe(e,t,n,void 0,null==r?void 0:r[oe],null==r?void 0:r.recognizedTokenTypes)}(c,u,m,{[oe]:y});let E;try{await A}catch(e){if(Wn(e,r))return g(a,Vn);if(e instanceof xe)switch(e.error){case"slow_down":0;case"authorization_pending":return await kn(e.response,a,s),g(a)}In(e)}return E.id_token&&await(null==f?void 0:f(m)),Ln(E),E}function Bn(e){mn(e).tlsOnly=!1}async function Dn(e,t,n,r,o){if(jn(e),!((null==o?void 0:o.flag)===Vn||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw Rn('"currentUrl" must be an instance of URL, or Request',Sn);let i,a;const{as:s,c,auth:u,fetch:l,tlsOnly:d,jarm:h,hybrid:f,nonRepudiation:p,timeout:y,decrypt:g,implicit:m}=mn(e);if((null==o?void 0:o.flag)===Vn)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 Z("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if("application/x-www-form-urlencoded"!==Fe(e))throw Z("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(e){if(e.bodyUsed)throw Z("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{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 Rn("unexpected Request HTTP method",vn)}}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!!m:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,n,r){if(Oe(e),Ie(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw Z('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(St(n,"response"))throw fe('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',ut,{parameters:n});const o=St(n,"iss"),i=St(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw fe('response parameter "iss" (issuer) missing',ut,{parameters:n});if(o&&o!==e.issuer)throw fe('unexpected "iss" (issuer) response parameter value',ut,{expected:e.issuer,parameters:n});switch(r){case void 0:case Tt:if(void 0!==i)throw fe('unexpected "state" response parameter encountered',ut,{expected:void 0,parameters:n});break;case Rt:break;default:if(Ae(r,'"expectedState" argument'),i!==r)throw fe(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',ut,{expected:r,parameters:n})}if(St(n,"error"))throw new Ue("authorization response from the server is an error",{cause:n});const a=St(n,"id_token"),s=St(n,"token");if(void 0!==a||void 0!==s)throw new de("implicit and hybrid flows are not supported");return new URLSearchParams(n),$e.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){In(e)}}}const w=await async function(e,t,n,r,o,i,a){if(Oe(e),Ie(t),!$e.has(r))throw Z('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");Ae(o,'"redirectUri"');const s=St(r,"code");if(!s)throw fe('no authorization code in "callbackParameters"',ut);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==Qe&&(Ae(i,'"codeVerifier"'),c.set("code_verifier",i)),Ve(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||Qe,{additionalParameters:r,[ne]:l,[Q]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(yn),signal:Fn(y)}).catch(In);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const A=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 nt:break;default:Ae(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case rt:break;default:we(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await qe(e,t,n,s,i,a);Ae(c.id_token,'"response" body "id_token" property',ut,{body:c});const u=Ye(c);if(o!==rt){const e=Te()+Se(t),n=Re(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 qe(e,t,n,void 0,null==r?void 0:r[oe],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[oe]:l,recognizedTokenTypes:n})}).catch(In);return Ln(d),d}async function Jn(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;r"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 Mt('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)}(Ht,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 Ht('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Ht('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 Dt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Ht("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Ht("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(cn(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&hn(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(!Qt(t))throw new TypeError(zt(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(dn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(cn(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&hn(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)&&hn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Qt(t))throw new TypeError(zt(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(dn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(dn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(dn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(dn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(dn(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?Lt(e.protected):new Uint8Array,Lt("."),"string"==typeof e.payload?a?Lt(e.payload):_t.encode(e.payload):e.payload);let d;try{Pt(e.signature)}catch(e){throw new Ht("Failed to base64url decode the signature")}const h=await async function(e,t){if(e instanceof Uint8Array)return e;if(Zt(e))return e;if($t(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{un||(un=new WeakMap);let n=un.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("given KeyObject instance cannot be used for this algorithm")}e.toCryptoKey(e.asymmetricKeyType,o,r?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError("given KeyObject instance cannot be used for this algorithm");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("given KeyObject instance cannot be used for this algorithm");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("given KeyObject instance cannot be used for this algorithm")}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("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===n&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),"ES384"===t&&"P-384"===n&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),"ES512"===t&&"P-521"===n&&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("given KeyObject instance cannot be used for this algorithm");return n?n[t]=i:un.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return ln(e,n,t)}if(cn(e))return e.k?Pt(e.k):ln(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await Jn(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 Mt("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 Vt;let f;if(a)try{Pt(e.payload)}catch(e){throw new Ht("Failed to base64url decode the payload")}else"string"==typeof e.payload?_t.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?W(W({},p),{},{key:h}):p}const qn=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function zn(e){const t=qn.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 Zn=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function $n(e,t,n){var r;const o=await async function(e,t,n){if(e instanceof Uint8Array&&Ct.decode(e),"string"!=typeof e)throw new Ht("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:i,length:a}=e.split(".");if(3!==a)throw new Ht("Invalid Compact JWS");const s=await Yn({payload:o,protected:r,signature:i},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?W(W({},c),{},{key:s.key}):c}(e,t,n);if(null!==o.protectedHeader.crit&&void 0!==r&&r.includes("b64")&&!1===o.protectedHeader.b64)throw new Gt("JWTs MUST NOT use unencoded payload");const i=function(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Ct.decode(t))}catch(e){}if(!en(n))throw new Gt("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||Zn(e.typ)!==Zn(o)))throw new Ut('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 Ut('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new Ut('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new Ut('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!((e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e))))(n.aud,"string"==typeof c?[c]:c))throw new Ut('unexpected "aud" claim value',n,"aud","check_failed");let d;switch(typeof r.clockTolerance){case"string":zn(r.clockTolerance);break;case"number":r.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,f=(e=>Math.floor(e.getTime()/1e3))(h||new Date);if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new Ut('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new Ut('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>f+d)throw new Ut('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new Ut('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=f-d)throw new Bt('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=f-n.iat;if(e-d>("number"==typeof u?u:zn(u)))throw new Bt('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-d)throw new Ut('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}(o.protectedHeader,o.payload,n),a={payload:i,protectedHeader:o.protectedHeader};return"function"==typeof t?W(W({},a),{},{key:o.key}):a}function Qn(e){return en(e)}var er,tr,nr=new WeakMap,rr=new WeakMap;class or{constructor(e){if(G(this,nr,void 0),G(this,rr,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Qn)}(e))throw new Kt("JSON Web Key Set malformed");K(nr,this,structuredClone(e))}jwks(){return H(nr,this)}async getKey(e,t){const{alg:n,kid:r}=W(W({},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 Mt('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=H(nr,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 jt;if(1!==s){const e=new Ft,t=H(rr,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new X(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield D(ir(t,e,n))}catch(e){}}),e}return ir(H(rr,this),a,n)}}async function ir(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(!en(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 Pt(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Mt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return sn(W(W({},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 sn(W(W({},e),{},{ext:n}));case"EC":case"OKP":return sn(W(W({},e),{},{alg:t,ext:n}));default:throw new Mt('Unsupported "kty" (Key Type) Parameter value')}}(W(W({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new Kt("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function ar(e){const t=new or(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 sr;if("undefined"==typeof navigator||null===(er=navigator.userAgent)||void 0===er||null===(tr=er.startsWith)||void 0===tr||!tr.call(er,"Mozilla/5.0 ")){const e="v6.1.3";sr="".concat("jose","/").concat(e)}const cr=Symbol(),ur=Symbol();var lr=new WeakMap,dr=new WeakMap,hr=new WeakMap,fr=new WeakMap,pr=new WeakMap,yr=new WeakMap,gr=new WeakMap,mr=new WeakMap,wr=new WeakMap,Ar=new WeakMap;class Er{constructor(e,t){if(G(this,lr,void 0),G(this,dr,void 0),G(this,hr,void 0),G(this,fr,void 0),G(this,pr,void 0),G(this,yr,void 0),G(this,gr,void 0),G(this,mr,void 0),G(this,wr,void 0),G(this,Ar,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;K(lr,this,new URL(e.href)),K(dr,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),K(hr,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),K(fr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),K(gr,this,new Headers(null==t?void 0:t.headers)),sr&&!H(gr,this).has("User-Agent")&&H(gr,this).set("User-Agent",sr),H(gr,this).has("accept")||(H(gr,this).set("accept","application/json"),H(gr,this).append("accept","application/jwk-set+json")),K(mr,this,null==t?void 0:t[cr]),void 0!==(null==t?void 0:t[ur])&&(K(Ar,this,null==t?void 0:t[ur]),null==t?void 0:t[ur],H(fr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&en(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,en)&&(K(pr,this,H(Ar,this).uat),K(wr,this,ar(H(Ar,this).jwks))))}pendingFetch(){return!!H(yr,this)}coolingDown(){return"number"==typeof H(pr,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 Wt;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")}}(H(lr,this).href,H(gr,this),AbortSignal.timeout(H(dr,this)),H(mr,this)).then(e=>{K(wr,this,ar(e)),H(Ar,this)&&(H(Ar,this).uat=Date.now(),H(Ar,this).jwks=e),K(pr,this,Date.now()),K(yr,this,void 0)}).catch(e=>{throw K(yr,this,void 0),e})),await H(yr,this)}}const br=["mfaToken"],vr=["mfaToken"];var Sr,Rr,Tr,Or,Ir,Nr,_r,Cr,Lr=class extends Error{constructor(e,t){super(t),j(this,"code",void 0),this.name="NotSupportedError",this.code=e}},kr=class extends Error{constructor(e,t,n){super(t),j(this,"cause",void 0),j(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Pr=class extends kr{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},xr=class extends kr{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Ur=class extends kr{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Br=class extends kr{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Dr=class extends kr{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Mr=class extends Error{constructor(e){super(e),j(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Hr=class extends kr{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),j(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Gr=class extends kr{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},Kr=class extends kr{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},jr=class extends kr{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},Fr=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),j(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Wr(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>W(W({},e),{},{[t[0]]:t[1]}),{})}var Vr=class extends Error{constructor(e,t,n){super(t),j(this,"cause",void 0),j(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Xr=class extends Vr{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Jr=class extends Vr{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},Yr=class extends Vr{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},qr=class extends Vr{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function zr(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var Zr=(Sr=new WeakMap,Rr=new WeakMap,Tr=new WeakMap,class{constructor(e){var t;G(this,Sr,void 0),G(this,Rr,void 0),G(this,Tr,void 0),K(Sr,this,"https://".concat(e.domain)),K(Rr,this,e.clientId),K(Tr,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(H(Sr,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await H(Tr,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 Xr(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(zr)}async enrollAuthenticator(e){const t="".concat(H(Sr,this),"/mfa/associate"),{mfaToken:n}=e,r=V(e,br),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 H(Tr,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 Jr(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};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,r="".concat(H(Sr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await H(Tr,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 Yr(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(H(Sr,this),"/mfa/challenge"),{mfaToken:n}=e,r=V(e,vr),o={mfa_token:n,client_id:H(Rr,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await H(Tr,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 qr(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())}}),$r=class e{constructor(e,t,n,r,o,i,a){j(this,"accessToken",void 0),j(this,"idToken",void 0),j(this,"refreshToken",void 0),j(this,"expiresAt",void 0),j(this,"scope",void 0),j(this,"claims",void 0),j(this,"authorizationDetails",void 0),j(this,"tokenType",void 0),j(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}},Qr="openid profile email offline_access",eo=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 to(e){if(null==e)throw new Dr("subject_token is required");if("string"!=typeof e)throw new Dr("subject_token must be a string");if(0===e.trim().length)throw new Dr("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Dr("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Dr("subject_token must not include the 'Bearer ' prefix")}function no(e,t){if(t)for(const[n,r]of Object.entries(t))if(!eo.has(n))if(Array.isArray(r)){if(r.length>20)throw new Dr("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}Or=new WeakMap,Ir=new WeakMap,Nr=new WeakMap,_r=new WeakMap,Cr=new WeakSet;async function ro(){if(H(Or,this)&&H(Ir,this))return{configuration:H(Or,this),serverMetadata:H(Ir,this)};const e=await B(Cr,this,ao).call(this);return K(Or,this,await Nn(new URL("https://".concat(H(Nr,this).domain)),H(Nr,this).clientId,{use_mtls_endpoint_aliases:H(Nr,this).useMtls},e,{[bn]:H(Nr,this).customFetch})),K(Ir,this,H(Or,this).serverMetadata()),H(Or,this)[bn]=H(Nr,this).customFetch||fetch,{configuration:H(Or,this),serverMetadata:H(Ir,this)}}async function oo(e){var t,n;const{configuration:r}=await B(Cr,this,ro).call(this);if("audience"in e||"resource"in e)throw new Dr("audience and resource parameters are not supported for Token Vault exchanges");to(e.subjectToken);const o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==e.subjectTokenType&&void 0!==t?t:"urn:ietf:params:oauth:token-type:access_token",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),no(o,e.extra);try{const e=await Xn(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return $r.fromTokenEndpointResponse(e)}catch(t){throw new Dr("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function io(e){const{configuration:t}=await B(Cr,this,ro).call(this);to(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),no(n,e.extra);try{const e=await Xn(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return $r.fromTokenEndpointResponse(e)}catch(t){throw new Dr("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function ao(){if(!H(Nr,this).clientSecret&&!H(Nr,this).clientAssertionSigningKey&&!H(Nr,this).useMtls)throw new Fr;if(H(Nr,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=H(Nr,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,H(Nr,this).clientAssertionSigningAlg||"RS256"),e?function(e){return _e(e,void 0)}(e):En(H(Nr,this).clientSecret)}async function so(e){const{configuration:t}=await B(Cr,this,ro).call(this),n=be(),r=await function(e){return async function(e){return Ae(e,"codeVerifier"),le(await crypto.subtle.digest("SHA-256",se(e)))}(e)}(n),o=Wr(W(W({},H(Nr,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(W(W({scope:Qr},o),{},{client_id:H(Nr,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Kn(t,i):await Gn(t,i),codeVerifier:n}}function co(e,t){return function(){return e.apply(t,arguments)}}const{toString:uo}=Object.prototype,{getPrototypeOf:lo}=Object,{iterator:ho,toStringTag:fo}=Symbol,po=(yo=Object.create(null),e=>{const t=uo.call(e);return yo[t]||(yo[t]=t.slice(8,-1).toLowerCase())});var yo;const go=e=>(e=e.toLowerCase(),t=>po(t)===e),mo=e=>t=>typeof t===e,{isArray:wo}=Array,Ao=mo("undefined");function Eo(e){return null!==e&&!Ao(e)&&null!==e.constructor&&!Ao(e.constructor)&&So(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bo=go("ArrayBuffer");const vo=mo("string"),So=mo("function"),Ro=mo("number"),To=e=>null!==e&&"object"==typeof e,Oo=e=>{if("object"!==po(e))return!1;const t=lo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||fo in e||ho in e)},Io=go("Date"),No=go("File"),_o=go("Blob"),Co=go("FileList");const Lo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ko=void 0!==Lo.FormData?Lo.FormData:void 0,Po=go("URLSearchParams"),[xo,Uo,Bo,Do]=["ReadableStream","Request","Response","Headers"].map(go);function Mo(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),wo(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Go="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Ko=e=>!Ao(e)&&e!==Go;const jo=(Fo="undefined"!=typeof Uint8Array&&lo(Uint8Array),e=>Fo&&e instanceof Fo);var Fo;const Wo=go("HTMLFormElement"),Vo=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Xo=go("RegExp"),Jo=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mo(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Yo=go("AsyncFunction"),qo=(zo="function"==typeof setImmediate,Zo=So(Go.postMessage),zo?setImmediate:Zo?($o=`axios@${Math.random()}`,Qo=[],Go.addEventListener("message",({source:e,data:t})=>{e===Go&&t===$o&&Qo.length&&Qo.shift()()},!1),e=>{Qo.push(e),Go.postMessage($o,"*")}):e=>setTimeout(e));var zo,Zo,$o,Qo;const ei="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Go):"undefined"!=typeof process&&process.nextTick||qo,ti={isArray:wo,isArrayBuffer:bo,isBuffer:Eo,isFormData:e=>{let t;return e&&(ko&&e instanceof ko||So(e.append)&&("formdata"===(t=po(e))||"object"===t&&So(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&bo(e.buffer),t},isString:vo,isNumber:Ro,isBoolean:e=>!0===e||!1===e,isObject:To,isPlainObject:Oo,isEmptyObject:e=>{if(!To(e)||Eo(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:xo,isRequest:Uo,isResponse:Bo,isHeaders:Do,isUndefined:Ao,isDate:Io,isFile:No,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:_o,isRegExp:Xo,isFunction:So,isStream:e=>To(e)&&So(e.pipe),isURLSearchParams:Po,isTypedArray:jo,isFileList:Co,forEach:Mo,merge:function e(){const{caseless:t,skipUndefined:n}=Ko(this)&&this||{},r={},o=(o,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=t&&Ho(r,i)||i;Oo(r[a])&&Oo(o)?r[a]=e(r[a],o):Oo(o)?r[a]=e({},o):wo(o)?r[a]=o.slice():n&&Ao(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(Mo(t,(t,r)=>{n&&So(t)?Object.defineProperty(e,r,{value:co(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{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",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{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&&lo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:po,kindOfTest:go,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(wo(e))return e;let t=e.length;if(!Ro(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[ho]).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:Wo,hasOwnProperty:Vo,hasOwnProp:Vo,reduceDescriptors:Jo,freezeMethods:e=>{Jo(e,(t,n)=>{if(So(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];So(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 wo(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:Ho,global:Go,isContextDefined:Ko,isSpecCompliantForm:function(e){return!!(e&&So(e.append)&&"FormData"===e[fo]&&e[ho])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(To(e)){if(t.indexOf(e)>=0)return;if(Eo(e))return e;if(!("toJSON"in e)){t[r]=e;const o=wo(e)?[]:{};return Mo(e,(e,t)=>{const i=n(e,r+1);!Ao(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Yo,isThenable:e=>e&&(To(e)||So(e))&&So(e.then)&&So(e.catch),setImmediate:qo,asap:ei,isIterable:e=>null!=e&&So(e[ho])};class ni extends Error{static from(e,t,n,r,o,i){const a=new ni(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",{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(){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:ti.toJSONObject(this.config),code:this.code,status:this.status}}}ni.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ni.ERR_BAD_OPTION="ERR_BAD_OPTION",ni.ECONNABORTED="ECONNABORTED",ni.ETIMEDOUT="ETIMEDOUT",ni.ERR_NETWORK="ERR_NETWORK",ni.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ni.ERR_DEPRECATED="ERR_DEPRECATED",ni.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ni.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ni.ERR_CANCELED="ERR_CANCELED",ni.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ni.ERR_INVALID_URL="ERR_INVALID_URL";const ri=ni;var oi=n(8287).hp;function ii(e){return ti.isPlainObject(e)||ti.isArray(e)}function ai(e){return ti.endsWith(e,"[]")?e.slice(0,-2):e}function si(e,t,n){return e?e.concat(t).map(function(e,t){return e=ai(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ci=ti.toFlatObject(ti,{},null,function(e){return/^is[A-Z]/.test(e)});const ui=function(e,t,n){if(!ti.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ti.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ti.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ti.isSpecCompliantForm(t);if(!ti.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ti.isDate(e))return e.toISOString();if(ti.isBoolean(e))return e.toString();if(!s&&ti.isBlob(e))throw new ri("Blob is not supported. Use a Buffer instead.");return ti.isArrayBuffer(e)||ti.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):oi.from(e):e}function u(e,n,o){let s=e;if(ti.isReactNative(t)&&ti.isReactNativeBlob(e))return t.append(si(o,n,i),c(e)),!1;if(e&&!o&&"object"==typeof e)if(ti.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ti.isArray(e)&&function(e){return ti.isArray(e)&&!e.some(ii)}(e)||(ti.isFileList(e)||ti.endsWith(n,"[]"))&&(s=ti.toArray(e)))return n=ai(n),s.forEach(function(e,r){!ti.isUndefined(e)&&null!==e&&t.append(!0===a?si([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!ii(e)||(t.append(si(o,n,i),c(e)),!1)}const l=[],d=Object.assign(ci,{defaultVisitor:u,convertValue:c,isVisitable:ii});if(!ti.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ti.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),ti.forEach(n,function(n,i){!0===(!(ti.isUndefined(n)||null===n)&&o.call(t,n,ti.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function li(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function di(e,t){this._pairs=[],e&&ui(e,this,t)}const hi=di.prototype;hi.append=function(e,t){this._pairs.push([e,t])},hi.toString=function(e){const t=e?function(t){return e.call(this,t,li)}:li;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const fi=di;function pi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yi(e,t,n){if(!t)return e;const r=n&&n.encode||pi,o=ti.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):ti.isURLSearchParams(t)?t.toString():new fi(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const gi=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){ti.forEach(this.handlers,function(t){null!==t&&e(t)})}},mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},wi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:fi,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ai="undefined"!=typeof window&&"undefined"!=typeof document,Ei="object"==typeof navigator&&navigator||void 0,bi=Ai&&(!Ei||["ReactNative","NativeScript","NS"].indexOf(Ei.product)<0),vi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Si=Ai&&window.location.href||"http://localhost",Ri={...e,...wi};const Ti=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&&ti.isArray(r)?r.length:i,s)return ti.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&ti.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&ti.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 ti.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const Oi={transitional:mi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ti.isObject(e);o&&ti.isHTMLForm(e)&&(e=new FormData(e));if(ti.isFormData(e))return r?JSON.stringify(Ti(e)):e;if(ti.isArrayBuffer(e)||ti.isBuffer(e)||ti.isStream(e)||ti.isFile(e)||ti.isBlob(e)||ti.isReadableStream(e))return e;if(ti.isArrayBufferView(e))return e.buffer;if(ti.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ui(e,new Ri.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ri.isNode&&ti.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=ti.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ui(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(ti.isString(e))try{return(t||JSON.parse)(e),ti.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Oi.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ti.isResponse(e)||ti.isReadableStream(e))return e;if(e&&ti.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw ri.from(e,ri.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ri.classes.FormData,Blob:Ri.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ti.forEach(["delete","get","head","post","put","patch"],e=>{Oi.headers[e]={}});const Ii=Oi,Ni=ti.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"]),_i=Symbol("internals");function Ci(e){return e&&String(e).trim().toLowerCase()}function Li(e){return!1===e||null==e?e:ti.isArray(e)?e.map(Li):String(e)}function ki(e,t,n,r,o){return ti.isFunction(r)?r.call(this,t,n):(o&&(t=n),ti.isString(t)?ti.isString(r)?-1!==t.indexOf(r):ti.isRegExp(r)?r.test(t):void 0:void 0)}class Pi{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ci(t);if(!o)throw new Error("header name must be a non-empty string");const i=ti.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Li(e))}const i=(e,t)=>ti.forEach(e,(e,n)=>o(e,n,t));if(ti.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(ti.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((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]&&Ni[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(ti.isObject(e)&&ti.isIterable(e)){let n,r,o={};for(const t of e){if(!ti.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?ti.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=Ci(e)){const n=ti.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(ti.isFunction(t))return t.call(this,e,n);if(ti.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ci(e)){const n=ti.findKey(this,e);return!(!n||void 0===this[n]||t&&!ki(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ci(e)){const o=ti.findKey(n,e);!o||t&&!ki(0,n[o],o,t)||(delete n[o],r=!0)}}return ti.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&&!ki(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ti.forEach(this,(r,o)=>{const i=ti.findKey(n,o);if(i)return t[i]=Li(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]=Li(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ti.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ti.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=Ci(e);t[r]||(!function(e,t){const n=ti.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return ti.isArray(e)?e.forEach(r):r(e),this}}Pi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ti.reduceDescriptors(Pi.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),ti.freezeMethods(Pi);const xi=Pi;function Ui(e,t){const n=this||Ii,r=t||n,o=xi.from(r.headers);let i=r.data;return ti.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Bi(e){return!(!e||!e.__CANCEL__)}const Di=class extends ri{constructor(e,t,n){super(null==e?"canceled":e,ri.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Mi(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ri("Request failed with status code "+n.status,[ri.ERR_BAD_REQUEST,ri.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Hi=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)]},Ki=(e,t,n=3)=>{let r=0;const o=Hi(50,250);return Gi(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},ji=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Fi=e=>(...t)=>ti.asap(()=>e(...t)),Wi=Ri.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ri.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ri.origin),Ri.navigator&&/(msie|trident)/i.test(Ri.navigator.userAgent)):()=>!0,Vi=Ri.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];ti.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),ti.isString(r)&&s.push(`path=${r}`),ti.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),ti.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Xi(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ji=e=>e instanceof xi?{...e}:e;function Yi(e,t){t=t||{};const n={};function r(e,t,n,r){return ti.isPlainObject(e)&&ti.isPlainObject(t)?ti.merge.call({caseless:r},e,t):ti.isPlainObject(t)?ti.merge({},t):ti.isArray(t)?t.slice():t}function o(e,t,n,o){return ti.isUndefined(t)?ti.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!ti.isUndefined(t))return r(void 0,t)}function a(e,t){return ti.isUndefined(t)?ti.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 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,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(Ji(e),Ji(t),0,!0)};return ti.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=ti.hasOwnProp(c,r)?c[r]:o,a=i(e[r],t[r],r);ti.isUndefined(a)&&i!==s||(n[r]=a)}),n}const qi=e=>{const t=Yi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=xi.from(a),t.url=yi(Xi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),ti.isFormData(n))if(Ri.hasStandardBrowserEnv||Ri.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ti.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(Ri.hasStandardBrowserEnv&&(r&&ti.isFunction(r)&&(r=r(t)),r||!1!==r&&Wi(t.url))){const e=o&&i&&Vi.read(i);e&&a.set(o,e)}return t},zi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=qi(e);let o=r.data;const i=xi.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=xi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Mi(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&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(n(new ri("Request aborted",ri.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new ri(r,ri.ERR_NETWORK,e,y);o.event=t||null,n(o),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||mi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ri(t,o.clarifyTimeoutError?ri.ETIMEDOUT:ri.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&ti.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),ti.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),f&&([c,l]=Ki(f,!0),y.addEventListener("progress",c)),h&&y.upload&&([s,u]=Ki(h),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new Di(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===Ri.protocols.indexOf(m)?n(new ri("Unsupported protocol "+m+":",ri.ERR_BAD_REQUEST,e)):y.send(o||null)})},Zi=(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 ri?t:new Di(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new ri(`timeout of ${t}ms exceeded`,ri.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=()=>ti.asap(a),s}},$i=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Qi(e))yield*$i(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})},{isFunction:ta}=ti,na=(({Request:e,Response:t})=>({Request:e,Response:t}))(ti.global),{ReadableStream:ra,TextEncoder:oa}=ti.global,ia=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},aa=e=>{e=ti.merge.call({skipUndefined:!0},na,e);const{fetch:t,Request:n,Response:r}=e,o=t?ta(t):"function"==typeof fetch,i=ta(n),a=ta(r);if(!o)return!1;const s=o&&ta(ra),c=o&&("function"==typeof oa?(u=new oa,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&ia(()=>{let e=!1;const t=new n(Ri.origin,{body:new ra,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&ia(()=>ti.isReadableStream(new r("").body)),h={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ri(`Response type '${e}' is not supported`,ri.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=ti.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(ti.isBlob(e))return e.size;if(ti.isSpecCompliantForm(e)){const t=new n(Ri.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ti.isArrayBufferView(e)||ti.isArrayBuffer(e)?e.byteLength:(ti.isURLSearchParams(e)&&(e+=""),ti.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:p,onDownloadProgress:y,onUploadProgress:g,responseType:m,headers:w,withCredentials:A="same-origin",fetchOptions:E}=qi(e),b=t||fetch;m=m?(m+"").toLowerCase():"text";let v=Zi([c,u&&u.toAbortSignal()],p),S=null;const R=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let T;try{if(g&&l&&"get"!==a&&"head"!==a&&0!==(T=await f(w,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(ti.isFormData(s)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=ji(T,Ki(Fi(g)));s=ea(t.body,65536,e,n)}}ti.isString(A)||(A=A?"include":"omit");const t=i&&"credentials"in n.prototype,c={...E,signal:v,method:a.toUpperCase(),headers:w.normalize().toJSON(),body:s,duplex:"half",credentials:t?A:void 0};S=i&&new n(o,c);let u=await(i?b(S,E):b(o,c));const p=d&&("stream"===m||"response"===m);if(d&&(y||p&&R)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=ti.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&ji(t,Ki(Fi(y),!0))||[];u=new r(ea(u.body,65536,n,()=>{o&&o(),R&&R()}),e)}m=m||"text";let O=await h[ti.findKey(h,m)||"text"](u,e);return!p&&R&&R(),await new Promise((t,n)=>{Mi(t,n,{data:O,headers:xi.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:S})})}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ri("Network Error",ri.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw ri.from(t,t&&t.code,e,S,t&&t.response)}}},sa=new Map,ca=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=sa;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:aa(t)),u=s;return s},ua=(ca(),{http:null,xhr:zi,fetch:{get:ca}});ti.forEach(ua,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const la=e=>`- ${e}`,da=e=>ti.isFunction(e)||null===e||!1===e;const ha={getAdapter:function(e,t){e=ti.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(la).join("\n"):" "+la(e[0]):"as no adapter specified";throw new ri("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:ua};function fa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Di(null,e)}function pa(e){fa(e),e.headers=xi.from(e.headers),e.data=Ui.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ha.getAdapter(e.adapter||Ii.adapter,e)(e).then(function(t){return fa(e),t.data=Ui.call(e,e.transformResponse,t),t.headers=xi.from(t.headers),t},function(t){return Bi(t)||(fa(e),t&&t.response&&(t.response.data=Ui.call(e,e.transformResponse,t.response),t.response.headers=xi.from(t.response.headers))),Promise.reject(t)})}const ya="1.13.6",ga={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ga[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ma={};ga.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ya+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new ri(r(o," has been removed"+(t?" in "+t:"")),ri.ERR_DEPRECATED);return t&&!ma[o]&&(ma[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)}},ga.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const wa={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ri("options must be an object",ri.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new ri("option "+i+" must be "+n,ri.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ri("Unknown option "+i,ri.ERR_BAD_OPTION)}},validators:ga},Aa=wa.validators;class Ea{constructor(e){this.defaults=e||{},this.interceptors={request:new gi,response:new gi}}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=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Yi(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&wa.assertOptions(n,{silentJSONParsing:Aa.transitional(Aa.boolean),forcedJSONParsing:Aa.transitional(Aa.boolean),clarifyTimeoutError:Aa.transitional(Aa.boolean),legacyInterceptorReqResOrdering:Aa.transitional(Aa.boolean)},!1),null!=r&&(ti.isFunction(r)?t.paramsSerializer={serialize:r}:wa.assertOptions(r,{encode:Aa.function,serialize:Aa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),wa.assertOptions(t,{baseUrl:Aa.spelling("baseURL"),withXsrfToken:Aa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&ti.merge(o.common,o[t.method]);o&&ti.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=xi.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||mi;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=[pa.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 Di(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 va(function(t){e=t});return{token:t,cancel:e}}}const Sa=va;const Ra={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(Ra).forEach(([e,t])=>{Ra[t]=e});const Ta=Ra;const Oa=function e(t){const n=new ba(t),r=co(ba.prototype.request,n);return ti.extend(r,ba.prototype,n,{allOwnKeys:!0}),ti.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Yi(t,n))},r}(Ii);Oa.Axios=ba,Oa.CanceledError=Di,Oa.CancelToken=Sa,Oa.isCancel=Bi,Oa.VERSION=ya,Oa.toFormData=ui,Oa.AxiosError=ri,Oa.Cancel=Oa.CanceledError,Oa.all=function(e){return Promise.all(e)},Oa.spread=function(e){return function(t){return e.apply(null,t)}},Oa.isAxiosError=function(e){return ti.isObject(e)&&!0===e.isAxiosError},Oa.mergeConfig=Yi,Oa.AxiosHeaders=xi,Oa.formToJSON=e=>Ti(ti.isHTMLForm(e)?new FormData(e):e),Oa.getAdapter=ha.getAdapter,Oa.HttpStatusCode=Ta,Oa.default=Oa;var Ia,Na;function _a(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 Ca(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=La().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])},xa=function(){return La().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Ua=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=m(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)},Ba=function(){var e=Pa();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)},Da=function(){return"complete"===document.readyState},Ma=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(Da())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=Da()),document.querySelector("body")&&n&&(clearInterval(r),t(!0));case 1:case"end":return o.stop()}},o)})),200)}})},Ha=function(){return new Promise(function(e){if(("interactive"===document.readyState||Da())&&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)}})},Ga=function(){return new Promise(function(e){if(Da())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)}})},Ka=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,Ha();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)}}(),ja=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,Ka(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)}}(),Fa=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))})},Wa=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)}}(),Va=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=Va;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Xa=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 Ja=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,m;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:Ca({},r)}));case 1:return o.next=2,ja();case 2:return s=o.sent,o.next=3,Ka("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,Wa();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:Ca({},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:Ca({},r)}));case 13:o.prev=13,m=o.catch(0),n(m);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=Ja);var Ya=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 qa="#main .article-share ul",za=".dropdown-menu .account-settings",Za=".nav-wrapper-secondary .article-share ul",$a=function(){return document.querySelectorAll(qa)},Qa=function(){return document.querySelector(za)},es=function(){return document.querySelector(Za)},ts=n(8287).hp,ns=function(e){return ts.from(e,"base64").toString("utf8")},rs=function(){var e=window.localStorage.getItem(h),t=e&&ns(e)&&JSON.parse(ns(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(ns(t))):t});return u.log("Got encoded object hash with a value of ".concat(JSON.stringify(t))),t},os=function(e){var t=rs();return t&&t[e]},is=function(e,t){var n=rs()||{};n[e]=t,function(e){var t={};Object.keys(e).forEach(function(n){t[n]=ts.from(JSON.stringify(e[n])).toString("base64")});var n=ts.from(JSON.stringify(t)).toString("base64");window.localStorage.setItem("user-profile",n),u.log("Set encoded object hash for ".concat(e))}(n)};var as=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},ss=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,Fa();case 1:if(t=e.sent,!(n=t.idToken)){e.next=2;break}return r=Ua(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)}}(),cs=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},us=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?Ua(e):"";return u.log("Article sharing: UUID: ",t.uuid),t},ls=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=us().uuid);var l,h,f={uid:a,entitlementsToken:ka("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,is(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)})})})},ds=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=os(d),n||!r){e.next=1;break}return e.abrupt("return",r);case 1:return e.next=2,ss(t);case 2:return o=e.sent,e.next=3,ls(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)}}(),hs=function(){var e=s(c.mark(function e(n){var r,o,i,a,s,l,h,f,p,y,g,m,w,A;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)}}(),ys=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,")")},gs=function(e){e.classList.contains("article-share-fixed")&&e.classList.remove("article-share-fixed")},ms=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,Ma();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(Ya("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,ds(r,!1);case 2:a=e.sent,cs(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&&(Xa(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),as("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&&gs(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,Ka("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=ys(i);var g=document.createElement("div");g.id="share-box-position".concat(i),g.className="article-share-box share-box-position".concat(i);var m,w="GIFT THIS ARTICLE",A='You have '.concat("10"," gift articles remaining this month");m=a,u.log(m),u.log("article sharing article title: ",m);var E=document.location.host;if(!1===t){g.classList.add("no-share");var b=E.replace("www.","").replace("develop.","").replace("preprod.",""),v=Ba()?"https://subscription.".concat(b):"https://checkout.".concat(b);A='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(w,"
\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(w,"
\n\t\t\t\t
").concat(A,"
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t

").concat(m,"

\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(){ws(i)}),"done"});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),h=[es()].concat(i($a())),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,ps();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)}}(),ws=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,hs(t);case 1:return n=e.sent,e.next=2,Ka("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}as("Network error, try again",t),e.next=11;break;case 3:if("Link Updated"===n.status?as("Link Updated",t):as("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?as("Link Updated",t):as("Link Copied",t),e.next=7;break;case 6:e.prev=6,s=e.catch(4),u.error("Clipboard write failed:",s),as("Copy failed. Try again.",t);case 7:e.next=9;break;case 8:u.warn("Clipboard copy blocked: document not focused"),as("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,ds(t);case 10:a=e.sent,cs(a);case 11:case"end":return e.stop()}},e,null,[[4,6]])}));return function(t){return e.apply(this,arguments)}}(),As=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,Ka("Content ID");case 1:if(o=e.sent,i=xa(),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"),Ya("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"),Ya("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?gs(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?gs(e):e.classList.contains("article-share-fixed")||e.classList.add("article-share-fixed")}})}),e.next=1,Fa();case 1:return t=e.sent,n=t.isAuthenticated,e.next=2,Wa();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,ja();case 3:if(o=e.sent,u.log("article sharing: page type is ",o),"article"!==o){e.next=5;break}return e.next=4,ms(!0);case 4:e.next=6;break;case 5:return e.next=6,ps();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,As();case 8:return e.next=9,ms(!1);case 9:window.addEventListener("updateArticlesRemainingUI",function(e){cs(e.detail)});case 10:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();var bs=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),")")},vs=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,Ma();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=bs(o)}else u.log("engage gifting: skipping location ".concat(t,":"),e)},r=[es()].concat(i($a())),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)}}(),Ss=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,ja();case 1:if(t=e.sent,u.log("engage gifting: page type is",t),"article"!==t){e.next=2;break}return e.next=2,vs();case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();t.A.enableEngageArticleGifting?Ss():Es()})()})(); //# sourceMappingURL=mng-digisubs.articleShare.bundle.js.map;