PageSourceSearch

https://loczhit.com/_next/static/chunks/35ck1h9aea350.js

js loczhit.com collected 2026-10-05 06:49:03 UTC 177,236 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81475,e=>{"use strict";let t,n,r,o,i,a,s,c,l;function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function h(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function d(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function p(e,t){this.v=e,this.k=t}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError("Private element is not present on this object")}function y(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function w(e,t){return e.get(f(e,t))}function g(e,t,n){y(e,t),t.set(e,n)}function b(e,t,n){return e.set(f(e,t),n),n}function v(e,t){y(e,t),t.add(e)}function k(e,t,n){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t,"string"))?r:r+"")in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){k(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,s=a instanceof p;Promise.resolve(s?a.v:a).then(function(n){if(s){var c="return"===t&&a.k?t:"next";if(!a.k||n.done)return r(c,n);n=e[c](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,a){var s={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,o))})}
1,"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof SuppressedError&&SuppressedError,E.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},E.prototype.next=function(e){return this._invoke("next",e)},E.prototype.throw=function(e){return this._invoke("throw",e)},E.prototype.return=function(e){return this._invoke("return",e)};let A={timeoutInSeconds:60},R="memory",I={name:"auth0-spa-js",version:"2.21.1"},x=()=>Date.now(),C="default";class O extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,O.prototype)}static fromPayload(e){return new O(e.error,e.error_description)}}class j extends O{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,j.prototype)}}class W extends O{constructor(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,W.prototype)}}class K extends O{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,K.prototype)}}class U extends K{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,U.prototype)}}class L extends O{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,L.prototype)}}class N extends O{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,N.prototype)}}class D extends O{constructor(e,t,n,r){super(e,t),this.mfa_token=n,this.mfa_requirements=r,Object.setPrototypeOf(this,D.prototype)}}class H extends O{constructor(e,t){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(Z(e,["default"]),"', scope: '").concat(Z(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,H.prototype)}}class J extends O{constructor(e,t){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(Z(e,["default"]),"', missing scope: '").concat(Z(t),"')")),this.audience=e,this.scope=t,Object.setPrototypeOf(this,J.prototype)}}class z extends O{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,z.prototype)}}function Z(e){return e&&!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).includes(e)?e:""}let M=()=>window.crypto,X=()=>{let e="";for(;e.length<43;)for(let t of M().getRandomValues(new Uint8Array(43-e.length)))e.length<43&&t<198&&(e+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~."[t%66]);return e},F=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],V=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object.keys(e).reduce((n,r)=>{if(t&&"env"===r)return n;let o=F.find(e=>e.key===r);return o&&o.type.includes(typeof e[r])&&(n[r]=e[r]),n},{})},G=e=>{let t;return new URLSearchParams(Object.keys(t=Object.assign({client_id:e.clientId},u(e,["clientId"]))).filter(e=>void 0!==t[e]).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})).toString()},Y=async e=>{let t=M().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},B=e=>decodeURIComponent(atob(e.replace(/_/g,"/").replace(/-/g,"+")).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")),q=e=>{var t;let n,r=new Uint8Array(e);return t=window.btoa(String.fromCharCode(...Array.from(r))),n={"+":"-","/":"_","=":""},t.replace(/[+/=]/g,e=>n[e])};var Q,$,ee="u">typeof globalThis?globalThis:"u">typeof window?window:e.g,et={},en={};Object.defineProperty(en,"__esModule",{value:!0});var er=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}();en.default=function(){return er.getInstance()};var eo=ee&&ee.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}c((r=r.apply(e,t||[])).next())})},ei=ee&&ee.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){var c=[i,s];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}};Object.defineProperty(et,"__esModule",{value:!0});var ea="browser-tabs-lock-key",es={key:function(e){return eo(ee,void 0,void 0,function(){return ei(this,function(e){throw Error("Unsupported")})})},getItem:function(e){return eo(ee,void 0,void 0,function(){return ei(this,function(e){throw Error("Unsupported")})})},clear:function(){return eo(ee,void 0,void 0,function(){return ei(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return eo(ee,void 0,void 0,function(){return ei(this,function(e){throw Error("Unsupported")})})},setItem:function(e,t){return eo(ee,void 0,void 0,function(){return ei(this,function(e){throw Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function ec(e){return new Promise(function(t){return setTimeout(t,e)})}function el(e){for(var t="",n=0;n<e;n++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var eu=et.default=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+el(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return void 0===n&&(n=5e3),eo(this,void 0,void 0,function(){var r,o,i,a,s,c,l;return ei(this,function(u){switch(u.label){case 0:r=Date.now()+el(4),o=Date.now()+n,i=ea+"-"+t,a=void 0===this.storageHandler?es:this.storageHandler,u.label=1;case 1:return Date.now()<o?[4,ec(30)]:[3,8];case 2:return u.sent(),null!==a.getItemSync(i)?[3,5]:(s=this.id+"-"+t+"-"+r,[4,ec(Math.floor(25*Math.random()))]);case 3:return u.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:r,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,ec(30)];case 4:return u.sent(),null!==(c=a.getItemSync(i))&&(l=JSON.parse(c)).id===this.id&&l.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(i,r),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?es:this.storageHandler),[4,this.waitForSomethingToChange(o)];case 6:u.sent(),u.label=7;case 7:return r=Date.now()+el(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return eo(this,void 0,void 0,function(){var n=this;return ei(this,function(r){return setTimeout(function(){return eo(n,void 0,void 0,function(){var n,r,o;return ei(this,function(i){switch(i.label){case 0:return[4,en.default().lock(t)];case 1:return i.sent(),this.acquiredIatSet.has(t)?null===(r=(n=void 0===this.storageHandler?es:this.storageHandler).getItemSync(e))?en.default().unlock(t):((o=JSON.parse(r)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(o)),en.default().unlock(t),this.refreshLockWhileAcquired(e,t)):en.default().unlock(t),[2]}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return eo(this,void 0,void 0,function(){return ei(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=!1;function a(){if(i||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(s),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEac
1h(function(e){return e()})},e.prototype.releaseLock=function(e){return eo(this,void 0,void 0,function(){return ei(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 eo(this,void 0,void 0,function(){var n,r,o,i;return ei(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?es:this.storageHandler,r=ea+"-"+t,null===(o=n.getItemSync(r))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,en.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),en.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=[],o=0;;){var i=t.keySync(o);if(null===i)break;r.push(i),o++}for(var a=!1,s=0;s<r.length;s++){var c=r[s];if(c.includes(ea)){var l=t.getItemSync(c);if(null!==l){var u=JSON.parse(l);(void 0===u.timeRefreshed&&u.timeAcquired<n||void 0!==u.timeRefreshed&&u.timeRefreshed<n)&&(t.removeItemSync(c),a=!0)}}}a&&e.notifyWaiters()},e.waiters=void 0,e}();class eh{async runWithLock(e,t,n){let r=new AbortController,o=setTimeout(()=>r.abort(),t);try{return await navigator.locks.request(e,{mode:"exclusive",signal:r.signal},async e=>{if(clearTimeout(o),!e)throw Error("Lock not available");return await n()})}catch(e){if(clearTimeout(o),"AbortError"===(null==e?void 0:e.name))throw new K;throw e}}}class ed{constructor(){this.activeLocks=new Set,this.lock=new eu,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,t,n){let r=!1;for(let n=0;n<10&&!r;n++)r=await this.lock.acquireLock(e,t);if(!r)throw new K;this.activeLocks.add(e),1===this.activeLocks.size&&"u">typeof window&&window.addEventListener("pagehide",this.pagehideHandler);try{return await n()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),0===this.activeLocks.size&&"u">typeof window&&window.removeEventListener("pagehide",this.pagehideHandler)}}}let ep=null,em=new TextEncoder,ef=new TextDecoder;function ey(e){return"string"==typeof e?em.encode(e):ef.decode(e)}function ew(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new ev(`${e.name} modulusLength must be at least 2048 bits`)}async function eg(e,n,r){var o,i,a;if(!1===r.usages.includes("sign"))throw TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');let s=`${(o=ey(JSON.stringify(e)),t(o))}.${(i=ey(JSON.stringify(n)),t(i))}`;return`${s}.${a=await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return ew(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return ew(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new eb}(r),r,ey(s)),t(a)}`}t=Uint8Array.prototype.toBase64?e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));let t=[];for(let n=0;n<e.byteLength;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(t.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};class eb extends Error{constructor(e){var t;super(null!=e?e:"operation not supported"),this.name=this.constructor.name,null==(t=Error.captureStackTrace)||t.call(Error,this,this.constructor)}}class ev extends Error{constructor(e){var t;super(e),this.name=this.constructor.name,null==(t=Error.captureStackTrace)||t.call(Error,this,this.constructor)}}function ek(e){return e instanceof CryptoKey}function e_(e){return ek(e)&&"public"===e.type}async function eS(e,n,r,o,i,a){var s;let c=null==e?void 0:e.privateKey,l=null==e?void 0:e.publicKey;if(!ek(c)||"private"!==c.type)throw TypeError('"keypair.privateKey" must be a private CryptoKey');if(!e_(l))throw TypeError('"keypair.publicKey" must be a public CryptoKey');if(!0!==l.extractable)throw TypeError('"keypair.publicKey.extractable" must be true');if("string"!=typeof n)throw TypeError('"htu" must be a string');
1if("string"!=typeof r)throw TypeError('"htm" must be a string');if(void 0!==o&&"string"!=typeof o)throw TypeError('"nonce" must be a string or undefined');if(void 0!==i&&"string"!=typeof i)throw TypeError('"accessToken" must be a string or undefined');if(void 0!==a&&("object"!=typeof a||null===a||Array.isArray(a)))throw TypeError('"additional" must be an object');return eg({alg:function(e){switch(e.algorithm.name){case"RSA-PSS":if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new eb("unsupported RsaHashedKeyAlgorithm hash name");case"RSASSA-PKCS1-v1_5":if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new eb("unsupported RsaHashedKeyAlgorithm hash name");case"ECDSA":if("P-256"===e.algorithm.namedCurve)return"ES256";throw new eb("unsupported EcKeyAlgorithm namedCurve");case"Ed25519":return"Ed25519";default:throw new eb("unsupported CryptoKey algorithm name")}}(c),typ:"dpop+jwt",jwk:await eT(l)},Object.assign(Object.assign({},a),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:o,htu:n,ath:i?(s=await crypto.subtle.digest("SHA-256",ey(i)),t(s)):void 0}),c)}async function eT(e){let{kty:t,e:n,n:r,x:o,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:r,x:o,y:i}}let eP="dpop-nonce",eE=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-rec
1overy-code"],eA=(e,t)=>new Promise(function(n,r){let o=new MessageChannel;o.port1.onmessage=function(e){e.data.error?r(Error(e.data.error)):n(e.data),o.port1.close()},t.postMessage(e,[o.port2])}),eR=(e,t,n)=>{let r,o=new AbortController;return t.signal=o.signal,Promise.race([fetch(e,t),new Promise((e,t)=>{r=setTimeout(()=>{o.abort(),t(Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},eI=async function(e,t,n,r,o,i){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e4;return o?(async(e,t,n,r,o,i,a,s,c)=>eA({type:"refresh",auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s,skipTokenStorage:c},i))(e,t,n,r,a,o,i,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0):(async(e,t,n)=>{let r=await eR(e,t,n);return{ok:r.ok,json:await r.json(),headers:[...r.headers].reduce((e,t)=>{let n=P(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}})(e,r,a)};async function ex(e,t,n,r,o,i,a,s,c,l,h){let d;if(c){let t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let p,m=null;for(let c=0;c<3;c++)try{p=await eI(e,n,r,o,i,a,t,s,h),m=null;break}catch(e){m=e}if(m)throw m;let f=p.json,y=f.error,w=f.error_description,g=u(f,["error","error_description"]),b=p,v=b.headers,k=b.ok;if(c&&(d=v[eP])&&await c.setNonce(d),!k){let u=w||"HTTP error. Unable to fetch ".concat(e);if("mfa_required"===y)throw new D(y,u,g.mfa_token,g.mfa_requirements);if("missing_refresh_token"===y)throw new H(n,r);if("use_dpop_nonce"===y){if(!c||!d||l)throw new z(d);return ex(e,t,n,r,o,i,a,s,c,!0,h)}throw new O(y||"request_error",u)}return g}async function eC(e,t,n){var r,o=e.baseUrl,i=e.timeout,a=e.audience,s=e.scope,c=e.auth0Client,l=e.useFormData,h=e.useMrrt,d=e.dpop,p=u(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);let m="urn:ietf:params:oauth:grant-type:token-exchange"===p.grant_type,f="urn:okta:params:oauth:grant-type:webauthn"===p.grant_type,y="refresh_token"===p.grant_type&&h,w=m||f||y,g=Object.assign(Object.assign(Object.assign({},p),w&&a&&{audience:a}),w&&s&&{scope:s}),b=f||!l,v=b?JSON.stringify(g):G(g),k=(r=p.grant_type,eE.includes(r));return await ex("".concat(o,"/oauth/token"),i,a||C,s,{method:"POST",body:v,headers:{"Content-Type":b?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(V(c||I)))}},t,l,h,k?d:void 0,void 0,n)}let eO=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.filter(Boolean).join(" ").trim().split(/\s+/))).join(" ")},ej=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e[C]),eO(r,t)},eW="@@auth0spajs@@",eK="@@user@@";class eU{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eW,n=arguments.length>2?arguments[2]:void 0;this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){let t=P(e.split("::"),4),n=t[0],r=t[1],o=t[2];return new eU({clientId:r,scope:t[3],audience:o},n)}static fromCacheEntry(e){return new eU({scope:e.scope,audience:e.audience,clientId:e.client_id})}}class eL{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){let 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(eW))}}class eN{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){let n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class eD{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||x}async setIdToken(e,t,n){var r;let o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await (null==(r=this.keyManifest)?void 0:r.add(o))}async getIdToken(e){let t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){let t=await this.get(e);if(!t||!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){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0,i=await this.cache.get(e.toKey()),a=e;if(!i){let t=await this.getCacheKeys();if(!t)return;let n=this.matchExistingCacheKey(e,t);if(n&&(i=await this.cache.get(n),a=eU.fromKey(n)),!i&&r&&"cache-only"!==o)return this.getEntryWithRefreshToken(e,t)}if(!i)return;let s=Math.floor(await this.nowProvider()/1e3);return i.expiresAt-n<s?i.body.refresh_token?this.modifiedCachedEntry(i,a):(await this.cache.remove(a.toKey()),void await (null==(t=this.keyManifest)?void 0:t.remove(a.toKey()))):i.body}async modifiedCachedEntry(e,t){let n={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},r={body:n,expiresAt:e.expiresAt};return await this.cache.set(t.toKey(),r),{refresh_token:n.refresh_token,audience:n.audience,scope:n.scope}}async set(e){var t;let n=new eU({clientId:e.client_id,scope:e.scope,audience:e.audience}),r=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),r),await (null==(t=this.keyManifest)?void 0:t.add(n.toKey()))}async remove(e,t,n){let r=new eU({clientId:e,scope:n,audience:t});await this.cache.remove(r.toKey())}async stripRefreshToken(e){var t;let n=await this.getCacheKeys();if(n)for(let r of n){let n=await this.cache.get(r);(null==(t=null==n?void 0:n.body)?void 0:t.refresh_token)===e&&(delete n.body.refresh_token,await this.cache.set(r,n))}}async clear(e){var t;let n=await this.getCacheKeys();n&&(await n.filter(t=>!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await (null==(t=this.keyManifest)?void 0:t.clear()))}async wrapCacheEntry(e){return{body:e,expiresAt:Math.floor(await this.nowProvider()/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null==(e=await this.keyManifest.get())?void 0:e.keys:this.cache.allKe
1ys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new eU({clientId:e},eW,eK).toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;let r=eU.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null==(n=e.scope)?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return r.prefix===eW&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(let r of t){let t=eU.fromKey(r);if(t.prefix===eW&&t.clientId===e.clientId){let e=await this.cache.get(r);if(null==(n=null==e?void 0:e.body)?void 0:n.refresh_token)return{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}}}async getRefreshTokensByAudience(e,t){var n;let r=await this.getCacheKeys();if(!r)return[];let o=new Set;for(let i of r){let r=eU.fromKey(i);if(r.prefix===eW&&r.clientId===t&&r.audience===e){let e=await this.cache.get(i);(null==(n=null==e?void 0:e.body)?void 0:n.refresh_token)&&o.add(e.body.refresh_token)}}return Array.from(o)}async updateEntry(e,t){var n;let r=await this.getCacheKeys();if(r)for(let o of r){let r=await this.cache.get(o);(null==(n=null==r?void 0:r.body)?void 0:n.refresh_token)===e&&(r.body.refresh_token=t,await this.cache.set(o,r))}}}class eH{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}let eJ=["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 ez=ee&&ee.__assign||function(){return(ez=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function eZ(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function eM(e,t,n){var r;document.cookie=(r=ez({path:"/"},n),encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return eZ("Expires",e.expires?e.expires.toUTCString():"")+eZ("Domain",e.domain)+eZ("Path",e.path)+eZ("Secure",e.secure)+eZ("SameSite",e.sameSite)}(r))}var eX=function(e,t){eM(e,"",ez(ez({},t),{expires:-1}))};let eF={get(e){let t=function(e){for(var t={},n=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}(document.cookie)[e];if(void 0!==t)return JSON.parse(t)},save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),eM(e,JSON.stringify(t),r)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),eX(e,n)}},eV="_legacy_",eG={get:e=>eF.get(e)||eF.get("".concat(eV).concat(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),eM("".concat(eV).concat(e),JSON.stringify(t),r),eF.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),eX(e,n),eF.remove(e,t),eF.remove("".concat(eV).concat(e),t)}},eY={get(e){if("u"<typeof sessionStorage)return;let 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)}};(eB=eq||(eq={})).Code="code",eB.ConnectCode="connect_code";var eB,eq,eQ,e$=function(e){var t,n,r;return new Worker(eQ=eQ||(n=(t=function(e,t){var n=atob(e);
1if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxpLGE9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihhLnB1c2goby52YWx1ZSksYS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoaT1yLnJldHVybigpLE9iamVjdChpKSE9PWkpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGF9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IGk9e30sYT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PWU9PntPYmplY3QuZW50cmllcyhpKS5mb3JFYWNoKHI9PntsZXQgbz10KHIsMiksbj1vWzBdO29bMV09PT1lJiZkZWxldGUgaVtuXX0pfSxmPWU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0sZD1hc3luYyBlPT57bGV0IHIsbixhPWUuZGF0YSx1PWEudGltZW91dCxkPWEuYXV0aCxoPWEuZmV0Y2hVcmwscD1hLmZldGNoT3B0aW9ucyx5PWEudXNlRm9ybURhdGEsZz1hLnVzZU1ycnQsYj1hLnNraXBUb2tlblN0b3JhZ2UsTz10KGUucG9ydHMsMSlbMF0saz17fTtjb25zdCBtPWR8fHt9LGo9bS5hdWRpZW5jZSx2PW0uc2NvcGU7dHJ5e2NvbnN0IGU9eT9mKHAuYm9keSk6SlNPTi5wYXJzZShwLmJvZHkpO2lmKCFlLnJlZnJlc2hfdG9rZW4mJiJyZWZyZXNoX3Rva2VuIj09PWUuZ3JhbnRfdHlwZSl7aWYobj0oKGUsdCk9PmlbYyhlLHQpXSkoaix2KSwhbiYmZyl7Y29uc3QgZT1pLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT4hIU9iamVjdC5rZXlzKGkpLmZpbmQocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBvPWwodCxyKSxuPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLHM9ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm4uaW5jbHVkZXMoZSkpO3JldHVybiBvJiZzfX0pKSh2LGopO2UmJiF0JiYobj1lKX1pZighbil0aHJvdyBuZXcgbyhqLHYpO3AuYm9keT15P3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSl9bGV0IGEsZDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYoYT1uZXcgQWJvcnRDb250cm9sbGVyLHAuc2lnbmFsPWEuc2lnbmFsKTt0cnl7ZD1hd2FpdCBQcm9taXNlLnJhY2UoWyhNPXUsbmV3IFByb21pc2UoZT0+c2V0VGltZW91dChlLE0pKSksZmV0Y2goaCxPYmplY3QuYXNzaWduKHt9LHApKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIE8ucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFkKXJldHVybi
1BhJiZhLmFib3J0KCksdm9pZCBPLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2lmKFM9ZC5oZWFkZXJzLGs9Wy4uLlNdLnJlZHVjZSgoZSxyKT0+e2xldCBvPXQociwyKSxuPW9bMF0scz1vWzFdO3JldHVybiBlW25dPXMsZX0se30pLHI9YXdhaXQgZC5qc29uKCksYilyZXR1cm4gZGVsZXRlIHIucmVmcmVzaF90b2tlbix2b2lkIE8ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6a30pO3IucmVmcmVzaF90b2tlbj8oZyYmKGkubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLF89bix3PXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhpKS5mb3JFYWNoKGU9PntsZXQgcj10KGUsMiksbz1yWzBdO3JbMV09PT1fJiYoaVtvXT13KX0pKSwoKGUsdCxyKT0+e2lbYyh0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLGosdiksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIGlbYyhlLHQpXX0pKGosdiksTy5wb3N0TWVzc2FnZSh7b2s6ZC5vayxqc29uOnIsaGVhZGVyczprfSl9Y2F0Y2goZSl7Ty5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6a30pfXZhciBfLHcsUyxNfSxoPWFzeW5jIGU9PntsZXQgcj1lLmRhdGEsbz1yLnRpbWVvdXQsbj1yLmF1dGgsYT1yLmZldGNoVXJsLGM9ci5mZXRjaE9wdGlvbnMsZD1yLnVzZUZvcm1EYXRhLGg9dChlLnBvcnRzLDEpWzBdO2NvbnN0IHA9KG58fHt9KS5hdWRpZW5jZTt0cnl7Y29uc3QgZT0oZT0+e2NvbnN0IHI9bmV3IFNldDtyZXR1cm4gT2JqZWN0LmVud
1HJpZXMoaSkuZm9yRWFjaChvPT57bGV0IG49dChvLDIpLHM9blswXSxpPW5bMV07bChlLHMpJiZyLmFkZChpKX0pLEFycmF5LmZyb20ocil9KShwKTtpZigwPT09ZS5sZW5ndGgpcmV0dXJuIHZvaWQgaC5wb3N0TWVzc2FnZSh7b2s6ITB9KTtjb25zdCByPWQ/ZihjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtmb3IoY29uc3QgdCBvZiBlKXtjb25zdCBlPWQ/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3Rva2VuOnR9KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpO2xldCBuLGksbCxmOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihuPW5ldyBBYm9ydENvbnRyb2xsZXIsaT1uLnNpZ25hbCk7dHJ5e2Y9YXdhaXQgUHJvbWlzZS5yYWNlKFtuZXcgUHJvbWlzZShlPT57bD1zZXRUaW1lb3V0KGUsbyl9KSxmZXRjaChhLE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxjKSx7Ym9keTplLHNpZ25hbDppfSkpXSkuZmluYWxseSgoKT0+Y2xlYXJUaW1lb3V0KGwpKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBoLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZilyZXR1cm4gbiYmbi5hYm9ydCgpLHZvaWQgaC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZighZi5vayl7bGV0IGU7dHJ5e2NvbnN0IHQ9SlNPTi5wYXJzZShhd2FpdCBmLnRleHQoKSk7ZT10LmVycm9yX2Rlc2NyaXB0aW9ufWNhdGNoKGUpe31yZXR1cm4gdm9pZCBoLnBvc3RNZXNzYWdlKHtlcnJvcjplfHwiSFRUUCBlcnJvciAiLmNvbmNhdChmLnN0YXR1cyl9KX11KHQpfWgucG9zdE1lc3NhZ2Uoe29rOiEwfSl9Y2F0Y2goZSl7aC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfHwiVW5rbm93biBlcnJvciBkdXJpbmcgdG9rZW4gcmV2b2NhdGlvbiJ9KX19LHA9KGUsdCk9PntpZighYSlyZXR1cm4hMTt0cnl7Y29uc3Qgcj1uZXcgVVJMKGEpLm9yaWdpbixvPW5ldyBVUkwoZS5mZXRjaFVybCk7cmV0dXJuIG8ub3JpZ2luPT09ciYmby5wYXRobmFtZT09PXR9Y2F0Y2goZSl7cmV0dXJuITF9fTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixlPT57Y29uc3Qgcj1lLmRhdGEsbz10KGUucG9ydHMsMSlbMF07aWYoISgidHlwZSJpbiByKXx8ImluaXQiIT09ci50eXBlKXJldHVybiJ0eXBlImluIHImJiJjbGVhciI9PT1yLnR5cGU/KGk9e30sdm9pZChudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMH0pKSk6InR5cGUiaW4gciYmInJldm9rZSI9PT1yLnR5cGU/cChyLCIvb2F1dGgvcmV2b2tlIik/dm9pZCBoKGUpOnZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ImludmFsaWRfZmV0Y2hfdXJsIixlcnJvcl9kZXNjcmlwdGlvbjoiVW5hdXRob3JpemVkIGZldGNoIFVSTCJ9LGhlYWRlcnM6e319KSk6dm9pZCgiZmV0Y2hVcmwiaW4gciYmcChyLCIvb2F1dGgvdG9rZW4iKT9kKGUpOm51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpO2lmKG51bGw9PT1hKXRyeXtuZXcgVVJMKHIuYWxsb3dlZEJhc2VVcmwpLGE9ci5hbGxvd2VkQmFzZVVybH1jYXRjaChlKXtyZXR1cm59fSl9KCk7Cgo=",!1)).indexOf("\n",10)+1,r=new Blob([t.substring(n)+""],{type:"application/javascript"}),URL.createObjectURL(r)),e)};let e0={};class e2{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;let n=new Set((null==(t=await this.cache.get(this.manifestKey))?void 0:t.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){let t=await this.cache.get(this.manifestKey);if(t){let n=new Set(t.keys);return n.delete(e),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(eW,"::").concat(e)}}let e1="auth0.is.authenticated",e5={memory:()=>(new eN).enclosedCache,localstorage:()=>new eL},e3=e=>e5[e],e9=e=>{let t=e.openUrl,n=e.onRedirect;return Object.assign(Object.assign({},u(e,["openUrl","onRedirect"])),{openUrl:!1===t||t?t:n})},e4=(e,t)=>{let n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},e6={NONCE:"nonce",KEYPAIR:"keypair"};class e8{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){let e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(e6).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){let r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){return"".concat(this.clientId,"::").concat(e?"_".concat(e):"auth0")}setNonce(e,t){return this.save(e6.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(e6.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(e6.NONCE,this.buildKey(e))}findKeyPair(){return this.find(e6.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){let n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());await Promise.all((null==n?void 0:n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t))))||[])}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith("".concat(t,"::")))}clearNonces(){return this.deleteByClientId(e6.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(e6.KEYPAIR,this.clientId)}}class e7{constructor(e){this.storage=new e8(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();
1return e||(e=await async function(e,t){var n;let r;if("string"!=typeof e||0===e.length)throw TypeError('"alg" must be a non-empty string');switch(e){case"PS256":r={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":r={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":r={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":r={name:"Ed25519"};break;default:throw new eb}return crypto.subtle.generateKey(r,null!=(n=null==t?void 0:t.extractable)&&n,["sign","verify"])}("ES256",{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){var t;let n,r,o,i,a,s;return r=(t=Object.assign({keyPair:await this.getOrGenerateKeyPair()},e)).keyPair,o=t.url,i=t.method,a=t.nonce,s=t.accessToken,eS(r,((n=new URL(o)).search="",n.hash="",n.href),i,a,s)}async calculateThumbprint(){return async function(e){var n;let r;if(!e_(e))throw TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw TypeError('"publicKey.extractable" must be true');let o=await eT(e);switch(o.kty){case"EC":r={crv:o.crv,kty:o.kty,x:o.x,y:o.y};break;case"OKP":r={crv:o.crv,kty:o.kty,x:o.x};break;case"RSA":r={e:o.e,kty:o.kty,n:o.n};break;default:throw new eb("unsupported JWK kty")}return n=await crypto.subtle.digest({name:"SHA-256"},ey(JSON.stringify(r))),t(n)}((await this.getOrGenerateKeyPair()).publicKey)}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}(rU=rL||(rL={})).Bearer="Bearer",rU.DPoP="DPoP";class te{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("u"<typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(t.replace(/^\/+/,""))}throw TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);let n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rL.Bearer;e.headers.set("authorization","".concat(n," ").concat(t))}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;let n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){let n,r,o=await this.getAccessToken(t);"string"==typeof o?(n=this.config.dpopNonceId?rL.DPoP:rL.Bearer,r=o):(n=o.token_type,r=o.access_token),this.setAuthorizationHeader(e,r,n),n===rL.DPoP&&await this.setDpopProofHeader(e,r)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;let t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){let n=this.getHeader(e.headers,eP);if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new z(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){let o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);let i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){let r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class tt{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){let t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async completeAccount(e){let t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(t)}async getFactors(){let e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}
1async getAuthenticationMethods(e){let t=e?"?".concat(new URLSearchParams({type:e})):"",n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(t),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(n)).authentication_methods}async getAuthenticationMethod(e){let t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(t)}async deleteAuthenticationMethod(e){let t=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});t.ok||await this._handleResponse(t)}async updateAuthenticationMethod(e,t){let n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},{scope:["update:me:authentication_methods"]});return this._handleResponse(n)}async enrollmentChallenge(e){var t;let n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),r=await this._handleResponse(n),o=null!=(t=n.headers.get("location"))?t:"",i=decodeURIComponent(o.split("/").pop()||"");return Object.assign(Object.assign({},r),{id:i,location:o})}async enrollmentVerify(e){let t=e.location;e.type;let n=u(e,["location","type"]),r=await this.myAccountFetcher.fetchWithAuth("".concat(t,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},{scope:["create:me:authentication_methods"]});return this._handleResponse(r)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new tn({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new tn(t)}}class tn extends Error{constructor(e){let t=e.type,n=e.status,r=e.title,o=e.detail,i=e.validation_errors;super(o),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=r,this.detail=o,this.validation_errors=i,Object.setPrototypeOf(this,tn.prototype)}}let tr={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}};function to(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch(e){return!1}}("u"<typeof navigator||null==(rN=navigator.userAgent)||null==(rD=rN.startsWith)||!rD.call(rN,"Mozilla/5.0 "))&&(n="".concat("oauth4webapi","/").concat("v3.8.6"));let ti="ERR_INVALID_ARG_VALUE",ta="ERR_INVALID_ARG_TYPE";function ts(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}let tc=Symbol(),tl=Symbol(),tu=Symbol(),th=Symbol(),td=Symbol(),tp=Symbol(),tm=new TextEncoder,tf=new TextDecoder;function ty(e){return"string"==typeof e?tm.encode(e):tf.decode(e)}function tw(e){return"string"==typeof e?o(e):r(e)}r=Uint8Array.prototype.toBase64?e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));let t=[];for(let n=0;n<e.byteLength;n+=32768)t.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(t.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},o=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw ts("The input to be decoded is not correctly encoded.",ti,e)}}:e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw ts("The input to be decoded is not correctly encoded.",ti,e)}};
1class tg extends Error{constructor(e,t){var n;super(e,t),k(this,"code",void 0),this.name=this.constructor.name,this.code=no,null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}class tb extends Error{constructor(e,t){var n;super(e,t),k(this,"code",void 0),this.name=this.constructor.name,null!=t&&t.code&&(this.code=null==t?void 0:t.code),null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}function tv(e,t,n){return new tb(e,{code:t,cause:n})}function tk(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function t_(e){to(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(null!=e?e:{});if(n&&!t.has("user-agent")&&t.set("user-agent",n),t.has("authorization"))throw ts('"options.headers" must not include the "authorization" header name',ti);return t}function tS(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw ts('"options.signal" must return or be an instance of AbortSignal',ta);return t}}function tT(e){return e.includes("//")?e.replace("//","/"):e}async function tP(e,t){return async function(e,t,n,r){if(!(e instanceof URL))throw ts('"'.concat(t,'" must be an instance of URL'),ta);tL(e,!0!==(null==r?void 0:r[tc]));let o=n(new URL(e.href)),i=t_(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[th])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:tS(o,null==r?void 0:r.signal)}
1)}(e,"issuerIdentifier",e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":e.pathname=tT("".concat(e.pathname,"/").concat(".well-known/openid-configuration"));break;case"oauth2":!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=tT("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw ts('"options.algorithm" must be "oidc" (default), or "oauth2"',ti)}return e},t)}function tE(e,t,n,r,o){try{if("number"!=typeof e||!Number.isFinite(e))throw ts("".concat(n," must be a number"),ta,o);if(e>0)return;if(t){if(0!==e)throw ts("".concat(n," must be a non-negative number"),ti,o);return}throw ts("".concat(n," must be a positive number"),ti,o)}catch(e){if(r)throw tv(e.message,r,o);throw e}}function tA(e,t,n,r){try{if("string"!=typeof e)throw ts("".concat(t," must be a string"),ta,r);if(0===e.length)throw ts("".concat(t," must not be empty"),ti,r)}catch(e){if(n)throw tv(e.message,n,r);throw e}}function tR(e){var t="application/json";if(tB(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(r.length>2){let e=r.pop();t+="".concat(r.join(", "),", or ").concat(e)}else 2===r.length?t+="".concat(r[0]," or ").concat(r[1]):t+=r[0];return tv(t,nc,e)}(e,t)}function tI(){return tw(crypto.getRandomValues(new Uint8Array(32)))}function tx(e){let t=null==e?void 0:e[tl];return"number"==typeof t&&Number.isFinite(t)?t:0}function tC(e){let t=null==e?void 0:e[tu];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function tO(){return Math.floor(Date.now()/1e3)}function tj(e){if("object"!=typeof e||null===e)throw ts('"as" must be an object',ta);tA(e.issuer,'"as.issuer"')}function tW(e){if("object"!=typeof e||null===e)throw ts('"client" must be an object',ta);tA(e.client_id,'"client.client_id"')}function tK(e){return tA(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}let tU=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function tL(e,t){if(t&&"https:"!==e.protocol)throw tv("only requests to HTTPS are allowed",nu,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw tv("only HTTP and HTTPS requests are allowed",nh,e)}function tN(e,t,n,r){let o;if("string"!=typeof e||!(o=tU(e)))throw tv("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?nf:ny,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return tL(o,r),o}function tD(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?tN(e.mtls_endpoint_aliases[t],t,n,r):tN(e[t],t,n,r)}
1class tH extends Error{constructor(e,t){var n;super(e,t),k(this,"cause",void 0),k(this,"code",void 0),k(this,"error",void 0),k(this,"status",void 0),k(this,"error_description",void 0),k(this,"response",void 0),this.name=this.constructor.name,this.code=nr,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}class tJ extends Error{constructor(e,t){var n,r;super(e,t),k(this,"cause",void 0),k(this,"code",void 0),k(this,"error",void 0),k(this,"error_description",void 0),this.name=this.constructor.name,this.code=ni,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!=(n=t.cause.get("error_description"))?n:void 0,null==(r=Error.captureStackTrace)||r.call(Error,this,this.constructor)}}class tz extends Error{constructor(e,t){var n;super(e,t),k(this,"cause",void 0),k(this,"code",void 0),k(this,"response",void 0),k(this,"status",void 0),this.name=this.constructor.name,this.code=nn,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}let tZ="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",tM=RegExp("^[,\\s]*("+tZ+")"),tX=RegExp("^[,\\s]*("+tZ+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),tF=RegExp("^[,\\s]*"+("("+tZ+")\\s*=\\s*(")+tZ+")[,\\s]*(.*)"),tV=RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function tG(e,t,n){if(e.status!==t){var r;let t;if(function(e){let t;if(t=function(e){if(!to(e,Response))throw ts('"response" must be an instance of Response',ta);let t=e.headers.get("www-authenticate");if(null===t)return;let n=[],r=t;for(;r;){let e,t=r.match(tM),c=null==(o=t)?void 0:o[1].toLowerCase();if(!c)return;let l=r.substring(t[0].length);if(l&&!l.match(/^[\s,]/))return;let u=l.match(/^\s+(.*)$/),h=!!u;r=u?u[1]:void 0;let d={};if(h)for(;r;){let n,c;if(t=r.match(tX)){var o,i=P(t,4);if(n=i[1],c=i[2],r=i[3],c.includes("\\"))try{c=JSON.parse('"'.concat(c,'"'))}catch(e){}d[n.toLowerCase()]=c}else{if(!(t=r.match(tF))){if(t=r.match(tV)){if(Object.keys(d).length)break;var a=P(t,3);e=a[1],r=a[2];break}return}var s=P(t,4);n=s[1],c=s[2],r=s[3],d[n.toLowerCase()]=c}}else r=l||void 0;let p={scheme:c,parameters:d};e&&(p.token68=e),n.push(p)}return n.length?n:void 0}(e))throw new tz("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),t=await async function(e){if(e.status>399&&e.status<500){nw(e),tR(e);try{let t=await e.clone().json();if(tk(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await (null==(r=e.body)?void 0:r.cancel()),new tH("server responded with an error in the response body",{cause:t,response:e});throw tv('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),nl,e)}}function tY(e){if(!t9.has(e))throw ts('"options.DPoP" is not a valid DPoPHandle',ti)}function tB(e){var t;return null==(t=e.headers.get("content-type"))?void 0:t.split(";")[0]}async function tq(e,t,n,r,o,i,a){return await n(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[th])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:tS(r,null==a?void 0:a.signal)})}async function tQ(e,t,n,r,o,i){var a;let s=tD(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[tc]));o.set("grant_type",r);let c=t_(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(tY(i.DPoP),await i.DPoP.addProof(s,c,"POST"));let l=await tq(e,t,n,s,o,c,i);return null==i||null==(a=i.DPoP)||a.cacheNonce(l,s),l}let t$=new WeakMap,t0=new WeakMap;function t2(e){if(!e.id_token)return;let t=t$.get(e);if(!t)throw ts('"ref" was already garbage collected or did not resolve from the proper sources',ti);return t}async function t1(e,t,n,r,o,i){if(tj(e),tW(t),!to(n,Response))throw ts('"response" must be an instance of Response',ta);await tG(n,200,"Token Endpoint"),nw(n);let a=await nT(n);if(tA(a.access_token,'"response" body "access_token" property',ns,{body:a}),tA(a.token_type,'"response" body "token_type" property',ns,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;tE(e,!0,'"response" body "expires_in" property',ns,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&tA(a.refresh_token,'"response" body "refresh_token" property',ns,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw tv('"response" body "scope" property must be a string',ns,{body:a});if(void 0!==a.id_token){tA(a.id_token,'"response" body "id_token" property',ns,{body:a});let i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(tE(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=r&&r.length&&i.push(...r);let s=await (async function(e,t,n,r,o){let i,a,s=e.split("."),c=s[0],l=s[1],u=s.length;if(5===u){if(void 0===o)throw new tg("JWE decryption is not configured",{cause:e});var h=(e=await o(e)).split(".");c=h[0],l=h[1],u=h.length}if(3!==u)throw tv("Invalid JWT",ns,e);try{i=JSON.parse(ty(tw(c)))}catch(e){throw tv("failed to parse JWT Header body as base64url encoded JSON",na,e)}if(!tk(i))throw tv("JWT Header must be a top level object",ns,e);if(t(i),void 0!==i.crit)throw new tg('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{a=JSON.parse(ty(tw(l)))}catch(e){throw tv("failed to parse JWT Payload body as base64url encoded JSON",na,e)}if(!tk(a))throw tv("JWT Payload must be a top level object",ns,e);let d=tO()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw tv('unexpected JWT "exp" (expiration time) claim type',ns,{claims:a});if(a.exp<=d-r)throw tv('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',nd,{claims:a,now:d,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw tv('unexpected JWT "iat" (issued at) claim type',ns,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw tv('unexpected JWT "iss" (issuer) claim type',ns,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw tv('unexpected JWT "nbf" (not before) claim type',ns,{claims:a});if(a.nbf>d+r)throw tv('unexpected JWT "nbf" (not before) claim value',nd,{claims:a,now:d,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw tv('unexpected JWT "aud" (audience) claim type',ns,{claims:a});return{header:i,claims:a,jwt:e}})(a.id_token,nv.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),tx(t),tC(t),o).then(t8.bind(void 0,i)).then(t3.bind(void 0,e)).then(t5.bind(void 0,t.client_id)),c=s.claims,l=s.jwt;if(Array.isArray(c.aud)&&1!==c.aud.length){if(void 0===c.azp)throw tv('ID Token "aud" (audience) claim includes additional untrusted audiences',np,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw tv('unexpected ID Token "azp" (authorized party) claim value',np,{expected:t.client_id,claims:c,claim:"azp"})}void 0!==c.auth_time&&tE(c.auth_time,!0,'ID Token "auth_time" (authentication time)',ns,{claims:c}),t0.set(n,l),t$.set(a,c)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new tg("unsupported `token_type` value",{cause:{body:a}});return a}function t5(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw tv('unexpected JWT "aud" (audience) claim value',np,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw tv('unexpected JWT "aud" (audience) claim value',np,{expected:e,claims:t.claims,claim:"aud"});return t}function t3(e,t){var n,r;let o=null!=(n=null==(r=e[nE])?void 0:r.call(e,t))?n:e.issuer;if(t.claims.iss!==o)throw tv('unexpected JWT "iss" (issuer) claim value',np,{expected:o,claims:t.claims,claim:"iss"});return t}let t9=new WeakSet,t4=Symbol(),t6={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function t8(e,t){for(let n of e)if(void 0===t.claims[n])throw tv('JWT "'.concat(n,'" (').concat(t6[n],") claim missing"),ns,{claims:t.claims});return t}let t7=Symbol(),ne=Symbol();async function nt(e,t,n,r){return"string"==typeof(null==r?void 0:r.expectedNonce)||"number"==typeof(null==r?void 0:r.maxAge)||null!=r&&r.requireIdToken?async function(e,t,n,r,o,i,a){let s=[];switch(r){case void 0:r=t7;break;case t7:break;default:tA(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||(o=t.default_max_age),o){case void 0:o=ne;break;case ne:break;default:tE(o,!0,'"maxAge" argument'),s.push("auth_time")}let c=await t1(e,t,n,s,i,a);tA(c.id_token,'"response" body "id_token" property',ns,{body:c});let l=t2(c);if(o!==ne){let e=tO()+tx(t),n=tC(t);if(l.auth_time+o<e-n)throw tv("too much time has elapsed since the last End-User authentication",nd,{claims:l,now:e,tolerance:n,claim:"auth_time"})}if(r===t7){if(void 0!==l.nonce)throw tv('unexpected ID Token "nonce" claim value',np,{expected:void 0,claims:l,claim:"nonce"})}else if(l.nonce!==r)throw tv('unexpected ID Token "nonce" claim value',np,{expected:r,claims:l,claim:"nonce"});return c}(e,t,n,r.expectedNonce,r.maxAge,r[tp],r.recognizedTokenTypes):async function(e,t,n,r,o){let i=await t1(e,t,n,void 0,r,o),a=t2(i);if(a){if(void 0!==t.default_max_age){tE(t.default_max_age,!0,'"client.default_max_age"');let e=tO()+tx(t),n=tC(t);if(a.auth_time+t.default_max_age<e-n)throw tv("too much time has elapsed since the last End-User authentication",nd,{claims:a,now:e,tolerance:n,claim:"auth_time"})}if(void 0!==a.nonce)throw tv('unexpected ID Token "nonce" claim value',np,{expected:void 0,claims:a,claim:"nonce"})}return i}(e,t,n,null==r?void 0:r[tp],null==r?void 0:r.recognizedTokenTypes)}let nn="OAUTH_WWW_AUTHENTICATE_CHALLENGE",nr="OAUTH_RESPONSE_BODY_ERROR",no="OAUTH_UNSUPPORTED_OPERATION",ni="OAUTH_AUTHORIZATION_RESPONSE_E
1RROR",na="OAUTH_PARSE_ERROR",ns="OAUTH_INVALID_RESPONSE",nc="OAUTH_RESPONSE_IS_NOT_JSON",nl="OAUTH_RESPONSE_IS_NOT_CONFORM",nu="OAUTH_HTTP_REQUEST_FORBIDDEN",nh="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",nd="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",np="OAUTH_JWT_CLAIM_COMPARISON_FAILED",nm="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",nf="OAUTH_MISSING_SERVER_METADATA",ny="OAUTH_INVALID_SERVER_METADATA";function nw(e){if(e.bodyUsed)throw ts('"response" body has been used already',ti)}function ng(e){let t=e.algorithm;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new tg("unsupported ".concat(t.name," modulusLength"),{cause:e})}async function nb(e){if("POST"!==e.method)throw ts("form_post responses are expected to use the POST method",ti,{cause:e});if("application/x-www-form-urlencoded"!==tB(e))throw ts("form_post responses are expected to use the application/x-www-form-urlencoded content-type",ti,{cause:e});return async function(e){if(e.bodyUsed)throw ts("form_post Request instances must contain a readable body",ti,{cause:e});return e.text()}(e)}function nv(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw tv('unexpected JWT "alg" header parameter',ns,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw tv('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?r.alg!==n:"function"==typeof n?!n(r.alg):!n.includes(r.alg))throw tv('unexpected JWT "alg" header parameter',ns,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw tv('unexpected JWT "alg" header parameter',ns,{header:r,expected:e,reason:"client configuration"})}function nk(e,t){let n=e.getAll(t),r=n[0];if(n.length>1)throw tv('"'.concat(t,'" parameter must be provided only once'),ns);return r}let n_=Symbol(),nS=Symbol();async function nT(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tR;try{t=await e.json()}catch(t){throw n(e),tv('failed to parse "response" body as JSON',na,t)}if(!tk(t))throw tv('"response" body must be a top level object',ns,{body:t});return t}let nP=Symbol(),nE=Symbol(),nA=new TextEncoder,nR=new TextDecoder;function nI(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>127)throw TypeError("non-ASCII string encountered in encode()");t[n]=r}return t}function nx(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function nC(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:nR.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=nR.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return nx(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}}let nO=function(e){return TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))};function nj(e,t){if(parseInt(e.hash.name.slice(4),10)!==t)throw nO("SHA-".concat(t),"algorithm.hash")}function nW(e,t){for(var n,r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if((o=o.filter(Boolean)).length>2){let t=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(t,".")}else 2===o.length?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");return null==t?e+=" Received ".concat(t):"function"==typeof t&&t.name?e+=" Received function ".concat(t.name):"object"==typeof t&&null!=t&&null!=(n=t.constructor)&&n.name&&(e+=" Received an instance of ".concat(t.constructor.name)),e}let nK=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return nW("Key for the ".concat(e," algorithm must be "),t,...r)};class nU extends Error{constructor(e,t){var n;super(e,t),k(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}
1k(nU,"code","ERR_JOSE_GENERIC");class nL extends nU{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),k(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),k(this,"claim",void 0),k(this,"reason",void 0),k(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}k(nL,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class nN extends nU{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),k(this,"code","ERR_JWT_EXPIRED"),k(this,"claim",void 0),k(this,"reason",void 0),k(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}k(nN,"code","ERR_JWT_EXPIRED");class nD extends nU{constructor(){super(...arguments),k(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}k(nD,"code","ERR_JOSE_ALG_NOT_ALLOWED");class nH extends nU{constructor(){super(...arguments),k(this,"code","ERR_JOSE_NOT_SUPPORTED")}}k(nH,"code","ERR_JOSE_NOT_SUPPORTED"),k(class extends nU{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),k(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),k(class extends nU{constructor(){super(...arguments),k(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class nJ extends nU{constructor(){super(...arguments),k(this,"code","ERR_JWS_INVALID")}}k(nJ,"code","ERR_JWS_INVALID");class nz extends nU{constructor(){super(...arguments),k(this,"code","ERR_JWT_INVALID")}}k(nz,"code","ERR_JWT_INVALID"),k(class extends nU{constructor(){super(...arguments),k(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class nZ extends nU{constructor(){super(...arguments),k(this,"code","ERR_JWKS_INVALID")}}k(nZ,"code","ERR_JWKS_INVALID");class nM extends nU{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),k(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}k(nM,"code","ERR_JWKS_NO_MATCHING_KEY");class nX extends nU{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),k(this,Symbol.asyncIterator,void 0),k(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}k(nX,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class nF extends nU{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),k(this,"code","ERR_JWKS_TIMEOUT")}}k(nF,"code","ERR_JWKS_TIMEOUT");class nV extends nU{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),k(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}k(nV,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");let nG=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},nY=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),nB=e=>nG(e)||nY(e);function nq(e,t,n){try{return nC(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}function nQ(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let n$=e=>nQ(e)&&"string"==typeof e.kty;async function n0(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return nW("Key must be ",e,...n)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[n])}return function(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":if("HMAC"!==e.algorithm.name)throw nO("HMAC");nj(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw nO("RSASSA-PKCS1-v1_5");nj(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==e.algorithm.name)throw nO("RSA-PSS");nj(e.algorithm,parseInt(t.slice(2),10));break;
1case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw nO("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let r;if(r=e.algorithm,r.name!==t)throw nO(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)throw nO("ECDSA");let n=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==n)throw nO(n,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(n&&!e.usages.includes(n))throw TypeError("CryptoKey does not support this operation, its usages must include ".concat(n,"."))}(t,e,n),t}async function n2(e,t,n,r){let o=await n0(e,t,"verify");if(e.startsWith("RS")||e.startsWith("PS")){let t=o.algorithm.modulusLength;if("number"!=typeof t||t<2048)throw TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}let i=function(e,t){let n="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};
1case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new nH("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,n,r)}catch(e){return!1}}let n1='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function n5(e){var t,n;if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let r=function(e){let t,n;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},n=e.priv?["sign"]:["verify"];break;default:throw new nH(n1)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},n=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(e.alg.slice(-3),10)||1)},n=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new nH(n1)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new nH(n1)}break;
1case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},n=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},n=e.d?["deriveBits"]:[];break;default:throw new nH(n1)}break;default:throw new nH('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:n}}(e),o=r.algorithm,i=r.keyUsages,a=S({},e);return"AKP"!==a.kty&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,o,null!=(t=e.ext)?t:!e.d&&!e.priv,null!=(n=e.key_ops)?n:i)}let n3="given KeyObject instance cannot be used for this algorithm",n9=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i||(i=new WeakMap);let o=i.get(e);if(null!=o&&o[n])return o[n];let a=await n5(S(S({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=a:i.set(e,{[n]:a}),a};async function n4(e,t){if(e instanceof Uint8Array||nG(e))return e;if(nY(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let n;i||(i=new WeakMap);let r=i.get(e);if(null!=r&&r[t])return r[t];let o="public"===e.type,a=!!o;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(n3)}n=e.toCryptoKey(e.asymmetricKeyType,a,o?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(n3);n=e.toCryptoKey(e.asymmetricKeyType,a,[o?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(n3);n=e.toCryptoKey(e.asymmetricKeyType,a,[o?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let r;switch(t){case"RSA-OAEP":r="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":r="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":r="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":r="SHA-512";break;default:throw TypeError(n3)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:r},a,o?["encrypt"]:["decrypt"]);n=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:r},a,[o?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var s;let r=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null==(s=e.asymmetricKeyDetails)?void 0:s.namedCurve);if(!r)throw TypeError(n3);let i={ES256:"P-256",ES384:"P-384",ES512:"P-521"};i[t]&&r===i[t]&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:r},a,[o?"verify":"sign"])),t.startsWith("ECDH-ES")&&(n=e.toCryptoKey({name:"ECDH",namedCurve:r},a,o?[]:["deriveBits"]))}if(!n)throw TypeError(n3);return r?r[t]=n:i.set(e,{[t]:n}),n})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return n9(e,n,t)}if(n$(e))return e.k?nC(e.k):n9(e,e,t,!0);throw Error("unreachable")}let n6=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},n8=e=>{let t=e.data[e.pos++];if(128&t){let n=127&t,r=0;for(let t=0;t<n;t++)r=r<<8|e.data[e.pos++];return r}return t},n7=(e,t,n)=>{if(e.data[e.pos++]!==t)throw Error(n)},re=(e,t)=>{let n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},rt=async(e,t,n,r)=>{var o;let i,a,s="spki"===e,c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=r.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new nH("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;
1case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new nH('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!=(o=null==r?void 0:r.extractable)?o:!!s,a)},rn=e=>null==e?void 0:e[Symbol.toStringTag],rr=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError('Invalid key for this operation, its "use" must be "'.concat(e,'" when present'))}if(void 0!==t.alg&&t.alg!==e)throw TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var r,o;let i;switch(!0){case"sign"===n||"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===n?"wrapKey":"unwrapKey":n;break;case"encrypt"===n&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null==(r=t.key_ops)||null==(o=r.includes)?void 0:o.call(r,i)))throw TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function ro(e){return void 0!==e?tK(e):(c||(c=new WeakMap),(e,t,n,r)=>{let o;return(o=c.get(t))||(!function(e,t){if("string"!=typeof e)throw rs("".concat(t," must be a string"),ra);if(0===e.length)throw rs("".concat(t," must not be empty"),ri)}(t.client_secret,'"metadata.client_secret"'),o=tK(t.client_secret),c.set(t,o)),o(e,t,n,r)})}("u"<typeof navigator||null==(rH=navigator.userAgent)||null==(rJ=rH.startsWith)||!rJ.call(rH,"Mozilla/5.0 "))&&(a={"user-agent":"".concat("openid-client","/").concat("v6.8.4")});let ri="ERR_INVALID_ARG_VALUE",ra="ERR_INVALID_ARG_TYPE";function rs(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class rc extends Error{constructor(e,t){var n;super(e,t),k(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null==(n=Error.captureStackTrace)||n.call(Error,this,this.constructor)}}function rl(e,t,n){return new rc(e,{cause:t,code:n})}function ru(e){if(e instanceof TypeError||e instanceof rc||e instanceof tH||e instanceof tJ||e instanceof tz)throw e;if(e instanceof tb)switch(e.code){case nu:throw rl("only requests to HTTPS are allowed",e,e.code);case nh:throw rl("only requests to HTTP or HTTPS are allowed",e,e.code);case nl:throw rl("unexpected HTTP response status code",e.cause,e.code);case nc:throw rl("unexpected response content-type",e.cause,e.code);case na:throw rl("parsing error occured",e,e.code);case ns:throw rl("invalid response encountered",e,e.code);case np:throw rl("unexpected JWT claim value encountered",e,e.code);case nm:throw rl("unexpected JSON attribute value encountered",e,e.code);case nd:throw rl("JWT timestamp claim value failed validation",e,e.code);default:throw rl(e.message,e,e.code)}if(e instanceof tg)throw rl("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw rl("runtime operation error",e,no);case"NotSupportedError":throw rl("runtime unsupported operation",e,no);case"TimeoutError":throw rl("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw rl("operation aborted",e,"OAUTH_ABORT")}throw new rc("something went wrong",{cause:e})}async function rh(e,t,n,r,o){let i=new rp(await async function(e,t){var n,r,o;if(!(e instanceof URL))throw rs('"server" must be an instance of URL',ra);let i=!e.href.includes("/.well-known/"),s=null!=(n=null==t?void 0:t.timeout)?n:30,c=AbortSignal.timeout(1e3*s),l=await (i?tP(e,{algorithm:null==t?void 0:t.algorithm,[th]:null==t?void 0:t[th],[tc]:null==t||null==(r=t.execute)?void 0:r.includes(rb),signal:c,headers:new Headers(a)}):((null==t?void 0:t[th])||fetch)((tL(e,null==t||null==(o=t.execute)||!o.includes(rb)),e.href),{headers:Object.fromEntries(new Headers(S({accept:"application/json"},a)).entries()),body:void 0,method:"GET",redirect:"manual",signal:c})).then(e=>(async function(e,t){if(!(e instanceof URL)&&e!==nP)throw ts('"expectedIssuerIdentifier" must be an instance of URL',ta);if(!to(t,Response))throw ts('"response" must be an instance of Response',ta);if(200!==t.status)throw tv('"response" is not a conform Authorization Server Metadata response 
1(unexpected HTTP status code)',nl,t);nw(t);let n=await nT(t);if(tA(n.issuer,'"response" body "issuer" property',ns,{body:n}),e!==nP&&new URL(n.issuer).href!==e.href)throw tv('"response" body "issuer" property does not match the expected value',nm,{expected:e.href,body:n,attribute:"issuer"});return n})(nP,e)).catch(ru);return i&&new URL(l.issuer).href!==e.href&&("https://login.microsoftonline.com"!==e.origin||null!=t&&t.algorithm&&"oidc"!==t.algorithm||(l[rd]=!0,0))&&(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)&&(()=>{throw new rc("discovered metadata issuer does not match the expected issuer",{code:nm,cause:{expected:e.href,body:l,attribute:"issuer"}})})(),l}(e,o),t,n,r),c=s.get(i);if(null!=o&&o[th]&&(c.fetch=o[th]),null!=o&&o.timeout&&(c.timeout=o.timeout),null!=o&&o.execute)for(let e of o.execute)e(i);return i}new TextDecoder;let rd=Symbol();class rp{constructor(e,t,n,r){var o,i,a,c,l;let u;if("string"!=typeof t||!t.length)throw rs('"clientId" must be a non-empty string',ra);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null==(o=n)?void 0:o.client_id)&&t!==n.client_id)throw rs('"clientId" and "metadata.client_id" must be the same',ri);const h=S(S({},structuredClone(n)),{},{client_id:t});h[tl]=null!=(i=null==(a=n)?void 0:a[tl])?i:0,h[tu]=null!=(c=null==(l=n)?void 0:l[tu])?c:30,u=r||("string"==typeof h.client_secret&&h.client_secret.length?ro(h.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(h);const p=structuredClone(e);rd in e&&(p[nE]=t=>{let n=t.claims.tid;return e.issuer.replace("{tenantid}",n)});let m=Object.freeze(p);s||(s=new WeakMap),s.set(this,{__proto__:null,as:m,c:d,auth:u,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(s.get(this).as);return Object.defineProperties(e,{supportsPKCE:{__proto__:null,value(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"S256";return!0===(null==(t=e.code_challenge_methods_supported)?void 0:t.includes(n))}}}),e}clientMetadata(){return structuredClone(s.get(this).c)}get timeout(){return s.get(this).timeout}set timeout(e){s.get(this).timeout=e}get[th](){return s.get(this).fetch}set[th](e){s.get(this).fetch=e}}function rm(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){let n=new Date;n.setSeconds(n.getSeconds()+e.expires_in),t=n.getTime()}
1return{expiresIn:{__proto__:null,value(){if(t){let e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return t2(this)}catch(e){return}}}}}(e))}async function rf(e,t,n){var r;let o,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=null==(r=e.headers.get("retry-after"))?void 0:r.trim();if(void 0!==a){if(/^\d+$/.test(a))o=parseInt(a,10);else{let e=new Date(a);if(Number.isFinite(e.getTime())){let t=new Date,n=e.getTime()-t.getTime();n>0&&(o=Math.ceil(n/1e3))}}if(i&&!Number.isFinite(o))throw new tb("invalid Retry-After header value",{cause:e});o>t&&await ry(o-t,n)}}function ry(e,t){return new Promise((n,r)=>{let o=e=>{try{t.throwIfAborted()}catch(e){return void r(e)}if(e<=0)return void n();let i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function rw(e,t){rP(e);let n=s.get(e),r=n.as,o=n.c,i=n.auth,c=n.fetch,l=n.tlsOnly,u=n.timeout;return(async function(e,t,n,r,o){tj(e),tW(t);let i=tD(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[tc])),a=new URLSearchParams(r);a.set("client_id",t.client_id);let s=t_(null==o?void 0:o.headers);return s.set("accept","application/json"),tq(e,t,n,i,a,s,o)})(r,o,i,t,{[th]:c,[tc]:!l,headers:new Headers(a),signal:rE(u)}).then(e=>(async function(e,t,n){if(tj(e),tW(t),!to(n,Response))throw ts('"response" must be an instance of Response',ta);await tG(n,200,"Backchannel Authentication Endpoint"),nw(n);let r=await nT(n);tA(r.auth_req_id,'"response" body "auth_req_id" property',ns,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return tE(o,!0,'"response" body "expires_in" property',ns,{body:r}),r.expires_in=o,void 0!==r.interval&&tE(r.interval,!1,'"response" body "interval" property',ns,{body:r}),r})(r,o,e)).catch(ru)}async function rg(e,t,n,r){var o,i,c;let l;rP(e),n=new URLSearchParams(n);let u=null!=(o=t.interval)?o:5,h=null!=(i=null==r?void 0:r.signal)?i:AbortSignal.timeout(1e3*t.expires_in);try{await ry(u,h)}catch(e){ru(e)}let d=s.get(e),p=d.as,m=d.c,f=d.auth,y=d.fetch,w=d.tlsOnly,g=d.nonRepudiation,b=d.timeout,v=d.decrypt,k=(o,i)=>rg(e,S(S({},t),{},{interval:o}),n,S(S({},r),{},{signal:h,flag:i})),_=function(e,t){let n=rE(t);if(!n)return{signal:e,cleanup(){}};let r=new AbortController,o=e=>{let t=e.target;r.abort(t.reason)};return e.aborted?r.abort(e.reason):n.aborted?r.abort(n.reason):(e.addEventListener("abort",o,{once:!0}),n.addEventListener("abort",o,{once:!0})),{signal:r.signal,cleanup(){e.removeEventListener("abort",o),n.removeEventListener("abort",o)}}}(h,b),T=await (async function(e,t,n,r,o){tj(e),tW(t),tA(r,'"authReqId"');let i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),tQ(e,t,n,"urn:openid:params:grant-type:ciba",i,o)})(p,m,f,t.auth_req_id,{[th]:y,[tc]:!w,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(a),signal:_.signal}).catch(ru).finally(_.cleanup);if(503===T.status&&T.headers.has("retry-after"))return await rf(T,u,h,!0),await (null==(c=T.body)?void 0:c.cancel()),k(u);let P=async function(e,t,n,r){return t1(e,t,n,void 0,null==r?void 0:r[tp],null==r?void 0:r.recognizedTokenTypes)}(p,m,T,{[tp]:v});try{l=await P}catch(e){if(rA(e,r))return k(u,rR);if(e instanceof tH)switch(e.error){case"slow_down":u+=5;case"authorization_pending":return await rf(e.response,u,h),k(u)}ru(e)}return l.id_token&&await (null==g?void 0:g(T)),rm(l),l}function rb(e){s.get(e).tlsOnly=!1}async function rv(e,t,n,r,o){let i,c,l;if(rP(e),!((null==o?void 0:o.flag)===rR||t instanceof URL||function(e,t){try{return Object.getPrototypeOf(e)[Symbol.toStringTag]===t}catch(e){return!1}}(t,"Request")))throw rs('"currentUrl" must be an instance of URL, or Request',ra);let u=s.get(e),h=u.as,d=u.c,p=u.auth,m=u.fetch,f=u.tlsOnly,y=u.jarm,w=u.hybrid,g=u.nonRepudiation,b=u.timeout,v=u.decrypt,k=u.implicit;if((null==o?void 0:o.flag)===rR)i=o.authResponse,c=o.redirectUri;else{if(!(t instanceof URL)){let e=t;switch(t=new URL(t.url),e.method){case"GET":break;case"POST":let n=new URLSearchParams(await nb(e));if(w)t.hash=n.toString();
1else for(let e of n.entries()){var _,T=P(e,2);let n=T[0],r=T[1];t.searchParams.append(n,r)}break;default:throw rs("unexpected Request HTTP method",ri)}}switch((_=new URL(_=t)).search="",_.hash="",c=_.href,!0){case!!y:i=await y(t,null==n?void 0:n.expectedState);break;case!!w:i=await w(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!k:throw TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=function(e,t,n,r){var o;if(tj(e),tW(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw ts('"parameters" must be an instance of URLSearchParams, or URL',ta);if(nk(n,"response"))throw tv('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',ns,{parameters:n});let i=nk(n,"iss"),a=nk(n,"state");if(!i&&e.authorization_response_iss_parameter_supported)throw tv('response parameter "iss" (issuer) missing',ns,{parameters:n});if(i&&i!==e.issuer)throw tv('unexpected "iss" (issuer) response parameter value',ns,{expected:e.issuer,parameters:n});switch(r){case void 0:case nS:if(void 0!==a)throw tv('unexpected "state" response parameter encountered',ns,{expected:void 0,parameters:n});break;case n_:break;default:if(tA(r,'"expectedState" argument'),a!==r)throw tv(void 0===a?'response parameter "state" missing':'unexpected "state" response parameter value',ns,{expected:r,parameters:n})}if(nk(n,"error"))throw new tJ("authorization response from the server is an error",{cause:n});let s=nk(n,"id_token"),c=nk(n,"token");if(void 0!==s||void 0!==c)throw new tg("implicit and hybrid flows are not supported");return o=new URLSearchParams(n),t9.add(o),o}(h,d,t.searchParams,null==n?void 0:n.expectedState)}catch(e){ru(e)}}}let E=await (async function(e,t,n,r,o,i,a){if(tj(e),tW(t),!t9.has(r))throw ts('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',ti);tA(o,'"redirectUri"');let s=nk(r,"code");if(!s)throw tv('no authorization code in "callbackParameters"',ns);let c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==t4&&(tA(i,'"codeVerifier"'),c.set("code_verifier",i)),tQ(e,t,n,"authorization_code",c,a)})(h,d,p,i,c,(null==n?void 0:n.pkceCodeVerifier)||t4,{additionalParameters:r,[th]:m,[tc]:!f,DPoP:null==o?void 0:o.DPoP,headers:new Headers(a),signal:rE(b)}).catch(ru);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);let A=nt(h,d,E,{expectedNonce:null==n?void 0:n.expectedNonce,maxAge:null==n?void 0:n.maxAge,requireIdToken:null==n?void 0:n.idTokenExpected,[tp]:v});try{l=await A}catch(t){if(rA(t,o))return rv(e,void 0,n,r,S(S({},o),{},{flag:rR,authResponse:i,redirectUri:c}));ru(t)}return l.id_token&&await (null==g?void 0:g(E)),rm(l),l}async function rk(e,t,n,r){let o;rP(e),n=new URLSearchParams(n);let i=s.get(e),c=i.as,l=i.c,u=i.auth,h=i.fetch,d=i.tlsOnly,p=i.nonRepudiation,m=i.timeout,f=i.decrypt,y=await (async function(e,t,n,r,o){tj(e),tW(t),tA(r,'"refreshToken"');let i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("refresh_token",r),tQ(e,t,n,"refresh_token",i,o)})(c,l,u,t,{[th]:h,[tc]:!d,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(a),signal:rE(m)}).catch(ru),w=async function(e,t,n,r){return t1(e,t,n,void 0,null==r?void 0:r[tp],null==r?void 0:r.recognizedTokenTypes)}(c,l,y,{[tp]:f});try{o=await w}catch(o){if(rA(o,r))return rk(e,t,n,S(S({},r),{},{flag:rR}));ru(o)}return o.id_token&&await (null==p?void 0:p(y)),rm(o),o}async function r_(e,t,n){let r;rP(e),t=new URLSearchParams(t);let o=s.get(e),i=o.as,c=o.c,l=o.auth,u=o.fetch,h=o.tlsOnly,d=o.timeout,p=await (async function(e,t,n,r,o){return tj(e),tW(t),tQ(e,t,n,"client_credentials",new URLSearchParams(r),o)})(i,c,l,t,{[th]:u,[tc]:!h,DPoP:null==n?void 0:n.DPoP,headers:new Headers(a),signal:rE(d)}).catch(ru),m=async function(e,t,n){return t1(e,t,n,void 0,void 0,void 0)}(i,c,p);try{r=await m}catch(r){if(rA(r,n))return r_(e,t,S(S({},n),{},{flag:rR}));ru(r)}return rm(r),r}function rS(e,t){rP(e);let n=s.get(e),r=n.as,o=n.c,i=n.tlsOnly,a=n.hybrid,c=n.jarm,l=n.implicit,u=tD(r,"authorization_endpoint",!1,i);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",a?"code id_token":l?"id_token":"code"),l&&!t.has("nonce"))throw rs("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",ri);c&&t.set("response_mode","jwt")}for(let e of t.entries()){var h=P(e,2);let t=h[0],n=h[1];u.searchParams.append(t,n)}return u}async function rT(e,t,n){let r;rP(e);let o=rS(e,t),i=s.get(e),c=i.as,l=i.c,u=i.auth,h=i.fetch,d=i.tlsOnly,p=i.timeout,m=await (async function(e,t,n,r,o){var i;tj(e),tW(t);let a=tD(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[tc])),s=new URLSearchParams(r);s.set("client_id",t.client_id);let c=t_(null==o?void 0:o.headers);c.set("accept","application/json"),void 0!==(null==o?void 0:o.DPoP)&&(tY(o.DPoP),await o.DPoP.addProof(a,c,"POST"));let l=await tq(e,t,n,a,s,c,o);return null==o||null==(i=o.DPoP)||i.cacheNonce(l,a),l})(c,l,u,o.searchParams,{[th]:h,[tc]:!d,DPoP:null==n?void 0:n.DPoP,headers:new Headers(a),signal:rE(p)}).catch(ru),f=async function(e,t,n){if(tj(e),tW(t),!to(n,Response))throw ts('"response" must be an instance of Response',ta);await tG(n,201,"Pushed Authorization Request Endpoint"),nw(n);let r=await nT(n);tA(r.request_uri,'"response" body "request_uri" property',ns,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return tE(o,!0,'"response" body "expires_in" property',ns,{body:r}),r.expires_in=o,r}(c,l,m);try{r=await f}catch(r){if(rA(r,n))return rT(e,t,S(S({},n),{},{flag:rR}));ru(r)}return rS(e,{request_uri:r.request_uri})}function rP(e){if(!(e instanceof rp))throw rs('"config" must be an instance of Configuration',ra);if(Object.getPrototypeOf(e)!==rp.prototype)throw rs("subclassing Configuration is not allowed",ri)}function rE(e){return e?AbortSignal.timeout(1e3*e):void 0}function rA(e,t){return!(null==t||!t.DPoP||t.flag===rR)&&function(e){if(e instanceof tz){let t=e.cause,n=t[0];return 1===t.length&&"dpop"===n.scheme&&"use_dpop_nonce"===n.parameters.error}return e instanceof tH&&"use_dpop_nonce"===e.error}(e)}Object.freeze(rp.prototype);let rR=Symbol();async function rI(e,t,n,r){let o,i;rP(e);let c=s.get(e),l=c.as,u=c.c,h=c.auth,d=c.fetch,p=c.tlsOnly,m=c.timeout,f=c.decrypt,y=c.nonRepudiation,w=await (async function(e,t,n,r,o,i){return tj(e),tW(t),tA(r,'"grantType"'),tQ(e,t,n,r,new URLSearchParams(o),i)})(l,u,h,t,new URLSearchParams(n),{[th]:d,[tc]:!p,DPoP:null==r?void 0:r.DPoP,headers:new Headers(a),signal:rE(m)}).catch(ru);"urn:ietf:params:oauth:grant-type:token-exchange"===t&&(o={n_a:()=>{}});let g=async function(e,t,n,r){return t1(e,t,n,void 0,null==r?void 0:r[tp],null==r?void 0:r.recognizedTokenTypes)}
1(l,u,w,{[tp]:f,recognizedTokenTypes:o});try{i=await g}catch(o){if(rA(o,r))return rI(e,t,n,S(S({},r),{},{flag:rR}));ru(o)}return i.id_token&&await (null==y?void 0:y(w)),rm(i),i}async function rx(e,t,n){if(!nQ(e))throw new nJ("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new nJ('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new nJ("JWS Protected Header incorrect type");if(void 0===e.payload)throw new nJ("JWS Payload missing");if("string"!=typeof e.signature)throw new nJ("JWS Signature missing or incorrect type");if(void 0!==e.header&&!nQ(e.header))throw new nJ("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{let t=nC(e.protected);r=JSON.parse(nR.decode(t))}catch(e){throw new nJ("JWS Protected Header is invalid")}if(!function(){let e;for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=n.filter(Boolean);if(0===o.length||1===o.length)return!0;for(let t of o){let n=Object.keys(t);if(e&&0!==e.size)for(let t of n){if(e.has(t))return!1;e.add(t)}else e=new Set(n)}return!0}(r,e.header))throw new nJ("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o=S(S({},r),e.header),i=function(e,t,n,r,o){let i;if(void 0!==o.crit&&void 0===(null==r?void 0:r.crit))throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||void 0===r.crit)return new Set;if(!Array.isArray(r.crit)||0===r.crit.length||r.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(i=void 0!==n?new Map([...Object.entries(n),...t.entries()]):t,r.crit)){if(!i.has(a))throw new nH('Extension Header Parameter "'.concat(a,'" is not recognized'));if(void 0===o[a])throw new e('Extension Header Parameter "'.concat(a,'" is missing'));if(i.get(a)&&void 0===r[a])throw new e('Extension Header Parameter "'.concat(a,'" MUST be integrity protected'))}return new Set(r.crit)}(nJ,new Map([["b64",!0]]),null==n?void 0:n.crit,r,o),a=!0;if(i.has("b64")&&"boolean"!=typeof(a=r.b64))throw new nJ('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let s=o.alg;if("string"!=typeof s||!s)throw new nJ('JWS "alg" (Algorithm) Header Parameter missing or invalid');let c=n&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError('"'.concat(e,'" option must be an array of strings'));if(t)return new Set(t)}("algorithms",n.algorithms);if(c&&!c.has(s))throw new nD('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new nJ("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new nJ("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t&&(t=await t(r,e),l=!0),function(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,n)=>{if(!(t instanceof Uint8Array)){if(n$(t)){if("oct"===t.kty&&"string"==typeof t.k&&rr(e,t,n))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!nB(t))throw TypeError(nK(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError("".concat(rn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(n$(t))switch(n){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&rr(e,t,n))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&rr(e,t,n))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!nB(t))throw TypeError(nK(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError("".concat(rn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw TypeError("".concat(rn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw TypeError("".concat(rn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw TypeError("".concat(rn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw TypeError("".concat(rn(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}(s,t,"verify");let u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=new Uint8Array(t.reduce((e,t)=>
1e+t.length,0)),o=0;for(let e of t)r.set(e,o),o+=e.length;return r}(void 0!==e.protected?nI(e.protected):new Uint8Array,nI("."),"string"==typeof e.payload?a?nI(e.payload):nA.encode(e.payload):e.payload),h=nq(e.signature,"signature",nJ),d=await n4(t,s);if(!await n2(s,d,h,u))throw new nV;let p={payload:a?nq(e.payload,"payload",nJ):"string"==typeof e.payload?nA.encode(e.payload):e.payload};return void 0!==e.protected&&(p.protectedHeader=r),void 0!==e.header&&(p.unprotectedHeader=e.header),l?S(S({},p),{},{key:d}):p}let rC=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function rO(e){let t,n=rC.exec(e);if(!n||n[4]&&n[1])throw TypeError("Invalid time period format");let r=parseFloat(n[2]);switch(n[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*r);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*r);break;case"day":case"days":case"d":t=Math.round(86400*r);break;case"week":case"weeks":case"w":t=Math.round(604800*r);break;default:t=Math.round(0x1e187e0*r)}return"-"===n[1]||"ago"===n[4]?-t:t}let rj=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());async function rW(e,t,n){var r;let o=await async function(e,t,n){if(e instanceof Uint8Array&&(e=nR.decode(e)),"string"!=typeof e)throw new nJ("Compact JWS must be a string or Uint8Array");let r=e.split("."),o=r[0],i=r[1],a=r[2];if(3!==r.length)throw new nJ("Invalid Compact JWS");let s=await rx({payload:i,protected:o,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?S(S({},c),{},{key:s.key}):c}(e,t,n);if(null!=(r=o.protectedHeader.crit)&&r.includes("b64")&&!1===o.protectedHeader.b64)throw new nz("JWTs MUST NOT use unencoded payload");let i={payload:function(e,t){var n,r;let o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{i=JSON.parse(nR.decode(t))}catch(e){}if(!nQ(i))throw new nz("JWT Claims Set must be a top-level JSON object");let s=a.typ;if(s&&("string"!=typeof e.typ||rj(e.typ)!==rj(s)))throw new nL('unexpected "typ" JWT header value',i,"typ","check_failed");let c=a.requiredClaims,l=a.issuer,u=a.subject,h=a.audience,d=a.maxTokenAge,p=[...void 0===c?[]:c];for(let e of(void 0!==d&&p.push("iat"),void 0!==h&&p.push("aud"),void 0!==u&&p.push("sub"),void 0!==l&&p.push("iss"),new Set(p.reverse())))if(!(e in i))throw new nL('missing required "'.concat(e,'" claim'),i,e,"missing");if(l&&!(Array.isArray(l)?l:[l]).includes(i.iss))throw new nL('unexpected "iss" claim value',i,"iss","check_failed");if(u&&i.sub!==u)throw new nL('unexpected "sub" claim value',i,"sub","check_failed");
1if(h&&(n=i.aud,r="string"==typeof h?[h]:h,!("string"==typeof n?r.includes(n):Array.isArray(n)&&r.some(Set.prototype.has.bind(new Set(n))))))throw new nL('unexpected "aud" claim value',i,"aud","check_failed");switch(typeof a.clockTolerance){case"string":o=rO(a.clockTolerance);break;case"number":o=a.clockTolerance;break;case"undefined":o=0;break;default:throw TypeError("Invalid clockTolerance option type")}let m=Math.floor((a.currentDate||new Date).getTime()/1e3);if((void 0!==i.iat||d)&&"number"!=typeof i.iat)throw new nL('"iat" claim must be a number',i,"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new nL('"nbf" claim must be a number',i,"nbf","invalid");if(i.nbf>m+o)throw new nL('"nbf" claim timestamp check failed',i,"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new nL('"exp" claim must be a number',i,"exp","invalid");if(i.exp<=m-o)throw new nN('"exp" claim timestamp check failed',i,"exp","check_failed")}if(d){let e=m-i.iat;if(e-o>("number"==typeof d?d:rO(d)))throw new nN('"iat" claim timestamp check failed (too far in the past)',i,"iat","check_failed");if(e<0-o)throw new nL('"iat" claim timestamp check failed (it should be in the past)',i,"iat","check_failed")}return i}(o.protectedHeader,o.payload,n),protectedHeader:o.protectedHeader};return"function"==typeof t?S(S({},i),{},{key:o.key}):i}function rK(e){return nQ(e)}var rU,rL,rN,rD,rH,rJ,rz,rZ,rM=new WeakMap,rX=new WeakMap;class rF{constructor(e){if(g(this,rM,void 0),g(this,rX,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(rK)}(e))throw new nZ("JSON Web Key Set malformed");b(rM,this,structuredClone(e))}jwks(){return w(rM,this)}async getKey(e,t){let n=S(S({},e),null==t?void 0:t.header),r=n.alg,o=n.kid,i=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new nH('Unsupported "alg" value for a JSON Web Key Set')}}(r),a=w(rM,this).keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof o&&(t=o===e.kid),t&&("string"==typeof e.alg||"AKP"===i)&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;
1case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),s=a[0],c=a.length;if(0===c)throw new nM;if(1!==c){var l;let e=new nX,t=w(rX,this);throw e[Symbol.asyncIterator]=(l=function*(){for(let n of a)try{var e;yield yield(e=rV(t,n,r),new p(e,0))}catch(e){}},function(){return new E(l.apply(this,arguments))}),e}return rV(w(rX,this),s,r)}}async function rV(e,t,n){let r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[n]){let e=await async function(e,t){let n;if(!nQ(e))throw TypeError("JWK must be an object");switch(null!=t||(t=e.alg),null!=n||(n=e.ext),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return nC(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new nH('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return n5(S(S({},e),{},{alg:t,ext:n}));case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return n5(S(S({},e),{},{ext:n}));case"EC":case"OKP":return n5(S(S({},e),{},{alg:t,ext:n}));default:throw new nH('Unsupported "kty" (Key Type) Parameter value')}}(S(S({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new nZ("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function rG(e){let t=new rF(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}("u"<typeof navigator||null==(rz=navigator.userAgent)||null==(rZ=rz.startsWith)||!rZ.call(rz,"Mozilla/5.0 "))&&(l="".concat("jose","/").concat("v6.2.3"));let rY=Symbol(),rB=Symbol();var rq=new WeakMap,rQ=new WeakMap,r$=new WeakMap,r0=new WeakMap,r2=new WeakMap,r1=new WeakMap,r5=new WeakMap,r3=new WeakMap,r9=new WeakMap,r4=new WeakMap;class r6{constructor(e,t){var n,r;if(g(this,rq,void 0),g(this,rQ,void 0),g(this,r$,void 0),g(this,r0,void 0),g(this,r2,void 0),g(this,r1,void 0),g(this,r5,void 0),g(this,r3,void 0),g(this,r9,void 0),g(this,r4,void 0),!(e instanceof URL))throw TypeError("url must be an instance of URL");b(rq,this,new URL(e.href)),b(rQ,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),b(r$,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),b(r0,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),b(r5,this,new Headers(null==t?void 0:t.headers)),l&&!w(r5,this).has("User-Agent")&&w(r5,this).set("User-Agent",l),w(r5,this).has("accept")||(w(r5,this).set("accept","application/json"),w(r5,this).append("accept","application/jwk-set+json")),b(r3,this,null==t?void 0:t[rY]),void 0!==(null==t?void 0:t[rB])&&(b(r4,this,null==t?void 0:t[rB]),n=null==t?void 0:t[rB],r=w(r0,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&nQ(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,nQ)&&(b(r2,this,w(r4,this).uat),b(r9,this,rG(w(r4,this).jwks))))}pendingFetch(){return!!w(r1,this)}coolingDown(){return"number"==typeof w(r2,this)&&Date.now()<w(r2,this)+w(r$,this)}fresh(){return"number"==typeof w(r2,this)&&Date.now()<w(r2,this)+w(r0,this)}jwks(){var e;return null==(e=w(r9,this))?void 0:e.jwks()}async getKey(e,t){w(r9,this)&&this.fresh()||await this.reload();try{return await w(r9,this).call(this,e,t)}catch(n){if(n instanceof nM&&!1===this.coolingDown())return await this.reload(),w(r9,this).call(this,e,t);throw n}}async reload(){w(r1,this)&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&b(r1,this,void 0),w(r1,this)||b(r1,this,(async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fetch,o=await r(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new nF;throw e});if(200!==o.status)throw new nU("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new nU("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(w(rq,this).href,w(r5,this),AbortSignal.timeout(w(rQ,this)),w(r3,this)).then(e=>{b(r9,this,rG(e)),w(r4,this)&&(w(r4,this).uat=Date.now(),w(r4,this).jwks=e),b(r2,this,Date.now()),b(r1,this,void 0)}).catch(e=>{throw b(r1,this,void 0),e})),await w(r1,this)}}let r8=["mfaToken"],r7=["mfaToken"];var oe,ot,on,or,oo,oi,oa,os,oc,ol,ou,oh,od,op,om,of,oy,ow,og,ob,ov,ok=class extends 
1Error{constructor(e,t){super(t),k(this,"code",void 0),this.name="NotSupportedError",this.code=e}},o_=class extends Error{constructor(e,t,n){super(t),k(this,"cause",void 0),k(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},oS=class extends o_{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},oT=class extends o_{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},oP=class extends o_{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},oE=class extends o_{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},oA=class extends o_{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},oR=class extends o_{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},oI=class extends Error{constructor(e){super(e),k(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},ox=class extends o_{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),k(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},oC=class extends o_{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},oO=class extends o_{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},oj=class extends o_{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},oW=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),k(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function oK(e){return Object.entries(e).filter(e=>void 0!==P(e,2)[1]).reduce((e,t)=>S(S({},e),{},{[t[0]]:t[1]}),{})}var oU=class extends Error{constructor(e,t,n){super(t),k(this,"cause",void 0),k(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},oL=class extends oU{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},oN=class extends oU{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},oD=class extends oU{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},oH=class extends oU{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function oJ(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var oz=(oe=new WeakMap,ot=new WeakMap,on=new WeakMap,class{constructor(e){var t;g(this,oe,void 0),g(this,ot,void 0),g(this,on,void 0),b(oe,this,"https://".concat(e.domain)),b(ot,this,e.clientId),b(on,this,null!=(t=e.customFetch)?t:function(){return fetch(...arguments)})}async listAuthenticators(e){let t="".concat(w(oe,this),"/mfa/authenticators"),n=e.mfaToken,r=await w(on,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json();throw new oL(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(oJ)}async enrollAuthenticator(e){let t="".concat(w(oe,this),"/mfa/associate"),n=e.mfaToken,r=T(e,r8),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);let i=await w(on,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){let e=await i.json();throw new oN(e.error_description||"Failed to enroll authenticator",e)}var a=await i.json();if("otp"===a.authenticator_type)return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if("oob"===a.authenticator_type)return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes};throw Error("Unexpected authenticator type: ".concat(a.authenticator_type))}async deleteAuthenticator(e){let t=e.authenticatorId,n=e.mfaToken,r="".concat(w(oe,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await w(on,this).call(this,r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json();throw new oD(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){var t;let n,r="".concat(w(oe,this),"/mfa/challenge"),o=e.mfaToken,i=T(e,r7),a={mfa_token:o,client_id:w(ot,this),challenge_type:i.challengeType};i.authenticatorId&&(a.authenticator_id=i.authenticatorId);let s=await w(on,this).call(this,r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!s.ok){let e=await s.json();throw new oH(e.error_description||"Failed to challenge authenticator",e)}return n={challengeType:(t=await s.json()).challenge_type},void 0!==t.oob_code&&(n.oobCode=t.oob_code),void 0!==t.binding_method&&(n.bindingMethod=t.binding_method),n}}
1),oZ=class extends Error{constructor(e,t,n){super(t),k(this,"cause",void 0),k(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},oM=class extends oZ{constructor(e,t){super("passkey_register_error",e,t),this.name="PasskeyRegisterError"}},oX=class extends oZ{constructor(e,t){super("passkey_challenge_error",e,t),this.name="PasskeyChallengeError"}},oF=class extends oZ{constructor(e,t){super("passkey_get_token_error",e,t),this.name="PasskeyGetTokenError"}},oV=(or=new WeakMap,oo=new WeakMap,oi=new WeakMap,oa=new WeakMap,os=new WeakSet,class{constructor(e){var t;v(this,os),g(this,or,void 0),g(this,oo,void 0),g(this,oi,void 0),g(this,oa,void 0),b(or,this,"https://".concat(e.domain)),b(oo,this,e.clientId),b(oi,this,null!=(t=e.customFetch)?t:function(){return fetch(...arguments)}),b(oa,this,e.grantRequest)}async register(e){let t="".concat(w(or,this),"/passkey/register"),n=S(S(S(S(S(S(S(S({},e.email&&{email:e.email}),e.name&&{name:e.name}),e.phoneNumber&&{phone_number:e.phoneNumber}),e.username&&{username:e.username}),e.givenName&&{given_name:e.givenName}),e.familyName&&{family_name:e.familyName}),e.nickname&&{nickname:e.nickname}),e.picture&&{picture:e.picture}),r={client_id:w(oo,this),user_profile:n};e.realm&&(r.realm=e.realm),e.organization&&(r.organization=e.organization),e.userMetadata&&(r.user_metadata=e.userMetadata);let o=await w(oi,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){let e=await f(os,this,oG).call(this,o);throw new oM(e.error_description||"Failed to request signup challenge",e)}let i=await o.json();return{authSession:i.auth_session,authnParamsPublicKey:S({},i.authn_params_public_key)}}async challenge(e){let t="".concat(w(or,this),"/passkey/challenge"),n={client_id:w(oo,this)};null!=e&&e.realm&&(n.realm=e.realm),null!=e&&e.organization&&(n.organization=e.organization);let r=await w(oi,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){let e=await f(os,this,oG).call(this,r);throw new oX(e.error_description||"Failed to request login challenge",e)}let o=await r.json();return{authSession:o.auth_session,authnParamsPublicKey:S({},o.authn_params_public_key)}}async getTokenByPasskey(e){let t=new URLSearchParams({auth_session:e.authSession,authn_response:JSON.stringify(e.credential)});e.realm&&t.append("realm",e.realm),e.scope&&t.append("scope",e.scope),e.audience&&t.append("audience",e.audience),e.organization&&t.append("organization",e.organization);try{return await w(oa,this).call(this,"urn:okta:params:oauth:grant-type:webauthn",t)}catch(e){throw new oF(e.error_description||"Failed to exchange passkey credential for tokens.",e)}}});async function oG(e){try{return await e.json()}catch(t){return{error:"unknown_error",error_description:"HTTP ".concat(e.status," ").concat(e.statusText)}}}var oY=class e{constructor(e,t,n,r,o,i,a){k(this,"accessToken",void 0),k(this,"idToken",void 0),k(this,"refreshToken",void 0),k(this,"expiresAt",void 0),k(this,"scope",void 0),k(this,"claims",void 0),k(this,"authorizationDetails",void 0),k(this,"tokenType",void 0),k(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=r,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){let n=t.id_token?t.claims():void 0,r=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return r.tokenType=t.token_type,r.issuedTokenType=t.issued_token_type,r}},oB=(oc=new WeakMap,ol=new WeakMap,ou=new WeakMap,class{constructor(e,t){g(this,oc,new Map),g(this,ol,void 0),g(this,ou,void 0),b(ou,this,Math.max(1,Math.floor(e))),b(ol,this,Math.max(0,Math.floor(t)))}get(e){let t=w(oc,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return w(oc,this).delete(e),w(oc,this).set(e,t),t.value;w(oc,this).delete(e)}}set(e,t){for(w(oc,this).has(e)&&w(oc,this).delete(e),w(oc,this).set(e,{value:t,expiresAt:Date.now()+w(ol,this)});w(oc,this).size>w(ou,this);){let e=w(oc,this).keys().next().value;if(void 0===e)break;w(oc,this).delete(e)}}}),oq=new Map;function oQ(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var o$=class{static createDiscoveryCache(e){var t,n;let r=(t=e.maxEntries,n=e.ttlMs,"".concat(t,":").concat(n)),o=oq.get(r);return o||(o=new oB(e.maxEntries,e.ttlMs),oq.set(r,o)),o}static createJwksCache(){return{}}},o0="openid profile email offline_access",o2=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function o1(e){if(null==e)throw new oR("subject_token is required");if("string"!=typeof e)throw new oR("subject_token must be a string");if(0===e.trim().length)throw new oR("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new oR("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new oR("subject_token must not include the 'Bearer ' prefix")}function o5(e,t){if(t)for(let r of Object.entries(t)){var n=P(r,2);let t=n[0],o=n[1];if(!o2.has(t))if(Array.isArray(o)){if(o.length>20)throw new oR("Parameter '".concat(t,"' exceeds maximum array size of ").concat(20));o.forEach(n=>{e.append(t,n)})}
1else e.append(t,o)}}var o3="urn:ietf:params:oauth:token-type:access_token",o9=(oh=new WeakMap,od=new WeakMap,op=new WeakMap,om=new WeakMap,of=new WeakMap,oy=new WeakMap,ow=new WeakMap,og=new WeakMap,ob=new WeakMap,ov=new WeakSet,class{constructor(e){var t,n,r,o;if(v(this,ov),g(this,oh,void 0),g(this,od,void 0),g(this,op,void 0),g(this,om,void 0),g(this,of,void 0),g(this,oy,void 0),g(this,ow,void 0),g(this,og,void 0),g(this,ob,void 0),k(this,"mfa",void 0),k(this,"passkey",void 0),b(om,this,e),e.useMtls&&!e.customFetch)throw new ok("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");b(of,this,function(e,t){if(!1===t.enabled)return e;let n=btoa(JSON.stringify({name:t.name,version:t.version}));return async(t,r)=>{let o=t instanceof Request?new Headers(t.headers):new Headers;return null!=r&&r.headers&&new Headers(r.headers).forEach((e,t)=>{o.set(t,e)}),o.set("Auth0-Client",n),e(t,S(S({},r),{},{headers:o}))}}(null!=(t=e.customFetch)?t:function(){return fetch(...arguments)},!1===(null==(n=e.telemetry)?void 0:n.enabled)?n:{enabled:!0,name:null!=(r=null==n?void 0:n.name)?r:"@auth0/auth0-auth-js",version:null!=(o=null==n?void 0:n.version)?o:"1.7.0"}));const i=oQ(e.discoveryCache);b(ow,this,o$.createDiscoveryCache(i)),b(og,this,new Map),b(ob,this,o$.createJwksCache()),this.mfa=new oz({domain:w(om,this).domain,clientId:w(om,this).clientId,customFetch:w(of,this)}),this.passkey=new oV({domain:w(om,this).domain,clientId:w(om,this).clientId,customFetch:w(of,this),grantRequest:async(e,t)=>{let n=(await f(ov,this,o8).call(this)).configuration,r=await rI(n,e,t);return oY.fromTokenEndpointResponse(r)}})}async getServerMetadata(){return(await f(ov,this,o8).call(this)).serverMetadata}async buildAuthorizationUrl(e){let t=(await f(ov,this,o8).call(this)).serverMetadata;if(null!=e&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new ok("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await f(ov,this,ir).call(this,e)}catch(e){throw new oC(e)}}async buildLinkUserUrl(e){try{let t=await f(ov,this,ir).call(this,{authorizationParams:S(S({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new oO(e)}}async buildUnlinkUserUrl(e){try{let t=await f(ov,this,ir).call(this,{authorizationParams:S(S({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(e){throw new oj(e)}}async backchannelAuthentication(e){let t=await f(ov,this,o8).call(this),n=t.configuration,r=t.serverMetadata,o=oK(S(S({},w(om,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(S(S({scope:o0},o),{},{client_id:w(om,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:r.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&i.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&i.append("authorization_details",JSON.stringify(e.authorizationDetails));try{let e=await rw(n,i),t=await rg(n,e);return oY.fromTokenEndpointResponse(t)}catch(e){throw new ox(e)}}async initiateBackchannelAuthentication(e){let t=await f(ov,this,o8).call(this),n=t.configuration,r=t.serverMetadata,o=oK(S(S({},w(om,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(S(S({scope:o0},o),{},{client_id:w(om,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:r.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&i.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&i.append("authorization_details",JSON.stringify(e.authorizationDetails));try{let e=await rw(n,i);return{authReqId:e.auth_req_id,expiresIn:e.expires_in,interval:e.interval}}catch(e){throw new ox(e)}}async backchannelAuthenticationGrant(e){let t=e.authReqId,n=(await f(ov,this,o8).call(this)).configuration,r=new URLSearchParams({auth_req_id:t});try{let e=await rI(n,"urn:openid:params:grant-type:ciba",r);return oY.fromTokenEndpointResponse(e)}catch(e){throw new ox(e)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new oA("Either a refresh or access token should be specified, but not both.");let n=null!=(t=e.accessToken)?t:e.refreshToken;if(!n)throw new oA("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?o3:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(e){if(e instanceof oR)throw new oA(e.message,e.cause);throw e}}async exchangeToken(e){return"connection"in e?f(ov,this,o7).call(this,e):f(ov,this,ie).
1call(this,e)}async getTokenByCode(e,t){let n=(await f(ov,this,o8).call(this)).configuration;try{let r=await rv(n,e,{pkceCodeVerifier:t.codeVerifier});return oY.fromTokenEndpointResponse(r)}catch(e){throw new oS("There was an error while trying to request a token.",e)}}async getTokenByRefreshToken(e){let t=(await f(ov,this,o8).call(this)).configuration,n=new URLSearchParams;e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope);try{let r=await rk(t,e.refreshToken,n);return oY.fromTokenEndpointResponse(r)}catch(e){throw new oP("The access token has expired and there was an error while trying to refresh it.",e)}}async getTokenByPassword(e){let t=(await f(ov,this,o8).call(this)).configuration,n=new URLSearchParams({username:e.username,password:e.password});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.realm&&n.append("realm",e.realm);let r=t;if(e.auth0ForwardedFor){let n=await f(ov,this,it).call(this);(r=new rp(t.serverMetadata(),w(om,this).clientId,w(om,this).clientSecret,n))[th]=(t,n)=>w(of,this).call(this,t,S(S({},n),{},{headers:S(S({},n.headers),{},{"auth0-forwarded-for":e.auth0ForwardedFor})}))}try{let e=await rI(r,"password",n);return oY.fromTokenEndpointResponse(e)}catch(e){throw new oE("There was an error while trying to request a token.",e)}}async getTokenByClientCredentials(e){let t=(await f(ov,this,o8).call(this)).configuration;try{let n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);let r=await r_(t,n);return oY.fromTokenEndpointResponse(r)}catch(e){throw new oT("There was an error while trying to request a token.",e)}}async buildLogoutUrl(e){let t=await f(ov,this,o8).call(this),n=t.configuration;if(!t.serverMetadata.end_session_endpoint){let t=new URL("https://".concat(w(om,this).domain,"/v2/logout"));return t.searchParams.set("returnTo",e.returnTo),t.searchParams.set("client_id",w(om,this).clientId),t}return function(e,t){rP(e);let n=s.get(e),r=n.as,o=n.c,i=tD(r,"end_session_endpoint",!1,n.tlsOnly);for(let e of((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),t.entries())){var a=P(e,2);let t=a[0],n=a[1];i.searchParams.append(t,n)}return i}(n,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){let t,n,r=(await f(ov,this,o8).call(this)).serverMetadata,o=oQ(w(om,this).discoveryCache),i=r.jwks_uri;w(oy,this)||b(oy,this,(t=new r6(new URL(i),{cacheMaxAge:o.ttlMs,[rY]:w(of,this),[rB]:w(ob,this)}),Object.defineProperties(n=async(e,n)=>t.getKey(e,n),{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>t.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>t.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n));let a=(await rW(e.logoutToken,w(oy,this),{issuer:r.issuer,audience:w(om,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in a)&&!("sub"in a))throw new oI('either "sid" or "sub" (or both) claims must be present');if("sid"in a&&"string"!=typeof a.sid)throw new oI('"sid" claim must be a string');if("sub"in a&&"string"!=typeof a.sub)throw new oI('"sub" claim must be a string');if("nonce"in a)throw new oI('"nonce" claim is prohibited');if(!("events"in a))throw new oI('"events" claim is missing');if("object"!=typeof a.events||null===a.events)throw new oI('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in a.events))throw new oI('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if("object"!=typeof a.events["http://schemas.openid.net/event/backchannel-logout"])throw new oI('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:a.sid,sub:a.sub}}});function o4(){let e=w(om,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(w(om,this).useMtls?"1":"0")}async function o6(e){let t=await f(ov,this,it).call(this),n=new rp(e,w(om,this).clientId,w(om,this).clientSecret,t);return n[th]=w(of,this),n}async function o8(){if(w(oh,this)&&w(od,this))return{configuration:w(oh,this),serverMetadata:w(od,this)};let e=f(ov,this,o4).call(this),t=w(ow,this).get(e);if(t)return b(od,this,t.serverMetadata),b(oh,this,await f(ov,this,o6).call(this,t.serverMetadata)),{
1configuration:w(oh,this),serverMetadata:w(od,this)};let n=w(og,this).get(e);if(n){let e=await n;return b(od,this,e.serverMetadata),b(oh,this,await f(ov,this,o6).call(this,e.serverMetadata)),{configuration:w(oh,this),serverMetadata:w(od,this)}}let r=(async()=>{let t=await f(ov,this,it).call(this),n=await rh(new URL("https://".concat(w(om,this).domain)),w(om,this).clientId,{use_mtls_endpoint_aliases:w(om,this).useMtls},t,{[th]:w(of,this)}),r=n.serverMetadata();return w(ow,this).set(e,{serverMetadata:r}),{configuration:n,serverMetadata:r}})(),o=r.then(e=>({serverMetadata:e.serverMetadata}));o.catch(()=>{}),w(og,this).set(e,o);try{let e=await r,t=e.configuration,n=e.serverMetadata;b(oh,this,t),b(od,this,n),w(oh,this)[th]=w(of,this)}finally{w(og,this).delete(e)}return{configuration:w(oh,this),serverMetadata:w(od,this)}}async function o7(e){var t,n;let r=(await f(ov,this,o8).call(this)).configuration;if("audience"in e||"resource"in e)throw new oR("audience and resource parameters are not supported for Token Vault exchanges");o1(e.subjectToken);let o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!=(t=e.subjectTokenType)?t:o3,requested_token_type:null!=(n=e.requestedTokenType)?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&o.append("login_hint",e.loginHint),e.scope&&o.append("scope",e.scope),o5(o,e.extra);try{let e=await rI(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return oY.fromTokenEndpointResponse(e)}catch(t){throw new oR("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function ie(e){let t=(await f(ov,this,o8).call(this)).configuration;o1(e.subjectToken);let n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),o5(n,e.extra);try{let e=await rI(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return oY.fromTokenEndpointResponse(e)}catch(t){throw new oR("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function it(){return w(op,this)||b(op,this,(async()=>{var e,t;let n,r,o;if(!w(om,this).clientSecret&&!w(om,this).clientAssertionSigningKey&&!w(om,this).useMtls)throw new oW;if(w(om,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let i=w(om,this).clientAssertionSigningKey;return!i||i instanceof CryptoKey||(i=await async function(e,t){var n,r;let o,i,a;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return n=void 0,o=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,i=nx(e.replace(o,"")),a=n,null!=t&&null!=(r=t.startsWith)&&r.call(t,"ECDH-ES")&&(a||(a={}),a.getNamedCurve=e=>{let t,n={data:e,pos:0};return n7(n,48,"Invalid PKCS#8 structure"),n8(n),n7(n,2,"Expected version field"),t=n8(n),n.pos+=t,n7(n,48,"Expected algorithm identifier"),n8(n),n.pos,(e=>{let t,n=(n7(e,6,"Expected algorithm OID"),t=n8(e),re(e,t));if(n6(n,[43,101,110]))return"X25519";if(!n6(n,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");n7(e,6,"Expected curve OID");let r=n8(e),o=re(e,r);for(let e of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}]){let t=e.name;if(n6(o,e.oid))return t}throw Error("Unsupported named curve")})(n)}),rt("pkcs8",i,t,a)}(i,w(om,this).clientAssertionSigningAlg||"RS256")),i?(t=void 0,r=(n=(e=i)instanceof CryptoKey?{key:e}:(null==e?void 0:e.key)instanceof CryptoKey?(void 0!==e.kid&&tA(e.kid,'"kid"'),{key:e.key,kid:e.kid}):{}).key,o=n.kid,function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw ts("".concat(t," must be a CryptoKey"),ta)}(e,t),"private"!==e.type)throw ts("".concat(t," must be a private CryptoKey"),ti)}(r,'"clientPrivateKey.key"'),async(e,n,i,a)=>{var s;let c,l={alg:function(e){switch(e.algorithm.name){case"RSA-PSS":switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new tg("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new tg("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}case"ECDSA":switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new tg("unsupported EcKeyAlgorithm namedCurve",{cause:e})}case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new tg("unsupported CryptoKey algorithm name",{cause:e})}}(r),kid:o},u=(c=tO()+tx(n),{jti:tI(),aud:e.issuer,exp:c+60,iat:c,nbf:c,iss:n.client_id,sub:n.client_id});null==t||null==(s=t[td])||s.call(t,l,u),i.set("client_id",n.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw ts('
1CryptoKey instances used for signing assertions must include "sign" in their "usages"',ti);let r="".concat(tw(ty(JSON.stringify(e))),".").concat(tw(ty(JSON.stringify(t)))),o=tw(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:function(e){switch(e.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new tg("unsupported ECDSA namedCurve",{cause:e})}}(e)};case"RSA-PSS":switch(ng(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new tg("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return ng(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new tg("unsupported CryptoKey algorithm name",{cause:e})}(n),n,ty(r)));return"".concat(r,".").concat(o)}(l,u,r))}):ro(w(om,this).clientSecret)})().catch(e=>{throw b(op,this,void 0),e})),w(op,this)}async function ir(e){let t=(await f(ov,this,o8).call(this)).configuration,n=tI(),r=await async function(e){return tA(e,"codeVerifier"),tw(await crypto.subtle.digest("SHA-256",ty(e)))}(n),o=oK(S(S({},w(om,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(S(S({scope:o0},o),{},{client_id:w(om,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await rT(t,i):await rS(t,i),codeVerifier:n}}class io extends O{constructor(e,t){super(e,t),Object.setPrototypeOf(this,io.prototype)}static fromPayload(e){return new io(e.error,e.error_description)}}class ii extends io{constructor(e,t){super(e,t),Object.setPrototypeOf(this,ii.prototype)}}class ia extends io{constructor(e,t){super(e,t),Object.setPrototypeOf(this,ia.prototype)}}class is extends io{constructor(e,t){super(e,t),Object.setPrototypeOf(this,is.prototype)}}class ic extends io{constructor(e,t){super(e,t),Object.setPrototypeOf(this,ic.prototype)}}class il extends io{constructor(e,t){super(e,t),Object.setPrototypeOf(this,il.prototype)}}class iu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,t){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({},t),{createdAt:Date.now()}))}get(e){let t=this.contexts.get(e);if(t){if(!(Date.now()-t.createdAt>this.ttlMs))return t;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){let e=Date.now();for(let n of this.contexts){var t=P(n,2);let r=t[0];e-t[1].createdAt>this.ttlMs&&this.contexts.delete(r)}}get size(){return this.contexts.size}}class ih{constructor(e,t){this.authJsMfaClient=e,this.auth0Client=t,this.contextManager=new iu}setMFAAuthDetails(e,t,n,r){this.contextManager.set(e,{scope:t,audience:n,mfaRequirements:r})}async getAuthenticators(e){var t,n;let r=this.contextManager.get(e);if(!(null==(t=null==r?void 0:r.mfaRequirements)?void 0:t.challenge)||0===r.mfaRequirements.challenge.length)throw new ii("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");let o=r.mfaRequirements.challenge.map(e=>e.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:e})).filter(e=>!!e.type&&o.includes(e.type))}catch(e){if(e instanceof oL)throw new ii(null==(n=e.cause)?void 0:n.error,e.message);throw e}}async enroll(e){var t;let n,r=(n=tr[e.factorType],Object.assign(Object.assign(Object.assign({mfaToken:e.mfaToken,authenticatorTypes:n.authenticatorTypes},n.oobChannels&&{oobChannels:n.oobChannels}),"phoneNumber"in e&&{phoneNumber:e.phoneNumber}),"email"in e&&{email:e.email}));try{return await this.authJsMfaClient.enrollAuthenticator(r)}catch(e){if(e instanceof oN)throw new ia(null==(t=e.cause)?void 0:t.error,e.message);throw e}}async challenge(e){var t;try{let t={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(t.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(t)}catch(e){if(e instanceof oH)throw new is(null==(t=e.cause)?void 0:t.error,e.message);throw e}}async getEnrollmentFactors(e){let t=this.contextManager.get(e);if(!t||!t.mfaRequirements)throw new il("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return t.mfaRequirements.enroll&&0!==t.mfaRequirements.enroll.length?t.mfaRequirements.enroll:[]}async verify(e){let t=this.contextManager.get(e.mfaToken);if(!t)throw new ic("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");let n="otp"in e&&e.otp?"http://auth0.com/oauth/grant-type/mfa-otp":"oobCode"in e&&e.oobCode?"http://auth0.com/oauth/grant-type/mfa-oob":"recoveryCode"in e&&e.recoveryCode?"http://auth0.com/oauth/grant-type/mfa-rec
1overy-code":void 0;if(!n)throw new ic("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");let r=t.scope,o=t.audience;try{let t=await this.auth0Client._requestTokenForMfa({grant_type:n,mfaToken:e.mfaToken,scope:r,audience:o,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),t}catch(e){if(e instanceof D)this.setMFAAuthDetails(e.mfa_token,r,o,e.mfa_requirements);else if(e instanceof ic)throw new ic(e.error,e.error_description);throw e}}}class id extends Error{constructor(e,t,n){super(t),this.name="PasskeyError",this.code=e,this.cause=n,Object.setPrototypeOf(this,id.prototype)}}class ip{constructor(e,t){Q.set(this,void 0),$.set(this,void 0),d(this,Q,e,"f"),d(this,$,t,"f")}async signup(e){var t,n;let r;if(!window.PublicKeyCredential)throw new id("passkey_not_supported","WebAuthn is not supported in this browser.");let o=e.scope,i=e.audience,a=u(e,["scope","audience"]),s=await h(this,Q,"f").register(a),c=Object.assign(Object.assign({},t=s.authnParamsPublicKey),{challenge:iy(t.challenge),user:Object.assign(Object.assign({},t.user),{id:iy(t.user.id)}),pubKeyCredParams:t.pubKeyCredParams,authenticatorSelection:t.authenticatorSelection}),l=await navigator.credentials.create({publicKey:c});if(!l)throw new id("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");let d=(r=l.response,{id:l.id,rawId:im(l.rawId),type:l.type,authenticatorAttachment:null!=(n=l.authenticatorAttachment)?n:void 0,response:{clientDataJSON:im(r.clientDataJSON),attestationObject:im(r.attestationObject)},clientExtensionResults:l.getClientExtensionResults()});return h(this,$,"f")._requestTokenForPasskey({authSession:s.authSession,credential:d,realm:a.realm,organization:a.organization,scope:o,audience:i})}async login(e){var t,n;let r;if(!window.PublicKeyCredential)throw new id("passkey_not_supported","WebAuthn is not supported in this browser.");let o=e||{},i=o.scope,a=o.audience,s=u(o,["scope","audience"]),c=await h(this,Q,"f").challenge(Object.keys(s).length>0?s:void 0),l=Object.assign(Object.assign({},t=c.authnParamsPublicKey),{challenge:iy(t.challenge)}),d=await navigator.credentials.get({publicKey:l});if(!d)throw new id("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");let p=(r=d.response,{id:d.id,rawId:im(d.rawId),type:d.type,authenticatorAttachment:null!=(n=d.authenticatorAttachment)?n:void 0,response:{clientDataJSON:im(r.clientDataJSON),authenticatorData:im(r.authenticatorData),signature:im(r.signature),userHandle:r.userHandle?im(r.userHandle):void 0},clientExtensionResults:d.getClientExtensionResults()});return h(this,$,"f")._requestTokenForPasskey({authSession:c.authSession,credential:p,realm:s.realm,organization:s.organization,scope:i,audience:a})}}function im(e){return btoa(Array.from(new Uint8Array(e),e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function iy(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t+"=".repeat((4-t.length%4)%4)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}Q=new WeakMap,$=new WeakMap;class iw{constructor(e){var t,n;let r,o;if(this.userCache=(new eN).enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"u">typeof window&&(()=>{if(!M())throw Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===M().subtle)throw Error("\n      auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n    ")})(),this.lockManager=(ep||(ep=function(){var e;return"u">typeof navigator&&"function"==typeof(null==(e=navigator.locks)?void 0:e.request)?new eh:new ed}()),ep),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)o=e.cache;
1else{if(!e3(r=e.cacheLocation||R))throw Error('Invalid cache location "'.concat(r,'"'));o=e3(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?eF:eG,this.orgHintCookieName=(t=this.options.clientId,"auth0.".concat(t,".organization_hint")),this.isAuthenticatedCookieName=(e=>"auth0.".concat(e,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const i=e.useCookiesForTransactions?this.cookieStorage:eY;this.scope=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if("object"!=typeof e)return{[C]:eO(t,e,...r)};let i={[C]:eO(t,...r)};return Object.keys(e).forEach(n=>{let o=e[n];i[n]=eO(t,o,...r)}),i}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new eH(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||x,this.cacheManager=new eD(o,o.allKeys?void 0:new e2(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new e7(this.options.clientId):void 0,this.domainUrl=(n=this.options.domain,/^https?:\/\//.test(n)?n:"https://".concat(n)),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:"https://".concat(e,"/"):"".concat(t,"/"))(this.options.issuer,this.domainUrl);const a="".concat(this.domainUrl,"/me/"),s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null==(t=null==e?void 0:e.scope)?void 0:t.join(" "),audience:a},detailedResponse:!0})}}));this.myAccount=new tt(s,a),this.authJsClient=new o9({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new ih(this.authJsClient.mfa,this),this.passkey=new ip(this.authJsClient.passkey,this),"u">typeof window&&window.Worker&&this.options.useRefreshTokens&&r===R&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new e$,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){let t=encodeURIComponent(btoa(JSON.stringify(V(this.options.auth0Client||I,!0))));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(t)}_authorizeUrl(e){return this._url("/authorize?".concat(G(e)))}async _verifyIdToken(e,t,n){var r;let o=await this.nowProvider();return(e=>{if(!e.id_token)throw Error("ID token is required but missing");let t=(e=>{let t=e.split("."),n=P(t,3),r=n[0],o=n[1],i=n[2];if(3!==t.length||!r||!o||!i)throw Error("ID token could not be decoded");let a=JSON.parse(B(o)),s={__raw:e},c={};return Object.keys(a).forEach(e=>{s[e]=a[e],eJ.includes(e)||(c[e]=a[e])}),{encoded:{header:r,payload:o,signature:i},header:JSON.parse(B(r)),claims:s,user:c}})(e.id_token);if(!t.claims.iss)throw Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw 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 Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw 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 Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw Error("Nonce (nonce) claim must be a string present in the ID token");
1if(t.claims.nonce!==e.nonce)throw Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&"number"!=typeof t.claims.auth_time)throw 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||"number"!=typeof t.claims.exp)throw Error("Expiration Time (exp) claim must be a number present in the ID token");if("number"!=typeof t.claims.iat)throw Error("Issued At (iat) claim must be a number present in the ID token");let 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 Error("Expiration Time (exp) claim error in the ID token; current time (".concat(r,") is after expiration time (").concat(o,")"));if(null!=t.claims.nbf&&"number"==typeof t.claims.nbf){let e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),r<e)throw Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(r,") is before ").concat(e))}if(null!=t.claims.auth_time&&"number"==typeof t.claims.auth_time){let o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),r>o)throw Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(r,") is after last auth at ").concat(o))}if(e.organization){let n=e.organization.trim();if(n.startsWith("org_")){if(!t.claims.org_id)throw Error("Organization ID (org_id) claim must be a string present in the ID token");if(n!==t.claims.org_id)throw Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(n,'", found "').concat(t.claims.org_id,'"'))}else{let e=n.toLowerCase();if(!t.claims.org_name)throw Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(e,'", found "').concat(t.claims.org_name,'"'))}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:"string"!=typeof(r=this.options.authorizationParams.max_age)?r:parseInt(r,10)||void 0,now: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})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{let t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState({},"",t.toString()))}catch(e){}}_applySessionTransferToken(e){let t=this.options.sessionTransferTokenQueryParamName;if(!t||e.session_transfer_token)return e;let n=this._extractSessionTransferToken(t);return n?(this._clearSessionTransferTokenFromUrl(t),Object.assign(Object.assign({},e),{session_transfer_token:n})):e}async _prepareAuthorizeUrl(e,t,n){var r;let o,i,a,s,c=btoa(X()),l=btoa(X()),u=X(),h=q(await Y(u)),d=await (null==(r=this.dpop)?void 0:r.calculateThumbprint()),p=(o=this.options,i=this.scope,a=e.redirect_uri||this.options.authorizationParams.redirect_uri||n,s=null==t?void 0:t.response_mode,Object.assign(Object.assign(Object.assign({client_id:o.clientId}
1,o.authorizationParams),e),{scope:ej(i,e.scope,e.audience),response_type:"code",response_mode:s||"query",state:c,nonce:l,redirect_uri:a||o.authorizationParams.redirect_uri,code_challenge:h,code_challenge_method:"S256",dpop_jkt:d})),m=this._authorizeUrl(p);return{nonce:l,code_verifier:u,scope:p.scope,audience:p.audience||C,redirect_uri:p.redirect_uri,state:c,url:m}}async loginWithPopup(e,t){var n;let r,o,i,a;if(e=e||{},!(t=t||{}).popup&&(t.popup=(r=window.screenX+(window.innerWidth-400)/2,o=window.screenY+(window.innerHeight-600)/2,window.open("","auth0:authorize:popup","left=".concat(r,",top=").concat(o,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))),!t.popup))throw new N;let s=this._applySessionTransferToken(e.authorizationParams||{}),c=await this._prepareAuthorizeUrl(s,{response_mode:"web_message"},window.location.origin);t.popup.location.href=c.url;let l=await (i=Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),a=new URL(c.url).origin,new Promise((e,t)=>{let n,r=setInterval(()=>{i.popup&&i.popup.closed&&(clearInterval(r),clearTimeout(o),window.removeEventListener("message",n,!1),t(new L(i.popup)))},1e3),o=setTimeout(()=>{clearInterval(r),t(new U(i.popup)),window.removeEventListener("message",n,!1)},1e3*(i.timeoutInSeconds||60));n=function(s){if(s.origin===a&&s.data&&"authorization_response"===s.data.type){if(clearTimeout(o),clearInterval(r),window.removeEventListener("message",n,!1),!1!==i.closePopup&&i.popup.close(),s.data.response.error)return t(O.fromPayload(s.data.response));e(s.data.response)}},window.addEventListener("message",n)}));if(c.state!==l.state)throw new O("state_mismatch","Invalid state");let u=(null==(n=e.authorizationParams)?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:l.code,redirect_uri:c.redirect_uri},{nonceIn:c.nonce,organization:u})}async getUser(){var e;let t=await this._getIdTokenFromCache();return null==(e=null==t?void 0:t.decodedToken)?void 0:e.user}async getIdTokenClaims(){var e;let t=await this._getIdTokenFromCache();return null==(e=null==t?void 0:t.decodedToken)?void 0:e.claims}async loginWithRedirect(){var e;let t=e9(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
1),n=t.openUrl,r=t.fragment,o=t.appState,i=u(t,["openUrl","fragment","appState"]),a=(null==(e=i.authorizationParams)?void 0:e.organization)||this.options.authorizationParams.organization,s=this._applySessionTransferToken(i.authorizationParams||{}),c=await this._prepareAuthorizeUrl(s),l=c.url,h=u(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},h),{appState:o,response_type:eq.Code}),a&&{organization:a}));let d=r?"".concat(l,"#").concat(r):l;n?await n(d):window.location.assign(d)}async handleRedirectCallback(){var e;let t,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href).split("?").slice(1);if(0===n.length)throw Error("There are no query params available for parsing.");let r=this.transactionManager.get();if(!r)throw new O("missing_transaction","Invalid state");this.transactionManager.remove();let o=((e=n.join("")).indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#"))),{state:(t=new URLSearchParams(e)).get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0});return r.response_type===eq.ConnectCode?this._handleConnectAccountRedirectCallback(o,r):this._handleLoginRedirectCallback(o,r)}async _handleLoginRedirectCallback(e,t){let n=e.code,r=e.state,o=e.error,i=e.error_description;if(o)throw new j(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new O("state_mismatch","Invalid state");let a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:eq.Code}}async _handleConnectAccountRedirectCallback(e,t){let n=e.connect_code,r=e.state,o=e.error,i=e.error_description;if(o)throw new W(o,i||o,t.connection,r,t.appState);if(!n)throw new O("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new O("state_mismatch","Invalid state");return Object.assign(Object.assign({},await this.myAccount.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier})),{appState:t.appState,response_type:eq.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(e1))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(e1)}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(){var e,t,n,r;let o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(Object.assign({cacheMode:"on"},i),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),i.authorizationParams),{scope:ej(this.scope,null==(e=i.authorizationParams)?void 0:e.scope,(null==(t=i.authorizationParams)?void 0:t.audience)||this.options.authorizationParams.audience)})}),s=await (n=()=>this._getTokenSilently(a),(o=e0[r="".concat(this.options.clientId,"::").concat(a.authorizationParams.audience,"::").concat(a.authorizationParams.scope)])||(o=n().finally(()=>{delete e0[r],o=null}),e0[r]=o),o);return i.detailedResponse?s:null==s?void 0:s.access_token}async _getTokenSilently(e){var t,n;let r=e.cacheMode,o=u(e,["cacheMode"]);if("off"!==r){let e=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||C,clientId:this.options.clientId,cacheMode:r});if(e)return e}if("cache-only"===r)return;let i=(t=this.options.clientId,n=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(t,".").concat(n));try{return await this.lockManager.runWithLock(i,5e3,async()=>{if("off"!==r){let e=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||C,clientId:this.options.clientId});if(e)return e}let e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),t=e.id_token,n=e.token_type,i=e.access_token,a=e.oauthTokenScope,s=e.expires_in;return Object.assign(Object.assign({id_token:t,token_type:n,access_token:i},a?{scope:a}:null),{expires_in:s})})}catch(e){if(this._isInteractiveError(e)&&"popup"===this.options.interactiveErrorHandler)return await this._handleInteractiveErrorWithPopup(o);throw e}}_isInteractiveError(e){return e instanceof D||e instanceof O&&this._isIframeMfaError(e)}_isIframeMfaError(e){return"login_required"===e.error&&"Multifactor authentication required"===e.error_description}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});let t=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||C,clientId:this.options.clientId});if(!t)throw new O("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return t}catch(e){throw e}}async getTokenWithPopup(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:ej(this.scope,null==(e=n.authorizationParams)?void 0:e.scope,(null==(t=n.authorizationParams)?void 0:t.audience)||this.options.authorizationParams.audience)})});return r=Object.assign(Object.assign({},A),r),await this.loginWithPopup(o,r),(await this.cacheManager.get(new eU({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||C,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;let t=e.logoutParams||{},n=t.federated,r=u(t,["federated"]);return this._url("/v2/logout?".concat(G(Object.assign({clientId:e.clientId},r))))+(n?"&federated":"")}async revokeRefreshToken(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.options.useRefreshTokens)return;let t=e.audience||this.options.authorizationParams.audience||C,n=await this.cacheManager.getRefreshTokensByAudience(t,this.options.clientId);await async function(e,t){let n=e.baseUrl,r=e.timeout,o=e.auth0Client,i=e.useFormData,a=e.refreshTokens,s=e.audience,c=e.client_id,l=e.onRefreshTokenRevoked,u=r||1e4,h="refresh_token",d="".concat(n,"/oauth/revoke"),p={"Content-Type":i?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(V(o||I)))};if(t){let e={client_id:c,token_type_hint:h},n=i?G(e):JSON.stringify(e);try{return await eA({type:"revoke",timeout:u,fetchUrl:d,fetchOptions:{method:"POST",body:n,headers:p},useFormData:i,auth:{audience:null!=s?s:C}},t)}catch(e){throw new O("revoke_error",e.message)}}for(let e of a){let t={client_id:c,token_type_hint:h,token:e},n=i?G(t):JSON.stringify(t),r=await eR(d,{method:"POST",body:n,headers:p},u);if(!r.ok){let e,t;try{var m=JSON.parse(await r.text());e=m.error,t=m.error_description}catch(e){}throw new O(e||"revoke_error",t||"HTTP error ".concat(r.status))}await (null==l?void 0:l(e))}}({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:n,audience:t,onRefreshTokenRevoked:e=>this.cacheManager.stripRefreshToken(e)},this.worker)}async logout(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e9(t),r=n.openUrl,o=u(n,["openUrl"]);null===t.clientId?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(eK);try{await (null==(e=this.dpop)?void 0:e.clear())}catch(e){}if(this.worker)try{await eA({type:"clear"},this.worker)}catch(e){}let i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){var t;let n=(t=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(t));try{return await this.lockManager.runWithLock(n,5e3,async()=>{let t,n=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),r=this.cookieStorage.get(this.orgHintCookieName);r&&!n.organization&&(n.organization=r);let o=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin),i=o.url,a=o.state,s=o.nonce,c=o.code_verifier,l=o.redirect_uri,u=o.scope,h=o.audience;if(window.crossOriginIsolated)throw new O("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");let d=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;try{t=new URL(this.domainUrl).origin}catch(e){t=this.domainUrl}let p=await function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;return new Promise((r,o)=>{let i,a=window.document.createElement("iframe");a.setAttribute("width","0"),a.setAttribute("height","0"),a.style.display="none";let s=()=>{window.document.body.contains(a)&&(window.document.body.removeChild(a),window.removeEventListener("message",i,!1))},c=setTimeout(()=>{o(new K),s()},1e3*n);i=function(e){if(e.origin!=t||!e.data||"authorization_response"!==e.data.type)return;let n=e.source;n&&n.close(),e.data.response.error?o(O.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",i,!1),setTimeout(s,2e3)},window.addEventListener("message",i,!1),window.document.body.appendChild(a),a.setAttribute("src",e)})}(i,t,d);if(a!==p.state)throw new O("state_mismatch","Invalid state");let m=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:c,code:p.code,grant_type:"authorization_code",redirect_uri:l,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:s,organization:n.organization});return Object.assign(Object.assign({},m),{scope:u,oauthTokenScope:m.scope,audience:h})})}catch(e){throw"login_required"===e.error&&(e instanceof O&&this._isIframeMfaError(e)&&"popup"===this.options.interactiveErrorHandler||this.logout({openUrl:!1})),e}}async _getTokenUsingRefreshToken(e){var t,n,r,o,i,a,s;let c=await this.cacheManager.get(new eU({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||C,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(c&&c.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new H(e.authorizationParams.audience||C,e.authorizationParams.scope)}let l=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,u="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,h=((e,t,n,r)=>{var o;
1if(e&&n&&r){if(t.audience!==n)return t.scope;let e=r.split(" "),i=(null==(o=t.scope)?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==c?void 0:c.audience,null==c?void 0:c.scope);try{let i=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:c&&c.refresh_token,redirect_uri:l}),u&&{timeout:u}),{scopesToRequest:h});if(i.refresh_token&&(null==c?void 0:c.refresh_token)&&await this.cacheManager.updateEntry(c.refresh_token,i.refresh_token),this.options.useMrrt&&(t=null==c?void 0:c.audience,n=null==c?void 0:c.scope,r=e.authorizationParams.audience,o=e.authorizationParams.scope,t!==r||!e4(o,n))&&!e4(h,i.scope)){let t,n;if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);let r=(s=i.scope,t=(null==h?void 0:h.split(" "))||[],n=(null==s?void 0:s.split(" "))||[],t.filter(e=>-1==n.indexOf(e)).join(","));throw new J(e.authorizationParams.audience||"default",r)}return Object.assign(Object.assign({},i),{scope:e.authorizationParams.scope,oauthTokenScope:i.scope,audience:e.authorizationParams.audience||C})}catch(t){if(t.message){if(t.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),t;if((t.message.includes("Missing Refresh Token")||t.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw t instanceof D&&this.mfa.setMFAAuthDetails(t.mfa_token,null==(i=e.authorizationParams)?void 0:i.scope,null==(a=e.authorizationParams)?void 0:a.audience,t.mfa_requirements),t}}async _saveEntryInCache(e){let t=e.id_token,n=e.decodedToken,r=u(e,["id_token","decodedToken"]);this.userCache.set(eK,{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){let e=this.options.authorizationParams.audience||C,t=this.scope[e],n=await this.cacheManager.getIdToken(new eU({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get(eK);return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set(eK,n),n)}async _getEntryFromCache(e){let t=e.scope,n=e.audience,r=e.clientId,o=e.cacheMode,i=await this.cacheManager.get(new eU({scope:t,audience:n,clientId:r}),60,this.options.useMrrt,o);if(i&&i.access_token){let e=i.token_type,t=i.access_token,n=i.oauthTokenScope,r=i.expires_in,o=await this._getIdTokenFromCache();return o&&Object.assign(Object.assign({id_token:o.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){var n,r;let o=t||{},i=o.nonceIn,a=o.organization,s=o.scopesToRequest,c=await eC(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:s||e.scope}),this.worker),l=await this._verifyIdToken(c.id_token,i,a);if("authorization_code"===e.grant_type){let e=await this._getIdTokenFromCache();(null==(r=null==(n=null==e?void 0:e.decodedToken)?void 0:n.claims)?void 0:r.sub)&&e.decodedToken.claims.sub!==l.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(eK))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},c),{decodedToken:l,scope:e.scope,audience:e.audience||C}),c.scope?{oauthTokenScope:c.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||l.claims.org_id),Object.assign(Object.assign({},c),{decodedToken:l})}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}
1),{scope:ej(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){return this._requestToken(this._buildTokenExchangeParams(e))}async customTokenExchange(e){let t=await eC(Object.assign(Object.assign({},this._buildTokenExchangeParams(e)),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return t.id_token&&await this._verifyIdToken(t.id_token,void 0,e.organization),t}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new te(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null==(t=null==e?void 0:e.scope)?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){let t=e.openUrl,n=e.appState,r=e.connection,o=e.scopes,i=e.authorization_params,a=e.redirectUri,s=void 0===a?this.options.authorizationParams.redirect_uri||window.location.origin:a;if(!r)throw Error("connection is required");let c=btoa(X()),l=X(),u=q(await Y(l)),h=await this.myAccount.connectAccount({connection:r,scopes:o,redirect_uri:s,state:c,code_challenge:u,code_challenge_method:"S256",authorization_params:i}),d=h.connect_uri,p=h.connect_params,m=h.auth_session;this.transactionManager.create({state:c,code_verifier:l,auth_session:m,redirect_uri:s,appState:n,connection:r,response_type:eq.ConnectCode});let f=new URL(d);f.searchParams.set("ticket",p.ticket),t?await t(f.toString()):window.location.assign(f)}async _requestTokenForPasskey(e){let t=e.audience||this.options.authorizationParams.audience,n=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),n&&{organization:n}),{scope:ej(this.scope,e.scope,t),audience:t}))}async _requestTokenForMfa(e,t){let n=e.mfaToken,r=u(e,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:n}),t)}}async function ig(e){let t=new iw(e);return await t.checkSession(),t}var ib=e.i(1148);let iv=async()=>await ig({clientId:"Gg6YfVlRNx47i71L0A2KGKHKKukCv0yj",domain:"auth.loczhit.com",cacheLocation:"localstorage",authorizationParams:{audience:"loczhit_api",redirect_uri:ib.LczRoutes.loginRedirectUrl()}});e.s(["createLczAuth0Client",0,iv],81475)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.