/*! For license information please see mng-digisubs.main.bundle.js.LICENSE.txt */ (()=>{var e={1928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},2012:(e,t,n)=>{"use strict";var r=n(9516),o=["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"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},2505:(e,t,n)=>{e.exports=n(8015)},2881:(e,t,n)=>{"use strict";var r=n(9516),o=n(6987);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},3191:(e,t,n)=>{"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},3864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3948:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4202:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4490:(e,t,n)=>{"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(6987),s=n(1928);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},4680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4841:(e,t,n)=>{"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},5019:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},5155:(e,t,n)=>{"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),s=n(5343),c=n(4841),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var h=e;n.length;){var d=n.shift(),f=n.shift();try{h=d(h)}catch(e){f(e);break}}try{o=a(h)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=l},5343:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},5449:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5592:(e,t,n)=>{"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),s=n(9615),c=n(2012),u=n(4202),l=n(7763),h=n(6987),d=n(1928);e.exports=function(e){return new Promise((function(t,n){var f,p=e.data,g=e.headers,m=e.responseType;function w(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}r.isFormData(p)&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(y+":"+E)}var A=s(e.baseURL,e.url);function S(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v};o((function(e){t(e),w()}),(function(e){n(e),w()}),i),v=null}}if(v.open(e.method.toUpperCase(),a(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=S:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(S)},v.onabort=function(){v&&(n(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){n(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||h.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||u(A))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;b&&(g[e.xsrfHeaderName]=b)}"setRequestHeader"in v&&r.forEach(g,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(e){v&&(n(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),p||(p=null),v.send(p)}))}},6987:(e,t,n)=>{"use strict";var r=n(9516),o=n(7018),i=n(5449),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},7018:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},7522:(e,t,n)=>{"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},7763:(e,t,n)=>{"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},7980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8015:(e,t,n)=>{"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343);var s=function e(t){var n=new i(t),s=o(i.prototype.request,n);return r.extend(s,i.prototype,n),r.extend(s,n),s.create=function(n){return e(a(t,n))},s}(n(6987));s.Axios=i,s.Cancel=n(1928),s.CancelToken=n(3191),s.isCancel=n(3864),s.VERSION=n(9641).version,s.all=function(e){return Promise.all(e)},s.spread=n(7980),s.isAxiosError=n(5019),e.exports=s,e.exports.default=s},8805:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={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,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}},9012:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},9516:(e,t,n)=>{"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},9641:e=>{e.exports={version:"0.24.0"}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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),(()=>{"use strict";function e(t){return e="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(t)}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)}))}}var o=n(8805);const i={log:function(){if(o.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function d(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(h(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return h(t)}}function f(e){this.message=e}f.prototype=new Error,f.prototype.name="InvalidTokenError";const p=function(e,t){if("string"!=typeof e)throw new f("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(d(e.split(".")[n]))}catch(e){throw new f("Invalid token specified: "+e.message)}};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,y.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),y.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 O extends I{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,O.prototype)}}class T extends O{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,T.prototype)}}class L extends I{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class C extends I{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,C.prototype)}}class R extends I{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${k(e,["default"])}', scope: '${k(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,R.prototype)}}function k(e,t=[]){return e&&!t.includes(e)?e:""}const _=()=>window.crypto,x=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(_().getRandomValues(new Uint8Array(43))).forEach((n=>t+=e[n%66])),t},P=e=>btoa(e),G=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()},U=e=>(e=>decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),M=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},D=async(e,t,n,r,o,i,a=1e4)=>o?(async(e,t,n,r,o,i,a)=>{return s={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a},c=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()},c.postMessage(s,[n.port2])}));var s,c})(e,t,n,r,a,o,i):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([M(e,t),new Promise(((e,t)=>{o=setTimeout((()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((()=>{clearTimeout(o)}))})(e,r,a);const B=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class X{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 X({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new X({scope:t,audience:n,clientId:r})}}class F{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 H{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 j{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||b}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){var n;let r=await this.cache.get(e.toKey());if(!r){const t=await this.getCacheKeys();if(!t)return;const n=this.matchExistingCacheKey(e,t);n&&(r=await this.cache.get(n))}if(!r)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return r.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 X({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter((t=>{var n;const r=X.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]}}class K{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 Y=e=>"number"==typeof e,W=["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 V=v((function(e,t){var n=m&&m.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nQ.get(e)||Q.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),J(`_legacy_${e}`,JSON.stringify(t),r),Q.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),z(e,n),Q.remove(e,t),Q.remove(`_legacy_${e}`,t)}},$={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 ee,te=function(e){return ee=ee||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{await se.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!_())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===_().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",!ie(t))throw new Error(`Invalid cache location "${t}"`);n=ie(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Q:q,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:$;var o;this.scope=B("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new K(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||b,this.cacheManager=new j(n,n.allKeys?void 0:new re(n,this.options.clientId),this.nowProvider),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),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new te)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||S)));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(U(r)),a={__raw:e},s={};return Object.keys(i).forEach((e=>{a[e]=i[e],W.includes(e)||(s[e]=i[e])})),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(U(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&&!Y(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||!Y(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Y(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&&Y(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){const r=P(x()),o=P(x()),i=x(),a=(e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,(e=>t[e]))})(window.btoa(String.fromCharCode(...Array.from(t))))})(await(async e=>{const t=_().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t})(i)),s=((e,t,n,r,o,i,a,s)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:B(t,n.scope),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"}))(this.options,this.scope,e,r,o,a,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode),c=this._authorizeUrl(s);return{nonce:o,code_verifier:i,scope:s.scope,audience:s.audience||"default",redirect_uri:s.redirect_uri,state:r,url:c}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const 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 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),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=ae(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}),s&&{organization:s}));const h=o?`${u}#${o}`:u;r?await r(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const{state:n,code:r,error:o,error_description:i}=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join("")),a=this.transactionManager.get();if(!a)throw new I("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new N(o,i||o,n,a.appState);if(!a.code_verifier||a.state&&a.state!==n)throw new I("state_mismatch","Invalid state");const s=a.organization,c=a.nonce,u=a.redirect_uri;return await this._requestToken(Object.assign({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:r},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:a.appState}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t;const n=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:B(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope)})}),r=await((e,t)=>{let n=ne[t];return n||(n=e().finally((()=>{delete ne[t],n=null})),ne[t]=n),n})((()=>this._getTokenSilently(n)),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return e.detailedResponse?r:null==r?void 0:r.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});if(e)return e}if("cache-only"!==t){if(!await(async(e,t=3)=>{for(let n=0;nse.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new O;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"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,access_token:o,oauthTokenScope:i,expires_in:a}=e;return Object.assign(Object.assign({id_token:r,access_token:o},i?{scope:i}:null),{expires_in:a})}finally{await se.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(e={},t={}){var n;const r=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:B(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope)})});return t=Object.assign(Object.assign({},A),t),await this.loginWithPopup(r,t),(await this.cacheManager.get(new X({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).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?${G(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){const t=ae(e),{openUrl:n}=t,r=g(t,["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@@");const o=this._buildLogoutUrl(r);n?await n(o):!1!==n&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url: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);try{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 n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let l;try{l=new URL(this.domainUrl).origin}catch(e){l=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 O),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,l,n);if(o!==h.state)throw new I("state_mismatch","Invalid state");const d=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({},d),{scope:c,oauthTokenScope:d.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new X({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new R(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;try{const o=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}));return Object.assign(Object.assign({},o),{scope:e.authorizationParams.scope,oauthTokenScope:o.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}}async _saveEntryInCache(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=await this.cacheManager.getIdToken(new X({clientId:this.options.clientId,audience:e,scope:this.scope})),n=this.userCache.get("@@user@@");return t&&t.id_token===(null==n?void 0:n.id_token)?n:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:e,audience:t,clientId:n}){const r=await this.cacheManager.get(new X({scope:e,audience:t,clientId:n}),60);if(r&&r.access_token){const{access_token:e,oauthTokenScope:t,expires_in:n}=r,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,access_token:e},t?{scope:t}:null),{expires_in:n})}}async _requestToken(e,t){const{nonceIn:n,organization:r}=t||{},o=await async function(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s}=e,c=g(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u="urn:ietf:params:oauth:grant-type:token-exchange"===c.grant_type,l=Object.assign(Object.assign(Object.assign({},c),u&&o&&{audience:o}),u&&i&&{scope:i}),h=s?G(l):JSON.stringify(l);return await async function(e,t,n,r,o,i,a){let s,c=null;for(let u=0;u<3;u++)try{s=await D(e,n,r,o,i,a,t),c=null;break}catch(e){c=e}if(c)throw c;const u=s.json,{error:l,error_description:h}=u,d=g(u,["error","error_description"]),{ok:f}=s;if(!f){const t=h||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===l)throw new C(l,t,d.mfa_token);if("missing_refresh_token"===l)throw new R(n,r);throw new I(l||"request_error",t)}return d}(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:h,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||S))}},t,s)}(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},e),this.worker),i=await this._verifyIdToken(o.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}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:B(e.scope,this.scope),audience:e.audience||this.options.authorizationParams.audience})}}var ue=n(2505),le=n.n(ue);const he={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"};var de,fe,pe,ge,me,we;function ve(){ve=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var ye=function(){var e=window.location.href;return new URL(e)},Ee=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]&&arguments[0],t=ye().hostname;e&&"string"==typeof e&&(t=e);var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},Se=function(){var e=Ae();return".".concat(e)},be=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(i.log("Setting cookie with options: ",n),Object.entries(n).forEach((function(e){var t=u(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},Ie=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=Ae(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach((function(e){var t=u(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,";")}))},Ne=function(e){return p(e)},Oe=function(e){return(de=de||r(ve().mark((function e(t){var n,r;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ae().split(".")[0],e.prev=1,e.next=4,le()({method:"get",url:"".concat(o.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 4:if(!(r=e.sent).data){e.next=8;break}return i.log("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 8:return e.abrupt("return",!1);case 11:return e.prev=11,e.t0=e.catch(1),i.log("Apple Sub Check: Request Failure: ",e.t0),e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)},Te=function(e){return(fe=fe||r(ve().mark((function e(t){var n;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le()({method:"get",url:"".concat(o.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":o.A.entitlementsApiKey}});case 2:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Le=function(){return"complete"===document.readyState},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){var n=!0;if(Le())t();else{i.log("UIHandler: ","Waiting for the body to load...");var o=setInterval(r(ve().mark((function r(){return ve().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=Le()),document.querySelector("body")&&n&&(clearInterval(o),t(!0));case 2:case"end":return r.stop()}}),r)}))),200)}}))},Re=function(){return new Promise((function(e){i.log("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},(function(){i.log("blueConicReady | onReady fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),i.log("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)}),3e3)}))},ke=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){i.log("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout((function(){clearTimeout(n),i.log("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?(i.log("blueConicLoaded | BC object already loaded"),e?t(Re()):(clearTimeout(n),t())):(i.log('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(ve().mark((function r(){var o;return ve().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i.log("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=10;break}return i.log("blueConicLoaded | waiting for blueConicReady..."),r.next=5,Re();case 5:o=r.sent,clearTimeout(n),t(o),r.next=12;break;case 10:clearTimeout(n),t();case 12:case"end":return r.stop()}}),r)}))),!1))}))},_e=function(){return(pe=pe||r(ve().mark((function e(){return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke(!0);case 2:if(!e.sent){e.next=10;break}return e.next=6,new Promise((function(e){i.log("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(i.log("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},(function(){i.log("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),i.log("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)}),3e3)}));case 6:if(e.sent){e.next=9;break}return e.abrupt("return",!1);case 9:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},xe=function(){return(ge=ge||r(ve().mark((function e(){var t,n,r,o,a,s,c,u=arguments;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]&&u[0],n=!1,o=["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=5,ke(!0);case 5:if(!e.sent){e.next=15;break}if(a=window.blueConicClient.getSegments(),i.log("bcLowaCheck | BC segments for users: ",a),!(a.filter((function(e){return o.includes(e.name)})).length>0)){e.next=15;break}return e.next=13,_e();case 13:(s=e.sent)&&(n=!0,r=s);case 15:return t&&n&&Pe(),c={isSub:n},r&&(c.uuid=r),e.abrupt("return",c);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Pe=function(){be("bc_lowa_status",1,{path:"/",domain:Se(),expires:7,secure:!0})},Ge=function(){return new Promise((function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(i.log("utils.js | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(i.log("utils.js | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",(function(n){try{var r=n.detail||{};i.log("utils.js | Event: authentication ready: ",r),e(r)}catch(e){i.log(e),t(e)}}),!1))}))},Ue=function(){return(me=me||r(ve().mark((function e(){return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){return o.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(i.log("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,i.log("Received entitlementsReady event:",r),e(r)}catch(e){i.error("Error handling entitlementsReady event:",e),t(e)}}),{once:!0}):(i.log("Entitlements disabled in settings."),void e(!1))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Me=function(){Ie(he.AUTH0_SUB_COOKIE_KEY),Ie("mng-jwt-decoded"),localStorage.removeItem(he.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){i.log("Clearing entitlements...");try{Ie(he.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){i.log("Failed to delete legacy cookie: ",e)}try{Ie(he.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:Ae(),expires:365,secure:!0})}catch(e){i.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(he.LOCAL_STORAGE_SESSION_KEY)}catch(e){i.log("Failed to remove local storage: ",e)}}()},De=function(){var e=ye();return!["local","develop","preprod","trbdev"].some((function(t){return e.origin.includes(t)}))},Be=function(e){i.log("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),i.log("Storage Object removed : ",e))},Xe=function(e){i.log("starting simpleEmailValidation");var t=new RegExp(/^(([^<>()[\]\\.,;:\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);if(!e)return{valid:!1,message:"Please enter an email."};if(!t.test(e))return{valid:!1,message:"Please enter a valid email."};var n=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),r=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(n);return i.log("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex((function(t){return t===e.split("@")[1]}))?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Xe;var Fe;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var He=function(){return(we=we||r(ve().mark((function e(){var t,n;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Fe){e.next=2;break}return e.abrupt("return",Fe);case 2:return t=o.A.auth0Domain,n=o.A.auth0ClientId,Fe=new ce({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",Fe);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},je=function(e){i.log("utils.js | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,i.log("Utils.js | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),i.log("Utils.js | Dispatched authenticationReady event!")},Ke=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 i.log("checkOneTapOptions: enabled options",n),n.length>0}return!1},Ye=function(e){return Number.isInteger(Number(e))};var We=function(e){o.A.datadogEnabled&&window.DD_RUM.addTiming(e)};var Ve,Ze,Je,ze,Qe,qe,$e,et;function tt(){tt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var nt=function(){return(Ve=Ve||r(tt().mark((function e(){return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke();case 2:return e.next=4,Ge();case 4:return e.abrupt("return",new Promise((function(e){i.log("ANALYTICS: inside BCregwall events");var t=ye();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 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},rt=function(e){return(Ze=Ze||r(tt().mark((function e(t){var n,r,o,a,s;return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{void 0!==(n=Ne(t))&&n&&(i.log("ANALYTICS: Partner Access: JWT found"),r=n.entitlement_entitled,o=n.entitlement_source,a=n.entitlement_organizationTrackingId,s=n.entitlement_organizationType,i.log("ANALYTICS: Partner Access Event: Entitled: ".concat(r," and source: ").concat(o)),r&&"partner-access"===o&&(i.log("ANALYTICS: GA event for partner access"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"partnerAccess",partner:"".concat(a,"|").concat(s)})))}catch(e){i.log("ANALYTICS: Failed to send Partner Access event: ",e)}case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},ot=function(){return(Je=Je||r(tt().mark((function e(){return tt().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"}),i.log("ANALYTICS: GA/ datalayer ",window.dataLayer),localStorage.removeItem("regwallEvent"))}catch(e){i.log("ANALYTICS: Failed to send Regwall Succuss Event: ",e)}case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},it=function(e,t){return(ze=ze||r(tt().mark((function e(t,n){var r,o;return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.entitlements&&(r=Ne(n.entitlements.token)),i.log("ANALYTICS: user state variables are: ",t,n.userState),o="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",i.log("ANALYTICS: user state is ",o),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Auth0State_event",Auth0State:o});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},at=function(){return(Qe=Qe||r(tt().mark((function e(){var t,n,r;return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ge();case 3:n=e.sent,r=n.isAuthenticated,e.t0=r,e.next=!0===e.t0?8:!1===e.t0?10:e.t0===he.USER_IS_LOWA?12:14;break;case 8:return t="known",e.abrupt("break",16);case 10:return t="unknown",e.abrupt("break",16);case 12:return t=he.USER_IS_LOWA,e.abrupt("break",16);case 14:return t="unknown-default",e.abrupt("break",16);case 16:return e.abrupt("return",t);case 19:return e.prev=19,e.t1=e.catch(0),i.log("ANALYTICS: Error during onAuthReadyAnalytics: ",e.t1),e.abrupt("return","unknown-fail");case 23:case"end":return e.stop()}}),e,null,[[0,19]])})))).apply(this,arguments)},st=function(e){try{window.dataLayer.push({event:e}),i.log("ANALYTICS: ".concat(e," event")),i.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){i.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}},ct=function(e){try{var t={};Object.keys(e).forEach((function(n){t[n]=e[n]})),0!==Object.keys(t).length&&window.dataLayer.push(t),i.log("ANALYTICS: ".concat(e.event," event")),i.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){i.log("ANALYTICS: Failed to send ".concat(e.event," event: "),t)}},ut=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(Ye(window.authentication_config["got".concat(t,"GroupTime")])?parseInt(window.authentication_config["got".concat(t,"GroupTime")],10):1);break;default:return n.event}return n},lt=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=Ke("GroupEnabled"),a=Ke("GroupDelayEnabled"),s=Ke("GroupTimeDelayEnabled"),c=Ke("got".concat(n,"GroupEnabled")),u=Ke("got".concat(r,"GroupDelayEnabled")),l=Ke("got".concat(n,"GroupTimeDelayEnabled")),h=/Windows|Macintosh|Mac OS X|Linux/.test(navigator.userAgent),n&&o&&c&&!a&&h&&!s?(i.log("ANALYTICS: Position event enabled"),ct(ut("placement",n))):r&&!o&&a&&u&&!s?(i.log("ANALYTICS: Scroll delay enabled"),ct(ut("scrolling",r))):n&&!o&&!a&&s&&l?(i.log("ANALYTICS: Time delay enabled"),ct(ut("delayTime",n))):(i.log("ANALYTICS: No custom event detected"),st(ut("default")))):st(t)}catch(e){i.log("ANALYTICS: Event not setup",e)}var n,r,o,a,s,c,u,l,h},ht=function(){return(qe=qe||r(tt().mark((function e(){var t,n,r,o,a;return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=!1,e.next=4,Ue();case 4:if(!(n=e.sent)||!n.token){e.next=12;break}return r=n.token,o=n.isEntitled,a=n.adfree,i.log("ANALYTICS: entitlements options: ",o,a),!0===a&&i.log("ANALYTICS: user state: found ad free",a),!0===o?(i.log("ANALYTICS: user state: found subscriber"),t="subscriber"):(i.log("ANALYTICS: user state: LINA"),t="lina"),rt(r),e.abrupt("return",{userState:t,entitlements:n});case 12:return e.abrupt("return","noEntitlements");case 15:return e.prev=15,e.t0=e.catch(0),i.log("ANALYTICS:",e.t0),e.abrupt("return","entitlementError");case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))).apply(this,arguments)},dt=function(){return($e=$e||r(tt().mark((function e(){return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ke();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)};const ft={onLoadAnalytics:function(){return(et=et||r(tt().mark((function e(){var t,n,r;return tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("ANALYTICS: Start Analytics"),ot(),window.MNGAuthentication.postAuthEvents=[],window.MNGAuthentication.preAuthGTMEvents=[],window.MNGAuthentication.postAuthEvents.push(lt),!((t=ye()).pathname.startsWith("/logout")||t.pathname.startsWith("/login")||t.pathname.startsWith("/callback"))){e.next=8;break}return e.abrupt("return");case 8:return dt(),e.next=11,at();case 11:return n=e.sent,e.next=14,ht();case 14:r=e.sent,it(n,r);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)},blueConicRegwallEvents:nt,callPreparedGTMEvent:st,callCustomGTMEvent:ct};var pt,gt,mt,wt,vt,yt;function Et(){Et=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var At,St,bt,It,Nt,Ot,Tt,Lt=function(){try{var e=localStorage.getItem(he.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){i.log("Unable to get session from local storage: ",e)}return"{}"},Ct=function(e){try{i.log("Setting local storage session",e),localStorage.setItem(he.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){i.log("Unable to save session from local storage: ",e)}},Rt=function(e){try{be(he.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Se(),expires:365,secure:!0})}catch(e){i.log("Unable to save session to cookie storage: ",e)}},kt=function(){return(pt=pt||r(Et().mark((function e(){var t,n,r,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E;return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.A.sessionServer,n="".concat(t,"/api/session"),i.log("Checking server session: ",n),e.next=5,le().get(n,{withCredentials:!0});case 5:if(!(r=e.sent).data){e.next=17;break}return h=r.data.entitlementTokenDecoded,d=r.data,f=d.accessToken,p=d.idToken,g=d.entitlementToken,m=null!==(a=null==h?void 0:h.entitlement_expiry)&&void 0!==a?a:null,w=null!==(s=null==h?void 0:h.entitlement_source)&&void 0!==s?s:null,v=null!==(c=null==h?void 0:h.entitlement_entitled)&&void 0!==c?c:null,y=null!==(u=null==h?void 0:h.entitlement_extras_adfree)&&void 0!==u?u:null,E=null!==(l=null==h?void 0:h.entitlement_level)&&void 0!==l?l:null,Ct(JSON.stringify({accessToken:f,idToken:p,entitlementToken:g,expiration:m,entitlementSource:w,isEntitled:v,adFree:y,entitlementLevel:E})),""!==g&&"string"==typeof g&&Rt(g),e.abrupt("return",{accessToken:f,idToken:p,entitlementToken:g,expiration:m,entitlementSource:w,isEntitled:v,adFree:y,entitlementLevel:E});case 17:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)},_t=function(e){return(gt=gt||r(Et().mark((function e(t){var n,r;return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=o.A.sessionServer,r="".concat(n,"/api/session"),i.log("Updating server session: ",r),e.next=6,le().post(r,t,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),i.log("Failed to update session server: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},xt=function(){return(mt=mt||r(Et().mark((function e(){var t,n;return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=o.A.sessionServer,n="".concat(t,"/api/session"),i.log("Deleting server session: ",n),e.next=6,le().delete(n,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),i.log("Failed to delete server session: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},Pt=function(){return(wt=wt||r(Et().mark((function e(){var t,n,r,o,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S,b,I,N,O,T,L;return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Inside getSession"),e.prev=1,l=Lt(),i.log("Session: __MNG_Session = ",l),h=JSON.parse(l),d=h.accessToken,f=h.idToken,p=h.entitlementToken,g=h.expiration,m=h.entitlementSource,w=h.isEntitled,v=h.adFree,y=h.entitlementLevel,n=d,t=f,r=p,o=g,a=m,s=w,c=v,u=y,i.log("Session: check both tokens: ",t,r),void 0!==f&&void 0!==p&&null!==f&&null!==p){e.next=35;break}return i.log("Session: missing id or entitlements, try session server"),e.next=18,kt();case 18:E=e.sent,A=E.accessToken,S=E.idToken,b=E.entitlementToken,I=E.expiration,N=E.entitlementSource,O=E.isEntitled,T=E.adFree,L=E.entitlementLevel,n=A,t=S,r=b,o=I,a=N,s=O,c=T,u=L;case 35:e.next=40;break;case 37:e.prev=37,e.t0=e.catch(1),i.log("Failed to get session: ",e.t0);case 40:return i.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:o,entitlementSource:a,isEntitled:s,adFree:c,entitlementLevel:u});case 42:case"end":return e.stop()}}),e,null,[[1,37]])})))).apply(this,arguments)},Gt=function(e){return(vt=vt||r(Et().mark((function e(t){var n,r,o,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S,b,I,N,O,T,L,C,R;return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Lt(),r=JSON.parse(n),o=r.accessToken,a=void 0===o?null:o,s=r.idToken,c=void 0===s?null:s,u=r.entitlementToken,l=void 0===u?null:u,h=r.expiration,d=void 0===h?null:h,f=r.entitlementSource,p=void 0===f?null:f,g=r.isEntitled,m=void 0===g?null:g,w=r.adFree,v=void 0===w?null:w,y=r.entitlementLevel,E=void 0===y?null:y,A=t.accessToken,S=t.idToken,b=t.entitlementToken,I=t.expiration,N=t.entitlementSource,O=t.isEntitled,T=t.adFree,L=t.entitlementLevel,C={accessToken:null==A?a:A,idToken:null==S?c:S,entitlementToken:null==b?l:b,expiration:null==I?d:I,entitlementSource:null==N?p:N,isEntitled:null==O?m:O,adFree:null==T?v:T,entitlementLevel:null==L?E:L},i.log("Current session data: ",r),i.log("New session data: ",t),i.log("Updated session data:",C),R=JSON.stringify(C),Ct(R),""!==C.entitlementToken&&"string"==typeof C.entitlementToken&&Rt(C.entitlementToken),n===R){e.next=15;break}return e.next=15,_t(C);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),i.log("Unable to save session: ",e.t0);case 20:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)},Ut=function(){return(yt=yt||r(Et().mark((function e(){return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Ending session..."),Me(),e.next=4,xt();case 4:localStorage.removeItem(he.LOCAL_STORAGE_SESSION_KEY);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)};function Mt(){Mt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var Dt=function(){return"logout"===(ye().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var Bt=function(e){return(At=At||r(Mt().mark((function e(t){var n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,He();case 2:n=e.sent,i.log("Calling Auth0 logout..."),n.logout({returnTo:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Xt=function(){i.log("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){i.log("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=/")}},Ft=function(){return(St=St||r(Mt().mark((function e(){var t,n,o,a,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Attempting to logout..."),Xt(),!window.authentication_config.sessionManagementEnabled){e.next=7;break}return e.next=5,Ut();case 5:e.next=8;break;case 7:Me();case 8:return e.prev=8,i.log("Cycling through logout callbacks..."),t=window.MNGAuthentication.logoutCallbacks.map((function(e){return e()})),e.next=13,Promise.all(t);case 13:i.log("Finished cycling through logout callbacks."),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(8),i.log("Failed to cycle through logout callbacks: ",e.t0);case 19:Object.keys(window.localStorage).filter((function(e){return e.includes("auth0")})).forEach((function(e){window.localStorage.removeItem(e),i.log("Removed Auth0 storage object...")})),Be("hhsl"),Be("userNewsLetterData"),Be(he.REGWALL_USER_IS_SUBSCRIBED),Be(he.USER_PROFILE_HASH),n=ye(),o=window.location.origin;try{n.searchParams.get("returnURL")&&(a=decodeURIComponent(n.searchParams.get("returnURL")),o=a)}catch(e){i.log(e),o=window.location.origin}return o=new URL(o),e.next=31,window.ConnextUtils.connextReady();case 31:if(!e.sent){e.next=63;break}if(i.log("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),i.log("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),s=o,o.origin!==window.location.origin&&(s=new URL(window.location.origin)).searchParams.append("returnAfterLogout",o),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",s),!De()){e.next=44;break}i.log("About to call Connext Logout..."),setTimeout((function(){Connext.Logout()}),500),e.next=61;break;case 44:if("Logged In"!==("undefined"==typeof CnnXt?(i.log("Connext was not loaded."),!1):Connext.Storage.GetUserState())){e.next=58;break}if(i.log("Connext user state is logged in, setting timeout..."),setTimeout(r(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Connext took too long to logout, calling auth0 logout..."),e.next=3,Bt(o);case 3:case"end":return e.stop()}}),e)}))),8e3),"function"!=typeof Connext._logout){e.next=53;break}return i.log("About to call Connext _logout..."),e.next=51,Connext._logout();case 51:e.next=56;break;case 53:return i.log("About to call Connext Logout..."),e.next=56,Connext.Logout();case 56:e.next=61;break;case 58:return i.log("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=61,Bt(o);case 61:e.next=66;break;case 63:return i.log("Connext Logout was NOT called"),e.next=66,Bt(o);case 66:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)},Ht=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},jt=function(e,t,n,o,a){return(bt=bt||r(Mt().mark((function e(t,n,r,o,a){var s,u,l,h,d,f,p,g,m,w,v,y,E;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Attempting to login..."),Ht()>4.5&&window.localStorage.clear(),window.MNGAuthentication.preAuthGTMEvents.forEach((function(e){return st(e)})),i.log("Cycled through preauth GTM events."),o&&(s=[],u=window.localStorage.getItem("callbackEvents"),l=JSON.parse(u),s=l&&l.length>0?c(new Set([].concat(c(o),c(l)))):o,window.localStorage.setItem("callbackEvents",JSON.stringify(s))),h=null,e.next=7,He();case 7:if(d=e.sent,f=ye(),p=f.origin,g=new URL("".concat(p,"/callback")),m={},f.searchParams.get("regwall")&&(f.searchParams.get("returnUrl")&&(w=f.searchParams.get("returnUrl")),f.searchParams.get("auth_redirect")&&(w=f.searchParams.get("auth_redirect"))),f.pathname.startsWith("/login")||f.pathname.startsWith("/callback")?f.searchParams.get("returnUrl")?g.searchParams.set("auth_redirect",f.searchParams.get("returnUrl")):a&&g.searchParams.set("auth_redirect",a):g.searchParams.set("auth_redirect",f.toString()),w&&"regwall"!==t&&g.searchParams.set("auth_redirect",w),"true"===f.searchParams.get("close-after-finish")&&g.searchParams.set("close-after-finish","true"),"true"!==f.searchParams.get("ssl")){e.next=23;break}if(!window.authentication_config.sessionManagementEnabled){e.next=22;break}return e.next=20,Ut();case 20:e.next=23;break;case 22:Me();case 23:return null!==(h=f.searchParams.get("login-with"))?m.connection=h:n&&(m.connection=n),v="none",t&&"regwall"===t&&(g.searchParams.set("regwall","true"),v="signUp",i.log("Logging in with regwall")),t&&(g.searchParams.set("loginsource",t),i.log("Logging in with ".concat(t))),r&&(m.login_hint=r),m.redirect_uri=g.toString(),m.initialScreen=v,"googleonetap"!==t&&(m.prompt="select_account"),null!==(y=f.searchParams.get("ampRegiWall"))&&(E=window.location.hostname,m.ampRegiWall=y,m.sourceDomain=E.replace("www.","").replace("preprod.","").replace("develop.",""),m.initialScreen="signUp",m.preferenceId=f.searchParams.get("prefId")),e.next=36,d.loginWithRedirect({authorizationParams:m});case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Kt=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();i.log("Adding listeners to events we need to wait for...");var o=r.map((function(e){return t=e,new Promise((function(e){i.log("Adding event to wait for: ",t),window.addEventListener(t,(function(n){try{var r=n.detail||{};i.log("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){i.log(t),e()}}),!1)}));var t}));Promise.all(o).then((function(){clearTimeout(t),e()}))}catch(t){i.log("Failed to wait for callback events",t),e()}}))};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var Yt=function(){return(It=It||r(Mt().mark((function e(){var t,n,o,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S,b;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Xt(),t=ye(),n=!1,o=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),a=t.searchParams.get("redirect_uri")||"",a.includes("applenews")?(i.log("This is Apple prelogin flow."),(s=new URL(a))?(s.searchParams.append("post-apple-login","true"),i.log("Post callback Apple redirect URL is ".concat(s)),jt(!1,!1,!1,[],s)):jt()):o.includes("post-apple-login")&&(i.log("This is Apple Callback flow."),n=!0,(c=new URL(decodeURIComponent(o))).searchParams.delete("post-apple-login"),o=c),i.log("Handling post login callback..."),!(u=t.searchParams.get("error_description"))){e.next=13;break}if("shouldAutoLogin"!==u){e.next=12;break}return e.abrupt("return",jt(!1,!1,!1,!1,o));case 12:n&&alert("There was an error in logging you in, please try again.");case 13:return e.next=15,He();case 15:return l=e.sent,e.next=18,l.handleRedirectCallback();case 18:return e.next=20,l.getIdTokenClaims();case 20:return h=e.sent,e.next=23,l.getUser();case 23:return d=e.sent,i.log("Auth0 user profile: ",d),f=h.__raw,e.next=28,l.getTokenSilently();case 28:return p=e.sent,e.prev=29,i.log("Cycling through login callbacks..."),e.next=33,Kt();case 33:return m=window.MNGAuthentication.oidcLoginCallbacks.map((function(e){return(g=g||r(Mt().mark((function e(t){return Mt().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)})))).apply(this,arguments)})),e.next=36,Promise.all(m);case 36:i.log("Finished cycling through login callbacks."),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(29),i.log("Failed to cycle through login callbacks: ",e.t0);case 42:if(w={accessToken:p,userId:d.sub,email:d.email,picture:d.picture},v=!1,y="",!n){e.next=61;break}return e.prev=46,e.next=49,Te(w.userId);case 49:return y=e.sent,i.log("Encrypted apple uuid is: ".concat(y)),e.next=53,Oe(y);case 53:v=e.sent,i.log("Apple sub status is: ".concat(v)),e.next=61;break;case 57:e.prev=57,e.t1=e.catch(46),i.log("Apple sub check error: ".concat(e.t1)),alert("There was an error in logging you in, please try again.");case 61:if(Be(he.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=66;break}return i.log("Saving idToken to session server"),e.next=66,Gt({idToken:f,accessToken:p});case 66:if(!t.searchParams.get("close-after-finish")){e.next=68;break}return e.abrupt("return",window.close());case 68:if(!t.search.includes("loginsource")){e.next=73;break}return A=t.searchParams.get("loginsource"),S=window.MNGAuthentication.postAuthEvents.map((function(e){return(E=E||r(Mt().mark((function e(t){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(A));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)})),e.next=73,Promise.all(S);case 73:return e.prev=73,b=new URL(o),n&&v&&b.searchParams.append("access_token",y),i.log("Apple redirect URL:",b),e.abrupt("return",window.location.assign(b));case 80:e.prev=80,e.t2=e.catch(73),i.log("Failed to redirect after authentication: ",e.t2);case 83:return window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 85:case"end":return e.stop()}}),e,null,[[29,39],[46,57],[73,80]])})))).apply(this,arguments)},Wt=function(){return(Nt=Nt||r(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("ANALYTICS: fireBC events"),e.next=3,nt();case 3:i.log("ANALYTICS: bc values should be filled");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Vt=function(){return(Ot=Ot||r(Mt().mark((function e(){var t,n,r,o,a,s,c,u,l,h,d,f,p;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ge();case 2:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=18;break}return e.prev=6,s=Ne(n),c=s.email,u=s.picture,l=s.sub,h=s.name,d=s.nickname,f=s.connection_source,p=null===(o=s.user_metadata)||void 0===o||null===(a=o.customProfile)||void 0===a?void 0:a.nickname,l.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:p||d||h,email:c,picture:u,userId:l,connectionSource:f});case 15:e.prev=15,e.t0=e.catch(6),i.log("Unable to parse idToken: ",n," Error: ",e.t0);case 18:return e.abrupt("return",{authenticated:r});case 19:case"end":return e.stop()}}),e,null,[[6,15]])})))).apply(this,arguments)};window.MNGAuthentication.login=jt,window.MNGAuthentication.logout=Ft,window.MNGAuthentication.getUserInfo=Vt;var Zt=function(){return(Tt=Tt||r(Mt().mark((function t(){var n,a,s,c,u,l,h,d,f,p,g,m,w;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=ye(),s=!1,c="",u=!1,l={},Dt()&&window.ConnextUtils.rerunConnextEntitlements(!0),a.searchParams.get("returnAfterLogout")&&(h=decodeURIComponent(a.searchParams.get("returnAfterLogout")),window.location.assign(h)),a.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),d=function(){return(n=n||r(Mt().mark((function t(){var n,r;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,He();case 3:return n=t.sent,t.next=6,n.getIdTokenClaims();case 6:return l=t.sent,t.next=9,n.isAuthenticated();case 9:if(s=t.sent,c="object"===e(l)?l.__raw:"",r=Ee(he.ENTITLEMENT_COOKIE_KEY),s||!r){t.next=16;break}return t.next=15,n.getTokenSilently();case 15:u=t.sent;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(0),i.log("Unable to verify user has active auth0 session: ",t.t0);case 21:case"end":return t.stop()}}),t,null,[[0,18]])})))).apply(this,arguments)},!a.pathname.startsWith("/logout")){t.next=14;break}return i.log("Page is logout. Routing to logout function..."),t.next=13,Ft();case 13:return t.abrupt("return");case 14:if(!window.authentication_config.sessionManagementEnabled){t.next=40;break}return t.next=17,d();case 17:if(""===c){t.next=26;break}if(f=null,p=JSON.parse(window.localStorage.getItem(he.LOCAL_STORAGE_SESSION_KEY)),"{}"!==Lt()){t.next=24;break}return p&&(f=p.jwt),t.next=24,Gt({idToken:c,entitlementToken:f});case 24:t.next=38;break;case 26:return t.prev=26,t.next=29,Pt();case 29:g=t.sent,c=g.idToken,(s="string"==typeof c)&&(l=Ne(c)),t.next=38;break;case 35:t.prev=35,t.t0=t.catch(26),i.log("Unable to initialize session: ",t.t0);case 38:t.next=42;break;case 40:return t.next=42,d();case 42:if(s||u||!o.A.blueconicEnabled||!o.A.bcLowaSegements){t.next=47;break}return t.next=45,xe(!0);case 45:(m=t.sent).isSub&&(s=he.USER_IS_LOWA,l={sub:m.uuid});case 47:if(je({isAuthenticated:s,idToken:c,accessToken:u,claims:l}),We("authenticationReady"),!0===s?(i.log("User is authenticated."),a.searchParams.get("auth_redirect")&&(i.log("Auth Redirect is present, sending user to auth redirect..."),(w=a.searchParams.get("auth_redirect")).endsWith("#")&&(w=w.slice(0,w.length)),window.location.assign(w)),a.pathname.startsWith("/login")&&!Dt()&&(i.log("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(a.origin))):i.log("User is not authenticated."),a.pathname.startsWith("/login")&&!Dt()?(i.log("Page is login. Attempting to log user in..."),jt()):i.log("Page is not login or Connext state is present"),!a.pathname.startsWith("/callback")||!a.searchParams.get("regwall")){t.next=60;break}return i.log("Page is callback with regwall param. Routing to regwall receiver..."),t.next=56,Wt();case 56:i.log("Now login from regwall"),jt(),t.next=64;break;case 60:if(!a.pathname.startsWith("/callback")){t.next=64;break}return i.log("Page is callback without regwall param. Routing to callback receiver..."),t.next=64,Yt();case 64:case"end":return t.stop()}}),t,null,[[26,35]])})))).apply(this,arguments)};window.MNGAuthentication.init=Zt;const Jt={init:Zt};var zt=function(e,t){return new Promise((function(n){try{"undefined"==typeof CnnXt&&(i.log("Connext was not loaded."),n(!1)),i.log("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(){i.log("Signed user up to newsletter: ",t),n(!0)},onError:function(e){i.log("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){i.log("subscribeToNewsletter Error:",e),n(!1)}}))};var Qt,qt,$t;function en(){en=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var tn=function(e){return(Qt=Qt||r(en().mark((function e(t){var n;return en().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Google token ",t),n=Ne(t.credential),e.prev=2,st("one_tap_click"),localStorage.setItem("regwallSuccess","yes"),!o.A.newsletterId){e.next=9;break}return i.log("About to call Connext's subscribeToNewsletter function"),e.next=9,zt(n.email,o.A.newsletterId);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),i.log("Error: ",e.t0);case 14:return i.log("About to login with onetap flow..."),e.next=17,window.MNGAuthentication.login("googleonetap",o.A.useTribMainGoogle?"Trib-Google":"google-oauth2",n.email);case 17:case"end":return e.stop()}}),e,null,[[2,11]])})))).apply(this,arguments)},nn=function(){return(qt=qt||r(en().mark((function e(){return en().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:google.accounts.id.initialize({client_id:o.A.googleClientId,callback:tn,auto_select:!1,cancel_on_tap_outside:!1}),i.log("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"),st(t)}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)};const rn={init:function(){return($t=$t||r(en().mark((function e(){var t,n,r,a,s;return en().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.A.oneTapEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Ge();case 4:if(t=e.sent,n=t.isAuthenticated,r=ye(),n!==he.USER_IS_LOWA){e.next=15;break}return e.next=10,_e();case 10:if(!(a=e.sent)||a.includes("google")){e.next=13;break}return e.abrupt("return");case 13:e.next=17;break;case 15:if(!(n||r.pathname.startsWith("/login")||r.pathname.startsWith("/logout")||r.pathname.startsWith("/callback"))){e.next=17;break}return e.abrupt("return");case 17:return e.next=19,Ce();case 19:return i.log("onetap loading..."),s=new Date,e.next=23,nn(s);case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}};var on;function an(){an=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,b=S&&S(S(_([])));b&&b!==r&&o.call(b,s)&&(A=b);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function O(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}!function(){(on=on||r(an().mark((function e(){return an().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Settings: ",o.A),Jt.init(),ft.onLoadAnalytics(),e.next=5,rn.init();case 5:case"end":return e.stop()}}),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={1928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},2012:(e,t,n)=>{"use strict";var r=n(9516),o=["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"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},2505:(e,t,n)=>{e.exports=n(8015)},2881:(e,t,n)=>{"use strict";var r=n(9516),o=n(6987);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},3191:(e,t,n)=>{"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},3864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3948:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4202:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4490:(e,t,n)=>{"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(6987),s=n(1928);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},4680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4841:(e,t,n)=>{"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},5019:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},5155:(e,t,n)=>{"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),s=n(5343),c=n(4841),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var h=e;n.length;){var d=n.shift(),f=n.shift();try{h=d(h)}catch(e){f(e);break}}try{o=a(h)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=l},5343:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},5449:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5592:(e,t,n)=>{"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),s=n(9615),c=n(2012),u=n(4202),l=n(7763),h=n(6987),d=n(1928);e.exports=function(e){return new Promise((function(t,n){var f,p=e.data,g=e.headers,m=e.responseType;function w(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}r.isFormData(p)&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(y+":"+E)}var A=s(e.baseURL,e.url);function S(){if(v){var r="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v};o((function(e){t(e),w()}),(function(e){n(e),w()}),i),v=null}}if(v.open(e.method.toUpperCase(),a(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=S:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(S)},v.onabort=function(){v&&(n(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){n(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||h.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},r.isStandardBrowserEnv()){var O=(e.withCredentials||u(A))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;O&&(g[e.xsrfHeaderName]=O)}"setRequestHeader"in v&&r.forEach(g,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(e){v&&(n(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),p||(p=null),v.send(p)}))}},6987:(e,t,n)=>{"use strict";var r=n(9516),o=n(7018),i=n(5449),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},7018:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},7522:(e,t,n)=>{"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},7763:(e,t,n)=>{"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},7980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8015:(e,t,n)=>{"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343);var s=function e(t){var n=new i(t),s=o(i.prototype.request,n);return r.extend(s,i.prototype,n),r.extend(s,n),s.create=function(n){return e(a(t,n))},s}(n(6987));s.Axios=i,s.Cancel=n(1928),s.CancelToken=n(3191),s.isCancel=n(3864),s.VERSION=n(9641).version,s.all=function(e){return Promise.all(e)},s.spread=n(7980),s.isAxiosError=n(5019),e.exports=s,e.exports.default=s},8805:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={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,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}},9012:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},9516:(e,t,n)=>{"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},9641:e=>{e.exports={version:"0.24.0"}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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),(()=>{"use strict";function e(t){return e="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(t)}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)}))}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function u(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(c(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return c(t)}}function l(e){this.message=e}l.prototype=new Error,l.prototype.name="InvalidTokenError";const h=function(e,t){if("string"!=typeof e)throw new l("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(u(e.split(".")[n]))}catch(e){throw new l("Invalid token specified: "+e.message)}};function d(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,m.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),m.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 A extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,A.prototype)}static fromPayload({error:e,error_description:t}){return new A(e,t)}}class S extends A{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,S.prototype)}}class O extends A{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,O.prototype)}}class I extends O{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,I.prototype)}}class N extends A{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class b extends A{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,b.prototype)}}class T extends A{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${L(e,["default"])}', scope: '${L(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,T.prototype)}}function L(e,t=[]){return e&&!t.includes(e)?e:""}const C=()=>window.crypto,R=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(C().getRandomValues(new Uint8Array(43))).forEach((n=>t+=e[n%66])),t},k=e=>btoa(e),x=e=>{var{clientId:t}=e,n=d(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()},_=e=>(e=>decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),P=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},G=async(e,t,n,r,o,i,a=1e4)=>o?(async(e,t,n,r,o,i,a)=>{return s={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a},c=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()},c.postMessage(s,[n.port2])}));var s,c})(e,t,n,r,a,o,i):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([P(e,t),new Promise(((e,t)=>{o=setTimeout((()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((()=>{clearTimeout(o)}))})(e,r,a);const U=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class M{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 M({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new M({scope:t,audience:n,clientId:r})}}class B{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 D{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 X{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||E}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){var n;let r=await this.cache.get(e.toKey());if(!r){const t=await this.getCacheKeys();if(!t)return;const n=this.matchExistingCacheKey(e,t);n&&(r=await this.cache.get(n))}if(!r)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return r.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 M({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter((t=>{var n;const r=M.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]}}class F{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 H=e=>"number"==typeof e,j=["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 K=g((function(e,t){var n=f&&f.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nZ.get(e)||Z.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),Y(`_legacy_${e}`,JSON.stringify(t),r),Z.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),V(e,n),Z.remove(e,t),Z.remove(`_legacy_${e}`,t)}},z={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 Q,q=function(e){return Q=Q||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{await oe.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!C())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===C().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",!ne(t))throw new Error(`Invalid cache location "${t}"`);n=ne(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Z:J,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:z;var o;this.scope=U("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new F(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||E,this.cacheManager=new X(n,n.allKeys?void 0:new ee(n,this.options.clientId),this.nowProvider),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),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new q)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||y)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${x(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(_(r)),a={__raw:e},s={};return Object.keys(i).forEach((e=>{a[e]=i[e],j.includes(e)||(s[e]=i[e])})),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(_(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!H(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||!H(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!H(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&&H(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){const r=k(R()),o=k(R()),i=R(),a=(e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,(e=>t[e]))})(window.btoa(String.fromCharCode(...Array.from(t))))})(await(async e=>{const t=C().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t})(i)),s=((e,t,n,r,o,i,a,s)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:U(t,n.scope),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"}))(this.options,this.scope,e,r,o,a,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode),c=this._authorizeUrl(s);return{nonce:o,code_verifier:i,scope:s.scope,audience:s.audience||"default",redirect_uri:s.redirect_uri,state:r,url:c}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const 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 I(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),e.popup.close(),a.data.response.error)return n(A.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 A("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=re(e),{openUrl:r,fragment:o,appState:i}=n,a=d(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=d(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i}),s&&{organization:s}));const h=o?`${u}#${o}`:u;r?await r(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const{state:n,code:r,error:o,error_description:i}=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join("")),a=this.transactionManager.get();if(!a)throw new A("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new S(o,i||o,n,a.appState);if(!a.code_verifier||a.state&&a.state!==n)throw new A("state_mismatch","Invalid state");const s=a.organization,c=a.nonce,u=a.redirect_uri;return await this._requestToken(Object.assign({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:r},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:a.appState}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t;const n=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:U(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope)})}),r=await((e,t)=>{let n=$[t];return n||(n=e().finally((()=>{delete $[t],n=null})),$[t]=n),n})((()=>this._getTokenSilently(n)),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return e.detailedResponse?r:null==r?void 0:r.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=d(e,["cacheMode"]);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}if("cache-only"!==t){if(!await(async(e,t=3)=>{for(let n=0;noe.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new O;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"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,access_token:o,oauthTokenScope:i,expires_in:a}=e;return Object.assign(Object.assign({id_token:r,access_token:o},i?{scope:i}:null),{expires_in:a})}finally{await oe.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(e={},t={}){var n;const r=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:U(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope)})});return t=Object.assign(Object.assign({},v),t),await this.loginWithPopup(r,t),(await this.cacheManager.get(new M({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).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=d(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${x(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){const t=re(e),{openUrl:n}=t,r=d(t,["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@@");const o=this._buildLogoutUrl(r);n?await n(o):!1!==n&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url: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);try{if(window.crossOriginIsolated)throw new A("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let l;try{l=new URL(this.domainUrl).origin}catch(e){l=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 O),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(A.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,l,n);if(o!==h.state)throw new A("state_mismatch","Invalid state");const d=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({},d),{scope:c,oauthTokenScope:d.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new M({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new T(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;try{const o=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}));return Object.assign(Object.assign({},o),{scope:e.authorizationParams.scope,oauthTokenScope:o.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=d(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=await this.cacheManager.getIdToken(new M({clientId:this.options.clientId,audience:e,scope:this.scope})),n=this.userCache.get("@@user@@");return t&&t.id_token===(null==n?void 0:n.id_token)?n:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:e,audience:t,clientId:n}){const r=await this.cacheManager.get(new M({scope:e,audience:t,clientId:n}),60);if(r&&r.access_token){const{access_token:e,oauthTokenScope:t,expires_in:n}=r,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,access_token:e},t?{scope:t}:null),{expires_in:n})}}async _requestToken(e,t){const{nonceIn:n,organization:r}=t||{},o=await async function(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s}=e,c=d(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u="urn:ietf:params:oauth:grant-type:token-exchange"===c.grant_type,l=Object.assign(Object.assign(Object.assign({},c),u&&o&&{audience:o}),u&&i&&{scope:i}),h=s?x(l):JSON.stringify(l);return await async function(e,t,n,r,o,i,a){let s,c=null;for(let u=0;u<3;u++)try{s=await G(e,n,r,o,i,a,t),c=null;break}catch(e){c=e}if(c)throw c;const u=s.json,{error:l,error_description:h}=u,f=d(u,["error","error_description"]),{ok:p}=s;if(!p){const t=h||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===l)throw new b(l,t,f.mfa_token);if("missing_refresh_token"===l)throw new T(n,r);throw new A(l||"request_error",t)}return f}(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:h,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||y))}},t,s)}(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},e),this.worker),i=await this._verifyIdToken(o.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}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:U(e.scope,this.scope),audience:e.audience||this.options.authorizationParams.audience})}}var ae=n(2505),se=n.n(ae),ce=n(8805);const ue={log:function(){if(ce.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var we=function(){var e=window.location.href;return new URL(e)},ve=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]&&arguments[0],t=we().hostname;e&&"string"==typeof e&&(t=e);var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},Ee=function(){var e=ye();return".".concat(e)},Ae=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(ue.log("Setting cookie with options: ",n),Object.entries(n).forEach((function(e){var t=a(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},Se=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=ye(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach((function(e){var t=a(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,";")}))},Oe=function(e){return h(e)},Ie=function(e){return(he=he||r(me().mark((function e(t){var n,r;return me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ye().split(".")[0],e.prev=1,e.next=4,se()({method:"get",url:"".concat(ce.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 4:if(!(r=e.sent).data){e.next=8;break}return ue.log("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 8:return e.abrupt("return",!1);case 11:return e.prev=11,e.t0=e.catch(1),ue.log("Apple Sub Check: Request Failure: ",e.t0),e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)},Ne=function(e){return(de=de||r(me().mark((function e(t){var n;return me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,se()({method:"get",url:"".concat(ce.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":ce.A.entitlementsApiKey}});case 2:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},be=function(){return"complete"===document.readyState},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){var n=!0;if(be())t();else{ue.log("UIHandler: ","Waiting for the body to load...");var o=setInterval(r(me().mark((function r(){return me().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=be()),document.querySelector("body")&&n&&(clearInterval(o),t(!0));case 2:case"end":return r.stop()}}),r)}))),200)}}))},Le=function(){return new Promise((function(e){ue.log("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},(function(){ue.log("blueConicReady | onReady fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),ue.log("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)}),3e3)}))},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){ue.log("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout((function(){clearTimeout(n),ue.log("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?(ue.log("blueConicLoaded | BC object already loaded"),e?t(Le()):(clearTimeout(n),t())):(ue.log('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(me().mark((function r(){var o;return me().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(ue.log("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=10;break}return ue.log("blueConicLoaded | waiting for blueConicReady..."),r.next=5,Le();case 5:o=r.sent,clearTimeout(n),t(o),r.next=12;break;case 10:clearTimeout(n),t();case 12:case"end":return r.stop()}}),r)}))),!1))}))},Re=function(){return(fe=fe||r(me().mark((function e(){return me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce(!0);case 2:if(!e.sent){e.next=10;break}return e.next=6,new Promise((function(e){ue.log("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(ue.log("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},(function(){ue.log("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),ue.log("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)}),3e3)}));case 6:if(e.sent){e.next=9;break}return e.abrupt("return",!1);case 9:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},ke=function(){return(pe=pe||r(me().mark((function e(){var t,n,r,o,i,a,s,c=arguments;return me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]&&c[0],n=!1,o=["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=5,Ce(!0);case 5:if(!e.sent){e.next=15;break}if(i=window.blueConicClient.getSegments(),ue.log("bcLowaCheck | BC segments for users: ",i),!(i.filter((function(e){return o.includes(e.name)})).length>0)){e.next=15;break}return e.next=13,Re();case 13:(a=e.sent)&&(n=!0,r=a);case 15:return t&&n&&xe(),s={isSub:n},r&&(s.uuid=r),e.abrupt("return",s);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},xe=function(){Ae("bc_lowa_status",1,{path:"/",domain:Ee(),expires:7,secure:!0})},_e=function(){return new Promise((function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(ue.log("utils.js | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(ue.log("utils.js | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",(function(n){try{var r=n.detail||{};ue.log("utils.js | Event: authentication ready: ",r),e(r)}catch(e){ue.log(e),t(e)}}),!1))}))},Pe=function(){Se(le.AUTH0_SUB_COOKIE_KEY),Se("mng-jwt-decoded"),localStorage.removeItem(le.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){ue.log("Clearing entitlements...");try{Se(le.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){ue.log("Failed to delete legacy cookie: ",e)}try{Se(le.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:ye(),expires:365,secure:!0})}catch(e){ue.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(le.LOCAL_STORAGE_SESSION_KEY)}catch(e){ue.log("Failed to remove local storage: ",e)}}()},Ge=function(){var e=we();return!["local","develop","preprod","trbdev"].some((function(t){return e.origin.includes(t)}))},Ue=function(e){ue.log("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),ue.log("Storage Object removed : ",e))},Me=function(e){ue.log("starting simpleEmailValidation");var t=new RegExp(/^(([^<>()[\]\\.,;:\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);if(!e)return{valid:!1,message:"Please enter an email."};if(!t.test(e))return{valid:!1,message:"Please enter a valid email."};var n=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),r=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(n);return ue.log("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex((function(t){return t===e.split("@")[1]}))?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Me;var Be;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var De=function(){return(ge=ge||r(me().mark((function e(){var t,n;return me().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Be){e.next=2;break}return e.abrupt("return",Be);case 2:return t=ce.A.auth0Domain,n=ce.A.auth0ClientId,Be=new ie({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",Be);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Xe=function(e){ue.log("utils.js | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,ue.log("Utils.js | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),ue.log("Utils.js | Dispatched authenticationReady event!")};var Fe=function(e){ce.A.datadogEnabled&&window.DD_RUM.addTiming(e)};function He(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(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 je;function Ke(){Ke=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(x([])));O&&O!==r&&o.call(O,s)&&(A=O);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var We=function(){return(je=je||r(Ke().mark((function e(){return Ke().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ce();case 2:return e.next=4,_e();case 4:return e.abrupt("return",new Promise((function(e){ue.log("ANALYTICS: inside BCregwall events");var t=we();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 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Ye=function(e){try{window.dataLayer.push({event:e}),ue.log("ANALYTICS: ".concat(e," event")),ue.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){ue.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Ve,Ze,Je,ze,Qe,qe;function $e(){$e=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(x([])));O&&O!==r&&o.call(O,s)&&(A=O);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var et,tt,nt,rt,ot,it,at,st=function(){try{var e=localStorage.getItem(le.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){ue.log("Unable to get session from local storage: ",e)}return"{}"},ct=function(e){try{ue.log("Setting local storage session",e),localStorage.setItem(le.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){ue.log("Unable to save session from local storage: ",e)}},ut=function(e){try{Ae(le.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Ee(),expires:365,secure:!0})}catch(e){ue.log("Unable to save session to cookie storage: ",e)}},lt=function(){return(Ve=Ve||r($e().mark((function e(){var t,n,r,o,i,a,s,c,u,l,h,d,f,p,g,m,w,v;return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ce.A.sessionServer,n="".concat(t,"/api/session"),ue.log("Checking server session: ",n),e.next=5,se().get(n,{withCredentials:!0});case 5:if(!(r=e.sent).data){e.next=17;break}return u=r.data.entitlementTokenDecoded,l=r.data,h=l.accessToken,d=l.idToken,f=l.entitlementToken,p=null!==(o=null==u?void 0:u.entitlement_expiry)&&void 0!==o?o:null,g=null!==(i=null==u?void 0:u.entitlement_source)&&void 0!==i?i:null,m=null!==(a=null==u?void 0:u.entitlement_entitled)&&void 0!==a?a:null,w=null!==(s=null==u?void 0:u.entitlement_extras_adfree)&&void 0!==s?s:null,v=null!==(c=null==u?void 0:u.entitlement_level)&&void 0!==c?c:null,ct(JSON.stringify({accessToken:h,idToken:d,entitlementToken:f,expiration:p,entitlementSource:g,isEntitled:m,adFree:w,entitlementLevel:v})),""!==f&&"string"==typeof f&&ut(f),e.abrupt("return",{accessToken:h,idToken:d,entitlementToken:f,expiration:p,entitlementSource:g,isEntitled:m,adFree:w,entitlementLevel:v});case 17:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)},ht=function(e){return(Ze=Ze||r($e().mark((function e(t){var n,r;return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=ce.A.sessionServer,r="".concat(n,"/api/session"),ue.log("Updating server session: ",r),e.next=6,se().post(r,t,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),ue.log("Failed to update session server: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},dt=function(){return(Je=Je||r($e().mark((function e(){var t,n;return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=ce.A.sessionServer,n="".concat(t,"/api/session"),ue.log("Deleting server session: ",n),e.next=6,se().delete(n,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),ue.log("Failed to delete server session: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},ft=function(){return(ze=ze||r($e().mark((function e(){var t,n,r,o,i,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S,O,I,N,b,T;return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ue.log("Inside getSession"),e.prev=1,u=st(),ue.log("Session: __MNG_Session = ",u),l=JSON.parse(u),h=l.accessToken,d=l.idToken,f=l.entitlementToken,p=l.expiration,g=l.entitlementSource,m=l.isEntitled,w=l.adFree,v=l.entitlementLevel,n=h,t=d,r=f,o=p,i=g,a=m,s=w,c=v,ue.log("Session: check both tokens: ",t,r),void 0!==d&&void 0!==f&&null!==d&&null!==f){e.next=35;break}return ue.log("Session: missing id or entitlements, try session server"),e.next=18,lt();case 18:y=e.sent,E=y.accessToken,A=y.idToken,S=y.entitlementToken,O=y.expiration,I=y.entitlementSource,N=y.isEntitled,b=y.adFree,T=y.entitlementLevel,n=E,t=A,r=S,o=O,i=I,a=N,s=b,c=T;case 35:e.next=40;break;case 37:e.prev=37,e.t0=e.catch(1),ue.log("Failed to get session: ",e.t0);case 40:return ue.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:o,entitlementSource:i,isEntitled:a,adFree:s,entitlementLevel:c});case 42:case"end":return e.stop()}}),e,null,[[1,37]])})))).apply(this,arguments)},pt=function(e){return(Qe=Qe||r($e().mark((function e(t){var n,r,o,i,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S,O,I,N,b,T,L,C;return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=st(),r=JSON.parse(n),o=r.accessToken,i=void 0===o?null:o,a=r.idToken,s=void 0===a?null:a,c=r.entitlementToken,u=void 0===c?null:c,l=r.expiration,h=void 0===l?null:l,d=r.entitlementSource,f=void 0===d?null:d,p=r.isEntitled,g=void 0===p?null:p,m=r.adFree,w=void 0===m?null:m,v=r.entitlementLevel,y=void 0===v?null:v,E=t.accessToken,A=t.idToken,S=t.entitlementToken,O=t.expiration,I=t.entitlementSource,N=t.isEntitled,b=t.adFree,T=t.entitlementLevel,L={accessToken:null==E?i:E,idToken:null==A?s:A,entitlementToken:null==S?u:S,expiration:null==O?h:O,entitlementSource:null==I?f:I,isEntitled:null==N?g:N,adFree:null==b?w:b,entitlementLevel:null==T?y:T},ue.log("Current session data: ",r),ue.log("New session data: ",t),ue.log("Updated session data:",L),C=JSON.stringify(L),ct(C),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&ut(L.entitlementToken),n===C){e.next=15;break}return e.next=15,ht(L);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),ue.log("Unable to save session: ",e.t0);case 20:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)},gt=function(){return(qe=qe||r($e().mark((function e(){return $e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ue.log("Ending session..."),Pe(),e.next=4,dt();case 4:localStorage.removeItem(le.LOCAL_STORAGE_SESSION_KEY);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)};function mt(){mt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(x([])));O&&O!==r&&o.call(O,s)&&(A=O);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var wt=function(){return"logout"===(we().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var vt=function(e){return(et=et||r(mt().mark((function e(t){var n;return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,De();case 2:n=e.sent,ue.log("Calling Auth0 logout..."),n.logout({returnTo:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},yt=function(){ue.log("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){ue.log("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=/")}},Et=function(){return(tt=tt||r(mt().mark((function e(){var t,n,o,i,a;return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ue.log("Attempting to logout..."),yt(),!window.authentication_config.sessionManagementEnabled){e.next=7;break}return e.next=5,gt();case 5:e.next=8;break;case 7:Pe();case 8:return e.prev=8,ue.log("Cycling through logout callbacks..."),t=window.MNGAuthentication.logoutCallbacks.map((function(e){return e()})),e.next=13,Promise.all(t);case 13:ue.log("Finished cycling through logout callbacks."),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(8),ue.log("Failed to cycle through logout callbacks: ",e.t0);case 19:Object.keys(window.localStorage).filter((function(e){return e.includes("auth0")})).forEach((function(e){window.localStorage.removeItem(e),ue.log("Removed Auth0 storage object...")})),Ue("hhsl"),Ue("userNewsLetterData"),Ue(le.REGWALL_USER_IS_SUBSCRIBED),Ue(le.USER_PROFILE_HASH),n=we(),o=window.location.origin;try{n.searchParams.get("returnURL")&&(i=decodeURIComponent(n.searchParams.get("returnURL")),o=i)}catch(e){ue.log(e),o=window.location.origin}return o=new URL(o),e.next=31,window.ConnextUtils.connextReady();case 31:if(!e.sent){e.next=63;break}if(ue.log("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),ue.log("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),a=o,o.origin!==window.location.origin&&(a=new URL(window.location.origin)).searchParams.append("returnAfterLogout",o),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",a),!Ge()){e.next=44;break}ue.log("About to call Connext Logout..."),setTimeout((function(){Connext.Logout()}),500),e.next=61;break;case 44:if("Logged In"!==("undefined"==typeof CnnXt?(ue.log("Connext was not loaded."),!1):Connext.Storage.GetUserState())){e.next=58;break}if(ue.log("Connext user state is logged in, setting timeout..."),setTimeout(r(mt().mark((function e(){return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ue.log("Connext took too long to logout, calling auth0 logout..."),e.next=3,vt(o);case 3:case"end":return e.stop()}}),e)}))),8e3),"function"!=typeof Connext._logout){e.next=53;break}return ue.log("About to call Connext _logout..."),e.next=51,Connext._logout();case 51:e.next=56;break;case 53:return ue.log("About to call Connext Logout..."),e.next=56,Connext.Logout();case 56:e.next=61;break;case 58:return ue.log("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=61,vt(o);case 61:e.next=66;break;case 63:return ue.log("Connext Logout was NOT called"),e.next=66,vt(o);case 66:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)},At=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},St=function(e,t,n,o,i){return(nt=nt||r(mt().mark((function e(t,n,r,o,i){var a,s,c,u,l,h,d,f,p,g,m,w,v;return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ue.log("Attempting to login..."),At()>4.5&&window.localStorage.clear(),window.MNGAuthentication.preAuthGTMEvents.forEach((function(e){return Ye(e)})),ue.log("Cycled through preauth GTM events."),o&&(a=[],s=window.localStorage.getItem("callbackEvents"),c=JSON.parse(s),a=c&&c.length>0?He(new Set([].concat(He(o),He(c)))):o,window.localStorage.setItem("callbackEvents",JSON.stringify(a))),u=null,e.next=7,De();case 7:if(l=e.sent,h=we(),d=h.origin,f=new URL("".concat(d,"/callback")),p={},h.searchParams.get("regwall")&&(h.searchParams.get("returnUrl")&&(g=h.searchParams.get("returnUrl")),h.searchParams.get("auth_redirect")&&(g=h.searchParams.get("auth_redirect"))),h.pathname.startsWith("/login")||h.pathname.startsWith("/callback")?h.searchParams.get("returnUrl")?f.searchParams.set("auth_redirect",h.searchParams.get("returnUrl")):i&&f.searchParams.set("auth_redirect",i):f.searchParams.set("auth_redirect",h.toString()),g&&"regwall"!==t&&f.searchParams.set("auth_redirect",g),"true"===h.searchParams.get("close-after-finish")&&f.searchParams.set("close-after-finish","true"),"true"!==h.searchParams.get("ssl")){e.next=23;break}if(!window.authentication_config.sessionManagementEnabled){e.next=22;break}return e.next=20,gt();case 20:e.next=23;break;case 22:Pe();case 23:return null!==(u=h.searchParams.get("login-with"))?p.connection=u:n&&(p.connection=n),m="none",t&&"regwall"===t&&(f.searchParams.set("regwall","true"),m="signUp",ue.log("Logging in with regwall")),t&&(f.searchParams.set("loginsource",t),ue.log("Logging in with ".concat(t))),r&&(p.login_hint=r),p.redirect_uri=f.toString(),p.initialScreen=m,"googleonetap"!==t&&(p.prompt="select_account"),null!==(w=h.searchParams.get("ampRegiWall"))&&(v=window.location.hostname,p.ampRegiWall=w,p.sourceDomain=v.replace("www.","").replace("preprod.","").replace("develop.",""),p.initialScreen="signUp",p.preferenceId=h.searchParams.get("prefId")),e.next=36,l.loginWithRedirect({authorizationParams:p});case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Ot=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();ue.log("Adding listeners to events we need to wait for...");var o=r.map((function(e){return t=e,new Promise((function(e){ue.log("Adding event to wait for: ",t),window.addEventListener(t,(function(n){try{var r=n.detail||{};ue.log("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){ue.log(t),e()}}),!1)}));var t}));Promise.all(o).then((function(){clearTimeout(t),e()}))}catch(t){ue.log("Failed to wait for callback events",t),e()}}))};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var It=function(){return(rt=rt||r(mt().mark((function e(){var t,n,o,i,a,s,c,u,l,h,d,f,p,g,m,w,v,y,E,A,S;return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(yt(),t=we(),n=!1,o=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),i=t.searchParams.get("redirect_uri")||"",i.includes("applenews")?(ue.log("This is Apple prelogin flow."),(a=new URL(i))?(a.searchParams.append("post-apple-login","true"),ue.log("Post callback Apple redirect URL is ".concat(a)),St(!1,!1,!1,[],a)):St()):o.includes("post-apple-login")&&(ue.log("This is Apple Callback flow."),n=!0,(s=new URL(decodeURIComponent(o))).searchParams.delete("post-apple-login"),o=s),ue.log("Handling post login callback..."),!(c=t.searchParams.get("error_description"))){e.next=13;break}if("shouldAutoLogin"!==c){e.next=12;break}return e.abrupt("return",St(!1,!1,!1,!1,o));case 12:n&&alert("There was an error in logging you in, please try again.");case 13:return e.next=15,De();case 15:return u=e.sent,e.next=18,u.handleRedirectCallback();case 18:return e.next=20,u.getIdTokenClaims();case 20:return l=e.sent,e.next=23,u.getUser();case 23:return h=e.sent,ue.log("Auth0 user profile: ",h),d=l.__raw,e.next=28,u.getTokenSilently();case 28:return f=e.sent,e.prev=29,ue.log("Cycling through login callbacks..."),e.next=33,Ot();case 33:return g=window.MNGAuthentication.oidcLoginCallbacks.map((function(e){return(p=p||r(mt().mark((function e(t){return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(d));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)})),e.next=36,Promise.all(g);case 36:ue.log("Finished cycling through login callbacks."),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(29),ue.log("Failed to cycle through login callbacks: ",e.t0);case 42:if(m={accessToken:f,userId:h.sub,email:h.email,picture:h.picture},w=!1,v="",!n){e.next=61;break}return e.prev=46,e.next=49,Ne(m.userId);case 49:return v=e.sent,ue.log("Encrypted apple uuid is: ".concat(v)),e.next=53,Ie(v);case 53:w=e.sent,ue.log("Apple sub status is: ".concat(w)),e.next=61;break;case 57:e.prev=57,e.t1=e.catch(46),ue.log("Apple sub check error: ".concat(e.t1)),alert("There was an error in logging you in, please try again.");case 61:if(Ue(le.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=66;break}return ue.log("Saving idToken to session server"),e.next=66,pt({idToken:d,accessToken:f});case 66:if(!t.searchParams.get("close-after-finish")){e.next=68;break}return e.abrupt("return",window.close());case 68:if(!t.search.includes("loginsource")){e.next=73;break}return E=t.searchParams.get("loginsource"),A=window.MNGAuthentication.postAuthEvents.map((function(e){return(y=y||r(mt().mark((function e(t){return mt().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)})))).apply(this,arguments)})),e.next=73,Promise.all(A);case 73:return e.prev=73,S=new URL(o),n&&w&&S.searchParams.append("access_token",v),ue.log("Apple redirect URL:",S),e.abrupt("return",window.location.assign(S));case 80:e.prev=80,e.t2=e.catch(73),ue.log("Failed to redirect after authentication: ",e.t2);case 83:return window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 85:case"end":return e.stop()}}),e,null,[[29,39],[46,57],[73,80]])})))).apply(this,arguments)},Nt=function(){return(ot=ot||r(mt().mark((function e(){return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ue.log("ANALYTICS: fireBC events"),e.next=3,We();case 3:ue.log("ANALYTICS: bc values should be filled");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},bt=function(){return(it=it||r(mt().mark((function e(){var t,n,r,o,i,a,s,c,u,l,h,d,f;return mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e();case 2:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=18;break}return e.prev=6,a=Oe(n),s=a.email,c=a.picture,u=a.sub,l=a.name,h=a.nickname,d=a.connection_source,f=null===(o=a.user_metadata)||void 0===o||null===(i=o.customProfile)||void 0===i?void 0:i.nickname,u.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:f||h||l,email:s,picture:c,userId:u,connectionSource:d});case 15:e.prev=15,e.t0=e.catch(6),ue.log("Unable to parse idToken: ",n," Error: ",e.t0);case 18:return e.abrupt("return",{authenticated:r});case 19:case"end":return e.stop()}}),e,null,[[6,15]])})))).apply(this,arguments)};window.MNGAuthentication.login=St,window.MNGAuthentication.logout=Et,window.MNGAuthentication.getUserInfo=bt;var Tt=function(){return(at=at||r(mt().mark((function t(){var n,o,i,a,s,c,u,l,h,d,f,p,g;return mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=we(),i=!1,a="",s=!1,c={},wt()&&window.ConnextUtils.rerunConnextEntitlements(!0),o.searchParams.get("returnAfterLogout")&&(u=decodeURIComponent(o.searchParams.get("returnAfterLogout")),window.location.assign(u)),o.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),l=function(){return(n=n||r(mt().mark((function t(){var n,r;return mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,De();case 3:return n=t.sent,t.next=6,n.getIdTokenClaims();case 6:return c=t.sent,t.next=9,n.isAuthenticated();case 9:if(i=t.sent,a="object"===e(c)?c.__raw:"",r=ve(le.ENTITLEMENT_COOKIE_KEY),i||!r){t.next=16;break}return t.next=15,n.getTokenSilently();case 15:s=t.sent;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(0),ue.log("Unable to verify user has active auth0 session: ",t.t0);case 21:case"end":return t.stop()}}),t,null,[[0,18]])})))).apply(this,arguments)},!o.pathname.startsWith("/logout")){t.next=14;break}return ue.log("Page is logout. Routing to logout function..."),t.next=13,Et();case 13:return t.abrupt("return");case 14:if(!window.authentication_config.sessionManagementEnabled){t.next=40;break}return t.next=17,l();case 17:if(""===a){t.next=26;break}if(h=null,d=JSON.parse(window.localStorage.getItem(le.LOCAL_STORAGE_SESSION_KEY)),"{}"!==st()){t.next=24;break}return d&&(h=d.jwt),t.next=24,pt({idToken:a,entitlementToken:h});case 24:t.next=38;break;case 26:return t.prev=26,t.next=29,ft();case 29:f=t.sent,a=f.idToken,(i="string"==typeof a)&&(c=Oe(a)),t.next=38;break;case 35:t.prev=35,t.t0=t.catch(26),ue.log("Unable to initialize session: ",t.t0);case 38:t.next=42;break;case 40:return t.next=42,l();case 42:if(i||s||!ce.A.blueconicEnabled||!ce.A.bcLowaSegements){t.next=47;break}return t.next=45,ke(!0);case 45:(p=t.sent).isSub&&(i=le.USER_IS_LOWA,c={sub:p.uuid});case 47:if(Xe({isAuthenticated:i,idToken:a,accessToken:s,claims:c}),Fe("authenticationReady"),!0===i?(ue.log("User is authenticated."),o.searchParams.get("auth_redirect")&&(ue.log("Auth Redirect is present, sending user to auth redirect..."),(g=o.searchParams.get("auth_redirect")).endsWith("#")&&(g=g.slice(0,g.length)),window.location.assign(g)),o.pathname.startsWith("/login")&&!wt()&&(ue.log("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(o.origin))):ue.log("User is not authenticated."),o.pathname.startsWith("/login")&&!wt()?(ue.log("Page is login. Attempting to log user in..."),St()):ue.log("Page is not login or Connext state is present"),!o.pathname.startsWith("/callback")||!o.searchParams.get("regwall")){t.next=60;break}return ue.log("Page is callback with regwall param. Routing to regwall receiver..."),t.next=56,Nt();case 56:ue.log("Now login from regwall"),St(),t.next=64;break;case 60:if(!o.pathname.startsWith("/callback")){t.next=64;break}return ue.log("Page is callback without regwall param. Routing to callback receiver..."),t.next=64,It();case 64:case"end":return t.stop()}}),t,null,[[26,35]])})))).apply(this,arguments)};window.MNGAuthentication.init=Tt;var Lt,Ct;function Rt(){Rt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(x([])));O&&O!==r&&o.call(O,s)&&(A=O);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}var kt=function(e,t){return new Promise((function(n){try{"undefined"==typeof CnnXt&&(ue.log("Connext was not loaded."),n(!1)),ue.log("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(){ue.log("Signed user up to newsletter: ",t),n(!0)},onError:function(e){ue.log("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){ue.log("subscribeToNewsletter Error:",e),n(!1)}}))},xt=function(e){try{"string"==typeof e&&Ae(le.AUTH0_SUB_COOKIE_KEY,e,{domain:Ee(),path:"/",expires:365,secure:!0})}catch(e){ue.log("Failed to set auth0_sub cookie: ",e)}},_t=function(t){if(!ve(le.AUTH0_SUB_COOKIE_KEY))try{var n=t.claims;if(null==n||"object"!==e(n)&&!Object.keys(n).includes("sub"))return;var r=n.sub;xt(r)}catch(e){ue.log("Failed to set auth0_sub: ",e)}},Pt=function(e){try{if("string"==typeof e){var t=Oe(e).sub;xt(t)}else ue.log("Could not set auth0_sub on login, idToken was not available.")}catch(e){ue.log("Failed to set auth0_sub on login: ",e)}},Gt=function(){return(Lt=Lt||r(Rt().mark((function e(){var t,n,r;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=window.localStorage.getItem("newsletter_to_subscribe"))){e.next=13;break}return e.next=4,window.ConnextUtils.connextReady("onFinish");case 4:return e.next=6,bt();case 6:return n=e.sent,r=n.email,ue.log("CONNEXT: about to sign up ".concat(r," to ").concat(t)),e.next=11,kt(r,t);case 11:window.localStorage.removeItem("newsletter_to_subscribe"),ue.log("CONNEXT: newsletter_to_subscribe value removed from local storage.");case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)};const Ut={init:function(){return(Ct=Ct||r(Rt().mark((function e(){var t;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 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)}})),Ge()||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])}})),Gt(),MNGAuthentication.oidcLoginCallbacks.push(Pt),window.ConnextUtils.runConnextIfSilent(),e.next=7,_e();case 7:t=e.sent,_t(t);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}};var Mt;function Bt(){Bt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.create(o.prototype),s=new k(r||[]);return i(a,"_invoke",{value:T(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",p="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function E(){}var A={};l(A,s,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(x([])));O&&O!==r&&o.call(O,s)&&(A=O);var I=E.prototype=v.prototype=Object.create(A);function N(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(t,n){function r(i,a,s,c){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==e(h)&&o.call(h,"__await")?n.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function T(e,n,r){var o=f;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===w)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=d(e,n,r);if("normal"===u.type){if(o=r.done?m:p,u.arg===w)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),w;var i=d(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,w;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,w):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,w)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function x(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),w}},n}!function(){(Mt=Mt||r(Bt().mark((function e(){return Bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ut.init(),e.next=3,Te(!0);case 3:case"end":return e.stop()}}),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={1928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},2012:(e,t,n)=>{"use strict";var r=n(9516),o=["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"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},2505:(e,t,n)=>{e.exports=n(8015)},2881:(e,t,n)=>{"use strict";var r=n(9516),o=n(6987);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},3191:(e,t,n)=>{"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},3864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3948:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var c=[];c.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),r.isString(o)&&c.push("path="+o),r.isString(i)&&c.push("domain="+i),!0===a&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4202:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4490:(e,t,n)=>{"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(6987),c=n(1928);function s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new c("canceled")}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return s(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(s(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},4680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4841:(e,t,n)=>{"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var c=e[i],s=void 0===c||a(c,i,e);if(!0!==s)throw new TypeError("option "+i+" must be "+s)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},5019:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},5155:(e,t,n)=>{"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),c=n(5343),s=n(4841),u=s.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=c(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&s.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=e;n.length;){var h=n.shift(),d=n.shift();try{f=h(f)}catch(e){d(e);break}}try{o=a(f)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=c(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(c(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(c(r||{},{method:e,url:t,data:n}))}})),e.exports=l},5343:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function c(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function s(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:s};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==s||(n[e]=o)})),n}},5449:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5592:(e,t,n)=>{"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),c=n(9615),s=n(2012),u=n(4202),l=n(7763),f=n(6987),h=n(1928);e.exports=function(e){return new Promise((function(t,n){var d,p=e.data,E=e.headers,A=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}r.isFormData(p)&&delete E["Content-Type"];var N=new XMLHttpRequest;if(e.auth){var S=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";E.Authorization="Basic "+btoa(S+":"+m)}var w=c(e.baseURL,e.url);function g(){if(N){var r="getAllResponseHeaders"in N?s(N.getAllResponseHeaders()):null,i={data:A&&"text"!==A&&"json"!==A?N.response:N.responseText,status:N.status,statusText:N.statusText,headers:r,config:e,request:N};o((function(e){t(e),v()}),(function(e){n(e),v()}),i),N=null}}if(N.open(e.method.toUpperCase(),a(w,e.params,e.paramsSerializer),!0),N.timeout=e.timeout,"onloadend"in N?N.onloadend=g:N.onreadystatechange=function(){N&&4===N.readyState&&(0!==N.status||N.responseURL&&0===N.responseURL.indexOf("file:"))&&setTimeout(g)},N.onabort=function(){N&&(n(l("Request aborted",e,"ECONNABORTED",N)),N=null)},N.onerror=function(){n(l("Network Error",e,null,N)),N=null},N.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",N)),N=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||u(w))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(E[e.xsrfHeaderName]=y)}"setRequestHeader"in N&&r.forEach(E,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete E[t]:N.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(N.withCredentials=!!e.withCredentials),A&&"json"!==A&&(N.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&N.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&N.upload&&N.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(e){N&&(n(!e||e&&e.type?new h("canceled"):e),N.abort(),N=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),p||(p=null),N.send(p)}))}},6987:(e,t,n)=>{"use strict";var r=n(9516),o=n(7018),i=n(5449),a={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(s=n(5592)),s),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(c(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},7018:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},7522:(e,t,n)=>{"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},7763:(e,t,n)=>{"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},7980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8015:(e,t,n)=>{"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343);var c=function e(t){var n=new i(t),c=o(i.prototype.request,n);return r.extend(c,i.prototype,n),r.extend(c,n),c.create=function(n){return e(a(t,n))},c}(n(6987));c.Axios=i,c.Cancel=n(1928),c.CancelToken=n(3191),c.isCancel=n(3864),c.VERSION=n(9641).version,c.all=function(e){return Promise.all(e)},c.spread=n(7980),c.isAxiosError=n(5019),e.exports=c,e.exports.default=c},8805:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={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,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}},9012:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var c=e.indexOf("#");-1!==c&&(e=e.slice(0,c)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},9516:(e,t,n)=>{"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},9641:e=>{e.exports={version:"0.24.0"}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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),(()=>{"use strict";function e(t){return e="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(t)}function t(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).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 c(e){t(a,o,i,c,s,"next",e)}function s(e){t(a,o,i,c,s,"throw",e)}c(void 0)}))}}var o=n(8805);const i=function(){if(o.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function l(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(u(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return u(t)}}function f(e){this.message=e}f.prototype=new Error,f.prototype.name="InvalidTokenError";const h=function(e,t){if("string"!=typeof e)throw new f("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(l(e.split(".")[n]))}catch(e){throw new f("Invalid token specified: "+e.message)}};"function"==typeof SuppressedError&&SuppressedError;var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function E(e,t){return e(t={exports:{}},t.exports),t.exports}var A=E((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()}}));p(A);var v=p(E((function(e,t){var n=d&&d.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function c(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}s((r=r.apply(e,t||[])).next())}))},r=d&&d.__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:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){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 c=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,c,s;return r(this,(function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(c=n.getItemSync(o))?[2]:(s=JSON.parse(c)).id!==this.id?[3,2]:[4,A.default().lock(s.iat)];case 1:r.sent(),this.acquiredIatSet.delete(s.iat),n.removeItemSync(o),A.default().unlock(s.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 c=r.keySync(a);if(null===c)break;o.push(c),a++}for(var s=!1,u=0;u=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:G(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var C=function(){var e=window.location.href;return new URL(e)},b=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]&&arguments[0],t=C().hostname;e&&"string"==typeof e&&(t=e);var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},k=function(){var e=x();return".".concat(e)},G=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(i("Setting cookie with options: ",n),Object.entries(n).forEach((function(e){var t=c(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},M=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=x(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach((function(e){var t=c(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,";")}))},B=function(){return C().host.replace("www.","").replace("develop.","").replace("preprod.","")},U=function(e){return h(e)},D=function(){return"complete"===document.readyState},P=function(e){return(I=I||r(R().mark((function e(t){var n,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){if(("interactive"===document.readyState||D())&&window.dataLayer)i("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{i("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(R().mark((function n(){return R().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)}}));case 2:if(i("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",i("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),o=function(e){return i("Utils dataLayerLoop: look for this element ",e),e[t]?(i("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(i("Utils dataLayerLoop: dataLayer search ",!1),!1)},!window.dataLayer.some(o)){e.next=10;break}return e.abrupt("return",n);case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},X=function(){return(L=L||r(R().mark((function e(){var t,n,r=arguments;return R().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=3,P(t);case 3:return n=e.sent,i("utils.js | pageType: page type is ",n),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},F=function(){return new Promise((function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(i("utils.js | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(i("utils.js | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",(function(n){try{var r=n.detail||{};i("utils.js | Event: authentication ready: ",r),e(r)}catch(e){i(e),t(e)}}),!1))}))},H=function(){i("Clearing entitlements...");try{M(y,{path:"/"})}catch(e){i("Failed to delete legacy cookie: ",e)}try{M(y,{path:"/",domain:x(),expires:365,secure:!0})}catch(e){i("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(O)}catch(e){i("Failed to remove local storage: ",e)}},_=function(e){i("starting simpleEmailValidation");var t=new RegExp(/^(([^<>()[\]\\.,;:\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);if(!e)return{valid:!1,message:"Please enter an email."};if(!t.test(e))return{valid:!1,message:"Please enter a valid email."};var n=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),r=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(n);return i("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex((function(t){return t===e.split("@")[1]}))?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=_;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var K=function(e){o.A.datadogEnabled&&window.DD_RUM.addTiming(e)};var Y,j,W,V;function J(){J=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof N?t:N,a=Object.create(o.prototype),c=new x(r||[]);return i(a,"_invoke",{value:L(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var d="suspendedStart",p="suspendedYield",E="executing",A="completed",v={};function N(){}function S(){}function m(){}var w={};l(w,c,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(k([])));y&&y!==r&&o.call(y,c)&&(w=y);var O=m.prototype=N.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(t,n){function r(i,a,c,s){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):n.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function L(e,n,r){var o=d;return function(i,a){if(o===E)throw new Error("Generator is already running");if(o===A){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=R(c,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=A,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=E;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?A:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=A,r.method="throw",r.arg=u.arg)}}}function R(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function k(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),b(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;b(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var Z,Q,q,z,ee,te,ne,re,oe=function(){try{var e=localStorage.getItem(O);return"string"==typeof e?e:"{}"}catch(e){i("Unable to get session from local storage: ",e)}return"{}"},ie=function(e){try{i("Setting local storage session",e),localStorage.setItem(O,e)}catch(e){i("Unable to save session from local storage: ",e)}},ae=function(e){try{G(y,e,{path:"/",domain:k(),expires:365,secure:!0})}catch(e){i("Unable to save session to cookie storage: ",e)}},ce=function(){return(Y=Y||r(J().mark((function e(){var t,n,r,a,c,s,u,l,f,h,d,p,E,A,v,N,S,m;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.A.sessionServer,n="".concat(t,"/api/session"),i("Checking server session: ",n),e.next=5,w().get(n,{withCredentials:!0});case 5:if(!(r=e.sent).data){e.next=17;break}return f=r.data.entitlementTokenDecoded,h=r.data,d=h.accessToken,p=h.idToken,E=h.entitlementToken,A=null!==(a=null==f?void 0:f.entitlement_expiry)&&void 0!==a?a:null,v=null!==(c=null==f?void 0:f.entitlement_source)&&void 0!==c?c:null,N=null!==(s=null==f?void 0:f.entitlement_entitled)&&void 0!==s?s:null,S=null!==(u=null==f?void 0:f.entitlement_extras_adfree)&&void 0!==u?u:null,m=null!==(l=null==f?void 0:f.entitlement_level)&&void 0!==l?l:null,ie(JSON.stringify({accessToken:d,idToken:p,entitlementToken:E,expiration:A,entitlementSource:v,isEntitled:N,adFree:S,entitlementLevel:m})),""!==E&&"string"==typeof E&&ae(E),e.abrupt("return",{accessToken:d,idToken:p,entitlementToken:E,expiration:A,entitlementSource:v,isEntitled:N,adFree:S,entitlementLevel:m});case 17:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)},se=function(e){return(j=j||r(J().mark((function e(t){var n,r;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=o.A.sessionServer,r="".concat(n,"/api/session"),i("Updating server session: ",r),e.next=6,w().post(r,t,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),i("Failed to update session server: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},ue=function(){return(W=W||r(J().mark((function e(){var t,n,r,o,a,c,s,u,l,f,h,d,p,E,A,v,N,S,m,w,g,y,O,T,I,L,R;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i("Inside getSession"),e.prev=1,l=oe(),i("Session: __MNG_Session = ",l),f=JSON.parse(l),h=f.accessToken,d=f.idToken,p=f.entitlementToken,E=f.expiration,A=f.entitlementSource,v=f.isEntitled,N=f.adFree,S=f.entitlementLevel,n=h,o=E,a=A,c=v,s=N,u=S,i("Session: check both tokens: ",t=d,r=p),void 0!==d&&void 0!==p&&null!==d&&null!==p){e.next=35;break}return i("Session: missing id or entitlements, try session server"),e.next=18,ce();case 18:m=e.sent,w=m.accessToken,g=m.idToken,y=m.entitlementToken,O=m.expiration,T=m.entitlementSource,I=m.isEntitled,L=m.adFree,R=m.entitlementLevel,n=w,t=g,r=y,o=O,a=T,c=I,s=L,u=R;case 35:e.next=40;break;case 37:e.prev=37,e.t0=e.catch(1),i("Failed to get session: ",e.t0);case 40:return i("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:o,entitlementSource:a,isEntitled:c,adFree:s,entitlementLevel:u});case 42:case"end":return e.stop()}}),e,null,[[1,37]])})))).apply(this,arguments)},le=function(e){return(V=V||r(J().mark((function e(t){var n,r,o,a,c,s,u,l,f,h,d,p,E,A,v,N,S,m,w,g,y,O,T,I,L,R,C,b;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=oe(),r=JSON.parse(n),o=r.accessToken,a=void 0===o?null:o,c=r.idToken,s=void 0===c?null:c,u=r.entitlementToken,l=void 0===u?null:u,f=r.expiration,h=void 0===f?null:f,d=r.entitlementSource,p=void 0===d?null:d,E=r.isEntitled,A=void 0===E?null:E,v=r.adFree,N=void 0===v?null:v,S=r.entitlementLevel,m=void 0===S?null:S,w=t.accessToken,g=t.idToken,y=t.entitlementToken,O=t.expiration,T=t.entitlementSource,I=t.isEntitled,L=t.adFree,R=t.entitlementLevel,C={accessToken:null==w?a:w,idToken:null==g?s:g,entitlementToken:null==y?l:y,expiration:null==O?h:O,entitlementSource:null==T?p:T,isEntitled:null==I?A:I,adFree:null==L?N:L,entitlementLevel:null==R?m:R},i("Current session data: ",r),i("New session data: ",t),i("Updated session data:",C),b=JSON.stringify(C),ie(b),""!==C.entitlementToken&&"string"==typeof C.entitlementToken&&ae(C.entitlementToken),n===b){e.next=15;break}return e.next=15,se(C);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),i("Unable to save session: ",e.t0);case 20:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)};function fe(){fe=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof N?t:N,a=Object.create(o.prototype),c=new x(r||[]);return i(a,"_invoke",{value:L(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var d="suspendedStart",p="suspendedYield",E="executing",A="completed",v={};function N(){}function S(){}function m(){}var w={};l(w,c,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(k([])));y&&y!==r&&o.call(y,c)&&(w=y);var O=m.prototype=N.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(t,n){function r(i,a,c,s){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):n.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function L(e,n,r){var o=d;return function(i,a){if(o===E)throw new Error("Generator is already running");if(o===A){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=R(c,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=A,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=E;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?A:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=A,r.method="throw",r.arg=u.arg)}}}function R(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function k(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),b(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;b(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var he=function(){var e=window.localStorage.getItem(O);return JSON.parse(e)},de=function(){return(Z=Z||r(fe().mark((function e(){var t,n;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.authentication_config.sessionManagementEnabled){e.next=5;break}return e.next=3,ue();case 3:return t=e.sent,e.abrupt("return",t);case 5:return n=he(),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)},pe=function(e){G(y,e,{path:"/",domain:k(),expires:365,secure:!0})},Ee=function(e){return(Q=Q||r(fe().mark((function e(t){var n;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,pe(t),i("About to decode token before saving: ",t),n=U(t),!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=7,le({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 7:e.next=10;break;case 9:window.localStorage.setItem(O,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 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),i("Entitlements: Failed to save token: ",e.t0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)},Ae=function(e){return(q=q||r(fe().mark((function e(t){var n,a,c,s,u,l,f;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!window.authentication_config.sessionManagementEnabled){e.next=8;break}return e.next=4,ue();case 4:"string"==typeof(a=e.sent).idToken&&""!==a.idToken&&(c=U(a.idToken),n=void 0!==c&&c.email_verified),e.next=13;break;case 8:return e.next=10,F();case 10:s=e.sent,(u=s.idToken)&&""!==u&&(n=U(u).email_verified);case 13:if(i("Entitlements: refresh JWT start..."),t){e.next=16;break}return e.abrupt("return",new Error("No token to refresh"));case 16:return i("Entitlements refresh: entitlement token: ",t),i("Entitlements refresh: auth0 verified: ",n),l={jwt:t,verified:n},f="".concat(o.A.entitlementsEndpoint,"session/refresh"),e.abrupt("return",new Promise((function(e){var t,n;$.ajax({type:"POST",url:f,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":o.A.entitlementsApiKey},data:JSON.stringify(l),success:function(n){return(t=t||r(fe().mark((function t(n){return fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof n.jwt){t.next=2;break}return t.abrupt("return",new Error("Entitlements API returned no JWT"));case 2:return i("Entitlements: Request successful: ",n),t.next=5,Ee(n.jwt);case 5:return t.abrupt("return",e(n.jwt));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)},error:function(e,t,o){return(n=n||r(fe().mark((function e(t,n,r){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i("Entitlements: Request Failure: ",r),H(),!window.authentication_config.sessionManagementEnabled){e.next=5;break}return e.next=5,le({entitlementToken:null});case 5:return e.abrupt("return",new Error("Entitlements Refresh failure"));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}})})));case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)},ve=function(t){return new Promise((function(n,a){var c;if(i("Entitlements: create token start..."),i("Entitlements: createToken payload with ",t),"object"!==e(t)&&"string"!=typeof t.sub)return a(new Error("No user info to create token"));var s,u,l=x();if(t.sub&&(s=t.sub),t.idToken&&(u=t.idToken),!u&&!s)throw new Error("No idToken or uuid provided.");var f={publication:l.replace(".local",".com"),requestSource:"website"};u&&(f.idToken=u),s&&(f.uuid=s);var h="".concat(o.A.entitlementsEndpoint,"session/create");return i("Entitlements: create payload",f),$.ajax({type:"POST",url:h,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":o.A.entitlementsApiKey},data:JSON.stringify(f),success:function(e){return(c=c||r(fe().mark((function e(t){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t.jwt){e.next=2;break}return e.abrupt("return",a(new Error("Entitlements | API returned no JWT")));case 2:return i("Entitlements: Token Created: ",t),e.next=5,Ee(t.jwt);case 5:return e.abrupt("return",n(t.jwt));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},error:function(e,t,n){i("Entitlements: Create Token Failure: ",t,n),a(new Error("Entitlements: Create Token Failure"))}})}))},Ne=function(){return(z=z||r(fe().mark((function e(){var t,n;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,de();case 3:if((t=e.sent)&&t.entitlementToken){e.next=6;break}return e.abrupt("return",!1);case 6:if(!((n=Date.now()/1e3) ").concat(t.expiration)),e.abrupt("return",Ae(t.entitlementToken));case 13:return e.prev=13,e.t0=e.catch(0),i("Entitlements: Local Storage: Error processing token: ",e.t0.message),e.abrupt("return",!1);case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)},Se=function(){return(ee=ee||r(fe().mark((function e(){var t;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=b(y)){e.next=4;break}return e.abrupt("return",!1);case 4:return i("checkCookiesForToken, Refreshing token, ".concat(t)),e.next=7,Ae(t);case 7:return e.abrupt("return",e.sent);case 10:return e.prev=10,e.t0=e.catch(0),i("Entitlements: Cookie: Error processing token: ",e.t0.message),e.abrupt("return",!1);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)},me=function(e){i("Attempting to broadcast entitlements ready...",e);try{var t={token:e};if(e){i("About to decode token before broadcasting: ",e);var n=U(e);!function(e){var t=b("mng-jwt-decoded");t&&t===e||G("mng-jwt-decoded",JSON.stringify(e),{path:"/",domain:k(),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,i("Dispatching entitlementsReady Event: ",r),window.dispatchEvent(r),i("Dispatched entitlementsReady event"),K("entitlementsReady")}catch(e){var o={token:""};o=Object.assign(o,{isEntitled:"unknown",adfree:"unknown",subscriptionLevel:"unknown"});var a=new CustomEvent("entitlementsReady",{detail:o});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=o,i("Dispatching entitlementsReady EMPTY Event: ",a),window.dispatchEvent(a),i("Dispatched entitlementsReady EMPTY event"),i("Error: ",e)}},we=function(e){return(te=te||r(fe().mark((function e(t){return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ve({idToken:t});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),i("Entitlements error during oidc login callback: ",e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)},ge=function(e){var t=e.searchParams.get("entitlement_jwt");i("Webview JWT param provided: ",t),pe(t);var n=U(t);window.localStorage.setItem(O,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}))},ye=function(){return(ne=ne||r(fe().mark((function e(){var t,n,r,a,c,s,u,l,f,h,d,p;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=window.localStorage.getItem(T),n=b(g),r=C(),a=B(),!b("clearEntCache")&&!r.searchParams.has("newUser")){e.next=24;break}return c="".concat(o.A.entitlementsEndpoint,"session/create"),e.next=10,F();case 10:return s=e.sent,u={uuid:s.claims.auth0Id,publication:a},e.prev=12,e.next=15,$.ajax({type:"DELETE",url:c,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":o.A.entitlementsApiKey},data:JSON.stringify(u)});case 15:e.sent&&(i("loggedOutNewSubscriberActions","Entitlements: Cache cleared"),M("clearEntCache")),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(12),i("loggedOutNewSubscriberActions","Entitlements: Cache clear Failure - ".concat(e.t0.message));case 22:e.next=25;break;case 24:i("loggedOutNewSubscriberActions","There is no clearEntCache cookie");case 25:if(i("loggedOutNewSubscriberActions","Checking if this is a new regwall subscriber"),"false"!==t||!r.searchParams.has("newUser")||!n){e.next=39;break}return l=!1,f={sub:n,email_verified:!0},e.next=31,ve(f);case 31:if((h=e.sent)&&""!==h&&(d=U(h),p=d.entitlement_entitled,l=p),i("loggedOutNewSubscriberActions","New regwall user is entitled: ".concat(l)),!l){e.next=38;break}return window.localStorage.setItem(T,"true"),window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",!0);case 38:case 39:return e.abrupt("return",!1);case 42:return e.prev=42,e.t1=e.catch(0),i("loggedOutNewSubscriberActions error",e.t1),e.abrupt("return",!1);case 46:case"end":return e.stop()}}),e,null,[[0,42],[12,19]])})))).apply(this,arguments)};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.isUserAdFree=function(){var e=JSON.parse(window.localStorage.getItem(O));return null!=e?(i("Ad Free Check: : ",e.adFree),e.idToken&&e.adFree||o.A.isAdfreeArticle):o.A.isAdfreeArticle},window.MNGAuthentication.isUserSubscriber=function(){var e=JSON.parse(window.localStorage.getItem(O));return null!=e&&(i("Subscriber Check: : ",e.isEntitled),e.isEntitled)};const Oe={init:function(){return(re=re||r(fe().mark((function e(){var t,n,r,a,c,s,u,l,f,h,d,p,E,A,v;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.A.entitlementsEnabled){e.next=120;break}return e.next=3,ye();case 3:if(!e.sent){e.next=6;break}return e.abrupt("return",me(!1));case 6:return t=window.location,n=new URL(t.href),e.next=10,F();case 10:if(r=e.sent,a=r.idToken,c=r.accessToken,s=r.isAuthenticated,u=r.claims,void 0!==window.MNGAuthentication&&Array.isArray(window.MNGAuthentication.oidcLoginCallbacks)&&window.MNGAuthentication.oidcLoginCallbacks.push(we),e.prev=16,!n.searchParams.has("newUser")){e.next=28;break}if("string"!=typeof a||""===a){e.next=27;break}return e.next=21,ve({idToken:a});case 21:if(!(l=e.sent)){e.next=25;break}return i("Entitlements Init: Created new token for new subscriber"),e.abrupt("return",me(l));case 25:e.next=28;break;case 27:i("New subscription, no idToken.");case 28:e.next=33;break;case 30:e.prev=30,e.t0=e.catch(16),i("Not a new subscriber.");case 33:try{n.searchParams.has("entitlement_jwt")&&ge(n)}catch(e){i("Error during webview JWT retrieval: ",e)}return e.prev=34,e.next=37,Ne();case 37:if(!((f=e.sent)instanceof Error)){e.next=40;break}throw f;case 40:f&&(l=f,i("Entitlements Init: Local Storage Token exists")),e.next=46;break;case 43:e.prev=43,e.t1=e.catch(34),i("Error during Local Storage Token check: ",e.t1);case 46:if(e.prev=46,l){e.next=54;break}return e.next=50,Se();case 50:if(!((h=e.sent)instanceof Error)){e.next=53;break}throw h;case 53:h&&(l=h,i("Entitlements Init: Cookie Token exists"));case 54:e.next=59;break;case 56:e.prev=56,e.t2=e.catch(46),i("Error during Cookie Token check: ",e.t2);case 59:if(!s&&l&&(i("Entitled-only flow: User is not authenticated but entitlement token exists."),U(l).entitlement_entitled?(i("PageSuite flow: User is not authenticated but is subscriber. Access token is ".concat(c)),c?MNGAuthentication.login():i("PageSuite flow: No Access token.")):i("Entitled-only flow: User is not entitled.")),s){e.next=63;break}return i("User is not logged in, skipping entitlement flow."),e.abrupt("return",me(!1));case 63:if(!o.A.bcLowaSegements||s!==o.A.USER_IS_LOWA||l){e.next=76;break}return e.prev=64,i("About to check entitlements based on BC"),d={sub:u.sub},e.next=69,ve(d);case 69:l=e.sent,!window.authentication_config.sessionManagementEnabled&&o.A.serverEntitlements&&l&&(i("Entitlements fetched, about to reload to refresh entitlement cookie for server."),window.location.reload()),e.next=76;break;case 73:e.prev=73,e.t3=e.catch(64),i("BC sub segment check failed: ",e.t3);case 76:if(e.prev=76,!l){e.next=99;break}if(!o.A.linaCheckOnArticles){e.next=98;break}if(p=U(l),E=p.entitlement_entitled,A=p.iat,i("LINA check: isEntitled: ".concat(E,", token created at: ").concat(A)),!(o.A.linaCheckOnArticles&&!E&&Date.now()/1e3-new Date(A)>45)){e.next=98;break}if(i("Checking entitlements again for LINA user."),""===a){e.next=97;break}return e.next=87,ve({idToken:a});case 87:if(!(v=e.sent)){e.next=95;break}return i("Entitlements Init: Created new token for LINA user"),e.next=92,X();case 92:return"article"===e.sent&&window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",me(v));case 95:e.next=98;break;case 97:i("LINA check, no idToken.");case 98:return e.abrupt("return",me(l));case 99:e.next=104;break;case 101:e.prev=101,e.t4=e.catch(76),i("LINA check error: ",e.t4);case 104:if(e.prev=104,"string"!=typeof a||""===a){e.next=114;break}return e.next=108,ve({idToken:a});case 108:if(!(l=e.sent)){e.next=112;break}return i("Entitlements Init: Created new token"),e.abrupt("return",me(l));case 112:e.next=115;break;case 114:i("No OIDC ID Token. Not creating a new entitlements token.");case 115:e.next=120;break;case 117:e.prev=117,e.t5=e.catch(104),i("Unable to create token during initialize: ",e.t5);case 120:return e.abrupt("return",me(!1));case 121:case"end":return e.stop()}}),e,null,[[16,30],[34,43],[46,56],[64,73],[76,101],[104,117]])})))).apply(this,arguments)}};var Te;function Ie(){Ie=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof N?t:N,a=Object.create(o.prototype),c=new x(r||[]);return i(a,"_invoke",{value:L(e,n,c)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var d="suspendedStart",p="suspendedYield",E="executing",A="completed",v={};function N(){}function S(){}function m(){}var w={};l(w,c,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(k([])));y&&y!==r&&o.call(y,c)&&(w=y);var O=m.prototype=N.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function I(t,n){function r(i,a,c,s){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&o.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):n.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function L(e,n,r){var o=d;return function(i,a){if(o===E)throw new Error("Generator is already running");if(o===A){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var s=R(c,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=A,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=E;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?A:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=A,r.method="throw",r.arg=u.arg)}}}function R(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function b(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function k(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),b(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;b(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}!function(){(Te=Te||r(Ie().mark((function e(){return Ie().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Oe.init();case 2:case"end":return e.stop()}}),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={1928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},2012:(e,t,n)=>{"use strict";var r=n(9516),o=["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"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},2505:(e,t,n)=>{e.exports=n(8015)},2881:(e,t,n)=>{"use strict";var r=n(9516),o=n(6987);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},3191:(e,t,n)=>{"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},3864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3948:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4202:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4490:(e,t,n)=>{"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(6987),s=n(1928);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},4680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4841:(e,t,n)=>{"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var s=e[i],c=void 0===s||a(s,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},5019:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},5155:(e,t,n)=>{"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),s=n(5343),c=n(4841),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=e;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=l},5343:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},5449:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5592:(e,t,n)=>{"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),s=n(9615),c=n(2012),u=n(4202),l=n(7763),d=n(6987),h=n(1928);e.exports=function(e){return new Promise((function(t,n){var p,f=e.data,g=e.headers,m=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(f)&&delete g["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(w+":"+E)}var b=s(e.baseURL,e.url);function S(){if(y){var r="getAllResponseHeaders"in y?c(y.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};o((function(e){t(e),v()}),(function(e){n(e),v()}),i),y=null}}if(y.open(e.method.toUpperCase(),a(b,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(S)},y.onabort=function(){y&&(n(l("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(l("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var A=(e.withCredentials||u(b))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;A&&(g[e.xsrfHeaderName]=A)}"setRequestHeader"in y&&r.forEach(g,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete g[t]:y.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),m&&"json"!==m&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){y&&(n(!e||e&&e.type?new h("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),f||(f=null),y.send(f)}))}},6987:(e,t,n)=>{"use strict";var r=n(9516),o=n(7018),i=n(5449),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u},7018:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},7522:(e,t,n)=>{"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},7763:(e,t,n)=>{"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},7980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8015:(e,t,n)=>{"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343);var s=function e(t){var n=new i(t),s=o(i.prototype.request,n);return r.extend(s,i.prototype,n),r.extend(s,n),s.create=function(n){return e(a(t,n))},s}(n(6987));s.Axios=i,s.Cancel=n(1928),s.CancelToken=n(3191),s.isCancel=n(3864),s.VERSION=n(9641).version,s.all=function(e){return Promise.all(e)},s.spread=n(7980),s.isAxiosError=n(5019),e.exports=s,e.exports.default=s},8805:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={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,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}},9012:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},9516:(e,t,n)=>{"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},9641:e=>{e.exports={version:"0.24.0"}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},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),(()=>{"use strict";function e(t){return e="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(t)}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)}))}}var o=n(8805);const i={log:function(){if(o.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function d(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(l(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return l(t)}}function h(e){this.message=e}h.prototype=new Error,h.prototype.name="InvalidTokenError";const p=function(e,t){if("string"!=typeof e)throw new h("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(d(e.split(".")[n]))}catch(e){throw new h("Invalid token specified: "+e.message)}};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,y.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),y.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 A extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,A.prototype)}static fromPayload({error:e,error_description:t}){return new A(e,t)}}class L extends A{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,L.prototype)}}class I extends A{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,I.prototype)}}class N extends I{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class O extends A{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,O.prototype)}}class x extends A{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,x.prototype)}}class T extends A{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${k(e,["default"])}', scope: '${k(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,T.prototype)}}function k(e,t=[]){return e&&!t.includes(e)?e:""}const C=()=>window.crypto,R=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(C().getRandomValues(new Uint8Array(43))).forEach((n=>t+=e[n%66])),t},_=e=>btoa(e),P=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()},G=e=>(e=>decodeURIComponent(atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),U=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json()}},M=async(e,t,n,r,o,i,a=1e4)=>o?(async(e,t,n,r,o,i,a)=>{return s={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a},c=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()},c.postMessage(s,[n.port2])}));var s,c})(e,t,n,r,a,o,i):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([U(e,t),new Promise(((e,t)=>{o=setTimeout((()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((()=>{clearTimeout(o)}))})(e,r,a);const B=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};class D{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 D({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new D({scope:t,audience:n,clientId:r})}}class j{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 H{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 F{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||S}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){var n;let r=await this.cache.get(e.toKey());if(!r){const t=await this.getCacheKeys();if(!t)return;const n=this.matchExistingCacheKey(e,t);n&&(r=await this.cache.get(n))}if(!r)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return r.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 D({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter((t=>{var n;const r=D.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]}}class X{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 K=e=>"number"==typeof e,W=["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 Y=v((function(e,t){var n=g&&g.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nz.get(e)||z.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),Z(`_legacy_${e}`,JSON.stringify(t),r),z.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),J(e,n),z.remove(e,t),z.remove(`_legacy_${e}`,t)}},Q={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 ee,te=function(e){return ee=ee||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{await se.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!C())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===C().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",!ie(t))throw new Error(`Invalid cache location "${t}"`);n=ie(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?z:q,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:Q;var o;this.scope=B("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new X(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||S,this.cacheManager=new F(n,n.allKeys?void 0:new re(n,this.options.clientId),this.nowProvider),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),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new te)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||b)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${P(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(G(r)),a={__raw:e},s={};return Object.keys(i).forEach((e=>{a[e]=i[e],W.includes(e)||(s[e]=i[e])})),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(G(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&&!K(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||!K(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!K(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&&K(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){const r=_(R()),o=_(R()),i=R(),a=(e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,(e=>t[e]))})(window.btoa(String.fromCharCode(...Array.from(t))))})(await(async e=>{const t=C().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t})(i)),s=((e,t,n,r,o,i,a,s)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:B(t,n.scope),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"}))(this.options,this.scope,e,r,o,a,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode),c=this._authorizeUrl(s);return{nonce:o,code_verifier:i,scope:s.scope,audience:s.audience||"default",redirect_uri:s.redirect_uri,state:r,url:c}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const 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 O(e.popup)))}),1e3),i=setTimeout((()=>{clearInterval(o),n(new N(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),e.popup.close(),a.data.response.error)return n(A.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 A("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=ae(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}),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{state:n,code:r,error:o,error_description:i}=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join("")),a=this.transactionManager.get();if(!a)throw new A("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new L(o,i||o,n,a.appState);if(!a.code_verifier||a.state&&a.state!==n)throw new A("state_mismatch","Invalid state");const s=a.organization,c=a.nonce,u=a.redirect_uri;return await this._requestToken(Object.assign({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:r},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:a.appState}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t;const n=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:B(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope)})}),r=await((e,t)=>{let n=ne[t];return n||(n=e().finally((()=>{delete ne[t],n=null})),ne[t]=n),n})((()=>this._getTokenSilently(n)),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return e.detailedResponse?r:null==r?void 0:r.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});if(e)return e}if("cache-only"!==t){if(!await(async(e,t=3)=>{for(let n=0;nse.acquireLock("auth0.lock.getTokenSilently",5e3)),10))throw new I;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),"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,access_token:o,oauthTokenScope:i,expires_in:a}=e;return Object.assign(Object.assign({id_token:r,access_token:o},i?{scope:i}:null),{expires_in:a})}finally{await se.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(e={},t={}){var n;const r=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:B(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope)})});return t=Object.assign(Object.assign({},E),t),await this.loginWithPopup(r,t),(await this.cacheManager.get(new D({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).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?${P(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){const t=ae(e),{openUrl:n}=t,r=f(t,["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@@");const o=this._buildLogoutUrl(r);n?await n(o):!1!==n&&window.location.assign(o)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url: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);try{if(window.crossOriginIsolated)throw new A("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let l;try{l=new URL(this.domainUrl).origin}catch(e){l=this.domainUrl}const d=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(A.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,l,n);if(o!==d.state)throw new A("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:d.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn: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}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new D({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new T(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;try{const o=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}));return Object.assign(Object.assign({},o),{scope:e.authorizationParams.scope,oauthTokenScope:o.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}}async _saveEntryInCache(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=await this.cacheManager.getIdToken(new D({clientId:this.options.clientId,audience:e,scope:this.scope})),n=this.userCache.get("@@user@@");return t&&t.id_token===(null==n?void 0:n.id_token)?n:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:e,audience:t,clientId:n}){const r=await this.cacheManager.get(new D({scope:e,audience:t,clientId:n}),60);if(r&&r.access_token){const{access_token:e,oauthTokenScope:t,expires_in:n}=r,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,access_token:e},t?{scope:t}:null),{expires_in:n})}}async _requestToken(e,t){const{nonceIn:n,organization:r}=t||{},o=await async function(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s}=e,c=f(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u="urn:ietf:params:oauth:grant-type:token-exchange"===c.grant_type,l=Object.assign(Object.assign(Object.assign({},c),u&&o&&{audience:o}),u&&i&&{scope:i}),d=s?P(l):JSON.stringify(l);return await async function(e,t,n,r,o,i,a){let s,c=null;for(let u=0;u<3;u++)try{s=await M(e,n,r,o,i,a,t),c=null;break}catch(e){c=e}if(c)throw c;const u=s.json,{error:l,error_description:d}=u,h=f(u,["error","error_description"]),{ok:p}=s;if(!p){const t=d||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===l)throw new x(l,t,h.mfa_token);if("missing_refresh_token"===l)throw new T(n,r);throw new A(l||"request_error",t)}return h}(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:d,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||b))}},t,s)}(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},e),this.worker),i=await this._verifyIdToken(o.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}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:B(e.scope,this.scope),audience:e.audience||this.options.authorizationParams.audience})}}var ue=n(2505),le=n.n(ue);const de={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"};var he,pe,fe,ge,me,ve,ye,we;function Ee(){Ee=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var be=function(){var e=window.location.href;return new URL(e)},Se=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]&&arguments[0],t=be().hostname;e&&"string"==typeof e&&(t=e);var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},Le=function(){var e=Ae();return".".concat(e)},Ie=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(i.log("Setting cookie with options: ",n),Object.entries(n).forEach((function(e){var t=c(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},Ne=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=Ae(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach((function(e){var t=c(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,";")}))},Oe=function(){return be().host.replace("www.","").replace("develop.","").replace("preprod.","")},xe=function(e){return p(e)},Te=function(){var e=Ae();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)},ke=function(e){return(he=he||r(Ee().mark((function e(t){var n,r;return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Ae().split(".")[0],e.prev=1,e.next=4,le()({method:"get",url:"".concat(o.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 4:if(!(r=e.sent).data){e.next=8;break}return i.log("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 8:return e.abrupt("return",!1);case 11:return e.prev=11,e.t0=e.catch(1),i.log("Apple Sub Check: Request Failure: ",e.t0),e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,null,[[1,11]])})))).apply(this,arguments)},Ce=function(e){return(pe=pe||r(Ee().mark((function e(t){var n;return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,le()({method:"get",url:"".concat(o.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":o.A.entitlementsApiKey}});case 2:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Re=function(){return"complete"===document.readyState},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){var n=!0;if(Re())t();else{i.log("UIHandler: ","Waiting for the body to load...");var o=setInterval(r(Ee().mark((function r(){return Ee().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=Re()),document.querySelector("body")&&n&&(clearInterval(o),t(!0));case 2:case"end":return r.stop()}}),r)}))),200)}}))},Pe=function(e){return(fe=fe||r(Ee().mark((function e(t){var n,o;return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){if(("interactive"===document.readyState||Re())&&window.dataLayer)i.log("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{i.log("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(Ee().mark((function n(){return Ee().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)}}));case 2:if(i.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",i.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),o=function(e){return i.log("Utils dataLayerLoop: look for this element ",e),e[t]?(i.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(i.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},!window.dataLayer.some(o)){e.next=10;break}return e.abrupt("return",n);case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Ge=function(){return(ge=ge||r(Ee().mark((function e(){var t,n,r=arguments;return Ee().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=3,Pe(t);case 3:return n=e.sent,i.log("utils.js | pageType: page type is ",n),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Ue=function(){return new Promise((function(e){i.log("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},(function(){i.log("blueConicReady | onReady fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),i.log("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)}),3e3)}))},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(t){i.log("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout((function(){clearTimeout(n),i.log("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?(i.log("blueConicLoaded | BC object already loaded"),e?t(Ue()):(clearTimeout(n),t())):(i.log('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(Ee().mark((function r(){var o;return Ee().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i.log("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=10;break}return i.log("blueConicLoaded | waiting for blueConicReady..."),r.next=5,Ue();case 5:o=r.sent,clearTimeout(n),t(o),r.next=12;break;case 10:clearTimeout(n),t();case 12:case"end":return r.stop()}}),r)}))),!1))}))},Be=function(){return(me=me||r(Ee().mark((function e(){return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Me(!0);case 2:if(!e.sent){e.next=10;break}return e.next=6,new Promise((function(e){i.log("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(i.log("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},(function(){i.log("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)}));var t=setTimeout((function(){clearTimeout(t),i.log("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)}),3e3)}));case 6:if(e.sent){e.next=9;break}return e.abrupt("return",!1);case 9:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},De=function(){return(ve=ve||r(Ee().mark((function e(){var t,n,r,o,a,s,c,u=arguments;return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]&&u[0],n=!1,o=["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=5,Me(!0);case 5:if(!e.sent){e.next=15;break}if(a=window.blueConicClient.getSegments(),i.log("bcLowaCheck | BC segments for users: ",a),!(a.filter((function(e){return o.includes(e.name)})).length>0)){e.next=15;break}return e.next=13,Be();case 13:(s=e.sent)&&(n=!0,r=s);case 15:return t&&n&&je(),c={isSub:n},r&&(c.uuid=r),e.abrupt("return",c);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},je=function(){Ie("bc_lowa_status",1,{path:"/",domain:Le(),expires:7,secure:!0})},He=function(){return new Promise((function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(i.log("utils.js | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(i.log("utils.js | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",(function(n){try{var r=n.detail||{};i.log("utils.js | Event: authentication ready: ",r),e(r)}catch(e){i.log(e),t(e)}}),!1))}))},Fe=function(){return(ye=ye||r(Ee().mark((function e(){return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){return o.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(i.log("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,i.log("Received entitlementsReady event:",r),e(r)}catch(e){i.error("Error handling entitlementsReady event:",e),t(e)}}),{once:!0}):(i.log("Entitlements disabled in settings."),void e(!1))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Xe=function(){i.log("Clearing entitlements...");try{Ne(de.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){i.log("Failed to delete legacy cookie: ",e)}try{Ne(de.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:Ae(),expires:365,secure:!0})}catch(e){i.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(de.LOCAL_STORAGE_SESSION_KEY)}catch(e){i.log("Failed to remove local storage: ",e)}},Ke=function(){Ne(de.AUTH0_SUB_COOKIE_KEY),Ne("mng-jwt-decoded"),localStorage.removeItem(de.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),Xe()},We=function(){var e=be();return!["local","develop","preprod","trbdev"].some((function(t){return e.origin.includes(t)}))},Ye=function(e){i.log("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),i.log("Storage Object removed : ",e))},Ve=function(e){i.log("starting simpleEmailValidation");var t=new RegExp(/^(([^<>()[\]\\.,;:\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);if(!e)return{valid:!1,message:"Please enter an email."};if(!t.test(e))return{valid:!1,message:"Please enter a valid email."};var n=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),r=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(n);return i.log("simpleEmailValidation: ","TLD search ".concat(r)),!1===r?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex((function(t){return t===e.split("@")[1]}))?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Ve;var Ze;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Je=function(){return(we=we||r(Ee().mark((function e(){var t,n;return Ee().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Ze){e.next=2;break}return e.abrupt("return",Ze);case 2:return t=o.A.auth0Domain,n=o.A.auth0ClientId,Ze=new ce({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",Ze);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},ze=function(e){i.log("utils.js | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,i.log("Utils.js | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),i.log("Utils.js | Dispatched authenticationReady event!")},qe=function(e){return new Promise((function(t){document.querySelector(e)&&t(document.querySelector(e));var n=new MutationObserver((function(){return document.querySelector(e)&&(t(document.querySelector(e)),n.disconnect()),!0}));n.observe(document.body,{childList:!0,subtree:!0})}))};var Qe=function(){var e=window.localStorage.getItem("__MNG_Session");if(e){var t=JSON.parse(e);if(t.idToken){var n=xe(t.idToken);if(n.home_paper)return i.log("Util.js | home paper: Home paper is ",n.home_paper),n.home_paper.replace("www.","").replace("develop.","").replace("preprod.","")}}return i.log("Util.js | home paper: Home paper is not set ",Oe()),Oe()},$e=function(e){o.A.datadogEnabled&&window.DD_RUM.addTiming(e)};var et,tt="#primary-menu",nt="#pushnav",rt=".log-in-button",ot=".subscribe-visibility",it=".log-out-button",at="dfm-digisubs-menu",st="digisubs-push-container",ct="dfm-digisubs-push-menu",ut="mega-subscribe-button",lt=function(){return document.querySelector(tt)},dt=function(){return document.querySelector(nt)},ht=function(){return document.getElementById(at)},pt=function(){return document.getElementById(ct)},ft=function(){return ht()?ht().querySelector(rt):null},gt=function(){return ft()?ft().querySelector("a"):null},mt=function(){return pt()?pt().querySelector(rt):null},vt=function(){return dt()?dt().querySelector(rt):null},yt=function(){return document.querySelectorAll(ot)};function wt(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(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.")}()}function Et(){Et=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var bt=function(){return(et=et||r(Et().mark((function e(){return Et().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Me();case 2:return e.next=4,He();case 4:return e.abrupt("return",new Promise((function(e){i.log("ANALYTICS: inside BCregwall events");var t=be();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 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},St=function(e){try{window.dataLayer.push({event:e}),i.log("ANALYTICS: ".concat(e," event")),i.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){i.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var At,Lt,It,Nt,Ot,xt;function Tt(){Tt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var kt,Ct,Rt,_t,Pt,Gt,Ut,Mt=function(){try{var e=localStorage.getItem(de.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){i.log("Unable to get session from local storage: ",e)}return"{}"},Bt=function(e){try{i.log("Setting local storage session",e),localStorage.setItem(de.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){i.log("Unable to save session from local storage: ",e)}},Dt=function(e){try{Ie(de.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Le(),expires:365,secure:!0})}catch(e){i.log("Unable to save session to cookie storage: ",e)}},jt=function(){return(At=At||r(Tt().mark((function e(){var t,n,r,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.A.sessionServer,n="".concat(t,"/api/session"),i.log("Checking server session: ",n),e.next=5,le().get(n,{withCredentials:!0});case 5:if(!(r=e.sent).data){e.next=17;break}return d=r.data.entitlementTokenDecoded,h=r.data,p=h.accessToken,f=h.idToken,g=h.entitlementToken,m=null!==(a=null==d?void 0:d.entitlement_expiry)&&void 0!==a?a:null,v=null!==(s=null==d?void 0:d.entitlement_source)&&void 0!==s?s:null,y=null!==(c=null==d?void 0:d.entitlement_entitled)&&void 0!==c?c:null,w=null!==(u=null==d?void 0:d.entitlement_extras_adfree)&&void 0!==u?u:null,E=null!==(l=null==d?void 0:d.entitlement_level)&&void 0!==l?l:null,Bt(JSON.stringify({accessToken:p,idToken:f,entitlementToken:g,expiration:m,entitlementSource:v,isEntitled:y,adFree:w,entitlementLevel:E})),""!==g&&"string"==typeof g&&Dt(g),e.abrupt("return",{accessToken:p,idToken:f,entitlementToken:g,expiration:m,entitlementSource:v,isEntitled:y,adFree:w,entitlementLevel:E});case 17:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Ht=function(e){return(Lt=Lt||r(Tt().mark((function e(t){var n,r;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=o.A.sessionServer,r="".concat(n,"/api/session"),i.log("Updating server session: ",r),e.next=6,le().post(r,t,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),i.log("Failed to update session server: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},Ft=function(){return(It=It||r(Tt().mark((function e(){var t,n;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=o.A.sessionServer,n="".concat(t,"/api/session"),i.log("Deleting server session: ",n),e.next=6,le().delete(n,{withCredentials:!0});case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),i.log("Failed to delete server session: ",e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)},Xt=function(){return(Nt=Nt||r(Tt().mark((function e(){var t,n,r,o,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E,b,S,A,L,I,N,O,x;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Inside getSession"),e.prev=1,l=Mt(),i.log("Session: __MNG_Session = ",l),d=JSON.parse(l),h=d.accessToken,p=d.idToken,f=d.entitlementToken,g=d.expiration,m=d.entitlementSource,v=d.isEntitled,y=d.adFree,w=d.entitlementLevel,n=h,t=p,r=f,o=g,a=m,s=v,c=y,u=w,i.log("Session: check both tokens: ",t,r),void 0!==p&&void 0!==f&&null!==p&&null!==f){e.next=35;break}return i.log("Session: missing id or entitlements, try session server"),e.next=18,jt();case 18:E=e.sent,b=E.accessToken,S=E.idToken,A=E.entitlementToken,L=E.expiration,I=E.entitlementSource,N=E.isEntitled,O=E.adFree,x=E.entitlementLevel,n=b,t=S,r=A,o=L,a=I,s=N,c=O,u=x;case 35:e.next=40;break;case 37:e.prev=37,e.t0=e.catch(1),i.log("Failed to get session: ",e.t0);case 40:return i.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:o,entitlementSource:a,isEntitled:s,adFree:c,entitlementLevel:u});case 42:case"end":return e.stop()}}),e,null,[[1,37]])})))).apply(this,arguments)},Kt=function(e){return(Ot=Ot||r(Tt().mark((function e(t){var n,r,o,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E,b,S,A,L,I,N,O,x,T,k;return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Mt(),r=JSON.parse(n),o=r.accessToken,a=void 0===o?null:o,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,p=r.entitlementSource,f=void 0===p?null:p,g=r.isEntitled,m=void 0===g?null:g,v=r.adFree,y=void 0===v?null:v,w=r.entitlementLevel,E=void 0===w?null:w,b=t.accessToken,S=t.idToken,A=t.entitlementToken,L=t.expiration,I=t.entitlementSource,N=t.isEntitled,O=t.adFree,x=t.entitlementLevel,T={accessToken:null==b?a:b,idToken:null==S?c:S,entitlementToken:null==A?l:A,expiration:null==L?h:L,entitlementSource:null==I?f:I,isEntitled:null==N?m:N,adFree:null==O?y:O,entitlementLevel:null==x?E:x},i.log("Current session data: ",r),i.log("New session data: ",t),i.log("Updated session data:",T),k=JSON.stringify(T),Bt(k),""!==T.entitlementToken&&"string"==typeof T.entitlementToken&&Dt(T.entitlementToken),n===k){e.next=15;break}return e.next=15,Ht(T);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),i.log("Unable to save session: ",e.t0);case 20:case"end":return e.stop()}}),e,null,[[0,17]])})))).apply(this,arguments)},Wt=function(){return(xt=xt||r(Tt().mark((function e(){return Tt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Ending session..."),Ke(),e.next=4,Ft();case 4:localStorage.removeItem(de.LOCAL_STORAGE_SESSION_KEY);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)};function Yt(){Yt=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var Vt=function(){return"logout"===(be().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var Zt=function(e){return(kt=kt||r(Yt().mark((function e(t){var n;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Je();case 2:n=e.sent,i.log("Calling Auth0 logout..."),n.logout({returnTo:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},Jt=function(){i.log("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){i.log("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=/")}},zt=function(){return(Ct=Ct||r(Yt().mark((function e(){var t,n,o,a,s;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Attempting to logout..."),Jt(),!window.authentication_config.sessionManagementEnabled){e.next=7;break}return e.next=5,Wt();case 5:e.next=8;break;case 7:Ke();case 8:return e.prev=8,i.log("Cycling through logout callbacks..."),t=window.MNGAuthentication.logoutCallbacks.map((function(e){return e()})),e.next=13,Promise.all(t);case 13:i.log("Finished cycling through logout callbacks."),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(8),i.log("Failed to cycle through logout callbacks: ",e.t0);case 19:Object.keys(window.localStorage).filter((function(e){return e.includes("auth0")})).forEach((function(e){window.localStorage.removeItem(e),i.log("Removed Auth0 storage object...")})),Ye("hhsl"),Ye("userNewsLetterData"),Ye(de.REGWALL_USER_IS_SUBSCRIBED),Ye(de.USER_PROFILE_HASH),n=be(),o=window.location.origin;try{n.searchParams.get("returnURL")&&(a=decodeURIComponent(n.searchParams.get("returnURL")),o=a)}catch(e){i.log(e),o=window.location.origin}return o=new URL(o),e.next=31,window.ConnextUtils.connextReady();case 31:if(!e.sent){e.next=63;break}if(i.log("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),i.log("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),s=o,o.origin!==window.location.origin&&(s=new URL(window.location.origin)).searchParams.append("returnAfterLogout",o),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",s),!We()){e.next=44;break}i.log("About to call Connext Logout..."),setTimeout((function(){Connext.Logout()}),500),e.next=61;break;case 44:if("Logged In"!==("undefined"==typeof CnnXt?(i.log("Connext was not loaded."),!1):Connext.Storage.GetUserState())){e.next=58;break}if(i.log("Connext user state is logged in, setting timeout..."),setTimeout(r(Yt().mark((function e(){return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Connext took too long to logout, calling auth0 logout..."),e.next=3,Zt(o);case 3:case"end":return e.stop()}}),e)}))),8e3),"function"!=typeof Connext._logout){e.next=53;break}return i.log("About to call Connext _logout..."),e.next=51,Connext._logout();case 51:e.next=56;break;case 53:return i.log("About to call Connext Logout..."),e.next=56,Connext.Logout();case 56:e.next=61;break;case 58:return i.log("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=61,Zt(o);case 61:e.next=66;break;case 63:return i.log("Connext Logout was NOT called"),e.next=66,Zt(o);case 66:case"end":return e.stop()}}),e,null,[[8,16]])})))).apply(this,arguments)},qt=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},Qt=function(e,t,n,o,a){return(Rt=Rt||r(Yt().mark((function e(t,n,r,o,a){var s,c,u,l,d,h,p,f,g,m,v,y,w;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("Attempting to login..."),qt()>4.5&&window.localStorage.clear(),window.MNGAuthentication.preAuthGTMEvents.forEach((function(e){return St(e)})),i.log("Cycled through preauth GTM events."),o&&(s=[],c=window.localStorage.getItem("callbackEvents"),u=JSON.parse(c),s=u&&u.length>0?wt(new Set([].concat(wt(o),wt(u)))):o,window.localStorage.setItem("callbackEvents",JSON.stringify(s))),l=null,e.next=7,Je();case 7:if(d=e.sent,h=be(),p=h.origin,f=new URL("".concat(p,"/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")?f.searchParams.set("auth_redirect",h.searchParams.get("returnUrl")):a&&f.searchParams.set("auth_redirect",a):f.searchParams.set("auth_redirect",h.toString()),m&&"regwall"!==t&&f.searchParams.set("auth_redirect",m),"true"===h.searchParams.get("close-after-finish")&&f.searchParams.set("close-after-finish","true"),"true"!==h.searchParams.get("ssl")){e.next=23;break}if(!window.authentication_config.sessionManagementEnabled){e.next=22;break}return e.next=20,Wt();case 20:e.next=23;break;case 22:Ke();case 23:return null!==(l=h.searchParams.get("login-with"))?g.connection=l:n&&(g.connection=n),v="none",t&&"regwall"===t&&(f.searchParams.set("regwall","true"),v="signUp",i.log("Logging in with regwall")),t&&(f.searchParams.set("loginsource",t),i.log("Logging in with ".concat(t))),r&&(g.login_hint=r),g.redirect_uri=f.toString(),g.initialScreen=v,"googleonetap"!==t&&(g.prompt="select_account"),null!==(y=h.searchParams.get("ampRegiWall"))&&(w=window.location.hostname,g.ampRegiWall=y,g.sourceDomain=w.replace("www.","").replace("preprod.","").replace("develop.",""),g.initialScreen="signUp",g.preferenceId=h.searchParams.get("prefId")),e.next=36,d.loginWithRedirect({authorizationParams:g});case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)},$t=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();i.log("Adding listeners to events we need to wait for...");var o=r.map((function(e){return t=e,new Promise((function(e){i.log("Adding event to wait for: ",t),window.addEventListener(t,(function(n){try{var r=n.detail||{};i.log("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){i.log(t),e()}}),!1)}));var t}));Promise.all(o).then((function(){clearTimeout(t),e()}))}catch(t){i.log("Failed to wait for callback events",t),e()}}))};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var en=function(){return(_t=_t||r(Yt().mark((function e(){var t,n,o,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E,b,S,A;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Jt(),t=be(),n=!1,o=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),a=t.searchParams.get("redirect_uri")||"",a.includes("applenews")?(i.log("This is Apple prelogin flow."),(s=new URL(a))?(s.searchParams.append("post-apple-login","true"),i.log("Post callback Apple redirect URL is ".concat(s)),Qt(!1,!1,!1,[],s)):Qt()):o.includes("post-apple-login")&&(i.log("This is Apple Callback flow."),n=!0,(c=new URL(decodeURIComponent(o))).searchParams.delete("post-apple-login"),o=c),i.log("Handling post login callback..."),!(u=t.searchParams.get("error_description"))){e.next=13;break}if("shouldAutoLogin"!==u){e.next=12;break}return e.abrupt("return",Qt(!1,!1,!1,!1,o));case 12:n&&alert("There was an error in logging you in, please try again.");case 13:return e.next=15,Je();case 15:return l=e.sent,e.next=18,l.handleRedirectCallback();case 18:return e.next=20,l.getIdTokenClaims();case 20:return d=e.sent,e.next=23,l.getUser();case 23:return h=e.sent,i.log("Auth0 user profile: ",h),p=d.__raw,e.next=28,l.getTokenSilently();case 28:return f=e.sent,e.prev=29,i.log("Cycling through login callbacks..."),e.next=33,$t();case 33:return m=window.MNGAuthentication.oidcLoginCallbacks.map((function(e){return(g=g||r(Yt().mark((function e(t){return Yt().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)})))).apply(this,arguments)})),e.next=36,Promise.all(m);case 36:i.log("Finished cycling through login callbacks."),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(29),i.log("Failed to cycle through login callbacks: ",e.t0);case 42:if(v={accessToken:f,userId:h.sub,email:h.email,picture:h.picture},y=!1,w="",!n){e.next=61;break}return e.prev=46,e.next=49,Ce(v.userId);case 49:return w=e.sent,i.log("Encrypted apple uuid is: ".concat(w)),e.next=53,ke(w);case 53:y=e.sent,i.log("Apple sub status is: ".concat(y)),e.next=61;break;case 57:e.prev=57,e.t1=e.catch(46),i.log("Apple sub check error: ".concat(e.t1)),alert("There was an error in logging you in, please try again.");case 61:if(Ye(de.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=66;break}return i.log("Saving idToken to session server"),e.next=66,Kt({idToken:p,accessToken:f});case 66:if(!t.searchParams.get("close-after-finish")){e.next=68;break}return e.abrupt("return",window.close());case 68:if(!t.search.includes("loginsource")){e.next=73;break}return b=t.searchParams.get("loginsource"),S=window.MNGAuthentication.postAuthEvents.map((function(e){return(E=E||r(Yt().mark((function e(t){return Yt().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)})))).apply(this,arguments)})),e.next=73,Promise.all(S);case 73:return e.prev=73,A=new URL(o),n&&y&&A.searchParams.append("access_token",w),i.log("Apple redirect URL:",A),e.abrupt("return",window.location.assign(A));case 80:e.prev=80,e.t2=e.catch(73),i.log("Failed to redirect after authentication: ",e.t2);case 83:return window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 85:case"end":return e.stop()}}),e,null,[[29,39],[46,57],[73,80]])})))).apply(this,arguments)},tn=function(){return(Pt=Pt||r(Yt().mark((function e(){return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("ANALYTICS: fireBC events"),e.next=3,bt();case 3:i.log("ANALYTICS: bc values should be filled");case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)},nn=function(){return(Gt=Gt||r(Yt().mark((function e(){var t,n,r,o,a,s,c,u,l,d,h,p,f;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,He();case 2:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=18;break}return e.prev=6,s=xe(n),c=s.email,u=s.picture,l=s.sub,d=s.name,h=s.nickname,p=s.connection_source,f=null===(o=s.user_metadata)||void 0===o||null===(a=o.customProfile)||void 0===a?void 0:a.nickname,l.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:f||h||d,email:c,picture:u,userId:l,connectionSource:p});case 15:e.prev=15,e.t0=e.catch(6),i.log("Unable to parse idToken: ",n," Error: ",e.t0);case 18:return e.abrupt("return",{authenticated:r});case 19:case"end":return e.stop()}}),e,null,[[6,15]])})))).apply(this,arguments)};window.MNGAuthentication.login=Qt,window.MNGAuthentication.logout=zt,window.MNGAuthentication.getUserInfo=nn;var rn=function(){return(Ut=Ut||r(Yt().mark((function t(){var n,a,s,c,u,l,d,h,p,f,g,m,v;return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=be(),s=!1,c="",u=!1,l={},Vt()&&window.ConnextUtils.rerunConnextEntitlements(!0),a.searchParams.get("returnAfterLogout")&&(d=decodeURIComponent(a.searchParams.get("returnAfterLogout")),window.location.assign(d)),a.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),h=function(){return(n=n||r(Yt().mark((function t(){var n,r;return Yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Je();case 3:return n=t.sent,t.next=6,n.getIdTokenClaims();case 6:return l=t.sent,t.next=9,n.isAuthenticated();case 9:if(s=t.sent,c="object"===e(l)?l.__raw:"",r=Se(de.ENTITLEMENT_COOKIE_KEY),s||!r){t.next=16;break}return t.next=15,n.getTokenSilently();case 15:u=t.sent;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(0),i.log("Unable to verify user has active auth0 session: ",t.t0);case 21:case"end":return t.stop()}}),t,null,[[0,18]])})))).apply(this,arguments)},!a.pathname.startsWith("/logout")){t.next=14;break}return i.log("Page is logout. Routing to logout function..."),t.next=13,zt();case 13:return t.abrupt("return");case 14:if(!window.authentication_config.sessionManagementEnabled){t.next=40;break}return t.next=17,h();case 17:if(""===c){t.next=26;break}if(p=null,f=JSON.parse(window.localStorage.getItem(de.LOCAL_STORAGE_SESSION_KEY)),"{}"!==Mt()){t.next=24;break}return f&&(p=f.jwt),t.next=24,Kt({idToken:c,entitlementToken:p});case 24:t.next=38;break;case 26:return t.prev=26,t.next=29,Xt();case 29:g=t.sent,c=g.idToken,(s="string"==typeof c)&&(l=xe(c)),t.next=38;break;case 35:t.prev=35,t.t0=t.catch(26),i.log("Unable to initialize session: ",t.t0);case 38:t.next=42;break;case 40:return t.next=42,h();case 42:if(s||u||!o.A.blueconicEnabled||!o.A.bcLowaSegements){t.next=47;break}return t.next=45,De(!0);case 45:(m=t.sent).isSub&&(s=de.USER_IS_LOWA,l={sub:m.uuid});case 47:if(ze({isAuthenticated:s,idToken:c,accessToken:u,claims:l}),$e("authenticationReady"),!0===s?(i.log("User is authenticated."),a.searchParams.get("auth_redirect")&&(i.log("Auth Redirect is present, sending user to auth redirect..."),(v=a.searchParams.get("auth_redirect")).endsWith("#")&&(v=v.slice(0,v.length)),window.location.assign(v)),a.pathname.startsWith("/login")&&!Vt()&&(i.log("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(a.origin))):i.log("User is not authenticated."),a.pathname.startsWith("/login")&&!Vt()?(i.log("Page is login. Attempting to log user in..."),Qt()):i.log("Page is not login or Connext state is present"),!a.pathname.startsWith("/callback")||!a.searchParams.get("regwall")){t.next=60;break}return i.log("Page is callback with regwall param. Routing to regwall receiver..."),t.next=56,tn();case 56:i.log("Now login from regwall"),Qt(),t.next=64;break;case 60:if(!a.pathname.startsWith("/callback")){t.next=64;break}return i.log("Page is callback without regwall param. Routing to callback receiver..."),t.next=64,en();case 64:case"end":return t.stop()}}),t,null,[[26,35]])})))).apply(this,arguments)};window.MNGAuthentication.init=rn;function on(e,t){for(var n=0;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var cn=function(e){Ie(de.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:Le(),expires:365,secure:!0})},un=function(e){return(an=an||r(sn().mark((function e(t){var n;return sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,cn(t),i.log("About to decode token before saving: ",t),n=xe(t),!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=7,Kt({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 7:e.next=10;break;case 9:window.localStorage.setItem(de.LOCAL_STORAGE_SESSION_KEY,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 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),i.log("Entitlements: Failed to save token: ",e.t0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)},ln=function(t){return new Promise((function(n,a){var s;if(i.log("Entitlements: create token start..."),i.log("Entitlements: createToken payload with ",t),"object"!==e(t)&&"string"!=typeof t.sub)return a(new Error("No user info to create token"));var c,u,l=Ae();if(t.sub&&(c=t.sub),t.idToken&&(u=t.idToken),!u&&!c)throw new Error("No idToken or uuid provided.");var d={publication:l.replace(".local",".com"),requestSource:"website"};u&&(d.idToken=u),c&&(d.uuid=c);var h="".concat(o.A.entitlementsEndpoint,"session/create");return i.log("Entitlements: create payload",d),$.ajax({type:"POST",url:h,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":o.A.entitlementsApiKey},data:JSON.stringify(d),success:function(e){return(s=s||r(sn().mark((function e(t){return sn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t.jwt){e.next=2;break}return e.abrupt("return",a(new Error("Entitlements | API returned no JWT")));case 2:return i.log("Entitlements: Token Created: ",t),e.next=5,un(t.jwt);case 5:return e.abrupt("return",n(t.jwt));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},error:function(e,t,n){i.log("Entitlements: Create Token Failure: ",t,n),a(new Error("Entitlements: Create Token Failure"))}})}))};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.isUserAdFree=function(){var e=JSON.parse(window.localStorage.getItem(de.LOCAL_STORAGE_SESSION_KEY));return null!=e?(i.log("Ad Free Check: : ",e.adFree),e.idToken&&e.adFree||o.A.isAdfreeArticle):o.A.isAdfreeArticle},window.MNGAuthentication.isUserSubscriber=function(){var e=JSON.parse(window.localStorage.getItem(de.LOCAL_STORAGE_SESSION_KEY));return null!=e&&(i.log("Subscriber Check: : ",e.isEntitled),e.isEntitled)};var dn,hn;function pn(){pn=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var fn=function(e,t){var n=e.toLowerCase(),r="";return["@medianewsgroup.com","@tribpub.com","@activeone.co"].forEach((function(e){t&&t.endsWith(e)&&(r="corporate")})),!!n.includes("employee")&&{employeeAccess:!0,accessGroup:r}},gn=function(e){return new Promise((function(t){i.log("Entitlements: get UUID from email start...");var n=Te(),r=Ae(),a="".concat(o.A.entitlementsEndpoint,"auth0/users/").concat(e,"?all=true&spoofUser=true&domain=").concat(r);return $.ajax({type:"GET",url:a,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":o.A.entitlementsApiKey},success:function(e){i.log("Entitlements: Request successful: ",e);var r=e&&e.identities&&e.identities.some((function(e){return n?"Trib"===e.connection.split("-")[0]:"Trib"!==e.connection.split("-")[0]}))?e:null;if(!r)return i.log("Entitlements: No matching user identity found."),t(!1);var o=JSON.stringify(e),a=btoa(encodeURIComponent(o));localStorage.setItem("spoofed-user-profile",a);var s={uuid:r.identities[0].user_id,provider:r.identities[0].provider};return t(s)},error:function(e,n,r){i.log("Entitlements: uuid request Failure: ",r),t(!1)}})}))},mn=function(){return(dn=dn||r(pn().mark((function e(){return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){var n=Connext,r={},o=!1,a=setTimeout((function(){o=!0,clearInterval(s),t(new Error("Timeout: User state did not change within the specified time"))}),2e4),s=setInterval((function(){var t=n.Storage.GetUserState();i.log("Employee tools: Checking Connext UserState, state is: ".concat(t)),void 0!==t&&"Logged Out"!==t&&(r.conversation=n.Storage.GetCurrentConversation().Name,r.userState=t,r.campaign=n.Storage.GetLocalConfiguration().Campaign.Name,r.meter=n.Storage.GetLocalConfiguration().DynamicMeter.Name,clearInterval(s),clearTimeout(a),e(r))}),600);o&&(clearInterval(s),t(new Error("Timeout: User state did not change within the specified time")))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)},vn=function(e,t,n){function o(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.source=e,this.email=t,this.employeeId=n,this.spoofContent=document.createElement("p"),this.spoofBanner=document.createElement("div")}var a,s,c;return a=o,s=[{key:"clearSpoofedUser",value:function(){return(e=e||r(pn().mark((function e(){var t;return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return document.getElementById("spoof-banner").remove(),this.userSpoofCheckbox.checked=!1,o.deleteLocalStorageSpoofUser(),e.next=5,ln({sub:this.employeeId,email:this.email,email_verified:!0});case 5:if(t=e.sent,!window.authentication_config.sessionManagementEnabled){e.next=11;break}return e.next=9,Ft();case 9:return e.next=11,Kt({idToken:this.idToken,entitlementToken:t});case 11:window.sessionStorage.removeItem("dashboard-state"),window.location.reload();case 13:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}},{key:"handleUserSpoofAction",value:function(e){return(t=t||r(pn().mark((function e(t){var n,r,a,s,c,u;return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("employee tools: handling spoof"),e.next=3,He();case 3:if(n=e.sent,r=n.idToken,a=localStorage.getItem(de.USER_PROFILE_HASH),!t.target.checked){e.next=46;break}if(s=window.prompt("Enter the email of the user you want to spoof:")){e.next=11;break}return t.target.checked=!1,e.abrupt("return");case 11:return this.userSpoofCheckbox.checked=!0,this.addSpoofBannerToPage("Fetching entitlements for ".concat(s," ..."),"greenyellow"),e.prev=13,e.next=16,gn(s);case 16:if(c=e.sent,i.log("employee tools: spoof user data: ",c),c&&"string"==typeof c.uuid){e.next=23;break}return this.spoofBanner.style.backgroundColor="red",this.spoofContent.textContent="User could not be found with that address, check for typos.",this.userSpoofCheckbox.checked=!1,e.abrupt("return");case 23:return e.next=25,ln({sub:"".concat(c.provider,"|").concat(c.uuid),email:s,email_verified:!0});case 25:if(u=e.sent,!window.authentication_config.sessionManagementEnabled){e.next=32;break}return e.next=29,Ft();case 29:return e.next=31,Kt({idToken:r,entitlementToken:u});case 31:o.deleteLocalStorageManualExpiration();case 32:window.localStorage.setItem("spoof-user",s),window.sessionStorage.removeItem("dashboard-state"),o.removeUserProfileHash(a),window.location.reload(),e.next=44;break;case 38:e.prev=38,e.t0=e.catch(13),i.log("Error fetching user spoof entitlements",e.t0),this.spoofBanner.style.backgroundColor="red",this.spoofContent.textContent="Error fetching user entitlements",this.userSpoofCheckbox.checked=!1;case 44:e.next=50;break;case 46:return o.deleteLocalStorageManualExpiration(),o.removeUserProfileHash(a),e.next=50,this.clearSpoofedUser();case 50:case"end":return e.stop()}}),e,this,[[13,38]])})))).apply(this,arguments)}},{key:"addEventListeners",value:function(){document.getElementById("user-spoof-control").addEventListener("click",this.handleUserSpoofAction.bind(this)),document.getElementById("expiration-control").addEventListener("change",(function(e){var t=document.getElementById("datepicker-wrapper");!0===e.currentTarget.checked?t.classList.contains("show-picker")||t.classList.add("show-picker"):(t.classList.contains("show-picker")&&t.classList.remove("show-picker"),window.localStorage.getItem("manual-expiration")&&(window.localStorage.removeItem("manual-expiration"),clearInterval(o.interval),document.getElementById("expiration-pop-up").remove()))}))}},{key:"addSpoofBannerToPage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"deeppink";i.log("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:function(){return(n=n||r(pn().mark((function e(){var t,n,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E,b,S,A,L,I,N,O,x;return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.MNGAuthentication.logoutCallbacks.push(o.deleteLocalStorageSpoofUser),t=window.localStorage.getItem("spoof-user"),n=window.localStorage.getItem("manual-expiration"),a=fn(this.source,this.email),i.log("employee tools: validate employee:",a),this.email&&this.employeeId&&(t||!this.source||a.employeeAccess&&"corporate"===a.accessGroup)&&(this.source||t)){e.next=7;break}return e.abrupt("return");case 7:(s=document.createElement("div")).id="employee-debugger",s.classList="employee-debugger-close",(c=document.createElement("div")).id="employee-debugger-button",c.innerHTML='\n\t\t\t\n\t\t',(u=document.createElement("div")).id="employee-debugger-content",u.innerHTML="\n\t\t\t

MNG Debugger

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

Entitlements JWT

\n\t\t',Object.keys(L).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(L[e],""),t.append(n,i),O.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)}))})),(x=document.createElement("div")).style.padding="5px 0px 0px 10px",x.innerHTML='\n\t\t\t\t

Connext answer

\n\t\t\t\t',document.addEventListener("onInit",r(pn().mark((function e(){var t,n;return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof Connext){e.next=7;break}(t=document.createElement("p")).className="connext-error-message",t.innerHTML="Something went wrong, reload may solve the issue.",x.append(t),e.next=11;break;case 7:return e.next=9,mn();case 9: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),x.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 11:case"end":return e.stop()}}),e)})))),document.getElementById("employee-debugger-content").append(l,O,x),document.getElementById("employee-debugger-toggles").append(d),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%"})),!t&&this.source&&this.source.toLowerCase().includes("employee")&&wt(f).forEach((function(e){var t=e;t.textContent="Subscriber - Employee",t.style.color="blue"})),t&&(this.addSpoofBannerToPage(p),this.userSpoofCheckbox.checked=!0,wt(f).forEach((function(e){var t=e;t.textContent="Subscriber - Employee (spoofing)",t.style.color="blue"}))),document.getElementById("apply-exp-btn").addEventListener("click",(function(){var e,t=null===(e=new Date(y.value))||void 0===e?void 0:e.getTime(),n=Math.floor(t/1e3);A.expiration=n,localStorage.setItem("__MNG_Session",JSON.stringify(A)),window.localStorage.setItem("manual-expiration",!0),o.interval&&clearInterval(o.interval),o.timeLeftPopUp(A.expiration)})),document.getElementById("reset-exp-btn").addEventListener("click",(function(){y.value=N.toISOString().replace(/.\d+Z$/g,"")})),this.addEventListeners(),n&&(this.datePickerCheckbox.click(),o.timeLeftPopUp(A.expiration));case 82:case"end":return e.stop()}}),e,this)})))).apply(this,arguments)}}],c=[{key:"deleteLocalStorageSpoofUser",value:function(){window.localStorage.removeItem("spoof-user"),window.localStorage.removeItem("spoofed-user-profile"),localStorage.getItem("userNewsLetterData")&&window.localStorage.removeItem("userNewsLetterData"),i.log("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(de.USER_PROFILE_HASH)}}],s&&on(a.prototype,s),c&&on(a,c),o}(),yn=function(e,t){return(hn=hn||r(pn().mark((function e(t,n){var o,a,s;return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.log("Employee Tools: employeeAds: "),o=fn(t,n),i.log("employee tools: validate employee:",o),"corporate"===o.accessGroup&&o.employeeAccess){e.next=5;break}return e.abrupt("return",!1);case 5:return e.next=7,new Promise((function(e){if(Re())e();else{i.log("UIHandler: Employee Debugger: ","Waiting for the digisubs debugger toolbox to load...");var t=setInterval(r(Ee().mark((function n(){return Ee().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)}}));case 7:return(a=document.createElement("div")).id="employee-debugger-adfree",a.innerHTML='\n\t\t\n\t\t\n\t\t

(page will reload)

\n\t',document.getElementById("employee-debugger-toggles").append(a),(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){i.log("employee tools: employee ad toggle clicked"),e.target.checked?(i.log("Employee tools: employee ads: turn off"),localStorage.setItem("hhsl","access"),window.MNGAuthentication.isUserAdFree=!0,setTimeout((function(){window.location.reload()}),500)):(i.log("Employee tools: employee ads: turn on"),localStorage.removeItem("hhsl"),setTimeout((function(){window.location.reload()}),500))})),e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)};var wn;function En(){En=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var bn,Sn,An,Ln,In,Nn=[],On=Oe();On=On.replace("local","com");var xn="".concat(o.A.entitlementsEndpoint,"newsletters"),Tn=function(e){var t=new Date,n=Math.round(t.getTime()/1e3)-86400;return new Date(e)>=new Date(1e3*n).getTime()},kn=function(e){return(wn=wn||r(En().mark((function e(t){var n,r,a;return En().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=xn,"get"===t.method&&(n="".concat(n,"?email=").concat(t.dataToSend.email,"&domain=").concat(t.dataToSend.domain,"&nocache=").concat((new Date).getTime())),e.prev=2,e.next=5,le()({method:t.method,url:n,headers:{"X-Api-Key":o.A.entitlementsApiKey},data:t.dataToSend});case 5:r=e.sent,"get"===t.method&&((Nn=r.data.responseData).sort((function(e,t){return e.title>t.title?1:-1})),"limited"===Sn?(a=Nn.filter((function(e){return!e.subscriberOnly})),localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:new Date,newsLetterData:a}))):localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:new Date,newsLetterData:Nn})),Gn()),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),i.log("newsletter: ",e.t0);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)},Cn=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)"},Rn=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,Nn.find((function(e){return e.id===o})).isSubscribed=i,t.method=i?"post":"delete",t.dataToSend={email:bn,domain:On,preferenceId:o},Pn(t)},_n=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=Cn())))}},Pn=function(e){localStorage.setItem("userNewsLetterData",JSON.stringify({expoDate:An,newsLetterData:Nn})),kn({method:e.method,dataToSend:e.dataToSend})},Gn=function(){var e=document.createElement("div"),t=document.createElement("span");t.classList.add("icon-arrow-right","newsletter-icon"),t.addEventListener("click",_n),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",_n);var r=e.cloneNode(!0);r.classList.add("show-digisubs-push","newsletter-dropdown-title"),r.style.display="flex",r.addEventListener("click",_n),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"),h=Qe();d.setAttribute("href","https://myaccount.".concat(h)),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 p=a.cloneNode(!0);o.append(a),i.append(p);var f,g,m,v=(f={},Nn.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=(g=v,m=Object.keys(g).sort((function(e,t){return"My Newsletters:"===e?-1:"My Newsletters:"===t?1:e.localeCompare(t)})),"My Newsletters:"===m[0]?m.splice(1,0,"".concat(In," Newsletters:")):m=["".concat(In," Newsletters:")].concat(wt(m)),m);v["".concat(In," 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(In," Newsletters:")||r.classList.add("newsLetterTitleBold");var a=r.cloneNode(!0);t.append(r),n.append(a),o.append(t),i.append(n),v[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",Rn),Ln&&(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",Rn),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 Un=function(e,t,n,r){if(bn=e,Sn=t,In=r,Ln=n){Ye("userNewsLetterData");for(var o=document.getElementById("newsLetterContent-dropdown"),a=document.getElementById("newsLetterItem-push");o.firstChild;)o.firstChild.remove();for(;a.firstChild;)a.firstChild.remove()}if(i.log("host for newsletter prefs",On),localStorage.getItem("userNewsLetterData")){var s=JSON.parse(localStorage.getItem("userNewsLetterData"));An=s.expoDate,Tn(An)?(Nn=s.newsLetterData,Gn()):kn({method:"get",dataToSend:{email:bn,domain:On}})}else kn({method:"get",dataToSend:{email:bn,domain:On}})};var Mn;function Bn(){Bn=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var Dn=function(){var e=lt()?lt().querySelector(it):null,t=lt();null!==e&&t.removeChild(e)};function jn(e){var t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}const Hn=function(e){return(Mn=Mn||r(Bn().mark((function e(t){var n,r,a,s,u,l,d,h,p,f,g,m,v,y,w,E,b,S,A,L,I,N,O,x,T,k,C,R,_,P,G,U,M,B,D,j,H,F,X,K,W,Y,V,Z,J,z,q,Q,$,ee,te,ne,re,oe,ie,ae,se,ce,ue,le,he,pe,fe,ge,me,ve,ye,we,Ee,Se,Le,Ie,Ne,Oe,xe,Te;return Bn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.authenticatedStatus,r=t.email,a=t.nickname,s=t.picture,u=t.connectionSource,l=t.entitlementSource,d=t.entitlementOrganization,h=t.entitlementLevel,p=t.serviceCode,f=t.isEedition,g=t.accountHref,m=t.userId,v="",y=" | Logged in with ",w=[],E=r,b=function(){return window.innerWidth<=768},S=function(e){if(!e)return" ";var t=c(e.split("@"),2),n=t[0],r=t[1],o=n.length>15?n.substring(0,15):n,i=r.length>20?"...".concat(r.slice(-20)):r;return"".concat(o,"@").concat(i)},A=function(e){if(!e)return" ";var t=c(e.split("@"),2),n=t[0],r=t[1],o=n.length>11?n.substring(0,11):n,i=r.length>10?"...".concat(r.slice(-10)):r;return"".concat(o,"@").concat(i)},void 0!==r&&"undefined"!==r&&r&&!r.endsWith("@example.com")||(E=a||"Logged In"),L=u.replace("Trib-","").toLowerCase(),e.prev=10,e.t0=L,e.next="google-oauth2"===e.t0||"google"===e.t0?14:"facebook"===e.t0?16:"apple"===e.t0?18:20;break;case 14:return y+="Google",e.abrupt("break",22);case 16:return y+="Facebook",e.abrupt("break",22);case 18:return y+="Apple",e.abrupt("break",22);case 20:return y="",e.abrupt("break",22);case 22:e.t1=h,e.next="limited"===e.t1?25:"subscriber"===e.t1||"freeTrial"===e.t1?27:"premium"===e.t1?29:"comp"===e.t1?31:"partner-access"===e.t1?33:35;break;case 25:return v="Limited Access",e.abrupt("break",37);case 27:return v="Standard Digital Access",e.abrupt("break",37);case 29:return v="Premium Ad-Free Access",e.abrupt("break",37);case 31:return v="Standard Digital Trial",e.abrupt("break",37);case 33:return v="Partner Access",e.abrupt("break",37);case 35:return v="Anonymous",e.abrupt("break",37);case 37:for(n===de.USER_IS_LOWA&&(y="",v="Anonymous"),f&&p&&p.includes("P")&&(v="Limited Subscription - e-Edition access"),d&&(v="".concat("Standard Digital Access"===v?"Access":"Premium Ad-Free Access"===v?"Ad-Free Access":v," provided by ").concat(d)),Dn(),document.getElementById(st).style.display="none",ht().dataset.status="logged-in",(N=ft()).removeChild(N.firstChild),(O=document.createElement("a")).id="anchorProfileDropDown",O.className="nav-link dropdown-toggle dropdown-toogle-mobile",O.setAttribute("aria-label","Account menu dropdown"),O.style.cursor="pointer",O.setAttribute("tabindex","0"),O.setAttribute("aria-expanded","false"),x=document.createElement("img"),T=document.getElementById("pushnav-icon"),x.className="rounded-circle",x.alt="Profile image",T.className="rounded-circle",x.src=s,T.src=s,s||(x.src="https://ui-static-assets-prod.mng-digisubs-prod.com/img/no-icon.png",T.src="https://ui-static-assets-prod.mng-digisubs-prod.com/img/no-icon.png"),(k=document.createElement("span")).className="icon-arrow-down",k.id="icon-caret",k.setAttribute("aria-hidden","true"),C=document.createElement("div"),(R=document.createElement("div")).id="account-content",R.className="dropdown-menu",C.id="account-content-container",document.body.appendChild(C),N.append(O,R),_="",window.dataLayer.forEach((function(e){Object.prototype.hasOwnProperty.call(e,"SiteName")&&(_=e.SiteName)})),P=window,G=P.location,U=new URL(G),B=null,n!==de.USER_IS_LOWA?((B=document.createElement("a")).className="dropdown-item dropdown-profile account-link",B.text=E):document.getElementById("push-email-link").style.display="none",n===de.USER_IS_LOWA&&((D=document.createElement("li")).className="dropdown-item log-in-button subscribe-special custom-button",j=document.createElement("a"),H=be(),j.href="/login?returnUrl=".concat(H),j.target="_blank",j.text="Complete Log In",j.style.cursor="pointer",j.style.margin="0",j.style.width="auto"),F=jn('\n\t\t\t'),X=b()?A:S,K=X(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"),ke=void 0,ke=document.querySelectorAll("".concat(ot," a")),Y=ke.length>0?ke[0]:null,V=Ae(),Z="https://checkout.".concat(V),Y&&(Z=Y.href,console.log(Z)),J="subscriber"===h||"premium"===h?"\n\t\t\t\t
\n\t\t\t\t\t
".concat(a,"
\n\t\t\t\t\t
").concat(K,"
\n\t\t\t\t
"):"\n\t\t\t\t
\n\t\t\t\t\t
".concat(a,"
\n\t\t\t\t\t
").concat(K,"
\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
"),z=jn(J),W.appendChild(z),(q=document.createElement("a")).className="dropdown-item account-link account-settings",q.setAttribute("data-mng-click","account-settings"),q.setAttribute("data-mng-category","account-link"),q.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(v,'
\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
'),$=jn(Q),q.appendChild($),o.A.enableReaderDashboardLink&&((M=document.createElement("a")).className="dropdown-item",M.id="reader-dashboard-link",M.setAttribute("data-mng-click","reader-dashboard"),M.setAttribute("data-mng-category","account-link"),M.setAttribute("data-mng-action","reader-dashboard"),M.href="".concat(U.origin,"/user-tools/dashboard"),M.target="_blank",ee=jn('\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
'),M.appendChild(ee)),(te=document.createElement("a")).className="dropdown-item",te.setAttribute("data-mng-click","gifted-articles"),te.setAttribute("data-mng-category","account-link"),te.setAttribute("data-mng-action","gifted-articles"),te.href="".concat(U.origin,"/user-tools/dashboard/#shared-articles-container"),te.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=jn(ne),te.appendChild(re),(oe=document.createElement("a")).className="dropdown-item",oe.href="".concat(U.origin,"/user-tools/dashboard/#saved-article-container"),oe.target="_blank",ie="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
',ae=jn(ie),oe.appendChild(ae),(se=document.createElement("a")).className="dropdown-item",se.href="".concat(U.origin,"/contact-us"),se.target="_blank",se.setAttribute("data-mng-click","contact-us"),se.setAttribute("data-mng-category","account-link"),se.setAttribute("data-mng-action","contact-us"),ce=jn('\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
'),se.appendChild(ce),(ue=document.createElement("a")).className="dropdown-item",ue.href="".concat(U.origin,"/logout"),se.setAttribute("data-mng-click","logout"),se.setAttribute("data-mng-category","account-link"),se.setAttribute("data-mng-action","logout"),le=jn("\n\t\t
\n\t\t\t
\n\t\t\t\t
Log Out
\n\t\t\t
\n\t\t
"),ue.appendChild(le),(he=document.createElement("a")).className="dropdown-item",he.setAttribute("data-mng-click","marketing-content"),he.setAttribute("data-mng-category","marketing-content"),he.setAttribute("data-mng-action","marketing-content"),pe=jn("\n\t\t
\n\t\t\t
\n\t\t\t\tSAMPLE MARKETING ITEM HERE\n\t\t\t
\n\t\t
"),he.appendChild(pe),N.id="profileDropDown",N.className="nav-item dropdown auth-visible show",O.append(x,k),D&&document.getElementById("account-content").append(D),fe=[F,W].concat(wt(M?[M]:[]),[q,te,oe,se,ue,he]),(I=document.getElementById("account-content")).append.apply(I,wt(fe)),document.getElementById("push-auth-source").textContent="".concat(v).concat(y),document.getElementById("push-email-link").textContent=E,document.getElementById("push-account-content").style.display="block",document.getElementById("blank-icon-user").style.display="none",o.A.enableReaderDashboardLink&&((ge=document.createElement("a")).className="show-digisubs-push dashboard-link",ge.id="push-reader-dashboard",ge.text="Reader Dashboard",ge.href="".concat(U.origin,"/user-tools/dashboard"),document.querySelector("#push-account-link").after(ge)),i.log("Employee tools: start tools here",l,r,m),!1===(me=l)&&(me="none"),(ve=new vn(me,r,m)).init(),yn(me,r),o.A.newslettersEnabled&&h&&(ye=E,we=!1,ve.userSpoofCheckbox&&(we=ve.userSpoofCheckbox.checked),localStorage.getItem("spoof-user")&&(ye=localStorage.getItem("spoof-user")),!0===n&&Un(ye,h,we,_)),Ee=document.getElementById("account-content"),Se=document.querySelector(".search-icon-wrapper"),Le=function(){var e=Ee.classList.contains("show");k.className=e?"icon-arrow-up":"icon-arrow-down",O.setAttribute("aria-expanded",e.toString()),e?(null==Se||Se.classList.add("search-icon-wrapper-hide"),C.style.display="block"):(null==Se||Se.classList.remove("search-icon-wrapper-hide"),C.style.display="none")},window.addEventListener("resize",Le),O.addEventListener("click",(function(){Ee.classList.toggle("show"),Le()})),document.getElementById("anchorProfileDropDown").addEventListener("keydown",(function(e){"Enter"===e.key&&(Ee.classList.toggle("show"),Le())})),document.addEventListener("click",(function(e){O.contains(e.target)||Ee.contains(e.target)||(Ee.classList.remove("show"),Le())})),w=document.getElementsByClassName("account-link"),Ie=0;Ie=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}var $n=function(){return(Fn=Fn||r(Qn().mark((function e(){var t,n,r,i,a,s,c,u,l,d,h,p,f,g,m,v,y;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!1,n="Naviga",r="",i="Anonymous",a=!1,s=!1,c="",!o.A.entitlementsEnabled){e.next=14;break}return e.next=10,Fe();case 10:(u=e.sent)&&u.token&&(l=u.token,d=xe(l),h=d.entitlement_entitled,p=d.entitlement_source,f=d.entitlement_organizationName,g=d.entitlement_level,m=d.entitlement_serviceCode,v=d.entitlement_isEedition,y=d.email,t=h||!1,n=p||!1,i=g||"Anonymous",a=m||!1,s=v||!1,c=y||"",r=f||""),e.next=15;break;case 14:"undefined"!=typeof Connext&&"Subscribed"===Connext.Storage.GetUserState()&&(t=!0);case 15:return e.abrupt("return",{userIsEntitled:t,entitlementSource:n,entitlementOrganization:r,entitlementLevel:i,serviceCode:a,isEedition:s,tokenEmail:c});case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)},er=function(e){return(Xn=Xn||r(Qn().mark((function e(t){var n,r,o;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=be(),r=t.querySelector("a"),(o=new URL(r.href)).searchParams.set("returnUrl",encodeURIComponent("".concat(n.href,"?newUser=true"))),r.setAttribute("href",o.href);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},tr=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))?(i.log("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))},nr=function(e){return(Kn=Kn||r(Qn().mark((function e(t){var n,r,o,i;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.entitlementSource,r=t.accountHref,o="My Account",void 0!==window.MNGPaywall&&"Piano"===n&&(o="Account"),(i=gt()).textContent=o,i.setAttribute("href",r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)},rr=function(e){try{void 0!==window.MNGAuthentication&&("keydown"===e.type&&"Enter"===e.key||"click"===e.type)&&(e.preventDefault(),window.MNGAuthentication.logout())}catch(e){i.log(e)}},or=function(e){i.log("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)},ir=function(){i.log("UIHandler: ","show logout buttons"),or("engageLogoutLink"),document.querySelectorAll(it).forEach((function(e){var t=e;t.style.visibility="visible",t.style.display="block",t.addEventListener("click",rr),t.addEventListener("keydown",rr)}))},ar=function(){i.log("UIHandler: ","show login buttons"),or("engageLoginLink"),document.querySelectorAll(rt).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",be()),t.querySelector("a").setAttribute("href","".concat(n,"?").concat(r))}))},sr=function(){return(Wn=Wn||r(Qn().mark((function e(){var t,n,r,a,s,c,u,l,d,h,p,f,g,m,v,y,w,E,b;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("UIHandler: ","setup"),e.next=3,nn();case 3:return t=e.sent,n=t.authenticated,r=t.email,a=t.picture,s=t.connectionSource,c=t.userId,u=t.nickname,e.next=12,$n();case 12:if(l=e.sent,d=l.userIsEntitled,h=l.entitlementSource,p=l.entitlementOrganization,f=l.entitlementLevel,g=l.serviceCode,m=l.isEedition,v=l.tokenEmail,y=tr({siteUrl:Qe()}),!n){e.next=33;break}if(!o.A.dropdownEnabled){e.next=28;break}return n===de.USER_IS_LOWA||r&&!r.includes("@example.com")||(r=v),e.next=26,Hn({authenticatedStatus:n,email:r,nickname:u,picture:a,connectionSource:s,entitlementSource:h,entitlementOrganization:p,entitlementLevel:f,serviceCode:g,isEedition:m,accountHref:y,userId:c});case 26:e.next=30;break;case 28:return e.next=30,nr({entitlementSource:h,siteUrl:Oe(),accountHref:y});case 30:ir(),e.next=34;break;case 33:ar();case 34:w=document.getElementById(ut),d?(yt().forEach((function(e){e.style.display="none"})),w&&(w.style.display="none")):(yt().forEach((function(e){var t=e;t.style.display="block",er(t)})),w&&(w.style.display="flex",E=be(),(b=new URL(w.getAttribute("href"))).searchParams.set("returnUrl",encodeURIComponent(E.href)),w.setAttribute("href",b.href)));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)},cr=function(){var e=ft();e&&(e.style.display="block",e.style.visibility="visible");var t=gt();t&&(t.textContent="Loading..."),ht().dataset.status="logged-out"},ur=function(){return(Yn=Yn||r(Qn().mark((function e(){var t;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e();case 2:return e.next=4,Ge();case 4:if("article"===e.sent){e.next=9;break}i.log("StnHandler: Non-article page detected, leaving stnHandler function"),e.next=22;break;case 9:if(i.log("StnHandler: Article page detected, waiting for entitlements"),"undefined"!=typeof MNGAuthentication){e.next=13;break}return e.next=13,He();case 13:return e.next=15,Fe();case 15:if(!e.sent.adfree){e.next=22;break}return i.log("StnHandler: User is premium, Waiting for send to news player to exist"),e.next=20,qe("stn-player");case 20:(t=e.sent)&&(i.log("StnHandler: Send to news player found, removing it for adfree user",t),t.parentNode.style.display="none");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},lr=function(){return(Vn=Vn||r(Qn().mark((function e(){var t,n,r,o;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("1"===window.authentication_config.serverEntitlements){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,_e();case 4:return e.next=6,Ge();case 6:if("article"===e.sent){e.next=11;break}i.log("audioPlayerHandler: Non-article page, leaving audioPlayerHandler function"),e.next=26;break;case 11:if(i.log("audioPlayerHandler: Article page detected, waiting for entitlements"),"undefined"!=typeof MNGAuthentication){e.next=15;break}return e.next=15,He();case 15:return e.next=17,Fe();case 17:if(t=e.sent,n=window.dataLayer.find((function(e){return e.Paywall_Level})).Paywall_Level,r=!(!t||!t.isEntitled),"premium"!==n||r){e.next=26;break}return i.log("audioPlayerHandler: LINA user on premium article, Waiting for audio player to exist"),e.next=24,qe(".wp-remixd-voice-wrapper");case 24:(o=e.sent)?(i.log("audioPlayerHandler: Audio player found, removing it from the DOM"),o.remove()):i.log("audioPlayerHandler: Audio player not found or removed already");case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)},dr=function(){return(Zn=Zn||r(Qn().mark((function e(){var t;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e();case 2:return e.next=4,Ge();case 4:if("article"===e.sent){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,qe(".article-bottom-share");case 9:(t=e.sent)&&(i.log("articleBottomShareHandler: Bottom article share buttons found, updating styles",t),t.style.margin="0 auto");case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)},hr=function(){return(Jn=Jn||r(Qn().mark((function e(){return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return cr(),e.next=3,sr();case 3:case"end":return e.stop()}}),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 pr,fr=function(){return(zn=zn||r(Qn().mark((function e(){var t,n,o,a,s,c;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e();case 2:return t=document.querySelector("#server-regwall .regwall-input-holder.flex-container"),e.next=5,Ge();case 5:if(n=e.sent,i.log("handleSsRegwall: Checking regwall existance: ".concat(t)),i.log("handleSsRegwall: Checking pageType: ".concat(n)),t&&"article"===n){e.next=10;break}return e.abrupt("return");case 10:o=document.getElementById("user-email-input"),a=document.querySelector("#regwall-input-message"),s=document.querySelector(".regwall-btn-container #regwall-btn"),c=document.querySelector(".flex-container.regwall-input-holder"),o.addEventListener("keyup",(function(){var e=o.value.trim(),t=window.simpleEmailValidation(e).valid;if(""===e)return a.textContent="",a.style.display="none",s.disabled=!0,void(c.style.border="1px solid #9d9a98");t?(a.textContent="",a.style.display="none",s.disabled=!1,c.style.border="1px solid #9d9a98"):(a.textContent="Please enter a valid email address.",a.style.display="block",a.style.color="red",s.disabled=!0,c.style.border="1px solid red")})),s.addEventListener("click",r(Qn().mark((function e(){var t,n,r;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.value,n=Number(window.authentication_config.regwallPrefId),e.next=4,window.engageLibrary.sspwSuscribeToNewsletter(t,n);case 4:e.sent?(a.textContent="Subscribed succesfully!",a.style.display="block",a.style.color="green",r=be().pathname,document.cookie="entitled_via_newsletter=true; path=".concat(r,"; max-age=1800"),window.location.reload()):(a.textContent="Something went wrong, try again later",a.style.display="block",a.style.color="red");case 6:case"end":return e.stop()}}),e)}))));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)},gr=function(){return(qn=qn||r(Qn().mark((function e(){return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){if(Re())e();else{i.log("UIHandler: ","Waiting for the log-in-button class to load...");var t=setInterval(r(Ee().mark((function n(){return Ee().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)}}));case 2:return e.next=4,hr();case 4:ur(),lr(),dr(),fr();case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)};function mr(){mr=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(t){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new C(r||[]);return i(a,"_invoke",{value:O(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var p="suspendedStart",f="suspendedYield",g="executing",m="completed",v={};function y(){}function w(){}function E(){}var b={};l(b,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(R([])));A&&A!==r&&o.call(A,s)&&(b=A);var L=E.prototype=y.prototype=Object.create(b);function I(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function N(t,n){function r(i,a,s,c){var u=h(t[i],t,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==e(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):n.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,o){r(e,t,n,o)}))}return a=a?a.then(o,o):o()}})}function O(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=x(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var u=h(e,n,r);if("normal"===u.type){if(o=r.done?m:f,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=m,r.method="throw",r.arg=u.arg)}}}function x(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var r=n[s];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var i=-1,a=function e(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}!function(){(pr=pr||r(mr().mark((function e(){return mr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:gr();case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}()})()})(); //# sourceMappingURL=mng-digisubs.uiHandler.bundle.js.map;