@sesamy/sesamy-js 1.22.2 → 1.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- "use strict";var bh=Object.defineProperty;var Sh=(e,t,r)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var de=(e,t,r)=>Sh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ee=function(e){try{return!!e()}catch{return!0}},$h=ee,Fn=!$h(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),bl=Fn,Sl=Function.prototype,Ti=Sl.call,Ih=bl&&Sl.bind.bind(Ti,Ti),H=bl?Ih:function(e){return function(){return Ti.apply(e,arguments)}},$l=H,Th=$l({}.toString),Ph=$l("".slice),Bn=function(e){return Ph(Th(e),8,-1)},Eh=H,Oh=ee,kh=Bn,ua=Object,_h=Eh("".split),Il=Oh(function(){return!ua("z").propertyIsEnumerable(0)})?function(e){return kh(e)==="String"?_h(e,""):ua(e)}:ua,zn=function(e){return e==null},Rh=zn,Ch=TypeError,Hn=function(e){if(Rh(e))throw new Ch("Can't call method on "+e);return e},Ah=Il,jh=Hn,_r=function(e){return Ah(jh(e))},tr=function(e){return e&&e.Math===Math&&e},G=tr(typeof globalThis=="object"&&globalThis)||tr(typeof window=="object"&&window)||tr(typeof self=="object"&&self)||tr(typeof Mr=="object"&&Mr)||tr(typeof Mr=="object"&&Mr)||function(){return this}()||Function("return this")(),Tl={exports:{}},Lh=!1,ss=G,Uh=Object.defineProperty,co=function(e,t){try{Uh(ss,e,{value:t,configurable:!0,writable:!0})}catch{ss[e]=t}return t},Nh=G,xh=co,cs="__core-js_shared__",us=Tl.exports=Nh[cs]||xh(cs,{});(us.versions||(us.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var uo=Tl.exports,ls=uo,Pl=function(e,t){return ls[e]||(ls[e]=t||{})},Dh=Hn,Mh=Object,Gn=function(e){return Mh(Dh(e))},Fh=H,Bh=Gn,zh=Fh({}.hasOwnProperty),ye=Object.hasOwn||function(t,r){return zh(Bh(t),r)},Hh=H,Gh=0,Kh=Math.random(),Wh=Hh(1 .toString),El=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Wh(++Gh+Kh,36)},Vh=G,fs=Vh.navigator,ds=fs&&fs.userAgent,Rr=ds?String(ds):"",Ol=G,la=Rr,hs=Ol.process,vs=Ol.Deno,ps=hs&&hs.versions||vs&&vs.version,ms=ps&&ps.v8,Pe,In;ms&&(Pe=ms.split("."),In=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1]));!In&&la&&(Pe=la.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=la.match(/Chrome\/(\d+)/),Pe&&(In=+Pe[1])));var kl=In,gs=kl,Zh=ee,Jh=G,Yh=Jh.String,_l=!!Object.getOwnPropertySymbols&&!Zh(function(){var e=Symbol("symbol detection");return!Yh(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&gs&&gs<41}),Xh=_l,Rl=Xh&&!Symbol.sham&&typeof Symbol.iterator=="symbol",qh=G,Qh=Pl,ys=ye,ev=El,tv=_l,rv=Rl,_t=qh.Symbol,fa=Qh("wks"),nv=rv?_t.for||_t:_t&&_t.withoutSetter||ev,te=function(e){return ys(fa,e)||(fa[e]=tv&&ys(_t,e)?_t[e]:nv("Symbol."+e)),fa[e]},da=typeof document=="object"&&document.all,Z=typeof da>"u"&&da!==void 0?function(e){return typeof e=="function"||e===da}:function(e){return typeof e=="function"},av=Z,we=function(e){return typeof e=="object"?e!==null:av(e)},iv=we,ov=String,sv=TypeError,_e=function(e){if(iv(e))return e;throw new sv(ov(e)+" is not an object")},Cl={},cv=ee,re=!cv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uv=re,lv=ee,Al=uv&&lv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Le={},fv=G,ws=we,Pi=fv.document,dv=ws(Pi)&&ws(Pi.createElement),Kn=function(e){return dv?Pi.createElement(e):{}},hv=re,vv=ee,pv=Kn,jl=!hv&&!vv(function(){return Object.defineProperty(pv("div"),"a",{get:function(){return 7}}).a!==7}),mv=Fn,Fr=Function.prototype.call,ne=mv?Fr.bind(Fr):function(){return Fr.apply(Fr,arguments)},ha=G,gv=Z,yv=function(e){return gv(e)?e:void 0},be=function(e,t){return arguments.length<2?yv(ha[e]):ha[e]&&ha[e][t]},wv=H,Wn=wv({}.isPrototypeOf),bv=be,Sv=Z,$v=Wn,Iv=Rl,Tv=Object,Ll=Iv?function(e){return typeof e=="symbol"}:function(e){var t=bv("Symbol");return Sv(t)&&$v(t.prototype,Tv(e))},Pv=String,Vn=function(e){try{return Pv(e)}catch{return"Object"}},Ev=Z,Ov=Vn,kv=TypeError,Re=function(e){if(Ev(e))return e;throw new kv(Ov(e)+" is not a function")},_v=Re,Rv=zn,lo=function(e,t){var r=e[t];return Rv(r)?void 0:_v(r)},va=ne,pa=Z,ma=we,Cv=TypeError,Av=function(e,t){var r,n;if(t==="string"&&pa(r=e.toString)&&!ma(n=va(r,e))||pa(r=e.valueOf)&&!ma(n=va(r,e))||t!=="string"&&pa(r=e.toString)&&!ma(n=va(r,e)))return n;throw new Cv("Can't convert object to primitive value")},jv=ne,bs=we,Ss=Ll,Lv=lo,Uv=Av,Nv=te,xv=TypeError,Dv=Nv("toPrimitive"),Mv=function(e,t){if(!bs(e)||Ss(e))return e;var r=Lv(e,Dv),n;if(r){if(t===void 0&&(t="default"),n=jv(r,e,t),!bs(n)||Ss(n))return n;throw new xv("Can't convert object to primitive value")}return t===void 0&&(t="number"),Uv(e,t)},Fv=Mv,Bv=Ll,Ul=function(e){var t=Fv(e,"string");return Bv(t)?t:t+""},zv=re,Hv=jl,Gv=Al,Br=_e,$s=Ul,Kv=TypeError,ga=Object.defineProperty,Wv=Object.getOwnPropertyDescriptor,ya="enumerable",wa="configurable",ba="writable";Le.f=zv?Gv?function(t,r,n){if(Br(t),r=$s(r),Br(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ba in n&&!n[ba]){var a=Wv(t,r);a&&a[ba]&&(t[r]=n.value,n={configurable:wa in n?n[wa]:a[wa],enumerable:ya in n?n[ya]:a[ya],writable:!1})}return ga(t,r,n)}:ga:function(t,r,n){if(Br(t),r=$s(r),Br(n),Hv)try{return ga(t,r,n)}catch{}if("get"in n||"set"in n)throw new Kv("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Vv=Math.ceil,Zv=Math.floor,Jv=Math.trunc||function(t){var r=+t;return(r>0?Zv:Vv)(r)},Yv=Jv,fo=function(e){var t=+e;return t!==t||t===0?0:Yv(t)},Xv=fo,qv=Math.max,Qv=Math.min,Nl=function(e,t){var r=Xv(e);return r<0?qv(r+t,0):Qv(r,t)},ep=fo,tp=Math.min,rp=function(e){var t=ep(e);return t>0?tp(t,9007199254740991):0},np=rp,ho=function(e){return np(e.length)},ap=_r,ip=Nl,op=ho,Is=function(e){return function(t,r,n){var a=ap(t),i=op(a);if(i===0)return!e&&-1;var o=ip(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},sp={includes:Is(!0),indexOf:Is(!1)},vo={},cp=H,Sa=ye,up=_r,lp=sp.indexOf,fp=vo,Ts=cp([].push),xl=function(e,t){var r=up(e),n=0,a=[],i;for(i in r)!Sa(fp,i)&&Sa(r,i)&&Ts(a,i);for(;t.length>n;)Sa(r,i=t[n++])&&(~lp(a,i)||Ts(a,i));return a},po=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dp=xl,hp=po,Dl=Object.keys||function(t){return dp(t,hp)},vp=re,pp=Al,mp=Le,gp=_e,yp=_r,wp=Dl;Cl.f=vp&&!pp?Object.defineProperties:function(t,r){gp(t);for(var n=yp(r),a=wp(r),i=a.length,o=0,s;i>o;)mp.f(t,s=a[o++],n[s]);return t};var bp=be,Ml=bp("document","documentElement"),Sp=Pl,$p=El,Ps=Sp("keys"),mo=function(e){return Ps[e]||(Ps[e]=$p(e))},Ip=_e,Tp=Cl,Es=po,Pp=vo,Ep=Ml,Op=Kn,kp=mo,Os=">",ks="<",Ei="prototype",Oi="script",Fl=kp("IE_PROTO"),$a=function(){},Bl=function(e){return ks+Oi+Os+e+ks+"/"+Oi+Os},_s=function(e){e.write(Bl("")),e.close();var t=e.parentWindow.Object;return e=null,t},_p=function(){var e=Op("iframe"),t="java"+Oi+":",r;return e.style.display="none",Ep.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Bl("document.F=Object")),r.close(),r.F},zr,vn=function(){try{zr=new ActiveXObject("htmlfile")}catch{}vn=typeof document<"u"?document.domain&&zr?_s(zr):_p():_s(zr);for(var e=Es.length;e--;)delete vn[Ei][Es[e]];return vn()};Pp[Fl]=!0;var Zn=Object.create||function(t,r){var n;return t!==null?($a[Ei]=Ip(t),n=new $a,$a[Ei]=null,n[Fl]=t):n=vn(),r===void 0?n:Tp.f(n,r)},Rp=te,Cp=Zn,Ap=Le.f,ki=Rp("unscopables"),_i=Array.prototype;_i[ki]===void 0&&Ap(_i,ki,{configurable:!0,value:Cp(null)});var jp=function(e){_i[ki][e]=!0},Cr={},Lp=G,Up=Z,Rs=Lp.WeakMap,Np=Up(Rs)&&/native code/.test(String(Rs)),pt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},xp=re,Dp=Le,Mp=pt,mt=xp?function(e,t,r){return Dp.f(e,t,Mp(1,r))}:function(e,t,r){return e[t]=r,e},Fp=Np,zl=G,Bp=we,zp=mt,Ia=ye,Ta=uo,Hp=mo,Gp=vo,Cs="Object already initialized",Ri=zl.TypeError,Kp=zl.WeakMap,Tn,Pr,Pn,Wp=function(e){return Pn(e)?Pr(e):Tn(e,{})},Vp=function(e){return function(t){var r;if(!Bp(t)||(r=Pr(t)).type!==e)throw new Ri("Incompatible receiver, "+e+" required");return r}};if(Fp||Ta.state){var Ce=Ta.state||(Ta.state=new Kp);Ce.get=Ce.get,Ce.has=Ce.has,Ce.set=Ce.set,Tn=function(e,t){if(Ce.has(e))throw new Ri(Cs);return t.facade=e,Ce.set(e,t),t},Pr=function(e){return Ce.get(e)||{}},Pn=function(e){return Ce.has(e)}}else{var wt=Hp("state");Gp[wt]=!0,Tn=function(e,t){if(Ia(e,wt))throw new Ri(Cs);return t.facade=e,zp(e,wt,t),t},Pr=function(e){return Ia(e,wt)?e[wt]:{}},Pn=function(e){return Ia(e,wt)}}var Zt={set:Tn,get:Pr,has:Pn,enforce:Wp,getterFor:Vp},go={},yo={},Hl={}.propertyIsEnumerable,Gl=Object.getOwnPropertyDescriptor,Zp=Gl&&!Hl.call({1:2},1);yo.f=Zp?function(t){var r=Gl(this,t);return!!r&&r.enumerable}:Hl;var Jp=re,Yp=ne,Xp=yo,qp=pt,Qp=_r,em=Ul,tm=ye,rm=jl,As=Object.getOwnPropertyDescriptor;go.f=Jp?As:function(t,r){if(t=Qp(t),r=em(r),rm)try{return As(t,r)}catch{}if(tm(t,r))return qp(!Yp(Xp.f,t,r),t[r])};var Kl={exports:{}},Ci=re,nm=ye,Wl=Function.prototype,am=Ci&&Object.getOwnPropertyDescriptor,wo=nm(Wl,"name"),im=wo&&(function(){}).name==="something",om=wo&&(!Ci||Ci&&am(Wl,"name").configurable),Vl={EXISTS:wo,PROPER:im,CONFIGURABLE:om},sm=H,cm=Z,Ai=uo,um=sm(Function.toString);cm(Ai.inspectSource)||(Ai.inspectSource=function(e){return um(e)});var bo=Ai.inspectSource,So=H,lm=ee,fm=Z,Hr=ye,ji=re,dm=Vl.CONFIGURABLE,hm=bo,Zl=Zt,vm=Zl.enforce,pm=Zl.get,js=String,pn=Object.defineProperty,mm=So("".slice),gm=So("".replace),ym=So([].join),wm=ji&&!lm(function(){return pn(function(){},"length",{value:8}).length!==8}),bm=String(String).split("String"),Sm=Kl.exports=function(e,t,r){mm(js(t),0,7)==="Symbol("&&(t="["+gm(js(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Hr(e,"name")||dm&&e.name!==t)&&(ji?pn(e,"name",{value:t,configurable:!0}):e.name=t),wm&&r&&Hr(r,"arity")&&e.length!==r.arity&&pn(e,"length",{value:r.arity});try{r&&Hr(r,"constructor")&&r.constructor?ji&&pn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=vm(e);return Hr(n,"source")||(n.source=ym(bm,typeof t=="string"?t:"")),e};Function.prototype.toString=Sm(function(){return fm(this)&&pm(this).source||hm(this)},"toString");var Jl=Kl.exports,$m=Z,Im=Le,Tm=Jl,Pm=co,Se=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if($m(r)&&Tm(r,i,n),n.global)a?e[t]=r:Pm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Im.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Yl={},Em=xl,Om=po,km=Om.concat("length","prototype");Yl.f=Object.getOwnPropertyNames||function(t){return Em(t,km)};var $o={};$o.f=Object.getOwnPropertySymbols;var _m=be,Rm=H,Cm=Yl,Am=$o,jm=_e,Lm=Rm([].concat),Um=_m("Reflect","ownKeys")||function(t){var r=Cm.f(jm(t)),n=Am.f;return n?Lm(r,n(t)):r},Ls=ye,Nm=Um,xm=go,Dm=Le,Xl=function(e,t,r){for(var n=Nm(t),a=Dm.f,i=xm.f,o=0;o<n.length;o++){var s=n[o];!Ls(e,s)&&!(r&&Ls(r,s))&&a(e,s,i(t,s))}},Mm=ee,Fm=Z,Bm=/#|\.prototype\./,Ar=function(e,t){var r=Hm[zm(e)];return r===Km?!0:r===Gm?!1:Fm(t)?Mm(t):!!t},zm=Ar.normalize=function(e){return String(e).replace(Bm,".").toLowerCase()},Hm=Ar.data={},Gm=Ar.NATIVE="N",Km=Ar.POLYFILL="P",ql=Ar,Gr=G,Wm=go.f,Vm=mt,Zm=Se,Jm=co,Ym=Xl,Xm=ql,X=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Gr:a?o=Gr[r]||Jm(r,{}):o=Gr[r]&&Gr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Wm(o,s),u=l&&l.value):u=o[s],i=Xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Ym(f,u)}(e.sham||u&&u.sham)&&Vm(f,"sham",!0),Zm(o,s,f,e)}},qm=ee,Qm=!qm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),eg=ye,tg=Z,rg=Gn,ng=mo,ag=Qm,Us=ng("IE_PROTO"),Li=Object,ig=Li.prototype,Io=ag?Li.getPrototypeOf:function(e){var t=rg(e);if(eg(t,Us))return t[Us];var r=t.constructor;return tg(r)&&t instanceof r?r.prototype:t instanceof Li?ig:null},og=ee,sg=Z,cg=we,Ns=Io,ug=Se,lg=te,Ui=lg("iterator"),Ql=!1,ft,Pa,Ea;[].keys&&(Ea=[].keys(),"next"in Ea?(Pa=Ns(Ns(Ea)),Pa!==Object.prototype&&(ft=Pa)):Ql=!0);var fg=!cg(ft)||og(function(){var e={};return ft[Ui].call(e)!==e});fg&&(ft={});sg(ft[Ui])||ug(ft,Ui,function(){return this});var ef={IteratorPrototype:ft,BUGGY_SAFARI_ITERATORS:Ql},dg=Le.f,hg=ye,vg=te,xs=vg("toStringTag"),Jt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hg(e,xs)&&dg(e,xs,{configurable:!0,value:t})},pg=ef.IteratorPrototype,mg=Zn,gg=pt,yg=Jt,wg=Cr,bg=function(){return this},tf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=mg(pg,{next:gg(+!n,r)}),yg(e,a,!1),wg[a]=bg,e},Sg=H,$g=Re,Ig=function(e,t,r){try{return Sg($g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Tg=we,Pg=function(e){return Tg(e)||e===null},Eg=Pg,Og=String,kg=TypeError,_g=function(e){if(Eg(e))return e;throw new kg("Can't set "+Og(e)+" as a prototype")},Rg=Ig,Cg=we,Ag=Hn,jg=_g,To=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Rg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Ag(a),jg(i),Cg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Lg=X,Ug=ne,rf=Vl,Ng=Z,xg=tf,Ds=Io,Ms=To,Dg=Jt,Mg=mt,Oa=Se,Fg=te,Bg=Cr,nf=ef,zg=rf.PROPER,Hg=rf.CONFIGURABLE,Fs=nf.IteratorPrototype,Kr=nf.BUGGY_SAFARI_ITERATORS,rr=Fg("iterator"),Bs="keys",nr="values",zs="entries",Gg=function(){return this},af=function(e,t,r,n,a,i,o){xg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Kr&&T&&T in l)return l[T];switch(T){case Bs:return function(){return new r(this,T)};case nr:return function(){return new r(this,T)};case zs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[rr]||l["@@iterator"]||a&&l[a],d=!Kr&&c||s(a),h=t==="Array"&&l.entries||c,v,S,g;if(h&&(v=Ds(h.call(new e)),v!==Object.prototype&&v.next&&(Ds(v)!==Fs&&(Ms?Ms(v,Fs):Ng(v[rr])||Oa(v,rr,Gg)),Dg(v,u,!0))),zg&&a===nr&&c&&c.name!==nr&&(Hg?Mg(l,"name",nr):(f=!0,d=function(){return Ug(c,this)})),a)if(S={values:s(nr),keys:i?d:s(Bs),entries:s(zs)},o)for(g in S)(Kr||f||!(g in l))&&Oa(l,g,S[g]);else Lg({target:t,proto:!0,forced:Kr||f},S);return l[rr]!==d&&Oa(l,rr,d,{name:a}),Bg[t]=d,S},Po=function(e,t){return{value:e,done:t}},Kg=_r,Eo=jp,Hs=Cr,of=Zt,Wg=Le.f,Vg=af,Wr=Po,Zg=re,sf="Array Iterator",Jg=of.set,Yg=of.getterFor(sf),Xg=Vg(Array,"Array",function(e,t){Jg(this,{type:sf,target:Kg(e),index:0,kind:t})},function(){var e=Yg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Wr(void 0,!0);switch(e.kind){case"keys":return Wr(r,!1);case"values":return Wr(t[r],!1)}return Wr([r,t[r]],!1)},"values"),Gs=Hs.Arguments=Hs.Array;Eo("keys");Eo("values");Eo("entries");if(Zg&&Gs.name!=="values")try{Wg(Gs,"name",{value:"values"})}catch{}var qg=X,Qg=H,ey=Nl,ty=RangeError,Ks=String.fromCharCode,Ws=String.fromCodePoint,ry=Qg([].join),ny=!!Ws&&Ws.length!==1;qg({target:"String",stat:!0,arity:1,forced:ny},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],ey(i,1114111)!==i)throw new ty(i+" is not a valid code point");r[a]=i<65536?Ks(i):Ks(((i-=65536)>>10)+55296,i%1024+56320)}return ry(r,"")}});var Vs=G,ay=re,iy=Object.getOwnPropertyDescriptor,cf=function(e){if(!ay)return Vs[e];var t=iy(Vs,e);return t&&t.value},oy=ee,sy=te,cy=re,Zs=Lh,uy=sy("iterator"),Jn=!oy(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Zs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Zs||!cy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[uy]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Js=Jl,ly=Le,Yn=function(e,t,r){return r.get&&Js(r.get,t,{getter:!0}),r.set&&Js(r.set,t,{setter:!0}),ly.f(e,t,r)},fy=Se,dy=function(e,t,r){for(var n in t)fy(e,n,t[n],r);return e},hy=Wn,vy=TypeError,Oo=function(e,t){if(hy(t,e))return e;throw new vy("Incorrect invocation")},py=Bn,my=H,gy=function(e){if(py(e)==="Function")return my(e)},Ys=gy,yy=Re,wy=Fn,by=Ys(Ys.bind),Yt=function(e,t){return yy(e),t===void 0?e:wy?by(e,t):function(){return e.apply(t,arguments)}},Sy=te,$y=Sy("toStringTag"),uf={};uf[$y]="z";var ko=String(uf)==="[object z]",Iy=ko,Ty=Z,mn=Bn,Py=te,Ey=Py("toStringTag"),Oy=Object,ky=mn(function(){return arguments}())==="Arguments",_y=function(e,t){try{return e[t]}catch{}},jr=Iy?mn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=_y(t=Oy(e),Ey))=="string"?r:ky?mn(t):(n=mn(t))==="Object"&&Ty(t.callee)?"Arguments":n},Ry=jr,Cy=String,He=function(e){if(Ry(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Cy(e)},Ay=jr,Xs=lo,jy=zn,Ly=Cr,Uy=te,Ny=Uy("iterator"),Xn=function(e){if(!jy(e))return Xs(e,Ny)||Xs(e,"@@iterator")||Ly[Ay(e)]},xy=ne,Dy=Re,My=_e,Fy=Vn,By=Xn,zy=TypeError,_o=function(e,t){var r=arguments.length<2?By(e):t;if(Dy(r))return My(xy(r,e));throw new zy(Fy(e)+" is not iterable")},Hy=TypeError,gt=function(e,t){if(e<t)throw new Hy("Not enough arguments");return e},Gy=H,qn=Gy([].slice),qs=qn,Ky=Math.floor,Ni=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Ky(r/2),s=Ni(qs(e,0,o),t),u=Ni(qs(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Wy=Ni,xi=X,lf=G,Ro=cf,Vy=be,Vr=ne,Oe=H,pr=re,ff=Jn,df=Se,Zy=Yn,Jy=dy,Yy=Jt,Xy=tf,Co=Zt,hf=Oo,ka=Z,qy=ye,Qy=Yt,ew=jr,tw=_e,vf=we,ie=He,rw=Zn,Qs=pt,ec=_o,nw=Xn,Zr=Po,bt=gt,aw=te,iw=Wy,ow=aw("iterator"),Xt="URLSearchParams",pf=Xt+"Iterator",mf=Co.set,me=Co.getterFor(Xt),sw=Co.getterFor(pf),tc=Ro("fetch"),En=Ro("Request"),mr=Ro("Headers"),_a=En&&En.prototype,rc=mr&&mr.prototype,cw=lf.TypeError,uw=lf.encodeURIComponent,lw=String.fromCharCode,fw=Vy("String","fromCodePoint"),dw=parseInt,gn=Oe("".charAt),nc=Oe([].join),Ve=Oe([].push),gf=Oe("".replace),hw=Oe([].shift),ac=Oe([].splice),ic=Oe("".split),yf=Oe("".slice),vw=Oe(/./.exec),pw=/\+/g,Ra="�",mw=/^[0-9a-f]+$/i,oc=function(e,t){var r=yf(e,t,t+2);return vw(mw,r)?dw(r,16):NaN},gw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},yw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},sc=function(e){e=gf(e,pw," ");for(var t=e.length,r="",n=0;n<t;){var a=gn(e,n);if(a==="%"){if(gn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=oc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=gw(i);if(o===0)a=lw(i);else{if(o===1||o>4){r+=Ra,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||gn(e,n)!=="%"));){var f=oc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Ve(s,f),n+=2,u++}if(s.length!==o){r+=Ra;continue}var l=yw(s);l===null?r+=Ra:a=fw(l)}}r+=a,n++}return r},ww=/[!'()~]|%20/g,bw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Sw=function(e){return bw[e]},cc=function(e){return gf(uw(e),ww,Sw)},Ca=Xy(function(t,r){mf(this,{type:pf,target:me(t).entries,index:0,kind:r})},Xt,function(){var t=sw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Zr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Zr(a.key,!1);case"values":return Zr(a.value,!1)}return Zr([a.key,a.value],!1)},!0),wf=function(e){this.entries=[],this.url=null,e!==void 0&&(vf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?gn(e,0)==="?"?yf(e,1):e:ie(e)))};wf.prototype={type:Xt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=nw(e),n,a,i,o,s,u,f;if(r)for(n=ec(e,r),a=n.next;!(i=Vr(a,n)).done;){if(o=ec(tw(i.value)),s=o.next,(u=Vr(s,o)).done||(f=Vr(s,o)).done||!Vr(s,o).done)throw new cw("Expected sequence with length 2");Ve(t,{key:ie(u.value),value:ie(f.value)})}else for(var l in e)qy(e,l)&&Ve(t,{key:l,value:ie(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=ic(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=ic(a,"="),Ve(t,{key:sc(hw(i)),value:sc(nc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ve(t,cc(n.key)+"="+cc(n.value));return nc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Qn=function(){hf(this,Dt);var t=arguments.length>0?arguments[0]:void 0,r=mf(this,new wf(t));pr||(this.size=r.entries.length)},Dt=Qn.prototype;Jy(Dt,{append:function(t,r){var n=me(this);bt(arguments.length,2),Ve(n.entries,{key:ie(t),value:ie(r)}),pr||this.length++,n.updateURL()},delete:function(e){for(var t=me(this),r=bt(arguments.length,1),n=t.entries,a=ie(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(ac(n,s,1),o!==void 0)break}else s++}pr||(this.size=n.length),t.updateURL()},get:function(t){var r=me(this).entries;bt(arguments.length,1);for(var n=ie(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=me(this).entries;bt(arguments.length,1);for(var n=ie(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ve(a,r[i].value);return a},has:function(t){for(var r=me(this).entries,n=bt(arguments.length,1),a=ie(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=me(this);bt(arguments.length,1);for(var a=n.entries,i=!1,o=ie(t),s=ie(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?ac(a,u--,1):(i=!0,f.value=s));i||Ve(a,{key:o,value:s}),pr||(this.size=a.length),n.updateURL()},sort:function(){var t=me(this);iw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=me(this).entries,n=Qy(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new Ca(this,"keys")},values:function(){return new Ca(this,"values")},entries:function(){return new Ca(this,"entries")}},{enumerable:!0});df(Dt,ow,Dt.entries,{name:"entries"});df(Dt,"toString",function(){return me(this).serialize()},{enumerable:!0});pr&&Zy(Dt,"size",{get:function(){return me(this).entries.length},configurable:!0,enumerable:!0});Yy(Qn,Xt);xi({global:!0,constructor:!0,forced:!ff},{URLSearchParams:Qn});if(!ff&&ka(mr)){var $w=Oe(rc.has),Iw=Oe(rc.set),uc=function(e){if(vf(e)){var t=e.body,r;if(ew(t)===Xt)return r=e.headers?new mr(e.headers):new mr,$w(r,"content-type")||Iw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),rw(e,{body:Qs(0,ie(t)),headers:Qs(0,r)})}return e};if(ka(tc)&&xi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return tc(t,arguments.length>1?uc(arguments[1]):{})}}),ka(En)){var Aa=function(t){return hf(this,_a),new En(t,arguments.length>1?uc(arguments[1]):{})};_a.constructor=Aa,Aa.prototype=_a,xi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Aa})}}var Tw={URLSearchParams:Qn,getState:me},Pw=Se,ea=H,lc=He,Ew=gt,bf=URLSearchParams,ta=bf.prototype,Ow=ea(ta.append),fc=ea(ta.delete),kw=ea(ta.forEach),_w=ea([].push),Ao=new bf("a=1&a=2&b=3");Ao.delete("a",1);Ao.delete("b",void 0);Ao+""!="a=2"&&Pw(ta,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return fc(this,e);var n=[];kw(this,function(c,d){_w(n,{key:d,value:c})}),Ew(t,1);for(var a=lc(e),i=lc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,fc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Ow(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Rw=Se,Sf=H,Cw=He,Aw=gt,$f=URLSearchParams,jo=$f.prototype,jw=Sf(jo.getAll),Lw=Sf(jo.has),dc=new $f("a=1");(dc.has("a",2)||!dc.has("a",void 0))&&Rw(jo,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Lw(this,t);var a=jw(this,t);Aw(r,1);for(var i=Cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Uw=re,Nw=H,xw=Yn,Di=URLSearchParams.prototype,Dw=Nw(Di.forEach);Uw&&!("size"in Di)&&xw(Di,"size",{get:function(){var t=0;return Dw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Mw=G,Lo=Mw,Fw=Lo;Fw.URLSearchParams;var Uo=H,Bw=fo,zw=He,Hw=Hn,Gw=Uo("".charAt),hc=Uo("".charCodeAt),Kw=Uo("".slice),vc=function(e){return function(t,r){var n=zw(Hw(t)),a=Bw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=hc(n,a),o<55296||o>56319||a+1===i||(s=hc(n,a+1))<56320||s>57343?e?Gw(n,a):o:e?Kw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},If={codeAt:vc(!1),charAt:vc(!0)},Ww=If.charAt,Vw=He,Tf=Zt,Zw=af,pc=Po,Pf="String Iterator",Jw=Tf.set,Yw=Tf.getterFor(Pf);Zw(String,"String",function(e){Jw(this,{type:Pf,string:Vw(e),index:0})},function(){var t=Yw(this),r=t.string,n=t.index,a;return n>=r.length?pc(void 0,!0):(a=Ww(r,n),t.index+=a.length,pc(a,!1))});var mc=re,Xw=H,qw=ne,Qw=ee,ja=Dl,eb=$o,tb=yo,rb=Gn,nb=Il,St=Object.assign,gc=Object.defineProperty,ab=Xw([].concat),ib=!St||Qw(function(){if(mc&&St({b:1},St(gc({},"a",{enumerable:!0,get:function(){gc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),St({},e)[r]!==7||ja(St({},t)).join("")!==n})?function(t,r){for(var n=rb(t),a=arguments.length,i=1,o=eb.f,s=tb.f;a>i;)for(var u=nb(arguments[i++]),f=o?ab(ja(u),o(u)):ja(u),l=f.length,c=0,d;l>c;)d=f[c++],(!mc||qw(s,u,d))&&(n[d]=u[d]);return n}:St,ob=ne,yc=_e,sb=lo,Ef=function(e,t,r){var n,a;yc(e);try{if(n=sb(e,"return"),!n){if(t==="throw")throw r;return r}n=ob(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return yc(n),r},cb=_e,ub=Ef,lb=function(e,t,r,n){try{return n?t(cb(r)[0],r[1]):t(r)}catch(a){ub(e,"throw",a)}},fb=te,db=Cr,hb=fb("iterator"),vb=Array.prototype,Of=function(e){return e!==void 0&&(db.Array===e||vb[hb]===e)},pb=H,mb=ee,kf=Z,gb=jr,yb=be,wb=bo,_f=function(){},Rf=yb("Reflect","construct"),No=/^\s*(?:class|function)\b/,bb=pb(No.exec),Sb=!No.test(_f),ar=function(t){if(!kf(t))return!1;try{return Rf(_f,[],t),!0}catch{return!1}},Cf=function(t){if(!kf(t))return!1;switch(gb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sb||!!bb(No,wb(t))}catch{return!0}};Cf.sham=!0;var Af=!Rf||mb(function(){var e;return ar(ar.call)||!ar(Object)||!ar(function(){e=!0})||e})?Cf:ar,$b=re,Ib=Le,Tb=pt,Pb=function(e,t,r){$b?Ib.f(e,t,Tb(0,r)):e[t]=r},Eb=Yt,Ob=ne,kb=Gn,_b=lb,Rb=Of,Cb=Af,Ab=ho,wc=Pb,jb=_o,Lb=Xn,bc=Array,Ub=function(t){var r=kb(t),n=Cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Eb(i,a>2?arguments[2]:void 0));var s=Lb(r),u=0,f,l,c,d,h,v;if(s&&!(this===bc&&Rb(s)))for(l=n?new this:[],d=jb(r,s),h=d.next;!(c=Ob(h,d)).done;u++)v=o?_b(d,i,[c.value,u],!0):c.value,wc(l,u,v);else for(f=Ab(r),l=n?new this(f):bc(f);f>u;u++)v=o?i(r[u],u):r[u],wc(l,u,v);return l.length=u,l},yt=H,La=2147483647,gr=36,jf=1,Mi=26,Nb=38,xb=700,Db=72,Mb=128,Fb="-",Bb=/[^\0-\u007E]/,Lf=/[.\u3002\uFF0E\uFF61]/g,Sc="Overflow: input needs wider integers to process",Ua=gr-jf,$c=RangeError,zb=yt(Lf.exec),Rt=Math.floor,Na=String.fromCharCode,Ic=yt("".charCodeAt),Uf=yt([].join),Ze=yt([].push),Hb=yt("".replace),Gb=yt("".split),Kb=yt("".toLowerCase),Wb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Ic(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Ic(e,r++);(i&64512)===56320?Ze(t,((a&1023)<<10)+(i&1023)+65536):(Ze(t,a),r--)}else Ze(t,a)}return t},Tc=function(e){return e+22+75*(e<26)},Vb=function(e,t,r){var n=0;for(e=r?Rt(e/xb):e>>1,e+=Rt(e/t);e>Ua*Mi>>1;)e=Rt(e/Ua),n+=gr;return Rt(n+(Ua+1)*e/(e+Nb))},Zb=function(e){var t=[];e=Wb(e);var r=e.length,n=Mb,a=0,i=Db,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Ze(t,Na(s));var u=t.length,f=u;for(u&&Ze(t,Fb);f<r;){var l=La;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Rt((La-a)/c))throw new $c(Sc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>La)throw new $c(Sc);if(s===n){for(var d=a,h=gr;;){var v=h<=i?jf:h>=i+Mi?Mi:h-i;if(d<v)break;var S=d-v,g=gr-v;Ze(t,Na(Tc(v+S%g))),d=Rt(S/g),h+=gr}Ze(t,Na(Tc(d))),i=Vb(a,c,f===u),a=0,f++}}a++,n++}return Uf(t,"")},Jb=function(e){var t=[],r=Gb(Hb(Kb(e),Lf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ze(t,zb(Bb,a)?"xn--"+Zb(a):a);return Uf(t,".")},Yb=X,xo=re,Xb=Jn,Do=G,Pc=Yt,$e=H,On=Se,he=Yn,qb=Oo,Fi=ye,Mo=ib,$t=Ub,Ie=qn,Qb=If.codeAt,eS=Jb,De=He,tS=Jt,rS=gt,Nf=Tw,xf=Zt,nS=xf.set,kn=xf.getterFor("URL"),aS=Nf.URLSearchParams,iS=Nf.getState,ir=Do.URL,Bi=Do.TypeError,_n=Do.parseInt,oS=Math.floor,Ec=Math.pow,ge=$e("".charAt),Ee=$e(/./.exec),fr=$e([].join),sS=$e(1 .toString),cS=$e([].pop),Et=$e([].push),xa=$e("".replace),uS=$e([].shift),lS=$e("".split),yr=$e("".slice),Rn=$e("".toLowerCase),fS=$e([].unshift),dS="Invalid authority",Da="Invalid scheme",et="Invalid host",Oc="Invalid port",Df=/[a-z]/i,hS=/[\d+-.a-z]/i,zi=/\d/,vS=/^0x/i,pS=/^[0-7]+$/,mS=/^\d+$/,Mf=/^[\da-f]+$/i,gS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yS=/[\0\t\n\r #/:<>?@[\\\]^|]/,wS=/^[\u0000-\u0020]+/,bS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,SS=/[\t\n\r]/g,ve,$S=function(e){var t=lS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&ge(i,0)==="0"&&(o=Ee(vS,i)?16:8,i=yr(i,o===8?1:2)),i==="")s=0;else{if(!Ee(o===10?mS:o===8?pS:Mf,i))return e;s=_n(i,o)}Et(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Ec(256,5-r))return null}else if(s>255)return null;for(u=cS(n),a=0;a<n.length;a++)u+=n[a]*Ec(256,3-a);return u},IS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return ge(e,a)};if(d()===":"){if(ge(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ee(Mf,d());)i=i*16+_n(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ee(zi,d()))return;for(;Ee(zi,d());){if(f=_n(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},TS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},or=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)fS(t,e%256),e=oS(e/256);return fr(t,".")}if(typeof e=="object"){for(t="",n=TS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=sS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},yn={},Ff=Mo({},yn,{" ":1,'"':1,"<":1,">":1,"`":1}),Bf=Mo({},Ff,{"#":1,"?":1,"{":1,"}":1}),Ma=Mo({},Bf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ge=function(e,t){var r=Qb(e,0);return r>32&&r<127&&!Fi(t,e)?e:encodeURIComponent(e)},Jr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},dr=function(e,t){var r;return e.length===2&&Ee(Df,ge(e,0))&&((r=ge(e,1))===":"||!t&&r==="|")},kc=function(e){var t;return e.length>1&&dr(yr(e,0,2))&&(e.length===2||(t=ge(e,2))==="/"||t==="\\"||t==="?"||t==="#")},PS=function(e){return e==="."||Rn(e)==="%2e"},ES=function(e){return e=Rn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Fa={},_c={},Ba={},Rc={},Cc={},za={},Ac={},jc={},Yr={},Xr={},Ha={},Ga={},Ka={},Wa={},Lc={},Va={},It={},Ae={},Uc={},tt={},xe={},Fo=function(e,t,r){var n=De(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Bi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Fo(r,!0)),i=this.parse(n,null,a),i)throw new Bi(i);o=iS(new aS),o.bindURL(this),this.searchParams=o}};Fo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Fa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=De(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=xa(e,wS,""),e=xa(e,bS,"$1")),e=xa(e,SS,""),l=$t(e);i<=l.length;){switch(c=l[i],a){case Fa:if(c&&Ee(Df,c))o+=Rn(c),a=_c;else{if(t)return Da;a=Ba;continue}break;case _c:if(c&&(Ee(hS,c)||c==="+"||c==="-"||c==="."))o+=Rn(c);else if(c===":"){if(t&&(n.isSpecial()!==Fi(Jr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Jr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Wa:n.isSpecial()&&r&&r.scheme===n.scheme?a=Rc:n.isSpecial()?a=jc:l[i+1]==="/"?(a=Cc,i++):(n.cannotBeABaseURL=!0,Et(n.path,""),a=Uc)}else{if(t)return Da;o="",a=Ba,i=0;continue}break;case Ba:if(!r||r.cannotBeABaseURL&&c!=="#")return Da;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Ie(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=xe;break}a=r.scheme==="file"?Wa:za;continue;case Rc:if(c==="/"&&l[i+1]==="/")a=Yr,i++;else{a=za;continue}break;case Cc:if(c==="/"){a=Xr;break}else{a=Ae;continue}case za:if(n.scheme=r.scheme,c===ve)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Ac;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query="",a=tt;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query=r.query,n.fragment="",a=xe;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.path.length--,a=Ae;continue}break;case Ac:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Yr;else if(c==="/")a=Xr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ae;continue}break;case jc:if(a=Yr,c!=="/"||ge(o,i+1)!=="/")continue;i++;break;case Yr:if(c!=="/"&&c!=="\\"){a=Xr;continue}break;case Xr:if(c==="@"){s&&(o="%40"+o),s=!0,d=$t(o);for(var v=0;v<d.length;v++){var S=d[v];if(S===":"&&!f){f=!0;continue}var g=Ge(S,Ma);f?n.password+=g:n.username+=g}o=""}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return dS;i-=$t(o).length+1,o="",a=Ha}else o+=c;break;case Ha:case Ga:if(t&&n.scheme==="file"){a=Va;continue}else if(c===":"&&!u){if(o==="")return et;if(h=n.parseHost(o),h)return h;if(o="",a=Ka,t===Ga)return}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return et;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=It,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ka:if(Ee(zi,c))o+=c;else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=_n(o,10);if(T>65535)return Oc;n.port=n.isSpecial()&&T===Jr[n.scheme]?null:T,o=""}if(t)return;a=It;continue}else return Oc;break;case Wa:if(n.scheme="file",c==="/"||c==="\\")a=Lc;else if(r&&r.scheme==="file")switch(c){case ve:n.host=r.host,n.path=Ie(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Ie(r.path),n.query="",a=tt;break;case"#":n.host=r.host,n.path=Ie(r.path),n.query=r.query,n.fragment="",a=xe;break;default:kc(fr(Ie(l,i),""))||(n.host=r.host,n.path=Ie(r.path),n.shortenPath()),a=Ae;continue}else{a=Ae;continue}break;case Lc:if(c==="/"||c==="\\"){a=Va;break}r&&r.scheme==="file"&&!kc(fr(Ie(l,i),""))&&(dr(r.path[0],!0)?Et(n.path,r.path[0]):n.host=r.host),a=Ae;continue;case Va:if(c===ve||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&dr(o))a=Ae;else if(o===""){if(n.host="",t)return;a=It}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=It}continue}else o+=c;break;case It:if(n.isSpecial()){if(a=Ae,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=tt;else if(!t&&c==="#")n.fragment="",a=xe;else if(c!==ve&&(a=Ae,c!=="/"))continue;break;case Ae:if(c===ve||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(ES(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,"")):PS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,""):(n.scheme==="file"&&!n.path.length&&dr(o)&&(n.host&&(n.host=""),o=ge(o,0)+":"),Et(n.path,o)),o="",n.scheme==="file"&&(c===ve||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)uS(n.path);c==="?"?(n.query="",a=tt):c==="#"&&(n.fragment="",a=xe)}else o+=Ge(c,Bf);break;case Uc:c==="?"?(n.query="",a=tt):c==="#"?(n.fragment="",a=xe):c!==ve&&(n.path[0]+=Ge(c,yn));break;case tt:!t&&c==="#"?(n.fragment="",a=xe):c!==ve&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ge(c,yn));break;case xe:c!==ve&&(n.fragment+=Ge(c,Ff));break}i++}},parseHost:function(e){var t,r,n;if(ge(e,0)==="["){if(ge(e,e.length-1)!=="]"||(t=IS(yr(e,1,-1)),!t))return et;this.host=t}else if(this.isSpecial()){if(e=eS(e),Ee(gS,e)||(t=$S(e),t===null))return et;this.host=t}else{if(Ee(yS,e))return et;for(t="",r=$t(e),n=0;n<r.length;n++)t+=Ge(r[n],yn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Fi(Jr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!dr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=or(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+fr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Bi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Mt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+or(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(De(e)+":",Fa)},getUsername:function(){return this.username},setUsername:function(e){var t=$t(De(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ge(t[r],Ma)}},getPassword:function(){return this.password},setPassword:function(e){var t=$t(De(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ge(t[r],Ma)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?or(e):or(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getHostname:function(){var e=this.host;return e===null?"":or(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ga)},getPort:function(){var e=this.port;return e===null?"":De(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=De(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+fr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,It))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=De(e),e===""?this.query=null:(ge(e,0)==="?"&&(e=yr(e,1)),this.query="",this.parse(e,tt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=De(e),e===""){this.fragment=null;return}ge(e,0)==="#"&&(e=yr(e,1)),this.fragment="",this.parse(e,xe)},update:function(){this.query=this.searchParams.serialize()||null}};var Mt=function(t){var r=qb(this,ae),n=rS(arguments.length,1)>1?arguments[1]:void 0,a=nS(r,new Fo(t,!1,n));xo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ae=Mt.prototype,pe=function(e,t){return{get:function(){return kn(this)[e]()},set:t&&function(r){return kn(this)[t](r)},configurable:!0,enumerable:!0}};xo&&(he(ae,"href",pe("serialize","setHref")),he(ae,"origin",pe("getOrigin")),he(ae,"protocol",pe("getProtocol","setProtocol")),he(ae,"username",pe("getUsername","setUsername")),he(ae,"password",pe("getPassword","setPassword")),he(ae,"host",pe("getHost","setHost")),he(ae,"hostname",pe("getHostname","setHostname")),he(ae,"port",pe("getPort","setPort")),he(ae,"pathname",pe("getPathname","setPathname")),he(ae,"search",pe("getSearch","setSearch")),he(ae,"searchParams",pe("getSearchParams")),he(ae,"hash",pe("getHash","setHash")));On(ae,"toJSON",function(){return kn(this).serialize()},{enumerable:!0});On(ae,"toString",function(){return kn(this).serialize()},{enumerable:!0});if(ir){var Nc=ir.createObjectURL,xc=ir.revokeObjectURL;Nc&&On(Mt,"createObjectURL",Pc(Nc,ir)),xc&&On(Mt,"revokeObjectURL",Pc(xc,ir))}tS(Mt,"URL");Yb({global:!0,constructor:!0,forced:!Xb,sham:!xo},{URL:Mt});var OS=X,kS=be,zf=ee,_S=gt,Dc=He,RS=Jn,Bo=kS("URL"),CS=RS&&zf(function(){Bo.canParse()}),AS=zf(function(){return Bo.canParse.length!==1});OS({target:"URL",stat:!0,forced:!CS||AS},{canParse:function(t){var r=_S(arguments.length,1),n=Dc(t),a=r<2||arguments[1]===void 0?void 0:Dc(arguments[1]);try{return!!new Bo(n,a)}catch{return!1}}});var jS=X,LS=be,US=gt,Mc=He,NS=Jn,xS=LS("URL");jS({target:"URL",stat:!0,forced:!NS},{parse:function(t){var r=US(arguments.length,1),n=Mc(t),a=r<2||arguments[1]===void 0?void 0:Mc(arguments[1]);try{return new xS(n,a)}catch{return null}}});var DS=X,MS=ne;DS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return MS(URL.prototype.toString,this)}});var FS=Lo;FS.URL;var BS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zS=Kn,Za=zS("span").classList,Fc=Za&&Za.constructor&&Za.constructor.prototype,HS=Fc===Object.prototype?void 0:Fc,Bc=G,Hf=BS,GS=HS,hr=Xg,zc=mt,KS=Jt,WS=te,Ja=WS("iterator"),Ya=hr.values,Gf=function(e,t){if(e){if(e[Ja]!==Ya)try{zc(e,Ja,Ya)}catch{e[Ja]=Ya}if(KS(e,t,!0),Hf[t]){for(var r in hr)if(e[r]!==hr[r])try{zc(e,r,hr[r])}catch{e[r]=hr[r]}}}};for(var Xa in Hf)Gf(Bc[Xa]&&Bc[Xa].prototype,Xa);Gf(GS,"DOMTokenList");var VS=we,ZS=mt,JS=function(e,t){VS(t)&&"cause"in t&&ZS(e,"cause",t.cause)},YS=H,Kf=Error,XS=YS("".replace),qS=function(e){return String(new Kf(e).stack)}("zxcasd"),Wf=/\n\s*at [^:]*:[^\n]*/,QS=Wf.test(qS),e$=function(e,t){if(QS&&typeof e=="string"&&!Kf.prepareStackTrace)for(;t--;)e=XS(e,Wf,"");return e},t$=ee,r$=pt,n$=!t$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",r$(1,7)),e.stack!==7):!0}),a$=mt,i$=e$,o$=n$,Hc=Error.captureStackTrace,s$=function(e,t,r,n){o$&&(Hc?Hc(e,t):a$(e,"stack",i$(r,n)))},c$=Yt,u$=ne,l$=_e,f$=Vn,d$=Of,h$=ho,Gc=Wn,v$=_o,p$=Xn,Kc=Ef,m$=TypeError,wn=function(e,t){this.stopped=e,this.result=t},Wc=wn.prototype,Lr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=c$(t,n),f,l,c,d,h,v,S,g=function(I){return f&&Kc(f,"normal",I),new wn(!0,I)},T=function(I){return a?(l$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=p$(e),!l)throw new m$(f$(e)+" is not iterable");if(d$(l)){for(c=0,d=h$(e);d>c;c++)if(h=T(e[c]),h&&Gc(Wc,h))return h;return new wn(!1)}f=v$(e,l)}for(v=i?e.next:f.next;!(S=u$(v,f)).done;){try{h=T(S.value)}catch(I){Kc(f,"throw",I)}if(typeof h=="object"&&h&&Gc(Wc,h))return h}return new wn(!1)},g$=He,y$=function(e,t){return e===void 0?arguments.length<2?"":t:g$(e)},w$=X,b$=Wn,S$=Io,Cn=To,$$=Xl,Vf=Zn,qa=mt,Qa=pt,I$=JS,T$=s$,P$=Lr,E$=y$,O$=te,k$=O$("toStringTag"),An=Error,_$=[].push,Ft=function(t,r){var n=b$(ei,this),a;Cn?a=Cn(new An,n?S$(this):ei):(a=n?this:Vf(ei),qa(a,k$,"Error")),r!==void 0&&qa(a,"message",E$(r)),T$(a,Ft,a.stack,1),arguments.length>2&&I$(a,arguments[2]);var i=[];return P$(t,_$,{that:i}),qa(a,"errors",i),a};Cn?Cn(Ft,An):$$(Ft,An,{name:!0});var ei=Ft.prototype=Vf(An.prototype,{constructor:Qa(1,Ft),message:Qa(1,""),name:Qa(1,"AggregateError")});w$({global:!0,constructor:!0,arity:2},{AggregateError:Ft});var R$=ko,C$=jr,A$=R$?{}.toString:function(){return"[object "+C$(this)+"]"},j$=ko,L$=Se,U$=A$;j$||L$(Object.prototype,"toString",U$,{unsafe:!0});var sr=G,N$=Rr,x$=Bn,qr=function(e){return N$.slice(0,e.length)===e},Zf=function(){return qr("Bun/")?"BUN":qr("Cloudflare-Workers")?"CLOUDFLARE":qr("Deno/")?"DENO":qr("Node.js/")?"NODE":sr.Bun&&typeof Bun.version=="string"?"BUN":sr.Deno&&typeof Deno.version=="object"?"DENO":x$(sr.process)==="process"?"NODE":sr.window&&sr.document?"BROWSER":"REST"}(),D$=Zf,zo=D$==="NODE",M$=be,F$=Yn,B$=te,z$=re,Vc=B$("species"),H$=function(e){var t=M$(e);z$&&t&&!t[Vc]&&F$(t,Vc,{configurable:!0,get:function(){return this}})},G$=Af,K$=Vn,W$=TypeError,V$=function(e){if(G$(e))return e;throw new W$(K$(e)+" is not a constructor")},Zc=_e,Z$=V$,J$=zn,Y$=te,X$=Y$("species"),Jf=function(e,t){var r=Zc(e).constructor,n;return r===void 0||J$(n=Zc(r)[X$])?t:Z$(n)},q$=Fn,Yf=Function.prototype,Jc=Yf.apply,Yc=Yf.call,Xf=typeof Reflect=="object"&&Reflect.apply||(q$?Yc.bind(Jc):function(){return Yc.apply(Jc,arguments)}),Q$=Rr,qf=/(?:ipad|iphone|ipod).*applewebkit/i.test(Q$),le=G,eI=Xf,tI=Yt,Xc=Z,rI=ye,Qf=ee,qc=Ml,nI=qn,Qc=Kn,aI=gt,iI=qf,oI=zo,Hi=le.setImmediate,Gi=le.clearImmediate,sI=le.process,ti=le.Dispatch,cI=le.Function,eu=le.MessageChannel,uI=le.String,ri=0,wr={},tu="onreadystatechange",Er,rt,ni,ai;Qf(function(){Er=le.location});var Ho=function(e){if(rI(wr,e)){var t=wr[e];delete wr[e],t()}},ii=function(e){return function(){Ho(e)}},ru=function(e){Ho(e.data)},nu=function(e){le.postMessage(uI(e),Er.protocol+"//"+Er.host)};(!Hi||!Gi)&&(Hi=function(t){aI(arguments.length,1);var r=Xc(t)?t:cI(t),n=nI(arguments,1);return wr[++ri]=function(){eI(r,void 0,n)},rt(ri),ri},Gi=function(t){delete wr[t]},oI?rt=function(e){sI.nextTick(ii(e))}:ti&&ti.now?rt=function(e){ti.now(ii(e))}:eu&&!iI?(ni=new eu,ai=ni.port2,ni.port1.onmessage=ru,rt=tI(ai.postMessage,ai)):le.addEventListener&&Xc(le.postMessage)&&!le.importScripts&&Er&&Er.protocol!=="file:"&&!Qf(nu)?(rt=nu,le.addEventListener("message",ru,!1)):tu in Qc("script")?rt=function(e){qc.appendChild(Qc("script"))[tu]=function(){qc.removeChild(this),Ho(e)}}:rt=function(e){setTimeout(ii(e),0)});var ed={set:Hi,clear:Gi},td=function(){this.head=null,this.tail=null};td.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var rd=td,lI=Rr,fI=/ipad|iphone|ipod/i.test(lI)&&typeof Pebble<"u",dI=Rr,hI=/web0s(?!.*chrome)/i.test(dI),Bt=G,vI=cf,au=Yt,oi=ed.set,pI=rd,mI=qf,gI=fI,yI=hI,si=zo,iu=Bt.MutationObserver||Bt.WebKitMutationObserver,ou=Bt.document,su=Bt.process,Qr=Bt.Promise,Ki=vI("queueMicrotask"),Tt,ci,ui,en,cu;if(!Ki){var tn=new pI,rn=function(){var e,t;for(si&&(e=su.domain)&&e.exit();t=tn.get();)try{t()}catch(r){throw tn.head&&Tt(),r}e&&e.enter()};!mI&&!si&&!yI&&iu&&ou?(ci=!0,ui=ou.createTextNode(""),new iu(rn).observe(ui,{characterData:!0}),Tt=function(){ui.data=ci=!ci}):!gI&&Qr&&Qr.resolve?(en=Qr.resolve(void 0),en.constructor=Qr,cu=au(en.then,en),Tt=function(){cu(rn)}):si?Tt=function(){su.nextTick(rn)}:(oi=au(oi,Bt),Tt=function(){oi(rn)}),Ki=function(e){tn.head||Tt(),tn.add(e)}}var wI=Ki,bI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},qt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},SI=G,Ur=SI.Promise,$I=G,br=Ur,II=Z,TI=ql,PI=bo,EI=te,uu=Zf,li=kl;br&&br.prototype;var OI=EI("species"),Wi=!1,nd=II($I.PromiseRejectionEvent),kI=TI("Promise",function(){var e=PI(br),t=e!==String(br);if(!t&&li===66)return!0;if(!li||li<51||!/native code/.test(e)){var r=new br(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[OI]=n,Wi=r.then(function(){})instanceof n,!Wi)return!0}return!t&&(uu==="BROWSER"||uu==="DENO")&&!nd}),Nr={CONSTRUCTOR:kI,REJECTION_EVENT:nd,SUBCLASSING:Wi},Ue={},lu=Re,_I=TypeError,RI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new _I("Bad Promise constructor");t=n,r=a}),this.resolve=lu(t),this.reject=lu(r)};Ue.f=function(e){return new RI(e)};var CI=X,jn=zo,Xe=G,zt=ne,fu=Se,du=To,AI=Jt,jI=H$,LI=Re,bn=Z,UI=we,NI=Oo,xI=Jf,ad=ed.set,Go=wI,DI=bI,MI=qt,FI=rd,id=Zt,Ln=Ur,Ko=Nr,od=Ue,ra="Promise",sd=Ko.CONSTRUCTOR,BI=Ko.REJECTION_EVENT,zI=Ko.SUBCLASSING,fi=id.getterFor(ra),HI=id.set,Ot=Ln&&Ln.prototype,at=Ln,nn=Ot,cd=Xe.TypeError,Vi=Xe.document,Wo=Xe.process,Zi=od.f,GI=Zi,KI=!!(Vi&&Vi.createEvent&&Xe.dispatchEvent),ud="unhandledrejection",WI="rejectionhandled",hu=0,ld=1,VI=2,Vo=1,fd=2,an,vu,ZI,pu,dd=function(e){var t;return UI(e)&&bn(t=e.then)?t:!1},hd=function(e,t){var r=t.value,n=t.state===ld,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===fd&&YI(t),t.rejection=Vo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new cd("Promise-chain cycle")):(f=dd(u))?zt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},vd=function(e,t){e.notified||(e.notified=!0,Go(function(){for(var r=e.reactions,n;n=r.get();)hd(n,e);e.notified=!1,t&&!e.rejection&&JI(e)}))},pd=function(e,t,r){var n,a;KI?(n=Vi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Xe.dispatchEvent(n)):n={promise:t,reason:r},!BI&&(a=Xe["on"+e])?a(n):e===ud&&DI("Unhandled promise rejection",r)},JI=function(e){zt(ad,Xe,function(){var t=e.facade,r=e.value,n=mu(e),a;if(n&&(a=MI(function(){jn?Wo.emit("unhandledRejection",r,t):pd(ud,t,r)}),e.rejection=jn||mu(e)?fd:Vo,a.error))throw a.value})},mu=function(e){return e.rejection!==Vo&&!e.parent},YI=function(e){zt(ad,Xe,function(){var t=e.facade;jn?Wo.emit("rejectionHandled",t):pd(WI,t,e.value)})},Ct=function(e,t,r){return function(n){e(t,n,r)}},Lt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=VI,vd(e,!0))},Ji=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new cd("Promise can't be resolved itself");var n=dd(t);n?Go(function(){var a={done:!1};try{zt(n,t,Ct(Ji,a,e),Ct(Lt,a,e))}catch(i){Lt(a,i,e)}}):(e.value=t,e.state=ld,vd(e,!1))}catch(a){Lt({done:!1},a,e)}}};if(sd&&(at=function(t){NI(this,nn),LI(t),zt(an,this);var r=fi(this);try{t(Ct(Ji,r),Ct(Lt,r))}catch(n){Lt(r,n)}},nn=at.prototype,an=function(t){HI(this,{type:ra,done:!1,notified:!1,parent:!1,reactions:new FI,rejection:!1,state:hu,value:null})},an.prototype=fu(nn,"then",function(t,r){var n=fi(this),a=Zi(xI(this,at));return n.parent=!0,a.ok=bn(t)?t:!0,a.fail=bn(r)&&r,a.domain=jn?Wo.domain:void 0,n.state===hu?n.reactions.add(a):Go(function(){hd(a,n)}),a.promise}),vu=function(){var e=new an,t=fi(e);this.promise=e,this.resolve=Ct(Ji,t),this.reject=Ct(Lt,t)},od.f=Zi=function(e){return e===at||e===ZI?new vu(e):GI(e)},bn(Ln)&&Ot!==Object.prototype)){pu=Ot.then,zI||fu(Ot,"then",function(t,r){var n=this;return new at(function(a,i){zt(pu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Ot.constructor}catch{}du&&du(Ot,nn)}CI({global:!0,constructor:!0,wrap:!0,forced:sd},{Promise:at});AI(at,ra,!1);jI(ra);var XI=te,md=XI("iterator"),gd=!1;try{var qI=0,gu={next:function(){return{done:!!qI++}},return:function(){gd=!0}};gu[md]=function(){return this},Array.from(gu,function(){throw 2})}catch{}var QI=function(e,t){try{if(!t&&!gd)return!1}catch{return!1}var r=!1;try{var n={};n[md]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},e0=Ur,t0=QI,r0=Nr.CONSTRUCTOR,na=r0||!t0(function(e){e0.all(e).then(void 0,function(){})}),n0=X,a0=ne,i0=Re,o0=Ue,s0=qt,c0=Lr,u0=na;n0({target:"Promise",stat:!0,forced:u0},{all:function(t){var r=this,n=o0.f(r),a=n.resolve,i=n.reject,o=s0(function(){var s=i0(r.resolve),u=[],f=0,l=1;c0(t,function(c){var d=f++,h=!1;l++,a0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var l0=X,f0=Nr.CONSTRUCTOR,Yi=Ur,d0=be,h0=Z,v0=Se,yu=Yi&&Yi.prototype;l0({target:"Promise",proto:!0,forced:f0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(h0(Yi)){var wu=d0("Promise").prototype.catch;yu.catch!==wu&&v0(yu,"catch",wu,{unsafe:!0})}var p0=X,m0=ne,g0=Re,y0=Ue,w0=qt,b0=Lr,S0=na;p0({target:"Promise",stat:!0,forced:S0},{race:function(t){var r=this,n=y0.f(r),a=n.reject,i=w0(function(){var o=g0(r.resolve);b0(t,function(s){m0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var $0=X,I0=Ue,T0=Nr.CONSTRUCTOR;$0({target:"Promise",stat:!0,forced:T0},{reject:function(t){var r=I0.f(this),n=r.reject;return n(t),r.promise}});var P0=_e,E0=we,O0=Ue,yd=function(e,t){if(P0(e),E0(t)&&t.constructor===e)return t;var r=O0.f(e),n=r.resolve;return n(t),r.promise},k0=X,_0=be,R0=Nr.CONSTRUCTOR,C0=yd;_0("Promise");k0({target:"Promise",stat:!0,forced:R0},{resolve:function(t){return C0(this,t)}});var A0=X,j0=ne,L0=Re,U0=Ue,N0=qt,x0=Lr,D0=na;A0({target:"Promise",stat:!0,forced:D0},{allSettled:function(t){var r=this,n=U0.f(r),a=n.resolve,i=n.reject,o=N0(function(){var s=L0(r.resolve),u=[],f=0,l=1;x0(t,function(c){var d=f++,h=!1;l++,j0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var M0=X,F0=ne,B0=Re,z0=be,H0=Ue,G0=qt,K0=Lr,W0=na,bu="No one promise resolved";M0({target:"Promise",stat:!0,forced:W0},{any:function(t){var r=this,n=z0("AggregateError"),a=H0.f(r),i=a.resolve,o=a.reject,s=G0(function(){var u=B0(r.resolve),f=[],l=0,c=1,d=!1;K0(t,function(h){var v=l++,S=!1;c++,F0(u,r,h).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[v]=g,--c||o(new n(f,bu)))})}),--c||o(new n(f,bu))});return s.error&&o(s.value),a.promise}});var V0=X,Z0=Ue;V0({target:"Promise",stat:!0},{withResolvers:function(){var t=Z0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var J0=X,Un=Ur,Y0=ee,wd=be,bd=Z,X0=Jf,Su=yd,q0=Se,Xi=Un&&Un.prototype,Q0=!!Un&&Y0(function(){Xi.finally.call({then:function(){}},function(){})});J0({target:"Promise",proto:!0,real:!0,forced:Q0},{finally:function(e){var t=X0(this,wd("Promise")),r=bd(e);return this.then(r?function(n){return Su(t,e()).then(function(){return n})}:e,r?function(n){return Su(t,e()).then(function(){throw n})}:e)}});if(bd(Un)){var $u=wd("Promise").prototype.finally;Xi.finally!==$u&&q0(Xi,"finally",$u,{unsafe:!0})}var eT=Lo;eT.Promise;var tT=X,rT=G,nT=Xf,aT=qn,iT=Ue,oT=Re,Sd=qt,di=rT.Promise,Iu=!1,sT=!di||!di.try||Sd(function(){di.try(function(e){Iu=e===8},8)}).error||!Iu;tT({target:"Promise",stat:!0,forced:sT},{try:function(e){var t=arguments.length>1?aT(arguments,1):[],r=iT.f(this),n=Sd(function(){return nT(oT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function qe(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function je(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var it=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jo(e,t){return e(t={exports:{}},t.exports),t.exports}var nt=Jo(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Zo(nt);var cT=Zo(Jo(function(e,t){var r=it&&it.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,S){function g(w){try{I(h.next(w))}catch(p){S(p)}}function T(w){try{I(h.throw(w))}catch(p){S(p)}}function I(w){w.done?v(w.value):new d(function(p){p(w.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=it&&it.__generator||function(l,c){var d,h,v,S,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return S={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function T(I){return function(w){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch($){p=[6,$],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,w])}}},a=it;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(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=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,S,g,T,I,w;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(S))!==null&&(w=JSON.parse(I)).id===this.id&&w.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,nt.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(nt.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),nt.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(nt.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var w=50-(Date.now()-S);w>0?setTimeout(h,w):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(S=JSON.parse(v)).id!==this.id?[3,2]:[4,nt.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),nt.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],S=0;;){var g=h.keySync(S);if(g===null)break;v.push(g),S++}for(var T=!1,I=0;I<v.length;I++){var w=v[I];if(w.includes(i)){var p=h.getItemSync(w);if(p!==null){var $=JSON.parse(p);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(h.removeItemSync(w),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const uT={timeoutInSeconds:60},$d={name:"auth0-spa-js",version:"2.1.3"},Id=()=>Date.now();let ue=class qi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,qi.prototype)}static fromPayload({error:t,error_description:r}){return new qi(t,r)}},lT=class Td extends ue{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Td.prototype)}},Qi=class Pd extends ue{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Pd.prototype)}},fT=class Ed extends Qi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Ed.prototype)}},dT=class Od extends ue{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Od.prototype)}},hT=class kd extends ue{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,kd.prototype)}},_d=class Rd extends ue{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Tu(t,["default"])}', scope: '${Tu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Rd.prototype)}};function Tu(e,t=[]){return e&&!t.includes(e)?e:""}const Sn=()=>window.crypto,hi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Sn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Pu=e=>btoa(e),eo=e=>{var{clientId:t}=e,r=je(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Eu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),vT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},pT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([vT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},mT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},gT=async(e,t,r,n,a,i,o=1e4)=>a?mT(e,t,r,n,o,a,i):pT(e,n,o);async function yT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=je(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?eo(u):JSON.stringify(u);return await async function(l,c,d,h,v,S,g){let T,I=null;for(let k=0;k<3;k++)try{T=await gT(l,d,h,v,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const w=T.json,{error:p,error_description:$}=w,O=je(w,["error","error_description"]),{ok:_}=T;if(!_){const k=$||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new hT(p,k,O.mfa_token):p==="missing_refresh_token"?new _d(d,h):new ue(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||$d))}},t,s)}const on=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let st=class to{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new to({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new to({scope:r,audience:n,clientId:a})}},wT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Cd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},bT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Id}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new st({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new st({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=st.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},ST=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const cr=e=>typeof e=="number",$T=["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"],IT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Eu(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],$T.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Eu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!cr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!cr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!cr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&cr(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&cr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ct=Jo(function(e,t){var r=it&&it.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Zo(ct),ct.encode,ct.parse,ct.getAll;var TT=ct.get,Ad=ct.set,jd=ct.remove;const kt={get(e){const t=TT(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r)}},PT={get(e){return kt.get(e)||kt.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(`_legacy_${e}`,JSON.stringify(t),n),kt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r),kt.remove(e,t),kt.remove(`_legacy_${e}`,t)}},ET={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function OT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
2
- `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Ou,ku,_u,vi,kT=(Ou="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",ku=null,_u=!1,function(e){return vi=vi||OT(Ou,ku,_u),new Worker(vi,e)});const pi={};let _T=class{constructor(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(t),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(t){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(t),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(t){return`@@auth0spajs@@::${t}`}};const RT={memory:()=>new Cd().enclosedCache,localstorage:()=>new wT},Ru=e=>RT[e],Cu=e=>{const{openUrl:t,onRedirect:r}=e,n=je(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},mi=new cT;let CT=class{constructor(t){let r,n;if(this.userCache=new Cd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await mi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!Sn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Sn().subtle===void 0)throw new Error(`
1
+ "use strict";var bh=Object.defineProperty;var Sh=(e,t,r)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var de=(e,t,r)=>Sh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ee=function(e){try{return!!e()}catch{return!0}},$h=ee,Fn=!$h(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),bl=Fn,Sl=Function.prototype,Ti=Sl.call,Ih=bl&&Sl.bind.bind(Ti,Ti),H=bl?Ih:function(e){return function(){return Ti.apply(e,arguments)}},$l=H,Th=$l({}.toString),Ph=$l("".slice),Bn=function(e){return Ph(Th(e),8,-1)},Eh=H,Oh=ee,kh=Bn,ua=Object,_h=Eh("".split),Il=Oh(function(){return!ua("z").propertyIsEnumerable(0)})?function(e){return kh(e)==="String"?_h(e,""):ua(e)}:ua,zn=function(e){return e==null},Rh=zn,Ch=TypeError,Hn=function(e){if(Rh(e))throw new Ch("Can't call method on "+e);return e},Ah=Il,jh=Hn,_r=function(e){return Ah(jh(e))},tr=function(e){return e&&e.Math===Math&&e},G=tr(typeof globalThis=="object"&&globalThis)||tr(typeof window=="object"&&window)||tr(typeof self=="object"&&self)||tr(typeof Mr=="object"&&Mr)||tr(typeof Mr=="object"&&Mr)||function(){return this}()||Function("return this")(),Tl={exports:{}},Lh=!1,cs=G,Uh=Object.defineProperty,uo=function(e,t){try{Uh(cs,e,{value:t,configurable:!0,writable:!0})}catch{cs[e]=t}return t},Nh=G,xh=uo,us="__core-js_shared__",ls=Tl.exports=Nh[us]||xh(us,{});(ls.versions||(ls.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var lo=Tl.exports,fs=lo,Pl=function(e,t){return fs[e]||(fs[e]=t||{})},Dh=Hn,Mh=Object,Gn=function(e){return Mh(Dh(e))},Fh=H,Bh=Gn,zh=Fh({}.hasOwnProperty),ye=Object.hasOwn||function(t,r){return zh(Bh(t),r)},Hh=H,Gh=0,Kh=Math.random(),Wh=Hh(1 .toString),El=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Wh(++Gh+Kh,36)},Vh=G,ds=Vh.navigator,hs=ds&&ds.userAgent,Rr=hs?String(hs):"",Ol=G,la=Rr,vs=Ol.process,ps=Ol.Deno,ms=vs&&vs.versions||ps&&ps.version,gs=ms&&ms.v8,Pe,In;gs&&(Pe=gs.split("."),In=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1]));!In&&la&&(Pe=la.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=la.match(/Chrome\/(\d+)/),Pe&&(In=+Pe[1])));var kl=In,ys=kl,Zh=ee,Jh=G,Yh=Jh.String,_l=!!Object.getOwnPropertySymbols&&!Zh(function(){var e=Symbol("symbol detection");return!Yh(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ys&&ys<41}),Xh=_l,Rl=Xh&&!Symbol.sham&&typeof Symbol.iterator=="symbol",qh=G,Qh=Pl,ws=ye,ev=El,tv=_l,rv=Rl,_t=qh.Symbol,fa=Qh("wks"),nv=rv?_t.for||_t:_t&&_t.withoutSetter||ev,te=function(e){return ws(fa,e)||(fa[e]=tv&&ws(_t,e)?_t[e]:nv("Symbol."+e)),fa[e]},da=typeof document=="object"&&document.all,Z=typeof da>"u"&&da!==void 0?function(e){return typeof e=="function"||e===da}:function(e){return typeof e=="function"},av=Z,we=function(e){return typeof e=="object"?e!==null:av(e)},iv=we,ov=String,sv=TypeError,_e=function(e){if(iv(e))return e;throw new sv(ov(e)+" is not an object")},Cl={},cv=ee,re=!cv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uv=re,lv=ee,Al=uv&&lv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Le={},fv=G,bs=we,Pi=fv.document,dv=bs(Pi)&&bs(Pi.createElement),Kn=function(e){return dv?Pi.createElement(e):{}},hv=re,vv=ee,pv=Kn,jl=!hv&&!vv(function(){return Object.defineProperty(pv("div"),"a",{get:function(){return 7}}).a!==7}),mv=Fn,Fr=Function.prototype.call,ne=mv?Fr.bind(Fr):function(){return Fr.apply(Fr,arguments)},ha=G,gv=Z,yv=function(e){return gv(e)?e:void 0},be=function(e,t){return arguments.length<2?yv(ha[e]):ha[e]&&ha[e][t]},wv=H,Wn=wv({}.isPrototypeOf),bv=be,Sv=Z,$v=Wn,Iv=Rl,Tv=Object,Ll=Iv?function(e){return typeof e=="symbol"}:function(e){var t=bv("Symbol");return Sv(t)&&$v(t.prototype,Tv(e))},Pv=String,Vn=function(e){try{return Pv(e)}catch{return"Object"}},Ev=Z,Ov=Vn,kv=TypeError,Re=function(e){if(Ev(e))return e;throw new kv(Ov(e)+" is not a function")},_v=Re,Rv=zn,fo=function(e,t){var r=e[t];return Rv(r)?void 0:_v(r)},va=ne,pa=Z,ma=we,Cv=TypeError,Av=function(e,t){var r,n;if(t==="string"&&pa(r=e.toString)&&!ma(n=va(r,e))||pa(r=e.valueOf)&&!ma(n=va(r,e))||t!=="string"&&pa(r=e.toString)&&!ma(n=va(r,e)))return n;throw new Cv("Can't convert object to primitive value")},jv=ne,Ss=we,$s=Ll,Lv=fo,Uv=Av,Nv=te,xv=TypeError,Dv=Nv("toPrimitive"),Mv=function(e,t){if(!Ss(e)||$s(e))return e;var r=Lv(e,Dv),n;if(r){if(t===void 0&&(t="default"),n=jv(r,e,t),!Ss(n)||$s(n))return n;throw new xv("Can't convert object to primitive value")}return t===void 0&&(t="number"),Uv(e,t)},Fv=Mv,Bv=Ll,Ul=function(e){var t=Fv(e,"string");return Bv(t)?t:t+""},zv=re,Hv=jl,Gv=Al,Br=_e,Is=Ul,Kv=TypeError,ga=Object.defineProperty,Wv=Object.getOwnPropertyDescriptor,ya="enumerable",wa="configurable",ba="writable";Le.f=zv?Gv?function(t,r,n){if(Br(t),r=Is(r),Br(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ba in n&&!n[ba]){var a=Wv(t,r);a&&a[ba]&&(t[r]=n.value,n={configurable:wa in n?n[wa]:a[wa],enumerable:ya in n?n[ya]:a[ya],writable:!1})}return ga(t,r,n)}:ga:function(t,r,n){if(Br(t),r=Is(r),Br(n),Hv)try{return ga(t,r,n)}catch{}if("get"in n||"set"in n)throw new Kv("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Vv=Math.ceil,Zv=Math.floor,Jv=Math.trunc||function(t){var r=+t;return(r>0?Zv:Vv)(r)},Yv=Jv,ho=function(e){var t=+e;return t!==t||t===0?0:Yv(t)},Xv=ho,qv=Math.max,Qv=Math.min,Nl=function(e,t){var r=Xv(e);return r<0?qv(r+t,0):Qv(r,t)},ep=ho,tp=Math.min,rp=function(e){var t=ep(e);return t>0?tp(t,9007199254740991):0},np=rp,vo=function(e){return np(e.length)},ap=_r,ip=Nl,op=vo,Ts=function(e){return function(t,r,n){var a=ap(t),i=op(a);if(i===0)return!e&&-1;var o=ip(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},sp={includes:Ts(!0),indexOf:Ts(!1)},po={},cp=H,Sa=ye,up=_r,lp=sp.indexOf,fp=po,Ps=cp([].push),xl=function(e,t){var r=up(e),n=0,a=[],i;for(i in r)!Sa(fp,i)&&Sa(r,i)&&Ps(a,i);for(;t.length>n;)Sa(r,i=t[n++])&&(~lp(a,i)||Ps(a,i));return a},mo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dp=xl,hp=mo,Dl=Object.keys||function(t){return dp(t,hp)},vp=re,pp=Al,mp=Le,gp=_e,yp=_r,wp=Dl;Cl.f=vp&&!pp?Object.defineProperties:function(t,r){gp(t);for(var n=yp(r),a=wp(r),i=a.length,o=0,s;i>o;)mp.f(t,s=a[o++],n[s]);return t};var bp=be,Ml=bp("document","documentElement"),Sp=Pl,$p=El,Es=Sp("keys"),go=function(e){return Es[e]||(Es[e]=$p(e))},Ip=_e,Tp=Cl,Os=mo,Pp=po,Ep=Ml,Op=Kn,kp=go,ks=">",_s="<",Ei="prototype",Oi="script",Fl=kp("IE_PROTO"),$a=function(){},Bl=function(e){return _s+Oi+ks+e+_s+"/"+Oi+ks},Rs=function(e){e.write(Bl("")),e.close();var t=e.parentWindow.Object;return e=null,t},_p=function(){var e=Op("iframe"),t="java"+Oi+":",r;return e.style.display="none",Ep.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Bl("document.F=Object")),r.close(),r.F},zr,vn=function(){try{zr=new ActiveXObject("htmlfile")}catch{}vn=typeof document<"u"?document.domain&&zr?Rs(zr):_p():Rs(zr);for(var e=Os.length;e--;)delete vn[Ei][Os[e]];return vn()};Pp[Fl]=!0;var Zn=Object.create||function(t,r){var n;return t!==null?($a[Ei]=Ip(t),n=new $a,$a[Ei]=null,n[Fl]=t):n=vn(),r===void 0?n:Tp.f(n,r)},Rp=te,Cp=Zn,Ap=Le.f,ki=Rp("unscopables"),_i=Array.prototype;_i[ki]===void 0&&Ap(_i,ki,{configurable:!0,value:Cp(null)});var jp=function(e){_i[ki][e]=!0},Cr={},Lp=G,Up=Z,Cs=Lp.WeakMap,Np=Up(Cs)&&/native code/.test(String(Cs)),pt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},xp=re,Dp=Le,Mp=pt,mt=xp?function(e,t,r){return Dp.f(e,t,Mp(1,r))}:function(e,t,r){return e[t]=r,e},Fp=Np,zl=G,Bp=we,zp=mt,Ia=ye,Ta=lo,Hp=go,Gp=po,As="Object already initialized",Ri=zl.TypeError,Kp=zl.WeakMap,Tn,Pr,Pn,Wp=function(e){return Pn(e)?Pr(e):Tn(e,{})},Vp=function(e){return function(t){var r;if(!Bp(t)||(r=Pr(t)).type!==e)throw new Ri("Incompatible receiver, "+e+" required");return r}};if(Fp||Ta.state){var Ce=Ta.state||(Ta.state=new Kp);Ce.get=Ce.get,Ce.has=Ce.has,Ce.set=Ce.set,Tn=function(e,t){if(Ce.has(e))throw new Ri(As);return t.facade=e,Ce.set(e,t),t},Pr=function(e){return Ce.get(e)||{}},Pn=function(e){return Ce.has(e)}}else{var wt=Hp("state");Gp[wt]=!0,Tn=function(e,t){if(Ia(e,wt))throw new Ri(As);return t.facade=e,zp(e,wt,t),t},Pr=function(e){return Ia(e,wt)?e[wt]:{}},Pn=function(e){return Ia(e,wt)}}var Zt={set:Tn,get:Pr,has:Pn,enforce:Wp,getterFor:Vp},yo={},wo={},Hl={}.propertyIsEnumerable,Gl=Object.getOwnPropertyDescriptor,Zp=Gl&&!Hl.call({1:2},1);wo.f=Zp?function(t){var r=Gl(this,t);return!!r&&r.enumerable}:Hl;var Jp=re,Yp=ne,Xp=wo,qp=pt,Qp=_r,em=Ul,tm=ye,rm=jl,js=Object.getOwnPropertyDescriptor;yo.f=Jp?js:function(t,r){if(t=Qp(t),r=em(r),rm)try{return js(t,r)}catch{}if(tm(t,r))return qp(!Yp(Xp.f,t,r),t[r])};var Kl={exports:{}},Ci=re,nm=ye,Wl=Function.prototype,am=Ci&&Object.getOwnPropertyDescriptor,bo=nm(Wl,"name"),im=bo&&(function(){}).name==="something",om=bo&&(!Ci||Ci&&am(Wl,"name").configurable),Vl={EXISTS:bo,PROPER:im,CONFIGURABLE:om},sm=H,cm=Z,Ai=lo,um=sm(Function.toString);cm(Ai.inspectSource)||(Ai.inspectSource=function(e){return um(e)});var So=Ai.inspectSource,$o=H,lm=ee,fm=Z,Hr=ye,ji=re,dm=Vl.CONFIGURABLE,hm=So,Zl=Zt,vm=Zl.enforce,pm=Zl.get,Ls=String,pn=Object.defineProperty,mm=$o("".slice),gm=$o("".replace),ym=$o([].join),wm=ji&&!lm(function(){return pn(function(){},"length",{value:8}).length!==8}),bm=String(String).split("String"),Sm=Kl.exports=function(e,t,r){mm(Ls(t),0,7)==="Symbol("&&(t="["+gm(Ls(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Hr(e,"name")||dm&&e.name!==t)&&(ji?pn(e,"name",{value:t,configurable:!0}):e.name=t),wm&&r&&Hr(r,"arity")&&e.length!==r.arity&&pn(e,"length",{value:r.arity});try{r&&Hr(r,"constructor")&&r.constructor?ji&&pn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=vm(e);return Hr(n,"source")||(n.source=ym(bm,typeof t=="string"?t:"")),e};Function.prototype.toString=Sm(function(){return fm(this)&&pm(this).source||hm(this)},"toString");var Jl=Kl.exports,$m=Z,Im=Le,Tm=Jl,Pm=uo,Se=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if($m(r)&&Tm(r,i,n),n.global)a?e[t]=r:Pm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Im.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Yl={},Em=xl,Om=mo,km=Om.concat("length","prototype");Yl.f=Object.getOwnPropertyNames||function(t){return Em(t,km)};var Io={};Io.f=Object.getOwnPropertySymbols;var _m=be,Rm=H,Cm=Yl,Am=Io,jm=_e,Lm=Rm([].concat),Um=_m("Reflect","ownKeys")||function(t){var r=Cm.f(jm(t)),n=Am.f;return n?Lm(r,n(t)):r},Us=ye,Nm=Um,xm=yo,Dm=Le,Xl=function(e,t,r){for(var n=Nm(t),a=Dm.f,i=xm.f,o=0;o<n.length;o++){var s=n[o];!Us(e,s)&&!(r&&Us(r,s))&&a(e,s,i(t,s))}},Mm=ee,Fm=Z,Bm=/#|\.prototype\./,Ar=function(e,t){var r=Hm[zm(e)];return r===Km?!0:r===Gm?!1:Fm(t)?Mm(t):!!t},zm=Ar.normalize=function(e){return String(e).replace(Bm,".").toLowerCase()},Hm=Ar.data={},Gm=Ar.NATIVE="N",Km=Ar.POLYFILL="P",ql=Ar,Gr=G,Wm=yo.f,Vm=mt,Zm=Se,Jm=uo,Ym=Xl,Xm=ql,X=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Gr:a?o=Gr[r]||Jm(r,{}):o=Gr[r]&&Gr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Wm(o,s),u=l&&l.value):u=o[s],i=Xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Ym(f,u)}(e.sham||u&&u.sham)&&Vm(f,"sham",!0),Zm(o,s,f,e)}},qm=ee,Qm=!qm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),eg=ye,tg=Z,rg=Gn,ng=go,ag=Qm,Ns=ng("IE_PROTO"),Li=Object,ig=Li.prototype,To=ag?Li.getPrototypeOf:function(e){var t=rg(e);if(eg(t,Ns))return t[Ns];var r=t.constructor;return tg(r)&&t instanceof r?r.prototype:t instanceof Li?ig:null},og=ee,sg=Z,cg=we,xs=To,ug=Se,lg=te,Ui=lg("iterator"),Ql=!1,ft,Pa,Ea;[].keys&&(Ea=[].keys(),"next"in Ea?(Pa=xs(xs(Ea)),Pa!==Object.prototype&&(ft=Pa)):Ql=!0);var fg=!cg(ft)||og(function(){var e={};return ft[Ui].call(e)!==e});fg&&(ft={});sg(ft[Ui])||ug(ft,Ui,function(){return this});var ef={IteratorPrototype:ft,BUGGY_SAFARI_ITERATORS:Ql},dg=Le.f,hg=ye,vg=te,Ds=vg("toStringTag"),Jt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hg(e,Ds)&&dg(e,Ds,{configurable:!0,value:t})},pg=ef.IteratorPrototype,mg=Zn,gg=pt,yg=Jt,wg=Cr,bg=function(){return this},tf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=mg(pg,{next:gg(+!n,r)}),yg(e,a,!1),wg[a]=bg,e},Sg=H,$g=Re,Ig=function(e,t,r){try{return Sg($g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Tg=we,Pg=function(e){return Tg(e)||e===null},Eg=Pg,Og=String,kg=TypeError,_g=function(e){if(Eg(e))return e;throw new kg("Can't set "+Og(e)+" as a prototype")},Rg=Ig,Cg=we,Ag=Hn,jg=_g,Po=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Rg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Ag(a),jg(i),Cg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Lg=X,Ug=ne,rf=Vl,Ng=Z,xg=tf,Ms=To,Fs=Po,Dg=Jt,Mg=mt,Oa=Se,Fg=te,Bg=Cr,nf=ef,zg=rf.PROPER,Hg=rf.CONFIGURABLE,Bs=nf.IteratorPrototype,Kr=nf.BUGGY_SAFARI_ITERATORS,rr=Fg("iterator"),zs="keys",nr="values",Hs="entries",Gg=function(){return this},af=function(e,t,r,n,a,i,o){xg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Kr&&T&&T in l)return l[T];switch(T){case zs:return function(){return new r(this,T)};case nr:return function(){return new r(this,T)};case Hs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[rr]||l["@@iterator"]||a&&l[a],d=!Kr&&c||s(a),h=t==="Array"&&l.entries||c,v,S,g;if(h&&(v=Ms(h.call(new e)),v!==Object.prototype&&v.next&&(Ms(v)!==Bs&&(Fs?Fs(v,Bs):Ng(v[rr])||Oa(v,rr,Gg)),Dg(v,u,!0))),zg&&a===nr&&c&&c.name!==nr&&(Hg?Mg(l,"name",nr):(f=!0,d=function(){return Ug(c,this)})),a)if(S={values:s(nr),keys:i?d:s(zs),entries:s(Hs)},o)for(g in S)(Kr||f||!(g in l))&&Oa(l,g,S[g]);else Lg({target:t,proto:!0,forced:Kr||f},S);return l[rr]!==d&&Oa(l,rr,d,{name:a}),Bg[t]=d,S},Eo=function(e,t){return{value:e,done:t}},Kg=_r,Oo=jp,Gs=Cr,of=Zt,Wg=Le.f,Vg=af,Wr=Eo,Zg=re,sf="Array Iterator",Jg=of.set,Yg=of.getterFor(sf),Xg=Vg(Array,"Array",function(e,t){Jg(this,{type:sf,target:Kg(e),index:0,kind:t})},function(){var e=Yg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Wr(void 0,!0);switch(e.kind){case"keys":return Wr(r,!1);case"values":return Wr(t[r],!1)}return Wr([r,t[r]],!1)},"values"),Ks=Gs.Arguments=Gs.Array;Oo("keys");Oo("values");Oo("entries");if(Zg&&Ks.name!=="values")try{Wg(Ks,"name",{value:"values"})}catch{}var qg=X,Qg=H,ey=Nl,ty=RangeError,Ws=String.fromCharCode,Vs=String.fromCodePoint,ry=Qg([].join),ny=!!Vs&&Vs.length!==1;qg({target:"String",stat:!0,arity:1,forced:ny},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],ey(i,1114111)!==i)throw new ty(i+" is not a valid code point");r[a]=i<65536?Ws(i):Ws(((i-=65536)>>10)+55296,i%1024+56320)}return ry(r,"")}});var Zs=G,ay=re,iy=Object.getOwnPropertyDescriptor,cf=function(e){if(!ay)return Zs[e];var t=iy(Zs,e);return t&&t.value},oy=ee,sy=te,cy=re,Js=Lh,uy=sy("iterator"),Jn=!oy(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Js&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Js||!cy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[uy]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Ys=Jl,ly=Le,Yn=function(e,t,r){return r.get&&Ys(r.get,t,{getter:!0}),r.set&&Ys(r.set,t,{setter:!0}),ly.f(e,t,r)},fy=Se,dy=function(e,t,r){for(var n in t)fy(e,n,t[n],r);return e},hy=Wn,vy=TypeError,ko=function(e,t){if(hy(t,e))return e;throw new vy("Incorrect invocation")},py=Bn,my=H,gy=function(e){if(py(e)==="Function")return my(e)},Xs=gy,yy=Re,wy=Fn,by=Xs(Xs.bind),Yt=function(e,t){return yy(e),t===void 0?e:wy?by(e,t):function(){return e.apply(t,arguments)}},Sy=te,$y=Sy("toStringTag"),uf={};uf[$y]="z";var _o=String(uf)==="[object z]",Iy=_o,Ty=Z,mn=Bn,Py=te,Ey=Py("toStringTag"),Oy=Object,ky=mn(function(){return arguments}())==="Arguments",_y=function(e,t){try{return e[t]}catch{}},jr=Iy?mn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=_y(t=Oy(e),Ey))=="string"?r:ky?mn(t):(n=mn(t))==="Object"&&Ty(t.callee)?"Arguments":n},Ry=jr,Cy=String,He=function(e){if(Ry(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Cy(e)},Ay=jr,qs=fo,jy=zn,Ly=Cr,Uy=te,Ny=Uy("iterator"),Xn=function(e){if(!jy(e))return qs(e,Ny)||qs(e,"@@iterator")||Ly[Ay(e)]},xy=ne,Dy=Re,My=_e,Fy=Vn,By=Xn,zy=TypeError,Ro=function(e,t){var r=arguments.length<2?By(e):t;if(Dy(r))return My(xy(r,e));throw new zy(Fy(e)+" is not iterable")},Hy=TypeError,gt=function(e,t){if(e<t)throw new Hy("Not enough arguments");return e},Gy=H,qn=Gy([].slice),Qs=qn,Ky=Math.floor,Ni=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Ky(r/2),s=Ni(Qs(e,0,o),t),u=Ni(Qs(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Wy=Ni,xi=X,lf=G,Co=cf,Vy=be,Vr=ne,Oe=H,pr=re,ff=Jn,df=Se,Zy=Yn,Jy=dy,Yy=Jt,Xy=tf,Ao=Zt,hf=ko,ka=Z,qy=ye,Qy=Yt,ew=jr,tw=_e,vf=we,ie=He,rw=Zn,ec=pt,tc=Ro,nw=Xn,Zr=Eo,bt=gt,aw=te,iw=Wy,ow=aw("iterator"),Xt="URLSearchParams",pf=Xt+"Iterator",mf=Ao.set,me=Ao.getterFor(Xt),sw=Ao.getterFor(pf),rc=Co("fetch"),En=Co("Request"),mr=Co("Headers"),_a=En&&En.prototype,nc=mr&&mr.prototype,cw=lf.TypeError,uw=lf.encodeURIComponent,lw=String.fromCharCode,fw=Vy("String","fromCodePoint"),dw=parseInt,gn=Oe("".charAt),ac=Oe([].join),Ve=Oe([].push),gf=Oe("".replace),hw=Oe([].shift),ic=Oe([].splice),oc=Oe("".split),yf=Oe("".slice),vw=Oe(/./.exec),pw=/\+/g,Ra="�",mw=/^[0-9a-f]+$/i,sc=function(e,t){var r=yf(e,t,t+2);return vw(mw,r)?dw(r,16):NaN},gw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},yw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},cc=function(e){e=gf(e,pw," ");for(var t=e.length,r="",n=0;n<t;){var a=gn(e,n);if(a==="%"){if(gn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=sc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=gw(i);if(o===0)a=lw(i);else{if(o===1||o>4){r+=Ra,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||gn(e,n)!=="%"));){var f=sc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Ve(s,f),n+=2,u++}if(s.length!==o){r+=Ra;continue}var l=yw(s);l===null?r+=Ra:a=fw(l)}}r+=a,n++}return r},ww=/[!'()~]|%20/g,bw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Sw=function(e){return bw[e]},uc=function(e){return gf(uw(e),ww,Sw)},Ca=Xy(function(t,r){mf(this,{type:pf,target:me(t).entries,index:0,kind:r})},Xt,function(){var t=sw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Zr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Zr(a.key,!1);case"values":return Zr(a.value,!1)}return Zr([a.key,a.value],!1)},!0),wf=function(e){this.entries=[],this.url=null,e!==void 0&&(vf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?gn(e,0)==="?"?yf(e,1):e:ie(e)))};wf.prototype={type:Xt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=nw(e),n,a,i,o,s,u,f;if(r)for(n=tc(e,r),a=n.next;!(i=Vr(a,n)).done;){if(o=tc(tw(i.value)),s=o.next,(u=Vr(s,o)).done||(f=Vr(s,o)).done||!Vr(s,o).done)throw new cw("Expected sequence with length 2");Ve(t,{key:ie(u.value),value:ie(f.value)})}else for(var l in e)qy(e,l)&&Ve(t,{key:l,value:ie(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=oc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=oc(a,"="),Ve(t,{key:cc(hw(i)),value:cc(ac(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ve(t,uc(n.key)+"="+uc(n.value));return ac(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Qn=function(){hf(this,Dt);var t=arguments.length>0?arguments[0]:void 0,r=mf(this,new wf(t));pr||(this.size=r.entries.length)},Dt=Qn.prototype;Jy(Dt,{append:function(t,r){var n=me(this);bt(arguments.length,2),Ve(n.entries,{key:ie(t),value:ie(r)}),pr||this.length++,n.updateURL()},delete:function(e){for(var t=me(this),r=bt(arguments.length,1),n=t.entries,a=ie(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(ic(n,s,1),o!==void 0)break}else s++}pr||(this.size=n.length),t.updateURL()},get:function(t){var r=me(this).entries;bt(arguments.length,1);for(var n=ie(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=me(this).entries;bt(arguments.length,1);for(var n=ie(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ve(a,r[i].value);return a},has:function(t){for(var r=me(this).entries,n=bt(arguments.length,1),a=ie(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=me(this);bt(arguments.length,1);for(var a=n.entries,i=!1,o=ie(t),s=ie(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?ic(a,u--,1):(i=!0,f.value=s));i||Ve(a,{key:o,value:s}),pr||(this.size=a.length),n.updateURL()},sort:function(){var t=me(this);iw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=me(this).entries,n=Qy(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new Ca(this,"keys")},values:function(){return new Ca(this,"values")},entries:function(){return new Ca(this,"entries")}},{enumerable:!0});df(Dt,ow,Dt.entries,{name:"entries"});df(Dt,"toString",function(){return me(this).serialize()},{enumerable:!0});pr&&Zy(Dt,"size",{get:function(){return me(this).entries.length},configurable:!0,enumerable:!0});Yy(Qn,Xt);xi({global:!0,constructor:!0,forced:!ff},{URLSearchParams:Qn});if(!ff&&ka(mr)){var $w=Oe(nc.has),Iw=Oe(nc.set),lc=function(e){if(vf(e)){var t=e.body,r;if(ew(t)===Xt)return r=e.headers?new mr(e.headers):new mr,$w(r,"content-type")||Iw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),rw(e,{body:ec(0,ie(t)),headers:ec(0,r)})}return e};if(ka(rc)&&xi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return rc(t,arguments.length>1?lc(arguments[1]):{})}}),ka(En)){var Aa=function(t){return hf(this,_a),new En(t,arguments.length>1?lc(arguments[1]):{})};_a.constructor=Aa,Aa.prototype=_a,xi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Aa})}}var Tw={URLSearchParams:Qn,getState:me},Pw=Se,ea=H,fc=He,Ew=gt,bf=URLSearchParams,ta=bf.prototype,Ow=ea(ta.append),dc=ea(ta.delete),kw=ea(ta.forEach),_w=ea([].push),jo=new bf("a=1&a=2&b=3");jo.delete("a",1);jo.delete("b",void 0);jo+""!="a=2"&&Pw(ta,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return dc(this,e);var n=[];kw(this,function(c,d){_w(n,{key:d,value:c})}),Ew(t,1);for(var a=fc(e),i=fc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,dc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Ow(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Rw=Se,Sf=H,Cw=He,Aw=gt,$f=URLSearchParams,Lo=$f.prototype,jw=Sf(Lo.getAll),Lw=Sf(Lo.has),hc=new $f("a=1");(hc.has("a",2)||!hc.has("a",void 0))&&Rw(Lo,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Lw(this,t);var a=jw(this,t);Aw(r,1);for(var i=Cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Uw=re,Nw=H,xw=Yn,Di=URLSearchParams.prototype,Dw=Nw(Di.forEach);Uw&&!("size"in Di)&&xw(Di,"size",{get:function(){var t=0;return Dw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Mw=G,Uo=Mw,Fw=Uo;Fw.URLSearchParams;var No=H,Bw=ho,zw=He,Hw=Hn,Gw=No("".charAt),vc=No("".charCodeAt),Kw=No("".slice),pc=function(e){return function(t,r){var n=zw(Hw(t)),a=Bw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=vc(n,a),o<55296||o>56319||a+1===i||(s=vc(n,a+1))<56320||s>57343?e?Gw(n,a):o:e?Kw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},If={codeAt:pc(!1),charAt:pc(!0)},Ww=If.charAt,Vw=He,Tf=Zt,Zw=af,mc=Eo,Pf="String Iterator",Jw=Tf.set,Yw=Tf.getterFor(Pf);Zw(String,"String",function(e){Jw(this,{type:Pf,string:Vw(e),index:0})},function(){var t=Yw(this),r=t.string,n=t.index,a;return n>=r.length?mc(void 0,!0):(a=Ww(r,n),t.index+=a.length,mc(a,!1))});var gc=re,Xw=H,qw=ne,Qw=ee,ja=Dl,eb=Io,tb=wo,rb=Gn,nb=Il,St=Object.assign,yc=Object.defineProperty,ab=Xw([].concat),ib=!St||Qw(function(){if(gc&&St({b:1},St(yc({},"a",{enumerable:!0,get:function(){yc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),St({},e)[r]!==7||ja(St({},t)).join("")!==n})?function(t,r){for(var n=rb(t),a=arguments.length,i=1,o=eb.f,s=tb.f;a>i;)for(var u=nb(arguments[i++]),f=o?ab(ja(u),o(u)):ja(u),l=f.length,c=0,d;l>c;)d=f[c++],(!gc||qw(s,u,d))&&(n[d]=u[d]);return n}:St,ob=ne,wc=_e,sb=fo,Ef=function(e,t,r){var n,a;wc(e);try{if(n=sb(e,"return"),!n){if(t==="throw")throw r;return r}n=ob(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return wc(n),r},cb=_e,ub=Ef,lb=function(e,t,r,n){try{return n?t(cb(r)[0],r[1]):t(r)}catch(a){ub(e,"throw",a)}},fb=te,db=Cr,hb=fb("iterator"),vb=Array.prototype,Of=function(e){return e!==void 0&&(db.Array===e||vb[hb]===e)},pb=H,mb=ee,kf=Z,gb=jr,yb=be,wb=So,_f=function(){},Rf=yb("Reflect","construct"),xo=/^\s*(?:class|function)\b/,bb=pb(xo.exec),Sb=!xo.test(_f),ar=function(t){if(!kf(t))return!1;try{return Rf(_f,[],t),!0}catch{return!1}},Cf=function(t){if(!kf(t))return!1;switch(gb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sb||!!bb(xo,wb(t))}catch{return!0}};Cf.sham=!0;var Af=!Rf||mb(function(){var e;return ar(ar.call)||!ar(Object)||!ar(function(){e=!0})||e})?Cf:ar,$b=re,Ib=Le,Tb=pt,Pb=function(e,t,r){$b?Ib.f(e,t,Tb(0,r)):e[t]=r},Eb=Yt,Ob=ne,kb=Gn,_b=lb,Rb=Of,Cb=Af,Ab=vo,bc=Pb,jb=Ro,Lb=Xn,Sc=Array,Ub=function(t){var r=kb(t),n=Cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Eb(i,a>2?arguments[2]:void 0));var s=Lb(r),u=0,f,l,c,d,h,v;if(s&&!(this===Sc&&Rb(s)))for(l=n?new this:[],d=jb(r,s),h=d.next;!(c=Ob(h,d)).done;u++)v=o?_b(d,i,[c.value,u],!0):c.value,bc(l,u,v);else for(f=Ab(r),l=n?new this(f):Sc(f);f>u;u++)v=o?i(r[u],u):r[u],bc(l,u,v);return l.length=u,l},yt=H,La=2147483647,gr=36,jf=1,Mi=26,Nb=38,xb=700,Db=72,Mb=128,Fb="-",Bb=/[^\0-\u007E]/,Lf=/[.\u3002\uFF0E\uFF61]/g,$c="Overflow: input needs wider integers to process",Ua=gr-jf,Ic=RangeError,zb=yt(Lf.exec),Rt=Math.floor,Na=String.fromCharCode,Tc=yt("".charCodeAt),Uf=yt([].join),Ze=yt([].push),Hb=yt("".replace),Gb=yt("".split),Kb=yt("".toLowerCase),Wb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Tc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Tc(e,r++);(i&64512)===56320?Ze(t,((a&1023)<<10)+(i&1023)+65536):(Ze(t,a),r--)}else Ze(t,a)}return t},Pc=function(e){return e+22+75*(e<26)},Vb=function(e,t,r){var n=0;for(e=r?Rt(e/xb):e>>1,e+=Rt(e/t);e>Ua*Mi>>1;)e=Rt(e/Ua),n+=gr;return Rt(n+(Ua+1)*e/(e+Nb))},Zb=function(e){var t=[];e=Wb(e);var r=e.length,n=Mb,a=0,i=Db,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Ze(t,Na(s));var u=t.length,f=u;for(u&&Ze(t,Fb);f<r;){var l=La;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Rt((La-a)/c))throw new Ic($c);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>La)throw new Ic($c);if(s===n){for(var d=a,h=gr;;){var v=h<=i?jf:h>=i+Mi?Mi:h-i;if(d<v)break;var S=d-v,g=gr-v;Ze(t,Na(Pc(v+S%g))),d=Rt(S/g),h+=gr}Ze(t,Na(Pc(d))),i=Vb(a,c,f===u),a=0,f++}}a++,n++}return Uf(t,"")},Jb=function(e){var t=[],r=Gb(Hb(Kb(e),Lf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ze(t,zb(Bb,a)?"xn--"+Zb(a):a);return Uf(t,".")},Yb=X,Do=re,Xb=Jn,Mo=G,Ec=Yt,$e=H,On=Se,he=Yn,qb=ko,Fi=ye,Fo=ib,$t=Ub,Ie=qn,Qb=If.codeAt,eS=Jb,De=He,tS=Jt,rS=gt,Nf=Tw,xf=Zt,nS=xf.set,kn=xf.getterFor("URL"),aS=Nf.URLSearchParams,iS=Nf.getState,ir=Mo.URL,Bi=Mo.TypeError,_n=Mo.parseInt,oS=Math.floor,Oc=Math.pow,ge=$e("".charAt),Ee=$e(/./.exec),fr=$e([].join),sS=$e(1 .toString),cS=$e([].pop),Et=$e([].push),xa=$e("".replace),uS=$e([].shift),lS=$e("".split),yr=$e("".slice),Rn=$e("".toLowerCase),fS=$e([].unshift),dS="Invalid authority",Da="Invalid scheme",et="Invalid host",kc="Invalid port",Df=/[a-z]/i,hS=/[\d+-.a-z]/i,zi=/\d/,vS=/^0x/i,pS=/^[0-7]+$/,mS=/^\d+$/,Mf=/^[\da-f]+$/i,gS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yS=/[\0\t\n\r #/:<>?@[\\\]^|]/,wS=/^[\u0000-\u0020]+/,bS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,SS=/[\t\n\r]/g,ve,$S=function(e){var t=lS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&ge(i,0)==="0"&&(o=Ee(vS,i)?16:8,i=yr(i,o===8?1:2)),i==="")s=0;else{if(!Ee(o===10?mS:o===8?pS:Mf,i))return e;s=_n(i,o)}Et(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Oc(256,5-r))return null}else if(s>255)return null;for(u=cS(n),a=0;a<n.length;a++)u+=n[a]*Oc(256,3-a);return u},IS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return ge(e,a)};if(d()===":"){if(ge(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ee(Mf,d());)i=i*16+_n(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ee(zi,d()))return;for(;Ee(zi,d());){if(f=_n(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},TS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},or=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)fS(t,e%256),e=oS(e/256);return fr(t,".")}if(typeof e=="object"){for(t="",n=TS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=sS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},yn={},Ff=Fo({},yn,{" ":1,'"':1,"<":1,">":1,"`":1}),Bf=Fo({},Ff,{"#":1,"?":1,"{":1,"}":1}),Ma=Fo({},Bf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ge=function(e,t){var r=Qb(e,0);return r>32&&r<127&&!Fi(t,e)?e:encodeURIComponent(e)},Jr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},dr=function(e,t){var r;return e.length===2&&Ee(Df,ge(e,0))&&((r=ge(e,1))===":"||!t&&r==="|")},_c=function(e){var t;return e.length>1&&dr(yr(e,0,2))&&(e.length===2||(t=ge(e,2))==="/"||t==="\\"||t==="?"||t==="#")},PS=function(e){return e==="."||Rn(e)==="%2e"},ES=function(e){return e=Rn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Fa={},Rc={},Ba={},Cc={},Ac={},za={},jc={},Lc={},Yr={},Xr={},Ha={},Ga={},Ka={},Wa={},Uc={},Va={},It={},Ae={},Nc={},tt={},xe={},Bo=function(e,t,r){var n=De(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Bi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Bo(r,!0)),i=this.parse(n,null,a),i)throw new Bi(i);o=iS(new aS),o.bindURL(this),this.searchParams=o}};Bo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Fa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=De(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=xa(e,wS,""),e=xa(e,bS,"$1")),e=xa(e,SS,""),l=$t(e);i<=l.length;){switch(c=l[i],a){case Fa:if(c&&Ee(Df,c))o+=Rn(c),a=Rc;else{if(t)return Da;a=Ba;continue}break;case Rc:if(c&&(Ee(hS,c)||c==="+"||c==="-"||c==="."))o+=Rn(c);else if(c===":"){if(t&&(n.isSpecial()!==Fi(Jr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Jr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Wa:n.isSpecial()&&r&&r.scheme===n.scheme?a=Cc:n.isSpecial()?a=Lc:l[i+1]==="/"?(a=Ac,i++):(n.cannotBeABaseURL=!0,Et(n.path,""),a=Nc)}else{if(t)return Da;o="",a=Ba,i=0;continue}break;case Ba:if(!r||r.cannotBeABaseURL&&c!=="#")return Da;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Ie(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=xe;break}a=r.scheme==="file"?Wa:za;continue;case Cc:if(c==="/"&&l[i+1]==="/")a=Yr,i++;else{a=za;continue}break;case Ac:if(c==="/"){a=Xr;break}else{a=Ae;continue}case za:if(n.scheme=r.scheme,c===ve)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=jc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query="",a=tt;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.query=r.query,n.fragment="",a=xe;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ie(r.path),n.path.length--,a=Ae;continue}break;case jc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Yr;else if(c==="/")a=Xr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ae;continue}break;case Lc:if(a=Yr,c!=="/"||ge(o,i+1)!=="/")continue;i++;break;case Yr:if(c!=="/"&&c!=="\\"){a=Xr;continue}break;case Xr:if(c==="@"){s&&(o="%40"+o),s=!0,d=$t(o);for(var v=0;v<d.length;v++){var S=d[v];if(S===":"&&!f){f=!0;continue}var g=Ge(S,Ma);f?n.password+=g:n.username+=g}o=""}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return dS;i-=$t(o).length+1,o="",a=Ha}else o+=c;break;case Ha:case Ga:if(t&&n.scheme==="file"){a=Va;continue}else if(c===":"&&!u){if(o==="")return et;if(h=n.parseHost(o),h)return h;if(o="",a=Ka,t===Ga)return}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return et;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=It,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ka:if(Ee(zi,c))o+=c;else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=_n(o,10);if(T>65535)return kc;n.port=n.isSpecial()&&T===Jr[n.scheme]?null:T,o=""}if(t)return;a=It;continue}else return kc;break;case Wa:if(n.scheme="file",c==="/"||c==="\\")a=Uc;else if(r&&r.scheme==="file")switch(c){case ve:n.host=r.host,n.path=Ie(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Ie(r.path),n.query="",a=tt;break;case"#":n.host=r.host,n.path=Ie(r.path),n.query=r.query,n.fragment="",a=xe;break;default:_c(fr(Ie(l,i),""))||(n.host=r.host,n.path=Ie(r.path),n.shortenPath()),a=Ae;continue}else{a=Ae;continue}break;case Uc:if(c==="/"||c==="\\"){a=Va;break}r&&r.scheme==="file"&&!_c(fr(Ie(l,i),""))&&(dr(r.path[0],!0)?Et(n.path,r.path[0]):n.host=r.host),a=Ae;continue;case Va:if(c===ve||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&dr(o))a=Ae;else if(o===""){if(n.host="",t)return;a=It}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=It}continue}else o+=c;break;case It:if(n.isSpecial()){if(a=Ae,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=tt;else if(!t&&c==="#")n.fragment="",a=xe;else if(c!==ve&&(a=Ae,c!=="/"))continue;break;case Ae:if(c===ve||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(ES(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,"")):PS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,""):(n.scheme==="file"&&!n.path.length&&dr(o)&&(n.host&&(n.host=""),o=ge(o,0)+":"),Et(n.path,o)),o="",n.scheme==="file"&&(c===ve||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)uS(n.path);c==="?"?(n.query="",a=tt):c==="#"&&(n.fragment="",a=xe)}else o+=Ge(c,Bf);break;case Nc:c==="?"?(n.query="",a=tt):c==="#"?(n.fragment="",a=xe):c!==ve&&(n.path[0]+=Ge(c,yn));break;case tt:!t&&c==="#"?(n.fragment="",a=xe):c!==ve&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ge(c,yn));break;case xe:c!==ve&&(n.fragment+=Ge(c,Ff));break}i++}},parseHost:function(e){var t,r,n;if(ge(e,0)==="["){if(ge(e,e.length-1)!=="]"||(t=IS(yr(e,1,-1)),!t))return et;this.host=t}else if(this.isSpecial()){if(e=eS(e),Ee(gS,e)||(t=$S(e),t===null))return et;this.host=t}else{if(Ee(yS,e))return et;for(t="",r=$t(e),n=0;n<r.length;n++)t+=Ge(r[n],yn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Fi(Jr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!dr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=or(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+fr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Bi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Mt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+or(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(De(e)+":",Fa)},getUsername:function(){return this.username},setUsername:function(e){var t=$t(De(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ge(t[r],Ma)}},getPassword:function(){return this.password},setPassword:function(e){var t=$t(De(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ge(t[r],Ma)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?or(e):or(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getHostname:function(){var e=this.host;return e===null?"":or(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ga)},getPort:function(){var e=this.port;return e===null?"":De(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=De(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+fr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,It))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=De(e),e===""?this.query=null:(ge(e,0)==="?"&&(e=yr(e,1)),this.query="",this.parse(e,tt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=De(e),e===""){this.fragment=null;return}ge(e,0)==="#"&&(e=yr(e,1)),this.fragment="",this.parse(e,xe)},update:function(){this.query=this.searchParams.serialize()||null}};var Mt=function(t){var r=qb(this,ae),n=rS(arguments.length,1)>1?arguments[1]:void 0,a=nS(r,new Bo(t,!1,n));Do||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ae=Mt.prototype,pe=function(e,t){return{get:function(){return kn(this)[e]()},set:t&&function(r){return kn(this)[t](r)},configurable:!0,enumerable:!0}};Do&&(he(ae,"href",pe("serialize","setHref")),he(ae,"origin",pe("getOrigin")),he(ae,"protocol",pe("getProtocol","setProtocol")),he(ae,"username",pe("getUsername","setUsername")),he(ae,"password",pe("getPassword","setPassword")),he(ae,"host",pe("getHost","setHost")),he(ae,"hostname",pe("getHostname","setHostname")),he(ae,"port",pe("getPort","setPort")),he(ae,"pathname",pe("getPathname","setPathname")),he(ae,"search",pe("getSearch","setSearch")),he(ae,"searchParams",pe("getSearchParams")),he(ae,"hash",pe("getHash","setHash")));On(ae,"toJSON",function(){return kn(this).serialize()},{enumerable:!0});On(ae,"toString",function(){return kn(this).serialize()},{enumerable:!0});if(ir){var xc=ir.createObjectURL,Dc=ir.revokeObjectURL;xc&&On(Mt,"createObjectURL",Ec(xc,ir)),Dc&&On(Mt,"revokeObjectURL",Ec(Dc,ir))}tS(Mt,"URL");Yb({global:!0,constructor:!0,forced:!Xb,sham:!Do},{URL:Mt});var OS=X,kS=be,zf=ee,_S=gt,Mc=He,RS=Jn,zo=kS("URL"),CS=RS&&zf(function(){zo.canParse()}),AS=zf(function(){return zo.canParse.length!==1});OS({target:"URL",stat:!0,forced:!CS||AS},{canParse:function(t){var r=_S(arguments.length,1),n=Mc(t),a=r<2||arguments[1]===void 0?void 0:Mc(arguments[1]);try{return!!new zo(n,a)}catch{return!1}}});var jS=X,LS=be,US=gt,Fc=He,NS=Jn,xS=LS("URL");jS({target:"URL",stat:!0,forced:!NS},{parse:function(t){var r=US(arguments.length,1),n=Fc(t),a=r<2||arguments[1]===void 0?void 0:Fc(arguments[1]);try{return new xS(n,a)}catch{return null}}});var DS=X,MS=ne;DS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return MS(URL.prototype.toString,this)}});var FS=Uo;FS.URL;var BS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zS=Kn,Za=zS("span").classList,Bc=Za&&Za.constructor&&Za.constructor.prototype,HS=Bc===Object.prototype?void 0:Bc,zc=G,Hf=BS,GS=HS,hr=Xg,Hc=mt,KS=Jt,WS=te,Ja=WS("iterator"),Ya=hr.values,Gf=function(e,t){if(e){if(e[Ja]!==Ya)try{Hc(e,Ja,Ya)}catch{e[Ja]=Ya}if(KS(e,t,!0),Hf[t]){for(var r in hr)if(e[r]!==hr[r])try{Hc(e,r,hr[r])}catch{e[r]=hr[r]}}}};for(var Xa in Hf)Gf(zc[Xa]&&zc[Xa].prototype,Xa);Gf(GS,"DOMTokenList");var VS=we,ZS=mt,JS=function(e,t){VS(t)&&"cause"in t&&ZS(e,"cause",t.cause)},YS=H,Kf=Error,XS=YS("".replace),qS=function(e){return String(new Kf(e).stack)}("zxcasd"),Wf=/\n\s*at [^:]*:[^\n]*/,QS=Wf.test(qS),e$=function(e,t){if(QS&&typeof e=="string"&&!Kf.prepareStackTrace)for(;t--;)e=XS(e,Wf,"");return e},t$=ee,r$=pt,n$=!t$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",r$(1,7)),e.stack!==7):!0}),a$=mt,i$=e$,o$=n$,Gc=Error.captureStackTrace,s$=function(e,t,r,n){o$&&(Gc?Gc(e,t):a$(e,"stack",i$(r,n)))},c$=Yt,u$=ne,l$=_e,f$=Vn,d$=Of,h$=vo,Kc=Wn,v$=Ro,p$=Xn,Wc=Ef,m$=TypeError,wn=function(e,t){this.stopped=e,this.result=t},Vc=wn.prototype,Lr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=c$(t,n),f,l,c,d,h,v,S,g=function(I){return f&&Wc(f,"normal",I),new wn(!0,I)},T=function(I){return a?(l$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=p$(e),!l)throw new m$(f$(e)+" is not iterable");if(d$(l)){for(c=0,d=h$(e);d>c;c++)if(h=T(e[c]),h&&Kc(Vc,h))return h;return new wn(!1)}f=v$(e,l)}for(v=i?e.next:f.next;!(S=u$(v,f)).done;){try{h=T(S.value)}catch(I){Wc(f,"throw",I)}if(typeof h=="object"&&h&&Kc(Vc,h))return h}return new wn(!1)},g$=He,y$=function(e,t){return e===void 0?arguments.length<2?"":t:g$(e)},w$=X,b$=Wn,S$=To,Cn=Po,$$=Xl,Vf=Zn,qa=mt,Qa=pt,I$=JS,T$=s$,P$=Lr,E$=y$,O$=te,k$=O$("toStringTag"),An=Error,_$=[].push,Ft=function(t,r){var n=b$(ei,this),a;Cn?a=Cn(new An,n?S$(this):ei):(a=n?this:Vf(ei),qa(a,k$,"Error")),r!==void 0&&qa(a,"message",E$(r)),T$(a,Ft,a.stack,1),arguments.length>2&&I$(a,arguments[2]);var i=[];return P$(t,_$,{that:i}),qa(a,"errors",i),a};Cn?Cn(Ft,An):$$(Ft,An,{name:!0});var ei=Ft.prototype=Vf(An.prototype,{constructor:Qa(1,Ft),message:Qa(1,""),name:Qa(1,"AggregateError")});w$({global:!0,constructor:!0,arity:2},{AggregateError:Ft});var R$=_o,C$=jr,A$=R$?{}.toString:function(){return"[object "+C$(this)+"]"},j$=_o,L$=Se,U$=A$;j$||L$(Object.prototype,"toString",U$,{unsafe:!0});var sr=G,N$=Rr,x$=Bn,qr=function(e){return N$.slice(0,e.length)===e},Zf=function(){return qr("Bun/")?"BUN":qr("Cloudflare-Workers")?"CLOUDFLARE":qr("Deno/")?"DENO":qr("Node.js/")?"NODE":sr.Bun&&typeof Bun.version=="string"?"BUN":sr.Deno&&typeof Deno.version=="object"?"DENO":x$(sr.process)==="process"?"NODE":sr.window&&sr.document?"BROWSER":"REST"}(),D$=Zf,Ho=D$==="NODE",M$=be,F$=Yn,B$=te,z$=re,Zc=B$("species"),H$=function(e){var t=M$(e);z$&&t&&!t[Zc]&&F$(t,Zc,{configurable:!0,get:function(){return this}})},G$=Af,K$=Vn,W$=TypeError,V$=function(e){if(G$(e))return e;throw new W$(K$(e)+" is not a constructor")},Jc=_e,Z$=V$,J$=zn,Y$=te,X$=Y$("species"),Jf=function(e,t){var r=Jc(e).constructor,n;return r===void 0||J$(n=Jc(r)[X$])?t:Z$(n)},q$=Fn,Yf=Function.prototype,Yc=Yf.apply,Xc=Yf.call,Xf=typeof Reflect=="object"&&Reflect.apply||(q$?Xc.bind(Yc):function(){return Xc.apply(Yc,arguments)}),Q$=Rr,qf=/(?:ipad|iphone|ipod).*applewebkit/i.test(Q$),le=G,eI=Xf,tI=Yt,qc=Z,rI=ye,Qf=ee,Qc=Ml,nI=qn,eu=Kn,aI=gt,iI=qf,oI=Ho,Hi=le.setImmediate,Gi=le.clearImmediate,sI=le.process,ti=le.Dispatch,cI=le.Function,tu=le.MessageChannel,uI=le.String,ri=0,wr={},ru="onreadystatechange",Er,rt,ni,ai;Qf(function(){Er=le.location});var Go=function(e){if(rI(wr,e)){var t=wr[e];delete wr[e],t()}},ii=function(e){return function(){Go(e)}},nu=function(e){Go(e.data)},au=function(e){le.postMessage(uI(e),Er.protocol+"//"+Er.host)};(!Hi||!Gi)&&(Hi=function(t){aI(arguments.length,1);var r=qc(t)?t:cI(t),n=nI(arguments,1);return wr[++ri]=function(){eI(r,void 0,n)},rt(ri),ri},Gi=function(t){delete wr[t]},oI?rt=function(e){sI.nextTick(ii(e))}:ti&&ti.now?rt=function(e){ti.now(ii(e))}:tu&&!iI?(ni=new tu,ai=ni.port2,ni.port1.onmessage=nu,rt=tI(ai.postMessage,ai)):le.addEventListener&&qc(le.postMessage)&&!le.importScripts&&Er&&Er.protocol!=="file:"&&!Qf(au)?(rt=au,le.addEventListener("message",nu,!1)):ru in eu("script")?rt=function(e){Qc.appendChild(eu("script"))[ru]=function(){Qc.removeChild(this),Go(e)}}:rt=function(e){setTimeout(ii(e),0)});var ed={set:Hi,clear:Gi},td=function(){this.head=null,this.tail=null};td.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var rd=td,lI=Rr,fI=/ipad|iphone|ipod/i.test(lI)&&typeof Pebble<"u",dI=Rr,hI=/web0s(?!.*chrome)/i.test(dI),Bt=G,vI=cf,iu=Yt,oi=ed.set,pI=rd,mI=qf,gI=fI,yI=hI,si=Ho,ou=Bt.MutationObserver||Bt.WebKitMutationObserver,su=Bt.document,cu=Bt.process,Qr=Bt.Promise,Ki=vI("queueMicrotask"),Tt,ci,ui,en,uu;if(!Ki){var tn=new pI,rn=function(){var e,t;for(si&&(e=cu.domain)&&e.exit();t=tn.get();)try{t()}catch(r){throw tn.head&&Tt(),r}e&&e.enter()};!mI&&!si&&!yI&&ou&&su?(ci=!0,ui=su.createTextNode(""),new ou(rn).observe(ui,{characterData:!0}),Tt=function(){ui.data=ci=!ci}):!gI&&Qr&&Qr.resolve?(en=Qr.resolve(void 0),en.constructor=Qr,uu=iu(en.then,en),Tt=function(){uu(rn)}):si?Tt=function(){cu.nextTick(rn)}:(oi=iu(oi,Bt),Tt=function(){oi(rn)}),Ki=function(e){tn.head||Tt(),tn.add(e)}}var wI=Ki,bI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},qt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},SI=G,Ur=SI.Promise,$I=G,br=Ur,II=Z,TI=ql,PI=So,EI=te,lu=Zf,li=kl;br&&br.prototype;var OI=EI("species"),Wi=!1,nd=II($I.PromiseRejectionEvent),kI=TI("Promise",function(){var e=PI(br),t=e!==String(br);if(!t&&li===66)return!0;if(!li||li<51||!/native code/.test(e)){var r=new br(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[OI]=n,Wi=r.then(function(){})instanceof n,!Wi)return!0}return!t&&(lu==="BROWSER"||lu==="DENO")&&!nd}),Nr={CONSTRUCTOR:kI,REJECTION_EVENT:nd,SUBCLASSING:Wi},Ue={},fu=Re,_I=TypeError,RI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new _I("Bad Promise constructor");t=n,r=a}),this.resolve=fu(t),this.reject=fu(r)};Ue.f=function(e){return new RI(e)};var CI=X,jn=Ho,Xe=G,zt=ne,du=Se,hu=Po,AI=Jt,jI=H$,LI=Re,bn=Z,UI=we,NI=ko,xI=Jf,ad=ed.set,Ko=wI,DI=bI,MI=qt,FI=rd,id=Zt,Ln=Ur,Wo=Nr,od=Ue,ra="Promise",sd=Wo.CONSTRUCTOR,BI=Wo.REJECTION_EVENT,zI=Wo.SUBCLASSING,fi=id.getterFor(ra),HI=id.set,Ot=Ln&&Ln.prototype,at=Ln,nn=Ot,cd=Xe.TypeError,Vi=Xe.document,Vo=Xe.process,Zi=od.f,GI=Zi,KI=!!(Vi&&Vi.createEvent&&Xe.dispatchEvent),ud="unhandledrejection",WI="rejectionhandled",vu=0,ld=1,VI=2,Zo=1,fd=2,an,pu,ZI,mu,dd=function(e){var t;return UI(e)&&bn(t=e.then)?t:!1},hd=function(e,t){var r=t.value,n=t.state===ld,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===fd&&YI(t),t.rejection=Zo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new cd("Promise-chain cycle")):(f=dd(u))?zt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},vd=function(e,t){e.notified||(e.notified=!0,Ko(function(){for(var r=e.reactions,n;n=r.get();)hd(n,e);e.notified=!1,t&&!e.rejection&&JI(e)}))},pd=function(e,t,r){var n,a;KI?(n=Vi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Xe.dispatchEvent(n)):n={promise:t,reason:r},!BI&&(a=Xe["on"+e])?a(n):e===ud&&DI("Unhandled promise rejection",r)},JI=function(e){zt(ad,Xe,function(){var t=e.facade,r=e.value,n=gu(e),a;if(n&&(a=MI(function(){jn?Vo.emit("unhandledRejection",r,t):pd(ud,t,r)}),e.rejection=jn||gu(e)?fd:Zo,a.error))throw a.value})},gu=function(e){return e.rejection!==Zo&&!e.parent},YI=function(e){zt(ad,Xe,function(){var t=e.facade;jn?Vo.emit("rejectionHandled",t):pd(WI,t,e.value)})},Ct=function(e,t,r){return function(n){e(t,n,r)}},Lt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=VI,vd(e,!0))},Ji=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new cd("Promise can't be resolved itself");var n=dd(t);n?Ko(function(){var a={done:!1};try{zt(n,t,Ct(Ji,a,e),Ct(Lt,a,e))}catch(i){Lt(a,i,e)}}):(e.value=t,e.state=ld,vd(e,!1))}catch(a){Lt({done:!1},a,e)}}};if(sd&&(at=function(t){NI(this,nn),LI(t),zt(an,this);var r=fi(this);try{t(Ct(Ji,r),Ct(Lt,r))}catch(n){Lt(r,n)}},nn=at.prototype,an=function(t){HI(this,{type:ra,done:!1,notified:!1,parent:!1,reactions:new FI,rejection:!1,state:vu,value:null})},an.prototype=du(nn,"then",function(t,r){var n=fi(this),a=Zi(xI(this,at));return n.parent=!0,a.ok=bn(t)?t:!0,a.fail=bn(r)&&r,a.domain=jn?Vo.domain:void 0,n.state===vu?n.reactions.add(a):Ko(function(){hd(a,n)}),a.promise}),pu=function(){var e=new an,t=fi(e);this.promise=e,this.resolve=Ct(Ji,t),this.reject=Ct(Lt,t)},od.f=Zi=function(e){return e===at||e===ZI?new pu(e):GI(e)},bn(Ln)&&Ot!==Object.prototype)){mu=Ot.then,zI||du(Ot,"then",function(t,r){var n=this;return new at(function(a,i){zt(mu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Ot.constructor}catch{}hu&&hu(Ot,nn)}CI({global:!0,constructor:!0,wrap:!0,forced:sd},{Promise:at});AI(at,ra,!1);jI(ra);var XI=te,md=XI("iterator"),gd=!1;try{var qI=0,yu={next:function(){return{done:!!qI++}},return:function(){gd=!0}};yu[md]=function(){return this},Array.from(yu,function(){throw 2})}catch{}var QI=function(e,t){try{if(!t&&!gd)return!1}catch{return!1}var r=!1;try{var n={};n[md]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},e0=Ur,t0=QI,r0=Nr.CONSTRUCTOR,na=r0||!t0(function(e){e0.all(e).then(void 0,function(){})}),n0=X,a0=ne,i0=Re,o0=Ue,s0=qt,c0=Lr,u0=na;n0({target:"Promise",stat:!0,forced:u0},{all:function(t){var r=this,n=o0.f(r),a=n.resolve,i=n.reject,o=s0(function(){var s=i0(r.resolve),u=[],f=0,l=1;c0(t,function(c){var d=f++,h=!1;l++,a0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var l0=X,f0=Nr.CONSTRUCTOR,Yi=Ur,d0=be,h0=Z,v0=Se,wu=Yi&&Yi.prototype;l0({target:"Promise",proto:!0,forced:f0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(h0(Yi)){var bu=d0("Promise").prototype.catch;wu.catch!==bu&&v0(wu,"catch",bu,{unsafe:!0})}var p0=X,m0=ne,g0=Re,y0=Ue,w0=qt,b0=Lr,S0=na;p0({target:"Promise",stat:!0,forced:S0},{race:function(t){var r=this,n=y0.f(r),a=n.reject,i=w0(function(){var o=g0(r.resolve);b0(t,function(s){m0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var $0=X,I0=Ue,T0=Nr.CONSTRUCTOR;$0({target:"Promise",stat:!0,forced:T0},{reject:function(t){var r=I0.f(this),n=r.reject;return n(t),r.promise}});var P0=_e,E0=we,O0=Ue,yd=function(e,t){if(P0(e),E0(t)&&t.constructor===e)return t;var r=O0.f(e),n=r.resolve;return n(t),r.promise},k0=X,_0=be,R0=Nr.CONSTRUCTOR,C0=yd;_0("Promise");k0({target:"Promise",stat:!0,forced:R0},{resolve:function(t){return C0(this,t)}});var A0=X,j0=ne,L0=Re,U0=Ue,N0=qt,x0=Lr,D0=na;A0({target:"Promise",stat:!0,forced:D0},{allSettled:function(t){var r=this,n=U0.f(r),a=n.resolve,i=n.reject,o=N0(function(){var s=L0(r.resolve),u=[],f=0,l=1;x0(t,function(c){var d=f++,h=!1;l++,j0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var M0=X,F0=ne,B0=Re,z0=be,H0=Ue,G0=qt,K0=Lr,W0=na,Su="No one promise resolved";M0({target:"Promise",stat:!0,forced:W0},{any:function(t){var r=this,n=z0("AggregateError"),a=H0.f(r),i=a.resolve,o=a.reject,s=G0(function(){var u=B0(r.resolve),f=[],l=0,c=1,d=!1;K0(t,function(h){var v=l++,S=!1;c++,F0(u,r,h).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[v]=g,--c||o(new n(f,Su)))})}),--c||o(new n(f,Su))});return s.error&&o(s.value),a.promise}});var V0=X,Z0=Ue;V0({target:"Promise",stat:!0},{withResolvers:function(){var t=Z0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var J0=X,Un=Ur,Y0=ee,wd=be,bd=Z,X0=Jf,$u=yd,q0=Se,Xi=Un&&Un.prototype,Q0=!!Un&&Y0(function(){Xi.finally.call({then:function(){}},function(){})});J0({target:"Promise",proto:!0,real:!0,forced:Q0},{finally:function(e){var t=X0(this,wd("Promise")),r=bd(e);return this.then(r?function(n){return $u(t,e()).then(function(){return n})}:e,r?function(n){return $u(t,e()).then(function(){throw n})}:e)}});if(bd(Un)){var Iu=wd("Promise").prototype.finally;Xi.finally!==Iu&&q0(Xi,"finally",Iu,{unsafe:!0})}var eT=Uo;eT.Promise;var tT=X,rT=G,nT=Xf,aT=qn,iT=Ue,oT=Re,Sd=qt,di=rT.Promise,Tu=!1,sT=!di||!di.try||Sd(function(){di.try(function(e){Tu=e===8},8)}).error||!Tu;tT({target:"Promise",stat:!0,forced:sT},{try:function(e){var t=arguments.length>1?aT(arguments,1):[],r=iT.f(this),n=Sd(function(){return nT(oT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function qe(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function je(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var it=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yo(e,t){return e(t={exports:{}},t.exports),t.exports}var nt=Yo(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Jo(nt);var cT=Jo(Yo(function(e,t){var r=it&&it.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,S){function g(w){try{I(h.next(w))}catch(p){S(p)}}function T(w){try{I(h.throw(w))}catch(p){S(p)}}function I(w){w.done?v(w.value):new d(function(p){p(w.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=it&&it.__generator||function(l,c){var d,h,v,S,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return S={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function T(I){return function(w){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch($){p=[6,$],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,w])}}},a=it;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(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=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,S,g,T,I,w;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(S))!==null&&(w=JSON.parse(I)).id===this.id&&w.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,nt.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(nt.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),nt.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(nt.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var w=50-(Date.now()-S);w>0?setTimeout(h,w):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(S=JSON.parse(v)).id!==this.id?[3,2]:[4,nt.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),nt.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],S=0;;){var g=h.keySync(S);if(g===null)break;v.push(g),S++}for(var T=!1,I=0;I<v.length;I++){var w=v[I];if(w.includes(i)){var p=h.getItemSync(w);if(p!==null){var $=JSON.parse(p);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(h.removeItemSync(w),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const uT={timeoutInSeconds:60},$d={name:"auth0-spa-js",version:"2.1.3"},Id=()=>Date.now();let ue=class qi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,qi.prototype)}static fromPayload({error:t,error_description:r}){return new qi(t,r)}},lT=class Td extends ue{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Td.prototype)}},Qi=class Pd extends ue{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Pd.prototype)}},fT=class Ed extends Qi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Ed.prototype)}},dT=class Od extends ue{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Od.prototype)}},hT=class kd extends ue{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,kd.prototype)}},_d=class Rd extends ue{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Pu(t,["default"])}', scope: '${Pu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Rd.prototype)}};function Pu(e,t=[]){return e&&!t.includes(e)?e:""}const Sn=()=>window.crypto,hi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Sn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Eu=e=>btoa(e),eo=e=>{var{clientId:t}=e,r=je(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Ou=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),vT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},pT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([vT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},mT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},gT=async(e,t,r,n,a,i,o=1e4)=>a?mT(e,t,r,n,o,a,i):pT(e,n,o);async function yT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=je(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?eo(u):JSON.stringify(u);return await async function(l,c,d,h,v,S,g){let T,I=null;for(let k=0;k<3;k++)try{T=await gT(l,d,h,v,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const w=T.json,{error:p,error_description:$}=w,O=je(w,["error","error_description"]),{ok:_}=T;if(!_){const k=$||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new hT(p,k,O.mfa_token):p==="missing_refresh_token"?new _d(d,h):new ue(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||$d))}},t,s)}const on=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let st=class to{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new to({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new to({scope:r,audience:n,clientId:a})}},wT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Cd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},bT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Id}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new st({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new st({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=st.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},ST=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const cr=e=>typeof e=="number",$T=["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"],IT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Ou(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],$T.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Ou(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!cr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!cr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!cr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&cr(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&cr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ct=Yo(function(e,t){var r=it&&it.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Jo(ct),ct.encode,ct.parse,ct.getAll;var TT=ct.get,Ad=ct.set,jd=ct.remove;const kt={get(e){const t=TT(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r)}},PT={get(e){return kt.get(e)||kt.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(`_legacy_${e}`,JSON.stringify(t),n),kt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r),kt.remove(e,t),kt.remove(`_legacy_${e}`,t)}},ET={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function OT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
2
+ `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var ku,_u,Ru,vi,kT=(ku="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",_u=null,Ru=!1,function(e){return vi=vi||OT(ku,_u,Ru),new Worker(vi,e)});const pi={};let _T=class{constructor(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(t),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(t){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(t),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(t){return`@@auth0spajs@@::${t}`}};const RT={memory:()=>new Cd().enclosedCache,localstorage:()=>new wT},Cu=e=>RT[e],Au=e=>{const{openUrl:t,onRedirect:r}=e,n=je(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},mi=new cT;let CT=class{constructor(t){let r,n;if(this.userCache=new Cd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await mi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!Sn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Sn().subtle===void 0)throw new Error(`
3
3
  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.
4
- `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!Ru(r))throw new Error(`Invalid cache location "${r}"`);n=Ru(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?kt:PT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:ET;var i;this.scope=on("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ST(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Id,this.cacheManager=new bT(n,n.allKeys?void 0:new _T(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new kT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||$d)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${eo(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return IT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=Pu(hi()),i=Pu(hi()),o=hi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await Sn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:on(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new dT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new fT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(ue.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ue("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Cu(t),{openUrl:a,fragment:i,appState:o}=n,s=je(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=je(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ue("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new lT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ue("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:on(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=pi[o];return s||(s=i().finally(()=>{delete pi[o],s=null}),pi[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=je(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>mi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Qi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await mi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:on(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},uT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new st({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=je(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${eo(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Cu(t),{openUrl:n}=r,a=je(r,["openUrl"]);t.clientId===null?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("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ue("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((v,S,g=60)=>new Promise((T,I)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const p=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",$,!1))};let $;const O=setTimeout(()=>{I(new Qi),p()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(ue.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",$,!1),setTimeout(p,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(w),w.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new ue("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new st({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new _d(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=je(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new st({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new st({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await yT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function AT(e){const t=new CT(e);return await t.checkSession(),t}var ke=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ke||{});const jT="sesamy.com",LT="sesamy.dev",UT="https://sesa.my",ro="sesamyCacheTimestamp";function Fe(e,t){return`https://${e}.${t==="dev"?LT:jT}`}let fe,Ld,Ud=!1;const Ht="sesamyAccessToken",gi="sesamyRefreshToken";async function xr(){return new Promise((r,n)=>{let a=0;const i=()=>{Ud?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function NT(e){if(!e)return null;const t=localStorage.getItem(gi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(gi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(gi,i.refresh_token),localStorage.setItem(Ht,i.access_token),i.access_token}catch{Nd()}}async function Yo(){const e=localStorage.getItem(Ht);if(!e)return null;const t=xd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await NT(t);if(r)return r;localStorage.removeItem(Ht)}return e}function Au(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function xT(e){if(e.enabled===!1)return;Ld=e.organization;const t={domain:Fe("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Au(window.location.href)!==Au(Fe("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),fe=await AT(t),window.location.search.includes("code="))try{await fe.handleRedirectCallback();const r=await fe.getUser();qe(ke.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Ud=!0}async function Or(){return await xr(),await Yo()?!0:fe?fe.isAuthenticated():!1}async function DT(){return await xr(),await Yo()?{sub:"local",name:"Local User"}:fe?fe.getUser():null}async function Xo(e){if(await xr(),localStorage.removeItem(Ht),!fe)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return fe.loginWithRedirect({...e,authorizationParams:{organization:Ld,redirect_uri:window.location.href,...t}})}async function ur(e=!0){await xr();const t=await Yo();if(t)return t;try{return fe?await fe.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Nd(e={}){if(await xr(),localStorage.removeItem(Ht),qe(ke.LOGOUT,{}),!!fe)return fe.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function xd(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Dd(e){const t=xd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Ht,e),qe(ke.AUTHENTICATED,t)}const MT=(e,t)=>t.skipDedupe||t.method!=="GET",FT=(e,t)=>t.method+"@"+e,BT=e=>e.clone(),ju=({skip:e=MT,key:t=FT,resolver:r=BT}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},zT=(e,t)=>e*t,HT=e=>e&&e.ok,Lu=({delayTimer:e=500,delayRamp:t=zT,maxAttempts:r=10,until:n=HT,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(S=>S?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var w,p;g(u((w=I&&I.url)!==null&&w!==void 0?w:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},GT="application/json",Md="Content-Type",Pt=Symbol(),Fd=Symbol();function Uu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Md.toLowerCase()))===null||t===void 0?void 0:t[1]}function Nu(e){return/^application\/.*json.*/.test(e)}const ut=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=ut(o,i,r):n[a]=i,n},{...e})},Gt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function KT(e,t=!1){Gt.options=t?e:ut(Gt.options,e)}function WT(e,t=!1){Gt.polyfills=t?e:ut(Gt.polyfills,e)}function VT(e){Gt.errorType=e}const ZT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Bd extends Error{}const JT=e=>{const t=Object.create(null);e=e._addons.reduce((w,p)=>p.beforeRequest&&p.beforeRequest(w,e._options,t)||w,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ut(a.options,n);let c=r;const d=ZT(s)((w,p)=>(c=w,a.polyfill("fetch")(w,p)))(r,l),h=new Error,v=d.catch(w=>{throw{[Pt]:w}}).then(w=>{var p;if(!w.ok){const $=new Bd;if($.cause=h,$.stack=$.stack+`
5
- CAUSE: `+h.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw $;const O=a.errorType==="json"||((p=w.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?w.text():w[a.errorType]():Promise.resolve(w.body)).then(k=>{throw $.message=typeof k=="string"?k:w.statusText,k&&(O&&typeof k=="string"?($.text=k,$.json=JSON.parse(k)):$[a.errorType]=k),$})}return w}),S=w=>w.catch(p=>{const $=Object.prototype.hasOwnProperty.call(p,Pt),O=$?p[Pt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||$&&f.has(Pt)&&f.get(Pt);if(_)return _(O,e);const k=f.get(Fd);if(k)return k(O,e);throw O}),g=w=>p=>S(w?v.then($=>$&&$[w]()).then($=>p?p($):$):v.then($=>p?p($):$)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(w,p){return f.set(w,p),this},badRequest(w){return this.error(400,w)},unauthorized(w){return this.error(401,w)},forbidden(w){return this.error(403,w)},notFound(w){return this.error(404,w)},timeout(w){return this.error(408,w)},internalError(w){return this.error(500,w)},fetchError(w){return this.error(Pt,w)}},I=u.reduce((w,p)=>({...w,...typeof p.resolver=="function"?p.resolver(w):p.resolver}),T);return o.reduce((w,p)=>p(w,e),I)},YT={_url:"",_options:{},_config:Gt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:ut(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:ut(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:ut(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Md]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Fd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Uu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Nu(a));return n=r?o?n.json(r,a):n.body(r):n,JT(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Uu(this._options.headers);return this.content(t||Nu(r)&&r||GT).body(JSON.stringify(e))}};function ze(e="",t={}){return{...YT,_url:e,_options:t}}ze.default=ze;ze.options=KT;ze.errorType=VT;ze.polyfills=WT;ze.WretchError=Bd;function Te(){sessionStorage.removeItem(ro),qe(ke.CLEAR_CACHE,{})}function xu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function XT(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function qT(e,t){if(XT(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function QT(e,t){const r=new URL(`${Fe("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=qT(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("itemSrc",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const zd="sesamySignedURLs";function qo(){const e=sessionStorage.getItem(zd);return e?JSON.parse(e):[]}function eP(e){const t=qo();t.push(e),sessionStorage.setItem(zd,JSON.stringify(t))}function tP(e){const t=Fe("api2",e.environment),r=y=>async(P,j)=>{let V=sessionStorage.getItem(ro);V||(V=Date.now().toString(),sessionStorage.setItem(ro,V));const oe={...j,headers:{...j.headers,"Cache-Timestamp":V}};return y(P,oe)},n=(y=!0)=>P=>async(j,V)=>{let oe=null;if(oe=await ur(y),!oe){if(y)throw new Error("No access token available");return P(j,V)}const Qe={...V,headers:{...V.headers,...oe?{Authorization:`Bearer ${oe}`}:{}}};return P(j,Qe)},a=y=>(P,j)=>{if(j.headers.Authorization)return y(P,j);const V=localStorage.getItem("__anon_id"),oe=btoa(`${V}:`),Qe={...j,headers:{...j.headers,Authorization:`Basic ${oe}`}};return y(P,Qe)},i=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),ju(),Lu({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]),o=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,ju(),Lu({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]);async function s(y={}){const{waitForEntitlementAfter:P,includeSignedLinks:j=!0}=y,V=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",oe=await Or()?await i.get(`/entitlements${V}`).json():[];return j&&oe.push(...qo()),oe}async function u(y){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(j=>j.id===y)}async function f(y){return i.get(`/entitlements/${encodeURIComponent(y)}/access`).json()}async function l(y){return await Or()?await i.get(`/fulfillments?sku=${encodeURIComponent(y)}`).json():[]}async function c(){return i.get("/contracts").json()}async function d(y){const P=await i.get("/contracts").json();return P==null?void 0:P.find(j=>j.id===y)}async function h(y){return(await i.post({},`/contracts/${encodeURIComponent(y)}/cancel`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function S(){return i.get("/bills").json()}async function g(y){const P=await i.get("/bills").json();return P==null?void 0:P.find(j=>j.id===y)}async function T(){return i.get("/transactions").json()}async function I(y){const P=await i.get("/transactions").json();return P==null?void 0:P.find(j=>j.id===y)}async function w(y,P){const j=await i.url(`/user-metadata/${encodeURIComponent(y)}`).put(P).json();return qe(ke.USER_ATTRIBUTE_CHANGED,{}),Te(),j}async function p(y){const P=await i.url(`/user-metadata/${encodeURIComponent(y)}`).delete().res();return Te(),P.ok}async function $(y){return(await i.url(`/user-metadata/${encodeURIComponent(y)}`).get().json())[y]}async function O(){return await i.url("/user-metadata").get().json()}async function _(){return await i.url("/tags").get().json()}async function k(y){const P=await i.url(`/tags/${encodeURIComponent(y)}`).delete().res();return Te(),P.ok}async function M(y){const P=await i.url("/tags").post(encodeURIComponent(y)).res();return qe(ke.USER_ATTRIBUTE_CHANGED,{}),Te(),P.ok}async function F(y){return(await o.url("/tallies").get().json())[y]}async function J(){return await o.url("/tallies").get().json()}async function L(y){const P=await o.url(`/tallies/${y}`).delete().res();return Te(),P.ok}async function x(y,P){return await o.url(`/tallies/${encodeURIComponent(y)}/push`).post(P).json()}async function z(y){return await i.url(`/products/${encodeURIComponent(y)}`).get().json()}async function R(){return await ur(!1)?await i.url("/profile").get().json():null}async function K(y){const P=await i.url("/profile").patch(y).res();return Te(),P.ok}async function q(){return await i.url("/payment-issues").get().json()}async function Ne(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function m(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function b(y){const P=await ur(!1);if(!P)throw new Error("No access token available");const j=new URL(`${Fe("spotify-oas",e.environment)}/sesamy-callback`);j.searchParams.set("access_token",P),j.searchParams.set("state",y),window.location.href=j.toString()}async function E(y){const P=await i.url(`/products/${encodeURIComponent(y)}/auto-onboard`).post().json();return P.length&&Te(),P}async function U(y,P=3600){const{shortlink:j}=await ze(UT).post({url:y,ttl:P}).json();return j}async function N(y){const P=await ur(!1);let j;const V=y.language||xu();switch(y.target){case"account":j=new URL(`${Fe("account",e.environment)}/${encodeURIComponent(y.language||V)}/subscriptions/${encodeURIComponent(e.clientId)}`),j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"consume":j=new URL(`${Fe("consume",e.environment)}/${encodeURIComponent(y.language||V)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(y.sku)}`),y.episodeId?j.href+=`/${y.episodeId}`:j.href+="/listen",j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"checkout":j=QT(e,{language:V,...y});break;default:throw new Error("Invalid target")}return P&&(j.hash=`#access_token=${P}`),y.shorten?U(j.href,y.ttl):j.href}async function D(y){return(await o.url("/checkouts").post({language:xu(),...y,vendorId:e.clientId})).json()}async function Y(y,P){return(await o.url(`/checkouts/${y}`).patch(P)).json()}async function B(y){return(await o.url(`/checkouts/${y}`).get()).json()}async function W(){const y=await ur(!1),P=new URL(`${Fe("account",e.environment)}/subscriptions/${e.clientId}`);y&&(P.hash=`#access_token=${y}`),window.location.href=P.toString()}return{createCheckout:D,updateCheckout:Y,getCheckout:B,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getFulfillments:l,getContracts:c,getContract:d,cancelContract:h,getProfile:R,updateProfile:K,getSubscriptions:v,getBills:S,getBill:g,setUserMetadata:w,deleteUserMetadata:p,getUserMetadata:$,listUserMetadata:O,getTags:_,deleteTag:k,setTag:M,getTally:F,getTallies:J,deleteTally:L,pushTally:x,getTransactions:T,getTransaction:I,getProduct:z,getPaymentIssues:q,autoOnboardProduct:E,isSpotifyLinked:Ne,unlinkSpotify:m,linkSpotify:b,generateLink:N,openHostedAccountPage:W}}const Hd="@sesamy/sesamy-js",Qo="1.19.1";function Du(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var sn="undefined",Mu="object",no=function(){},Gd="any",Kd="*",dt="__",Nn=typeof process<"u"?process:{};Nn.env&&Nn.env.NODE_ENV;var Q=typeof document<"u";Nn.versions!=null&&Nn.versions.node!=null;typeof Deno<"u"&&Deno.core;Q&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Wd(e,t){return t.charAt(0)[e]()+t.slice(1)}var rP=Wd.bind(null,"toUpperCase"),nP=Wd.bind(null,"toLowerCase");function aP(e){return Vd(e)?rP("null"):typeof e=="object"?cP(e):Object.prototype.toString.call(e).slice(8,-1)}function xn(e,t){t===void 0&&(t=!0);var r=aP(e);return t?nP(r):r}function Dr(e,t){return typeof t===e}var ce=Dr.bind(null,"function"),Je=Dr.bind(null,"string"),At=Dr.bind(null,"undefined"),iP=Dr.bind(null,"boolean");Dr.bind(null,"symbol");function Vd(e){return e===null}function oP(e){return xn(e)==="number"&&!isNaN(e)}function Zd(e){return xn(e)==="array"}function se(e){if(!sP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function sP(e){return e&&(typeof e=="object"||e!==null)}function cP(e){return ce(e.constructor)?e.constructor.name:null}function uP(e){return e instanceof Error||Je(e.message)&&e.constructor&&oP(e.constructor.stackTraceLimit)}function Jd(e,t){if(typeof t!="object"||Vd(t))return!1;if(t instanceof e)return!0;var r=xn(new e(""));if(uP(t))for(;t;){if(xn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Jd.bind(null,TypeError);Jd.bind(null,SyntaxError);function aa(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?lP(e,t):r}function lP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ia(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ia(aa,"form");ia(aa,"button");ia(aa,"input");ia(aa,"select");function fP(e){return e?Zd(e)?e:[e]:[]}function Fu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function dP(){if(Q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function hP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Fu(r[1]),o=Fu(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(pP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return Q&&window.location.search.substring(1)}())}function pP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function oa(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function mP(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var Sr="global",Kt=dt+"global"+dt,Wt=typeof self===Mu&&self.self===self&&self||typeof global===Mu&&global.global===global&&global||void 0;function ht(e){return Wt[Kt][e]}function vt(e,t){return Wt[Kt][e]=t}function Qt(e){delete Wt[Kt][e]}function er(e,t,r){var n;try{if(es(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Wt[Kt]||(Wt[Kt]={});var cn={};function es(e){if(typeof cn[e]!==sn)return cn[e];try{var t=window[e];t.setItem(sn,sn),t.removeItem(sn)}catch{return cn[e]=!1}return cn[e]=!0}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}var We="function",Be="undefined",gP="@@redux/"+Math.random().toString(36),Bu=function(){return typeof Symbol===We&&Symbol.observable||"@@observable"}(),un=" != "+We;function Yd(e,t,r){var n;if(typeof t===We&&typeof r===Be&&(r=t,t=void 0),typeof r!==Be){if(typeof r!==We)throw new Error("enhancer"+un);return r(Yd)(e,t)}if(typeof e!==We)throw new Error("reducer"+un);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==We)throw new Error("Listener"+un);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var S=s.indexOf(h);s.splice(S,1)}}}function d(h){if(!se(h))throw new Error("Act != obj");if(typeof h.type===Be)throw new Error("ActType "+Be);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,S=0;S<v.length;S++)(0,v[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==We)throw new Error("next reducer"+un);a=h,d({type:"@@redux/INIT"})}})[Bu]=function(){var h,v=c;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:v(g)}}})[Bu]=function(){return this},h},n}function yP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Be}function Vt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function wP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),A({},o,{dispatch:s=Vt.apply(void 0,i)(o.dispatch)})}}}var Ye=dt+"anon_id",lt=dt+"user_id",Ut=dt+"user_traits",Ke="userId",jt="anonymousId",$n=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ao=["name","EVENTS","config","loaded"],C=$n.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),zu=/^utm_/,Hu=/^an_prop_/,Gu=/^an_trait_/;function bP(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===C.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ye,o.anonymousId),f||t(lt,o.userId),u.traits&&t(Ut,A({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,h=l.reduce(function(v,S){if(S.match(zu)||S.match(/^(d|g)clid/)){var g=S.replace(zu,"");v.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Hu)&&(v.props[S.replace(Hu,"")]=i[S]),S.match(Gu)&&(v.traits[S.replace(Gu,"")]=i[S]),v},{campaign:{},props:{},traits:{}});r.dispatch(A({type:C.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:C.campaign,campaign:h.campaign})}}return n(a)}}}}function SP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===C.setItemEnd){if(r.key===Ye)return A({},t,{anonymousId:r.value});if(r.key===lt)return A({},t,{userId:r.value})}switch(r.type){case C.identify:return Object.assign({},t,{userId:r.userId,traits:A({},t.traits,r.traits)});case C.reset:return[lt,Ye,Ut].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Ku(e){return{userId:e.getItem(lt),anonymousId:e.getItem(Ye),traits:e.getItem(Ut)}}var io=function(e){return dt+"TEMP"+dt+e};function $P(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===C.reset&&([lt,Ut,Ye].forEach(function(h){n(h)}),[Ke,jt,"traits"].forEach(function(h){Qt(io(h))})),s.type===C.identify){a(Ye)||r(Ye,oa());var c=a(lt),d=a(Ut)||{};c&&c!==u&&i.dispatch({type:C.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(lt,u),f&&r(Ut,A({},d,f))}return o(s)}}}}var vr={};function Wu(e,t){vr[e]&&ce(vr[e])&&(vr[e](t),delete vr[e])}function Xd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(A({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Xd(e,t,r-10).then(n,a)})})}function IP(e){return{abort:e}}function qd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,S=a[h][v];if(S&&ce(S)){var g,T=function(p,$){return p===void 0&&(p={}),$===void 0&&($={}),[Ke,jt].reduce(function(O,_){return p.hasOwnProperty(_)&&$[_]&&$[_]!==p[_]&&(O[_]=$[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[h].config,instance:r,abort:IP}))&&se(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var w=v+":"+h;e.dispatch(A({},T,{type:w,_:{called:w,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var yi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Nt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,w,p){var $=w.config,O=w.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Nt)?function(M,F,J,L,x){return function(z,R){var K=L?L.name:M,q=R&&kr(R)?R:J;if(L&&(!(q=R&&kr(R)?R:[M]).includes(M)||q.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(q)+" input valid");return A({},x,{abort:{reason:z,plugins:q,caller:F,_:K}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:TP(I),instance:g,config:$||{},abort:k}}}(n,h),S=t.exact.reduce(function(g,T){var I=T.pluginName,w=T.methodName,p=!1;return w.match(/^initialize/)||w.match(/^reset/)||(p=!f[I].loaded),l.offline&&w.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var w=T.pluginName;return Promise.resolve(g).then(function(p){function $(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[w])return Promise.resolve(t.namespaced[w].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ce(k.method)?(function(z,R){var K=Qu(z);if(K&&K.name===R){var q=Qu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(q?"or "+q.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
- `))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(J=F,L=w,x=k.pluginName,function(z,R){return A({},J,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Ju(k.pluginName,f,i),plugins:f})).then(function(z){var R=se(z)?z:{};return Promise.resolve(A({},F,R))})):F;var J,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[w]=_});p[w]=r}();return O&&O.then?O.then($):$()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,w){try{var p=t.exact.length===w+1,$=I.pluginName,O=i[$];return Promise.resolve(T).then(function(_){var k=g[$]?g[$]:{};if(d&&(k=_),bi(k,$))return wi({data:k,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(bi(_,$))return p&&wi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[$],i[$]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:Ju($,f,i),plugins:f})).then(function(F){var J=se(F)?F:{},L=A({},_,J),x=g[$];if(bi(x,$))wi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Vu)&&!c.match(Zu)&&n.dispatch(A({},d?L:k,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Nt)||c.match(/^registerPlugin/)||c.match(Zu)||c.match(Vu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=A({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});Qd(T,t.exact.length)&&!c.match(/End$/)&&(I=A({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Nt=/Start$/,Vu=/^bootstrap/,Zu=/^ready/;function wi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(A({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Ju(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Yu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Xu(e,t){var r=e.replace(Nt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function bi(e,t){var r=e.abort;return!!r&&(r===!0||qu(r,t)||r&&qu(r.plugins,t))}function Qd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Je(r))return!0;var n=r.plugins;return kr(r)&&r.length===t||kr(n)&&n.length===t}function kr(e){return Array.isArray(e)}function qu(e,t){return!(!e||!kr(e))&&e.includes(t)}function Qu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function TP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=se(e[r])?Object.assign({},e[r]):e[r]),t},{})}function PP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===C.enablePlugin&&a.dispatch({type:C.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===C.disablePlugin&&setTimeout(function(){return Wu(o.meta.rid,{payload:o})},0),f===C.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),S=[],g=[],T=o.disabled,I=v.map(function(p){var $=p.loaded,O=p.name,_=p.config;return Xd(p,function(){return $({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:C.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!ao.includes(M)})}),n[O]=!0),S=S.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(A({},{type:C.ready},$))},0)})}var w=function(){if(f!==C.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return qd(a,t,e)},0),Promise.resolve(function(p,$,O,_,k){try{var M=ce($)?$():$,F=p.type,J=F.replace(Nt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(K=M,(q=L.plugins)===void 0&&(q={}),(Ne=p.options)===void 0&&(Ne={}),Object.keys(K).filter(function(m){var b=Ne.plugins||{};return iP(b[m])?b[m]:b.all!==!1&&(!q[m]||q[m].enabled!==!1)}).map(function(m){return K[m]}));F===C.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var b=L.plugins[m];return p.plugins.includes(m)&&!b.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,b,E){var U=Xu(m).map(function(N){return Yu(N,b)});return b.reduce(function(N,D){var Y=D.name,B=Xu(m,Y).map(function(j){return Yu(j,b)}),W=B[0],y=B[1],P=B[2];return W.length&&(N.beforeNS[Y]=W),y.length&&(N.duringNS[Y]=y),P.length&&(N.afterNS[Y]=P),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(yi({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function b(){var N=function(){if(F.match(Nt))return Promise.resolve(yi({action:A({},E,{type:J+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(D){D.meta&&D.meta.hasCallback&&Wu(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(Qd(m,z.length))return m;var E,U=function(){if(F!==J)return Promise.resolve(yi({action:A({},m,{type:J}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(b):b()})}catch(m){return Promise.reject(m)}var K,q,Ne}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(w&&w.then?w.then(u):u(w))}catch(p){return Promise.reject(p)}}}}}function EP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===C.setItem||a===C.removeItem){if(n.abort)return r(n);a===C.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var OP=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Vt.apply(void 0,o)(n)(a)}}}}};function kP(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=el(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},A({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=el(r.type,C.initialize),f=e()[u];return f&&u?(n[u]=A({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),A({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=A({},t[r.name],{loaded:!0}),A({},t,n);switch(r.type){case C.disablePlugin:return A({},t,tl(r.plugins,!1,t));case C.enablePlugin:return A({},t,tl(r.plugins,!0,t));default:return t}}}function el(e,t){return e.substring(t.length+1,e.length)}function tl(e,t,r){return e.reduce(function(n,a){return n[a]=A({},r[a],{enabled:t}),n},r)}function eh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var _P={last:{},history:[]};function RP(e,t){e===void 0&&(e=_P);var r=t.options,n=t.meta;if(t.type===C.track){var a=eh(A({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return A({},e,{last:a,history:e.history.concat(a)})}return e}var CP={actions:[]};function AP(e,t){e===void 0&&(e=CP);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===C.identify?[t].concat(e.actions):e.actions.concat(t),A({},e,{actions:n});case"dequeue":return[];default:return e}}var th=/#.*$/;function jP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(th,""):"")}var rh,nh,ah,ih,LP=function(e){if(e===void 0&&(e={}),!Q)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(Q){for(var v,S=document.getElementsByTagName("link"),g=0;v=S[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(th,"")}(f),c={title:r,url:l,path:jP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),A({},c,e)},UP={last:{},history:[]};function NP(e,t){e===void 0&&(e=UP);var r=t.options;if(t.type===C.page){var n=eh(A({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return A({},e,{last:n,history:e.history.concat(n)})}return e}rh=function(){if(!Q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),nh=Q?document.referrer:null,ah=dP(),ih=hP();var rl={initialized:!1,sessionId:oa(),app:null,version:null,debug:!1,offline:!!Q&&!navigator.onLine,os:{name:rh},userAgent:Q?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:ih,locale:ah,campaign:{},referrer:nh};function xP(e,t){e===void 0&&(e=rl);var r=e.initialized,n=t.campaign;switch(t.type){case C.campaign:return A({},e,{campaign:n});case C.offline:return A({},e,{offline:!0});case C.online:return A({},e,{offline:!1});default:return r?e:A({},rl,e,{initialized:!0})}}var DP=["plugins","reducers","storage"];function MP(e,t,r){if(Q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function FP(e){var t=MP.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function oh(){return vt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Wt[Kt].analytics.push(o.action||o),i(o)}})}}}function nl(e){return function(){return Vt(Vt.apply(null,arguments),oh())}}function Si(e){return e?Zd(e)?e:[e]:[]}function al(e,t,r){e===void 0&&(e={});var n,a,i=oa();return t&&(vr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ce(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),A({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function BP(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,b){if(ce(b))return m.middlewares=m.middlewares.concat(b),m;if(b.NAMESPACE&&(b.name=b.NAMESPACE),!b.name)throw new Error("https://lytics.dev/errors/1");b.config||(b.config={});var E=b.EVENTS?Object.keys(b.EVENTS).map(function(D){return b.EVENTS[D]}):[];m.pluginEnabled[b.name]=!(b.enabled===!1||b.config.enabled===!1),delete b.enabled,b.methods&&(m.methods[b.name]=Object.keys(b.methods).reduce(function(D,Y){var B;return D[Y]=(B=b.methods[Y],function(){for(var W=Array.prototype.slice.call(arguments),y=new Array(B.length),P=0;P<W.length;P++)y[P]=W[P];return y[y.length]=$,B.apply({instance:$},y)}),D},{}),delete b.methods);var U=Object.keys(b).concat(E),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(b),m.plugins[b.name])throw new Error(b.name+"AlreadyLoaded");return m.plugins[b.name]=b,m.plugins[b.name].loaded||(m.plugins[b.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ht,setItem:vt,removeItem:Qt},i=function(m){return function(b,E,U){return E.getState("user")[b]||(U&&se(U)&&U[b]?U[b]:Ku(m)[b]||ht(io(b))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!ao.includes(m)}).sort(),u=new Set(s.concat($n).filter(function(m){return!ao.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new OP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=vP(),T=Ku(a),I=A({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=oa());var w=A({enable:function(m,b){return new Promise(function(E){R.dispatch({type:C.enablePlugin,plugins:Si(m),_:{originalAction:C.enablePlugin}},E,[b])})},disable:function(m,b){return new Promise(function(E){R.dispatch({type:C.disablePlugin,plugins:Si(m),_:{originalAction:C.disablePlugin}},E,[b])})}},n.methods),p=!1,$={identify:function(m,b,E,U){try{var N=Je(m)?m:null,D=se(m)?m:b,Y=E||{},B=$.user();vt(io(Ke),N);var W=N||D.userId||i(Ke,$,D);return Promise.resolve(new Promise(function(y){R.dispatch(A({type:C.identifyStart,userId:W,traits:D||{},options:Y,anonymousId:B.anonymousId},B.id&&B.id!==N&&{previousId:B.id}),y,[b,E,U])}))}catch(y){return Promise.reject(y)}},track:function(m,b,E,U){try{var N=se(m)?m.event:m;if(!N||!Je(N))throw new Error("EventMissing");var D=se(m)?m:b||{},Y=se(E)?E:{};return Promise.resolve(new Promise(function(B){R.dispatch({type:C.trackStart,event:N,properties:D,options:Y,userId:i(Ke,$,b),anonymousId:i(jt,$,b)},B,[b,E,U])}))}catch(B){return Promise.reject(B)}},page:function(m,b,E){try{var U=se(m)?m:{},N=se(b)?b:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:C.pageStart,properties:LP(U),options:N,userId:i(Ke,$,U),anonymousId:i(jt,$,U)},D,[m,b,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ke||m==="id")return i(Ke,$);if(m===jt||m==="anonId")return i(jt,$);var b=$.getState("user");return m?Du(b,m):b},reset:function(m){return new Promise(function(b){R.dispatch({type:C.resetStart},b,m)})},ready:function(m){return p&&m({plugins:w,instance:$}),$.on(C.ready,function(b){m(b),p=!0})},on:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(B){return function(W){return function(y){return y.type.match(E)&&b({payload:y,instance:$,plugins:o}),W(y)}}},N=function(B){return function(W){return function(y){return y.type.match(E)||b({payload:y,instance:$,plugins:o}),W(y)}}};return d(U,ln),d(N,fn),function(){h(U,ln),h(N,fn)}}var D=m.match(E)?ln:fn,Y=function(B){return function(W){return function(y){return y.type===m&&b({payload:y,instance:$,plugins:o,abort:S}),W(y)}}};return d(Y,D),function(){return h(Y,D)}},once:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".once disabled for "+m);var E=$.on(m,function(U){b({payload:U.payload,instance:$,plugins:o,abort:S}),E()});return E},getState:function(m){var b=R.getState();return m?Du(b,m):Object.assign({},b)},dispatch:function(m){var b=Je(m)?{type:m}:m;if($n.includes(b.type))throw new Error("reserved action "+b.type);var E=A({},b,{_:A({originalAction:b.type},m._||{})});R.dispatch(E)},enablePlugin:w.enable,disablePlugin:w.disable,plugins:w,storage:{getItem:a.getItem,setItem:function(m,b,E){R.dispatch({type:C.setItemStart,key:m,value:b,options:E})},removeItem:function(m,b){R.dispatch({type:C.removeItemStart,key:m,options:b})}},setAnonymousId:function(m,b){$.storage.setItem(Ye,m,b)},events:{core:$n,plugins:s}},O=n.middlewares.concat([function(m){return function(b){return function(E){return E.meta||(E.meta=al()),b(E)}}},v(ln),PP($,l,{all:f,plugins:s}),EP(a),bP($),$P($),v(fn)]),_={context:xP,user:SP(a),page:NP,track:RP,plugins:kP(l),queue:AP},k=Vt,M=Vt;if(Q&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?oh():se(typeof arguments[0])?nl():nl().apply(null,arguments)}}var J,L=function(m){return Object.keys(m).reduce(function(b,E){return DP.includes(E)||(b[E]=m[E]),b},{})}(e),x=n.pluginsArray.reduce(function(m,b){var E=b.name,U=b.config,N=b.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!b.initialize,loaded:!!N({config:U}),config:U},m},{}),z={context:L,user:I,plugins:x},R=Yd(function(m){for(var b=Object.keys(m),E={},U=0;U<b.length;U++){var N=b[U];typeof m[N]===We&&(E[N]=m[N])}var D,Y=Object.keys(E);try{(function(B){Object.keys(B).forEach(function(W){var y=B[W];if(typeof y(void 0,{type:"@@redux/INIT"})===Be||typeof y(void 0,{type:gP})===Be)throw new Error("reducer "+W+" "+Be)})})(E)}catch(B){D=B}return function(B,W){if(B===void 0&&(B={}),D)throw D;for(var y=!1,P={},j=0;j<Y.length;j++){var V=Y[j],oe=B[V],Qe=(0,E[V])(oe,W);if(typeof Qe===Be){var wh=yP(V,W);throw new Error(wh)}P[V]=Qe,y=y||Qe!==oe}return y?P:B}}(A({},_,t)),z,M(k(wP.apply(void 0,O))));R.dispatch=(J=R.dispatch,function(m,b,E){var U=A({},m,{meta:al(m.meta,b,Si(E))});return J.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:C.bootstrap,plugins:K,config:L,params:g,user:I,initialUser:r,persistedUser:T});var q=K.filter(function(m){return n.pluginEnabled[m]}),Ne=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:C.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,b){var E=m.bootstrap,U=m.config,N=m.name;E&&ce(E)&&E({instance:$,config:U,payload:m}),R.dispatch({type:C.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===b+1&&R.dispatch({type:C.initializeStart,plugins:q,disabled:Ne})}),FP(function(m){R.dispatch({type:m?C.offline:C.online})}),function(m,b,E){setInterval(function(){return qd(m,b,E)},3e3)}(R,l,$),$}var ln="before",fn="after",$r="cookie",ot=uh(),sh=sa,zP=sa;function ch(e){return ot?sa(e,"",-1):Qt(e)}function uh(){if(ot!==void 0)return ot;var e="cookiecookie";try{sa(e,e),ot=document.cookie.indexOf(e)!==-1,ch(e)}catch{ot=!1}return ot}function sa(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return ot===!1&&(o?vt(e,t):ht(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var Ir="localStorage",HP=es.bind(null,"localStorage");er("localStorage","getItem",ht);er("localStorage","setItem",vt);er("localStorage","removeItem",Qt);var Tr="sessionStorage",GP=es.bind(null,"sessionStorage");er("sessionStorage","getItem",ht);er("sessionStorage","setItem",vt);er("sessionStorage","removeItem",Qt);function xt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(se(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var KP=HP(),WP=GP(),VP=uh();function lh(e,t){if(e){var r=ts(t),n=!is(r),a=rs(r)?xt(localStorage.getItem(e)):void 0;if(n&&!At(a))return a;var i=ns(r)?xt(sh(e)):void 0;if(n&&i)return i;var o=as(r)?xt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ht(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function ZP(e,t,r){if(e&&!At(t)){var n={},a=ts(r),i=JSON.stringify(t),o=!is(a);return rs(a)&&(n[Ir]=dn(Ir,t,xt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Ir]:ns(a)&&(n[$r]=dn($r,t,xt(sh(e))),zP(e,i),o)?n[$r]:as(a)&&(n[Tr]=dn(Tr,t,xt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Tr]:(n[Sr]=dn(Sr,t,ht(e)),vt(e,t),o?n[Sr]:n)}}function JP(e,t){if(e){var r=ts(t),n=lh(e,Kd),a={};return!At(n.localStorage)&&rs(r)&&(localStorage.removeItem(e),a[Ir]=n.localStorage),!At(n.cookie)&&ns(r)&&(ch(e),a[$r]=n.cookie),!At(n.sessionStorage)&&as(r)&&(sessionStorage.removeItem(e),a[Tr]=n.sessionStorage),!At(n.global)&&ca(r,Sr)&&(Qt(e),a[Sr]=n.global),a}}function ts(e){return e?Je(e)?e:e.storage:Gd}function rs(e){return KP&&ca(e,Ir)}function ns(e){return VP&&ca(e,$r)}function as(e){return WP&&ca(e,Tr)}function is(e){return e===Kd||e==="all"}function ca(e,t){return e===Gd||e===t||is(e)}function dn(e,t,r){return{location:e,current:t,previous:r}}var YP={setItem:ZP,getItem:lh,removeItem:JP};function XP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ol(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?il(Object(r),!0).forEach(function(n){XP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):il(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:YP};return BP(ol(ol({},t),e))}function QP(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function eE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=rE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function tE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function rE(e){return["#","?"].forEach(t=>e=tE(e,t)),e}function nE(){eE(()=>{Me.page()})}function aE(e){if(e===void 0&&(e={}),!Q)return no;var t=cl(),r=oo(),n=sl(),a=hn(n,t),i=hn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return no;var h=d.map(function(S){return Number(S)}),v=mP(function(){var S=cl(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),T=oo(),I=sl(),w=hn(I,S),p=hn(T,S);if(l=w>l?w:l,c=p<c?p:c,!(o.length>=h.length)){var $=f===I,O="up";$?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||$)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(K){return K!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=w?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ce(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,J=M.direction;ce(e[F])&&e[F]({trigger:F,direction:J,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function oo(){return Q?document.body.scrollTop||document.documentElement.scrollTop:0}function iE(){return Q?window.innerHeight||document.documentElement.clientHeight:0}function sl(){return Math.round(oo()+iE())}function cl(){if(!Q)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function hn(e,t){return Math.round(e/t*100)}var ul="EventListener";function oE(e){return function(t,r,n,a){var i=n||no,o=a||!1;if(!Q)return i;var s=Dn(r),u=Dn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+ul:"remove"+ul,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?sE(i):i:f[h]||i;for(var S=0;S<s.length;S++)v[d]?v["on"+s[S]]=c?f[h]:null:v[d](s[S],f[h],o)}return l.bind(null,!c)}(e)}}function Dn(e,t){if(Je(e))return t?Dn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=fP(e);return t?i.map(function(o){return Je(o)?Dn(o,!0):o}).flat():i}function sE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var $i=oE("Event");function fh(e,t){return Q&&ce(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ce(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}fh.bind(null,"onerror");fh.bind(null,"onload");var dh=typeof window>"u",ll="hidden";function cE(e){if(dh)return!1;var t=uE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function uE(){var e=["webkit","moz","ms","o"];return dh||ll in document?ll:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var lE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function fE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=cE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(lE.map(function(s){return $i(document,s,r)})).concat($i(window,"load",r)).concat($i(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function dE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(lr(d),g),a&&l&&(l=!1,a(lr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(lr(d),g))},s)}var S=fE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=S();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:lr(d,c),idle:l?lr(r,c):0}}}}function lr(e,t){return t?0:Math.round((new Date-e)/1e3)}const fl=5e3;class hE{constructor(t){de(this,"element");de(this,"isInViewport",!1);de(this,"isAwake",!1);de(this,"isFlushing");de(this,"observer");de(this,"lastEventAt",Date.now());de(this,"registeredView",!1);de(this,"viewCallback");de(this,"activeDurationCallback");de(this,"idleDurationCallback");de(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),dE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:fl}),aE({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*fl:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const dl="sesamy_session_id";function vE(){let e=sessionStorage.getItem(dl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(dl,e)),e}let hh=!1,so,hl,Mn;const vh=new Map;function pE({clientId:e,enabled:t=!0,environment:r}){if(so=e,hl=t,Mn=`${Fe("logs",r)}/events`,!hl)return;window.addEventListener("beforeunload",()=>{mh.forEach((a,i)=>{a.bind(i)()}),gE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&vh.forEach((a,i)=>{a.bind(i)()})}),nE();const n=new hE({element:document.body,viewCallback:()=>{Me.page()},activeDurationCallback:(a,i,o)=>{Me.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Me.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Me.track("scroll",{scroll:a.scrollMax})}});yE(document.body,()=>{n.flush()}),wE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ke.AUTHENTICATED,async a=>{const i=a;await Me.identify(i.detail.sub)}),window.addEventListener(ke.LOGOUT,async()=>{await Me.track("logout",{}),os.flush(),await Me.reset()})}function ph(e){return JSON.stringify(e.map(t=>({...t,clientId:so,requestId:Math.random().toString(36).slice(2,9),sessionId:vE(),timestamp:new Date().toISOString(),version:Qo,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:Hd,userAgent:navigator.userAgent,clientId:so}})))}const os=QP(async e=>{if(e.length>0){const t=ph(e);hh?navigator.sendBeacon(Mn,t):(await fetch(Mn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ii(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Mn,ph([r]))}else os.push(e)}const Me=qP({app:Hd,version:Qo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ii({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ii({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ii({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function mE(e,t){Me.track(e,t)}function gE(){return hh=!0,os.flush()}const mh=new Map;function yE(e,t){mh.set(e,t)}function wE(e,t){vh.set(e,t)}const bE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function SE(){return new Promise(e=>{const t=bE.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function $E(){const e=navigator.userAgent.toLowerCase(),t=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of t)if(r.regex.test(e))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function IE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:S,getProfile:g,updateProfile:T,getTags:I,deleteTag:w,setTag:p,getUserMetadata:$,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:J,deleteTally:L,getProduct:x,getPaymentIssues:z,isSpotifyLinked:R,unlinkSpotify:K,linkSpotify:q,autoOnboardProduct:Ne,openHostedAccountPage:m,generateLink:b}=tP(e),E={auth:{getUser:g,isAuthenticated:Or,loginWithRedirect:Xo,logout:Nd,setToken:Dd},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:K},analytics:{track:mE},tags:{list:I,set:p,delete:w},entitlements:{get:a,list:i,access:o,signedLinks:qo},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:$,list:O,set:_,delete:k},tallies:{get:M,list:F,push:J,delete:L},subscriptions:{list:u},transactions:{get:v,list:S},products:{get:x,autoOnboard:Ne,linkSpotify:q},browser:{detectAdblock:SE,isInAppBrowser:$E},getVersion:TE,getPaymentIssues:z,generateLink:b,clearCache:Te};return e.namespace&&(window[e.namespace]=E),E}function TE(){return Qo}function PE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
4
+ `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!Cu(r))throw new Error(`Invalid cache location "${r}"`);n=Cu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?kt:PT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:ET;var i;this.scope=on("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ST(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Id,this.cacheManager=new bT(n,n.allKeys?void 0:new _T(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new kT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||$d)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${eo(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return IT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=Eu(hi()),i=Eu(hi()),o=hi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await Sn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:on(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new dT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new fT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(ue.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ue("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Au(t),{openUrl:a,fragment:i,appState:o}=n,s=je(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=je(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ue("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new lT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ue("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:on(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=pi[o];return s||(s=i().finally(()=>{delete pi[o],s=null}),pi[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=je(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>mi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Qi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await mi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:on(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},uT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new st({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=je(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${eo(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Au(t),{openUrl:n}=r,a=je(r,["openUrl"]);t.clientId===null?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("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ue("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((v,S,g=60)=>new Promise((T,I)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const p=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",$,!1))};let $;const O=setTimeout(()=>{I(new Qi),p()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(ue.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",$,!1),setTimeout(p,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(w),w.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new ue("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new st({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new _d(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=je(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new st({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new st({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await yT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function AT(e){const t=new CT(e);return await t.checkSession(),t}var ke=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ke||{});const jT="sesamy.com",LT="sesamy.dev",UT="https://sesa.my",ro="sesamyCacheTimestamp";function Fe(e,t){return`https://${e}.${t==="dev"?LT:jT}`}function no(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let fe,Ld,Ud=!1;const Ht="sesamyAccessToken",gi="sesamyRefreshToken";async function xr(){return new Promise((r,n)=>{let a=0;const i=()=>{Ud?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function NT(e){if(!e)return null;const t=localStorage.getItem(gi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(gi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(gi,i.refresh_token),localStorage.setItem(Ht,i.access_token),i.access_token}catch{Nd()}}async function Xo(){const e=localStorage.getItem(Ht);if(!e)return null;const t=xd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await NT(t);if(r)return r;localStorage.removeItem(Ht)}return e}function ju(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function xT(e){if(e.enabled===!1)return;Ld=e.organization;const t={domain:Fe("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(ju(window.location.href)!==ju(Fe("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),fe=await AT(t),window.location.search.includes("code="))try{await fe.handleRedirectCallback();const r=await fe.getUser();qe(ke.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Ud=!0}async function Or(){return await xr(),await Xo()?!0:fe?fe.isAuthenticated():!1}async function DT(){return await xr(),await Xo()?{sub:"local",name:"Local User"}:fe?fe.getUser():null}async function qo(e){if(await xr(),localStorage.removeItem(Ht),!fe)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return fe.loginWithRedirect({...e,authorizationParams:{organization:Ld,redirect_uri:window.location.href,ui_locales:no(),...t}})}async function ur(e=!0){await xr();const t=await Xo();if(t)return t;try{return fe?await fe.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Nd(e={}){if(await xr(),localStorage.removeItem(Ht),qe(ke.LOGOUT,{}),!!fe)return fe.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function xd(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Dd(e){const t=xd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Ht,e),qe(ke.AUTHENTICATED,t)}const MT=(e,t)=>t.skipDedupe||t.method!=="GET",FT=(e,t)=>t.method+"@"+e,BT=e=>e.clone(),Lu=({skip:e=MT,key:t=FT,resolver:r=BT}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},zT=(e,t)=>e*t,HT=e=>e&&e.ok,Uu=({delayTimer:e=500,delayRamp:t=zT,maxAttempts:r=10,until:n=HT,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(S=>S?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var w,p;g(u((w=I&&I.url)!==null&&w!==void 0?w:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},GT="application/json",Md="Content-Type",Pt=Symbol(),Fd=Symbol();function Nu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Md.toLowerCase()))===null||t===void 0?void 0:t[1]}function xu(e){return/^application\/.*json.*/.test(e)}const ut=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=ut(o,i,r):n[a]=i,n},{...e})},Gt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function KT(e,t=!1){Gt.options=t?e:ut(Gt.options,e)}function WT(e,t=!1){Gt.polyfills=t?e:ut(Gt.polyfills,e)}function VT(e){Gt.errorType=e}const ZT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Bd extends Error{}const JT=e=>{const t=Object.create(null);e=e._addons.reduce((w,p)=>p.beforeRequest&&p.beforeRequest(w,e._options,t)||w,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ut(a.options,n);let c=r;const d=ZT(s)((w,p)=>(c=w,a.polyfill("fetch")(w,p)))(r,l),h=new Error,v=d.catch(w=>{throw{[Pt]:w}}).then(w=>{var p;if(!w.ok){const $=new Bd;if($.cause=h,$.stack=$.stack+`
5
+ CAUSE: `+h.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw $;const O=a.errorType==="json"||((p=w.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?w.text():w[a.errorType]():Promise.resolve(w.body)).then(k=>{throw $.message=typeof k=="string"?k:w.statusText,k&&(O&&typeof k=="string"?($.text=k,$.json=JSON.parse(k)):$[a.errorType]=k),$})}return w}),S=w=>w.catch(p=>{const $=Object.prototype.hasOwnProperty.call(p,Pt),O=$?p[Pt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||$&&f.has(Pt)&&f.get(Pt);if(_)return _(O,e);const k=f.get(Fd);if(k)return k(O,e);throw O}),g=w=>p=>S(w?v.then($=>$&&$[w]()).then($=>p?p($):$):v.then($=>p?p($):$)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(w,p){return f.set(w,p),this},badRequest(w){return this.error(400,w)},unauthorized(w){return this.error(401,w)},forbidden(w){return this.error(403,w)},notFound(w){return this.error(404,w)},timeout(w){return this.error(408,w)},internalError(w){return this.error(500,w)},fetchError(w){return this.error(Pt,w)}},I=u.reduce((w,p)=>({...w,...typeof p.resolver=="function"?p.resolver(w):p.resolver}),T);return o.reduce((w,p)=>p(w,e),I)},YT={_url:"",_options:{},_config:Gt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:ut(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:ut(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:ut(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Md]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Fd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Nu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||xu(a));return n=r?o?n.json(r,a):n.body(r):n,JT(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Nu(this._options.headers);return this.content(t||xu(r)&&r||GT).body(JSON.stringify(e))}};function ze(e="",t={}){return{...YT,_url:e,_options:t}}ze.default=ze;ze.options=KT;ze.errorType=VT;ze.polyfills=WT;ze.WretchError=Bd;function Te(){sessionStorage.removeItem(ro),qe(ke.CLEAR_CACHE,{})}function XT(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function qT(e,t){if(XT(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function QT(e,t){const r=new URL(`${Fe("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=qT(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("itemSrc",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const zd="sesamySignedURLs";function Qo(){const e=sessionStorage.getItem(zd);return e?JSON.parse(e):[]}function eP(e){const t=Qo();t.push(e),sessionStorage.setItem(zd,JSON.stringify(t))}function tP(e){const t=Fe("api2",e.environment),r=y=>async(P,j)=>{let V=sessionStorage.getItem(ro);V||(V=Date.now().toString(),sessionStorage.setItem(ro,V));const oe={...j,headers:{...j.headers,"Cache-Timestamp":V}};return y(P,oe)},n=(y=!0)=>P=>async(j,V)=>{let oe=null;if(oe=await ur(y),!oe){if(y)throw new Error("No access token available");return P(j,V)}const Qe={...V,headers:{...V.headers,...oe?{Authorization:`Bearer ${oe}`}:{}}};return P(j,Qe)},a=y=>(P,j)=>{if(j.headers.Authorization)return y(P,j);const V=localStorage.getItem("__anon_id"),oe=btoa(`${V}:`),Qe={...j,headers:{...j.headers,Authorization:`Basic ${oe}`}};return y(P,Qe)},i=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Lu(),Uu({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]),o=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Lu(),Uu({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]);async function s(y={}){const{waitForEntitlementAfter:P,includeSignedLinks:j=!0}=y,V=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",oe=await Or()?await i.get(`/entitlements${V}`).json():[];return j&&oe.push(...Qo()),oe}async function u(y){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(j=>j.id===y)}async function f(y){return i.get(`/entitlements/${encodeURIComponent(y)}/access`).json()}async function l(y){return await Or()?await i.get(`/fulfillments?sku=${encodeURIComponent(y)}`).json():[]}async function c(){return i.get("/contracts").json()}async function d(y){const P=await i.get("/contracts").json();return P==null?void 0:P.find(j=>j.id===y)}async function h(y){return(await i.post({},`/contracts/${encodeURIComponent(y)}/cancel`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function S(){return i.get("/bills").json()}async function g(y){const P=await i.get("/bills").json();return P==null?void 0:P.find(j=>j.id===y)}async function T(){return i.get("/transactions").json()}async function I(y){const P=await i.get("/transactions").json();return P==null?void 0:P.find(j=>j.id===y)}async function w(y,P){const j=await i.url(`/user-metadata/${encodeURIComponent(y)}`).put(P).json();return qe(ke.USER_ATTRIBUTE_CHANGED,{}),Te(),j}async function p(y){const P=await i.url(`/user-metadata/${encodeURIComponent(y)}`).delete().res();return Te(),P.ok}async function $(y){return(await i.url(`/user-metadata/${encodeURIComponent(y)}`).get().json())[y]}async function O(){return await i.url("/user-metadata").get().json()}async function _(){return await i.url("/tags").get().json()}async function k(y){const P=await i.url(`/tags/${encodeURIComponent(y)}`).delete().res();return Te(),P.ok}async function M(y){const P=await i.url("/tags").post(encodeURIComponent(y)).res();return qe(ke.USER_ATTRIBUTE_CHANGED,{}),Te(),P.ok}async function F(y){return(await o.url("/tallies").get().json())[y]}async function J(){return await o.url("/tallies").get().json()}async function L(y){const P=await o.url(`/tallies/${y}`).delete().res();return Te(),P.ok}async function x(y,P){return await o.url(`/tallies/${encodeURIComponent(y)}/push`).post(P).json()}async function z(y){return await i.url(`/products/${encodeURIComponent(y)}`).get().json()}async function R(){return await ur(!1)?await i.url("/profile").get().json():null}async function K(y){const P=await i.url("/profile").patch(y).res();return Te(),P.ok}async function q(){return await i.url("/payment-issues").get().json()}async function Ne(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function m(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function b(y){const P=await ur(!1);if(!P)throw new Error("No access token available");const j=new URL(`${Fe("spotify-oas",e.environment)}/sesamy-callback`);j.searchParams.set("access_token",P),j.searchParams.set("state",y),window.location.href=j.toString()}async function E(y){const P=await i.url(`/products/${encodeURIComponent(y)}/auto-onboard`).post().json();return P.length&&Te(),P}async function U(y,P=3600){const{shortlink:j}=await ze(UT).post({url:y,ttl:P}).json();return j}async function N(y){const P=await ur(!1);let j;const V=y.language||no();switch(y.target){case"account":j=new URL(`${Fe("account",e.environment)}/${encodeURIComponent(y.language||V)}/subscriptions/${encodeURIComponent(e.clientId)}`),j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"consume":j=new URL(`${Fe("consume",e.environment)}/${encodeURIComponent(y.language||V)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(y.sku)}`),y.episodeId?j.href+=`/${y.episodeId}`:j.href+="/listen",j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"checkout":j=QT(e,{language:V,...y});break;default:throw new Error("Invalid target")}return P&&(j.hash=`#access_token=${P}`),y.shorten?U(j.href,y.ttl):j.href}async function D(y){return(await o.url("/checkouts").post({language:no(),...y,vendorId:e.clientId})).json()}async function Y(y,P){return(await o.url(`/checkouts/${y}`).patch(P)).json()}async function B(y){return(await o.url(`/checkouts/${y}`).get()).json()}async function W(){const y=await ur(!1),P=new URL(`${Fe("account",e.environment)}/subscriptions/${e.clientId}`);y&&(P.hash=`#access_token=${y}`),window.location.href=P.toString()}return{createCheckout:D,updateCheckout:Y,getCheckout:B,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getFulfillments:l,getContracts:c,getContract:d,cancelContract:h,getProfile:R,updateProfile:K,getSubscriptions:v,getBills:S,getBill:g,setUserMetadata:w,deleteUserMetadata:p,getUserMetadata:$,listUserMetadata:O,getTags:_,deleteTag:k,setTag:M,getTally:F,getTallies:J,deleteTally:L,pushTally:x,getTransactions:T,getTransaction:I,getProduct:z,getPaymentIssues:q,autoOnboardProduct:E,isSpotifyLinked:Ne,unlinkSpotify:m,linkSpotify:b,generateLink:N,openHostedAccountPage:W}}const Hd="@sesamy/sesamy-js",es="1.19.1";function Du(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var sn="undefined",Mu="object",ao=function(){},Gd="any",Kd="*",dt="__",Nn=typeof process<"u"?process:{};Nn.env&&Nn.env.NODE_ENV;var Q=typeof document<"u";Nn.versions!=null&&Nn.versions.node!=null;typeof Deno<"u"&&Deno.core;Q&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Wd(e,t){return t.charAt(0)[e]()+t.slice(1)}var rP=Wd.bind(null,"toUpperCase"),nP=Wd.bind(null,"toLowerCase");function aP(e){return Vd(e)?rP("null"):typeof e=="object"?cP(e):Object.prototype.toString.call(e).slice(8,-1)}function xn(e,t){t===void 0&&(t=!0);var r=aP(e);return t?nP(r):r}function Dr(e,t){return typeof t===e}var ce=Dr.bind(null,"function"),Je=Dr.bind(null,"string"),At=Dr.bind(null,"undefined"),iP=Dr.bind(null,"boolean");Dr.bind(null,"symbol");function Vd(e){return e===null}function oP(e){return xn(e)==="number"&&!isNaN(e)}function Zd(e){return xn(e)==="array"}function se(e){if(!sP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function sP(e){return e&&(typeof e=="object"||e!==null)}function cP(e){return ce(e.constructor)?e.constructor.name:null}function uP(e){return e instanceof Error||Je(e.message)&&e.constructor&&oP(e.constructor.stackTraceLimit)}function Jd(e,t){if(typeof t!="object"||Vd(t))return!1;if(t instanceof e)return!0;var r=xn(new e(""));if(uP(t))for(;t;){if(xn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Jd.bind(null,TypeError);Jd.bind(null,SyntaxError);function aa(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?lP(e,t):r}function lP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ia(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ia(aa,"form");ia(aa,"button");ia(aa,"input");ia(aa,"select");function fP(e){return e?Zd(e)?e:[e]:[]}function Fu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function dP(){if(Q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function hP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Fu(r[1]),o=Fu(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(pP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return Q&&window.location.search.substring(1)}())}function pP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function oa(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function mP(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var Sr="global",Kt=dt+"global"+dt,Wt=typeof self===Mu&&self.self===self&&self||typeof global===Mu&&global.global===global&&global||void 0;function ht(e){return Wt[Kt][e]}function vt(e,t){return Wt[Kt][e]=t}function Qt(e){delete Wt[Kt][e]}function er(e,t,r){var n;try{if(ts(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Wt[Kt]||(Wt[Kt]={});var cn={};function ts(e){if(typeof cn[e]!==sn)return cn[e];try{var t=window[e];t.setItem(sn,sn),t.removeItem(sn)}catch{return cn[e]=!1}return cn[e]=!0}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}var We="function",Be="undefined",gP="@@redux/"+Math.random().toString(36),Bu=function(){return typeof Symbol===We&&Symbol.observable||"@@observable"}(),un=" != "+We;function Yd(e,t,r){var n;if(typeof t===We&&typeof r===Be&&(r=t,t=void 0),typeof r!==Be){if(typeof r!==We)throw new Error("enhancer"+un);return r(Yd)(e,t)}if(typeof e!==We)throw new Error("reducer"+un);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==We)throw new Error("Listener"+un);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var S=s.indexOf(h);s.splice(S,1)}}}function d(h){if(!se(h))throw new Error("Act != obj");if(typeof h.type===Be)throw new Error("ActType "+Be);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,S=0;S<v.length;S++)(0,v[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==We)throw new Error("next reducer"+un);a=h,d({type:"@@redux/INIT"})}})[Bu]=function(){var h,v=c;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:v(g)}}})[Bu]=function(){return this},h},n}function yP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Be}function Vt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function wP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),A({},o,{dispatch:s=Vt.apply(void 0,i)(o.dispatch)})}}}var Ye=dt+"anon_id",lt=dt+"user_id",Ut=dt+"user_traits",Ke="userId",jt="anonymousId",$n=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],io=["name","EVENTS","config","loaded"],C=$n.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),zu=/^utm_/,Hu=/^an_prop_/,Gu=/^an_trait_/;function bP(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===C.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ye,o.anonymousId),f||t(lt,o.userId),u.traits&&t(Ut,A({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,h=l.reduce(function(v,S){if(S.match(zu)||S.match(/^(d|g)clid/)){var g=S.replace(zu,"");v.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Hu)&&(v.props[S.replace(Hu,"")]=i[S]),S.match(Gu)&&(v.traits[S.replace(Gu,"")]=i[S]),v},{campaign:{},props:{},traits:{}});r.dispatch(A({type:C.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:C.campaign,campaign:h.campaign})}}return n(a)}}}}function SP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===C.setItemEnd){if(r.key===Ye)return A({},t,{anonymousId:r.value});if(r.key===lt)return A({},t,{userId:r.value})}switch(r.type){case C.identify:return Object.assign({},t,{userId:r.userId,traits:A({},t.traits,r.traits)});case C.reset:return[lt,Ye,Ut].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Ku(e){return{userId:e.getItem(lt),anonymousId:e.getItem(Ye),traits:e.getItem(Ut)}}var oo=function(e){return dt+"TEMP"+dt+e};function $P(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===C.reset&&([lt,Ut,Ye].forEach(function(h){n(h)}),[Ke,jt,"traits"].forEach(function(h){Qt(oo(h))})),s.type===C.identify){a(Ye)||r(Ye,oa());var c=a(lt),d=a(Ut)||{};c&&c!==u&&i.dispatch({type:C.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(lt,u),f&&r(Ut,A({},d,f))}return o(s)}}}}var vr={};function Wu(e,t){vr[e]&&ce(vr[e])&&(vr[e](t),delete vr[e])}function Xd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(A({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Xd(e,t,r-10).then(n,a)})})}function IP(e){return{abort:e}}function qd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,S=a[h][v];if(S&&ce(S)){var g,T=function(p,$){return p===void 0&&(p={}),$===void 0&&($={}),[Ke,jt].reduce(function(O,_){return p.hasOwnProperty(_)&&$[_]&&$[_]!==p[_]&&(O[_]=$[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[h].config,instance:r,abort:IP}))&&se(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var w=v+":"+h;e.dispatch(A({},T,{type:w,_:{called:w,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var yi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Nt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,w,p){var $=w.config,O=w.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Nt)?function(M,F,J,L,x){return function(z,R){var K=L?L.name:M,q=R&&kr(R)?R:J;if(L&&(!(q=R&&kr(R)?R:[M]).includes(M)||q.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(q)+" input valid");return A({},x,{abort:{reason:z,plugins:q,caller:F,_:K}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:TP(I),instance:g,config:$||{},abort:k}}}(n,h),S=t.exact.reduce(function(g,T){var I=T.pluginName,w=T.methodName,p=!1;return w.match(/^initialize/)||w.match(/^reset/)||(p=!f[I].loaded),l.offline&&w.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var w=T.pluginName;return Promise.resolve(g).then(function(p){function $(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[w])return Promise.resolve(t.namespaced[w].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ce(k.method)?(function(z,R){var K=Qu(z);if(K&&K.name===R){var q=Qu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(q?"or "+q.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
+ `))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(J=F,L=w,x=k.pluginName,function(z,R){return A({},J,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Ju(k.pluginName,f,i),plugins:f})).then(function(z){var R=se(z)?z:{};return Promise.resolve(A({},F,R))})):F;var J,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[w]=_});p[w]=r}();return O&&O.then?O.then($):$()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,w){try{var p=t.exact.length===w+1,$=I.pluginName,O=i[$];return Promise.resolve(T).then(function(_){var k=g[$]?g[$]:{};if(d&&(k=_),bi(k,$))return wi({data:k,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(bi(_,$))return p&&wi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[$],i[$]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:Ju($,f,i),plugins:f})).then(function(F){var J=se(F)?F:{},L=A({},_,J),x=g[$];if(bi(x,$))wi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Vu)&&!c.match(Zu)&&n.dispatch(A({},d?L:k,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Nt)||c.match(/^registerPlugin/)||c.match(Zu)||c.match(Vu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=A({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});Qd(T,t.exact.length)&&!c.match(/End$/)&&(I=A({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Nt=/Start$/,Vu=/^bootstrap/,Zu=/^ready/;function wi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(A({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Ju(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Yu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Xu(e,t){var r=e.replace(Nt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function bi(e,t){var r=e.abort;return!!r&&(r===!0||qu(r,t)||r&&qu(r.plugins,t))}function Qd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Je(r))return!0;var n=r.plugins;return kr(r)&&r.length===t||kr(n)&&n.length===t}function kr(e){return Array.isArray(e)}function qu(e,t){return!(!e||!kr(e))&&e.includes(t)}function Qu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function TP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=se(e[r])?Object.assign({},e[r]):e[r]),t},{})}function PP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===C.enablePlugin&&a.dispatch({type:C.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===C.disablePlugin&&setTimeout(function(){return Wu(o.meta.rid,{payload:o})},0),f===C.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),S=[],g=[],T=o.disabled,I=v.map(function(p){var $=p.loaded,O=p.name,_=p.config;return Xd(p,function(){return $({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:C.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!io.includes(M)})}),n[O]=!0),S=S.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(A({},{type:C.ready},$))},0)})}var w=function(){if(f!==C.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return qd(a,t,e)},0),Promise.resolve(function(p,$,O,_,k){try{var M=ce($)?$():$,F=p.type,J=F.replace(Nt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(K=M,(q=L.plugins)===void 0&&(q={}),(Ne=p.options)===void 0&&(Ne={}),Object.keys(K).filter(function(m){var b=Ne.plugins||{};return iP(b[m])?b[m]:b.all!==!1&&(!q[m]||q[m].enabled!==!1)}).map(function(m){return K[m]}));F===C.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var b=L.plugins[m];return p.plugins.includes(m)&&!b.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,b,E){var U=Xu(m).map(function(N){return Yu(N,b)});return b.reduce(function(N,D){var Y=D.name,B=Xu(m,Y).map(function(j){return Yu(j,b)}),W=B[0],y=B[1],P=B[2];return W.length&&(N.beforeNS[Y]=W),y.length&&(N.duringNS[Y]=y),P.length&&(N.afterNS[Y]=P),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(yi({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function b(){var N=function(){if(F.match(Nt))return Promise.resolve(yi({action:A({},E,{type:J+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(D){D.meta&&D.meta.hasCallback&&Wu(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(Qd(m,z.length))return m;var E,U=function(){if(F!==J)return Promise.resolve(yi({action:A({},m,{type:J}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(b):b()})}catch(m){return Promise.reject(m)}var K,q,Ne}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(w&&w.then?w.then(u):u(w))}catch(p){return Promise.reject(p)}}}}}function EP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===C.setItem||a===C.removeItem){if(n.abort)return r(n);a===C.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var OP=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Vt.apply(void 0,o)(n)(a)}}}}};function kP(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=el(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},A({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=el(r.type,C.initialize),f=e()[u];return f&&u?(n[u]=A({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),A({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=A({},t[r.name],{loaded:!0}),A({},t,n);switch(r.type){case C.disablePlugin:return A({},t,tl(r.plugins,!1,t));case C.enablePlugin:return A({},t,tl(r.plugins,!0,t));default:return t}}}function el(e,t){return e.substring(t.length+1,e.length)}function tl(e,t,r){return e.reduce(function(n,a){return n[a]=A({},r[a],{enabled:t}),n},r)}function eh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var _P={last:{},history:[]};function RP(e,t){e===void 0&&(e=_P);var r=t.options,n=t.meta;if(t.type===C.track){var a=eh(A({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return A({},e,{last:a,history:e.history.concat(a)})}return e}var CP={actions:[]};function AP(e,t){e===void 0&&(e=CP);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===C.identify?[t].concat(e.actions):e.actions.concat(t),A({},e,{actions:n});case"dequeue":return[];default:return e}}var th=/#.*$/;function jP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(th,""):"")}var rh,nh,ah,ih,LP=function(e){if(e===void 0&&(e={}),!Q)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(Q){for(var v,S=document.getElementsByTagName("link"),g=0;v=S[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(th,"")}(f),c={title:r,url:l,path:jP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),A({},c,e)},UP={last:{},history:[]};function NP(e,t){e===void 0&&(e=UP);var r=t.options;if(t.type===C.page){var n=eh(A({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return A({},e,{last:n,history:e.history.concat(n)})}return e}rh=function(){if(!Q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),nh=Q?document.referrer:null,ah=dP(),ih=hP();var rl={initialized:!1,sessionId:oa(),app:null,version:null,debug:!1,offline:!!Q&&!navigator.onLine,os:{name:rh},userAgent:Q?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:ih,locale:ah,campaign:{},referrer:nh};function xP(e,t){e===void 0&&(e=rl);var r=e.initialized,n=t.campaign;switch(t.type){case C.campaign:return A({},e,{campaign:n});case C.offline:return A({},e,{offline:!0});case C.online:return A({},e,{offline:!1});default:return r?e:A({},rl,e,{initialized:!0})}}var DP=["plugins","reducers","storage"];function MP(e,t,r){if(Q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function FP(e){var t=MP.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function oh(){return vt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Wt[Kt].analytics.push(o.action||o),i(o)}})}}}function nl(e){return function(){return Vt(Vt.apply(null,arguments),oh())}}function Si(e){return e?Zd(e)?e:[e]:[]}function al(e,t,r){e===void 0&&(e={});var n,a,i=oa();return t&&(vr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ce(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),A({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function BP(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,b){if(ce(b))return m.middlewares=m.middlewares.concat(b),m;if(b.NAMESPACE&&(b.name=b.NAMESPACE),!b.name)throw new Error("https://lytics.dev/errors/1");b.config||(b.config={});var E=b.EVENTS?Object.keys(b.EVENTS).map(function(D){return b.EVENTS[D]}):[];m.pluginEnabled[b.name]=!(b.enabled===!1||b.config.enabled===!1),delete b.enabled,b.methods&&(m.methods[b.name]=Object.keys(b.methods).reduce(function(D,Y){var B;return D[Y]=(B=b.methods[Y],function(){for(var W=Array.prototype.slice.call(arguments),y=new Array(B.length),P=0;P<W.length;P++)y[P]=W[P];return y[y.length]=$,B.apply({instance:$},y)}),D},{}),delete b.methods);var U=Object.keys(b).concat(E),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(b),m.plugins[b.name])throw new Error(b.name+"AlreadyLoaded");return m.plugins[b.name]=b,m.plugins[b.name].loaded||(m.plugins[b.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ht,setItem:vt,removeItem:Qt},i=function(m){return function(b,E,U){return E.getState("user")[b]||(U&&se(U)&&U[b]?U[b]:Ku(m)[b]||ht(oo(b))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!io.includes(m)}).sort(),u=new Set(s.concat($n).filter(function(m){return!io.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new OP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=vP(),T=Ku(a),I=A({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=oa());var w=A({enable:function(m,b){return new Promise(function(E){R.dispatch({type:C.enablePlugin,plugins:Si(m),_:{originalAction:C.enablePlugin}},E,[b])})},disable:function(m,b){return new Promise(function(E){R.dispatch({type:C.disablePlugin,plugins:Si(m),_:{originalAction:C.disablePlugin}},E,[b])})}},n.methods),p=!1,$={identify:function(m,b,E,U){try{var N=Je(m)?m:null,D=se(m)?m:b,Y=E||{},B=$.user();vt(oo(Ke),N);var W=N||D.userId||i(Ke,$,D);return Promise.resolve(new Promise(function(y){R.dispatch(A({type:C.identifyStart,userId:W,traits:D||{},options:Y,anonymousId:B.anonymousId},B.id&&B.id!==N&&{previousId:B.id}),y,[b,E,U])}))}catch(y){return Promise.reject(y)}},track:function(m,b,E,U){try{var N=se(m)?m.event:m;if(!N||!Je(N))throw new Error("EventMissing");var D=se(m)?m:b||{},Y=se(E)?E:{};return Promise.resolve(new Promise(function(B){R.dispatch({type:C.trackStart,event:N,properties:D,options:Y,userId:i(Ke,$,b),anonymousId:i(jt,$,b)},B,[b,E,U])}))}catch(B){return Promise.reject(B)}},page:function(m,b,E){try{var U=se(m)?m:{},N=se(b)?b:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:C.pageStart,properties:LP(U),options:N,userId:i(Ke,$,U),anonymousId:i(jt,$,U)},D,[m,b,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ke||m==="id")return i(Ke,$);if(m===jt||m==="anonId")return i(jt,$);var b=$.getState("user");return m?Du(b,m):b},reset:function(m){return new Promise(function(b){R.dispatch({type:C.resetStart},b,m)})},ready:function(m){return p&&m({plugins:w,instance:$}),$.on(C.ready,function(b){m(b),p=!0})},on:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(B){return function(W){return function(y){return y.type.match(E)&&b({payload:y,instance:$,plugins:o}),W(y)}}},N=function(B){return function(W){return function(y){return y.type.match(E)||b({payload:y,instance:$,plugins:o}),W(y)}}};return d(U,ln),d(N,fn),function(){h(U,ln),h(N,fn)}}var D=m.match(E)?ln:fn,Y=function(B){return function(W){return function(y){return y.type===m&&b({payload:y,instance:$,plugins:o,abort:S}),W(y)}}};return d(Y,D),function(){return h(Y,D)}},once:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".once disabled for "+m);var E=$.on(m,function(U){b({payload:U.payload,instance:$,plugins:o,abort:S}),E()});return E},getState:function(m){var b=R.getState();return m?Du(b,m):Object.assign({},b)},dispatch:function(m){var b=Je(m)?{type:m}:m;if($n.includes(b.type))throw new Error("reserved action "+b.type);var E=A({},b,{_:A({originalAction:b.type},m._||{})});R.dispatch(E)},enablePlugin:w.enable,disablePlugin:w.disable,plugins:w,storage:{getItem:a.getItem,setItem:function(m,b,E){R.dispatch({type:C.setItemStart,key:m,value:b,options:E})},removeItem:function(m,b){R.dispatch({type:C.removeItemStart,key:m,options:b})}},setAnonymousId:function(m,b){$.storage.setItem(Ye,m,b)},events:{core:$n,plugins:s}},O=n.middlewares.concat([function(m){return function(b){return function(E){return E.meta||(E.meta=al()),b(E)}}},v(ln),PP($,l,{all:f,plugins:s}),EP(a),bP($),$P($),v(fn)]),_={context:xP,user:SP(a),page:NP,track:RP,plugins:kP(l),queue:AP},k=Vt,M=Vt;if(Q&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?oh():se(typeof arguments[0])?nl():nl().apply(null,arguments)}}var J,L=function(m){return Object.keys(m).reduce(function(b,E){return DP.includes(E)||(b[E]=m[E]),b},{})}(e),x=n.pluginsArray.reduce(function(m,b){var E=b.name,U=b.config,N=b.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!b.initialize,loaded:!!N({config:U}),config:U},m},{}),z={context:L,user:I,plugins:x},R=Yd(function(m){for(var b=Object.keys(m),E={},U=0;U<b.length;U++){var N=b[U];typeof m[N]===We&&(E[N]=m[N])}var D,Y=Object.keys(E);try{(function(B){Object.keys(B).forEach(function(W){var y=B[W];if(typeof y(void 0,{type:"@@redux/INIT"})===Be||typeof y(void 0,{type:gP})===Be)throw new Error("reducer "+W+" "+Be)})})(E)}catch(B){D=B}return function(B,W){if(B===void 0&&(B={}),D)throw D;for(var y=!1,P={},j=0;j<Y.length;j++){var V=Y[j],oe=B[V],Qe=(0,E[V])(oe,W);if(typeof Qe===Be){var wh=yP(V,W);throw new Error(wh)}P[V]=Qe,y=y||Qe!==oe}return y?P:B}}(A({},_,t)),z,M(k(wP.apply(void 0,O))));R.dispatch=(J=R.dispatch,function(m,b,E){var U=A({},m,{meta:al(m.meta,b,Si(E))});return J.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:C.bootstrap,plugins:K,config:L,params:g,user:I,initialUser:r,persistedUser:T});var q=K.filter(function(m){return n.pluginEnabled[m]}),Ne=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:C.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,b){var E=m.bootstrap,U=m.config,N=m.name;E&&ce(E)&&E({instance:$,config:U,payload:m}),R.dispatch({type:C.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===b+1&&R.dispatch({type:C.initializeStart,plugins:q,disabled:Ne})}),FP(function(m){R.dispatch({type:m?C.offline:C.online})}),function(m,b,E){setInterval(function(){return qd(m,b,E)},3e3)}(R,l,$),$}var ln="before",fn="after",$r="cookie",ot=uh(),sh=sa,zP=sa;function ch(e){return ot?sa(e,"",-1):Qt(e)}function uh(){if(ot!==void 0)return ot;var e="cookiecookie";try{sa(e,e),ot=document.cookie.indexOf(e)!==-1,ch(e)}catch{ot=!1}return ot}function sa(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return ot===!1&&(o?vt(e,t):ht(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var Ir="localStorage",HP=ts.bind(null,"localStorage");er("localStorage","getItem",ht);er("localStorage","setItem",vt);er("localStorage","removeItem",Qt);var Tr="sessionStorage",GP=ts.bind(null,"sessionStorage");er("sessionStorage","getItem",ht);er("sessionStorage","setItem",vt);er("sessionStorage","removeItem",Qt);function xt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(se(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var KP=HP(),WP=GP(),VP=uh();function lh(e,t){if(e){var r=rs(t),n=!os(r),a=ns(r)?xt(localStorage.getItem(e)):void 0;if(n&&!At(a))return a;var i=as(r)?xt(sh(e)):void 0;if(n&&i)return i;var o=is(r)?xt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ht(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function ZP(e,t,r){if(e&&!At(t)){var n={},a=rs(r),i=JSON.stringify(t),o=!os(a);return ns(a)&&(n[Ir]=dn(Ir,t,xt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Ir]:as(a)&&(n[$r]=dn($r,t,xt(sh(e))),zP(e,i),o)?n[$r]:is(a)&&(n[Tr]=dn(Tr,t,xt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Tr]:(n[Sr]=dn(Sr,t,ht(e)),vt(e,t),o?n[Sr]:n)}}function JP(e,t){if(e){var r=rs(t),n=lh(e,Kd),a={};return!At(n.localStorage)&&ns(r)&&(localStorage.removeItem(e),a[Ir]=n.localStorage),!At(n.cookie)&&as(r)&&(ch(e),a[$r]=n.cookie),!At(n.sessionStorage)&&is(r)&&(sessionStorage.removeItem(e),a[Tr]=n.sessionStorage),!At(n.global)&&ca(r,Sr)&&(Qt(e),a[Sr]=n.global),a}}function rs(e){return e?Je(e)?e:e.storage:Gd}function ns(e){return KP&&ca(e,Ir)}function as(e){return VP&&ca(e,$r)}function is(e){return WP&&ca(e,Tr)}function os(e){return e===Kd||e==="all"}function ca(e,t){return e===Gd||e===t||os(e)}function dn(e,t,r){return{location:e,current:t,previous:r}}var YP={setItem:ZP,getItem:lh,removeItem:JP};function XP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ol(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?il(Object(r),!0).forEach(function(n){XP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):il(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:YP};return BP(ol(ol({},t),e))}function QP(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function eE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=rE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function tE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function rE(e){return["#","?"].forEach(t=>e=tE(e,t)),e}function nE(){eE(()=>{Me.page()})}function aE(e){if(e===void 0&&(e={}),!Q)return ao;var t=cl(),r=so(),n=sl(),a=hn(n,t),i=hn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return ao;var h=d.map(function(S){return Number(S)}),v=mP(function(){var S=cl(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),T=so(),I=sl(),w=hn(I,S),p=hn(T,S);if(l=w>l?w:l,c=p<c?p:c,!(o.length>=h.length)){var $=f===I,O="up";$?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||$)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(K){return K!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=w?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ce(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,J=M.direction;ce(e[F])&&e[F]({trigger:F,direction:J,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function so(){return Q?document.body.scrollTop||document.documentElement.scrollTop:0}function iE(){return Q?window.innerHeight||document.documentElement.clientHeight:0}function sl(){return Math.round(so()+iE())}function cl(){if(!Q)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function hn(e,t){return Math.round(e/t*100)}var ul="EventListener";function oE(e){return function(t,r,n,a){var i=n||ao,o=a||!1;if(!Q)return i;var s=Dn(r),u=Dn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+ul:"remove"+ul,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?sE(i):i:f[h]||i;for(var S=0;S<s.length;S++)v[d]?v["on"+s[S]]=c?f[h]:null:v[d](s[S],f[h],o)}return l.bind(null,!c)}(e)}}function Dn(e,t){if(Je(e))return t?Dn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=fP(e);return t?i.map(function(o){return Je(o)?Dn(o,!0):o}).flat():i}function sE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var $i=oE("Event");function fh(e,t){return Q&&ce(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ce(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}fh.bind(null,"onerror");fh.bind(null,"onload");var dh=typeof window>"u",ll="hidden";function cE(e){if(dh)return!1;var t=uE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function uE(){var e=["webkit","moz","ms","o"];return dh||ll in document?ll:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var lE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function fE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=cE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(lE.map(function(s){return $i(document,s,r)})).concat($i(window,"load",r)).concat($i(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function dE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(lr(d),g),a&&l&&(l=!1,a(lr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(lr(d),g))},s)}var S=fE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=S();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:lr(d,c),idle:l?lr(r,c):0}}}}function lr(e,t){return t?0:Math.round((new Date-e)/1e3)}const fl=5e3;class hE{constructor(t){de(this,"element");de(this,"isInViewport",!1);de(this,"isAwake",!1);de(this,"isFlushing");de(this,"observer");de(this,"lastEventAt",Date.now());de(this,"registeredView",!1);de(this,"viewCallback");de(this,"activeDurationCallback");de(this,"idleDurationCallback");de(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),dE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:fl}),aE({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*fl:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const dl="sesamy_session_id";function vE(){let e=sessionStorage.getItem(dl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(dl,e)),e}let hh=!1,co,hl,Mn;const vh=new Map;function pE({clientId:e,enabled:t=!0,environment:r}){if(co=e,hl=t,Mn=`${Fe("logs",r)}/events`,!hl)return;window.addEventListener("beforeunload",()=>{mh.forEach((a,i)=>{a.bind(i)()}),gE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&vh.forEach((a,i)=>{a.bind(i)()})}),nE();const n=new hE({element:document.body,viewCallback:()=>{Me.page()},activeDurationCallback:(a,i,o)=>{Me.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Me.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Me.track("scroll",{scroll:a.scrollMax})}});yE(document.body,()=>{n.flush()}),wE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ke.AUTHENTICATED,async a=>{const i=a;await Me.identify(i.detail.sub)}),window.addEventListener(ke.LOGOUT,async()=>{await Me.track("logout",{}),ss.flush(),await Me.reset()})}function ph(e){return JSON.stringify(e.map(t=>({...t,clientId:co,requestId:Math.random().toString(36).slice(2,9),sessionId:vE(),timestamp:new Date().toISOString(),version:es,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:Hd,userAgent:navigator.userAgent,clientId:co}})))}const ss=QP(async e=>{if(e.length>0){const t=ph(e);hh?navigator.sendBeacon(Mn,t):(await fetch(Mn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ii(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Mn,ph([r]))}else ss.push(e)}const Me=qP({app:Hd,version:es,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ii({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ii({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ii({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function mE(e,t){Me.track(e,t)}function gE(){return hh=!0,ss.flush()}const mh=new Map;function yE(e,t){mh.set(e,t)}function wE(e,t){vh.set(e,t)}const bE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function SE(){return new Promise(e=>{const t=bE.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function $E(){const e=navigator.userAgent.toLowerCase(),t=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of t)if(r.regex.test(e))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function IE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:S,getProfile:g,updateProfile:T,getTags:I,deleteTag:w,setTag:p,getUserMetadata:$,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:J,deleteTally:L,getProduct:x,getPaymentIssues:z,isSpotifyLinked:R,unlinkSpotify:K,linkSpotify:q,autoOnboardProduct:Ne,openHostedAccountPage:m,generateLink:b}=tP(e),E={auth:{getUser:g,isAuthenticated:Or,loginWithRedirect:qo,logout:Nd,setToken:Dd},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:K},analytics:{track:mE},tags:{list:I,set:p,delete:w},entitlements:{get:a,list:i,access:o,signedLinks:Qo},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:$,list:O,set:_,delete:k},tallies:{get:M,list:F,push:J,delete:L},subscriptions:{list:u},transactions:{get:v,list:S},products:{get:x,autoOnboard:Ne,linkSpotify:q},browser:{detectAdblock:SE,isInAppBrowser:$E},getVersion:TE,getPaymentIssues:z,generateLink:b,clearCache:Te};return e.namespace&&(window[e.namespace]=E),E}function TE(){return es}function PE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
7
7
  ${t.selector}::before {
8
8
  content: '';
9
9
  position: absolute;
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw
14
14
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
15
15
  pointer-events: none;
16
16
  }
17
- `,document.head.appendChild(i)}async function gh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function EE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await gh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function OE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await gh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function kE({enabled:e=!1,rules:t}){if(!e)return;const r=await Or(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await EE(s,a);break;case"replace":await OE(s,a);break;case"remove":o.remove();break;case"gradient":PE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}function _E(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Dd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const vl="sesamy-refresh",pl="force-refetch-entitlements";function RE(){const e=new URLSearchParams(window.location.search),t=e.get(pl),r=e.get(vl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(pl),e.delete(vl),n.search=e.toString(),Te(),window.history.replaceState(null,"",n)}}function CE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function AE(){const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const n=CE(t),a=new Date(n.exp*1e3),i={id:"",title:"Signed link",sku:n.s.toString(),purchaseOptionsId:n.pid.toString(),url:n.url.toString(),token:t,type:"article",expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};eP(i)}catch{}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const ml="sesamy-user";async function jE(){var a;const t=(a=new URLSearchParams(window.location.search).get(ml))==null?void 0:a.toLowerCase();if(!t)return;const r=await DT();(r==null?void 0:r.email)!==t&&(Te(),Xo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const gl="sesamy-purchase";function LE(){const e=new URLSearchParams(window.location.search),t=e.get(gl);if(t!==null){const r=new URL(window.location.href);e.delete(gl),r.search=e.toString(),qe(ke.PURCHASE,{itemSrc:t}),Te(),window.history.replaceState(null,"",r)}}const yl="sesamy-login",UE="sesamy_login";async function NE(){const e=new URLSearchParams(window.location.search);if(!(e.get(yl)||e.get(UE)))return;await Or()||Xo();const n=new URL(window.location.href);n.searchParams.delete(yl),window.history.replaceState(null,"",n)}const xE=typeof window<"u";async function wl(e){pE({clientId:e.clientId,environment:e.environment,...e.analytics}),await xT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await kE(e.transform),_E(),RE(),AE(),await NE(),await jE(),LE(),qe(ke.READY,{})}async function yh(e){const t=IE({clientId:e.clientId,environment:e.environment,...e.api});return xE&&(e.awaitAllServices?await wl(e):wl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);yh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=yh;
17
+ `,document.head.appendChild(i)}async function gh(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function EE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await gh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function OE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await gh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function kE({enabled:e=!1,rules:t}){if(!e)return;const r=await Or(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await EE(s,a);break;case"replace":await OE(s,a);break;case"remove":o.remove();break;case"gradient":PE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}function _E(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Dd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const vl="sesamy-refresh",pl="force-refetch-entitlements";function RE(){const e=new URLSearchParams(window.location.search),t=e.get(pl),r=e.get(vl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(pl),e.delete(vl),n.search=e.toString(),Te(),window.history.replaceState(null,"",n)}}function CE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function AE(){const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const n=CE(t),a=new Date(n.exp*1e3),i={id:"",title:"Signed link",sku:n.s.toString(),purchaseOptionsId:n.pid.toString(),url:n.url.toString(),token:t,type:"article",expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};eP(i)}catch{}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const ml="sesamy-user";async function jE(){var a;const t=(a=new URLSearchParams(window.location.search).get(ml))==null?void 0:a.toLowerCase();if(!t)return;const r=await DT();(r==null?void 0:r.email)!==t&&(Te(),qo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const gl="sesamy-purchase";function LE(){const e=new URLSearchParams(window.location.search),t=e.get(gl);if(t!==null){const r=new URL(window.location.href);e.delete(gl),r.search=e.toString(),qe(ke.PURCHASE,{itemSrc:t}),Te(),window.history.replaceState(null,"",r)}}const yl="sesamy-login",UE="sesamy_login";async function NE(){const e=new URLSearchParams(window.location.search);if(!(e.get(yl)||e.get(UE)))return;await Or()||qo();const n=new URL(window.location.href);n.searchParams.delete(yl),window.history.replaceState(null,"",n)}const xE=typeof window<"u";async function wl(e){pE({clientId:e.clientId,environment:e.environment,...e.analytics}),await xT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await kE(e.transform),_E(),RE(),AE(),await NE(),await jE(),LE(),qe(ke.READY,{})}async function yh(e){const t=IE({clientId:e.clientId,environment:e.environment,...e.api});return xE&&(e.awaitAllServices?await wl(e):wl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);yh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=yh;