@corbado/webcomponent
Advanced tools
Comparing version 1.0.11 to 1.0.12
{ | ||
"name": "@corbado/webcomponent", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "", | ||
@@ -33,4 +33,5 @@ "main": "pkg/auth.js", | ||
"dependencies": { | ||
"jose": "^4.14.4", | ||
"js-cookie": "^3.0.5" | ||
} | ||
} |
/*! For license information please see session.js.LICENSE.txt */ | ||
var e={230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{function e(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e<r.length;e++)n[r[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}n.d(r,{Z:()=>_n}),Object.assign;const t=Object.prototype.hasOwnProperty,o=(e,n)=>t.call(e,n),s=Array.isArray,i=e=>"[object Map]"===l(e),a=e=>"symbol"==typeof e,c=e=>null!==e&&"object"==typeof e,u=Object.prototype.toString,l=e=>u.call(e),f=e=>l(e).slice(8,-1),h=e=>"string"==typeof e&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,d=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},p=/-(\w)/g,m=(d((e=>e.replace(p,((e,t)=>t?t.toUpperCase():"")))),/\B([A-Z])/g),g=(d((e=>e.replace(m,"-$1").toLowerCase())),d((e=>e.charAt(0).toUpperCase()+e.slice(1)))),b=(d((e=>e?`on${g(e)}`:"")),(e,t)=>!Object.is(e,t)),y=e=>{const t=new Set(e);return t.w=0,t.n=0,t},w=e=>(e.w&_)>0,E=e=>(e.n&_)>0,v=new WeakMap;let O=0,_=1;const R=30;let S;const j=Symbol(""),x=Symbol("");let T=!0;const A=[];function C(e,t,n){if(T&&S){let t=v.get(e);t||v.set(e,t=new Map);let r=t.get(n);r||t.set(n,r=y()),k(r)}}function k(e,t){let n=!1;O<=R?E(e)||(e.n|=_,n=!w(e)):n=!e.has(S),n&&(e.add(S),S.deps.push(e))}function N(e,t,n,r,o,a){const c=v.get(e);if(!c)return;let u=[];if("clear"===t)u=[...c.values()];else if("length"===n&&s(e))c.forEach(((e,t)=>{("length"===t||t>=r)&&u.push(e)}));else switch(void 0!==n&&u.push(c.get(n)),t){case"add":s(e)?h(n)&&u.push(c.get("length")):(u.push(c.get(j)),i(e)&&u.push(c.get(x)));break;case"delete":s(e)||(u.push(c.get(j)),i(e)&&u.push(c.get(x)));break;case"set":i(e)&&u.push(c.get(j))}if(1===u.length)u[0]&&P(u[0]);else{const e=[];for(const t of u)t&&e.push(...t);P(y(e))}}function P(e,t){const n=s(e)?e:[...e];for(const e of n)e.computed&&U(e);for(const e of n)e.computed||U(e)}function U(e,t){(e!==S||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const D=e("__proto__,__v_isRef,__isVue"),B=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(a)),L=M(),F=M(!0),z=I();function I(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=Ee(this);for(let e=0,t=this.length;e<t;e++)C(n,0,e+"");const r=n[t](...e);return-1===r||!1===r?n[t](...e.map(Ee)):r}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){A.push(T),T=!1;const n=Ee(this)[t].apply(this,e);return function(){const e=A.pop();T=void 0===e||e}(),n}})),e}function M(e=!1,t=!1){return function(n,r,i){if("__v_isReactive"===r)return!e;if("__v_isReadonly"===r)return e;if("__v_isShallow"===r)return t;if("__v_raw"===r&&i===(e?t?pe:de:t?he:fe).get(n))return n;const u=s(n);if(!e&&u&&o(z,r))return Reflect.get(z,r,i);const l=Reflect.get(n,r,i);return(a(r)?B.has(r):D(r))?l:(e||C(n,0,r),t?l:_e(l)?u&&h(r)?l:l.value:c(l)?e?ge(l):me(l):l)}}function W(e=!1){return function(t,n,r,i){let a=t[n];if(ye(a)&&_e(a)&&!_e(r))return!1;if(!e&&(we(r)||ye(r)||(a=Ee(a),r=Ee(r)),!s(t)&&_e(a)&&!_e(r)))return a.value=r,!0;const c=s(t)&&h(n)?Number(n)<t.length:o(t,n),u=Reflect.set(t,n,r,i);return t===Ee(i)&&(c?b(r,a)&&N(t,"set",n,r):N(t,"add",n,r)),u}}const J={get:L,set:W(),deleteProperty:function(e,t){const n=o(e,t),r=(e[t],Reflect.deleteProperty(e,t));return r&&n&&N(e,"delete",t,void 0),r},has:function(e,t){const n=Reflect.has(e,t);return a(t)&&B.has(t)||C(e,0,t),n},ownKeys:function(e){return C(e,0,s(e)?"length":j),Reflect.ownKeys(e)}},q={get:F,set:(e,t)=>!0,deleteProperty:(e,t)=>!0},V=e=>e,H=e=>Reflect.getPrototypeOf(e);function K(e,t,n=!1,r=!1){const o=Ee(e=e.__v_raw),s=Ee(t);n||(t!==s&&C(o,0,t),C(o,0,s));const{has:i}=H(o),a=r?V:n?Oe:ve;return i.call(o,t)?a(e.get(t)):i.call(o,s)?a(e.get(s)):void(e!==o&&e.get(t))}function $(e,t=!1){const n=this.__v_raw,r=Ee(n),o=Ee(e);return t||(e!==o&&C(r,0,e),C(r,0,o)),e===o?n.has(e):n.has(e)||n.has(o)}function X(e,t=!1){return e=e.__v_raw,!t&&C(Ee(e),0,j),Reflect.get(e,"size",e)}function Z(e){e=Ee(e);const t=Ee(this);return H(t).has.call(t,e)||(t.add(e),N(t,"add",e,e)),this}function Q(e,t){t=Ee(t);const n=Ee(this),{has:r,get:o}=H(n);let s=r.call(n,e);s||(e=Ee(e),s=r.call(n,e));const i=o.call(n,e);return n.set(e,t),s?b(t,i)&&N(n,"set",e,t):N(n,"add",e,t),this}function G(e){const t=Ee(this),{has:n,get:r}=H(t);let o=n.call(t,e);o||(e=Ee(e),o=n.call(t,e)),r&&r.call(t,e);const s=t.delete(e);return o&&N(t,"delete",e,void 0),s}function Y(){const e=Ee(this),t=0!==e.size,n=e.clear();return t&&N(e,"clear",void 0,void 0),n}function ee(e,t){return function(n,r){const o=this,s=o.__v_raw,i=Ee(s),a=t?V:e?Oe:ve;return!e&&C(i,0,j),s.forEach(((e,t)=>n.call(r,a(e),a(t),o)))}}function te(e,t,n){return function(...r){const o=this.__v_raw,s=Ee(o),a=i(s),c="entries"===e||e===Symbol.iterator&&a,u="keys"===e&&a,l=o[e](...r),f=n?V:t?Oe:ve;return!t&&C(s,0,u?x:j),{next(){const{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:c?[f(e[0]),f(e[1])]:f(e),done:t}},[Symbol.iterator](){return this}}}}function ne(e){return function(...t){return"delete"!==e&&this}}function re(){const e={get(e){return K(this,e)},get size(){return X(this)},has:$,add:Z,set:Q,delete:G,clear:Y,forEach:ee(!1,!1)},t={get(e){return K(this,e,!1,!0)},get size(){return X(this)},has:$,add:Z,set:Q,delete:G,clear:Y,forEach:ee(!1,!0)},n={get(e){return K(this,e,!0)},get size(){return X(this,!0)},has(e){return $.call(this,e,!0)},add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear"),forEach:ee(!0,!1)},r={get(e){return K(this,e,!0,!0)},get size(){return X(this,!0)},has(e){return $.call(this,e,!0)},add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear"),forEach:ee(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((o=>{e[o]=te(o,!1,!1),n[o]=te(o,!0,!1),t[o]=te(o,!1,!0),r[o]=te(o,!0,!0)})),[e,n,t,r]}const[oe,se,ie,ae]=re();function ce(e,t){const n=t?e?ae:ie:e?se:oe;return(t,r,s)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(o(n,r)&&r in t?n:t,r,s)}const ue={get:ce(!1,!1)},le={get:ce(!0,!1)},fe=new WeakMap,he=new WeakMap,de=new WeakMap,pe=new WeakMap;function me(e){return ye(e)?e:be(e,!1,J,ue,fe)}function ge(e){return be(e,!0,q,le,de)}function be(e,t,n,r,o){if(!c(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=o.get(e);if(s)return s;const i=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(f(a));var a;if(0===i)return e;const u=new Proxy(e,2===i?r:n);return o.set(e,u),u}function ye(e){return!(!e||!e.__v_isReadonly)}function we(e){return!(!e||!e.__v_isShallow)}function Ee(e){const t=e&&e.__v_raw;return t?Ee(t):e}const ve=e=>c(e)?me(e):e,Oe=e=>c(e)?ge(e):e;function _e(e){return!(!e||!0!==e.__v_isRef)}class Re{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Ee(e),this._value=t?e:ve(e)}get value(){return e=this,T&&S&&k((e=Ee(e)).dep||(e.dep=y())),this._value;var e}set value(e){const t=this.__v_isShallow||we(e)||ye(e);var n;e=t?e:Ee(e),b(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ve(e),(n=Ee(n=this)).dep&&P(n.dep))}}function Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var je=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Se({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var i in o)o[i]&&(s+="; "+i,!0!==o[i]&&(s+="="+o[i].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(r[a]=t.read(i,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Se({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Se({},this.attributes,t))},withConverter:function(t){return e(Se({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const xe=je;function Te(e){const t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""}class Ae{#e;#t;#n;constructor(e,t){var n,r;this.#e=e,this.#t=t,this.#n=(r=!1,_e(n=!0)?n:new Re(n,r))}#r=()=>this.#e.put("/v1/sessions/refresh").then((e=>(this.#t.value={initialLoaded:!0,authed:!0,sessionToken:e.data.sessionToken,globalError:""},function(e){var t;e.shortSession&&(t=e.shortSession,xe.set(t.key,t.value,{path:t.path,expires:new Date(t.expires),secure:t.secure,sameSite:t.sameSite,domain:t.domain}))}(e.data),e.data))).catch((e=>{if("AxiosError"!==e.name)throw e;"ERR_NETWORK"!==e.code?e.response&&401===e.response.status&&(this.#t.value={initialLoaded:!0,authed:!1,sessionToken:"",globalError:""}):this.#t.value={initialLoaded:!0,authed:!1,sessionToken:"",globalError:"Network error - please check cors settings"}}));#o=()=>""!==Te("cbo_short_session");#s=()=>""!==Te("cbo_short_session");#i=()=>!1;initialize(){setInterval((()=>{!1===this.#o()&&(!1===this.#n.value?(this.#n.value=!0,console.log("run check expired"),this.#r().then((e=>{this.#o()&&(this.#t.value={initialLoaded:!0,authed:!0,sessionToken:e.sessionToken,globalError:""},this.#n.value=!this.#t.value.authed)})).catch((()=>{this.#n.value=!1}))):this.#t.value={initialLoaded:!0,authed:!1,sessionToken:"",globalError:""})}),500),setInterval((()=>{this.#s()&&this.#o()&&!this.#i()&&(this.#n.value=!1,this.#r())}),24e4),this.#r().then((()=>{this.#t.value.initialLoaded=!0}))}logout(){this.#e.delete("/v1/sessions/logout").then((()=>{this.#t.value={initialLoaded:!0,authed:!1,sessionToken:"",globalError:""}})).catch((e=>{console.error(e)}))}}function Ce(e,t){return function(){return e.apply(t,arguments)}}const{toString:ke}=Object.prototype,{getPrototypeOf:Ne}=Object,Pe=(Ue=Object.create(null),e=>{const t=ke.call(e);return Ue[t]||(Ue[t]=t.slice(8,-1).toLowerCase())});var Ue;const De=e=>(e=e.toLowerCase(),t=>Pe(t)===e),Be=e=>t=>typeof t===e,{isArray:Le}=Array,Fe=Be("undefined"),ze=De("ArrayBuffer"),Ie=Be("string"),Me=Be("function"),We=Be("number"),Je=e=>null!==e&&"object"==typeof e,qe=e=>{if("object"!==Pe(e))return!1;const t=Ne(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Ve=De("Date"),He=De("File"),Ke=De("Blob"),$e=De("FileList"),Xe=De("URLSearchParams");function Ze(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Le(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}const Qe=(Ge="undefined"!=typeof Uint8Array&&Ne(Uint8Array),e=>Ge&&e instanceof Ge);var Ge;const Ye=De("HTMLFormElement"),et=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),tt=De("RegExp"),nt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ze(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},rt={isArray:Le,isArrayBuffer:ze,isBuffer:function(e){return null!==e&&!Fe(e)&&null!==e.constructor&&!Fe(e.constructor)&&Me(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||ke.call(e)===t||Me(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ze(e.buffer),t},isString:Ie,isNumber:We,isBoolean:e=>!0===e||!1===e,isObject:Je,isPlainObject:qe,isUndefined:Fe,isDate:Ve,isFile:He,isBlob:Ke,isRegExp:tt,isFunction:Me,isStream:e=>Je(e)&&Me(e.pipe),isURLSearchParams:Xe,isTypedArray:Qe,isFileList:$e,forEach:Ze,merge:function e(){const t={},n=(n,r)=>{qe(t[r])&&qe(n)?t[r]=e(t[r],n):qe(n)?t[r]=e({},n):Le(n)?t[r]=n.slice():t[r]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Ze(arguments[e],n);return t},extend:(e,t,n,{allOwnKeys:r}={})=>(Ze(t,((t,r)=>{n&&Me(t)?e[r]=Ce(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&Ne(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Pe,kindOfTest:De,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Le(e))return e;let t=e.length;if(!We(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Ye,hasOwnProperty:et,hasOwnProp:et,reduceDescriptors:nt,freezeMethods:e=>{nt(e,((t,n)=>{const r=e[n];Me(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Le(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t)};function ot(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}rt.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const st=ot.prototype,it={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{it[e]={value:e}})),Object.defineProperties(ot,it),Object.defineProperty(st,"isAxiosError",{value:!0}),ot.from=(e,t,n,r,o,s)=>{const i=Object.create(st);return rt.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ot.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const at=ot,ct=n(230);function ut(e){return rt.isPlainObject(e)||rt.isArray(e)}function lt(e){return rt.endsWith(e,"[]")?e.slice(0,-2):e}function ft(e,t,n){return e?e.concat(t).map((function(e,t){return e=lt(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ht=rt.toFlatObject(rt,{},null,(function(e){return/^is[A-Z]/.test(e)})),dt=function(e,t,n){if(!rt.isObject(e))throw new TypeError("target must be an object");t=t||new(ct||FormData);const r=(n=rt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!rt.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&(c=t)&&rt.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator];var c;if(!rt.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(rt.isDate(e))return e.toISOString();if(!a&&rt.isBlob(e))throw new at("Blob is not supported. Use a Buffer instead.");return rt.isArrayBuffer(e)||rt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(rt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(rt.isArray(e)&&function(e){return rt.isArray(e)&&!e.some(ut)}(e)||rt.isFileList(e)||rt.endsWith(n,"[]")&&(a=rt.toArray(e)))return n=lt(n),a.forEach((function(e,r){!rt.isUndefined(e)&&null!==e&&t.append(!0===i?ft([n],r,s):null===i?n:n+"[]",u(e))})),!1;return!!ut(e)||(t.append(ft(o,n,s),u(e)),!1)}const f=[],h=Object.assign(ht,{defaultVisitor:l,convertValue:u,isVisitable:ut});if(!rt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!rt.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),rt.forEach(n,(function(n,s){!0===(!(rt.isUndefined(n)||null===n)&&o.call(t,n,rt.isString(s)?s.trim():s,r,h))&&e(n,r?r.concat(s):[s])})),f.pop()}}(e),t};function pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function mt(e,t){this._pairs=[],e&&dt(e,this,t)}const gt=mt.prototype;gt.append=function(e,t){this._pairs.push([e,t])},gt.toString=function(e){const t=e?function(t){return e.call(this,t,pt)}:pt;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const bt=mt;function yt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wt(e,t,n){if(!t)return e;const r=n&&n.encode||yt,o=n&&n.serialize;let s;if(s=o?o(t,n):rt.isURLSearchParams(t)?t.toString():new bt(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Et=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){rt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},vt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ot="undefined"!=typeof URLSearchParams?URLSearchParams:bt,_t=FormData,Rt=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),St={isBrowser:!0,classes:{URLSearchParams:Ot,FormData:_t,Blob},isStandardBrowserEnv:Rt,protocols:["http","https","file","blob","url","data"]},jt=function(e){function t(e,n,r,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&rt.isArray(r)?r.length:s,a?(rt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&rt.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&rt.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(rt.isFormData(e)&&rt.isFunction(e.entries)){const n={};return rt.forEachEntry(e,((e,r)=>{t(function(e){return rt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},xt=St.isStandardBrowserEnv?{write:function(e,t,n,r,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),rt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),rt.isString(r)&&i.push("path="+r),rt.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Tt(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const At=St.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=rt.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ct(e,t,n){at.call(this,null==e?"canceled":e,at.ERR_CANCELED,t,n),this.name="CanceledError"}rt.inherits(Ct,at,{__CANCEL__:!0});const kt=Ct,Nt=rt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pt=Symbol("internals"),Ut=Symbol("defaults");function Dt(e){return e&&String(e).trim().toLowerCase()}function Bt(e){return!1===e||null==e?e:rt.isArray(e)?e.map(Bt):String(e)}function Lt(e,t,n,r){return rt.isFunction(r)?r.call(this,t,n):rt.isString(t)?rt.isString(r)?-1!==t.indexOf(r):rt.isRegExp(r)?r.test(t):void 0:void 0}function Ft(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}function zt(e,t){e&&this.set(e),this[Ut]=t||null}Object.assign(zt.prototype,{set:function(e,t,n){const r=this;function o(e,t,n){const o=Dt(t);if(!o)throw new Error("header name must be a non-empty string");const s=Ft(r,o);(!s||!0===n||!1!==r[s]&&!1!==n)&&(r[s||t]=Bt(e))}return rt.isPlainObject(e)?rt.forEach(e,((e,n)=>{o(e,n,t)})):o(t,e,n),this},get:function(e,t){if(!(e=Dt(e)))return;const n=Ft(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(rt.isFunction(t))return t.call(this,e,n);if(rt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,t){if(e=Dt(e)){const n=Ft(this,e);return!(!n||t&&!Lt(0,this[n],n,t))}return!1},delete:function(e,t){const n=this;let r=!1;function o(e){if(e=Dt(e)){const o=Ft(n,e);!o||t&&!Lt(0,n[o],o,t)||(delete n[o],r=!0)}}return rt.isArray(e)?e.forEach(o):o(e),r},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const t=this,n={};return rt.forEach(this,((r,o)=>{const s=Ft(n,o);if(s)return t[s]=Bt(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Bt(r),n[i]=!0})),this},toJSON:function(e){const t=Object.create(null);return rt.forEach(Object.assign({},this[Ut]||null,this),((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&rt.isArray(n)?n.join(", "):n)})),t}}),Object.assign(zt,{from:function(e){return rt.isString(e)?new this((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Nt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e)):e instanceof this?e:new this(e)},accessor:function(e){const t=(this[Pt]=this[Pt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Dt(e);t[r]||(function(e,t){const n=rt.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return rt.isArray(e)?e.forEach(r):r(e),this}}),zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),rt.freezeMethods(zt.prototype),rt.freezeMethods(zt);const It=zt,Mt=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const h=u&&c-u;return h?Math.round(1e3*f/h):void 0}};function Wt(e,t){let n=0;const r=Mt(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0};u[t?"download":"upload"]=!0,e(u)}}function Jt(e){return new Promise((function(t,n){let r=e.data;const o=It.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}rt.isFormData(r)&&St.isStandardBrowserEnv&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=Tt(e.baseURL,e.url);function l(){if(!c)return;const r=It.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new at("Request failed with status code "+n.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),wt(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new at("Request aborted",at.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new at("Network Error",at.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||vt;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new at(t,r.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,e,c)),c=null},St.isStandardBrowserEnv){const t=(e.withCredentials||At(u))&&e.xsrfCookieName&&xt.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in c&&rt.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),rt.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Wt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Wt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(n(!t||t.type?new kt(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===St.protocols.indexOf(f)?n(new at("Unsupported protocol "+f+":",at.ERR_BAD_REQUEST,e)):c.send(r||null)}))}const qt={http:Jt,xhr:Jt},Vt=e=>{if(rt.isString(e)){const t=qt[e];if(!e)throw Error(rt.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return t}if(!rt.isFunction(e))throw new TypeError("adapter is not a function");return e},Ht={"Content-Type":"application/x-www-form-urlencoded"},Kt={transitional:vt,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=Vt("xhr"):"undefined"!=typeof process&&"process"===rt.kindOf(process)&&(e=Vt("http")),e}(),transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=rt.isObject(e);if(o&&rt.isHTMLForm(e)&&(e=new FormData(e)),rt.isFormData(e))return r&&r?JSON.stringify(jt(e)):e;if(rt.isArrayBuffer(e)||rt.isBuffer(e)||rt.isStream(e)||rt.isFile(e)||rt.isBlob(e))return e;if(rt.isArrayBufferView(e))return e.buffer;if(rt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return dt(e,new St.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return St.isNode&&rt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=rt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return dt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(rt.isString(e))try{return(0,JSON.parse)(e),rt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Kt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&rt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw at.from(e,at.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};rt.forEach(["delete","get","head"],(function(e){Kt.headers[e]={}})),rt.forEach(["post","put","patch"],(function(e){Kt.headers[e]=rt.merge(Ht)}));const $t=Kt;function Xt(e,t){const n=this||$t,r=t||n,o=It.from(r.headers);let s=r.data;return rt.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Zt(e){return!(!e||!e.__CANCEL__)}function Qt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new kt}function Gt(e){return Qt(e),e.headers=It.from(e.headers),e.data=Xt.call(e,e.transformRequest),(e.adapter||$t.adapter)(e).then((function(t){return Qt(e),t.data=Xt.call(e,e.transformResponse,t),t.headers=It.from(t.headers),t}),(function(t){return Zt(t)||(Qt(e),t&&t.response&&(t.response.data=Xt.call(e,e.transformResponse,t.response),t.response.headers=It.from(t.response.headers))),Promise.reject(t)}))}function Yt(e,t){t=t||{};const n={};function r(e,t){return rt.isPlainObject(e)&&rt.isPlainObject(t)?rt.merge(e,t):rt.isPlainObject(t)?rt.merge({},t):rt.isArray(t)?t.slice():t}function o(n){return rt.isUndefined(t[n])?rt.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function s(e){if(!rt.isUndefined(t[e]))return r(void 0,t[e])}function i(n){return rt.isUndefined(t[n])?rt.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a};return rt.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){const t=c[e]||o,r=t(e);rt.isUndefined(r)&&t!==a||(n[e]=r)})),n}const en={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{en[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const tn={};en.transitional=function(e,t,n){function r(e,t){return"[Axios v1.1.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new at(r(o," has been removed"+(t?" in "+t:"")),at.ERR_DEPRECATED);return t&&!tn[o]&&(tn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const nn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new at("option "+s+" must be "+n,at.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}},validators:en},rn=nn.validators;class on{constructor(e){this.defaults=e,this.interceptors={request:new Et,response:new Et}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Yt(this.defaults,t);const{transitional:n,paramsSerializer:r}=t;void 0!==n&&nn.assertOptions(n,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean)},!1),void 0!==r&&nn.assertOptions(r,{encode:rn.function,serialize:rn.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();const o=t.headers&&rt.merge(t.headers.common,t.headers[t.method]);o&&rt.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),t.headers=new It(t.headers,o);const s=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const a=[];let c;this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)}));let u,l=0;if(!i){const e=[Gt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,a),u=e.length,c=Promise.resolve(t);l<u;)c=c.then(e[l++],e[l++]);return c}u=s.length;let f=t;for(l=0;l<u;){const e=s[l++],t=s[l++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=Gt.call(this,f)}catch(e){return Promise.reject(e)}for(l=0,u=a.length;l<u;)c=c.then(a[l++],a[l++]);return c}getUri(e){return wt(Tt((e=Yt(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}rt.forEach(["delete","get","head","options"],(function(e){on.prototype[e]=function(t,n){return this.request(Yt(n||{},{method:e,url:t,data:(n||{}).data}))}})),rt.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Yt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}on.prototype[e]=t(),on.prototype[e+"Form"]=t(!0)}));const sn=on;class an{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new kt(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new an((function(t){e=t})),cancel:e}}}const cn=an,un=function e(t){const n=new sn(t),r=Ce(sn.prototype.request,n);return rt.extend(r,sn.prototype,n,{allOwnKeys:!0}),rt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Yt(t,n))},r}($t);un.Axios=sn,un.CanceledError=kt,un.CancelToken=cn,un.isCancel=Zt,un.VERSION="1.1.3",un.toFormData=dt,un.AxiosError=at,un.Cancel=un.CanceledError,un.all=function(e){return Promise.all(e)},un.spread=function(e){return function(t){return e.apply(null,t)}},un.isAxiosError=function(e){return rt.isObject(e)&&!0===e.isAxiosError},un.formToJSON=e=>jt(rt.isHTMLForm(e)?new FormData(e):e);const ln=un,{Axios:fn,AxiosError:hn,CanceledError:dn,isCancel:pn,CancelToken:mn,VERSION:gn,all:bn,Cancel:yn,isAxiosError:wn,spread:En,toFormData:vn}=ln,On=ln;class _n extends Ae{constructor(e,t,n){const r=On.create({withCredentials:!0,baseURL:t,timeout:6e4});r.defaults.headers.common["X-Corbado-ProjectID"]=e,super(r,n)}}})();var o=r.Z;export{o as default}; | ||
var e={230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};(()=>{function e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}r.d(n,{Z:()=>Lt});var t=function t(r,n){function o(t,o,s){if("undefined"!=typeof document){"number"==typeof(s=e({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in s)s[a]&&(i+="; "+a,!0!==s[a]&&(i+="="+s[a].split(";")[0]));return document.cookie=t+"="+r.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},o=0;o<t.length;o++){var s=t[o].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(n[a]=r.read(i,a),e===a)break}catch(e){}}return e?n[e]:n}},remove:function(t,r){o(t,"",e({},r,{expires:-1}))},withAttributes:function(r){return t(this.converter,e({},this.attributes,r))},withConverter:function(r){return t(e({},this.converter,r),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(r)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const o=t;function s(e){const t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""}const i=crypto,a=e=>e instanceof CryptoKey,c=new TextEncoder,u=new TextDecoder;const l=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r})(t)}catch(e){throw new TypeError("The input to be decoded is not correctly encoded.")}};class f extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class d extends f{static get code(){return"ERR_JWT_CLAIM_VALIDATION_FAILED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=t,this.reason=r}}class h extends f{static get code(){return"ERR_JWT_EXPIRED"}constructor(e,t="unspecified",r="unspecified"){super(e),this.code="ERR_JWT_EXPIRED",this.claim=t,this.reason=r}}class p extends f{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class m extends f{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class y extends f{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class w extends f{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}class g extends f{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}static get code(){return"ERR_JWKS_INVALID"}}class b extends f{constructor(){super(...arguments),this.code="ERR_JWKS_NO_MATCHING_KEY",this.message="no applicable key found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_NO_MATCHING_KEY"}}class E extends f{constructor(){super(...arguments),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS",this.message="multiple matching keys found in the JSON Web Key Set"}static get code(){return"ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Symbol.asyncIterator;class S extends f{constructor(){super(...arguments),this.code="ERR_JWKS_TIMEOUT",this.message="request timed out"}static get code(){return"ERR_JWKS_TIMEOUT"}}class v extends f{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}i.getRandomValues.bind(i);const A=e=>a(e),R=["CryptoKey"],O=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:o}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new m(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new m('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new m('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),s=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:o];if("PBKDF2"===n.name)return i.subtle.importKey("raw",l(e.k),...s);const a={...e};return delete a.alg,delete a.use,i.subtle.importKey("jwk",a,...s)};function _(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function T(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const C=(e,...t)=>T("Key must be ",e,...t);function k(e,t,...r){return T(`Key for the ${e} algorithm must be `,t,...r)}function P(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function x(e,t){return e.name===t}function j(e){return parseInt(e.name.slice(4),10)}function D(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!x(e.algorithm,"HMAC"))throw P("HMAC");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!x(e.algorithm,"RSASSA-PKCS1-v1_5"))throw P("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!x(e.algorithm,"RSA-PSS"))throw P("RSA-PSS");const r=parseInt(t.slice(2),10);if(j(e.algorithm.hash)!==r)throw P(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw P("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!x(e.algorithm,"ECDSA"))throw P("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw P(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}(e,r)}Symbol();async function N(e,t,r){if(e instanceof Uint8Array&&(e=u.decode(e)),"string"!=typeof e)throw new y("Compact JWS must be a string or Uint8Array");const{0:n,1:o,2:s,length:f}=e.split(".");if(3!==f)throw new y("Invalid Compact JWS");const d=await async function(e,t,r){var n;if(!_(e))throw new y("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new y('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new y("JWS Protected Header incorrect type");if(void 0===e.payload)throw new y("JWS Payload missing");if("string"!=typeof e.signature)throw new y("JWS Signature missing or incorrect type");if(void 0!==e.header&&!_(e.header))throw new y("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const t=l(e.protected);o=JSON.parse(u.decode(t))}catch(e){throw new y("JWS Protected Header is invalid")}if(!((...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0})(o,e.header))throw new y("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const s={...o,...e.header};let f=!0;if(function(e,t,r,n,o){if(void 0!==o.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.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');let s;s=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!s.has(t))throw new m(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}(y,new Map([["b64",!0]]),null==r?void 0:r.crit,o,s).has("b64")&&(f=o.b64,"boolean"!=typeof f))throw new y('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:d}=s;if("string"!=typeof d||!d)throw new y('JWS "alg" (Algorithm) Header Parameter missing or invalid');const h=r&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",r.algorithms);if(h&&!h.has(d))throw new p('"alg" (Algorithm) Header Parameter not allowed');if(f){if("string"!=typeof e.payload)throw new y("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new y("JWS Payload must be a string or an Uint8Array instance");let w=!1;"function"==typeof t&&(t=await t(o,e),w=!0),((e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!A(t))throw new TypeError(k(e,t,...R,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${R.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!A(t))throw new TypeError(k(e,t,...R));if("secret"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${R.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)})(d,t,"verify");const g=function(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}(c.encode(null!==(n=e.protected)&&void 0!==n?n:""),c.encode("."),"string"==typeof e.payload?c.encode(e.payload):e.payload),b=l(e.signature);if(!await(async(e,t,r,n)=>{const o=await function(e,t,r){if(a(t))return D(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(C(t,...R));return i.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(C(t,...R,"Uint8Array"))}(e,t,"verify");((e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}})(e,o);const s=function(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new m(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm);try{return await i.subtle.verify(s,o,r,n)}catch(e){return!1}})(d,t,b,g))throw new v;let E;E=f?l(e.payload):"string"==typeof e.payload?c.encode(e.payload):e.payload;const S={payload:E};return void 0!==e.protected&&(S.protectedHeader=o),void 0!==e.header&&(S.unprotectedHeader=e.header),w?{...S,key:t}:S}({payload:o,protected:n,signature:s},t,r),h={payload:d.payload,protectedHeader:d.protectedHeader};return"function"==typeof t?{...h,key:d.key}:h}const U=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i,I=e=>{const t=U.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(86400*r);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}},K=e=>e.toLowerCase().replace(/^application\//,""),W=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||K(e.typ)!==K(n)))throw new d('unexpected "typ" JWT header value',"typ","check_failed");let o;try{o=JSON.parse(u.decode(t))}catch(e){}if(!_(o))throw new w("JWT Claims Set must be a top-level JSON object");const{requiredClaims:s=[],issuer:i,subject:a,audience:c,maxTokenAge:l}=r;void 0!==l&&s.push("iat"),void 0!==c&&s.push("aud"),void 0!==a&&s.push("sub"),void 0!==i&&s.push("iss");for(const e of new Set(s.reverse()))if(!(e in o))throw new d(`missing required "${e}" claim`,e,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(o.iss))throw new d('unexpected "iss" claim value',"iss","check_failed");if(a&&o.sub!==a)throw new d('unexpected "sub" claim value',"sub","check_failed");if(c&&(p="string"==typeof c?[c]:c,!("string"==typeof(f=o.aud)?p.includes(f):Array.isArray(f)&&p.some(Set.prototype.has.bind(new Set(f))))))throw new d('unexpected "aud" claim value',"aud","check_failed");var f,p;let m;switch(typeof r.clockTolerance){case"string":m=I(r.clockTolerance);break;case"number":m=r.clockTolerance;break;case"undefined":m=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:y}=r,g=(b=y||new Date,Math.floor(b.getTime()/1e3));var b;if((void 0!==o.iat||l)&&"number"!=typeof o.iat)throw new d('"iat" claim must be a number',"iat","invalid");if(void 0!==o.nbf){if("number"!=typeof o.nbf)throw new d('"nbf" claim must be a number',"nbf","invalid");if(o.nbf>g+m)throw new d('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==o.exp){if("number"!=typeof o.exp)throw new d('"exp" claim must be a number',"exp","invalid");if(o.exp<=g-m)throw new h('"exp" claim timestamp check failed',"exp","check_failed")}if(l){const e=g-o.iat;if(e-m>("number"==typeof l?l:I(l)))throw new h('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-m)throw new d('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return o};function L(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(F)}function F(e){return _(e)}class H{constructor(e){if(this._cached=new WeakMap,!L(e))throw new g("JSON Web Key Set malformed");var t;this._jwks=(t=e,"function"==typeof structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)))}async getKey(e,t){const{alg:r,kid:n}={...e,...null==t?void 0:t.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new m('Unsupported "alg" value for a JSON Web Key Set')}}(r),s=this._jwks.keys.filter((e=>{let t=o===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&"string"==typeof e.alg&&(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&&"EdDSA"===r&&(t="Ed25519"===e.crv||"Ed448"===e.crv),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv}return t})),{0:i,length:a}=s;if(0===a)throw new b;if(1!==a){const e=new E,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await J(t,e,r)}catch(e){continue}},e}return J(this._cached,i,r)}}async function J(e,t,r){const n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){const e=await async function(e,t,r){var n;if(!_(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?O({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):l(e.k);case"RSA":if(void 0!==e.oth)throw new m('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return O({...e,alg:t});default:throw new m('Unsupported "kty" (Key Type) Parameter value')}}({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new g("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}class B extends H{constructor(e,t){if(super({keys:[]}),this._jwks=void 0,!(e instanceof URL))throw new TypeError("url must be an instance of URL");this._url=new URL(e.href),this._options={agent:null==t?void 0:t.agent,headers:null==t?void 0:t.headers},this._timeoutDuration="number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3,this._cooldownDuration="number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._jwks&&this.fresh()||await this.reload();try{return await super.getKey(e,t)}catch(r){if(r instanceof b&&!1===this.coolingDown())return await this.reload(),super.getKey(e,t);throw r}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0),this._pendingFetch||(this._pendingFetch=(async(e,t,r)=>{let n,o,s=!1;"function"==typeof AbortController&&(n=new AbortController,o=setTimeout((()=>{s=!0,n.abort()}),t));const i=await fetch(e.href,{signal:n?n.signal:void 0,redirect:"manual",headers:r.headers}).catch((e=>{if(s)throw new S;throw e}));if(void 0!==o&&clearTimeout(o),200!==i.status)throw new f("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch(e){throw new f("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{if(!L(e))throw new g("JSON Web Key Set malformed");this._jwks={keys:e.keys},this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function M(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:z}=Object,V=(q=Object.create(null),e=>{const t=$.call(e);return q[t]||(q[t]=t.slice(8,-1).toLowerCase())});var q;const G=e=>(e=e.toLowerCase(),t=>V(t)===e),X=e=>t=>typeof t===e,{isArray:Y}=Array,Z=X("undefined"),Q=G("ArrayBuffer"),ee=X("string"),te=X("function"),re=X("number"),ne=e=>null!==e&&"object"==typeof e,oe=e=>{if("object"!==V(e))return!1;const t=z(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},se=G("Date"),ie=G("File"),ae=G("Blob"),ce=G("FileList"),ue=G("URLSearchParams");function le(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),Y(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}const fe=(de="undefined"!=typeof Uint8Array&&z(Uint8Array),e=>de&&e instanceof de);var de;const he=G("HTMLFormElement"),pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),me=G("RegExp"),ye=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};le(r,((r,o)=>{!1!==t(r,o,e)&&(n[o]=r)})),Object.defineProperties(e,n)},we={isArray:Y,isArrayBuffer:Q,isBuffer:function(e){return null!==e&&!Z(e)&&null!==e.constructor&&!Z(e.constructor)&&te(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||$.call(e)===t||te(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Q(e.buffer),t},isString:ee,isNumber:re,isBoolean:e=>!0===e||!1===e,isObject:ne,isPlainObject:oe,isUndefined:Z,isDate:se,isFile:ie,isBlob:ae,isRegExp:me,isFunction:te,isStream:e=>ne(e)&&te(e.pipe),isURLSearchParams:ue,isTypedArray:fe,isFileList:ce,forEach:le,merge:function e(){const t={},r=(r,n)=>{oe(t[n])&&oe(r)?t[n]=e(t[n],r):oe(r)?t[n]=e({},r):Y(r)?t[n]=r.slice():t[n]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&le(arguments[e],r);return t},extend:(e,t,r,{allOwnKeys:n}={})=>(le(t,((t,n)=>{r&&te(t)?e[n]=M(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&z(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:V,kindOfTest:G,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(Y(e))return e;let t=e.length;if(!re(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:he,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:ye,freezeMethods:e=>{ye(e,((t,r)=>{const n=e[r];te(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return Y(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t)};function ge(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}we.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const be=ge.prototype,Ee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Ee[e]={value:e}})),Object.defineProperties(ge,Ee),Object.defineProperty(be,"isAxiosError",{value:!0}),ge.from=(e,t,r,n,o,s)=>{const i=Object.create(be);return we.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ge.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const Se=ge,ve=r(230);function Ae(e){return we.isPlainObject(e)||we.isArray(e)}function Re(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,r){return e?e.concat(t).map((function(e,t){return e=Re(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const _e=we.toFlatObject(we,{},null,(function(e){return/^is[A-Z]/.test(e)})),Te=function(e,t,r){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new(ve||FormData);const n=(r=we.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!we.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&(c=t)&&we.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator];var c;if(!we.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(we.isDate(e))return e.toISOString();if(!a&&we.isBlob(e))throw new Se("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(e)||we.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(we.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(we.isArray(e)&&function(e){return we.isArray(e)&&!e.some(Ae)}(e)||we.isFileList(e)||we.endsWith(r,"[]")&&(a=we.toArray(e)))return r=Re(r),a.forEach((function(e,n){!we.isUndefined(e)&&null!==e&&t.append(!0===i?Oe([r],n,s):null===i?r:r+"[]",u(e))})),!1;return!!Ae(e)||(t.append(Oe(o,r,s),u(e)),!1)}const f=[],d=Object.assign(_e,{defaultVisitor:l,convertValue:u,isVisitable:Ae});if(!we.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!we.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),we.forEach(r,(function(r,s){!0===(!(we.isUndefined(r)||null===r)&&o.call(t,r,we.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])})),f.pop()}}(e),t};function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ke(e,t){this._pairs=[],e&&Te(e,this,t)}const Pe=ke.prototype;Pe.append=function(e,t){this._pairs.push([e,t])},Pe.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const xe=ke;function je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(e,t,r){if(!t)return e;const n=r&&r.encode||je,o=r&&r.serialize;let s;if(s=o?o(t,r):we.isURLSearchParams(t)?t.toString():new xe(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ne=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){we.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ie="undefined"!=typeof URLSearchParams?URLSearchParams:xe,Ke=FormData,We=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),Le={isBrowser:!0,classes:{URLSearchParams:Ie,FormData:Ke,Blob},isStandardBrowserEnv:We,protocols:["http","https","file","blob","url","data"]},Fe=function(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&we.isArray(n)?n.length:s,a?(we.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i):(n[s]&&we.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&we.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i)}if(we.isFormData(e)&&we.isFunction(e.entries)){const r={};return we.forEachEntry(e,((e,n)=>{t(function(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},He=Le.isStandardBrowserEnv?{write:function(e,t,r,n,o,s){const i=[];i.push(e+"="+encodeURIComponent(t)),we.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),we.isString(n)&&i.push("path="+n),we.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Je(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=Le.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=we.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Me(e,t,r){Se.call(this,null==e?"canceled":e,Se.ERR_CANCELED,t,r),this.name="CanceledError"}we.inherits(Me,Se,{__CANCEL__:!0});const $e=Me,ze=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ve=Symbol("internals"),qe=Symbol("defaults");function Ge(e){return e&&String(e).trim().toLowerCase()}function Xe(e){return!1===e||null==e?e:we.isArray(e)?e.map(Xe):String(e)}function Ye(e,t,r,n){return we.isFunction(n)?n.call(this,t,r):we.isString(t)?we.isString(n)?-1!==t.indexOf(n):we.isRegExp(n)?n.test(t):void 0:void 0}function Ze(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}function Qe(e,t){e&&this.set(e),this[qe]=t||null}Object.assign(Qe.prototype,{set:function(e,t,r){const n=this;function o(e,t,r){const o=Ge(t);if(!o)throw new Error("header name must be a non-empty string");const s=Ze(n,o);(!s||!0===r||!1!==n[s]&&!1!==r)&&(n[s||t]=Xe(e))}return we.isPlainObject(e)?we.forEach(e,((e,r)=>{o(e,r,t)})):o(t,e,r),this},get:function(e,t){if(!(e=Ge(e)))return;const r=Ze(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(we.isFunction(t))return t.call(this,e,r);if(we.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,t){if(e=Ge(e)){const r=Ze(this,e);return!(!r||t&&!Ye(0,this[r],r,t))}return!1},delete:function(e,t){const r=this;let n=!1;function o(e){if(e=Ge(e)){const o=Ze(r,e);!o||t&&!Ye(0,r[o],o,t)||(delete r[o],n=!0)}}return we.isArray(e)?e.forEach(o):o(e),n},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const t=this,r={};return we.forEach(this,((n,o)=>{const s=Ze(r,o);if(s)return t[s]=Xe(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Xe(n),r[i]=!0})),this},toJSON:function(e){const t=Object.create(null);return we.forEach(Object.assign({},this[qe]||null,this),((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&we.isArray(r)?r.join(", "):r)})),t}}),Object.assign(Qe,{from:function(e){return we.isString(e)?new this((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&ze[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e)):e instanceof this?e:new this(e)},accessor:function(e){const t=(this[Ve]=this[Ve]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ge(e);t[n]||(function(e,t){const r=we.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return we.isArray(e)?e.forEach(n):n(e),this}}),Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),we.freezeMethods(Qe.prototype),we.freezeMethods(Qe);const et=Qe,tt=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];o||(o=c),r[s]=a,n[s]=c;let l=i,f=0;for(;l!==s;)f+=r[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}};function rt(e,t){let r=0;const n=tt(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,c=n(a);r=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0};u[t?"download":"upload"]=!0,e(u)}}function nt(e){return new Promise((function(t,r){let n=e.data;const o=et.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}we.isFormData(n)&&Le.isStandardBrowserEnv&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=Je(e.baseURL,e.url);function l(){if(!c)return;const n=et.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Se("Request failed with status code "+r.status,[Se.ERR_BAD_REQUEST,Se.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),a()}),(function(e){r(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),De(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(r(new Se("Request aborted",Se.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new Se("Network Error",Se.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Ue;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new Se(t,n.clarifyTimeoutError?Se.ETIMEDOUT:Se.ECONNABORTED,e,c)),c=null},Le.isStandardBrowserEnv){const t=(e.withCredentials||Be(u))&&e.xsrfCookieName&&He.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in c&&we.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),we.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",rt(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",rt(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(r(!t||t.type?new $e(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);f&&-1===Le.protocols.indexOf(f)?r(new Se("Unsupported protocol "+f+":",Se.ERR_BAD_REQUEST,e)):c.send(n||null)}))}const ot={http:nt,xhr:nt},st=e=>{if(we.isString(e)){const t=ot[e];if(!e)throw Error(we.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return t}if(!we.isFunction(e))throw new TypeError("adapter is not a function");return e},it={"Content-Type":"application/x-www-form-urlencoded"},at={transitional:Ue,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=st("xhr"):"undefined"!=typeof process&&"process"===we.kindOf(process)&&(e=st("http")),e}(),transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=we.isObject(e);if(o&&we.isHTMLForm(e)&&(e=new FormData(e)),we.isFormData(e))return n&&n?JSON.stringify(Fe(e)):e;if(we.isArrayBuffer(e)||we.isBuffer(e)||we.isStream(e)||we.isFile(e)||we.isBlob(e))return e;if(we.isArrayBufferView(e))return e.buffer;if(we.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Te(e,new Le.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Le.isNode&&we.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=we.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(we.isString(e))try{return(0,JSON.parse)(e),we.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||at.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&we.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw Se.from(e,Se.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Le.classes.FormData,Blob:Le.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],(function(e){at.headers[e]={}})),we.forEach(["post","put","patch"],(function(e){at.headers[e]=we.merge(it)}));const ct=at;function ut(e,t){const r=this||ct,n=t||r,o=et.from(n.headers);let s=n.data;return we.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function lt(e){return!(!e||!e.__CANCEL__)}function ft(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $e}function dt(e){return ft(e),e.headers=et.from(e.headers),e.data=ut.call(e,e.transformRequest),(e.adapter||ct.adapter)(e).then((function(t){return ft(e),t.data=ut.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t}),(function(t){return lt(t)||(ft(e),t&&t.response&&(t.response.data=ut.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)}))}function ht(e,t){t=t||{};const r={};function n(e,t){return we.isPlainObject(e)&&we.isPlainObject(t)?we.merge(e,t):we.isPlainObject(t)?we.merge({},t):we.isArray(t)?t.slice():t}function o(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function s(e){if(!we.isUndefined(t[e]))return n(void 0,t[e])}function i(r){return we.isUndefined(t[r])?we.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function a(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a};return we.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){const t=c[e]||o,n=t(e);we.isUndefined(n)&&t!==a||(r[e]=n)})),r}const pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{pt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const mt={};pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.1.3] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new Se(n(o," has been removed"+(t?" in "+t:"")),Se.ERR_DEPRECATED);return t&&!mt[o]&&(mt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};const yt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Se("options must be an object",Se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new Se("option "+s+" must be "+r,Se.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new Se("Unknown option "+s,Se.ERR_BAD_OPTION)}},validators:pt},wt=yt.validators;class gt{constructor(e){this.defaults=e,this.interceptors={request:new Ne,response:new Ne}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ht(this.defaults,t);const{transitional:r,paramsSerializer:n}=t;void 0!==r&&yt.assertOptions(r,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),void 0!==n&&yt.assertOptions(n,{encode:wt.function,serialize:wt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();const o=t.headers&&we.merge(t.headers.common,t.headers[t.method]);o&&we.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),t.headers=new et(t.headers,o);const s=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const a=[];let c;this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)}));let u,l=0;if(!i){const e=[dt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,a),u=e.length,c=Promise.resolve(t);l<u;)c=c.then(e[l++],e[l++]);return c}u=s.length;let f=t;for(l=0;l<u;){const e=s[l++],t=s[l++];try{f=e(f)}catch(e){t.call(this,e);break}}try{c=dt.call(this,f)}catch(e){return Promise.reject(e)}for(l=0,u=a.length;l<u;)c=c.then(a[l++],a[l++]);return c}getUri(e){return De(Je((e=ht(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}we.forEach(["delete","get","head","options"],(function(e){gt.prototype[e]=function(t,r){return this.request(ht(r||{},{method:e,url:t,data:(r||{}).data}))}})),we.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(ht(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}gt.prototype[e]=t(),gt.prototype[e+"Form"]=t(!0)}));const bt=gt;class Et{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new $e(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Et((function(t){e=t})),cancel:e}}}const St=Et,vt=function e(t){const r=new bt(t),n=M(bt.prototype.request,r);return we.extend(n,bt.prototype,r,{allOwnKeys:!0}),we.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(ht(t,r))},n}(ct);vt.Axios=bt,vt.CanceledError=$e,vt.CancelToken=St,vt.isCancel=lt,vt.VERSION="1.1.3",vt.toFormData=Te,vt.AxiosError=Se,vt.Cancel=vt.CanceledError,vt.all=function(e){return Promise.all(e)},vt.spread=function(e){return function(t){return e.apply(null,t)}},vt.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},vt.formToJSON=e=>Fe(we.isHTMLForm(e)?new FormData(e):e);const At=vt,{Axios:Rt,AxiosError:Ot,CanceledError:_t,isCancel:Tt,CancelToken:Ct,VERSION:kt,all:Pt,Cancel:xt,isAxiosError:jt,spread:Dt,toFormData:Nt}=At,Ut=At,It=new function(){let e=Ut.create();this.configure=t=>{e=t(e)},this.get=()=>e};class Kt{constructor(e,t,r,n,o){this.userID=e,this.userIdentifier=t,this.userFullName=r,this.email=n,this.phoneNumber=o}}class Wt{#e=null;error;#t;#r=null;#n=null;#o;constructor(e,t){this.#t=e,It.configure((r=>(r.defaults.baseURL=e,r.defaults.timeout=6e4,r.defaults.withCredentials=!0,""!==t&&(r.defaults.headers.common["X-Corbado-ProjectID"]=t),r.defaults.headers.common["X-Corbado-Client-Timezone"]=Intl.DateTimeFormat().resolvedOptions().timeZone,r)))}#s=async e=>{const t=function(e,t){const r=new B(e,void 0);return async function(e,t){return r.getKey(e,t)}}(new URL(this.#t+"/.well-known/jwks")),{payload:r,protectedHeader:n}=await async function(e,t,r){var n;const o=await N(e,t,r);if((null===(n=o.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===o.protectedHeader.b64)throw new w("JWTs MUST NOT use unencoded payload");const s={payload:W(o.protectedHeader,o.payload,r),protectedHeader:o.protectedHeader};return"function"==typeof t?{...s,key:o.key}:s}(e,t,{});return{protectedHeader:n,payload:r}};#i=()=>It.get().put("/v1/sessions/refresh").then((e=>(function(e){var t;e.shortSession&&(t=e.shortSession,o.set(t.key,t.value,{path:t.path,expires:new Date(t.expires),secure:t.secure,sameSite:t.sameSite,domain:t.domain}))}(e.data),e.data))).catch((e=>{if("AxiosError"!==e.name)throw e;return"ERR_NETWORK"===e.code?(this.error="Network error - please check cors settings",void this.#a()):e.response&&401===e.response.status?(this.#e=null,void this.#o(this.#e)):void 0}));#a=()=>{null===this.#n&&(this.#n=setInterval((()=>{this.#i().then((()=>{clearInterval(this.#n)}))}),1e5))};#c=()=>{this.#i().then((e=>{null!==e&&this.#u()}))};#u=()=>{this.#s(s("cbo_short_session")).then((e=>{const t=Math.floor(e.payload.exp-(new Date).getTime()/1e3);console.log("jwt expires in "+t+" sec"),this.#e=new Kt(e.payload.sub,e.payload.Orig,e.payload.Name,e.payload.email??"",e.payload.phone_number??""),this.#o(this.#e),t<=10?this.#c():this.#r=setTimeout(this.#c,1e3*(t-10))}))};#l=()=>""!==s("cbo_short_session");initialize(e){this.#o=e;let t=!1;this.#l()&&(t=!0,this.#u()),setInterval((()=>{const e=this.#l();if(e&&null===this.#r){if(t)return void(t=!1);this.#u()}else e||null===this.#r||(clearTimeout(this.#r),this.#r=null)}),200)}get currentUser(){return this.#e}isAuthed(){return null!==this.#e}logout(){It.get().delete("/v1/sessions/logout").catch((e=>{console.error(e)}))}}class Lt extends Wt{}})();var o=n.Z;export{o as default}; | ||
//# sourceMappingURL=session.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1694656
1228
2
2
+ Addedjose@^4.14.4
+ Addedjose@4.15.9(transitive)