/*! For license information please see mng-digisubs.main.bundle.js.LICENSE.txt */ (()=>{var e={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,g=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*g}},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},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},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:"",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}},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},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},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)}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},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},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},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 g(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:g}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},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|g(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(J(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(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(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 g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(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 Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function w(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 L(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(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 y(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 I(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<=N)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=g,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(J(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 b(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return v(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(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 N=4096;function R(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){H(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){H(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||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||_(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||_(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(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||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(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||_(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||_(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||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(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||_(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||_(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||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||_(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(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=q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=q(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=q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=q(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 H(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 G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||X(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("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 W=/[^+/0-9A-Za-z-_]/g;function Y(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 V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(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 $=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 q(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}},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={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);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)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>nn,hasStandardBrowserEnv:()=>on,hasStandardBrowserWebWorkerEnv:()=>an,navigator:()=>rn,origin:()=>sn});var o=n(4756),i=n(3612);const a=function(){if(i.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.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)}}function m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&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 n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,E.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),E.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var c=!1,u=0;uDate.now();class I extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,I.prototype)}static fromPayload({error:e,error_description:t}){return new I(e,t)}}class N extends I{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,N.prototype)}}class R extends I{constructor(e,t,n,r,o=null){super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,R.prototype)}}class C extends I{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,C.prototype)}}class L extends C{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class k extends I{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,k.prototype)}}class _ extends I{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,_.prototype)}}class P extends I{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,P.prototype)}}class x extends I{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${D(e,["default"])}', scope: '${D(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,x.prototype)}}class U extends I{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${D(e,["default"])}', missing scope: '${D(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,U.prototype)}}class B extends I{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,B.prototype)}}function D(e,t=[]){return e&&!t.includes(e)?e:""}const M=()=>window.crypto,G=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(M().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},F=e=>btoa(e),K=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],H=e=>Object.keys(e).reduce((t,n)=>{const r=K.find(e=>e.key===n);return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t},{}),j=e=>{var{clientId:t}=e,n=m(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},X=async e=>{const t=M().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},W=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Y=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},V=new TextEncoder,z=new TextDecoder;function J(e){return"string"==typeof e?V.encode(e):z.decode(e)}function Z(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new ee(`${e.name} modulusLength must be at least 2048 bits`)}let $;if(Uint8Array.prototype.toBase64)$=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;$=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},ce=async(e,t,n,r,o,i,a=1e4,s)=>o?(async(e,t,n,r,o,i,a,s)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s},u=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(c,[n.port2])});var c,u})(e,t,n,r,a,o,i,s):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([se(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,a);async function ue(e,t,n,r,o,i,a,s,c,u){if(c){const t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let l,d=null;for(let c=0;c<3;c++)try{l=await ce(e,n,r,o,i,a,t,s),d=null;break}catch(e){d=e}if(d)throw d;const h=l.json,{error:f,error_description:p}=h,g=m(h,["error","error_description"]),{headers:w,ok:y}=l;let A;if(c&&(A=w["dpop-nonce"],A&&await c.setNonce(A)),!y){const l=p||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===f)throw new P(f,l,g.mfa_token);if("missing_refresh_token"===f)throw new x(n,r);if("use_dpop_nonce"===f){if(!c||!A||u)throw new B(A);return ue(e,t,n,r,o,i,a,s,c,!0)}throw new I(f||"request_error",l)}return g}async function le(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,l=m(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const d="urn:ietf:params:oauth:grant-type:token-exchange"===l.grant_type,h="refresh_token"===l.grant_type&&c,f=Object.assign(Object.assign(Object.assign(Object.assign({},l),d&&o&&{audience:o}),d&&i&&{scope:i}),h&&{audience:o,scope:i}),p=s?j(f):JSON.stringify(f),g=(w=l.grant_type,ae.includes(w));var w;return await ue(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:p,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(H(a||O)))}},t,s,c,g?u:void 0)}const de=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},he=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),de(r,t)};class fe{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new fe({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new fe({scope:t,audience:n,clientId:r})}}class pe{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}class ge{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class we{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||T}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!i&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const a=await this.nowProvider(),s=Math.floor(a/1e3);return i.expiresAt-t!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new fe({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=fe.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=fe.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}}class me{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const ye=e=>"number"==typeof e,Ae=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var be=b(function(e,t){var n=y&&y.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nOe.get(e)||Oe.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),Se(`_legacy_${e}`,JSON.stringify(t),r),Oe.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),ve(e,n),Oe.remove(e,t),Oe.remove(`_legacy_${e}`,t)}},Ie={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Ne;!function(e){e.Code="code",e.ConnectCode="connect_code"}(Ne||(Ne={}));var Re,Ce=function(e){return Re=Re||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o{for(let n=0;n0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const Pe={memory:()=>(new ge).enclosedCache,localstorage:()=>new pe},xe=e=>Pe[e],Ue=e=>{const{openUrl:t,onRedirect:n}=e,r=m(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},Be=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},De={NONCE:"nonce",KEYPAIR:"keypair"};class Me{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(De).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(De.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(De.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(De.NONCE,this.buildKey(e))}findKeyPair(){return this.find(De.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(De.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(De.KEYPAIR,this.clientId)}}class Ge{constructor(e){this.storage=new Me(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){const i=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t);return oe(e,i,n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!re(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await ie(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new Q("unsupported JWK kty")}return q(await crypto.subtle.digest({name:"SHA-256"},J(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Fe;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(Fe||(Fe={}));class Ke{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=Fe.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?Fe.DPoP:Fe.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===Fe.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new B(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class He{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new je({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new je(t)}}class je extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,je.prototype)}}const Xe=new S;class We{constructor(e){let t,n;if(this.userCache=(new ge).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await Xe.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!M())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===M().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!xe(t))throw new Error(`Invalid cache location "${t}"`);n=xe(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Oe:Te,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:Ie;var o;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:de(t,e,...n)};let r={default:de(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=de(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new me(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||T,this.cacheManager=new we(n,n.allKeys?void 0:new _e(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Ge(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl);const i=`${this.domainUrl}/me/`,a=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:i},detailedResponse:!0})}));this.myAccountApi=new He(a,i),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Ce)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||O)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${j(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(W(r)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],Ae.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(W(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!ye(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!ye(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ye(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&ye(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),ro)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=F(G()),i=F(G()),a=G(),s=await X(a),c=Y(s),u=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),l=((e,t,n,r,o,i,a,s,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:he(t,n.scope,n.audience),response_type:"code",response_mode:s||"query",state:r,nonce:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),d=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new _;const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(e=>new Promise((t,n)=>{let r;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new k(e.popup)))},1e3),i=setTimeout(()=>{clearInterval(o),n(new L(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),!1!==e.closePopup&&e.popup.close(),a.data.response.error)return n(I.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==o.state)throw new I("state_mismatch","Invalid state");const i=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:i})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=Ue(e),{openUrl:r,fragment:o,appState:i}=n,a=m(n,["openUrl","fragment","appState"]),s=(null===(t=a.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,l=m(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i,response_type:Ne.Code}),s&&{organization:s}));const d=o?`${u}#${o}`:u;r?await r(d):window.location.assign(d)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new I("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===Ne.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new N(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new I("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:Ne.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new R(o,i||o,t.connection,r,t.appState);if(!n)throw new I("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new I("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:Ne.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:he(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=Le[t];return n||(n=e().finally(()=>{delete Le[t],n=null}),Le[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=m(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!await ke(()=>Xe.acquireLock(r,5e3),10))throw new C;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},a?{scope:a}:null),{expires_in:s})}finally{await Xe.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:he(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},v),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new fe({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=m(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${j(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=Ue(e),{openUrl:r}=n,o=m(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=`auth0.lock.getTokenFromIFrame.${this.options.clientId}`;if(!await ke(()=>Xe.acquireLock(t,5e3),10))throw new C;try{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new I("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const l=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(e){d=this.domainUrl}const h=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",s,!1))};let s;const c=setTimeout(()=>{o(new C),a()},1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(I.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,d,l);if(o!==h.state)throw new I("state_mismatch","Invalid state");const f=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:h.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},f),{scope:c,oauthTokenScope:f.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}finally{await Xe.releaseLock(t)}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new fe({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new x(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(u.refresh_token&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,u.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,a=null==t?void 0:t.scope,s=e.authorizationParams.audience,c=e.authorizationParams.scope,i===s&&Be(c,a)||Be(o,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,u.scope);throw new U(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}var i,a,s,c}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=m(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new fe({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new fe({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){var n,r;const{nonceIn:o,organization:i,scopesToRequest:a}=t||{},s=await le(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:a||e.scope}),this.worker),c=await this._verifyIdToken(s.id_token,o,i);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(r=null===(n=null==e?void 0:e.decodedToken)||void 0===n?void 0:n.claims)||void 0===r?void 0:r.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:c,scope:e.scope,audience:e.audience||"default"}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(i||c.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:c})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:he(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new Ke(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,scopes:o,authorization_params:i,redirectUri:a=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const s=F(G()),c=G(),u=await X(c),l=Y(u),{connect_uri:d,connect_params:h,auth_session:f}=await this.myAccountApi.connectAccount({connection:r,scopes:o,redirect_uri:a,state:s,code_challenge:l,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:f,redirect_uri:a,appState:n,connection:r,response_type:Ne.ConnectCode});const p=new URL(d);p.searchParams.set("ticket",h.ticket),t?await t(p.toString()):window.location.assign(p)}}function Ye(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ve}=Object.prototype,{getPrototypeOf:ze}=Object,{iterator:Je,toStringTag:Ze}=Symbol,$e=(qe=Object.create(null),e=>{const t=Ve.call(e);return qe[t]||(qe[t]=t.slice(8,-1).toLowerCase())});var qe;const Qe=e=>(e=e.toLowerCase(),t=>$e(t)===e),et=e=>t=>typeof t===e,{isArray:tt}=Array,nt=et("undefined");function rt(e){return null!==e&&!nt(e)&&null!==e.constructor&&!nt(e.constructor)&&at(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ot=Qe("ArrayBuffer");const it=et("string"),at=et("function"),st=et("number"),ct=e=>null!==e&&"object"==typeof e,ut=e=>{if("object"!==$e(e))return!1;const t=ze(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ze in e||Je in e)},lt=Qe("Date"),dt=Qe("File"),ht=Qe("Blob"),ft=Qe("FileList"),pt=Qe("URLSearchParams"),[gt,wt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(Qe);function At(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),tt(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Et="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,St=e=>!nt(e)&&e!==Et;const vt=(Ot="undefined"!=typeof Uint8Array&&ze(Uint8Array),e=>Ot&&e instanceof Ot);var Ot;const Tt=Qe("HTMLFormElement"),It=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=Qe("RegExp"),Rt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};At(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Ct=Qe("AsyncFunction"),Lt=(kt="function"==typeof setImmediate,_t=at(Et.postMessage),kt?setImmediate:_t?(Pt=`axios@${Math.random()}`,xt=[],Et.addEventListener("message",({source:e,data:t})=>{e===Et&&t===Pt&&xt.length&&xt.shift()()},!1),e=>{xt.push(e),Et.postMessage(Pt,"*")}):e=>setTimeout(e));var kt,_t,Pt,xt;const Ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Et):"undefined"!=typeof process&&process.nextTick||Lt,Bt={isArray:tt,isArrayBuffer:ot,isBuffer:rt,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||at(e.append)&&("formdata"===(t=$e(e))||"object"===t&&at(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ot(e.buffer),t},isString:it,isNumber:st,isBoolean:e=>!0===e||!1===e,isObject:ct,isPlainObject:ut,isEmptyObject:e=>{if(!ct(e)||rt(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:gt,isRequest:wt,isResponse:mt,isHeaders:yt,isUndefined:nt,isDate:lt,isFile:dt,isBlob:ht,isRegExp:Nt,isFunction:at,isStream:e=>ct(e)&&at(e.pipe),isURLSearchParams:pt,isTypedArray:vt,isFileList:ft,forEach:At,merge:function e(){const{caseless:t,skipUndefined:n}=St(this)&&this||{},r={},o=(o,i)=>{const a=t&&bt(r,i)||i;ut(r[a])&&ut(o)?r[a]=e(r[a],o):ut(o)?r[a]=e({},o):tt(o)?r[a]=o.slice():n&&nt(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(At(t,(t,r)=>{n&&at(t)?e[r]=Ye(t,n):e[r]=t},{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),e.prototype.constructor=e,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&&ze(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:$e,kindOfTest:Qe,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(tt(e))return e;let t=e.length;if(!st(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Je]).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:Tt,hasOwnProperty:It,hasOwnProp:It,reduceDescriptors:Rt,freezeMethods:e=>{Rt(e,(t,n)=>{if(at(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];at(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 tt(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:bt,global:Et,isContextDefined:St,isSpecCompliantForm:function(e){return!!(e&&at(e.append)&&"FormData"===e[Ze]&&e[Je])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ct(e)){if(t.indexOf(e)>=0)return;if(rt(e))return e;if(!("toJSON"in e)){t[r]=e;const o=tt(e)?[]:{};return At(e,(e,t)=>{const i=n(e,r+1);!nt(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ct,isThenable:e=>e&&(ct(e)||at(e))&&at(e.then)&&at(e.catch),setImmediate:Lt,asap:Ut,isIterable:e=>null!=e&&at(e[Je])};function Dt(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Bt.inherits(Dt,Error,{toJSON:function(){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:Bt.toJSONObject(this.config),code:this.code,status:this.status}}});const Mt=Dt.prototype,Gt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Gt[e]={value:e}}),Object.defineProperties(Dt,Gt),Object.defineProperty(Mt,"isAxiosError",{value:!0}),Dt.from=(e,t,n,r,o,i)=>{const a=Object.create(Mt);Bt.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Dt.call(a,s,c,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const Ft=Dt;var Kt=n(8287).hp;function Ht(e){return Bt.isPlainObject(e)||Bt.isArray(e)}function jt(e){return Bt.endsWith(e,"[]")?e.slice(0,-2):e}function Xt(e,t,n){return e?e.concat(t).map(function(e,t){return e=jt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Wt=Bt.toFlatObject(Bt,{},null,function(e){return/^is[A-Z]/.test(e)});const Yt=function(e,t,n){if(!Bt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Bt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Bt.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Bt.isSpecCompliantForm(t);if(!Bt.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Bt.isDate(e))return e.toISOString();if(Bt.isBoolean(e))return e.toString();if(!s&&Bt.isBlob(e))throw new Ft("Blob is not supported. Use a Buffer instead.");return Bt.isArrayBuffer(e)||Bt.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Kt.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Bt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Bt.isArray(e)&&function(e){return Bt.isArray(e)&&!e.some(Ht)}(e)||(Bt.isFileList(e)||Bt.endsWith(n,"[]"))&&(s=Bt.toArray(e)))return n=jt(n),s.forEach(function(e,r){!Bt.isUndefined(e)&&null!==e&&t.append(!0===a?Xt([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Ht(e)||(t.append(Xt(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Wt,{defaultVisitor:u,convertValue:c,isVisitable:Ht});if(!Bt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Bt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Bt.forEach(n,function(n,i){!0===(!(Bt.isUndefined(n)||null===n)&&o.call(t,n,Bt.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Vt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function zt(e,t){this._pairs=[],e&&Yt(e,this,t)}const Jt=zt.prototype;Jt.append=function(e,t){this._pairs.push([e,t])},Jt.toString=function(e){const t=e?function(t){return e.call(this,t,Vt)}:Vt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Zt=zt;function $t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qt(e,t,n){if(!t)return e;const r=n&&n.encode||$t;Bt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Bt.isURLSearchParams(t)?t.toString():new Zt(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Qt=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){Bt.forEach(this.handlers,function(t){null!==t&&e(t)})}},en={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tn={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nn="undefined"!=typeof window&&"undefined"!=typeof document,rn="object"==typeof navigator&&navigator||void 0,on=nn&&(!rn||["ReactNative","NativeScript","NS"].indexOf(rn.product)<0),an="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,sn=nn&&window.location.href||"http://localhost",cn={...e,...tn};const un=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&&Bt.isArray(r)?r.length:i,s)return Bt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&Bt.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Bt.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 Bt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const ln={transitional:en,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Bt.isObject(e);o&&Bt.isHTMLForm(e)&&(e=new FormData(e));if(Bt.isFormData(e))return r?JSON.stringify(un(e)):e;if(Bt.isArrayBuffer(e)||Bt.isBuffer(e)||Bt.isStream(e)||Bt.isFile(e)||Bt.isBlob(e)||Bt.isReadableStream(e))return e;if(Bt.isArrayBufferView(e))return e.buffer;if(Bt.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 Yt(e,new cn.classes.URLSearchParams,{visitor:function(e,t,n,r){return cn.isNode&&Bt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Bt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Yt(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Bt.isString(e))try{return(t||JSON.parse)(e),Bt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ln.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Bt.isResponse(e)||Bt.isReadableStream(e))return e;if(e&&Bt.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 Ft.from(e,Ft.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:cn.classes.FormData,Blob:cn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Bt.forEach(["delete","get","head","post","put","patch"],e=>{ln.headers[e]={}});const dn=ln,hn=Bt.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"]),fn=Symbol("internals");function pn(e){return e&&String(e).trim().toLowerCase()}function gn(e){return!1===e||null==e?e:Bt.isArray(e)?e.map(gn):String(e)}function wn(e,t,n,r,o){return Bt.isFunction(r)?r.call(this,t,n):(o&&(t=n),Bt.isString(t)?Bt.isString(r)?-1!==t.indexOf(r):Bt.isRegExp(r)?r.test(t):void 0:void 0)}class mn{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=pn(t);if(!o)throw new Error("header name must be a non-empty string");const i=Bt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=gn(e))}const i=(e,t)=>Bt.forEach(e,(e,n)=>o(e,n,t));if(Bt.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Bt.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]&&hn[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(Bt.isObject(e)&&Bt.isIterable(e)){let n,r,o={};for(const t of e){if(!Bt.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Bt.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=pn(e)){const n=Bt.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(Bt.isFunction(t))return t.call(this,e,n);if(Bt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=pn(e)){const n=Bt.findKey(this,e);return!(!n||void 0===this[n]||t&&!wn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=pn(e)){const o=Bt.findKey(n,e);!o||t&&!wn(0,n[o],o,t)||(delete n[o],r=!0)}}return Bt.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&&!wn(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Bt.forEach(this,(r,o)=>{const i=Bt.findKey(n,o);if(i)return t[i]=gn(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]=gn(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Bt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Bt.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[fn]=this[fn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=pn(e);t[r]||(!function(e,t){const n=Bt.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 Bt.isArray(e)?e.forEach(r):r(e),this}}mn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Bt.reduceDescriptors(mn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Bt.freezeMethods(mn);const yn=mn;function An(e,t){const n=this||dn,r=t||n,o=yn.from(r.headers);let i=r.data;return Bt.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function bn(e){return!(!e||!e.__CANCEL__)}function En(e,t,n){Ft.call(this,null==e?"canceled":e,Ft.ERR_CANCELED,t,n),this.name="CanceledError"}Bt.inherits(En,Ft,{__CANCEL__:!0});const Sn=En;function vn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const On=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)]},In=(e,t,n=3)=>{let r=0;const o=On(50,250);return Tn(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)},Nn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Rn=e=>(...t)=>Bt.asap(()=>e(...t)),Cn=cn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,cn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(cn.origin),cn.navigator&&/(msie|trident)/i.test(cn.navigator.userAgent)):()=>!0,Ln=cn.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Bt.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Bt.isString(r)&&s.push(`path=${r}`),Bt.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Bt.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 kn(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const _n=e=>e instanceof yn?{...e}:e;function Pn(e,t){t=t||{};const n={};function r(e,t,n,r){return Bt.isPlainObject(e)&&Bt.isPlainObject(t)?Bt.merge.call({caseless:r},e,t):Bt.isPlainObject(t)?Bt.merge({},t):Bt.isArray(t)?t.slice():t}function o(e,t,n,o){return Bt.isUndefined(t)?Bt.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Bt.isUndefined(t))return r(void 0,t)}function a(e,t){return Bt.isUndefined(t)?Bt.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(_n(e),_n(t),0,!0)};return Bt.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);Bt.isUndefined(a)&&i!==s||(n[r]=a)}),n}const xn=e=>{const t=Pn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=yn.from(a),t.url=qt(kn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Bt.isFormData(n))if(cn.hasStandardBrowserEnv||cn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Bt.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(cn.hasStandardBrowserEnv&&(r&&Bt.isFunction(r)&&(r=r(t)),r||!1!==r&&Cn(t.url))){const e=o&&i&&Ln.read(i);e&&a.set(o,e)}return t},Un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=xn(e);let o=r.data;const i=yn.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 g=new XMLHttpRequest;function w(){if(!g)return;const r=yn.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());vn(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(w)},g.onabort=function(){g&&(n(new Ft("Request aborted",Ft.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Ft(r,Ft.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||en;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ft(t,o.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Bt.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Bt.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),f&&([c,l]=In(f,!0),g.addEventListener("progress",c)),h&&g.upload&&([s,u]=In(h),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new Sn(null,e,g):t),g.abort(),g=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===cn.protocols.indexOf(m)?n(new Ft("Unsupported protocol "+m+":",Ft.ERR_BAD_REQUEST,e)):g.send(o||null)})},Bn=(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 Ft?t:new Sn(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Ft(`timeout ${t} of ms exceeded`,Ft.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=()=>Bt.asap(a),s}},Dn=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Mn(e))yield*Dn(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:Fn}=Bt,Kn=(({Request:e,Response:t})=>({Request:e,Response:t}))(Bt.global),{ReadableStream:Hn,TextEncoder:jn}=Bt.global,Xn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Wn=e=>{e=Bt.merge.call({skipUndefined:!0},Kn,e);const{fetch:t,Request:n,Response:r}=e,o=t?Fn(t):"function"==typeof fetch,i=Fn(n),a=Fn(r);if(!o)return!1;const s=o&&Fn(Hn),c=o&&("function"==typeof jn?(u=new jn,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Xn(()=>{let e=!1;const t=new n(cn.origin,{body:new Hn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Xn(()=>Bt.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 Ft(`Response type '${e}' is not supported`,Ft.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Bt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Bt.isBlob(e))return e.size;if(Bt.isSpecCompliantForm(e)){const t=new n(cn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Bt.isArrayBufferView(e)||Bt.isArrayBuffer(e)?e.byteLength:(Bt.isURLSearchParams(e)&&(e+=""),Bt.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:g,onUploadProgress:w,responseType:m,headers:y,withCredentials:A="same-origin",fetchOptions:b}=xn(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let S=Bn([c,u&&u.toAbortSignal()],p),v=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let T;try{if(w&&l&&"get"!==a&&"head"!==a&&0!==(T=await f(y,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Bt.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Nn(T,In(Rn(w)));s=Gn(t.body,65536,e,n)}}Bt.isString(A)||(A=A?"include":"omit");const t=i&&"credentials"in n.prototype,c={...b,signal:S,method:a.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?A:void 0};v=i&&new n(o,c);let u=await(i?E(v,b):E(o,c));const p=d&&("stream"===m||"response"===m);if(d&&(g||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Bt.toFiniteNumber(u.headers.get("content-length")),[n,o]=g&&Nn(t,In(Rn(g),!0))||[];u=new r(Gn(u.body,65536,n,()=>{o&&o(),O&&O()}),e)}m=m||"text";let I=await h[Bt.findKey(h,m)||"text"](u,e);return!p&&O&&O(),await new Promise((t,n)=>{vn(t,n,{data:I,headers:yn.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:v})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,e,v),{cause:t.cause||t});throw Ft.from(t,t&&t.code,e,v)}}},Yn=new Map,Vn=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=Yn;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Wn(t)),u=s;return s},zn=(Vn(),{http:null,xhr:Un,fetch:{get:Vn}});Bt.forEach(zn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Jn=e=>`- ${e}`,Zn=e=>Bt.isFunction(e)||null===e||!1===e;const $n={getAdapter:function(e,t){e=Bt.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(Jn).join("\n"):" "+Jn(e[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:zn};function qn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sn(null,e)}function Qn(e){qn(e),e.headers=yn.from(e.headers),e.data=An.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return $n.getAdapter(e.adapter||dn.adapter,e)(e).then(function(t){return qn(e),t.data=An.call(e,e.transformResponse,t),t.headers=yn.from(t.headers),t},function(t){return bn(t)||(qn(e),t&&t.response&&(t.response.data=An.call(e,e.transformResponse,t.response),t.response.headers=yn.from(t.response.headers))),Promise.reject(t)})}const er="1.13.2",tr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nr={};tr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+er+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Ft(r(o," has been removed"+(t?" in "+t:"")),Ft.ERR_DEPRECATED);return t&&!nr[o]&&(nr[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)}},tr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ft("options must be an object",Ft.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 Ft("option "+i+" must be "+n,Ft.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ft("Unknown option "+i,Ft.ERR_BAD_OPTION)}},validators:tr},or=rr.validators;class ir{constructor(e){this.defaults=e||{},this.interceptors={request:new Qt,response:new Qt}}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=Pn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rr.assertOptions(n,{silentJSONParsing:or.transitional(or.boolean),forcedJSONParsing:or.transitional(or.boolean),clarifyTimeoutError:or.transitional(or.boolean)},!1),null!=r&&(Bt.isFunction(r)?t.paramsSerializer={serialize:r}:rr.assertOptions(r,{encode:or.function,serialize:or.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rr.assertOptions(t,{baseUrl:or.spelling("baseURL"),withXsrfToken:or.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Bt.merge(o.common,o[t.method]);o&&Bt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=yn.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(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=[Qn.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 Sn(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 sr(function(t){e=t});return{token:t,cancel:e}}}const cr=sr;const ur={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(ur).forEach(([e,t])=>{ur[t]=e});const lr=ur;const dr=function e(t){const n=new ar(t),r=Ye(ar.prototype.request,n);return Bt.extend(r,ar.prototype,n,{allOwnKeys:!0}),Bt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Pn(t,n))},r}(dn);dr.Axios=ar,dr.CanceledError=Sn,dr.CancelToken=cr,dr.isCancel=bn,dr.VERSION=er,dr.toFormData=Yt,dr.AxiosError=Ft,dr.Cancel=dr.CanceledError,dr.all=function(e){return Promise.all(e)},dr.spread=function(e){return function(t){return e.apply(null,t)}},dr.isAxiosError=function(e){return Bt.isObject(e)&&!0===e.isAxiosError},dr.mergeConfig=Pn,dr.AxiosHeaders=yn,dr.formToJSON=e=>un(Bt.isHTMLForm(e)?new FormData(e):e),dr.getAdapter=$n.getAdapter,dr.HttpStatusCode=lr,dr.default=dr;const hr=dr,fr={AUTH0_SUB_COOKIE_KEY:"auth0_sub",ENTITLEMENT_COOKIE_KEY:"mng-entitlements",LOCAL_STORAGE_SESSION_KEY:"__MNG_Session",REGWALL_USER_IS_SUBSCRIBED:"regwallUserIsSubscribed",USER_IS_LOWA:"entitled",SLO_FLAG:"slo_flag",AB_TESTING_COOKIE:"_matheriSegs",ARTICLES_REMAINING_KEY:"articlesRemaining",USER_PROFILE_HASH:"user-profile"};function pr(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 gr(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=yr().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])},Er=function(){var e=br();return".".concat(e)},Sr=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(a("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=p(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},vr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=br(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=p(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},Or=function(){return yr().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Tr=function(e){return function(e,t){if("string"!=typeof e)throw new g("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new g(`Invalid token specified: missing part #${n+1}`);let o;try{o=w(r)}catch(e){throw new g(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new g(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},Ir=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=br().split(".")[0],e.prev=1,e.next=2,hr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 2:if(!(r=e.sent).data){e.next=3;break}return a("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 3:return e.abrupt("return",!1);case 4:return e.prev=4,s=e.catch(1),a("Apple Sub Check: Request Failure: ",s),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),Nr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,hr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":i.A.entitlementsApiKey}});case 1:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Rr=function(){return"complete"===document.readyState},Cr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(Rr())t();else{a("UIHandler: ","Waiting for the body to load...");var i=setInterval(r(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=Rr()),document.querySelector("body")&&n&&(clearInterval(i),t(!0));case 1:case"end":return r.stop()}},r)})),200)}})},Lr=function(){return new Promise(function(e){if(("interactive"===document.readyState||Rr())&&window.dataLayer)a("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{a("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.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)}})},kr=function(){return new Promise(function(e){if("interactive"!==document.readyState&&"complete"!==document.readyState||!window.MG2DL){a("Utils mg2DataLayerLoaded:","Waiting for MG2DL to load...");var t=setInterval(function(){window.MG2DL&&window.MG2DL.length>0&&(clearInterval(t),e(!0))},50)}else a("Utils mg2DataLayerLoaded:","Document is in interactive state, resolving."),e()})},_r=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Lr();case 1:return a("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",a("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return a("Utils dataLayerLoop: look for this element ",e),e[t]?(a("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(a("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(r),e.abrupt("return",i?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Pr=function(){var e=r(o.mark(function e(){var t,n,r,i=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:[],e.next=1,Lr();case 1:if(a("Utils getMultipleDataLayerObjects: looking for these keys ",t),window.dataLayer=window.dataLayer||[],n={},a("Utils getDataLayerObjects: dataLayer length",window.dataLayer.length),r=function(e){a("Utils dataLayerLoop: look for this element ",e);var r=!1;return t.forEach(function(t){void 0!==e[t]?(a("Utils dataLayerLoop: found ".concat(t,":"),e[t]),n[t]=e[t],r=!0):a("Utils dataLayerLoop: ".concat(t," not found in this element"))}),t.every(function(e){return void 0!==n[e]})?(a("Utils dataLayerLoop: all requested keys found, stopping search"),!0):r},!(window.dataLayer.some(r)&&Object.keys(n).length>0)){e.next=2;break}return a("Utils getDataLayerObjects: final result",n),e.abrupt("return",n);case 2:return a("Utils getDataLayerObjects: none of the keys were found"),e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),xr=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.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,_r(t);case 1:return n=e.sent,a("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)}}(),Ur=function(){return new Promise(function(e){a("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){a("blueConicReady | onReady fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)},3e3)})},Br=function(){return new Promise(function(e){a("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(a("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},function(){a("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)},3e3)})},Dr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){a("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout(function(){clearTimeout(n),a("blueConicLoaded | onBlueConicLoaded timeout, resolving false for load status."),t(!1)},1e4);void 0!==window.blueConicClient&&void 0!==window.blueConicClient.event&&void 0!==window.blueConicClient.event.subscribe?(a("blueConicLoaded | BC object already loaded"),e?t(Ur()):(clearTimeout(n),t())):(a('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(o.mark(function r(){var i;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=2;break}return a("blueConicLoaded | waiting for blueConicReady..."),r.next=1,Ur();case 1:i=r.sent,clearTimeout(n),t(i),r.next=3;break;case 2:clearTimeout(n),t();case 3:case"end":return r.stop()}},r)})),!1))})},Mr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Dr(!0);case 1:if(!e.sent){e.next=4;break}return e.next=2,Br();case 2:if(e.sent){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Gr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]&&l[0],n=!1,i=["MICH LOWA","OHIO LOWA","PENN LOWA","NY LOWA","BOSTON LOWA","NORCAL LOWA","TWIN CITIES LOWA","DENV/PMP LOWA","SCNG LOWA","BANG LOWA","AMC LOWA","HC LOWA","GS LOWA","ORL LOWA","SS LOWA","NNDP LOWA","VP LOWA","NYDN LOWA","BAL LOWA","CG LOWA","CHI LOWA"],e.next=1,Dr(!0);case 1:if(!e.sent){e.next=3;break}if(s=window.blueConicClient.getSegments(),a("bcLowaCheck | BC segments for users: ",s),!(s.filter(function(e){return i.includes(e.name)}).length>0)){e.next=3;break}return e.next=2,Mr();case 2:(c=e.sent)&&(n=!0,r=c);case 3:return t&&n&&Fr(),u={isSub:n},r&&(u.uuid=r),e.abrupt("return",u);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fr=function(){Sr("bc_lowa_status",1,{path:"/",domain:Er(),expires:7,secure:!0})},Kr=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(a("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(a("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};a("utils | Event: authentication ready: ",r),e(r)}catch(e){a(e),t(e)}},!1))})},Hr=function(){var e=r(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 i.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(a("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,a("Received entitlementsReady event:",r),e(r)}catch(e){s("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(a("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),jr=function(){vr(fr.AUTH0_SUB_COOKIE_KEY),vr("mng-jwt-decoded"),localStorage.removeItem(fr.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){a("Clearing entitlements...");try{vr(fr.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){a("Failed to delete legacy cookie: ",e)}try{vr(fr.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:br(),expires:365,secure:!0})}catch(e){a("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(fr.LOCAL_STORAGE_SESSION_KEY)}catch(e){a("Failed to remove local storage: ",e)}}()},Xr=function(){var e=yr();return!["local","develop","preprod","trbdev"].some(function(t){return e.origin.includes(t)})},Wr=function(e){a("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),a("Storage Object removed : ",e))},Yr=function(e){a("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 a("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=Yr;var Vr;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var zr=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Vr){e.next=1;break}return e.abrupt("return",Vr);case 1:return t=i.A.auth0Domain,n=i.A.auth0ClientId,Vr=new We({domain:t,clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{audience:"access-extension",scope:"openid email profile user_metadata app_metadata offline_access"}}),e.abrupt("return",Vr);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Jr=function(e){a("utils | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,a("utils | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),a("utils | Dispatched authenticationReady event"),mr=new CustomEvent("mng-auth-check-complete",{detail:e}),wr?(a("utils | Dispatching mng-auth-complete event (islands were ready): ",t),window.dispatchEvent(mr)):a("Islands not ready")},Zr=function(e){if(void 0!==window.authentication_config){var t=window.authentication_config,n=Object.keys(t).filter(function(n){return n.includes(e)&&"1"===t[n]});return a("checkOneTapOptions: enabled options",n),n.length>0}return!1},$r=function(e){return Number.isInteger(Number(e))};var qr=function(e){i.A.datadogEnabled&&window.DD_RUM.addTiming(e)},Qr=function(){var e=r(o.mark(function e(t){var n,r,s,u,l,d;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a("deleteUserCache","Setting up cache deletion for ".concat(t)),n=Or(),a("deleteUSerCache","Domain is: ".concat(n)),r={publication:n,uuid:t},e.next=1,hr({method:"DELETE",url:"".concat(i.A.entitlementsEndpoint,"session/create"),data:r,headers:{"X-Api-Key":i.A.entitlementsApiKey}});case 1:if(s=e.sent,u=s.data,l=/Succesfully deleted/i,!("object"===c(u)&&Object.prototype.hasOwnProperty.call(u,"message"))||!l.test(u.message)){e.next=2;break}return a("deleteUserCache","Cache deletion successful for ".concat(t)),e.abrupt("return",{success:!0});case 2:return a("deleteUserCache","Cache deletion failed for ".concat(t,": ").concat(u)),e.abrupt("return",{success:!1});case 3:return e.prev=3,d=e.catch(0),a("deleteUserCache","Cache deletion error for ".concat(t,": ").concat(d)),e.abrupt("return",{success:!1});case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(t){return e.apply(this,arguments)}}(),eo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},s=function(){var s=r(o.mark(function r(){var s,c,u,l,d,h,f,p,g,w,m;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(s=window.sophi_config)||void 0===s?void 0:s.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return i.sspw=!0,r.abrupt("return",t({paywall:!0,details:gr({},i)}));case 1:return r.next=2,xr();case 2:return u=r.sent,r.next=3,_r("Paywall_Level");case 3:if(l=r.sent,"article"===u&&"free"!==l){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==u?"Page type is not an article":"Free article"}));case 4:return r.next=5,Hr();case 5:if(!(d=r.sent)||!d.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(h=null===(c=window.ConnextUtils)||void 0===c?void 0:c.runningSophi,a("checkPaywallStatus - Sophi is running: ",h),!h){r.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:gr({},i)})},{once:!0}),r.next=12;break;case 8:if(h){r.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)}),r.prev=9,r.next=10,Promise.race([f,p]);case 10:!0===(g=r.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(g)),r.next=12;break;case 11:r.prev=11,w=r.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(w);case 12:return r.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:gr({},i)}));case 13:r.prev=13,m=r.catch(0),n(m);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return s.apply(this,arguments)}}();s()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=eo);var to=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Dr();case 1:return e.next=2,Kr();case 2:return e.abrupt("return",new Promise(function(e){a("ANALYTICS: inside BCregwall events");var t=yr();t.searchParams.delete("regwall");var n=blueConicClient.profile.getProfile();localStorage.setItem("regwallSuccess","yes"),localStorage.setItem("regwallEvent","yes"),n.setValue("bang_reg_wall_status","Y"),n.setValue("regwall_newspaper",t.host),n.setValue("regwall_success_date",new Date),n.setValue("regwall_success","yes"),blueConicClient.profile.updateProfile(),e(!0)}));case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),no=function(){var e=r(o.mark(function e(t){var n,r,i,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{void 0!==(n=Tr(t))&&n&&(a("ANALYTICS: Partner Access: JWT found"),r=n.entitlement_entitled,i=n.entitlement_source,s=n.entitlement_organizationTrackingId,c=n.entitlement_organizationType,a("ANALYTICS: Partner Access Event: Entitled: ".concat(r," and source: ").concat(i)),r&&"partner-access"===i&&(a("ANALYTICS: GA event for partner access"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"partnerAccess",partner:"".concat(s,"|").concat(c)})))}catch(e){a("ANALYTICS: Failed to send Partner Access event: ",e)}case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ro=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{"yes"===localStorage.getItem("regwallEvent")&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"regwall_success"}),a("ANALYTICS: GA/ datalayer ",window.dataLayer),localStorage.removeItem("regwallEvent"))}catch(e){a("ANALYTICS: Failed to send Regwall Succuss Event: ",e)}case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),oo=function(){var e=r(o.mark(function e(t,n){var r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n.entitlements&&(r=Tr(n.entitlements.token)),a("ANALYTICS: user state variables are: ",t,n.userState),i="known"===t&&n.userState?r&&r.entitlement_entitled?"comp"===r.entitlement_level||"freeTrial"===r.entitlement_level?"subscriber-".concat(r.entitlement_level):"".concat(n.userState).concat(r.entitlement_serviceCode?"-".concat(r.entitlement_serviceCode):""):n.userState:"known"!==t||n.userState?"unknown"===t||"unknown-default"===t||"unknown-fail"===t&&"noEntitlements"===n.userState?t:t&&n.userState?r&&r.entitlement_entitled?"".concat(n.userState).concat(r.entitlement_serviceCode?"-".concat(r.entitlement_serviceCode):""):n.userState:"noState":"known-entitlements-failed",a("ANALYTICS: user state is ",i),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Auth0State_event",Auth0State:i});case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),io=function(){var e=r(o.mark(function e(){var t,n,r,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Kr();case 1:n=e.sent,r=n.isAuthenticated,i=r,e.next=!0===i?2:!1===i?3:i===fr.USER_IS_LOWA?4:5;break;case 2:return t="known",e.abrupt("continue",6);case 3:return t="unknown",e.abrupt("continue",6);case 4:return t=fr.USER_IS_LOWA,e.abrupt("continue",6);case 5:return t="unknown-default",e.abrupt("continue",6);case 6:return e.abrupt("return",t);case 7:return e.prev=7,s=e.catch(0),a("ANALYTICS: Error during onAuthReadyAnalytics: ",s),e.abrupt("return","unknown-fail");case 8:case"end":return e.stop()}},e,null,[[0,7]])}));return function(){return e.apply(this,arguments)}}(),ao=function(e){try{window.dataLayer.push({event:e}),a("ANALYTICS: ".concat(e," event")),a("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){a("ANALYTICS: Failed to send ".concat(e," event: "),t)}},so=function(e){try{var t={};Object.keys(e).forEach(function(n){t[n]=e[n]}),0!==Object.keys(t).length&&window.dataLayer.push(t),a("ANALYTICS: ".concat(e.event," event")),a("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){a("ANALYTICS: Failed to send ".concat(e.event," event: "),t)}},co=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={event:"one_tap_login",gotGroup:t,gotExperiment:e};switch(e){case"placement":n.gotDisplayPosition=window.authentication_config["got".concat(t,"ModalPosition")];break;case"scrolling":n.gotScrollDepthPercentage=window.authentication_config["got".concat(t,"GroupDepth")],n.gotDisplayPosition=window.authentication_config["got".concat(t,"GroupDelayPosition")];break;case"delayTime":n.gotTimeUntilDisplay=Math.floor($r(window.authentication_config["got".concat(t,"GroupTime")])?parseInt(window.authentication_config["got".concat(t,"GroupTime")],10):1);break;default:return n.event}return n},uo=function(e){try{var t={googleonetap:"one_tap_login",viafoura_signup:"viafoura_signup_success",viafoura_login:"viafoura_login_success"}[e];"one_tap_login"===t?(n=localStorage.getItem("abcdLocal"),r=localStorage.getItem("abcdeLocal"),o=Zr("GroupEnabled"),i=Zr("GroupDelayEnabled"),s=Zr("GroupTimeDelayEnabled"),c=Zr("got".concat(n,"GroupEnabled")),u=Zr("got".concat(r,"GroupDelayEnabled")),l=Zr("got".concat(n,"GroupTimeDelayEnabled")),d=/Windows|Macintosh|Mac OS X|Linux/.test(navigator.userAgent),n&&o&&c&&!i&&d&&!s?(a("ANALYTICS: Position event enabled"),so(co("placement",n))):r&&!o&&i&&u&&!s?(a("ANALYTICS: Scroll delay enabled"),so(co("scrolling",r))):n&&!o&&!i&&s&&l?(a("ANALYTICS: Time delay enabled"),so(co("delayTime",n))):(a("ANALYTICS: No custom event detected"),ao(co("default")))):ao(t)}catch(e){a("ANALYTICS: Event not setup",e)}var n,r,o,i,s,c,u,l,d},lo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=!1,e.next=1,Hr();case 1:if(!(n=e.sent)||!n.token){e.next=2;break}return r=n.token,i=n.isEntitled,s=n.adfree,a("ANALYTICS: entitlements options: ",i,s),!0===s&&a("ANALYTICS: user state: found ad free",s),!0===i?(a("ANALYTICS: user state: found subscriber"),t="subscriber"):(a("ANALYTICS: user state: LINA"),t="lina"),no(r),e.abrupt("return",{userState:t,entitlements:n});case 2:return e.abrupt("return","noEntitlements");case 3:return e.prev=3,c=e.catch(0),a("ANALYTICS:",c),e.abrupt("return","entitlementError");case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}(),ho=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Dr();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),fo=function(){var e=r(o.mark(function e(){var t,n,r,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("sspwG2iMeterEvent: initializing sspwG2iMeterEvent function"),e.next=1,xr();case 1:if("article"===e.sent){e.next=2;break}return a("sspwG2iMeterEvent: not an article page"),e.abrupt("return");case 2:return e.next=3,Pr(["Byline","Page Title","Section","Paywall_Level"]);case 3:if(!("free"!==(t=e.sent).Paywall_Level&&"1"===window.sophi_config.enableSophiSSPW||"premium"===t.Paywall_Level&&"1"===window.authentication_config.serverEntitlements)){e.next=5;break}return n="NOWALL",(r=document.querySelector("#server-paywall, #server-regwall"))&&(a("sspwG2iMeterEvent: paywall element found: ",r.id),"server-paywall"===r.id?n="SSPW":"server-regwall"===r.id&&(n="SSRW")),i="1"===window.sophi_config.enableSophiSSPW?"sophi":"sspw",s={event:"g2i_meter_stop",eng_author:t.Byline||"",title:t["Page Title"]||"",section:t.Section||"",actionType:"sophi"===i?"Sophi_SSPW":"SSPWV1",actionName:n},a("sspwG2iMeterEvent: article data found on dataLayer: ",t),e.next=4,kr();case 4:window.MG2DL=window.MG2DL||[],window.MG2DL.push(s),a("sspwG2iMeterEvent: event pushed to MG2DL: ",window.MG2DL),e.next=6;break;case 5:a("sspwG2iMeterEvent: event not pushed, criteria not met");case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const po={onLoadAnalytics:function(){var e=r(o.mark(function e(){var t,n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("ANALYTICS: Start Analytics"),ro(),window.MNGAuthentication.postAuthEvents=[],window.MNGAuthentication.preAuthGTMEvents=[],window.MNGAuthentication.postAuthEvents.push(uo),!((n=yr()).pathname.startsWith("/logout")||n.pathname.startsWith("/login")||n.pathname.startsWith("/callback"))){e.next=1;break}return e.abrupt("return");case 1:return ho(),e.next=2,io();case 2:return r=e.sent,e.next=3,lo();case 3:i=e.sent,oo(r,i),"1"!==window.authentication_config.serverEntitlements&&"1"!==(null===(t=window.sophi_config)||void 0===t?void 0:t.enableSophiSSPW)||(a("ANALYTICS: SSPW is active, setting up analytics events."),fo());case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),blueConicRegwallEvents:to,callPreparedGTMEvent:ao,callCustomGTMEvent:so};var go=function(){try{var e=localStorage.getItem(fr.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){a("Unable to get session from local storage: ",e)}return"{}"},wo=function(e){try{a("Setting local storage session",e),localStorage.setItem(fr.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){a("Unable to save session from local storage: ",e)}},mo=function(e){try{Sr(fr.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Er(),expires:365,secure:!0})}catch(e){a("Unable to save session to cookie storage: ",e)}},yo=function(){var e=r(o.mark(function e(){var t,n,r,s,c,u,l,d,h,f,p,g,w,m,y,A,b,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.A.sessionServer,n="".concat(t,"/api/session"),a("Checking server session: ",n),e.next=1,hr.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return h=r.data.entitlementTokenDecoded,f=r.data,p=f.accessToken,g=f.idToken,w=f.entitlementToken,m=null!==(s=null==h?void 0:h.entitlement_expiry)&&void 0!==s?s:null,y=null!==(c=null==h?void 0:h.entitlement_source)&&void 0!==c?c:null,A=null!==(u=null==h?void 0:h.entitlement_entitled)&&void 0!==u?u:null,b=null!==(l=null==h?void 0:h.entitlement_extras_adfree)&&void 0!==l?l:null,E=null!==(d=null==h?void 0:h.entitlement_level)&&void 0!==d?d:null,wo(JSON.stringify({accessToken:p,idToken:g,entitlementToken:w,expiration:m,entitlementSource:y,isEntitled:A,adFree:b,entitlementLevel:E})),""!==w&&"string"==typeof w&&mo(w),e.abrupt("return",{accessToken:p,idToken:g,entitlementToken:w,expiration:m,entitlementSource:y,isEntitled:A,adFree:b,entitlementLevel:E});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ao=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.A.sessionServer,r="".concat(n,"/api/session"),a("Updating server session: ",r),e.next=1,hr.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,s=e.catch(0),a("Failed to update session server: ",s);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),bo=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=i.A.sessionServer,n="".concat(t,"/api/session"),a("Deleting server session: ",n),e.next=1,hr.delete(n,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,r=e.catch(0),a("Failed to delete server session: ",r);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),Eo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,h,f,p,g,w,m,y,A,b,E,S,v,O,T,I,N,R,C,L;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Inside getSession"),e.prev=1,d=go(),a("Session: __MNG_Session = ",d),h=JSON.parse(d),f=h.accessToken,p=h.idToken,g=h.entitlementToken,w=h.expiration,m=h.entitlementSource,y=h.isEntitled,A=h.adFree,b=h.entitlementLevel,n=f,i=w,s=m,c=y,u=A,l=b,a("Session: check both tokens: ",t=p,r=g),void 0!==p&&void 0!==g&&null!==p&&null!==g){e.next=3;break}return a("Session: missing id or entitlements, try session server"),e.next=2,yo();case 2:E=e.sent,S=E.accessToken,v=E.idToken,O=E.entitlementToken,T=E.expiration,I=E.entitlementSource,N=E.isEntitled,R=E.adFree,C=E.entitlementLevel,n=S,t=v,r=O,i=T,s=I,c=N,u=R,l=C;case 3:e.next=5;break;case 4:e.prev=4,L=e.catch(1),a("Failed to get session: ",L);case 5:return a("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:s,isEntitled:c,adFree:u,entitlementLevel:l});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),So=function(){var e=r(o.mark(function e(t){var n,r,i,s,c,u,l,d,h,f,p,g,w,m,y,A,b,E,S,v,O,T,I,N,R,C,L,k,_;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=go(),r=JSON.parse(n),i=r.accessToken,s=void 0===i?null:i,c=r.idToken,u=void 0===c?null:c,l=r.entitlementToken,d=void 0===l?null:l,h=r.expiration,f=void 0===h?null:h,p=r.entitlementSource,g=void 0===p?null:p,w=r.isEntitled,m=void 0===w?null:w,y=r.adFree,A=void 0===y?null:y,b=r.entitlementLevel,E=void 0===b?null:b,S=t.accessToken,v=t.idToken,O=t.entitlementToken,T=t.expiration,I=t.entitlementSource,N=t.isEntitled,R=t.adFree,C=t.entitlementLevel,L={accessToken:null==S?s:S,idToken:null==v?u:v,entitlementToken:null==O?d:O,expiration:null==T?f:T,entitlementSource:null==I?g:I,isEntitled:null==N?m:N,adFree:null==R?A:R,entitlementLevel:null==C?E:C},a("Current session data: ",r),a("New session data: ",t),a("Updated session data:",L),k=JSON.stringify(L),wo(k),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&mo(L.entitlementToken),n===k){e.next=1;break}return e.next=1,Ao(L);case 1:e.next=3;break;case 2:e.prev=2,_=e.catch(0),a("Unable to save session: ",_);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),vo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Ending session..."),jr(),e.next=1,bo();case 1:localStorage.removeItem(fr.LOCAL_STORAGE_SESSION_KEY);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Oo=function(){return"logout"===(yr().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var To=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,zr();case 1:n=e.sent,a("Calling Auth0 logout..."),n.logout({returnTo:t});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Io=function(){return"undefined"==typeof CnnXt?(a("Connext was not loaded."),!1):Connext.Storage.GetUserState()},No=function(){a("Check for SS paywall Cookie");var e=window.location.hostname,t=document.cookie.split(";").find(function(e){return e.trim().startsWith("vip-go-seg=vc-v1__has_access")});if(/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.?)+[a-zA-Z]{2,6}$/.test(e)&&t){a("SS paywall Cookie found, removing it");var n=t.split("=")[0].trim();document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e),document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}},Ro=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u,l,d,h,f;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Attempting to logout..."),No(),a("About to perform user cache deletion..."),t=JSON.parse(localStorage.getItem(fr.LOCAL_STORAGE_SESSION_KEY)),n=t.idToken,!(i=n?Tr(n):"")){e.next=2;break}return s=i.auth0Id,e.next=1,Qr(s);case 1:e.sent.success?a("User cache cleared."):a("User cache deletion failed.");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=4;break}return e.next=3,vo();case 3:e.next=5;break;case 4:jr();case 5:return e.prev=5,a("Cycling through logout callbacks..."),c=window.MNGAuthentication.logoutCallbacks.map(function(e){return e()}),e.next=6,Promise.all(c);case 6:a("Finished cycling through logout callbacks."),e.next=8;break;case 7:e.prev=7,f=e.catch(5),a("Failed to cycle through logout callbacks: ",f);case 8:Object.keys(window.localStorage).filter(function(e){return e.includes("auth0")}).forEach(function(e){window.localStorage.removeItem(e),a("Removed Auth0 storage object...")}),Wr("hhsl"),Wr("userNewsLetterData"),Wr(fr.REGWALL_USER_IS_SUBSCRIBED),Wr(fr.USER_PROFILE_HASH),u=yr(),l=window.location.origin;try{u.searchParams.get("returnURL")&&(d=decodeURIComponent(u.searchParams.get("returnURL")),l=d)}catch(e){a(e),l=window.location.origin}return l=new URL(l),e.next=9,window.ConnextUtils.connextReady("onInit",!1);case 9:if(!e.sent){e.next=16;break}if(a("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),a("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),h=l,l.origin!==window.location.origin&&(h=new URL(window.location.origin)).searchParams.append("returnAfterLogout",l),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",h),!Xr()){e.next=10;break}a("About to call Connext Logout..."),setTimeout(function(){Connext.Logout()},500),e.next=15;break;case 10:if("Logged In"!==Io()){e.next=14;break}if(a("Connext user state is logged in, setting timeout..."),setTimeout(r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Connext took too long to logout, calling auth0 logout..."),e.next=1,To(l);case 1:case"end":return e.stop()}},e)})),8e3),"function"!=typeof Connext._logout){e.next=12;break}return a("About to call Connext _logout..."),e.next=11,Connext._logout();case 11:e.next=13;break;case 12:return a("About to call Connext Logout..."),e.next=13,Connext.Logout();case 13:e.next=15;break;case 14:return a("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=15,To(l);case 15:e.next=17;break;case 16:return a("Connext Logout was NOT called"),e.next=17,To(l);case 17:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}(),Co=function(){var e=0;for(var t in window.localStorage){var n=2*window.localStorage[t].length/1024/1024;!Number.isNaN(n)&&window.localStorage.hasOwnProperty(t)&&(e+=n)}return e},Lo=function(){window.MNGAuthentication.preAuthGTMEvents.forEach(function(e){return ao(e)}),a("Cycled through preauth GTM events.")},ko=function(){var e=r(o.mark(function e(t,n,r,i,s){var c,u,l,h,f,p,g,w,m,y,A,b,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Attempting to login..."),Co()>4.5&&window.localStorage.clear(),Lo(),i&&(c=[],u=window.localStorage.getItem("callbackEvents"),l=JSON.parse(u),c=l&&l.length>0?d(new Set([].concat(d(i),d(l)))):i,window.localStorage.setItem("callbackEvents",JSON.stringify(c))),h=null,e.next=1,zr();case 1:if(f=e.sent,p=yr(),g=p.origin,w=new URL("".concat(g,"/callback")),m={},p.searchParams.get("regwall")&&(p.searchParams.get("returnUrl")&&(y=p.searchParams.get("returnUrl")),p.searchParams.get("auth_redirect")&&(y=p.searchParams.get("auth_redirect"))),p.pathname.startsWith("/login")||p.pathname.startsWith("/callback")?p.searchParams.get("returnUrl")?w.searchParams.set("auth_redirect",p.searchParams.get("returnUrl")):s&&w.searchParams.set("auth_redirect",s):w.searchParams.set("auth_redirect",p.toString()),y&&"regwall"!==t&&w.searchParams.set("auth_redirect",y),"true"===p.searchParams.get("close-after-finish")&&w.searchParams.set("close-after-finish","true"),"true"!==p.searchParams.get("ssl")){e.next=4;break}if(!window.authentication_config.sessionManagementEnabled){e.next=3;break}return e.next=2,vo();case 2:e.next=4;break;case 3:jr();case 4:return null!==(h=p.searchParams.get("login-with"))?m.connection=h:n&&(m.connection=n),A="none",t&&"regwall"===t&&(w.searchParams.set("regwall","true"),A="signUp",a("Logging in with regwall")),t&&(w.searchParams.set("loginsource",t),a("Logging in with ".concat(t))),r&&(m.login_hint=r),m.redirect_uri=w.toString(),m.initialScreen=A,"googleonetap"!==t&&(m.prompt="select_account"),null!==(b=p.searchParams.get("ampRegiWall"))&&(E=window.location.hostname,m.ampRegiWall=b,m.sourceDomain=E.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.",""),m.initialScreen="signUp",m.preferenceId=p.searchParams.get("prefId")),e.next=5,f.loginWithRedirect({authorizationParams:m});case 5:case"end":return e.stop()}},e)}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),_o=function(){return new Promise(function(e){var t=setTimeout(function(){e()},8e3);try{var n=window.localStorage.getItem("callbackEvents"),r=JSON.parse(n);if(!r||0===r.length)return void e();a("Adding listeners to events we need to wait for...");var o=r.map(function(e){return t=e,new Promise(function(e){a("Adding event to wait for: ",t),window.addEventListener(t,function(n){try{var r=n.detail||{};a("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){a(t),e()}},!1)});var t});Promise.all(o).then(function(){clearTimeout(t),e()})}catch(t){a("Failed to wait for callback events",t),e()}})};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var Po=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u,l,d,h,f,p,g,w,m,y,A,b,E,S,v,O,T;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(No(),t=yr(),n=!1,i=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),s=t.searchParams.get("redirect_uri")||"",s.includes("applenews")?(a("This is Apple prelogin flow."),(c=new URL(s))?(c.searchParams.append("post-apple-login","true"),a("Post callback Apple redirect URL is ".concat(c)),ko(!1,!1,!1,[],c)):ko()):i.includes("post-apple-login")&&(a("This is Apple Callback flow."),n=!0,(u=new URL(decodeURIComponent(i))).searchParams.delete("post-apple-login"),i=u),a("Handling post login callback..."),!(l=t.searchParams.get("error_description"))){e.next=2;break}if("shouldAutoLogin"!==l){e.next=1;break}return e.abrupt("return",ko(!1,!1,!1,!1,i));case 1:n&&alert("There was an error in logging you in, please try again.");case 2:return e.next=3,zr();case 3:return d=e.sent,e.next=4,d.handleRedirectCallback();case 4:return e.next=5,d.getIdTokenClaims();case 5:return h=e.sent,e.next=6,d.getUser();case 6:return f=e.sent,a("Auth0 user profile: ",f),p=h.__raw,e.next=7,d.getTokenSilently();case 7:return g=e.sent,e.prev=8,a("Cycling through login callbacks..."),e.next=9,_o();case 9:return w=window.MNGAuthentication.oidcLoginCallbacks.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(p));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=10,Promise.all(w);case 10:a("Finished cycling through login callbacks."),e.next=12;break;case 11:e.prev=11,v=e.catch(8),a("Failed to cycle through login callbacks: ",v);case 12:if(m={accessToken:g,userId:f.sub,email:f.email,picture:f.picture},y=!1,A="",!n){e.next=17;break}return e.prev=13,e.next=14,Nr(m.userId);case 14:return A=e.sent,a("Encrypted apple uuid is: ".concat(A)),e.next=15,Ir(A);case 15:y=e.sent,a("Apple sub status is: ".concat(y)),e.next=17;break;case 16:e.prev=16,O=e.catch(13),a("Apple sub check error: ".concat(O)),alert("There was an error in logging you in, please try again.");case 17:if(Wr(fr.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=18;break}return a("Saving idToken to session server"),e.next=18,So({idToken:p,accessToken:g});case 18:if(!t.searchParams.get("close-after-finish")){e.next=19;break}return e.abrupt("return",window.close());case 19:if(!t.search.includes("loginsource")){e.next=20;break}return b=t.searchParams.get("loginsource"),E=window.MNGAuthentication.postAuthEvents.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(b));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=20,Promise.all(E);case 20:return e.prev=20,S=new URL(i),n&&y&&S.searchParams.append("access_token",A),a("Apple redirect URL:",S),e.abrupt("return",window.location.assign(S));case 21:return e.prev=21,T=e.catch(20),a("Failed to redirect after authentication: ",T),window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 22:case"end":return e.stop()}},e,null,[[8,11],[13,16],[20,21]])}));return function(){return e.apply(this,arguments)}}(),xo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("ANALYTICS: fireBC events"),e.next=1,to();case 1:a("ANALYTICS: bc values should be filled");case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Uo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,h,f,p,g;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Kr();case 1:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=4;break}return e.prev=2,s=Tr(n),c=s.email,u=s.picture,l=s.sub,d=s.name,h=s.nickname,f=s.connection_source,p=null===(i=s.user_metadata)||void 0===i||null===(i=i.customProfile)||void 0===i?void 0:i.nickname,l.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:p||h||d,email:c,picture:u,userId:l,connectionSource:f});case 3:e.prev=3,g=e.catch(2),a("Unable to parse idToken: ",n," Error: ",g);case 4:return e.abrupt("return",{authenticated:r});case 5:case"end":return e.stop()}},e,null,[[2,3]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.login=ko,window.MNGAuthentication.logout=Ro,window.MNGAuthentication.getUserInfo=Uo;var Bo=function(){var e=r(o.mark(function e(){var t,n,s,u,l,d,h,f,p,g,w,m,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=yr(),n=!1,s="",u=!1,l={},Oo()&&window.ConnextUtils.rerunConnextEntitlements(!0),t.searchParams.get("returnAfterLogout")&&(d=decodeURIComponent(t.searchParams.get("returnAfterLogout")),window.location.assign(d)),t.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),h=function(){var e=r(o.mark(function e(){var t,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,zr();case 1:return t=e.sent,e.next=2,t.getIdTokenClaims();case 2:return l=e.sent,e.next=3,t.isAuthenticated();case 3:if(n=e.sent,s="object"===c(l)?l.__raw:"",r=Ar(fr.ENTITLEMENT_COOKIE_KEY),n||!r){e.next=5;break}return e.next=4,t.getTokenSilently();case 4:u=e.sent;case 5:e.next=7;break;case 6:e.prev=6,i=e.catch(0),a("Unable to verify user has active auth0 session: ",i);case 7:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),!t.pathname.startsWith("/logout")){e.next=2;break}return a("Page is logout. Routing to logout function..."),e.next=1,Ro();case 1:return e.abrupt("return");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=3,h();case 3:if(""===s){e.next=5;break}if(f=null,p=JSON.parse(window.localStorage.getItem(fr.LOCAL_STORAGE_SESSION_KEY)),"{}"!==go()){e.next=4;break}return p&&(f=p.jwt),e.next=4,So({idToken:s,entitlementToken:f});case 4:e.next=8;break;case 5:return e.prev=5,e.next=6,Eo();case 6:g=e.sent,s=g.idToken,(n="string"==typeof s)&&(l=Tr(s)),e.next=8;break;case 7:e.prev=7,y=e.catch(5),a("Unable to initialize session: ",y);case 8:e.next=10;break;case 9:return e.next=10,h();case 10:if(n||u||!i.A.blueconicEnabled||!i.A.bcLowaSegements){e.next=12;break}return e.next=11,Gr(!0);case 11:(w=e.sent).isSub&&(n=fr.USER_IS_LOWA,l={sub:w.uuid});case 12:if(Jr({isAuthenticated:n,idToken:s,accessToken:u,claims:l}),qr("authenticationReady"),!0===n?(a("User is authenticated."),t.searchParams.get("auth_redirect")&&(a("Auth Redirect is present, sending user to auth redirect..."),(m=t.searchParams.get("auth_redirect")).endsWith("#")&&(m=m.slice(0,m.length)),window.location.assign(m)),t.pathname.startsWith("/login")&&!Oo()&&(a("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(t.origin))):a("User is not authenticated."),t.pathname.startsWith("/login")&&!Oo()?(a("Page is login. Attempting to log user in..."),ko()):a("Page is not login or Connext state is present"),!t.pathname.startsWith("/callback")||!t.searchParams.get("regwall")){e.next=14;break}return a("Page is callback with regwall param. Routing to regwall receiver..."),e.next=13,xo();case 13:a("Now login from regwall"),ko(),e.next=15;break;case 14:if(!t.pathname.startsWith("/callback")){e.next=15;break}return a("Page is callback without regwall param. Routing to callback receiver..."),e.next=15,Po();case 15:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.init=Bo;const Do={init:Bo};var Mo=function(e,t){return new Promise(function(n){try{"undefined"==typeof CnnXt&&(a("Connext was not loaded."),n(!1)),a("connext subscribeToNewsletter","about to call Cnnxt NewsletterSubscribe with pref id ".concat(t," and email ").concat(e)),CnnXt.API.NewsletterSubscribe({email:e,id:t,onSuccess:function(){a("Signed user up to newsletter: ",t),n(!0)},onError:function(e){a("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){a("subscribeToNewsletter Error:",e),n(!1)}})};var Go=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Google token ",t),n=Tr(t.credential),e.prev=1,ao("one_tap_click"),localStorage.setItem("regwallSuccess","yes"),!i.A.newsletterId){e.next=2;break}return a("About to call Connext's subscribeToNewsletter function"),e.next=2,Mo(n.email,i.A.newsletterId);case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(1),a("Error: ",r);case 4:return a("About to login with onetap flow..."),e.next=5,window.MNGAuthentication.login("googleonetap",i.A.useTribMainGoogle?"Trib-Google":"google-oauth2",n.email);case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),Fo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:google.accounts.id.initialize({client_id:i.A.googleClientId,callback:Go,auto_select:!1,cancel_on_tap_outside:!1}),a("Showing the onetap modal..."),google.accounts.id.prompt(function(e){var t;e.isDisplayed()?t="one_tap_displayed":e.isSkippedMoment()?t="one_tap_cancel":e.isNotDisplayed()&&"suppressed_by_user"===e.j&&(t="one_tap_auto_hide"),ao(t)});case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const Ko={init:function(){var e=r(o.mark(function e(){var t,n,r,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i.A.oneTapEnabled){e.next=1;break}return e.abrupt("return");case 1:return e.next=2,Kr();case 2:if(t=e.sent,n=t.isAuthenticated,r=yr(),n!==fr.USER_IS_LOWA){e.next=5;break}return e.next=3,Mr();case 3:if(!(s=e.sent)||s.includes("google")){e.next=4;break}return e.abrupt("return");case 4:e.next=6;break;case 5:if(!(n||r.pathname.startsWith("/login")||r.pathname.startsWith("/logout")||r.pathname.startsWith("/callback"))){e.next=6;break}return e.abrupt("return");case 6:return e.next=7,Cr();case 7:return a("onetap loading..."),c=new Date,e.next=8,Fo(c);case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Settings: ",i.A),Do.init(),po.onLoadAnalytics(),e.next=1,Ko.init();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.main.bundle.js.map; /*! For license information please see mng-digisubs.connext.bundle.js.LICENSE.txt */ (()=>{var e={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,g=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*g}},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},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},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:"",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}},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},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},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)}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},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},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},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 g(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:g}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},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|g(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(J(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(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(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 g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(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 Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function m(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 L(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(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<=N)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=g,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(J(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 b(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return v(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(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 N=4096;function R(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 U(e,t,n,r,o){H(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 x(e,t,n,r,o){H(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||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||_(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||_(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(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||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(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||_(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||_(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||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(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||_(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||_(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||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||_(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(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=q(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,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=q(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return 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 H(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 G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||X(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("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 W=/[^+/0-9A-Za-z-_]/g;function Y(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 V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(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 $=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 q(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}},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={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);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)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>qt,hasStandardBrowserEnv:()=>en,hasStandardBrowserWebWorkerEnv:()=>tn,navigator:()=>Qt,origin:()=>nn});var o=n(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 n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;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,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(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)}}function f(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&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 n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,w.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),w.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var c=!1,u=0;uDate.now();class S extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,S.prototype)}static fromPayload({error:e,error_description:t}){return new S(e,t)}}class v extends S{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,v.prototype)}}class O extends S{constructor(e,t,n,r,o=null){super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,O.prototype)}}class I extends S{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,I.prototype)}}class T extends I{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,T.prototype)}}class N extends S{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class R extends S{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,R.prototype)}}class C extends S{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,C.prototype)}}class L extends S{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${P(e,["default"])}', scope: '${P(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,L.prototype)}}class k extends S{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${P(e,["default"])}', missing scope: '${P(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,k.prototype)}}class _ extends S{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,_.prototype)}}function P(e,t=[]){return e&&!t.includes(e)?e:""}const U=()=>window.crypto,x=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(U().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},B=e=>btoa(e),D=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],M=e=>Object.keys(e).reduce((t,n)=>{const r=D.find(e=>e.key===n);return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t},{}),G=e=>{var{clientId:t}=e,n=f(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},F=async e=>{const t=U().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},K=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),H=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},j=new TextEncoder,X=new TextDecoder;function W(e){return"string"==typeof e?j.encode(e):X.decode(e)}function Y(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new Z(`${e.name} modulusLength must be at least 2048 bits`)}let V;if(Uint8Array.prototype.toBase64)V=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;V=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},oe=async(e,t,n,r,o,i,a=1e4,s)=>o?(async(e,t,n,r,o,i,a,s)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s},u=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(c,[n.port2])});var c,u})(e,t,n,r,a,o,i,s):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([re(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,a);async function ie(e,t,n,r,o,i,a,s,c,u){if(c){const t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let l,d=null;for(let c=0;c<3;c++)try{l=await oe(e,n,r,o,i,a,t,s),d=null;break}catch(e){d=e}if(d)throw d;const h=l.json,{error:p,error_description:g}=h,m=f(h,["error","error_description"]),{headers:w,ok:y}=l;let E;if(c&&(E=w["dpop-nonce"],E&&await c.setNonce(E)),!y){const l=g||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===p)throw new C(p,l,m.mfa_token);if("missing_refresh_token"===p)throw new L(n,r);if("use_dpop_nonce"===p){if(!c||!E||u)throw new _(E);return ie(e,t,n,r,o,i,a,s,c,!0)}throw new S(p||"request_error",l)}return m}async function ae(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,l=f(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const d="urn:ietf:params:oauth:grant-type:token-exchange"===l.grant_type,h="refresh_token"===l.grant_type&&c,p=Object.assign(Object.assign(Object.assign(Object.assign({},l),d&&o&&{audience:o}),d&&i&&{scope:i}),h&&{audience:o,scope:i}),g=s?G(p):JSON.stringify(p),m=(w=l.grant_type,ne.includes(w));var w;return await ie(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:g,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(M(a||b)))}},t,s,c,m?u:void 0)}const se=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},ce=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),se(r,t)};class ue{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new ue({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new ue({scope:t,audience:n,clientId:r})}}class le{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}class de{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class he{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||A}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!i&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const a=await this.nowProvider(),s=Math.floor(a/1e3);return i.expiresAt-t!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new ue({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=ue.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=ue.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}}class fe{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const pe=e=>"number"==typeof e,ge=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var me=m(function(e,t){var n=p&&p.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nbe.get(e)||be.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),ye(`_legacy_${e}`,JSON.stringify(t),r),be.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Ee(e,n),be.remove(e,t),be.remove(`_legacy_${e}`,t)}},Se={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var ve;!function(e){e.Code="code",e.ConnectCode="connect_code"}(ve||(ve={}));var Oe,Ie=function(e){return Oe=Oe||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o{for(let n=0;n0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const Ce={memory:()=>(new de).enclosedCache,localstorage:()=>new le},Le=e=>Ce[e],ke=e=>{const{openUrl:t,onRedirect:n}=e,r=f(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},_e=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},Pe={NONCE:"nonce",KEYPAIR:"keypair"};class Ue{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(Pe).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(Pe.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(Pe.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(Pe.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Pe.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(Pe.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Pe.KEYPAIR,this.clientId)}}class xe{constructor(e){this.storage=new Ue(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){const i=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t);return ee(e,i,n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Q(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await te(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new J("unsupported JWK kty")}return z(await crypto.subtle.digest({name:"SHA-256"},W(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Be;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(Be||(Be={}));class De{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=Be.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?Be.DPoP:Be.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===Be.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new _(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class Me{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new Ge({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new Ge(t)}}class Ge extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,Ge.prototype)}}const Fe=new y;class Ke{constructor(e){let t,n;if(this.userCache=(new de).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await Fe.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!U())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===U().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!Le(t))throw new Error(`Invalid cache location "${t}"`);n=Le(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?be:Ae,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:Se;var o;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:se(t,e,...n)};let r={default:se(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=se(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new fe(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||A,this.cacheManager=new he(n,n.allKeys?void 0:new Re(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new xe(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl);const i=`${this.domainUrl}/me/`,a=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:i},detailedResponse:!0})}));this.myAccountApi=new Me(a,i),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Ie)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||b)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${G(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(K(r)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],ge.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(K(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!pe(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!pe(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!pe(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&pe(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),ro)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=B(x()),i=B(x()),a=x(),s=await F(a),c=H(s),u=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),l=((e,t,n,r,o,i,a,s,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:ce(t,n.scope,n.audience),response_type:"code",response_mode:s||"query",state:r,nonce:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),d=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new R;const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(e=>new Promise((t,n)=>{let r;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new N(e.popup)))},1e3),i=setTimeout(()=>{clearInterval(o),n(new T(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),!1!==e.closePopup&&e.popup.close(),a.data.response.error)return n(S.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==o.state)throw new S("state_mismatch","Invalid state");const i=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:i})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=ke(e),{openUrl:r,fragment:o,appState:i}=n,a=f(n,["openUrl","fragment","appState"]),s=(null===(t=a.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,l=f(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i,response_type:ve.Code}),s&&{organization:s}));const d=o?`${u}#${o}`:u;r?await r(d):window.location.assign(d)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new S("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===ve.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new v(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new S("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:ve.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new O(o,i||o,t.connection,r,t.appState);if(!n)throw new S("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new S("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:ve.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ce(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=Te[t];return n||(n=e().finally(()=>{delete Te[t],n=null}),Te[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=f(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!await Ne(()=>Fe.acquireLock(r,5e3),10))throw new I;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},a?{scope:a}:null),{expires_in:s})}finally{await Fe.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ce(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},E),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new ue({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=f(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${G(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=ke(e),{openUrl:r}=n,o=f(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=`auth0.lock.getTokenFromIFrame.${this.options.clientId}`;if(!await Ne(()=>Fe.acquireLock(t,5e3),10))throw new I;try{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new S("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const l=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(e){d=this.domainUrl}const h=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",s,!1))};let s;const c=setTimeout(()=>{o(new I),a()},1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(S.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,d,l);if(o!==h.state)throw new S("state_mismatch","Invalid state");const f=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:h.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},f),{scope:c,oauthTokenScope:f.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}finally{await Fe.releaseLock(t)}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new ue({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new L(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(u.refresh_token&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,u.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,a=null==t?void 0:t.scope,s=e.authorizationParams.audience,c=e.authorizationParams.scope,i===s&&_e(c,a)||_e(o,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,u.scope);throw new k(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}var i,a,s,c}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=f(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new ue({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new ue({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){var n,r;const{nonceIn:o,organization:i,scopesToRequest:a}=t||{},s=await ae(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:a||e.scope}),this.worker),c=await this._verifyIdToken(s.id_token,o,i);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(r=null===(n=null==e?void 0:e.decodedToken)||void 0===n?void 0:n.claims)||void 0===r?void 0:r.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:c,scope:e.scope,audience:e.audience||"default"}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(i||c.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:c})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:ce(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new De(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,scopes:o,authorization_params:i,redirectUri:a=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const s=B(x()),c=x(),u=await F(c),l=H(u),{connect_uri:d,connect_params:h,auth_session:f}=await this.myAccountApi.connectAccount({connection:r,scopes:o,redirect_uri:a,state:s,code_challenge:l,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:f,redirect_uri:a,appState:n,connection:r,response_type:ve.ConnectCode});const p=new URL(d);p.searchParams.set("ticket",h.ticket),t?await t(p.toString()):window.location.assign(p)}}function He(e,t){return function(){return e.apply(t,arguments)}}const{toString:je}=Object.prototype,{getPrototypeOf:Xe}=Object,{iterator:We,toStringTag:Ye}=Symbol,Ve=(ze=Object.create(null),e=>{const t=je.call(e);return ze[t]||(ze[t]=t.slice(8,-1).toLowerCase())});var ze;const Je=e=>(e=e.toLowerCase(),t=>Ve(t)===e),Ze=e=>t=>typeof t===e,{isArray:$e}=Array,qe=Ze("undefined");function Qe(e){return null!==e&&!qe(e)&&null!==e.constructor&&!qe(e.constructor)&&nt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const et=Je("ArrayBuffer");const tt=Ze("string"),nt=Ze("function"),rt=Ze("number"),ot=e=>null!==e&&"object"==typeof e,it=e=>{if("object"!==Ve(e))return!1;const t=Xe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ye in e||We in e)},at=Je("Date"),st=Je("File"),ct=Je("Blob"),ut=Je("FileList"),lt=Je("URLSearchParams"),[dt,ht,ft,pt]=["ReadableStream","Request","Response","Headers"].map(Je);function gt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),$e(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,yt=e=>!qe(e)&&e!==wt;const Et=(bt="undefined"!=typeof Uint8Array&&Xe(Uint8Array),e=>bt&&e instanceof bt);var bt;const At=Je("HTMLFormElement"),St=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vt=Je("RegExp"),Ot=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};gt(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const It=Je("AsyncFunction"),Tt=(Nt="function"==typeof setImmediate,Rt=nt(wt.postMessage),Nt?setImmediate:Rt?(Ct=`axios@${Math.random()}`,Lt=[],wt.addEventListener("message",({source:e,data:t})=>{e===wt&&t===Ct&&Lt.length&&Lt.shift()()},!1),e=>{Lt.push(e),wt.postMessage(Ct,"*")}):e=>setTimeout(e));var Nt,Rt,Ct,Lt;const kt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(wt):"undefined"!=typeof process&&process.nextTick||Tt,_t={isArray:$e,isArrayBuffer:et,isBuffer:Qe,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||nt(e.append)&&("formdata"===(t=Ve(e))||"object"===t&&nt(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&et(e.buffer),t},isString:tt,isNumber:rt,isBoolean:e=>!0===e||!1===e,isObject:ot,isPlainObject:it,isEmptyObject:e=>{if(!ot(e)||Qe(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:dt,isRequest:ht,isResponse:ft,isHeaders:pt,isUndefined:qe,isDate:at,isFile:st,isBlob:ct,isRegExp:vt,isFunction:nt,isStream:e=>ot(e)&&nt(e.pipe),isURLSearchParams:lt,isTypedArray:Et,isFileList:ut,forEach:gt,merge:function e(){const{caseless:t,skipUndefined:n}=yt(this)&&this||{},r={},o=(o,i)=>{const a=t&&mt(r,i)||i;it(r[a])&&it(o)?r[a]=e(r[a],o):it(o)?r[a]=e({},o):$e(o)?r[a]=o.slice():n&&qe(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(gt(t,(t,r)=>{n&&nt(t)?e[r]=He(t,n):e[r]=t},{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),e.prototype.constructor=e,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&&Xe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ve,kindOfTest:Je,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($e(e))return e;let t=e.length;if(!rt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[We]).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:At,hasOwnProperty:St,hasOwnProp:St,reduceDescriptors:Ot,freezeMethods:e=>{Ot(e,(t,n)=>{if(nt(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];nt(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 $e(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:mt,global:wt,isContextDefined:yt,isSpecCompliantForm:function(e){return!!(e&&nt(e.append)&&"FormData"===e[Ye]&&e[We])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ot(e)){if(t.indexOf(e)>=0)return;if(Qe(e))return e;if(!("toJSON"in e)){t[r]=e;const o=$e(e)?[]:{};return gt(e,(e,t)=>{const i=n(e,r+1);!qe(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:It,isThenable:e=>e&&(ot(e)||nt(e))&&nt(e.then)&&nt(e.catch),setImmediate:Tt,asap:kt,isIterable:e=>null!=e&&nt(e[We])};function Pt(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}_t.inherits(Pt,Error,{toJSON:function(){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:_t.toJSONObject(this.config),code:this.code,status:this.status}}});const Ut=Pt.prototype,xt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{xt[e]={value:e}}),Object.defineProperties(Pt,xt),Object.defineProperty(Ut,"isAxiosError",{value:!0}),Pt.from=(e,t,n,r,o,i)=>{const a=Object.create(Ut);_t.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Pt.call(a,s,c,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const Bt=Pt;var Dt=n(8287).hp;function Mt(e){return _t.isPlainObject(e)||_t.isArray(e)}function Gt(e){return _t.endsWith(e,"[]")?e.slice(0,-2):e}function Ft(e,t,n){return e?e.concat(t).map(function(e,t){return e=Gt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Kt=_t.toFlatObject(_t,{},null,function(e){return/^is[A-Z]/.test(e)});const Ht=function(e,t,n){if(!_t.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=_t.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!_t.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&_t.isSpecCompliantForm(t);if(!_t.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(_t.isDate(e))return e.toISOString();if(_t.isBoolean(e))return e.toString();if(!s&&_t.isBlob(e))throw new Bt("Blob is not supported. Use a Buffer instead.");return _t.isArrayBuffer(e)||_t.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Dt.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(_t.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(_t.isArray(e)&&function(e){return _t.isArray(e)&&!e.some(Mt)}(e)||(_t.isFileList(e)||_t.endsWith(n,"[]"))&&(s=_t.toArray(e)))return n=Gt(n),s.forEach(function(e,r){!_t.isUndefined(e)&&null!==e&&t.append(!0===a?Ft([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Mt(e)||(t.append(Ft(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Kt,{defaultVisitor:u,convertValue:c,isVisitable:Mt});if(!_t.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!_t.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),_t.forEach(n,function(n,i){!0===(!(_t.isUndefined(n)||null===n)&&o.call(t,n,_t.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Xt(e,t){this._pairs=[],e&&Ht(e,this,t)}const Wt=Xt.prototype;Wt.append=function(e,t){this._pairs.push([e,t])},Wt.toString=function(e){const t=e?function(t){return e.call(this,t,jt)}:jt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Yt=Xt;function Vt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function zt(e,t,n){if(!t)return e;const r=n&&n.encode||Vt;_t.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):_t.isURLSearchParams(t)?t.toString():new Yt(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Jt=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){_t.forEach(this.handlers,function(t){null!==t&&e(t)})}},Zt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$t={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Yt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qt="undefined"!=typeof window&&"undefined"!=typeof document,Qt="object"==typeof navigator&&navigator||void 0,en=qt&&(!Qt||["ReactNative","NativeScript","NS"].indexOf(Qt.product)<0),tn="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,nn=qt&&window.location.href||"http://localhost",rn={...e,...$t};const on=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&&_t.isArray(r)?r.length:i,s)return _t.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&_t.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&_t.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 _t.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const an={transitional:Zt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=_t.isObject(e);o&&_t.isHTMLForm(e)&&(e=new FormData(e));if(_t.isFormData(e))return r?JSON.stringify(on(e)):e;if(_t.isArrayBuffer(e)||_t.isBuffer(e)||_t.isStream(e)||_t.isFile(e)||_t.isBlob(e)||_t.isReadableStream(e))return e;if(_t.isArrayBufferView(e))return e.buffer;if(_t.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 Ht(e,new rn.classes.URLSearchParams,{visitor:function(e,t,n,r){return rn.isNode&&_t.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=_t.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ht(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(_t.isString(e))try{return(t||JSON.parse)(e),_t.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||an.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(_t.isResponse(e)||_t.isReadableStream(e))return e;if(e&&_t.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 Bt.from(e,Bt.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:rn.classes.FormData,Blob:rn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};_t.forEach(["delete","get","head","post","put","patch"],e=>{an.headers[e]={}});const sn=an,cn=_t.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"]),un=Symbol("internals");function ln(e){return e&&String(e).trim().toLowerCase()}function dn(e){return!1===e||null==e?e:_t.isArray(e)?e.map(dn):String(e)}function hn(e,t,n,r,o){return _t.isFunction(r)?r.call(this,t,n):(o&&(t=n),_t.isString(t)?_t.isString(r)?-1!==t.indexOf(r):_t.isRegExp(r)?r.test(t):void 0:void 0)}class fn{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ln(t);if(!o)throw new Error("header name must be a non-empty string");const i=_t.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=dn(e))}const i=(e,t)=>_t.forEach(e,(e,n)=>o(e,n,t));if(_t.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(_t.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]&&cn[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(_t.isObject(e)&&_t.isIterable(e)){let n,r,o={};for(const t of e){if(!_t.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?_t.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=ln(e)){const n=_t.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(_t.isFunction(t))return t.call(this,e,n);if(_t.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ln(e)){const n=_t.findKey(this,e);return!(!n||void 0===this[n]||t&&!hn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ln(e)){const o=_t.findKey(n,e);!o||t&&!hn(0,n[o],o,t)||(delete n[o],r=!0)}}return _t.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&&!hn(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return _t.forEach(this,(r,o)=>{const i=_t.findKey(n,o);if(i)return t[i]=dn(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]=dn(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return _t.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&_t.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[un]=this[un]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ln(e);t[r]||(!function(e,t){const n=_t.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 _t.isArray(e)?e.forEach(r):r(e),this}}fn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),_t.reduceDescriptors(fn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),_t.freezeMethods(fn);const pn=fn;function gn(e,t){const n=this||sn,r=t||n,o=pn.from(r.headers);let i=r.data;return _t.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function mn(e){return!(!e||!e.__CANCEL__)}function wn(e,t,n){Bt.call(this,null==e?"canceled":e,Bt.ERR_CANCELED,t,n),this.name="CanceledError"}_t.inherits(wn,Bt,{__CANCEL__:!0});const yn=wn;function En(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Bt("Request failed with status code "+n.status,[Bt.ERR_BAD_REQUEST,Bt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const bn=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)]},Sn=(e,t,n=3)=>{let r=0;const o=bn(50,250);return An(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)},vn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},On=e=>(...t)=>_t.asap(()=>e(...t)),In=rn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rn.origin),rn.navigator&&/(msie|trident)/i.test(rn.navigator.userAgent)):()=>!0,Tn=rn.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];_t.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),_t.isString(r)&&s.push(`path=${r}`),_t.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),_t.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 Nn(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Rn=e=>e instanceof pn?{...e}:e;function Cn(e,t){t=t||{};const n={};function r(e,t,n,r){return _t.isPlainObject(e)&&_t.isPlainObject(t)?_t.merge.call({caseless:r},e,t):_t.isPlainObject(t)?_t.merge({},t):_t.isArray(t)?t.slice():t}function o(e,t,n,o){return _t.isUndefined(t)?_t.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!_t.isUndefined(t))return r(void 0,t)}function a(e,t){return _t.isUndefined(t)?_t.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(Rn(e),Rn(t),0,!0)};return _t.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);_t.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Ln=e=>{const t=Cn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=pn.from(a),t.url=zt(Nn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),_t.isFormData(n))if(rn.hasStandardBrowserEnv||rn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(_t.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(rn.hasStandardBrowserEnv&&(r&&_t.isFunction(r)&&(r=r(t)),r||!1!==r&&In(t.url))){const e=o&&i&&Tn.read(i);e&&a.set(o,e)}return t},kn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ln(e);let o=r.data;const i=pn.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 g=new XMLHttpRequest;function m(){if(!g)return;const r=pn.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());En(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new Bt("Request aborted",Bt.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Bt(r,Bt.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Zt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Bt(t,o.clarifyTimeoutError?Bt.ETIMEDOUT:Bt.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&_t.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),_t.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),f&&([c,l]=Sn(f,!0),g.addEventListener("progress",c)),h&&g.upload&&([s,u]=Sn(h),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new yn(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const w=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);w&&-1===rn.protocols.indexOf(w)?n(new Bt("Unsupported protocol "+w+":",Bt.ERR_BAD_REQUEST,e)):g.send(o||null)})},_n=(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 Bt?t:new yn(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Bt(`timeout ${t} of ms exceeded`,Bt.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=()=>_t.asap(a),s}},Pn=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Un(e))yield*Pn(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:Bn}=_t,Dn=(({Request:e,Response:t})=>({Request:e,Response:t}))(_t.global),{ReadableStream:Mn,TextEncoder:Gn}=_t.global,Fn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Kn=e=>{e=_t.merge.call({skipUndefined:!0},Dn,e);const{fetch:t,Request:n,Response:r}=e,o=t?Bn(t):"function"==typeof fetch,i=Bn(n),a=Bn(r);if(!o)return!1;const s=o&&Bn(Mn),c=o&&("function"==typeof Gn?(u=new Gn,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Fn(()=>{let e=!1;const t=new n(rn.origin,{body:new Mn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Fn(()=>_t.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 Bt(`Response type '${e}' is not supported`,Bt.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=_t.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(_t.isBlob(e))return e.size;if(_t.isSpecCompliantForm(e)){const t=new n(rn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return _t.isArrayBufferView(e)||_t.isArrayBuffer(e)?e.byteLength:(_t.isURLSearchParams(e)&&(e+=""),_t.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:g,onUploadProgress:m,responseType:w,headers:y,withCredentials:E="same-origin",fetchOptions:b}=Ln(e),A=t||fetch;w=w?(w+"").toLowerCase():"text";let S=_n([c,u&&u.toAbortSignal()],p),v=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let I;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(I=await f(y,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(_t.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=vn(I,Sn(On(m)));s=xn(t.body,65536,e,n)}}_t.isString(E)||(E=E?"include":"omit");const t=i&&"credentials"in n.prototype,c={...b,signal:S,method:a.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?E:void 0};v=i&&new n(o,c);let u=await(i?A(v,b):A(o,c));const p=d&&("stream"===w||"response"===w);if(d&&(g||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=_t.toFiniteNumber(u.headers.get("content-length")),[n,o]=g&&vn(t,Sn(On(g),!0))||[];u=new r(xn(u.body,65536,n,()=>{o&&o(),O&&O()}),e)}w=w||"text";let T=await h[_t.findKey(h,w)||"text"](u,e);return!p&&O&&O(),await new Promise((t,n)=>{En(t,n,{data:T,headers:pn.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:v})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Bt("Network Error",Bt.ERR_NETWORK,e,v),{cause:t.cause||t});throw Bt.from(t,t&&t.code,e,v)}}},Hn=new Map,jn=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=Hn;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Kn(t)),u=s;return s},Xn=(jn(),{http:null,xhr:kn,fetch:{get:jn}});_t.forEach(Xn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Wn=e=>`- ${e}`,Yn=e=>_t.isFunction(e)||null===e||!1===e;const Vn={getAdapter:function(e,t){e=_t.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(Wn).join("\n"):" "+Wn(e[0]):"as no adapter specified";throw new Bt("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Xn};function zn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yn(null,e)}function Jn(e){zn(e),e.headers=pn.from(e.headers),e.data=gn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Vn.getAdapter(e.adapter||sn.adapter,e)(e).then(function(t){return zn(e),t.data=gn.call(e,e.transformResponse,t),t.headers=pn.from(t.headers),t},function(t){return mn(t)||(zn(e),t&&t.response&&(t.response.data=gn.call(e,e.transformResponse,t.response),t.response.headers=pn.from(t.response.headers))),Promise.reject(t)})}const Zn="1.13.2",$n={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$n[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const qn={};$n.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Zn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Bt(r(o," has been removed"+(t?" in "+t:"")),Bt.ERR_DEPRECATED);return t&&!qn[o]&&(qn[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)}},$n.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Qn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Bt("options must be an object",Bt.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 Bt("option "+i+" must be "+n,Bt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Bt("Unknown option "+i,Bt.ERR_BAD_OPTION)}},validators:$n},er=Qn.validators;class tr{constructor(e){this.defaults=e||{},this.interceptors={request:new Jt,response:new Jt}}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=Cn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Qn.assertOptions(n,{silentJSONParsing:er.transitional(er.boolean),forcedJSONParsing:er.transitional(er.boolean),clarifyTimeoutError:er.transitional(er.boolean)},!1),null!=r&&(_t.isFunction(r)?t.paramsSerializer={serialize:r}:Qn.assertOptions(r,{encode:er.function,serialize:er.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Qn.assertOptions(t,{baseUrl:er.spelling("baseURL"),withXsrfToken:er.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&_t.merge(o.common,o[t.method]);o&&_t.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=pn.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(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=[Jn.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 yn(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 rr(function(t){e=t});return{token:t,cancel:e}}}const or=rr;const ir={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(ir).forEach(([e,t])=>{ir[t]=e});const ar=ir;const sr=function e(t){const n=new nr(t),r=He(nr.prototype.request,n);return _t.extend(r,nr.prototype,n,{allOwnKeys:!0}),_t.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Cn(t,n))},r}(sn);sr.Axios=nr,sr.CanceledError=yn,sr.CancelToken=or,sr.isCancel=mn,sr.VERSION=Zn,sr.toFormData=Ht,sr.AxiosError=Bt,sr.Cancel=sr.CanceledError,sr.all=function(e){return Promise.all(e)},sr.spread=function(e){return function(t){return e.apply(null,t)}},sr.isAxiosError=function(e){return _t.isObject(e)&&!0===e.isAxiosError},sr.mergeConfig=Cn,sr.AxiosHeaders=pn,sr.formToJSON=e=>on(_t.isHTMLForm(e)?new FormData(e):e),sr.getAdapter=Vn.getAdapter,sr.HttpStatusCode=ar,sr.default=sr;const cr=sr;var ur=n(3612);const lr=function(){if(ur.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=wr().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])},br=function(){var e=Er();return".".concat(e)},Ar=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(lr("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=l(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},Sr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=Er(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=l(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},vr=function(){return wr().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Or=function(e){return function(e,t){if("string"!=typeof e)throw new d("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 d(`Invalid token specified: missing part #${n+1}`);let o;try{o=h(r)}catch(e){throw new d(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new d(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},Ir=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=Er().split(".")[0],e.prev=1,e.next=2,cr({method:"get",url:"".concat(ur.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 2:if(!(r=e.sent).data){e.next=3;break}return lr("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 3:return e.abrupt("return",!1);case 4:return e.prev=4,i=e.catch(1),lr("Apple Sub Check: Request Failure: ",i),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),Tr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,cr({method:"get",url:"".concat(ur.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":ur.A.entitlementsApiKey}});case 1:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Nr=function(){return"complete"===document.readyState},Rr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(Nr())t();else{lr("UIHandler: ","Waiting for the body to load...");var i=setInterval(r(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=Nr()),document.querySelector("body")&&n&&(clearInterval(i),t(!0));case 1:case"end":return r.stop()}},r)})),200)}})},Cr=function(){return new Promise(function(e){if(("interactive"===document.readyState||Nr())&&window.dataLayer)lr("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{lr("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.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)}})},Lr=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Cr();case 1:return lr("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",lr("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return lr("Utils dataLayerLoop: look for this element ",e),e[t]?(lr("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(lr("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(r),e.abrupt("return",i?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),kr=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.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,Lr(t);case 1:return n=e.sent,lr("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)}}(),_r=function(){return new Promise(function(e){lr("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){lr("blueConicReady | onReady fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),lr("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)},3e3)})},Pr=function(){return new Promise(function(e){lr("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(lr("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},function(){lr("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),lr("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)},3e3)})},Ur=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){lr("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout(function(){clearTimeout(n),lr("blueConicLoaded | onBlueConicLoaded timeout, resolving false for load status."),t(!1)},1e4);void 0!==window.blueConicClient&&void 0!==window.blueConicClient.event&&void 0!==window.blueConicClient.event.subscribe?(lr("blueConicLoaded | BC object already loaded"),e?t(_r()):(clearTimeout(n),t())):(lr('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(o.mark(function r(){var i;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(lr("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=2;break}return lr("blueConicLoaded | waiting for blueConicReady..."),r.next=1,_r();case 1:i=r.sent,clearTimeout(n),t(i),r.next=3;break;case 2:clearTimeout(n),t();case 3:case"end":return r.stop()}},r)})),!1))})},xr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ur(!0);case 1:if(!e.sent){e.next=4;break}return e.next=2,Pr();case 2:if(e.sent){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Br=function(){var e=r(o.mark(function e(){var t,n,r,i,a,s,c,u=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]&&u[0],n=!1,i=["MICH LOWA","OHIO LOWA","PENN LOWA","NY LOWA","BOSTON LOWA","NORCAL LOWA","TWIN CITIES LOWA","DENV/PMP LOWA","SCNG LOWA","BANG LOWA","AMC LOWA","HC LOWA","GS LOWA","ORL LOWA","SS LOWA","NNDP LOWA","VP LOWA","NYDN LOWA","BAL LOWA","CG LOWA","CHI LOWA"],e.next=1,Ur(!0);case 1:if(!e.sent){e.next=3;break}if(a=window.blueConicClient.getSegments(),lr("bcLowaCheck | BC segments for users: ",a),!(a.filter(function(e){return i.includes(e.name)}).length>0)){e.next=3;break}return e.next=2,xr();case 2:(s=e.sent)&&(n=!0,r=s);case 3:return t&&n&&Dr(),c={isSub:n},r&&(c.uuid=r),e.abrupt("return",c);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Dr=function(){Ar("bc_lowa_status",1,{path:"/",domain:br(),expires:7,secure:!0})},Mr=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(lr("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(lr("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};lr("utils | Event: authentication ready: ",r),e(r)}catch(e){lr(e),t(e)}},!1))})},Gr=function(){var e=r(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 ur.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(lr("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,lr("Received entitlementsReady event:",r),e(r)}catch(e){dr("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(lr("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fr=function(){Sr(hr.AUTH0_SUB_COOKIE_KEY),Sr("mng-jwt-decoded"),localStorage.removeItem(hr.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){lr("Clearing entitlements...");try{Sr(hr.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){lr("Failed to delete legacy cookie: ",e)}try{Sr(hr.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:Er(),expires:365,secure:!0})}catch(e){lr("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(hr.LOCAL_STORAGE_SESSION_KEY)}catch(e){lr("Failed to remove local storage: ",e)}}()},Kr=function(){var e=wr();return!["local","develop","preprod","trbdev"].some(function(t){return e.origin.includes(t)})},Hr=function(e){lr("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),lr("Storage Object removed : ",e))},jr=function(e){lr("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 lr("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=jr;var Xr;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Wr=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Xr){e.next=1;break}return e.abrupt("return",Xr);case 1:return t=ur.A.auth0Domain,n=ur.A.auth0ClientId,Xr=new Ke({domain:t,clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{audience:"access-extension",scope:"openid email profile user_metadata app_metadata offline_access"}}),e.abrupt("return",Xr);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Yr=function(e){lr("utils | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,lr("utils | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),lr("utils | Dispatched authenticationReady event"),mr=new CustomEvent("mng-auth-check-complete",{detail:e}),gr?(lr("utils | Dispatching mng-auth-complete event (islands were ready): ",t),window.dispatchEvent(mr)):lr("Islands not ready")};var Vr=function(e){ur.A.datadogEnabled&&window.DD_RUM.addTiming(e)},zr=function(){var e=r(o.mark(function e(t){var n,r,a,s,c,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,lr("deleteUserCache","Setting up cache deletion for ".concat(t)),n=vr(),lr("deleteUSerCache","Domain is: ".concat(n)),r={publication:n,uuid:t},e.next=1,cr({method:"DELETE",url:"".concat(ur.A.entitlementsEndpoint,"session/create"),data:r,headers:{"X-Api-Key":ur.A.entitlementsApiKey}});case 1:if(a=e.sent,s=a.data,c=/Succesfully deleted/i,!("object"===i(s)&&Object.prototype.hasOwnProperty.call(s,"message"))||!c.test(s.message)){e.next=2;break}return lr("deleteUserCache","Cache deletion successful for ".concat(t)),e.abrupt("return",{success:!0});case 2:return lr("deleteUserCache","Cache deletion failed for ".concat(t,": ").concat(s)),e.abrupt("return",{success:!1});case 3:return e.prev=3,u=e.catch(0),lr("deleteUserCache","Cache deletion error for ".concat(t,": ").concat(u)),e.abrupt("return",{success:!1});case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(t){return e.apply(this,arguments)}}(),Jr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},a=function(){var a=r(o.mark(function r(){var a,s,c,u,l,d,h,f,p,g,m;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(a=window.sophi_config)||void 0===a?void 0:a.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return i.sspw=!0,r.abrupt("return",t({paywall:!0,details:pr({},i)}));case 1:return r.next=2,kr();case 2:return c=r.sent,r.next=3,Lr("Paywall_Level");case 3:if(u=r.sent,"article"===c&&"free"!==u){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==c?"Page type is not an article":"Free article"}));case 4:return r.next=5,Gr();case 5:if(!(l=r.sent)||!l.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==u){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(s=window.ConnextUtils)||void 0===s?void 0:s.runningSophi,lr("checkPaywallStatus - Sophi is running: ",d),!d){r.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:pr({},i)})},{once:!0}),r.next=12;break;case 8:if(d){r.next=12;break}return h=window.ConnextUtils.connextReady("onPaywallShown",!1),f=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),r.prev=9,r.next=10,Promise.race([h,f]);case 10:!0===(p=r.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(p)),r.next=12;break;case 11:r.prev=11,g=r.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(g);case 12:return r.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:pr({},i)}));case 13:r.prev=13,m=r.catch(0),n(m);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return a.apply(this,arguments)}}();a()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=Jr);function Zr(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var $r=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ur();case 1:return e.next=2,Mr();case 2:return e.abrupt("return",new Promise(function(e){lr("ANALYTICS: inside BCregwall events");var t=wr();t.searchParams.delete("regwall");var n=blueConicClient.profile.getProfile();localStorage.setItem("regwallSuccess","yes"),localStorage.setItem("regwallEvent","yes"),n.setValue("bang_reg_wall_status","Y"),n.setValue("regwall_newspaper",t.host),n.setValue("regwall_success_date",new Date),n.setValue("regwall_success","yes"),blueConicClient.profile.updateProfile(),e(!0)}));case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),qr=function(e){try{window.dataLayer.push({event:e}),lr("ANALYTICS: ".concat(e," event")),lr("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){lr("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Qr=function(){try{var e=localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){lr("Unable to get session from local storage: ",e)}return"{}"},eo=function(e){try{lr("Setting local storage session",e),localStorage.setItem(hr.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){lr("Unable to save session from local storage: ",e)}},to=function(e){try{Ar(hr.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:br(),expires:365,secure:!0})}catch(e){lr("Unable to save session to cookie storage: ",e)}},no=function(){var e=r(o.mark(function e(){var t,n,r,i,a,s,c,u,l,d,h,f,p,g,m,w,y,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=ur.A.sessionServer,n="".concat(t,"/api/session"),lr("Checking server session: ",n),e.next=1,cr.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return l=r.data.entitlementTokenDecoded,d=r.data,h=d.accessToken,f=d.idToken,p=d.entitlementToken,g=null!==(i=null==l?void 0:l.entitlement_expiry)&&void 0!==i?i:null,m=null!==(a=null==l?void 0:l.entitlement_source)&&void 0!==a?a:null,w=null!==(s=null==l?void 0:l.entitlement_entitled)&&void 0!==s?s:null,y=null!==(c=null==l?void 0:l.entitlement_extras_adfree)&&void 0!==c?c:null,E=null!==(u=null==l?void 0:l.entitlement_level)&&void 0!==u?u:null,eo(JSON.stringify({accessToken:h,idToken:f,entitlementToken:p,expiration:g,entitlementSource:m,isEntitled:w,adFree:y,entitlementLevel:E})),""!==p&&"string"==typeof p&&to(p),e.abrupt("return",{accessToken:h,idToken:f,entitlementToken:p,expiration:g,entitlementSource:m,isEntitled:w,adFree:y,entitlementLevel:E});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ro=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=ur.A.sessionServer,r="".concat(n,"/api/session"),lr("Updating server session: ",r),e.next=1,cr.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,i=e.catch(0),lr("Failed to update session server: ",i);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),oo=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=ur.A.sessionServer,n="".concat(t,"/api/session"),lr("Deleting server session: ",n),e.next=1,cr.delete(n,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,r=e.catch(0),lr("Failed to delete server session: ",r);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),io=function(){var e=r(o.mark(function e(){var t,n,r,i,a,s,c,u,l,d,h,f,p,g,m,w,y,E,b,A,S,v,O,I,T,N,R,C;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(lr("Inside getSession"),e.prev=1,l=Qr(),lr("Session: __MNG_Session = ",l),d=JSON.parse(l),h=d.accessToken,f=d.idToken,p=d.entitlementToken,g=d.expiration,m=d.entitlementSource,w=d.isEntitled,y=d.adFree,E=d.entitlementLevel,n=h,i=g,a=m,s=w,c=y,u=E,lr("Session: check both tokens: ",t=f,r=p),void 0!==f&&void 0!==p&&null!==f&&null!==p){e.next=3;break}return lr("Session: missing id or entitlements, try session server"),e.next=2,no();case 2:b=e.sent,A=b.accessToken,S=b.idToken,v=b.entitlementToken,O=b.expiration,I=b.entitlementSource,T=b.isEntitled,N=b.adFree,R=b.entitlementLevel,n=A,t=S,r=v,i=O,a=I,s=T,c=N,u=R;case 3:e.next=5;break;case 4:e.prev=4,C=e.catch(1),lr("Failed to get session: ",C);case 5:return lr("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:a,isEntitled:s,adFree:c,entitlementLevel:u});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),ao=function(){var e=r(o.mark(function e(t){var n,r,i,a,s,c,u,l,d,h,f,p,g,m,w,y,E,b,A,S,v,O,I,T,N,R,C,L,k;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Qr(),r=JSON.parse(n),i=r.accessToken,a=void 0===i?null:i,s=r.idToken,c=void 0===s?null:s,u=r.entitlementToken,l=void 0===u?null:u,d=r.expiration,h=void 0===d?null:d,f=r.entitlementSource,p=void 0===f?null:f,g=r.isEntitled,m=void 0===g?null:g,w=r.adFree,y=void 0===w?null:w,E=r.entitlementLevel,b=void 0===E?null:E,A=t.accessToken,S=t.idToken,v=t.entitlementToken,O=t.expiration,I=t.entitlementSource,T=t.isEntitled,N=t.adFree,R=t.entitlementLevel,C={accessToken:null==A?a:A,idToken:null==S?c:S,entitlementToken:null==v?l:v,expiration:null==O?h:O,entitlementSource:null==I?p:I,isEntitled:null==T?m:T,adFree:null==N?y:N,entitlementLevel:null==R?b:R},lr("Current session data: ",r),lr("New session data: ",t),lr("Updated session data:",C),L=JSON.stringify(C),eo(L),""!==C.entitlementToken&&"string"==typeof C.entitlementToken&&to(C.entitlementToken),n===L){e.next=1;break}return e.next=1,ro(C);case 1:e.next=3;break;case 2:e.prev=2,k=e.catch(0),lr("Unable to save session: ",k);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),so=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return lr("Ending session..."),Fr(),e.next=1,oo();case 1:localStorage.removeItem(hr.LOCAL_STORAGE_SESSION_KEY);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),co=function(){return"logout"===(wr().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var uo=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Wr();case 1:n=e.sent,lr("Calling Auth0 logout..."),n.logout({returnTo:t});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),lo=function(){return"undefined"==typeof CnnXt?(lr("Connext was not loaded."),!1):Connext.Storage.GetUserState()},ho=function(){lr("Check for SS paywall Cookie");var e=window.location.hostname,t=document.cookie.split(";").find(function(e){return e.trim().startsWith("vip-go-seg=vc-v1__has_access")});if(/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.?)+[a-zA-Z]{2,6}$/.test(e)&&t){lr("SS paywall Cookie found, removing it");var n=t.split("=")[0].trim();document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e),document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}},fo=function(){var e=r(o.mark(function e(){var t,n,i,a,s,c,u,l,d,h;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(lr("Attempting to logout..."),ho(),lr("About to perform user cache deletion..."),t=JSON.parse(localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY)),n=t.idToken,!(i=n?Or(n):"")){e.next=2;break}return a=i.auth0Id,e.next=1,zr(a);case 1:e.sent.success?lr("User cache cleared."):lr("User cache deletion failed.");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=4;break}return e.next=3,so();case 3:e.next=5;break;case 4:Fr();case 5:return e.prev=5,lr("Cycling through logout callbacks..."),s=window.MNGAuthentication.logoutCallbacks.map(function(e){return e()}),e.next=6,Promise.all(s);case 6:lr("Finished cycling through logout callbacks."),e.next=8;break;case 7:e.prev=7,h=e.catch(5),lr("Failed to cycle through logout callbacks: ",h);case 8:Object.keys(window.localStorage).filter(function(e){return e.includes("auth0")}).forEach(function(e){window.localStorage.removeItem(e),lr("Removed Auth0 storage object...")}),Hr("hhsl"),Hr("userNewsLetterData"),Hr(hr.REGWALL_USER_IS_SUBSCRIBED),Hr(hr.USER_PROFILE_HASH),c=wr(),u=window.location.origin;try{c.searchParams.get("returnURL")&&(l=decodeURIComponent(c.searchParams.get("returnURL")),u=l)}catch(e){lr(e),u=window.location.origin}return u=new URL(u),e.next=9,window.ConnextUtils.connextReady("onInit",!1);case 9:if(!e.sent){e.next=16;break}if(lr("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),lr("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),d=u,u.origin!==window.location.origin&&(d=new URL(window.location.origin)).searchParams.append("returnAfterLogout",u),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",d),!Kr()){e.next=10;break}lr("About to call Connext Logout..."),setTimeout(function(){Connext.Logout()},500),e.next=15;break;case 10:if("Logged In"!==lo()){e.next=14;break}if(lr("Connext user state is logged in, setting timeout..."),setTimeout(r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return lr("Connext took too long to logout, calling auth0 logout..."),e.next=1,uo(u);case 1:case"end":return e.stop()}},e)})),8e3),"function"!=typeof Connext._logout){e.next=12;break}return lr("About to call Connext _logout..."),e.next=11,Connext._logout();case 11:e.next=13;break;case 12:return lr("About to call Connext Logout..."),e.next=13,Connext.Logout();case 13:e.next=15;break;case 14:return lr("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=15,uo(u);case 15:e.next=17;break;case 16:return lr("Connext Logout was NOT called"),e.next=17,uo(u);case 17:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}(),po=function(){var e=0;for(var t in window.localStorage){var n=2*window.localStorage[t].length/1024/1024;!Number.isNaN(n)&&window.localStorage.hasOwnProperty(t)&&(e+=n)}return e},go=function(){window.MNGAuthentication.preAuthGTMEvents.forEach(function(e){return qr(e)}),lr("Cycled through preauth GTM events.")},mo=function(){var e=r(o.mark(function e(t,n,r,i,a){var s,c,u,l,d,h,f,p,g,m,w,y,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return lr("Attempting to login..."),po()>4.5&&window.localStorage.clear(),go(),i&&(s=[],c=window.localStorage.getItem("callbackEvents"),u=JSON.parse(c),s=u&&u.length>0?Zr(new Set([].concat(Zr(i),Zr(u)))):i,window.localStorage.setItem("callbackEvents",JSON.stringify(s))),l=null,e.next=1,Wr();case 1:if(d=e.sent,h=wr(),f=h.origin,p=new URL("".concat(f,"/callback")),g={},h.searchParams.get("regwall")&&(h.searchParams.get("returnUrl")&&(m=h.searchParams.get("returnUrl")),h.searchParams.get("auth_redirect")&&(m=h.searchParams.get("auth_redirect"))),h.pathname.startsWith("/login")||h.pathname.startsWith("/callback")?h.searchParams.get("returnUrl")?p.searchParams.set("auth_redirect",h.searchParams.get("returnUrl")):a&&p.searchParams.set("auth_redirect",a):p.searchParams.set("auth_redirect",h.toString()),m&&"regwall"!==t&&p.searchParams.set("auth_redirect",m),"true"===h.searchParams.get("close-after-finish")&&p.searchParams.set("close-after-finish","true"),"true"!==h.searchParams.get("ssl")){e.next=4;break}if(!window.authentication_config.sessionManagementEnabled){e.next=3;break}return e.next=2,so();case 2:e.next=4;break;case 3:Fr();case 4:return null!==(l=h.searchParams.get("login-with"))?g.connection=l:n&&(g.connection=n),w="none",t&&"regwall"===t&&(p.searchParams.set("regwall","true"),w="signUp",lr("Logging in with regwall")),t&&(p.searchParams.set("loginsource",t),lr("Logging in with ".concat(t))),r&&(g.login_hint=r),g.redirect_uri=p.toString(),g.initialScreen=w,"googleonetap"!==t&&(g.prompt="select_account"),null!==(y=h.searchParams.get("ampRegiWall"))&&(E=window.location.hostname,g.ampRegiWall=y,g.sourceDomain=E.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.",""),g.initialScreen="signUp",g.preferenceId=h.searchParams.get("prefId")),e.next=5,d.loginWithRedirect({authorizationParams:g});case 5:case"end":return e.stop()}},e)}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),wo=function(){return new Promise(function(e){var t=setTimeout(function(){e()},8e3);try{var n=window.localStorage.getItem("callbackEvents"),r=JSON.parse(n);if(!r||0===r.length)return void e();lr("Adding listeners to events we need to wait for...");var o=r.map(function(e){return t=e,new Promise(function(e){lr("Adding event to wait for: ",t),window.addEventListener(t,function(n){try{var r=n.detail||{};lr("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){lr(t),e()}},!1)});var t});Promise.all(o).then(function(){clearTimeout(t),e()})}catch(t){lr("Failed to wait for callback events",t),e()}})};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var yo=function(){var e=r(o.mark(function e(){var t,n,i,a,s,c,u,l,d,h,f,p,g,m,w,y,E,b,A,S,v,O;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(ho(),t=wr(),n=!1,i=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),a=t.searchParams.get("redirect_uri")||"",a.includes("applenews")?(lr("This is Apple prelogin flow."),(s=new URL(a))?(s.searchParams.append("post-apple-login","true"),lr("Post callback Apple redirect URL is ".concat(s)),mo(!1,!1,!1,[],s)):mo()):i.includes("post-apple-login")&&(lr("This is Apple Callback flow."),n=!0,(c=new URL(decodeURIComponent(i))).searchParams.delete("post-apple-login"),i=c),lr("Handling post login callback..."),!(u=t.searchParams.get("error_description"))){e.next=2;break}if("shouldAutoLogin"!==u){e.next=1;break}return e.abrupt("return",mo(!1,!1,!1,!1,i));case 1:n&&alert("There was an error in logging you in, please try again.");case 2:return e.next=3,Wr();case 3:return l=e.sent,e.next=4,l.handleRedirectCallback();case 4:return e.next=5,l.getIdTokenClaims();case 5:return d=e.sent,e.next=6,l.getUser();case 6:return h=e.sent,lr("Auth0 user profile: ",h),f=d.__raw,e.next=7,l.getTokenSilently();case 7:return p=e.sent,e.prev=8,lr("Cycling through login callbacks..."),e.next=9,wo();case 9:return g=window.MNGAuthentication.oidcLoginCallbacks.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(f));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=10,Promise.all(g);case 10:lr("Finished cycling through login callbacks."),e.next=12;break;case 11:e.prev=11,S=e.catch(8),lr("Failed to cycle through login callbacks: ",S);case 12:if(m={accessToken:p,userId:h.sub,email:h.email,picture:h.picture},w=!1,y="",!n){e.next=17;break}return e.prev=13,e.next=14,Tr(m.userId);case 14:return y=e.sent,lr("Encrypted apple uuid is: ".concat(y)),e.next=15,Ir(y);case 15:w=e.sent,lr("Apple sub status is: ".concat(w)),e.next=17;break;case 16:e.prev=16,v=e.catch(13),lr("Apple sub check error: ".concat(v)),alert("There was an error in logging you in, please try again.");case 17:if(Hr(hr.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=18;break}return lr("Saving idToken to session server"),e.next=18,ao({idToken:f,accessToken:p});case 18:if(!t.searchParams.get("close-after-finish")){e.next=19;break}return e.abrupt("return",window.close());case 19:if(!t.search.includes("loginsource")){e.next=20;break}return E=t.searchParams.get("loginsource"),b=window.MNGAuthentication.postAuthEvents.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(E));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=20,Promise.all(b);case 20:return e.prev=20,A=new URL(i),n&&w&&A.searchParams.append("access_token",y),lr("Apple redirect URL:",A),e.abrupt("return",window.location.assign(A));case 21:return e.prev=21,O=e.catch(20),lr("Failed to redirect after authentication: ",O),window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 22:case"end":return e.stop()}},e,null,[[8,11],[13,16],[20,21]])}));return function(){return e.apply(this,arguments)}}(),Eo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return lr("ANALYTICS: fireBC events"),e.next=1,$r();case 1:lr("ANALYTICS: bc values should be filled");case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),bo=function(){var e=r(o.mark(function e(){var t,n,r,i,a,s,c,u,l,d,h,f,p;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Mr();case 1:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=4;break}return e.prev=2,a=Or(n),s=a.email,c=a.picture,u=a.sub,l=a.name,d=a.nickname,h=a.connection_source,f=null===(i=a.user_metadata)||void 0===i||null===(i=i.customProfile)||void 0===i?void 0:i.nickname,u.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:f||d||l,email:s,picture:c,userId:u,connectionSource:h});case 3:e.prev=3,p=e.catch(2),lr("Unable to parse idToken: ",n," Error: ",p);case 4:return e.abrupt("return",{authenticated:r});case 5:case"end":return e.stop()}},e,null,[[2,3]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.login=mo,window.MNGAuthentication.logout=fo,window.MNGAuthentication.getUserInfo=bo;var Ao=function(){var e=r(o.mark(function e(){var t,n,a,s,c,u,l,d,h,f,p,g,m;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=wr(),n=!1,a="",s=!1,c={},co()&&window.ConnextUtils.rerunConnextEntitlements(!0),t.searchParams.get("returnAfterLogout")&&(u=decodeURIComponent(t.searchParams.get("returnAfterLogout")),window.location.assign(u)),t.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),l=function(){var e=r(o.mark(function e(){var t,r,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Wr();case 1:return t=e.sent,e.next=2,t.getIdTokenClaims();case 2:return c=e.sent,e.next=3,t.isAuthenticated();case 3:if(n=e.sent,a="object"===i(c)?c.__raw:"",r=yr(hr.ENTITLEMENT_COOKIE_KEY),n||!r){e.next=5;break}return e.next=4,t.getTokenSilently();case 4:s=e.sent;case 5:e.next=7;break;case 6:e.prev=6,u=e.catch(0),lr("Unable to verify user has active auth0 session: ",u);case 7:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),!t.pathname.startsWith("/logout")){e.next=2;break}return lr("Page is logout. Routing to logout function..."),e.next=1,fo();case 1:return e.abrupt("return");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=3,l();case 3:if(""===a){e.next=5;break}if(d=null,h=JSON.parse(window.localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY)),"{}"!==Qr()){e.next=4;break}return h&&(d=h.jwt),e.next=4,ao({idToken:a,entitlementToken:d});case 4:e.next=8;break;case 5:return e.prev=5,e.next=6,io();case 6:f=e.sent,a=f.idToken,(n="string"==typeof a)&&(c=Or(a)),e.next=8;break;case 7:e.prev=7,m=e.catch(5),lr("Unable to initialize session: ",m);case 8:e.next=10;break;case 9:return e.next=10,l();case 10:if(n||s||!ur.A.blueconicEnabled||!ur.A.bcLowaSegements){e.next=12;break}return e.next=11,Br(!0);case 11:(p=e.sent).isSub&&(n=hr.USER_IS_LOWA,c={sub:p.uuid});case 12:if(Yr({isAuthenticated:n,idToken:a,accessToken:s,claims:c}),Vr("authenticationReady"),!0===n?(lr("User is authenticated."),t.searchParams.get("auth_redirect")&&(lr("Auth Redirect is present, sending user to auth redirect..."),(g=t.searchParams.get("auth_redirect")).endsWith("#")&&(g=g.slice(0,g.length)),window.location.assign(g)),t.pathname.startsWith("/login")&&!co()&&(lr("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(t.origin))):lr("User is not authenticated."),t.pathname.startsWith("/login")&&!co()?(lr("Page is login. Attempting to log user in..."),mo()):lr("Page is not login or Connext state is present"),!t.pathname.startsWith("/callback")||!t.searchParams.get("regwall")){e.next=14;break}return lr("Page is callback with regwall param. Routing to regwall receiver..."),e.next=13,Eo();case 13:lr("Now login from regwall"),mo(),e.next=15;break;case 14:if(!t.pathname.startsWith("/callback")){e.next=15;break}return lr("Page is callback without regwall param. Routing to callback receiver..."),e.next=15,yo();case 15:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.init=Ao;var So=function(e,t){return new Promise(function(n){try{"undefined"==typeof CnnXt&&(lr("Connext was not loaded."),n(!1)),lr("connext subscribeToNewsletter","about to call Cnnxt NewsletterSubscribe with pref id ".concat(t," and email ").concat(e)),CnnXt.API.NewsletterSubscribe({email:e,id:t,onSuccess:function(){lr("Signed user up to newsletter: ",t),n(!0)},onError:function(e){lr("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){lr("subscribeToNewsletter Error:",e),n(!1)}})},vo=function(){document.addEventListener("click",function(e){if(e.target.classList.contains("connext-login")){var t=window.location.href,n=new URL(t),r=n.origin,o=new URL("".concat(r,"/login"));o.searchParams.set("returnUrl",n.toString()),window.location.assign(o)}})},Oo=function(){Kr()||document.addEventListener("onInit",function(){if("undefined"!=typeof Connext){var e,t,n,r=Connext;t="Logout",n=function(){return function(){alert("Warning! You called Connext.Logout() directly! Calling MNGAuthentication.logout() next."),window.MNGAuthentication.logout()}},(e=r)._logout=Connext.Logout,e[t]=n(e[t])}})},Io=function(e){try{"string"==typeof e&&Ar(hr.AUTH0_SUB_COOKIE_KEY,e,{domain:br(),path:"/",expires:365,secure:!0})}catch(e){lr("Failed to set auth0_sub cookie: ",e)}},To=function(e){if(!yr(hr.AUTH0_SUB_COOKIE_KEY))try{var t=e.claims;if(null==t||"object"!==i(t)&&!Object.keys(t).includes("sub"))return;var n=t.sub;Io(n)}catch(e){lr("Failed to set auth0_sub: ",e)}},No=function(e){try{if("string"==typeof e){var t=Or(e).sub;Io(t)}else lr("Could not set auth0_sub on login, idToken was not available.")}catch(e){lr("Failed to set auth0_sub on login: ",e)}},Ro=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=window.localStorage.getItem("newsletter_to_subscribe"))){e.next=4;break}return e.next=1,window.ConnextUtils.connextReady("onFinish");case 1:return e.next=2,bo();case 2:return n=e.sent,r=n.email,lr("CONNEXT: about to sign up ".concat(r," to ").concat(t)),e.next=3,So(r,t);case 3:window.localStorage.removeItem("newsletter_to_subscribe"),lr("CONNEXT: newsletter_to_subscribe value removed from local storage.");case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const Co={init:function(){var e=r(o.mark(function e(){var t;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return vo(),Oo(),Ro(),MNGAuthentication.oidcLoginCallbacks.push(No),window.ConnextUtils.runConnextIfSilent(),e.next=1,Mr();case 1:t=e.sent,To(t);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Co.init(),e.next=1,Rr(!0);case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.connext.bundle.js.map; /*! For license information please see mng-digisubs.entitlements.bundle.js.LICENSE.txt */ (()=>{var e={251(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<>1,l=-7,f=n?o-1:0,d=n?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-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,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,E=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+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*E}},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},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},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:"",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}},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},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),f=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var h={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,h[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:d,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(d(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},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)}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},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},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},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||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,d.n=n,u}};function h(e,r){for(a=e,s=r,n=0;!f&&c&&!o&&n3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&hr||r>p)&&(i[4]=e,i[5]=r,d.n=p,a=0))}if(o||e>1)return u;throw f=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),a=l,s=p;(n=a<2?t:s)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.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=(f=d.n<0)?s:e.call(r,d))!==u)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:n,done:f}}}(e,i,a),!0),c}var u={};function l(){}function f(){}function d(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=d.prototype=l.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return f.prototype=d,r(p,"constructor",d),r(d,"constructor",f),f.displayName="GeneratorFunction",r(d,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:E}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},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,f=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 f(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|E(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 h(t.buffer,t.byteOffset,t.byteLength)}return d(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 h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const 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||$(e.length)?s(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(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 f(e){return l(e),s(e<0?0:0|p(e))}function d(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 E(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 Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function A(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 L(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return v(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(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),$(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:y(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):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(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 R(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=E,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 m(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return O(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(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 v(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 M(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 k(e,t,n,r,o){X(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 x(e,t,n,r,o){X(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 P(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||P(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function G(e,t,n,r,i){return t=+t,n>>>=0,i||P(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||U(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||U(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||U(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(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||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(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||K(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||U(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||U(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||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||U(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||U(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||U(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||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(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||K(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||U(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(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){M(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){M(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||M(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||M(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||M(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||M(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||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q(function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);M(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);M(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||M(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||M(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||M(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||M(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||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Q(function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return 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 G(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return G(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 X(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 F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||K(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new F.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),_("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=H(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=H(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Y(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 V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(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 $(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 Q(e){return"undefined"==typeof BigInt?z:e}function z(){throw new Error("BigInt not supported")}}},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={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);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)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>Pe,hasStandardBrowserEnv:()=>Ge,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>De,origin:()=>_e});var o=n(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)}var a=n(3612);const s=function(){if(a.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.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)}}h.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e,t){return e(t={exports:{}},t.exports),t.exports}var w=g(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var 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}();t.default=function(){return n.getInstance()}});A(w);var y=A(g(function(e,t){var n=E&&E.__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())})},r=E&&E.__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 n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,w.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),w.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var c=!1,u=0;u(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;m=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const t=R.call(e);return B[t]||(B[t]=t.slice(8,-1).toLowerCase())});var B;const U=e=>(e=e.toLowerCase(),t=>L(t)===e),M=e=>t=>typeof t===e,{isArray:k}=Array,x=M("undefined");function P(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&F(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const D=U("ArrayBuffer");const G=M("string"),F=M("function"),_=M("number"),H=e=>null!==e&&"object"==typeof e,X=e=>{if("object"!==L(e))return!1;const t=I(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||C in e||v in e)},j=U("Date"),K=U("File"),W=U("Blob"),Y=U("FileList"),V=U("URLSearchParams"),[J,q,Z,Q]=["ReadableStream","Request","Response","Headers"].map(U);function z(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),k(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const te="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,ne=e=>!x(e)&&e!==te;const re=(oe="undefined"!=typeof Uint8Array&&I(Uint8Array),e=>oe&&e instanceof oe);var oe;const ie=U("HTMLFormElement"),ae=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),se=U("RegExp"),ce=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};z(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const ue=U("AsyncFunction"),le=(fe="function"==typeof setImmediate,de=F(te.postMessage),fe?setImmediate:de?(he=`axios@${Math.random()}`,pe=[],te.addEventListener("message",({source:e,data:t})=>{e===te&&t===he&&pe.length&&pe.shift()()},!1),e=>{pe.push(e),te.postMessage(he,"*")}):e=>setTimeout(e));var fe,de,he,pe;const Ee="undefined"!=typeof queueMicrotask?queueMicrotask.bind(te):"undefined"!=typeof process&&process.nextTick||le,Ae={isArray:k,isArrayBuffer:D,isBuffer:P,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||F(e.append)&&("formdata"===(t=L(e))||"object"===t&&F(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&D(e.buffer),t},isString:G,isNumber:_,isBoolean:e=>!0===e||!1===e,isObject:H,isPlainObject:X,isEmptyObject:e=>{if(!H(e)||P(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:J,isRequest:q,isResponse:Z,isHeaders:Q,isUndefined:x,isDate:j,isFile:K,isBlob:W,isRegExp:se,isFunction:F,isStream:e=>H(e)&&F(e.pipe),isURLSearchParams:V,isTypedArray:re,isFileList:Y,forEach:z,merge:function e(){const{caseless:t,skipUndefined:n}=ne(this)&&this||{},r={},o=(o,i)=>{const a=t&&ee(r,i)||i;X(r[a])&&X(o)?r[a]=e(r[a],o):X(o)?r[a]=e({},o):k(o)?r[a]=o.slice():n&&x(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(z(t,(t,r)=>{n&&F(t)?e[r]=T(t,n):e[r]=t},{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),e.prototype.constructor=e,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&&I(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:L,kindOfTest:U,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(k(e))return e;let t=e.length;if(!_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[v]).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:ie,hasOwnProperty:ae,hasOwnProp:ae,reduceDescriptors:ce,freezeMethods:e=>{ce(e,(t,n)=>{if(F(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];F(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 k(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:ee,global:te,isContextDefined:ne,isSpecCompliantForm:function(e){return!!(e&&F(e.append)&&"FormData"===e[C]&&e[v])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(H(e)){if(t.indexOf(e)>=0)return;if(P(e))return e;if(!("toJSON"in e)){t[r]=e;const o=k(e)?[]:{};return z(e,(e,t)=>{const i=n(e,r+1);!x(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ue,isThenable:e=>e&&(H(e)||F(e))&&F(e.then)&&F(e.catch),setImmediate:le,asap:Ee,isIterable:e=>null!=e&&F(e[v])};function ge(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Ae.inherits(ge,Error,{toJSON:function(){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:Ae.toJSONObject(this.config),code:this.code,status:this.status}}});const we=ge.prototype,ye={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ye[e]={value:e}}),Object.defineProperties(ge,ye),Object.defineProperty(we,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,o,i)=>{const a=Object.create(we);Ae.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ge.call(a,s,c,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const me=ge;var Se=n(8287).hp;function Oe(e){return Ae.isPlainObject(e)||Ae.isArray(e)}function be(e){return Ae.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,n){return e?e.concat(t).map(function(e,t){return e=be(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Te=Ae.toFlatObject(Ae,{},null,function(e){return/^is[A-Z]/.test(e)});const Re=function(e,t,n){if(!Ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ae.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ae.isSpecCompliantForm(t);if(!Ae.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Ae.isDate(e))return e.toISOString();if(Ae.isBoolean(e))return e.toString();if(!s&&Ae.isBlob(e))throw new me("Blob is not supported. Use a Buffer instead.");return Ae.isArrayBuffer(e)||Ae.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Se.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Ae.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ae.isArray(e)&&function(e){return Ae.isArray(e)&&!e.some(Oe)}(e)||(Ae.isFileList(e)||Ae.endsWith(n,"[]"))&&(s=Ae.toArray(e)))return n=be(n),s.forEach(function(e,r){!Ae.isUndefined(e)&&null!==e&&t.append(!0===a?Ne([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Oe(e)||(t.append(Ne(o,n,i),c(e)),!1)}const l=[],f=Object.assign(Te,{defaultVisitor:u,convertValue:c,isVisitable:Oe});if(!Ae.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Ae.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Ae.forEach(n,function(n,i){!0===(!(Ae.isUndefined(n)||null===n)&&o.call(t,n,Ae.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ve(e,t){this._pairs=[],e&&Re(e,this,t)}const Ce=ve.prototype;Ce.append=function(e,t){this._pairs.push([e,t])},Ce.toString=function(e){const t=e?function(t){return e.call(this,t,Ie)}:Ie;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Le=ve;function Be(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ue(e,t,n){if(!t)return e;const r=n&&n.encode||Be;Ae.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Ae.isURLSearchParams(t)?t.toString():new Le(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Me=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){Ae.forEach(this.handlers,function(t){null!==t&&e(t)})}},ke={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Le,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Pe="undefined"!=typeof window&&"undefined"!=typeof document,De="object"==typeof navigator&&navigator||void 0,Ge=Pe&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,_e=Pe&&window.location.href||"http://localhost",He={...e,...xe};const Xe=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&&Ae.isArray(r)?r.length:i,s)return Ae.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&Ae.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Ae.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 Ae.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const je={transitional:ke,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Ae.isObject(e);o&&Ae.isHTMLForm(e)&&(e=new FormData(e));if(Ae.isFormData(e))return r?JSON.stringify(Xe(e)):e;if(Ae.isArrayBuffer(e)||Ae.isBuffer(e)||Ae.isStream(e)||Ae.isFile(e)||Ae.isBlob(e)||Ae.isReadableStream(e))return e;if(Ae.isArrayBufferView(e))return e.buffer;if(Ae.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 Re(e,new He.classes.URLSearchParams,{visitor:function(e,t,n,r){return He.isNode&&Ae.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Ae.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Re(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ae.isString(e))try{return(t||JSON.parse)(e),Ae.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||je.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Ae.isResponse(e)||Ae.isReadableStream(e))return e;if(e&&Ae.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 me.from(e,me.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:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ae.forEach(["delete","get","head","post","put","patch"],e=>{je.headers[e]={}});const Ke=je,We=Ae.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"]),Ye=Symbol("internals");function Ve(e){return e&&String(e).trim().toLowerCase()}function Je(e){return!1===e||null==e?e:Ae.isArray(e)?e.map(Je):String(e)}function qe(e,t,n,r,o){return Ae.isFunction(r)?r.call(this,t,n):(o&&(t=n),Ae.isString(t)?Ae.isString(r)?-1!==t.indexOf(r):Ae.isRegExp(r)?r.test(t):void 0:void 0)}class $e{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ve(t);if(!o)throw new Error("header name must be a non-empty string");const i=Ae.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Je(e))}const i=(e,t)=>Ae.forEach(e,(e,n)=>o(e,n,t));if(Ae.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Ae.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]&&We[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(Ae.isObject(e)&&Ae.isIterable(e)){let n,r,o={};for(const t of e){if(!Ae.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Ae.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=Ve(e)){const n=Ae.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(Ae.isFunction(t))return t.call(this,e,n);if(Ae.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ve(e)){const n=Ae.findKey(this,e);return!(!n||void 0===this[n]||t&&!qe(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ve(e)){const o=Ae.findKey(n,e);!o||t&&!qe(0,n[o],o,t)||(delete n[o],r=!0)}}return Ae.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&&!qe(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Ae.forEach(this,(r,o)=>{const i=Ae.findKey(n,o);if(i)return t[i]=Je(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]=Je(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ae.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ae.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[Ye]=this[Ye]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ve(e);t[r]||(!function(e,t){const n=Ae.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 Ae.isArray(e)?e.forEach(r):r(e),this}}$e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ae.reduceDescriptors($e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ae.freezeMethods($e);const Ze=$e;function Qe(e,t){const n=this||Ke,r=t||n,o=Ze.from(r.headers);let i=r.data;return Ae.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ze(e){return!(!e||!e.__CANCEL__)}function et(e,t,n){me.call(this,null==e?"canceled":e,me.ERR_CANCELED,t,n),this.name="CanceledError"}Ae.inherits(et,me,{__CANCEL__:!0});const tt=et;function nt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const rt=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,f=0;for(;l!==i;)f+=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)]},it=(e,t,n=3)=>{let r=0;const o=rt(50,250);return ot(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)},at=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},st=e=>(...t)=>Ae.asap(()=>e(...t)),ct=He.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,He.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,ut=He.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Ae.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Ae.isString(r)&&s.push(`path=${r}`),Ae.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Ae.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 lt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ft=e=>e instanceof Ze?{...e}:e;function dt(e,t){t=t||{};const n={};function r(e,t,n,r){return Ae.isPlainObject(e)&&Ae.isPlainObject(t)?Ae.merge.call({caseless:r},e,t):Ae.isPlainObject(t)?Ae.merge({},t):Ae.isArray(t)?t.slice():t}function o(e,t,n,o){return Ae.isUndefined(t)?Ae.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Ae.isUndefined(t))return r(void 0,t)}function a(e,t){return Ae.isUndefined(t)?Ae.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(ft(e),ft(t),0,!0)};return Ae.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);Ae.isUndefined(a)&&i!==s||(n[r]=a)}),n}const ht=e=>{const t=dt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=Ze.from(a),t.url=Ue(lt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Ae.isFormData(n))if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Ae.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(He.hasStandardBrowserEnv&&(r&&Ae.isFunction(r)&&(r=r(t)),r||!1!==r&&ct(t.url))){const e=o&&i&&ut.read(i);e&&a.set(o,e)}return t},pt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ht(e);let o=r.data;const i=Ze.from(r.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let E=new XMLHttpRequest;function A(){if(!E)return;const r=Ze.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());nt(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:e,request:E}),E=null}E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout,"onloadend"in E?E.onloadend=A:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(A)},E.onabort=function(){E&&(n(new me("Request aborted",me.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new me(r,me.ERR_NETWORK,e,E);o.event=t||null,n(o),E=null},E.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ke;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new me(t,o.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,e,E)),E=null},void 0===o&&i.setContentType(null),"setRequestHeader"in E&&Ae.forEach(i.toJSON(),function(e,t){E.setRequestHeader(t,e)}),Ae.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),f&&"json"!==f&&(E.responseType=r.responseType),h&&([c,l]=it(h,!0),E.addEventListener("progress",c)),d&&E.upload&&([s,u]=it(d),E.upload.addEventListener("progress",s),E.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{E&&(n(!t||t.type?new tt(null,e,E):t),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===He.protocols.indexOf(g)?n(new me("Unsupported protocol "+g+":",me.ERR_BAD_REQUEST,e)):E.send(o||null)})},Et=(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 me?t:new tt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new me(`timeout ${t} of ms exceeded`,me.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=()=>Ae.asap(a),s}},At=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of gt(e))yield*At(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:yt}=Ae,mt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ae.global),{ReadableStream:St,TextEncoder:Ot}=Ae.global,bt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Nt=e=>{e=Ae.merge.call({skipUndefined:!0},mt,e);const{fetch:t,Request:n,Response:r}=e,o=t?yt(t):"function"==typeof fetch,i=yt(n),a=yt(r);if(!o)return!1;const s=o&&yt(St),c=o&&("function"==typeof Ot?(u=new Ot,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&bt(()=>{let e=!1;const t=new n(He.origin,{body:new St,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=a&&s&&bt(()=>Ae.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new me(`Response type '${e}' is not supported`,me.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=Ae.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Ae.isBlob(e))return e.size;if(Ae.isSpecCompliantForm(e)){const t=new n(He.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ae.isArrayBufferView(e)||Ae.isArrayBuffer(e)?e.byteLength:(Ae.isURLSearchParams(e)&&(e+=""),Ae.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:E,onUploadProgress:A,responseType:g,headers:w,withCredentials:y="same-origin",fetchOptions:m}=ht(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let O=Et([c,u&&u.toAbortSignal()],p),b=null;const N=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let T;try{if(A&&l&&"get"!==a&&"head"!==a&&0!==(T=await h(w,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Ae.isFormData(s)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=at(T,it(st(A)));s=wt(t.body,65536,e,n)}}Ae.isString(y)||(y=y?"include":"omit");const t=i&&"credentials"in n.prototype,c={...m,signal:O,method:a.toUpperCase(),headers:w.normalize().toJSON(),body:s,duplex:"half",credentials:t?y:void 0};b=i&&new n(o,c);let u=await(i?S(b,m):S(o,c));const p=f&&("stream"===g||"response"===g);if(f&&(E||p&&N)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Ae.toFiniteNumber(u.headers.get("content-length")),[n,o]=E&&at(t,it(st(E),!0))||[];u=new r(wt(u.body,65536,n,()=>{o&&o(),N&&N()}),e)}g=g||"text";let R=await d[Ae.findKey(d,g)||"text"](u,e);return!p&&N&&N(),await new Promise((t,n)=>{nt(t,n,{data:R,headers:Ze.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:b})})}catch(t){if(N&&N(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new me("Network Error",me.ERR_NETWORK,e,b),{cause:t.cause||t});throw me.from(t,t&&t.code,e,b)}}},Tt=new Map,Rt=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=Tt;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Nt(t)),u=s;return s},It=(Rt(),{http:null,xhr:pt,fetch:{get:Rt}});Ae.forEach(It,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const vt=e=>`- ${e}`,Ct=e=>Ae.isFunction(e)||null===e||!1===e;const Lt={getAdapter:function(e,t){e=Ae.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(vt).join("\n"):" "+vt(e[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:It};function Bt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tt(null,e)}function Ut(e){Bt(e),e.headers=Ze.from(e.headers),e.data=Qe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Lt.getAdapter(e.adapter||Ke.adapter,e)(e).then(function(t){return Bt(e),t.data=Qe.call(e,e.transformResponse,t),t.headers=Ze.from(t.headers),t},function(t){return ze(t)||(Bt(e),t&&t.response&&(t.response.data=Qe.call(e,e.transformResponse,t.response),t.response.headers=Ze.from(t.response.headers))),Promise.reject(t)})}const Mt="1.13.2",kt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const xt={};kt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Mt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new me(r(o," has been removed"+(t?" in "+t:"")),me.ERR_DEPRECATED);return t&&!xt[o]&&(xt[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)}},kt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Pt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new me("options must be an object",me.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 me("option "+i+" must be "+n,me.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new me("Unknown option "+i,me.ERR_BAD_OPTION)}},validators:kt},Dt=Pt.validators;class Gt{constructor(e){this.defaults=e||{},this.interceptors={request:new Me,response:new Me}}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=dt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Pt.assertOptions(n,{silentJSONParsing:Dt.transitional(Dt.boolean),forcedJSONParsing:Dt.transitional(Dt.boolean),clarifyTimeoutError:Dt.transitional(Dt.boolean)},!1),null!=r&&(Ae.isFunction(r)?t.paramsSerializer={serialize:r}:Pt.assertOptions(r,{encode:Dt.function,serialize:Dt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Pt.assertOptions(t,{baseUrl:Dt.spelling("baseURL"),withXsrfToken:Dt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Ae.merge(o.common,o[t.method]);o&&Ae.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Ze.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!s){const e=[Ut.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);f{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 tt(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 _t(function(t){e=t});return{token:t,cancel:e}}}const Ht=_t;const Xt={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(Xt).forEach(([e,t])=>{Xt[t]=e});const jt=Xt;const Kt=function e(t){const n=new Ft(t),r=T(Ft.prototype.request,n);return Ae.extend(r,Ft.prototype,n,{allOwnKeys:!0}),Ae.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(dt(t,n))},r}(Ke);Kt.Axios=Ft,Kt.CanceledError=tt,Kt.CancelToken=Ht,Kt.isCancel=ze,Kt.VERSION=Mt,Kt.toFormData=Re,Kt.AxiosError=me,Kt.Cancel=Kt.CanceledError,Kt.all=function(e){return Promise.all(e)},Kt.spread=function(e){return function(t){return e.apply(null,t)}},Kt.isAxiosError=function(e){return Ae.isObject(e)&&!0===e.isAxiosError},Kt.mergeConfig=dt,Kt.AxiosHeaders=Ze,Kt.formToJSON=e=>Xe(Ae.isHTMLForm(e)?new FormData(e):e),Kt.getAdapter=Lt.getAdapter,Kt.HttpStatusCode=jt,Kt.default=Kt;const Wt=Kt,Yt="auth0_sub",Vt="mng-entitlements",Jt="__MNG_Session",qt="regwallUserIsSubscribed";function $t(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 Zt(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=en().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])},rn=function(){var e=nn();return".".concat(e)},on=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(s("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=d(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},an=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=nn(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=d(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},sn=function(){return en().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},cn=function(e){return function(e,t){if("string"!=typeof e)throw new h("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 h(`Invalid token specified: missing part #${n+1}`);let o;try{o=p(r)}catch(e){throw new h(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new h(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},un=function(){return"complete"===document.readyState},ln=function(){return new Promise(function(e){if(("interactive"===document.readyState||un())&&window.dataLayer)s("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{s("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.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)}})},fn=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,ln();case 1:return s("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",s("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return s("Utils dataLayerLoop: look for this element ",e),e[t]?(s("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(s("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(r),e.abrupt("return",i?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),dn=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.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,fn(t);case 1:return n=e.sent,s("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)}}(),hn=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(s("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(s("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};s("utils | Event: authentication ready: ",r),e(r)}catch(e){s(e),t(e)}},!1))})},pn=function(){var e=r(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 a.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(s("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,s("Received entitlementsReady event:",r),e(r)}catch(e){c("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(s("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),En=function(){s("Clearing entitlements...");try{an(Vt,{path:"/"})}catch(e){s("Failed to delete legacy cookie: ",e)}try{an(Vt,{path:"/",domain:nn(),expires:365,secure:!0})}catch(e){s("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(Jt)}catch(e){s("Failed to remove local storage: ",e)}},An=function(e){s("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 s("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=An;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var gn=function(e){a.A.datadogEnabled&&window.DD_RUM.addTiming(e)},wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},a=function(){var a=r(o.mark(function r(){var a,c,u,l,f,d,h,p,E,A,g;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(a=window.sophi_config)||void 0===a?void 0:a.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return i.sspw=!0,r.abrupt("return",t({paywall:!0,details:Zt({},i)}));case 1:return r.next=2,dn();case 2:return u=r.sent,r.next=3,fn("Paywall_Level");case 3:if(l=r.sent,"article"===u&&"free"!==l){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==u?"Page type is not an article":"Free article"}));case 4:return r.next=5,pn();case 5:if(!(f=r.sent)||!f.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(c=window.ConnextUtils)||void 0===c?void 0:c.runningSophi,s("checkPaywallStatus - Sophi is running: ",d),!d){r.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:Zt({},i)})},{once:!0}),r.next=12;break;case 8:if(d){r.next=12;break}return h=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)}),r.prev=9,r.next=10,Promise.race([h,p]);case 10:!0===(E=r.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(E)),r.next=12;break;case 11:r.prev=11,A=r.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(A);case 12:return r.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:Zt({},i)}));case 13:r.prev=13,g=r.catch(0),n(g);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return a.apply(this,arguments)}}();a()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=wn);var yn,mn,Sn=function(){try{var e=localStorage.getItem(Jt);return"string"==typeof e?e:"{}"}catch(e){s("Unable to get session from local storage: ",e)}return"{}"},On=function(e){try{s("Setting local storage session",e),localStorage.setItem(Jt,e)}catch(e){s("Unable to save session from local storage: ",e)}},bn=function(e){try{on(Vt,e,{path:"/",domain:rn(),expires:365,secure:!0})}catch(e){s("Unable to save session to cookie storage: ",e)}},Nn=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w,y,m,S;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.A.sessionServer,n="".concat(t,"/api/session"),s("Checking server session: ",n),e.next=1,Wt.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return d=r.data.entitlementTokenDecoded,h=r.data,p=h.accessToken,E=h.idToken,A=h.entitlementToken,g=null!==(i=null==d?void 0:d.entitlement_expiry)&&void 0!==i?i:null,w=null!==(c=null==d?void 0:d.entitlement_source)&&void 0!==c?c:null,y=null!==(u=null==d?void 0:d.entitlement_entitled)&&void 0!==u?u:null,m=null!==(l=null==d?void 0:d.entitlement_extras_adfree)&&void 0!==l?l:null,S=null!==(f=null==d?void 0:d.entitlement_level)&&void 0!==f?f:null,On(JSON.stringify({accessToken:p,idToken:E,entitlementToken:A,expiration:g,entitlementSource:w,isEntitled:y,adFree:m,entitlementLevel:S})),""!==A&&"string"==typeof A&&bn(A),e.abrupt("return",{accessToken:p,idToken:E,entitlementToken:A,expiration:g,entitlementSource:w,isEntitled:y,adFree:m,entitlementLevel:S});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Tn=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=a.A.sessionServer,r="".concat(n,"/api/session"),s("Updating server session: ",r),e.next=1,Wt.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,i=e.catch(0),s("Failed to update session server: ",i);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Rn=function(){var e=r(o.mark(function e(){var t,n,r,i,a,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,b,N,T,R,I,v,C,L;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s("Inside getSession"),e.prev=1,f=Sn(),s("Session: __MNG_Session = ",f),d=JSON.parse(f),h=d.accessToken,p=d.idToken,E=d.entitlementToken,A=d.expiration,g=d.entitlementSource,w=d.isEntitled,y=d.adFree,m=d.entitlementLevel,n=h,i=A,a=g,c=w,u=y,l=m,s("Session: check both tokens: ",t=p,r=E),void 0!==p&&void 0!==E&&null!==p&&null!==E){e.next=3;break}return s("Session: missing id or entitlements, try session server"),e.next=2,Nn();case 2:S=e.sent,O=S.accessToken,b=S.idToken,N=S.entitlementToken,T=S.expiration,R=S.entitlementSource,I=S.isEntitled,v=S.adFree,C=S.entitlementLevel,n=O,t=b,r=N,i=T,a=R,c=I,u=v,l=C;case 3:e.next=5;break;case 4:e.prev=4,L=e.catch(1),s("Failed to get session: ",L);case 5:return s("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:a,isEntitled:c,adFree:u,entitlementLevel:l});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),In=function(){var e=r(o.mark(function e(t){var n,r,i,a,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,b,N,T,R,I,v,C,L,B,U;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Sn(),r=JSON.parse(n),i=r.accessToken,a=void 0===i?null:i,c=r.idToken,u=void 0===c?null:c,l=r.entitlementToken,f=void 0===l?null:l,d=r.expiration,h=void 0===d?null:d,p=r.entitlementSource,E=void 0===p?null:p,A=r.isEntitled,g=void 0===A?null:A,w=r.adFree,y=void 0===w?null:w,m=r.entitlementLevel,S=void 0===m?null:m,O=t.accessToken,b=t.idToken,N=t.entitlementToken,T=t.expiration,R=t.entitlementSource,I=t.isEntitled,v=t.adFree,C=t.entitlementLevel,L={accessToken:null==O?a:O,idToken:null==b?u:b,entitlementToken:null==N?f:N,expiration:null==T?h:T,entitlementSource:null==R?E:R,isEntitled:null==I?g:I,adFree:null==v?y:v,entitlementLevel:null==C?S:C},s("Current session data: ",r),s("New session data: ",t),s("Updated session data:",L),B=JSON.stringify(L),On(B),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&bn(L.entitlementToken),n===B){e.next=1;break}return e.next=1,Tn(L);case 1:e.next=3;break;case 2:e.prev=2,U=e.catch(0),s("Unable to save session: ",U);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}();window.addEventListener("mng-all-island-ready",function(e){yn||(yn=e,mn&&(s("utils | Dispatching mng-entitlement-check-complete event (islands were not ready): ",mn),window.dispatchEvent(mn)))});var vn=function(){var e=window.localStorage.getItem(Jt);return JSON.parse(e)},Cn=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,Rn();case 1:return t=e.sent,e.abrupt("return",t);case 2:return n=vn(),e.abrupt("return",n);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ln=function(e){on(Vt,e,{path:"/",domain:rn(),expires:365,secure:!0})},Bn=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,Ln(t),s("About to decode token before saving: ",t),n=cn(t),!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,In({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level});case 1:e.next=3;break;case 2:window.localStorage.setItem(Jt,JSON.stringify({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level}));case 3:e.next=5;break;case 4:e.prev=4,r=e.catch(0),s("Entitlements: Failed to save token: ",r);case 5:case"end":return e.stop()}},e,null,[[0,4]])}));return function(t){return e.apply(this,arguments)}}(),Un=function(){var e=r(o.mark(function e(t){var n,r,i,u,l,f,d,h,p,E,A,g,w,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,Rn();case 1:"string"==typeof(r=e.sent).idToken&&""!==r.idToken&&(i=cn(r.idToken),n=void 0!==i&&i.email_verified),e.next=4;break;case 2:return e.next=3,hn();case 3:u=e.sent,(l=u.idToken)&&""!==l&&(n=cn(l).email_verified);case 4:if(s("Entitlements: refresh JWT start..."),t){e.next=5;break}return e.abrupt("return",new Error("No token to refresh"));case 5:return s("Entitlements refresh: entitlement token: ",t),s("Entitlements refresh: auth0 verified: ",n),f={jwt:t,verified:n},d="".concat(a.A.entitlementsEndpoint,"session/refresh"),e.prev=6,e.next=7,$.ajax({type:"POST",url:d,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":a.A.entitlementsApiKey},data:JSON.stringify(f)});case 7:if("boolean"!=typeof(h=e.sent).success){e.next=10;break}if(!h.success){e.next=8;break}p=null===(E=h.data)||void 0===E?void 0:E.jwt,e.next=9;break;case 8:throw A=h.error||{},g=A.message||A.error||"Entitlements API returned an unknown error",new Error("API error: ".concat(g));case 9:e.next=11;break;case 10:p=h.jwt;case 11:return s("Entitlements: Request successful: ",p),e.next=12,Bn(p);case 12:return e.abrupt("return",p);case 13:if(e.prev=13,w=e.catch(6),c("Entitlements: Create Token Failure: ",w),En(),!window.authentication_config.sessionManagementEnabled){e.next=17;break}return e.prev=14,e.next=15,In({entitlementToken:null});case 15:e.next=17;break;case 16:e.prev=16,y=e.catch(14),c("Entitlements: Save Session Failure during error handling: ",y);case 17:throw new Error("Entitlements Refresh failure");case 18:case"end":return e.stop()}},e,null,[[6,13],[14,16]])}));return function(t){return e.apply(this,arguments)}}(),Mn=function(){var e=r(o.mark(function e(t){var n,r,u,l,f,d,h,p,E,A;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s("Entitlements: create token start..."),s("Entitlements: createToken payload with ",t),"object"===i(t)||"string"==typeof t.sub){e.next=1;break}throw new Error("No user info to create token");case 1:if(n=window.location.hostname,r=nn(n),t.sub&&(u=t.sub),t.idToken&&(l=t.idToken),l||u){e.next=2;break}throw new Error("No idToken or uuid provided.");case 2:return f={publication:r.replace("vipdev.lndo.site","com"),requestSource:"website"},l?f.idToken=l:u&&(f.uuid=u),d="".concat(a.A.entitlementsEndpoint,"session/create"),s("Entitlements: create payload",f),e.prev=3,e.next=4,$.ajax({type:"POST",url:d,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":a.A.entitlementsApiKey},data:JSON.stringify(f)});case 4:if("boolean"!=typeof(h=e.sent).success){e.next=6;break}if(h.success){e.next=5;break}return e.abrupt("return",new Error("Entitlements | API returned no JWT"));case 5:p=h.data.jwt,s("Entitlements: Token Created: ",p),e.next=7;break;case 6:p=h.jwt;case 7:return e.next=8,Bn(p);case 8:return e.abrupt("return",p);case 9:if(e.prev=9,E=e.catch(3),s("Entitlements: Create Token Failure: ",E),En(),!window.authentication_config.sessionManagementEnabled){e.next=13;break}return e.prev=10,e.next=11,In({entitlementToken:null});case 11:e.next=13;break;case 12:e.prev=12,A=e.catch(10),c("Entitlements: Save Session Failure during error handling: ",A);case 13:throw new Error("Entitlements Refresh failure");case 14:case"end":return e.stop()}},e,null,[[3,9],[10,12]])}));return function(t){return e.apply(this,arguments)}}(),kn=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Cn();case 1:if((t=e.sent)&&t.entitlementToken){e.next=2;break}return e.abrupt("return",!1);case 2:if(!((n=Date.now()/1e3) ").concat(t.expiration)),e.abrupt("return",Un(t.entitlementToken));case 4:return e.prev=4,r=e.catch(0),s("Entitlements: Local Storage: Error processing token: ",r.message),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[0,4]])}));return function(){return e.apply(this,arguments)}}(),xn=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=tn(Vt)){e.next=1;break}return e.abrupt("return",!1);case 1:return s("checkCookiesForToken, Refreshing token, ".concat(t)),e.next=2,Un(t);case 2:return e.abrupt("return",e.sent);case 3:return e.prev=3,n=e.catch(0),s("Entitlements: Cookie: Error processing token: ",n.message),e.abrupt("return",!1);case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}(),Pn=function(e){s("Attempting to broadcast entitlements ready...",e);try{var t={token:e};if(e){s("About to decode token before broadcasting: ",e);var n=cn(e);!function(e){var t=tn("mng-jwt-decoded");t&&t===e||on("mng-jwt-decoded",JSON.stringify(e),{path:"/",domain:rn(),expires:365,secure:!0})}(n),t=Object.assign(t,{isEntitled:n.entitlement_entitled,adfree:n.entitlement_extras_adfree||!1,subscriptionLevel:n.entitlement_level})}var r=new CustomEvent("entitlementsReady",{detail:t});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=t,s("Dispatching entitlementsReady Event: ",r),window.dispatchEvent(r),s("Dispatched entitlementsReady event"),gn("entitlementsReady"),mn=new CustomEvent("mng-entitlement-check-complete",{detail:t}),yn?(s("utils | Dispatching mng-entitlement-check-complete event (islands were ready): ",r),window.dispatchEvent(mn)):s("Islands not ready")}catch(e){var o={token:""};o=Object.assign(o,{isEntitled:"unknown",adfree:"unknown",subscriptionLevel:"unknown"});var i=new CustomEvent("entitlementsReady",{detail:o});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=o,s("Dispatching entitlementsReady EMPTY Event: ",i),window.dispatchEvent(i),s("Dispatched entitlementsReady EMPTY event"),s("Error: ",e)}},Dn=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Mn({idToken:t});case 1:e.next=3;break;case 2:e.prev=2,n=e.catch(0),s("Entitlements error during oidc login callback: ",n);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Gn=function(){void 0!==window.MNGAuthentication&&Array.isArray(window.MNGAuthentication.oidcLoginCallbacks)&&window.MNGAuthentication.oidcLoginCallbacks.push(Dn)},Fn=function(e){var t=e.searchParams.get("entitlement_jwt");s("Webview JWT param provided: ",t),Ln(t);var n=cn(t);window.localStorage.setItem(Jt,JSON.stringify({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level}))},_n=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=window.localStorage.getItem(qt),n=tn(Yt),r=en(),i=sn(),!(c=tn("clearEntCache"))&&!r.searchParams.has("newUser")){e.next=6;break}return u="".concat(a.A.entitlementsEndpoint,"session/create"),e.next=1,hn();case 1:return l=e.sent,f={uuid:l.claims.auth0Id,publication:i},e.prev=2,e.next=3,$.ajax({type:"DELETE",url:u,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":a.A.entitlementsApiKey},data:JSON.stringify(f)});case 3:e.sent&&(s("loggedOutNewSubscriberActions","Entitlements: Cache cleared"),an("clearEntCache")),e.next=5;break;case 4:e.prev=4,g=e.catch(2),s("loggedOutNewSubscriberActions","Entitlements: Cache clear Failure - ".concat(g.message));case 5:e.next=7;break;case 6:s("loggedOutNewSubscriberActions","There is no clearEntCache cookie");case 7:if(s("loggedOutNewSubscriberActions","Checking if this is a new regwall subscriber"),!(c||"false"===t&&r.searchParams.has("newUser")&&n)){e.next=10;break}return d=!1,h={sub:n,email_verified:!0},e.next=8,Mn(h);case 8:if((p=e.sent)&&""!==p&&(E=cn(p),A=E.entitlement_entitled,d=A),s("loggedOutNewSubscriberActions","New regwall user is entitled: ".concat(d)),!d){e.next=9;break}return window.localStorage.setItem(qt,"true"),window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",!0);case 9:case 10:return e.abrupt("return",!1);case 11:return e.prev=11,w=e.catch(0),s("loggedOutNewSubscriberActions error",w),e.abrupt("return",!1);case 12:case"end":return e.stop()}},e,null,[[0,11],[2,4]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.isUserAdFree=function(){var e=JSON.parse(window.localStorage.getItem(Jt));return null!=e?(s("Ad Free Check: : ",e.adFree),e.idToken&&e.adFree||a.A.isAdfreeArticle):a.A.isAdfreeArticle},window.MNGAuthentication.isUserSubscriber=function(){var e=JSON.parse(window.localStorage.getItem(Jt));return null!=e&&(s("Subscriber Check: : ",e.isEntitled),e.isEntitled)};var Hn=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,b;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.A.entitlementsEnabled){e.next=39;break}return e.next=1,_n();case 1:if(!e.sent){e.next=2;break}return e.abrupt("return",Pn(!1));case 2:return t=window.location,n=new URL(t.href),e.next=3,hn();case 3:if(r=e.sent,i=r.idToken,c=r.accessToken,u=r.isAuthenticated,l=r.claims,Gn(),e.prev=4,!n.searchParams.has("newUser")){e.next=8;break}if("string"!=typeof i||""===i){e.next=7;break}return e.next=5,Mn({idToken:i});case 5:if(!(f=e.sent)){e.next=6;break}return s("Entitlements Init: Created new token for new subscriber"),e.abrupt("return",Pn(f));case 6:e.next=8;break;case 7:s("New subscription, no idToken.");case 8:e.next=10;break;case 9:e.prev=9,e.catch(4),s("Not a new subscriber.");case 10:try{n.searchParams.has("entitlement_jwt")&&Fn(n)}catch(e){s("Error during webview JWT retrieval: ",e)}return e.prev=11,e.next=12,kn();case 12:if(!((d=e.sent)instanceof Error)){e.next=13;break}throw d;case 13:d&&(f=d,s("Entitlements Init: Local Storage Token exists")),e.next=15;break;case 14:e.prev=14,y=e.catch(11),s("Error during Local Storage Token check: ",y);case 15:if(e.prev=15,f){e.next=18;break}return e.next=16,xn();case 16:if(!((h=e.sent)instanceof Error)){e.next=17;break}throw h;case 17:h&&(f=h,s("Entitlements Init: Cookie Token exists"));case 18:e.next=20;break;case 19:e.prev=19,m=e.catch(15),s("Error during Cookie Token check: ",m);case 20:if(!u&&f&&(s("Entitled-only flow: User is not authenticated but entitlement token exists."),cn(f).entitlement_entitled?(s("PageSuite flow: User is not authenticated but is subscriber. Access token is ".concat(c)),c?MNGAuthentication.login():s("PageSuite flow: No Access token.")):s("Entitled-only flow: User is not entitled.")),u){e.next=21;break}return s("User is not logged in, skipping entitlement flow."),e.abrupt("return",Pn(!1));case 21:if(!a.A.bcLowaSegements||u!==a.A.USER_IS_LOWA||f){e.next=25;break}return e.prev=22,s("About to check entitlements based on BC"),p={sub:l.sub},e.next=23,Mn(p);case 23:f=e.sent,!window.authentication_config.sessionManagementEnabled&&a.A.serverEntitlements&&f&&(s("Entitlements fetched, about to reload to refresh entitlement cookie for server."),window.location.reload()),e.next=25;break;case 24:e.prev=24,S=e.catch(22),s("BC sub segment check failed: ",S);case 25:if(e.prev=25,!f){e.next=31;break}if(!a.A.linaCheckOnArticles){e.next=30;break}if(E=cn(f),A=E.entitlement_entitled,g=E.iat,s("LINA check: isEntitled: ".concat(A,", token created at: ").concat(g)),!(a.A.linaCheckOnArticles&&!A&&Date.now()/1e3-new Date(g)>45)){e.next=30;break}if(s("Checking entitlements again for LINA user."),""===i){e.next=29;break}return e.next=26,Mn({idToken:i});case 26:if(!(w=e.sent)){e.next=28;break}return s("Entitlements Init: Created new token for LINA user"),e.next=27,dn();case 27:return"article"===e.sent&&window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",Pn(w));case 28:e.next=30;break;case 29:s("LINA check, no idToken.");case 30:return e.abrupt("return",Pn(f));case 31:e.next=33;break;case 32:e.prev=32,O=e.catch(25),s("LINA check error: ",O);case 33:if(e.prev=33,"string"!=typeof i||""===i){e.next=36;break}return e.next=34,Mn({idToken:i});case 34:if(!(f=e.sent)){e.next=35;break}return s("Entitlements Init: Created new token"),e.abrupt("return",Pn(f));case 35:e.next=37;break;case 36:s("No OIDC ID Token. Not creating a new entitlements token.");case 37:e.next=39;break;case 38:e.prev=38,b=e.catch(33),s("Unable to create token during initialize: ",b);case 39:return e.abrupt("return",Pn(!1));case 40:case"end":return e.stop()}},e,null,[[4,9],[11,14],[15,19],[22,24],[25,32],[33,38]])}));return function(){return e.apply(this,arguments)}}();const Xn={init:Hn};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Xn.init();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.entitlements.bundle.js.map; /*! For license information please see mng-digisubs.uiHandler.bundle.js.LICENSE.txt */ (()=>{var e={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,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=p,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-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,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=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?p/c:p*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+h]=255&s,h+=f,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=f,a/=256,u-=8);e[n+h-f]|=128*m}},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},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},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:"",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}},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},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 p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function f(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,h[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(f(e),n,r,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(p(t)?a:i)(f(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},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)}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},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},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},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,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,p.n=n,u}};function h(e,r){for(a=e,s=r,n=0;!d&&c&&!o&&n3?(o=f===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&hr||r>f)&&(i[4]=e,i[5]=r,p.n=f,a=0))}if(o||e>1)return u;throw d=!0,r}return function(o,l,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&h(l,f),a=l,s=f;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(p.n=-1),h(a,s)):p.n=s:p.v=s);try{if(c=2,i){if(a||(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=p.n<0)?s:e.call(r,p))!==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 p(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),f=p.prototype=l.prototype=Object.create(h);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return d.prototype=p,r(f,"constructor",p),r(p,"constructor",d),d.displayName="GeneratorFunction",r(p,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,a,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},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|m(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(J(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const 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|f(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):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,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|f(e))}function p(e){const t=e.length<0?0:0|f(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 m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(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 Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(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 L(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(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:b(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):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(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 O(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(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<=N)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=m,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(J(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 v(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":case"latin1":case"binary":return A(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(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 N=4096;function k(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 _(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 P(e,t,n,r,o){K(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){K(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function B(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||x(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||x(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||x(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(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||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=$(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(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||x(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||x(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||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||x(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||x(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||x(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||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=$(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(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||X(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(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){_(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){_(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||_(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||_(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||_(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||_(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||_(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 P(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);_(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);_(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||_(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||_(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||_(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||_(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||_(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 P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function K(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 G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||X(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("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=H(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=H(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Y(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 V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(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 q=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")}}},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={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);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)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>nn,hasStandardBrowserEnv:()=>on,hasStandardBrowserWebWorkerEnv:()=>an,navigator:()=>rn,origin:()=>sn});var o=n(4756),i=n(3612);const a=function(){if(i.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.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)}}function g(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&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 n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,v.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),v.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var c=!1,u=0;uDate.now();class O extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,O.prototype)}static fromPayload({error:e,error_description:t}){return new O(e,t)}}class T extends O{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,T.prototype)}}class N extends O{constructor(e,t,n,r,o=null){super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,N.prototype)}}class k extends O{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,k.prototype)}}class C extends k{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,C.prototype)}}class L extends O{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class R extends O{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,R.prototype)}}class x extends O{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,x.prototype)}}class _ extends O{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${B(e,["default"])}', scope: '${B(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,_.prototype)}}class P extends O{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${B(e,["default"])}', missing scope: '${B(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,P.prototype)}}class U extends O{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,U.prototype)}}function B(e,t=[]){return e&&!t.includes(e)?e:""}const M=()=>window.crypto,D=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(M().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},G=e=>btoa(e),F=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],H=e=>Object.keys(e).reduce((t,n)=>{const r=F.find(e=>e.key===n);return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t},{}),K=e=>{var{clientId:t}=e,n=g(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},j=async e=>{const t=M().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},X=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),W=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},Y=new TextEncoder,V=new TextDecoder;function z(e){return"string"==typeof e?Y.encode(e):V.decode(e)}function J(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new ee(`${e.name} modulusLength must be at least 2048 bits`)}let Z;if(Uint8Array.prototype.toBase64)Z=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Z=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},ce=async(e,t,n,r,o,i,a=1e4,s)=>o?(async(e,t,n,r,o,i,a,s)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s},u=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(c,[n.port2])});var c,u})(e,t,n,r,a,o,i,s):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([se(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,a);async function ue(e,t,n,r,o,i,a,s,c,u){if(c){const t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let l,d=null;for(let c=0;c<3;c++)try{l=await ce(e,n,r,o,i,a,t,s),d=null;break}catch(e){d=e}if(d)throw d;const p=l.json,{error:h,error_description:f}=p,m=g(p,["error","error_description"]),{headers:w,ok:y}=l;let b;if(c&&(b=w["dpop-nonce"],b&&await c.setNonce(b)),!y){const l=f||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===h)throw new x(h,l,m.mfa_token);if("missing_refresh_token"===h)throw new _(n,r);if("use_dpop_nonce"===h){if(!c||!b||u)throw new U(b);return ue(e,t,n,r,o,i,a,s,c,!0)}throw new O(h||"request_error",l)}return m}async function le(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,l=g(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const d="urn:ietf:params:oauth:grant-type:token-exchange"===l.grant_type,p="refresh_token"===l.grant_type&&c,h=Object.assign(Object.assign(Object.assign(Object.assign({},l),d&&o&&{audience:o}),d&&i&&{scope:i}),p&&{audience:o,scope:i}),f=s?K(h):JSON.stringify(h),m=(w=l.grant_type,ae.includes(w));var w;return await ue(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(H(a||S)))}},t,s,c,m?u:void 0)}const de=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},pe=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),de(r,t)};class he{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new he({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new he({scope:t,audience:n,clientId:r})}}class fe{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}class me{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class ge{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||I}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!i&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const a=await this.nowProvider(),s=Math.floor(a/1e3);return i.expiresAt-t!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new he({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=he.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=he.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}}class we{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const ye=e=>"number"==typeof e,be=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var ve=b(function(e,t){var n=w&&w.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nIe.get(e)||Ie.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),Ae(`_legacy_${e}`,JSON.stringify(t),r),Ie.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Se(e,n),Ie.remove(e,t),Ie.remove(`_legacy_${e}`,t)}},Te={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Ne;!function(e){e.Code="code",e.ConnectCode="connect_code"}(Ne||(Ne={}));var ke,Ce=function(e){return ke=ke||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o{for(let n=0;n0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const _e={memory:()=>(new me).enclosedCache,localstorage:()=>new fe},Pe=e=>_e[e],Ue=e=>{const{openUrl:t,onRedirect:n}=e,r=g(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},Be=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},Me={NONCE:"nonce",KEYPAIR:"keypair"};class De{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(Me).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(Me.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(Me.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(Me.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Me.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(Me.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Me.KEYPAIR,this.clientId)}}class Ge{constructor(e){this.storage=new De(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){const i=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t);return oe(e,i,n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!re(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await ie(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new Q("unsupported JWK kty")}return q(await crypto.subtle.digest({name:"SHA-256"},z(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Fe;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(Fe||(Fe={}));class He{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=Fe.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?Fe.DPoP:Fe.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===Fe.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new U(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class Ke{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new je({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new je(t)}}class je extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,je.prototype)}}const Xe=new E;class We{constructor(e){let t,n;if(this.userCache=(new me).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await Xe.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!M())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===M().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!Pe(t))throw new Error(`Invalid cache location "${t}"`);n=Pe(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Ie:Oe,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:Te;var o;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:de(t,e,...n)};let r={default:de(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=de(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new we(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||I,this.cacheManager=new ge(n,n.allKeys?void 0:new xe(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Ge(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl);const i=`${this.domainUrl}/me/`,a=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:i},detailedResponse:!0})}));this.myAccountApi=new Ke(a,i),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Ce)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||S)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${K(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(X(r)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],be.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(X(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!ye(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!ye(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ye(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&ye(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),ro)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=G(D()),i=G(D()),a=D(),s=await j(a),c=W(s),u=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),l=((e,t,n,r,o,i,a,s,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:pe(t,n.scope,n.audience),response_type:"code",response_mode:s||"query",state:r,nonce:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),d=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new R;const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(e=>new Promise((t,n)=>{let r;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new L(e.popup)))},1e3),i=setTimeout(()=>{clearInterval(o),n(new C(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),!1!==e.closePopup&&e.popup.close(),a.data.response.error)return n(O.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==o.state)throw new O("state_mismatch","Invalid state");const i=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:i})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=Ue(e),{openUrl:r,fragment:o,appState:i}=n,a=g(n,["openUrl","fragment","appState"]),s=(null===(t=a.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,l=g(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i,response_type:Ne.Code}),s&&{organization:s}));const d=o?`${u}#${o}`:u;r?await r(d):window.location.assign(d)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new O("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===Ne.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new T(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new O("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:Ne.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new N(o,i||o,t.connection,r,t.appState);if(!n)throw new O("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new O("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:Ne.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:pe(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=Le[t];return n||(n=e().finally(()=>{delete Le[t],n=null}),Le[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=g(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!await Re(()=>Xe.acquireLock(r,5e3),10))throw new k;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},a?{scope:a}:null),{expires_in:s})}finally{await Xe.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:pe(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},A),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new he({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=g(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${K(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=Ue(e),{openUrl:r}=n,o=g(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=`auth0.lock.getTokenFromIFrame.${this.options.clientId}`;if(!await Re(()=>Xe.acquireLock(t,5e3),10))throw new k;try{const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new O("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const l=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(e){d=this.domainUrl}const p=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",s,!1))};let s;const c=setTimeout(()=>{o(new k),a()},1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(O.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,d,l);if(o!==p.state)throw new O("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:p.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},h),{scope:c,oauthTokenScope:h.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}finally{await Xe.releaseLock(t)}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new he({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new _(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(u.refresh_token&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,u.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,a=null==t?void 0:t.scope,s=e.authorizationParams.audience,c=e.authorizationParams.scope,i===s&&Be(c,a)||Be(o,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,u.scope);throw new P(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}var i,a,s,c}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=g(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new he({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new he({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){var n,r;const{nonceIn:o,organization:i,scopesToRequest:a}=t||{},s=await le(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:a||e.scope}),this.worker),c=await this._verifyIdToken(s.id_token,o,i);if("authorization_code"===e.grant_type){const e=await this._getIdTokenFromCache();(null===(r=null===(n=null==e?void 0:e.decodedToken)||void 0===n?void 0:n.claims)||void 0===r?void 0:r.sub)&&e.decodedToken.claims.sub!==c.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:c,scope:e.scope,audience:e.audience||"default"}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(i||c.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:c})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:pe(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new He(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,scopes:o,authorization_params:i,redirectUri:a=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const s=G(D()),c=D(),u=await j(c),l=W(u),{connect_uri:d,connect_params:p,auth_session:h}=await this.myAccountApi.connectAccount({connection:r,scopes:o,redirect_uri:a,state:s,code_challenge:l,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:h,redirect_uri:a,appState:n,connection:r,response_type:Ne.ConnectCode});const f=new URL(d);f.searchParams.set("ticket",p.ticket),t?await t(f.toString()):window.location.assign(f)}}function Ye(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ve}=Object.prototype,{getPrototypeOf:ze}=Object,{iterator:Je,toStringTag:Ze}=Symbol,qe=($e=Object.create(null),e=>{const t=Ve.call(e);return $e[t]||($e[t]=t.slice(8,-1).toLowerCase())});var $e;const Qe=e=>(e=e.toLowerCase(),t=>qe(t)===e),et=e=>t=>typeof t===e,{isArray:tt}=Array,nt=et("undefined");function rt(e){return null!==e&&!nt(e)&&null!==e.constructor&&!nt(e.constructor)&&at(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ot=Qe("ArrayBuffer");const it=et("string"),at=et("function"),st=et("number"),ct=e=>null!==e&&"object"==typeof e,ut=e=>{if("object"!==qe(e))return!1;const t=ze(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ze in e||Je in e)},lt=Qe("Date"),dt=Qe("File"),pt=Qe("Blob"),ht=Qe("FileList"),ft=Qe("URLSearchParams"),[mt,gt,wt,yt]=["ReadableStream","Request","Response","Headers"].map(Qe);function bt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),tt(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Et="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,At=e=>!nt(e)&&e!==Et;const St=(It="undefined"!=typeof Uint8Array&&ze(Uint8Array),e=>It&&e instanceof It);var It;const Ot=Qe("HTMLFormElement"),Tt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=Qe("RegExp"),kt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bt(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Ct=Qe("AsyncFunction"),Lt=(Rt="function"==typeof setImmediate,xt=at(Et.postMessage),Rt?setImmediate:xt?(_t=`axios@${Math.random()}`,Pt=[],Et.addEventListener("message",({source:e,data:t})=>{e===Et&&t===_t&&Pt.length&&Pt.shift()()},!1),e=>{Pt.push(e),Et.postMessage(_t,"*")}):e=>setTimeout(e));var Rt,xt,_t,Pt;const Ut="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Et):"undefined"!=typeof process&&process.nextTick||Lt,Bt={isArray:tt,isArrayBuffer:ot,isBuffer:rt,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||at(e.append)&&("formdata"===(t=qe(e))||"object"===t&&at(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ot(e.buffer),t},isString:it,isNumber:st,isBoolean:e=>!0===e||!1===e,isObject:ct,isPlainObject:ut,isEmptyObject:e=>{if(!ct(e)||rt(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:mt,isRequest:gt,isResponse:wt,isHeaders:yt,isUndefined:nt,isDate:lt,isFile:dt,isBlob:pt,isRegExp:Nt,isFunction:at,isStream:e=>ct(e)&&at(e.pipe),isURLSearchParams:ft,isTypedArray:St,isFileList:ht,forEach:bt,merge:function e(){const{caseless:t,skipUndefined:n}=At(this)&&this||{},r={},o=(o,i)=>{const a=t&&vt(r,i)||i;ut(r[a])&&ut(o)?r[a]=e(r[a],o):ut(o)?r[a]=e({},o):tt(o)?r[a]=o.slice():n&&nt(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(bt(t,(t,r)=>{n&&at(t)?e[r]=Ye(t,n):e[r]=t},{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),e.prototype.constructor=e,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&&ze(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:qe,kindOfTest:Qe,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(tt(e))return e;let t=e.length;if(!st(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Je]).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:Ot,hasOwnProperty:Tt,hasOwnProp:Tt,reduceDescriptors:kt,freezeMethods:e=>{kt(e,(t,n)=>{if(at(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];at(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 tt(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:vt,global:Et,isContextDefined:At,isSpecCompliantForm:function(e){return!!(e&&at(e.append)&&"FormData"===e[Ze]&&e[Je])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ct(e)){if(t.indexOf(e)>=0)return;if(rt(e))return e;if(!("toJSON"in e)){t[r]=e;const o=tt(e)?[]:{};return bt(e,(e,t)=>{const i=n(e,r+1);!nt(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ct,isThenable:e=>e&&(ct(e)||at(e))&&at(e.then)&&at(e.catch),setImmediate:Lt,asap:Ut,isIterable:e=>null!=e&&at(e[Je])};function Mt(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Bt.inherits(Mt,Error,{toJSON:function(){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:Bt.toJSONObject(this.config),code:this.code,status:this.status}}});const Dt=Mt.prototype,Gt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Gt[e]={value:e}}),Object.defineProperties(Mt,Gt),Object.defineProperty(Dt,"isAxiosError",{value:!0}),Mt.from=(e,t,n,r,o,i)=>{const a=Object.create(Dt);Bt.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Mt.call(a,s,c,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const Ft=Mt;var Ht=n(8287).hp;function Kt(e){return Bt.isPlainObject(e)||Bt.isArray(e)}function jt(e){return Bt.endsWith(e,"[]")?e.slice(0,-2):e}function Xt(e,t,n){return e?e.concat(t).map(function(e,t){return e=jt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Wt=Bt.toFlatObject(Bt,{},null,function(e){return/^is[A-Z]/.test(e)});const Yt=function(e,t,n){if(!Bt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Bt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Bt.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Bt.isSpecCompliantForm(t);if(!Bt.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Bt.isDate(e))return e.toISOString();if(Bt.isBoolean(e))return e.toString();if(!s&&Bt.isBlob(e))throw new Ft("Blob is not supported. Use a Buffer instead.");return Bt.isArrayBuffer(e)||Bt.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Ht.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Bt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Bt.isArray(e)&&function(e){return Bt.isArray(e)&&!e.some(Kt)}(e)||(Bt.isFileList(e)||Bt.endsWith(n,"[]"))&&(s=Bt.toArray(e)))return n=jt(n),s.forEach(function(e,r){!Bt.isUndefined(e)&&null!==e&&t.append(!0===a?Xt([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Kt(e)||(t.append(Xt(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Wt,{defaultVisitor:u,convertValue:c,isVisitable:Kt});if(!Bt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Bt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Bt.forEach(n,function(n,i){!0===(!(Bt.isUndefined(n)||null===n)&&o.call(t,n,Bt.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Vt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function zt(e,t){this._pairs=[],e&&Yt(e,this,t)}const Jt=zt.prototype;Jt.append=function(e,t){this._pairs.push([e,t])},Jt.toString=function(e){const t=e?function(t){return e.call(this,t,Vt)}:Vt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Zt=zt;function qt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $t(e,t,n){if(!t)return e;const r=n&&n.encode||qt;Bt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Bt.isURLSearchParams(t)?t.toString():new Zt(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Qt=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){Bt.forEach(this.handlers,function(t){null!==t&&e(t)})}},en={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tn={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nn="undefined"!=typeof window&&"undefined"!=typeof document,rn="object"==typeof navigator&&navigator||void 0,on=nn&&(!rn||["ReactNative","NativeScript","NS"].indexOf(rn.product)<0),an="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,sn=nn&&window.location.href||"http://localhost",cn={...e,...tn};const un=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&&Bt.isArray(r)?r.length:i,s)return Bt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&Bt.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Bt.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 Bt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const ln={transitional:en,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Bt.isObject(e);o&&Bt.isHTMLForm(e)&&(e=new FormData(e));if(Bt.isFormData(e))return r?JSON.stringify(un(e)):e;if(Bt.isArrayBuffer(e)||Bt.isBuffer(e)||Bt.isStream(e)||Bt.isFile(e)||Bt.isBlob(e)||Bt.isReadableStream(e))return e;if(Bt.isArrayBufferView(e))return e.buffer;if(Bt.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 Yt(e,new cn.classes.URLSearchParams,{visitor:function(e,t,n,r){return cn.isNode&&Bt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Bt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Yt(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Bt.isString(e))try{return(t||JSON.parse)(e),Bt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ln.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Bt.isResponse(e)||Bt.isReadableStream(e))return e;if(e&&Bt.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 Ft.from(e,Ft.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:cn.classes.FormData,Blob:cn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Bt.forEach(["delete","get","head","post","put","patch"],e=>{ln.headers[e]={}});const dn=ln,pn=Bt.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"]),hn=Symbol("internals");function fn(e){return e&&String(e).trim().toLowerCase()}function mn(e){return!1===e||null==e?e:Bt.isArray(e)?e.map(mn):String(e)}function gn(e,t,n,r,o){return Bt.isFunction(r)?r.call(this,t,n):(o&&(t=n),Bt.isString(t)?Bt.isString(r)?-1!==t.indexOf(r):Bt.isRegExp(r)?r.test(t):void 0:void 0)}class wn{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=fn(t);if(!o)throw new Error("header name must be a non-empty string");const i=Bt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=mn(e))}const i=(e,t)=>Bt.forEach(e,(e,n)=>o(e,n,t));if(Bt.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Bt.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]&&pn[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(Bt.isObject(e)&&Bt.isIterable(e)){let n,r,o={};for(const t of e){if(!Bt.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Bt.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=fn(e)){const n=Bt.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(Bt.isFunction(t))return t.call(this,e,n);if(Bt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=fn(e)){const n=Bt.findKey(this,e);return!(!n||void 0===this[n]||t&&!gn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=fn(e)){const o=Bt.findKey(n,e);!o||t&&!gn(0,n[o],o,t)||(delete n[o],r=!0)}}return Bt.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&&!gn(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Bt.forEach(this,(r,o)=>{const i=Bt.findKey(n,o);if(i)return t[i]=mn(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]=mn(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Bt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Bt.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[hn]=this[hn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=fn(e);t[r]||(!function(e,t){const n=Bt.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 Bt.isArray(e)?e.forEach(r):r(e),this}}wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Bt.reduceDescriptors(wn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Bt.freezeMethods(wn);const yn=wn;function bn(e,t){const n=this||dn,r=t||n,o=yn.from(r.headers);let i=r.data;return Bt.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function vn(e){return!(!e||!e.__CANCEL__)}function En(e,t,n){Ft.call(this,null==e?"canceled":e,Ft.ERR_CANCELED,t,n),this.name="CanceledError"}Bt.inherits(En,Ft,{__CANCEL__:!0});const An=En;function Sn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const In=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)]},Tn=(e,t,n=3)=>{let r=0;const o=In(50,250);return On(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)},Nn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kn=e=>(...t)=>Bt.asap(()=>e(...t)),Cn=cn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,cn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(cn.origin),cn.navigator&&/(msie|trident)/i.test(cn.navigator.userAgent)):()=>!0,Ln=cn.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Bt.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Bt.isString(r)&&s.push(`path=${r}`),Bt.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Bt.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 Rn(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const xn=e=>e instanceof yn?{...e}:e;function _n(e,t){t=t||{};const n={};function r(e,t,n,r){return Bt.isPlainObject(e)&&Bt.isPlainObject(t)?Bt.merge.call({caseless:r},e,t):Bt.isPlainObject(t)?Bt.merge({},t):Bt.isArray(t)?t.slice():t}function o(e,t,n,o){return Bt.isUndefined(t)?Bt.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Bt.isUndefined(t))return r(void 0,t)}function a(e,t){return Bt.isUndefined(t)?Bt.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(xn(e),xn(t),0,!0)};return Bt.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);Bt.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Pn=e=>{const t=_n({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=yn.from(a),t.url=$t(Rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Bt.isFormData(n))if(cn.hasStandardBrowserEnv||cn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Bt.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(cn.hasStandardBrowserEnv&&(r&&Bt.isFunction(r)&&(r=r(t)),r||!1!==r&&Cn(t.url))){const e=o&&i&&Ln.read(i);e&&a.set(o,e)}return t},Un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Pn(e);let o=r.data;const i=yn.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=yn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Sn(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ft("Request aborted",Ft.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new Ft(r,Ft.ERR_NETWORK,e,m);o.event=t||null,n(o),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||en;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ft(t,o.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&Bt.forEach(i.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Bt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([c,l]=Tn(h,!0),m.addEventListener("progress",c)),p&&m.upload&&([s,u]=Tn(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new An(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const w=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);w&&-1===cn.protocols.indexOf(w)?n(new Ft("Unsupported protocol "+w+":",Ft.ERR_BAD_REQUEST,e)):m.send(o||null)})},Bn=(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 Ft?t:new An(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Ft(`timeout ${t} of ms exceeded`,Ft.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=()=>Bt.asap(a),s}},Mn=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Dn(e))yield*Mn(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:Fn}=Bt,Hn=(({Request:e,Response:t})=>({Request:e,Response:t}))(Bt.global),{ReadableStream:Kn,TextEncoder:jn}=Bt.global,Xn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Wn=e=>{e=Bt.merge.call({skipUndefined:!0},Hn,e);const{fetch:t,Request:n,Response:r}=e,o=t?Fn(t):"function"==typeof fetch,i=Fn(n),a=Fn(r);if(!o)return!1;const s=o&&Fn(Kn),c=o&&("function"==typeof jn?(u=new jn,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Xn(()=>{let e=!1;const t=new n(cn.origin,{body:new Kn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Xn(()=>Bt.isReadableStream(new r("").body)),p={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ft(`Response type '${e}' is not supported`,Ft.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=Bt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Bt.isBlob(e))return e.size;if(Bt.isSpecCompliantForm(e)){const t=new n(cn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Bt.isArrayBufferView(e)||Bt.isArrayBuffer(e)?e.byteLength:(Bt.isURLSearchParams(e)&&(e+=""),Bt.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:f,onDownloadProgress:m,onUploadProgress:g,responseType:w,headers:y,withCredentials:b="same-origin",fetchOptions:v}=Pn(e),E=t||fetch;w=w?(w+"").toLowerCase():"text";let A=Bn([c,u&&u.toAbortSignal()],f),S=null;const I=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let O;try{if(g&&l&&"get"!==a&&"head"!==a&&0!==(O=await h(y,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(Bt.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Nn(O,Tn(kn(g)));s=Gn(t.body,65536,e,n)}}Bt.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={...v,signal:A,method:a.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};S=i&&new n(o,c);let u=await(i?E(S,v):E(o,c));const f=d&&("stream"===w||"response"===w);if(d&&(m||f&&I)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Bt.toFiniteNumber(u.headers.get("content-length")),[n,o]=m&&Nn(t,Tn(kn(m),!0))||[];u=new r(Gn(u.body,65536,n,()=>{o&&o(),I&&I()}),e)}w=w||"text";let T=await p[Bt.findKey(p,w)||"text"](u,e);return!f&&I&&I(),await new Promise((t,n)=>{Sn(t,n,{data:T,headers:yn.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:S})})}catch(t){if(I&&I(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,e,S),{cause:t.cause||t});throw Ft.from(t,t&&t.code,e,S)}}},Yn=new Map,Vn=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=Yn;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Wn(t)),u=s;return s},zn=(Vn(),{http:null,xhr:Un,fetch:{get:Vn}});Bt.forEach(zn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Jn=e=>`- ${e}`,Zn=e=>Bt.isFunction(e)||null===e||!1===e;const qn={getAdapter:function(e,t){e=Bt.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(Jn).join("\n"):" "+Jn(e[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:zn};function $n(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new An(null,e)}function Qn(e){$n(e),e.headers=yn.from(e.headers),e.data=bn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return qn.getAdapter(e.adapter||dn.adapter,e)(e).then(function(t){return $n(e),t.data=bn.call(e,e.transformResponse,t),t.headers=yn.from(t.headers),t},function(t){return vn(t)||($n(e),t&&t.response&&(t.response.data=bn.call(e,e.transformResponse,t.response),t.response.headers=yn.from(t.response.headers))),Promise.reject(t)})}const er="1.13.2",tr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const nr={};tr.transitional=function(e,t,n){function r(e,t){return"[Axios v"+er+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Ft(r(o," has been removed"+(t?" in "+t:"")),Ft.ERR_DEPRECATED);return t&&!nr[o]&&(nr[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)}},tr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ft("options must be an object",Ft.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 Ft("option "+i+" must be "+n,Ft.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ft("Unknown option "+i,Ft.ERR_BAD_OPTION)}},validators:tr},or=rr.validators;class ir{constructor(e){this.defaults=e||{},this.interceptors={request:new Qt,response:new Qt}}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=_n(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rr.assertOptions(n,{silentJSONParsing:or.transitional(or.boolean),forcedJSONParsing:or.transitional(or.boolean),clarifyTimeoutError:or.transitional(or.boolean)},!1),null!=r&&(Bt.isFunction(r)?t.paramsSerializer={serialize:r}:rr.assertOptions(r,{encode:or.function,serialize:or.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rr.assertOptions(t,{baseUrl:or.spelling("baseURL"),withXsrfToken:or.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Bt.merge(o.common,o[t.method]);o&&Bt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=yn.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(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=[Qn.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 An(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 sr(function(t){e=t});return{token:t,cancel:e}}}const cr=sr;const ur={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(ur).forEach(([e,t])=>{ur[t]=e});const lr=ur;const dr=function e(t){const n=new ar(t),r=Ye(ar.prototype.request,n);return Bt.extend(r,ar.prototype,n,{allOwnKeys:!0}),Bt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(_n(t,n))},r}(dn);dr.Axios=ar,dr.CanceledError=An,dr.CancelToken=cr,dr.isCancel=vn,dr.VERSION=er,dr.toFormData=Yt,dr.AxiosError=Ft,dr.Cancel=dr.CanceledError,dr.all=function(e){return Promise.all(e)},dr.spread=function(e){return function(t){return e.apply(null,t)}},dr.isAxiosError=function(e){return Bt.isObject(e)&&!0===e.isAxiosError},dr.mergeConfig=_n,dr.AxiosHeaders=yn,dr.formToJSON=e=>un(Bt.isHTMLForm(e)?new FormData(e):e),dr.getAdapter=qn.getAdapter,dr.HttpStatusCode=lr,dr.default=dr;const pr=dr,hr={AUTH0_SUB_COOKIE_KEY:"auth0_sub",ENTITLEMENT_COOKIE_KEY:"mng-entitlements",LOCAL_STORAGE_SESSION_KEY:"__MNG_Session",REGWALL_USER_IS_SUBSCRIBED:"regwallUserIsSubscribed",USER_IS_LOWA:"entitled",SLO_FLAG:"slo_flag",AB_TESTING_COOKIE:"_matheriSegs",ARTICLES_REMAINING_KEY:"articlesRemaining",USER_PROFILE_HASH:"user-profile"};function fr(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 mr(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=yr().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])},Er=function(){var e=vr();return".".concat(e)},Ar=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(a("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=h(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},Sr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=vr(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=h(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},Ir=function(){return yr().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},Or=function(e){return function(e,t){if("string"!=typeof e)throw new f("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 f(`Invalid token specified: missing part #${n+1}`);let o;try{o=m(r)}catch(e){throw new f(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new f(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},Tr=function(){var e=vr();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)},Nr=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=vr().split(".")[0],e.prev=1,e.next=2,pr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 2:if(!(r=e.sent).data){e.next=3;break}return a("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 3:return e.abrupt("return",!1);case 4:return e.prev=4,s=e.catch(1),a("Apple Sub Check: Request Failure: ",s),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),kr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,pr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":i.A.entitlementsApiKey}});case 1:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Cr=function(){return"complete"===document.readyState},Lr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(Cr())t();else{a("UIHandler: ","Waiting for the body to load...");var i=setInterval(r(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=Cr()),document.querySelector("body")&&n&&(clearInterval(i),t(!0));case 1:case"end":return r.stop()}},r)})),200)}})},Rr=function(){return new Promise(function(e){if(Cr())e();else{a("UIHandler: ","Waiting for the log-in-button class to load...");var t=setInterval(r(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:document.getElementsByClassName("log-in-button").length>1&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),200)}})},xr=function(){return new Promise(function(e){if(("interactive"===document.readyState||Cr())&&window.dataLayer)a("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{a("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.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)}})},_r=function(){return new Promise(function(e){if(Cr())e();else{a("UIHandler: Employee Debugger: ","Waiting for the digisubs debugger toolbox to load...");var t=setInterval(r(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:document.getElementById("employee-debugger-content")&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),200)}})},Pr=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,xr();case 1:return a("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",a("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return a("Utils dataLayerLoop: look for this element ",e),e[t]?(a("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(a("Utils dataLayerLoop: dataLayer search ",!1),!1)},i=window.dataLayer.some(r),e.abrupt("return",i?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Ur=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.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,Pr(t);case 1:return n=e.sent,a("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)}}(),Br=function(){return new Promise(function(e){a("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){a("blueConicReady | onReady fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)},3e3)})},Mr=function(){return new Promise(function(e){a("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(a("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},function(){a("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)},3e3)})},Dr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){a("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout(function(){clearTimeout(n),a("blueConicLoaded | onBlueConicLoaded timeout, resolving false for load status."),t(!1)},1e4);void 0!==window.blueConicClient&&void 0!==window.blueConicClient.event&&void 0!==window.blueConicClient.event.subscribe?(a("blueConicLoaded | BC object already loaded"),e?t(Br()):(clearTimeout(n),t())):(a('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(o.mark(function r(){var i;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=2;break}return a("blueConicLoaded | waiting for blueConicReady..."),r.next=1,Br();case 1:i=r.sent,clearTimeout(n),t(i),r.next=3;break;case 2:clearTimeout(n),t();case 3:case"end":return r.stop()}},r)})),!1))})},Gr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Dr(!0);case 1:if(!e.sent){e.next=4;break}return e.next=2,Mr();case 2:if(e.sent){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]&&l[0],n=!1,i=["MICH LOWA","OHIO LOWA","PENN LOWA","NY LOWA","BOSTON LOWA","NORCAL LOWA","TWIN CITIES LOWA","DENV/PMP LOWA","SCNG LOWA","BANG LOWA","AMC LOWA","HC LOWA","GS LOWA","ORL LOWA","SS LOWA","NNDP LOWA","VP LOWA","NYDN LOWA","BAL LOWA","CG LOWA","CHI LOWA"],e.next=1,Dr(!0);case 1:if(!e.sent){e.next=3;break}if(s=window.blueConicClient.getSegments(),a("bcLowaCheck | BC segments for users: ",s),!(s.filter(function(e){return i.includes(e.name)}).length>0)){e.next=3;break}return e.next=2,Gr();case 2:(c=e.sent)&&(n=!0,r=c);case 3:return t&&n&&Hr(),u={isSub:n},r&&(u.uuid=r),e.abrupt("return",u);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Hr=function(){Ar("bc_lowa_status",1,{path:"/",domain:Er(),expires:7,secure:!0})},Kr=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(a("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(a("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};a("utils | Event: authentication ready: ",r),e(r)}catch(e){a(e),t(e)}},!1))})},jr=function(){var e=r(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 i.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(a("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,a("Received entitlementsReady event:",r),e(r)}catch(e){s("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(a("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Xr=function(){a("Clearing entitlements...");try{Sr(hr.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){a("Failed to delete legacy cookie: ",e)}try{Sr(hr.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:vr(),expires:365,secure:!0})}catch(e){a("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(hr.LOCAL_STORAGE_SESSION_KEY)}catch(e){a("Failed to remove local storage: ",e)}},Wr=function(){Sr(hr.AUTH0_SUB_COOKIE_KEY),Sr("mng-jwt-decoded"),localStorage.removeItem(hr.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),Xr()},Yr=function(){var e=yr();return!["local","develop","preprod","trbdev"].some(function(t){return e.origin.includes(t)})},Vr=function(e){a("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),a("Storage Object removed : ",e))},zr=function(e){a("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 a("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=zr;var Jr;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Zr=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Jr){e.next=1;break}return e.abrupt("return",Jr);case 1:return t=i.A.auth0Domain,n=i.A.auth0ClientId,Jr=new We({domain:t,clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{audience:"access-extension",scope:"openid email profile user_metadata app_metadata offline_access"}}),e.abrupt("return",Jr);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),qr=function(e){a("utils | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,a("utils | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),a("utils | Dispatched authenticationReady event"),wr=new CustomEvent("mng-auth-check-complete",{detail:e}),gr?(a("utils | Dispatching mng-auth-complete event (islands were ready): ",t),window.dispatchEvent(wr)):a("Islands not ready")};var $r=function(){var e=window.localStorage.getItem("__MNG_Session");if(e){var t=JSON.parse(e);if(t.idToken){var n=Or(t.idToken);if(n.home_paper)return a("Util.js | home paper: Home paper is ",n.home_paper),n.home_paper.replace("www.","").replace("develop.","").replace("preprod.","").replace("staging.","")}}return a("Util.js | home paper: Home paper is not set ",Ir()),Ir()},Qr=function(e){i.A.datadogEnabled&&window.DD_RUM.addTiming(e)},eo=function(){var e=r(o.mark(function e(t){var n,r,s,u,l,d;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,a("deleteUserCache","Setting up cache deletion for ".concat(t)),n=Ir(),a("deleteUSerCache","Domain is: ".concat(n)),r={publication:n,uuid:t},e.next=1,pr({method:"DELETE",url:"".concat(i.A.entitlementsEndpoint,"session/create"),data:r,headers:{"X-Api-Key":i.A.entitlementsApiKey}});case 1:if(s=e.sent,u=s.data,l=/Succesfully deleted/i,!("object"===c(u)&&Object.prototype.hasOwnProperty.call(u,"message"))||!l.test(u.message)){e.next=2;break}return a("deleteUserCache","Cache deletion successful for ".concat(t)),e.abrupt("return",{success:!0});case 2:return a("deleteUserCache","Cache deletion failed for ".concat(t,": ").concat(u)),e.abrupt("return",{success:!1});case 3:return e.prev=3,d=e.catch(0),a("deleteUserCache","Cache deletion error for ".concat(t,": ").concat(d)),e.abrupt("return",{success:!1});case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(t){return e.apply(this,arguments)}}(),to=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var i={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},s=function(){var s=r(o.mark(function r(){var s,c,u,l,d,p,h,f,m,g,w;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(s=window.sophi_config)||void 0===s?void 0:s.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return i.sspw=!0,r.abrupt("return",t({paywall:!0,details:mr({},i)}));case 1:return r.next=2,Ur();case 2:return u=r.sent,r.next=3,Pr("Paywall_Level");case 3:if(l=r.sent,"article"===u&&"free"!==l){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==u?"Page type is not an article":"Free article"}));case 4:return r.next=5,jr();case 5:if(!(d=r.sent)||!d.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==l){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(p=null===(c=window.ConnextUtils)||void 0===c?void 0:c.runningSophi,a("checkPaywallStatus - Sophi is running: ",p),!p){r.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:mr({},i)})},{once:!0}),r.next=12;break;case 8:if(p){r.next=12;break}return h=window.ConnextUtils.connextReady("onPaywallShown",!1),f=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),r.prev=9,r.next=10,Promise.race([h,f]);case 10:!0===(m=r.sent)?(i.engagePaywall=!0,i.engageStatus="Engage paywall detected"):(i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(m)),r.next=12;break;case 11:r.prev=11,g=r.catch(9),i.engagePaywall=!1,i.engageStatus="Engage response: ".concat(g);case 12:return r.abrupt("return",t({paywall:Object.values(i).some(function(e){return e}),details:mr({},i)}));case 13:r.prev=13,w=r.catch(0),n(w);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return s.apply(this,arguments)}}();s()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=to);var no="#primary-menu",ro="#pushnav",oo=".log-in-button",io=".subscribe-visibility",ao=".log-out-button",so="dfm-digisubs-menu",co="digisubs-push-container",uo="dfm-digisubs-push-menu",lo="mega-subscribe-button",po=function(){return document.querySelector(no)},ho=function(){return document.querySelector(ro)},fo=function(){return document.getElementById(so)},mo=function(){return document.getElementById(co)},go=function(){return document.getElementById(uo)},wo=function(){return fo()?fo().querySelector(oo):null},yo=function(){return go()?go().querySelector(oo):null},bo=function(){return yo()?yo().querySelector("a"):null},vo=function(){return document.getElementById(lo)},Eo=function(){return ho()?ho().querySelector(oo):null},Ao=function(){return Eo()?Eo().querySelector("a"):null},So=function(){return document.querySelectorAll(oo)},Io=function(){return document.querySelectorAll(io)},Oo=function(){var e=document.querySelectorAll("".concat(io," a"));return e.length>0?e[0]:null};function To(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var No=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Dr();case 1:return e.next=2,Kr();case 2:return e.abrupt("return",new Promise(function(e){a("ANALYTICS: inside BCregwall events");var t=yr();t.searchParams.delete("regwall");var n=blueConicClient.profile.getProfile();localStorage.setItem("regwallSuccess","yes"),localStorage.setItem("regwallEvent","yes"),n.setValue("bang_reg_wall_status","Y"),n.setValue("regwall_newspaper",t.host),n.setValue("regwall_success_date",new Date),n.setValue("regwall_success","yes"),blueConicClient.profile.updateProfile(),e(!0)}));case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ko=function(e){try{window.dataLayer.push({event:e}),a("ANALYTICS: ".concat(e," event")),a("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){a("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Co=function(){try{var e=localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){a("Unable to get session from local storage: ",e)}return"{}"},Lo=function(e){try{a("Setting local storage session",e),localStorage.setItem(hr.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){a("Unable to save session from local storage: ",e)}},Ro=function(e){try{Ar(hr.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Er(),expires:365,secure:!0})}catch(e){a("Unable to save session to cookie storage: ",e)}},xo=function(){var e=r(o.mark(function e(){var t,n,r,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.A.sessionServer,n="".concat(t,"/api/session"),a("Checking server session: ",n),e.next=1,pr.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return p=r.data.entitlementTokenDecoded,h=r.data,f=h.accessToken,m=h.idToken,g=h.entitlementToken,w=null!==(s=null==p?void 0:p.entitlement_expiry)&&void 0!==s?s:null,y=null!==(c=null==p?void 0:p.entitlement_source)&&void 0!==c?c:null,b=null!==(u=null==p?void 0:p.entitlement_entitled)&&void 0!==u?u:null,v=null!==(l=null==p?void 0:p.entitlement_extras_adfree)&&void 0!==l?l:null,E=null!==(d=null==p?void 0:p.entitlement_level)&&void 0!==d?d:null,Lo(JSON.stringify({accessToken:f,idToken:m,entitlementToken:g,expiration:w,entitlementSource:y,isEntitled:b,adFree:v,entitlementLevel:E})),""!==g&&"string"==typeof g&&Ro(g),e.abrupt("return",{accessToken:f,idToken:m,entitlementToken:g,expiration:w,entitlementSource:y,isEntitled:b,adFree:v,entitlementLevel:E});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),_o=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.A.sessionServer,r="".concat(n,"/api/session"),a("Updating server session: ",r),e.next=1,pr.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,s=e.catch(0),a("Failed to update session server: ",s);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Po=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=i.A.sessionServer,n="".concat(t,"/api/session"),a("Deleting server session: ",n),e.next=1,pr.delete(n,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,r=e.catch(0),a("Failed to delete server session: ",r);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),Uo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A,S,I,O,T,N,k,C,L;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Inside getSession"),e.prev=1,d=Co(),a("Session: __MNG_Session = ",d),p=JSON.parse(d),h=p.accessToken,f=p.idToken,m=p.entitlementToken,g=p.expiration,w=p.entitlementSource,y=p.isEntitled,b=p.adFree,v=p.entitlementLevel,n=h,i=g,s=w,c=y,u=b,l=v,a("Session: check both tokens: ",t=f,r=m),void 0!==f&&void 0!==m&&null!==f&&null!==m){e.next=3;break}return a("Session: missing id or entitlements, try session server"),e.next=2,xo();case 2:E=e.sent,A=E.accessToken,S=E.idToken,I=E.entitlementToken,O=E.expiration,T=E.entitlementSource,N=E.isEntitled,k=E.adFree,C=E.entitlementLevel,n=A,t=S,r=I,i=O,s=T,c=N,u=k,l=C;case 3:e.next=5;break;case 4:e.prev=4,L=e.catch(1),a("Failed to get session: ",L);case 5:return a("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:s,isEntitled:c,adFree:u,entitlementLevel:l});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),Bo=function(){var e=r(o.mark(function e(t){var n,r,i,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A,S,I,O,T,N,k,C,L,R,x;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Co(),r=JSON.parse(n),i=r.accessToken,s=void 0===i?null:i,c=r.idToken,u=void 0===c?null:c,l=r.entitlementToken,d=void 0===l?null:l,p=r.expiration,h=void 0===p?null:p,f=r.entitlementSource,m=void 0===f?null:f,g=r.isEntitled,w=void 0===g?null:g,y=r.adFree,b=void 0===y?null:y,v=r.entitlementLevel,E=void 0===v?null:v,A=t.accessToken,S=t.idToken,I=t.entitlementToken,O=t.expiration,T=t.entitlementSource,N=t.isEntitled,k=t.adFree,C=t.entitlementLevel,L={accessToken:null==A?s:A,idToken:null==S?u:S,entitlementToken:null==I?d:I,expiration:null==O?h:O,entitlementSource:null==T?m:T,isEntitled:null==N?w:N,adFree:null==k?b:k,entitlementLevel:null==C?E:C},a("Current session data: ",r),a("New session data: ",t),a("Updated session data:",L),R=JSON.stringify(L),Lo(R),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&Ro(L.entitlementToken),n===R){e.next=1;break}return e.next=1,_o(L);case 1:e.next=3;break;case 2:e.prev=2,x=e.catch(0),a("Unable to save session: ",x);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Mo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Ending session..."),Wr(),e.next=1,Po();case 1:localStorage.removeItem(hr.LOCAL_STORAGE_SESSION_KEY);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Do=function(){return"logout"===(yr().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var Go=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Zr();case 1:n=e.sent,a("Calling Auth0 logout..."),n.logout({returnTo:t});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Fo=function(){return"undefined"==typeof CnnXt?(a("Connext was not loaded."),!1):Connext.Storage.GetUserState()},Ho=function(){a("Check for SS paywall Cookie");var e=window.location.hostname,t=document.cookie.split(";").find(function(e){return e.trim().startsWith("vip-go-seg=vc-v1__has_access")});if(/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.?)+[a-zA-Z]{2,6}$/.test(e)&&t){a("SS paywall Cookie found, removing it");var n=t.split("=")[0].trim();document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e),document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}},Ko=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u,l,d,p,h;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Attempting to logout..."),Ho(),a("About to perform user cache deletion..."),t=JSON.parse(localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY)),n=t.idToken,!(i=n?Or(n):"")){e.next=2;break}return s=i.auth0Id,e.next=1,eo(s);case 1:e.sent.success?a("User cache cleared."):a("User cache deletion failed.");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=4;break}return e.next=3,Mo();case 3:e.next=5;break;case 4:Wr();case 5:return e.prev=5,a("Cycling through logout callbacks..."),c=window.MNGAuthentication.logoutCallbacks.map(function(e){return e()}),e.next=6,Promise.all(c);case 6:a("Finished cycling through logout callbacks."),e.next=8;break;case 7:e.prev=7,h=e.catch(5),a("Failed to cycle through logout callbacks: ",h);case 8:Object.keys(window.localStorage).filter(function(e){return e.includes("auth0")}).forEach(function(e){window.localStorage.removeItem(e),a("Removed Auth0 storage object...")}),Vr("hhsl"),Vr("userNewsLetterData"),Vr(hr.REGWALL_USER_IS_SUBSCRIBED),Vr(hr.USER_PROFILE_HASH),u=yr(),l=window.location.origin;try{u.searchParams.get("returnURL")&&(d=decodeURIComponent(u.searchParams.get("returnURL")),l=d)}catch(e){a(e),l=window.location.origin}return l=new URL(l),e.next=9,window.ConnextUtils.connextReady("onInit",!1);case 9:if(!e.sent){e.next=16;break}if(a("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),a("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),p=l,l.origin!==window.location.origin&&(p=new URL(window.location.origin)).searchParams.append("returnAfterLogout",l),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",p),!Yr()){e.next=10;break}a("About to call Connext Logout..."),setTimeout(function(){Connext.Logout()},500),e.next=15;break;case 10:if("Logged In"!==Fo()){e.next=14;break}if(a("Connext user state is logged in, setting timeout..."),setTimeout(r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Connext took too long to logout, calling auth0 logout..."),e.next=1,Go(l);case 1:case"end":return e.stop()}},e)})),8e3),"function"!=typeof Connext._logout){e.next=12;break}return a("About to call Connext _logout..."),e.next=11,Connext._logout();case 11:e.next=13;break;case 12:return a("About to call Connext Logout..."),e.next=13,Connext.Logout();case 13:e.next=15;break;case 14:return a("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=15,Go(l);case 15:e.next=17;break;case 16:return a("Connext Logout was NOT called"),e.next=17,Go(l);case 17:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}(),jo=function(){var e=0;for(var t in window.localStorage){var n=2*window.localStorage[t].length/1024/1024;!Number.isNaN(n)&&window.localStorage.hasOwnProperty(t)&&(e+=n)}return e},Xo=function(){window.MNGAuthentication.preAuthGTMEvents.forEach(function(e){return ko(e)}),a("Cycled through preauth GTM events.")},Wo=function(){var e=r(o.mark(function e(t,n,r,i,s){var c,u,l,d,p,h,f,m,g,w,y,b,v;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("Attempting to login..."),jo()>4.5&&window.localStorage.clear(),Xo(),i&&(c=[],u=window.localStorage.getItem("callbackEvents"),l=JSON.parse(u),c=l&&l.length>0?To(new Set([].concat(To(i),To(l)))):i,window.localStorage.setItem("callbackEvents",JSON.stringify(c))),d=null,e.next=1,Zr();case 1:if(p=e.sent,h=yr(),f=h.origin,m=new URL("".concat(f,"/callback")),g={},h.searchParams.get("regwall")&&(h.searchParams.get("returnUrl")&&(w=h.searchParams.get("returnUrl")),h.searchParams.get("auth_redirect")&&(w=h.searchParams.get("auth_redirect"))),h.pathname.startsWith("/login")||h.pathname.startsWith("/callback")?h.searchParams.get("returnUrl")?m.searchParams.set("auth_redirect",h.searchParams.get("returnUrl")):s&&m.searchParams.set("auth_redirect",s):m.searchParams.set("auth_redirect",h.toString()),w&&"regwall"!==t&&m.searchParams.set("auth_redirect",w),"true"===h.searchParams.get("close-after-finish")&&m.searchParams.set("close-after-finish","true"),"true"!==h.searchParams.get("ssl")){e.next=4;break}if(!window.authentication_config.sessionManagementEnabled){e.next=3;break}return e.next=2,Mo();case 2:e.next=4;break;case 3:Wr();case 4:return null!==(d=h.searchParams.get("login-with"))?g.connection=d:n&&(g.connection=n),y="none",t&&"regwall"===t&&(m.searchParams.set("regwall","true"),y="signUp",a("Logging in with regwall")),t&&(m.searchParams.set("loginsource",t),a("Logging in with ".concat(t))),r&&(g.login_hint=r),g.redirect_uri=m.toString(),g.initialScreen=y,"googleonetap"!==t&&(g.prompt="select_account"),null!==(b=h.searchParams.get("ampRegiWall"))&&(v=window.location.hostname,g.ampRegiWall=b,g.sourceDomain=v.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.",""),g.initialScreen="signUp",g.preferenceId=h.searchParams.get("prefId")),e.next=5,p.loginWithRedirect({authorizationParams:g});case 5:case"end":return e.stop()}},e)}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),Yo=function(){return new Promise(function(e){var t=setTimeout(function(){e()},8e3);try{var n=window.localStorage.getItem("callbackEvents"),r=JSON.parse(n);if(!r||0===r.length)return void e();a("Adding listeners to events we need to wait for...");var o=r.map(function(e){return t=e,new Promise(function(e){a("Adding event to wait for: ",t),window.addEventListener(t,function(n){try{var r=n.detail||{};a("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){a(t),e()}},!1)});var t});Promise.all(o).then(function(){clearTimeout(t),e()})}catch(t){a("Failed to wait for callback events",t),e()}})};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var Vo=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A,S,I,O;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Ho(),t=yr(),n=!1,i=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),s=t.searchParams.get("redirect_uri")||"",s.includes("applenews")?(a("This is Apple prelogin flow."),(c=new URL(s))?(c.searchParams.append("post-apple-login","true"),a("Post callback Apple redirect URL is ".concat(c)),Wo(!1,!1,!1,[],c)):Wo()):i.includes("post-apple-login")&&(a("This is Apple Callback flow."),n=!0,(u=new URL(decodeURIComponent(i))).searchParams.delete("post-apple-login"),i=u),a("Handling post login callback..."),!(l=t.searchParams.get("error_description"))){e.next=2;break}if("shouldAutoLogin"!==l){e.next=1;break}return e.abrupt("return",Wo(!1,!1,!1,!1,i));case 1:n&&alert("There was an error in logging you in, please try again.");case 2:return e.next=3,Zr();case 3:return d=e.sent,e.next=4,d.handleRedirectCallback();case 4:return e.next=5,d.getIdTokenClaims();case 5:return p=e.sent,e.next=6,d.getUser();case 6:return h=e.sent,a("Auth0 user profile: ",h),f=p.__raw,e.next=7,d.getTokenSilently();case 7:return m=e.sent,e.prev=8,a("Cycling through login callbacks..."),e.next=9,Yo();case 9:return g=window.MNGAuthentication.oidcLoginCallbacks.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(f));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=10,Promise.all(g);case 10:a("Finished cycling through login callbacks."),e.next=12;break;case 11:e.prev=11,S=e.catch(8),a("Failed to cycle through login callbacks: ",S);case 12:if(w={accessToken:m,userId:h.sub,email:h.email,picture:h.picture},y=!1,b="",!n){e.next=17;break}return e.prev=13,e.next=14,kr(w.userId);case 14:return b=e.sent,a("Encrypted apple uuid is: ".concat(b)),e.next=15,Nr(b);case 15:y=e.sent,a("Apple sub status is: ".concat(y)),e.next=17;break;case 16:e.prev=16,I=e.catch(13),a("Apple sub check error: ".concat(I)),alert("There was an error in logging you in, please try again.");case 17:if(Vr(hr.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=18;break}return a("Saving idToken to session server"),e.next=18,Bo({idToken:f,accessToken:m});case 18:if(!t.searchParams.get("close-after-finish")){e.next=19;break}return e.abrupt("return",window.close());case 19:if(!t.search.includes("loginsource")){e.next=20;break}return v=t.searchParams.get("loginsource"),E=window.MNGAuthentication.postAuthEvents.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(v));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=20,Promise.all(E);case 20:return e.prev=20,A=new URL(i),n&&y&&A.searchParams.append("access_token",b),a("Apple redirect URL:",A),e.abrupt("return",window.location.assign(A));case 21:return e.prev=21,O=e.catch(20),a("Failed to redirect after authentication: ",O),window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 22:case"end":return e.stop()}},e,null,[[8,11],[13,16],[20,21]])}));return function(){return e.apply(this,arguments)}}(),zo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("ANALYTICS: fireBC events"),e.next=1,No();case 1:a("ANALYTICS: bc values should be filled");case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Jo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,p,h,f,m;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Kr();case 1:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=4;break}return e.prev=2,s=Or(n),c=s.email,u=s.picture,l=s.sub,d=s.name,p=s.nickname,h=s.connection_source,f=null===(i=s.user_metadata)||void 0===i||null===(i=i.customProfile)||void 0===i?void 0:i.nickname,l.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:f||p||d,email:c,picture:u,userId:l,connectionSource:h});case 3:e.prev=3,m=e.catch(2),a("Unable to parse idToken: ",n," Error: ",m);case 4:return e.abrupt("return",{authenticated:r});case 5:case"end":return e.stop()}},e,null,[[2,3]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.login=Wo,window.MNGAuthentication.logout=Ko,window.MNGAuthentication.getUserInfo=Jo;var Zo=function(){var e=r(o.mark(function e(){var t,n,s,u,l,d,p,h,f,m,g,w,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=yr(),n=!1,s="",u=!1,l={},Do()&&window.ConnextUtils.rerunConnextEntitlements(!0),t.searchParams.get("returnAfterLogout")&&(d=decodeURIComponent(t.searchParams.get("returnAfterLogout")),window.location.assign(d)),t.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),p=function(){var e=r(o.mark(function e(){var t,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Zr();case 1:return t=e.sent,e.next=2,t.getIdTokenClaims();case 2:return l=e.sent,e.next=3,t.isAuthenticated();case 3:if(n=e.sent,s="object"===c(l)?l.__raw:"",r=br(hr.ENTITLEMENT_COOKIE_KEY),n||!r){e.next=5;break}return e.next=4,t.getTokenSilently();case 4:u=e.sent;case 5:e.next=7;break;case 6:e.prev=6,i=e.catch(0),a("Unable to verify user has active auth0 session: ",i);case 7:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),!t.pathname.startsWith("/logout")){e.next=2;break}return a("Page is logout. Routing to logout function..."),e.next=1,Ko();case 1:return e.abrupt("return");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=3,p();case 3:if(""===s){e.next=5;break}if(h=null,f=JSON.parse(window.localStorage.getItem(hr.LOCAL_STORAGE_SESSION_KEY)),"{}"!==Co()){e.next=4;break}return f&&(h=f.jwt),e.next=4,Bo({idToken:s,entitlementToken:h});case 4:e.next=8;break;case 5:return e.prev=5,e.next=6,Uo();case 6:m=e.sent,s=m.idToken,(n="string"==typeof s)&&(l=Or(s)),e.next=8;break;case 7:e.prev=7,y=e.catch(5),a("Unable to initialize session: ",y);case 8:e.next=10;break;case 9:return e.next=10,p();case 10:if(n||u||!i.A.blueconicEnabled||!i.A.bcLowaSegements){e.next=12;break}return e.next=11,Fr(!0);case 11:(g=e.sent).isSub&&(n=hr.USER_IS_LOWA,l={sub:g.uuid});case 12:if(qr({isAuthenticated:n,idToken:s,accessToken:u,claims:l}),Qr("authenticationReady"),!0===n?(a("User is authenticated."),t.searchParams.get("auth_redirect")&&(a("Auth Redirect is present, sending user to auth redirect..."),(w=t.searchParams.get("auth_redirect")).endsWith("#")&&(w=w.slice(0,w.length)),window.location.assign(w)),t.pathname.startsWith("/login")&&!Do()&&(a("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(t.origin))):a("User is not authenticated."),t.pathname.startsWith("/login")&&!Do()?(a("Page is login. Attempting to log user in..."),Wo()):a("Page is not login or Connext state is present"),!t.pathname.startsWith("/callback")||!t.searchParams.get("regwall")){e.next=14;break}return a("Page is callback with regwall param. Routing to regwall receiver..."),e.next=13,zo();case 13:a("Now login from regwall"),Wo(),e.next=15;break;case 14:if(!t.pathname.startsWith("/callback")){e.next=15;break}return a("Page is callback without regwall param. Routing to callback receiver..."),e.next=15,Vo();case 15:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.init=Zo;function qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $o(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"deeppink";a("employee tools: add spoof banner");var n=document.getElementById("page").querySelector("header");this.spoofBanner.style.backgroundColor=t,this.spoofBanner.id="spoof-banner",this.spoofContent.textContent=e,this.spoofBanner.append(this.spoofContent),n.prepend(this.spoofBanner)}},{key:"init",value:(t=r(o.mark(function t(){var n,i,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A,S,I,O,T,N,k,C;return o.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(window.MNGAuthentication.logoutCallbacks.push(e.deleteLocalStorageSpoofUser),n=window.localStorage.getItem("spoof-user"),i=window.localStorage.getItem("manual-expiration"),s=ii(this.source,this.email),a("employee tools: validate employee:",s),this.email&&this.employeeId&&(n||!this.source||s.employeeAccess&&"corporate"===s.accessGroup)&&(this.source||n)){t.next=1;break}return t.abrupt("return");case 1:(c=document.createElement("div")).id="employee-debugger",c.classList="employee-debugger-close",(u=document.createElement("div")).id="employee-debugger-button",u.innerHTML='\n\t\t\t\n\t\t',(l=document.createElement("div")).id="employee-debugger-content",l.innerHTML="\n\t\t\t

MNG Debugger

\n\t\t",(d=document.createElement("div")).id="employee-debugger-toggles",(p=document.createElement("div")).id="employee-spoof-wrapper",(h=document.createElement("label")).textContent="Spoof a user",this.userSpoofCheckbox=document.createElement("input"),this.userSpoofCheckbox.type="checkbox",this.userSpoofCheckbox.id="user-spoof-control",f="You are currently entitled as the user 🤫 ".concat(n," 🤫"),m=document.querySelectorAll(".logged-in-source"),(g=document.createElement("div")).id="employee-datepicker-wrapper",(w=document.createElement("label")).textContent="Set expiration",this.datePickerCheckbox=document.createElement("input"),this.datePickerCheckbox.type="checkbox",this.datePickerCheckbox.id="expiration-control",(y=document.createElement("div")).id="datepicker-wrapper",(b=document.createElement("input")).id="expiration-picker",b.type="datetime-local",(v=document.createElement("button")).id="apply-exp-btn",v.className="expiration-btn",(E=document.createElement("button")).id="reset-exp-btn",E.className="expiration-btn",(A=v.appendChild(document.createElement("span"))).className="tooltiptext",A.textContent="Apply date",(S=E.appendChild(document.createElement("span"))).className="tooltiptext",S.textContent="Reset to original",document.body.append(c),document.getElementById("employee-debugger").append(u,l),document.getElementById("employee-debugger-content").append(d),document.getElementById("employee-debugger-toggles").append(p,g),document.getElementById("employee-spoof-wrapper").append(h,this.userSpoofCheckbox),document.getElementById("employee-datepicker-wrapper").append(w,this.datePickerCheckbox,y),document.getElementById("datepicker-wrapper").append(b,v,E),document.getElementById("employee-debugger").append(u,l),I=JSON.parse(localStorage.getItem("__MNG_Session")),O=Or(I.entitlementToken),T=new Date(1e3*I.expiration),N=new Date(1e3*O.session_exp),b.value=T.toISOString().replace(/.\d+Z$/g,""),(k=document.createElement("div")).style.padding="5px 0px 0px 10px",k.innerHTML='\n\t\t

Entitlements JWT

\n\t\t',Object.keys(O).forEach(function(e){var t=document.createElement("div");t.className="list-content";var n=document.createElement("p");n.className="collapsible-list",n.innerHTML="\n\t\t\t".concat(e,'\n\t\t\t+\n\t\t\t\n\t\t\t');var r=n.firstChild.nextElementSibling;r.style.display="inline";var o=n.lastChild.previousElementSibling,i=document.createElement("small");i.className="obj-value",i.innerHTML='⤷ ').concat(O[e],""),t.append(n,i),k.append(t),n.addEventListener("click",function(){var e=n.nextElementSibling;"block"===e.style.display?(e.style.display="none",r.style.display="inline",o.style.display="none"):(e.style.display="block",o.style.display="inline",r.style.display="none")}),i.addEventListener("click",function(){var t=document.getElementById("".concat(e,"_value")).innerHTML;navigator.clipboard&&navigator.clipboard.writeText(t)})}),(C=document.createElement("div")).style.padding="5px 0px 0px 10px",C.innerHTML='\n\t\t\t\t

Connext answer

\n\t\t\t\t',document.addEventListener("onInit",r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Connext){e.next=1;break}(t=document.createElement("p")).className="connext-error-message",t.innerHTML="Something went wrong, reload may solve the issue.",C.append(t),e.next=3;break;case 1:return e.next=2,si();case 2:n=e.sent,Object.keys(n).forEach(function(e){var t=document.createElement("div");t.className="list-content";var r=document.createElement("p");r.className="collapsible-list",r.innerHTML="\n\t\t\t\t".concat(e,'\n\t\t\t\t+\n\t\t\t\t\n\t\t\t\t');var o=r.firstChild.nextElementSibling;o.style.display="inline";var i=r.lastChild.previousElementSibling,a=document.createElement("small");a.className="obj-value",a.innerHTML='⤷ ').concat(n[e],""),t.append(r,a),C.append(t),r.addEventListener("click",function(){var e=r.nextElementSibling;"block"===e.style.display?(e.style.display="none",o.style.display="inline",i.style.display="none"):(e.style.display="block",i.style.display="inline",o.style.display="none")}),a.addEventListener("click",function(){var t=document.getElementById("".concat(e,"_value")).innerHTML;navigator.clipboard&&navigator.clipboard.writeText(t)})});case 3:case"end":return e.stop()}},e)}))),document.getElementById("employee-debugger-content").append(d,k,C),document.getElementById("employee-debugger-toggles").append(p),document.getElementById("employee-spoof-wrapper").append(h,this.userSpoofCheckbox),document.getElementById("employee-debugger-button").addEventListener("click",function(){console.log("clicked debugger");var e=document.getElementById("employee-debugger");e.classList.toggle("employee-debugger-close"),e.classList.contains("employee-debugger-close")?e.style.top="50%":e.style.top="20%"}),!n&&this.source&&this.source.toLowerCase().includes("employee")&&To(m).forEach(function(e){var t=e;t.textContent="Subscriber - Employee",t.style.color="blue"}),n&&(this.addSpoofBannerToPage(f),this.userSpoofCheckbox.checked=!0,To(m).forEach(function(e){var t=e;t.textContent="Subscriber - Employee (spoofing)",t.style.color="blue"})),document.getElementById("apply-exp-btn").addEventListener("click",function(){var t,n=null===(t=new Date(b.value))||void 0===t?void 0:t.getTime(),r=Math.floor(n/1e3);I.expiration=r,localStorage.setItem("__MNG_Session",JSON.stringify(I)),window.localStorage.setItem("manual-expiration",!0),e.interval&&clearInterval(e.interval),e.timeLeftPopUp(I.expiration)}),document.getElementById("reset-exp-btn").addEventListener("click",function(){b.value=N.toISOString().replace(/.\d+Z$/g,"")}),this.addEventListeners(),i&&(this.datePickerCheckbox.click(),e.timeLeftPopUp(I.expiration));case 2:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}],[{key:"deleteLocalStorageSpoofUser",value:function(){window.localStorage.removeItem("spoof-user"),window.localStorage.removeItem("spoofed-user-profile"),localStorage.getItem("userNewsLetterData")&&window.localStorage.removeItem("userNewsLetterData"),a("Removed spoofed-user storage object.")}},{key:"timeLeftPopUp",value:function(e){var t=document.getElementById("expiration-pop-up");if(t)t.classList="",document.getElementById("time-left-text").textContent="Calculating time...";else{var n=document.createElement("div");n.id="expiration-pop-up";var r=n.appendChild(document.createElement("p"));r.id="time-left-text",r.textContent="Calculating time...",document.getElementById("employee-debugger").prepend(n)}var o=new Date(1e3*e).toLocaleString(),i=new Date(o).getTime();this.interval=setInterval(function(){var e=(new Date).getTime(),n=i-e,r=Math.floor(Math.abs(n/864e5))||0,o=Math.floor(Math.abs(n%864e5)/36e5)||0,a=Math.floor(Math.abs(n%36e5)/6e4)||0,s=Math.floor(Math.abs(n%6e4)/1e3);document.getElementById("time-left-text").textContent="Token expires in: ".concat(r,"d ").concat(o,"h ").concat(a,"m ").concat(s,"s 🕛"),n<0&&(document.getElementById("time-left-text").textContent="Token expired by: ".concat(r,"d ").concat(o,"h ").concat(a,"m ").concat(s,"s 🕛"),t.classList.contains("expiredToken")||(t.classList="expiredToken"))},1e3)}},{key:"deleteLocalStorageManualExpiration",value:function(){window.localStorage.getItem("manual-expiration")&&(window.localStorage.removeItem("manual-expiration"),clearInterval(this.interval),document.getElementById("expiration-pop-up").remove())}},{key:"removeUserProfileHash",value:function(e){e&&localStorage.removeItem(hr.USER_PROFILE_HASH)}}]);var t,n,i}(),ui=function(){var e=r(o.mark(function e(t,n){var r,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a("Employee Tools: employeeAds: "),r=ii(t,n),a("employee tools: validate employee:",r),"corporate"===r.accessGroup&&r.employeeAccess){e.next=1;break}return e.abrupt("return",!1);case 1:return e.next=2,_r();case 2:return(i=document.createElement("div")).id="employee-debugger-adfree",i.innerHTML='\n\t\t\n\t\t\n\t\t

(page will reload)

\n\t',document.getElementById("employee-debugger-toggles").append(i),(void 0!==(s=localStorage.getItem("hhsl"))&&"access"===s||"undefined"!=typeof MNGAuthentication&&"function"==typeof MNGAuthentication.isUserAdFree&&MNGAuthentication.isUserAdFree())&&(document.getElementById("employee-adfree-toggle").checked=!0,window.MNGAuthentication.isUserAdFree=!0),document.getElementById("employee-adfree-toggle").addEventListener("click",function(e){a("employee tools: employee ad toggle clicked"),e.target.checked?(a("Employee tools: employee ads: turn off"),localStorage.setItem("hhsl","access"),window.MNGAuthentication.isUserAdFree=!0,setTimeout(function(){window.location.reload()},500)):(a("Employee tools: employee ads: turn on"),localStorage.removeItem("hhsl"),setTimeout(function(){window.location.reload()},500))}),e.abrupt("return",!0);case 3:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}();var li,di,pi,hi,fi,mi=[],gi=Ir();gi=gi.replace("local","com");var wi="".concat(i.A.entitlementsEndpoint,"newsletters"),yi=function(e){var t=new Date,n=Math.round(t.getTime()/1e3)-86400;return new Date(e)>=new Date(1e3*n).getTime()},bi=function(){var e=r(o.mark(function e(t){var n,r,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=wi,"get"===t.method&&(n="".concat(n,"?email=").concat(t.dataToSend.email,"&domain=").concat(t.dataToSend.domain,"&nocache=").concat((new Date).getTime())),e.prev=1,e.next=2,pr({method:t.method,url:n,headers:{"X-Api-Key":i.A.entitlementsApiKey},data:t.dataToSend});case 2:r=e.sent,"get"===t.method&&((mi=r.data.responseData).sort(function(e,t){return e.title>t.title?1:-1}),"limited"===di?(s=mi.filter(function(e){return!e.subscriberOnly}),localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:new Date,newsLetterData:s}))):localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:new Date,newsLetterData:mi})),Ii()),e.next=4;break;case 3:e.prev=3,c=e.catch(1),a("newsletter: ",c);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),vi=function(){var e,t,n=navigator.userAgent,r=/^((?!chrome|android).)*safari/i.test(n),o=/Chrome/.test(n);return r?"calc(100vh - 8.5rem)":o?"calc(100vh - ".concat((e=window.innerHeight,(t=(window.screen.height-e)/16)>0?t:0),"rem)"):"calc(100vh - 64px)"},Ei=function(e){e.stopPropagation();var t={},n=e.target,r=e.target.classList.contains("dropDownNewsLetter")?".slideOutNewsLetter":".dropDownNewsLetter",o=parseInt(n.getAttribute("data-id"),10),i=n.checked;document.querySelector("".concat(r,'[data-id="').concat(o,'"]')).checked=i,mi.find(function(e){return e.id===o}).isSubscribed=i,t.method=i?"post":"delete",t.dataToSend={email:li,domain:gi,preferenceId:o},Si(t)},Ai=function(e){e.stopPropagation();var t,n,r=e.target;if(r.matches("span")||r.matches("label")){var o,i=r.closest("div"),a=i.querySelector(".newsletter-icon"),s="block"===(o=i.classList.contains("show-digisubs-push")?document.querySelector("#newsLetterItem-push"):document.querySelector("#newsLetterContent-dropdown")).style.display,c=document.querySelector(".wrapper-nav-subs.pushnav.pushnav-right"),u=/iPad|iPhone|iPod/.test(navigator.userAgent),l=/Android/i.test(navigator.userAgent);s?(a.classList.remove("icon-arrow-down"),a.classList.add("icon-arrow-right"),o.style.display="none",""!==c.style.height&&(c.style.height="")):(a.classList.remove("icon-arrow-right"),a.classList.add("icon-arrow-down"),o.style.display="block",u&&window.innerHeight=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)||""!==c.style.height||(c.style.height=vi())))}},Si=function(e){localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:pi,newsLetterData:mi})),bi({method:e.method,dataToSend:e.dataToSend})},Ii=function(){var e=document.createElement("div"),t=document.createElement("span");t.classList.add("icon-arrow-right","newsletter-icon"),t.addEventListener("click",Ai),e.append(t);var n=document.createElement("label");n.textContent="Manage Newsletters",n.id="newsletterHead",e.append(n),e.classList.add("newsletter-dropdown-title"),e.addEventListener("click",Ai);var r=e.cloneNode(!0);r.classList.add("show-digisubs-push","newsletter-dropdown-title"),r.style.display="flex",r.addEventListener("click",Ai),e.classList.add("dropdown-item");var o=document.querySelector("#newsLetterContent-dropdown");o.before(e);var i=document.querySelector("#newsLetterItem-push");i.before(r);var a=document.createElement("li");a.classList.add("dropdown-item-newsletter","explainer-text");var s=document.createElement("p");s.classList.add("info-icon");var c=window.btoa('\n\t\tinfo\n\t\t\n\t\t\n\t\t\n\t'),u="url(data:image/svg+xml;base64,".concat(c,")");s.style.background=u;var l=document.createElement("p"),d=document.createElement("a"),p=$r();d.setAttribute("href","https://myaccount.".concat(p)),d.setAttribute("id","myAccountLink"),d.textContent="MyAccount",l.appendChild(document.createTextNode("Manage your newsletters here or visit ")),l.appendChild(d),l.appendChild(document.createTextNode(" for more information")),a.append(s),a.append(l);var h=a.cloneNode(!0);o.append(a),i.append(h);var f,m,g,w=(f={},mi.forEach(function(e){var t=e.category[0].Title;e.isSubscribed&&"Media News Group"!==t&&"MediaNews Group"!==t?f["My Newsletters:"]?f["My Newsletters:"].push(e):f["My Newsletters:"]=[e]:f[t]?f[t].push(e):f[t]=[e]}),f),y=(m=w,g=Object.keys(m).sort(function(e,t){return"My Newsletters:"===e?-1:"My Newsletters:"===t?1:e.localeCompare(t)}),"My Newsletters:"===g[0]?g.splice(1,0,"".concat(fi," Newsletters:")):g=["".concat(fi," Newsletters:")].concat(To(g)),g);w["".concat(fi," Newsletters:")]=[],y.forEach(function(e){if("Media News Group"!==e&&"MediaNews Group"!==e&&"MediaNewsGroup"!==e&&"Not Active"!==e){var t=document.createElement("li");t.classList.add("titleContainer");var n=document.createElement("li");n.classList.add("titleContainer");var r=document.createElement("label");r.classList.add("newsletterCategoryTitle"),r.textContent=e,"My Newsletters:"!==e&&e!=="".concat(fi," Newsletters:")||r.classList.add("newsLetterTitleBold");var a=r.cloneNode(!0);t.append(r),n.append(a),o.append(t),i.append(n),w[e].forEach(function(e){var t=document.createElement("li");t.classList.add("dropdown-item-newsletter");var n=document.createElement("li");n.classList.add("show-digisubs-push","newsLetter-container-push");var r=document.createElement("input");r.classList.add("newsLetterSubscriberToggle"),r.type="checkbox",r.name="newsLetter_".concat(e.title),r.setAttribute("data-id",e.id),r.checked=e.isSubscribed,r.style.cursor="pointer",r.addEventListener("click",Ei),hi&&(r.disabled=!0);var a=document.createElement("label");a.textContent=e.title,a.setAttribute("for","newsLetter_".concat(e.title));var s=r.cloneNode(),c=a.cloneNode(!0);s.addEventListener("click",Ei),r.classList.add("dropDownNewsLetter"),s.classList.add("slideOutNewsLetter"),t.append(r,a),n.append(s,c),o.append(t),i.append(n)})}}),o.style.display="none",i.style.display="none"};const Oi=function(e,t,n,r){if(li=e,di=t,fi=r,hi=n){Vr("userNewsLetterData");for(var o=document.getElementById("newsLetterContent-dropdown"),i=document.getElementById("newsLetterItem-push");o.firstChild;)o.firstChild.remove();for(;i.firstChild;)i.firstChild.remove()}if(a("host for newsletter prefs",gi),localStorage.getItem("userNewsLetterData")){var s=JSON.parse(localStorage.getItem("userNewsLetterData"));pi=s.expoDate,yi(pi)?(mi=s.newsLetterData,Ii()):bi({method:"get",dataToSend:{email:li,domain:gi}})}else bi({method:"get",dataToSend:{email:li,domain:gi}})};var Ti=function(){var e=po()?po().querySelector(ao):null,t=po();null!==e&&t.removeChild(e)},Ni=function(){var e=r(o.mark(function e(t){var n,r,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A,S,I,O,T,N,k,C,L,R,x,_,P,U,B,M,D,G,F,H,K,j,X,W,Y,V,z,J,Z,q,$,Q,ee,te,ne,re,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,we,ye,be,ve,Ee,Ae,Se,Ie,Oe,Te,Ne,ke;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=t.authenticatedStatus,r=t.email,c=t.nickname,u=t.picture,l=t.connectionSource,d=t.entitlementSource,p=t.entitlementOrganization,h=t.entitlementLevel,f=t.serviceCode,m=t.isEedition,g=t.accountHref,w=t.userId,y="",b=" | Logged in with ",v=[],E=r,A=function(e){var t=(e||"").trim();if(!t)return" ";var n=t.split("@"),r=n.shift()||"",o=r.length,i=-1*(o>24?Math.min(8,Math.ceil(o/6)):0);return'
').concat(r.slice(0,i),'').concat(r.slice(i),'@').concat(n.shift(),"
")},void 0!==r&&"undefined"!==r&&r&&!r.endsWith("@example.com")||(E=c||"Logged In"),S=null==l?void 0:l.replace("Trib-","").toLowerCase(),a("Validate connection source: ",S),e.prev=1,Te=S,e.next="google-oauth2"===Te||"google"===Te?2:"facebook"===Te?3:"apple"===Te?4:5;break;case 2:return b+="Google",e.abrupt("continue",6);case 3:return b+="Facebook",e.abrupt("continue",6);case 4:return b+="Apple",e.abrupt("continue",6);case 5:return b="",e.abrupt("continue",6);case 6:Ne=h,e.next="limited"===Ne?7:"subscriber"===Ne||"freeTrial"===Ne?8:"premium"===Ne?9:"comp"===Ne?10:"partner-access"===Ne?11:12;break;case 7:return y="Limited Access",e.abrupt("continue",13);case 8:return y="Standard Digital Access",e.abrupt("continue",13);case 9:return y="Premium Ad-Free Access",e.abrupt("continue",13);case 10:return y="Standard Digital Trial",e.abrupt("continue",13);case 11:return y="Partner Access",e.abrupt("continue",13);case 12:return y="Anonymous",e.abrupt("continue",13);case 13:if(n===hr.USER_IS_LOWA&&(b="",y="Anonymous"),m&&f&&f.includes("P")&&(y="Limited Subscription - e-Edition access"),p&&(y="".concat("Standard Digital Access"===y?"Access":"Premium Ad-Free Access"===y?"Ad-Free Access":y," provided by ").concat(p)),Ti(),mo().style.display="none",fo().dataset.status="logged-in",(O=wo()).removeChild(O.firstChild),(T=document.createElement("a")).id="anchorProfileDropDown",T.className="nav-link dropdown-toggle dropdown-toogle-mobile",T.setAttribute("aria-label","Account menu dropdown"),T.style.cursor="pointer",T.setAttribute("tabindex","0"),T.setAttribute("aria-expanded","false"),N=document.createElement("img"),k=document.getElementById("pushnav-icon"),N.className="rounded-circle",N.alt="Profile image",k.className="rounded-circle",N.src=u,k.src=u,u||(N.src="https://ui-static-assets-prod.mng-digisubs-prod.com/img/no-icon.png",k.src="https://ui-static-assets-prod.mng-digisubs-prod.com/img/no-icon.png"),(C=document.createElement("span")).className="icon-arrow-down",C.id="icon-caret",C.setAttribute("aria-hidden","true"),L=document.createElement("div"),(R=document.createElement("div")).id="account-content",R.className="dropdown-menu",L.id="account-content-container",document.body.appendChild(L),O.append(T,R),x="",window.dataLayer.forEach(function(e){Object.prototype.hasOwnProperty.call(e,"SiteName")&&(x=e.SiteName)}),_=window,P=_.location,U=new URL(P),G=null,n!==hr.USER_IS_LOWA?((G=document.createElement("a")).className="dropdown-item dropdown-profile account-link",G.text=E):document.getElementById("push-email-link").style.display="none",n===hr.USER_IS_LOWA&&((F=document.createElement("li")).className="dropdown-item log-in-button subscribe-special custom-button",H=document.createElement("a"),K=yr(),H.href="/login?returnUrl=".concat(K),H.target="_blank",H.text="Complete Log In",H.style.cursor="pointer",H.style.margin="0",H.style.width="auto"),j=ki('\n\t\t\t'),X=A(r),(W=document.createElement("div")).className="dropdown-item digisubs-top-info-container account-link account-settings",W.setAttribute("data-mng-click","account-settings"),W.setAttribute("data-mng-category","account-link"),W.setAttribute("data-mng-action","account-settings"),Y=Oo(),V=vr(),z="https://checkout.".concat(V),Y){z=Y.href,a("Original sub URL: ",z);try{(J=new URL(z)).searchParams.has("newUser")||J.searchParams.set("newUser","true"),z=J.toString()}catch(e){a("Error processing subscription URL: ",e)}}for(Z="subscriber"===h||"premium"===h?"\n\t\t\t\t
\n\t\t\t\t\t
".concat(c||"User","
\n\t\t\t\t\t
").concat(X,"
\n\t\t\t\t
"):"\n\t\t\t\t
\n\t\t\t\t\t
".concat(c||"User","
\n\t\t\t\t\t
").concat(X,"
\n\t\t\t\t\t
\n\t\t\t\t\t\tSubscribe Now\n\t\t\t\t\t
\n\t\t\t\t
"),q=ki(Z),W.appendChild(q),($=document.createElement("a")).className="dropdown-item account-link account-settings",$.setAttribute("data-mng-click","account-settings"),$.setAttribute("data-mng-category","account-link"),$.setAttribute("data-mng-action","account-settings"),Q="\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Subscription
\n\t\t\t\t\t
".concat(y,'
\n\t\t\t\t
\n\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
\n\t\t\t
'),ee=ki(Q),$.appendChild(ee),i.A.enableReaderDashboardLink&&((B=document.createElement("a")).className="dropdown-item",B.id="reader-dashboard-link",B.setAttribute("data-mng-click","reader-dashboard"),B.setAttribute("data-mng-category","account-link"),B.setAttribute("data-mng-action","reader-dashboard"),B.href="".concat(U.origin,"/user-tools/dashboard"),B.target="_blank",te=ki('\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
Reader Dashboard
\n\t\t\t\t
\n\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
\n\t\t\t
'),B.appendChild(te)),i.A.enableGiftedArticlesLink&&((M=document.createElement("a")).className="dropdown-item",M.setAttribute("data-mng-click","gifted-articles"),M.setAttribute("data-mng-category","account-link"),M.setAttribute("data-mng-action","gifted-articles"),M.href="".concat(U.origin,"/user-tools/dashboard/#shared-articles-container"),M.target="_blank",ne="subscriber"===h?'\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Gifted Articles
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
':"\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Gifted Articles
\n\t\t\t\t\t\t\x3c!-- Subscribe for access --\x3e\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
'),re=ki(ne),M.appendChild(re)),i.A.enableSavedArticlesLink&&((D=document.createElement("a")).className="dropdown-item",D.href="".concat(U.origin,"/user-tools/dashboard/#saved-article-container"),D.target="_blank",oe="subscriber"===h?"\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Saved Articles
\n\t\t\t\t\t\t\x3c!-- Subscribe for access --\x3e\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
'):"premium"===h?'\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Saved Articles
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
':'\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
Saved Articles
\n\x3c!--\t\t\t\t\t\t
Subscribe to Premium for access
--\x3e\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
',ie=ki(oe),D.appendChild(ie)),(ae=document.createElement("a")).className="dropdown-item",ae.href="".concat(U.origin,"/contact-us"),ae.target="_blank",ae.setAttribute("data-mng-click","contact-us"),ae.setAttribute("data-mng-category","account-link"),ae.setAttribute("data-mng-action","contact-us"),se=ki('\n\t\t
\n\t\t\t
\n\t\t\t\t
Contact Us
\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t
'),ae.appendChild(se),(ce=document.createElement("a")).className="dropdown-item",ce.href="".concat(U.origin,"/logout"),ae.setAttribute("data-mng-click","logout"),ae.setAttribute("data-mng-category","account-link"),ae.setAttribute("data-mng-action","logout"),ue=ki("\n\t\t
\n\t\t\t
\n\t\t\t\t
Log Out
\n\t\t\t
\n\t\t
"),ce.appendChild(ue),(le=document.createElement("a")).className="dropdown-item",le.setAttribute("data-mng-click","marketing-content"),le.setAttribute("data-mng-category","marketing-content"),le.setAttribute("data-mng-action","marketing-content"),de=ki("\n\t\t
\n\t\t\t
\n\t\t\t\tSAMPLE MARKETING ITEM HERE\n\t\t\t
\n\t\t
"),le.appendChild(de),O.id="profileDropDown",O.className="nav-item dropdown auth-visible show",T.append(N,C),F&&document.getElementById("account-content").append(F),pe=[j,W].concat(To(B?[B]:[]),[$],To(M?[M]:[]),To(D?[D]:[]),[ae,ce,le]),(I=document.getElementById("account-content")).append.apply(I,To(pe)),document.getElementById("push-auth-source").textContent="".concat(y).concat(b),document.getElementById("push-email-link").textContent=E,document.getElementById("push-account-content").style.display="block",document.getElementById("blank-icon-user").style.display="none",i.A.enableReaderDashboardLink&&((he=document.createElement("a")).className="show-digisubs-push dashboard-link",he.id="push-reader-dashboard",he.text="Reader Dashboard",he.href="".concat(U.origin,"/user-tools/dashboard"),document.querySelector("#push-account-link").after(he)),a("Employee tools: start tools here",d,r,w),!1===(fe=d)&&(fe="none"),(me=new ci(fe,r,w)).init(),ui(fe,r),i.A.newslettersEnabled&&h&&(ge=E,we=!1,me.userSpoofCheckbox&&(we=me.userSpoofCheckbox.checked),localStorage.getItem("spoof-user")&&(ge=localStorage.getItem("spoof-user")),!0===n&&Oi(ge,h,we,x)),ye=document.getElementById("account-content"),be=document.querySelector(".search-icon-wrapper"),ve=function(){var e=ye.classList.contains("show");C.className=e?"icon-arrow-up":"icon-arrow-down",T.setAttribute("aria-expanded",e.toString()),e?(null==be||be.classList.add("search-icon-wrapper-hide"),L.style.display="block"):(null==be||be.classList.remove("search-icon-wrapper-hide"),L.style.display="none")},window.addEventListener("resize",ve),T.addEventListener("click",function(){ye.classList.toggle("show"),ve()}),document.getElementById("anchorProfileDropDown").addEventListener("keydown",function(e){"Enter"===e.key&&(ye.classList.toggle("show"),ve())}),document.addEventListener("click",function(e){T.contains(e.target)||ye.contains(e.target)||(ye.classList.remove("show"),ve())}),v=document.getElementsByClassName("account-link"),Ee=0;Ee0&&e.addedNodes.forEach(function(e){1===e.nodeType&&n.targetsToWatch.forEach(function(t,r){(e.matches(t.selector)?[e]:Array.from(e.querySelectorAll(t.selector))).forEach(function(e){n.processTargetIfConditionMet(e,t,r)&&n.targetProcessedStatus.set(r,!0)})})})}),this.checkAndDisconnectObserver(t)}},{key:"checkAndDisconnectObserver",value:function(e){var t=this,n=!0;this.targetsToWatch.forEach(function(e,r){e.condition&&!t.targetProcessedStatus.get(r)&&(n=!1)}),n&&(e.disconnect(),a("MutationObserver disconnected: All relevant elements processed or conditions not met."))}},{key:"startObserving",value:(e=r(o.mark(function e(){var t,n=this,r=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:document.body,e.next=1,xr();case 1:a("ContentObserver: Starting observation process."),this.observer.observe(t,{childList:!0,subtree:!0}),a("MutationObserver started for ".concat(t.tagName||"document.body"," elements.")),Object.entries(this.targetsToWatch).forEach(function(e){var r=h(e,2),o=r[0],i=r[1];if(i.condition){var a=t.querySelector(i.selector);a&&n.processTargetIfConditionMet(a,i,o)&&n.targetProcessedStatus.set(o,!0)}}),this.checkAndDisconnectObserver(this.observer);case 2:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e}()),Ri=function(){var e=r(o.mark(function e(){var t,n,r,a,s,c,u,l,d,p,h,f,m,g,w,y,b;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!1,n="Naviga",r="",a="Anonymous",s=!1,c=!1,u="",!i.A.entitlementsEnabled){e.next=2;break}return e.next=1,jr();case 1:(l=e.sent)&&l.token&&(d=l.token,p=Or(d),h=p.entitlement_entitled,f=p.entitlement_source,m=p.entitlement_organizationName,g=p.entitlement_level,w=p.entitlement_serviceCode,y=p.entitlement_isEedition,b=p.email,t=h||!1,n=f||!1,a=g||"Anonymous",s=w||!1,c=y||!1,u=b||"",r=m||""),e.next=3;break;case 2:"undefined"!=typeof Connext&&"Subscribed"===Connext.Storage.GetUserState()&&(t=!0);case 3:return e.abrupt("return",{userIsEntitled:t,entitlementSource:n,entitlementOrganization:r,entitlementLevel:a,serviceCode:s,isEedition:c,tokenEmail:u});case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),xi=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=yr(),r=t.querySelector("a"),(i=new URL(r.href)).searchParams.set("returnUrl",encodeURIComponent("".concat(n.href,"?newUser=true"))),r.setAttribute("href",i.href);case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),_i=function(e){var t,n=e.siteUrl,r=["courant.com","mcall.com","baltimoresun.com","orlandosentinel.com","growthspotter.com","sun-sentinel.com","capitalgazette.com","dailypress.com","pilotonline.com","nydailynews.com","chicagotribune.com"].filter(function(e){return e===n});return void 0!==window.authentication_config&&window.authentication_config.myAccountLink&&(t=window.authentication_config.myAccountLink,/^https?:\/\/([\w.-]+)\.([a-z]{2,})(\/[\w-.]*)*$/.test(t))?(a("UIHandler: ","Account Settings link provided by wp-admin"),new URL("".concat(window.authentication_config.myAccountLink))):r.length>0?new URL("https://membership.".concat(n)):new URL("https://myaccount.".concat(n))},Pi=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=t.accountHref,So().forEach(function(e){var t=e;t.querySelector("a").textContent="My Account",t.querySelector("a").setAttribute("href",n)});case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Ui=function(e){try{void 0!==window.MNGAuthentication&&("keydown"===e.type&&"Enter"===e.key||"click"===e.type)&&(e.preventDefault(),window.MNGAuthentication.logout())}catch(e){a(e)}},Bi=function(e){a("UIHandler: ","engage overrides showing block: ",e);var t=document.createElement("style"),n=".".concat(e,"{display:inline-block !important;}");t.textContent=".engageLogoutLink, .engageLoginLink {display:none !important;}"+n,document.getElementsByTagName("head")[0].appendChild(t)},Mi=function(){a("UIHandler: ","show logout buttons"),Bi("engageLogoutLink"),document.querySelectorAll(ao).forEach(function(e){var t=e;t.style.visibility="visible",t.style.display="block",t.addEventListener("click",Ui),t.addEventListener("keydown",Ui)})},Di=function(){a("UIHandler: ","show login buttons"),Bi("engageLoginLink"),So().forEach(function(e){var t=e;t.style.visibility="visible",t.style.display="block",t.querySelector("a").textContent="Log in";var n=new URL(t.querySelector("a").href),r=new URLSearchParams(n);r.append("returnUrl",yr()),t.querySelector("a").setAttribute("href","".concat(n,"?").concat(r))})},Gi=function(){var e=r(o.mark(function e(){var t,n,r,s,c,u,l,d,p,h,f,m,g,w,y,b,v,E,A;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a("UIHandler: ","setup"),e.next=1,Jo();case 1:return t=e.sent,n=t.authenticated,r=t.email,s=t.picture,c=t.connectionSource,u=t.userId,l=t.nickname,e.next=2,Ri();case 2:if(d=e.sent,p=d.userIsEntitled,h=d.entitlementSource,f=d.entitlementOrganization,m=d.entitlementLevel,g=d.serviceCode,w=d.isEedition,y=d.tokenEmail,b=_i({siteUrl:$r()}),!n){e.next=6;break}if(!i.A.dropdownEnabled){e.next=4;break}return n===hr.USER_IS_LOWA||r&&!r.includes("@example.com")||(r=y),e.next=3,Ci({authenticatedStatus:n,email:r,nickname:l,picture:s,connectionSource:c,entitlementSource:h,entitlementOrganization:f,entitlementLevel:m,serviceCode:g,isEedition:w,accountHref:b,userId:u});case 3:e.next=5;break;case 4:return e.next=5,Pi({entitlementSource:h,siteUrl:Ir(),accountHref:b});case 5:Mi(),e.next=7;break;case 6:Di();case 7:v=vo(),p?(Io().forEach(function(e){e.style.display="none"}),v&&(v.style.display="none")):(Io().forEach(function(e){var t=e;t.style.display="block",xi(t)}),v&&(v.style.display="flex",E=yr(),(A=new URL(v.getAttribute("href"))).searchParams.set("returnUrl",encodeURIComponent(E.href)),v.setAttribute("href",A.href)));case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Fi=function(){var e=wo();e&&(e.style.display="block",e.style.visibility="visible");var t=wo()?wo().querySelector("a"):null;t&&(t.textContent="Loading..."),fo().dataset.status="logged-out"},Hi=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return Fi(),e.next=1,Gi();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();document.addEventListener("DOMContentLoaded",function(){var e=document.getElementById("digisubs-push-container");e&&(e.classList.remove("hidden"),e.classList.add("loaded"))});var Ki=function(){var e=r(o.mark(function e(){var t,n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Lr();case 1:return e.next=2,Ur();case 2:if("article"===e.sent){e.next=3;break}return a("addArticleContentObservers: Non-article page detected, leaving."),e.abrupt("return");case 3:return e.next=4,Pr("Paywall_Level");case 4:return t=e.sent,e.next=5,Ri();case 5:n=e.sent,r=n.userIsEntitled,i=n.entitlementLevel,Li.addTargetsFromObject({"stn-player":{selector:".stn-player",condition:r&&"premium"===i,action:function(e){a("addArticleContentObservers: Send to news player found. Hiding for adfree user.");var t=e.parentNode;t&&(t.style.display="none")}},bxc:{selector:".bxc",condition:r&&"premium"===i,action:function(e){a("addArticleContentObservers: .bx element found. Removing from DOM for adfree user."),document.querySelectorAll(".bx-client-overlay").forEach(function(e){e.classList.remove("bx-client-overlay")}),e.remove()}}}),Li.addTargetsFromObject({".article-bottom-share":{selector:".article-bottom-share",condition:!0,action:function(e){a("addArticleContentObservers: Bottom article share buttons found, updating styles."),e.style.margin="0 auto"}}}),Li.addTargetsFromObject({"wp-remixd-voice-wrapper":{selector:".wp-remixd-voice-wrapper",condition:"premium"===t&&!r,action:function(e){a("addArticleContentObservers: Audio player found. Removing from DOM for LINA user."),e.remove()}}});case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ji=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Rr();case 1:return r(o.mark(function e(){var t;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Ki();case 1:return e.next=2,Li.startObserving();case 2:e.next=4;break;case 3:e.prev=3,t=e.catch(0),a("Error: Failed to start ContentObserver:",t);case 4:case"end":return e.stop()}},e,null,[[0,3]])}))(),e.next=2,Hi();case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:ji();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.uiHandler.bundle.js.map;