@sesamy/sesamy-js 1.19.7 → 1.19.9
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.
- package/README.md +80 -2
- package/dist/sesamy-js.cjs +4 -4
- package/dist/sesamy-js.d.ts +127 -44
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +219 -179
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var pv=Object.defineProperty;var mv=(e,t,r)=>t in e?pv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>mv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},q=function(e){try{return!!e()}catch{return!0}},gv=q,Un=!gv(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),yl=Un,wl=Function.prototype,Si=wl.call,yv=yl&&wl.bind.bind(Si,Si),K=yl?yv:function(e){return function(){return Si.apply(e,arguments)}},bl=K,wv=bl({}.toString),bv=bl("".slice),xn=function(e){return bv(wv(e),8,-1)},Sv=K,$v=q,Iv=xn,sa=Object,Tv=Sv("".split),Sl=$v(function(){return!sa("z").propertyIsEnumerable(0)})?function(e){return Iv(e)==="String"?Tv(e,""):sa(e)}:sa,Dn=function(e){return e==null},Ev=Dn,Pv=TypeError,Mn=function(e){if(Ev(e))throw new Pv("Can't call method on "+e);return e},Ov=Sl,kv=Mn,Pr=function(e){return Ov(kv(e))},Qt=function(e){return e&&e.Math===Math&&e},H=Qt(typeof globalThis=="object"&&globalThis)||Qt(typeof window=="object"&&window)||Qt(typeof self=="object"&&self)||Qt(typeof Ur=="object"&&Ur)||Qt(typeof Ur=="object"&&Ur)||function(){return this}()||Function("return this")(),$l={exports:{}},_v=!1,os=H,Rv=Object.defineProperty,oo=function(e,t){try{Rv(os,e,{value:t,configurable:!0,writable:!0})}catch{os[e]=t}return t},Cv=H,Av=oo,ss="__core-js_shared__",cs=$l.exports=Cv[ss]||Av(ss,{});(cs.versions||(cs.versions=[])).push({version:"3.38.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"});var so=$l.exports,us=so,Il=function(e,t){return us[e]||(us[e]=t||{})},jv=Mn,Lv=Object,Fn=function(e){return Lv(jv(e))},Nv=K,Uv=Fn,xv=Nv({}.hasOwnProperty),me=Object.hasOwn||function(t,r){return xv(Uv(t),r)},Dv=K,Mv=0,Fv=Math.random(),zv=Dv(1 .toString),Tl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+zv(++Mv+Fv,36)},Bv=H,ls=Bv.navigator,fs=ls&&ls.userAgent,Or=fs?String(fs):"",El=H,ca=Or,ds=El.process,vs=El.Deno,hs=ds&&ds.versions||vs&&vs.version,ps=hs&&hs.v8,$e,wn;ps&&($e=ps.split("."),wn=$e[0]>0&&$e[0]<4?1:+($e[0]+$e[1]));!wn&&ca&&($e=ca.match(/Edge\/(\d+)/),(!$e||$e[1]>=74)&&($e=ca.match(/Chrome\/(\d+)/),$e&&(wn=+$e[1])));var Pl=wn,ms=Pl,Hv=q,Kv=H,Gv=Kv.String,Ol=!!Object.getOwnPropertySymbols&&!Hv(function(){var e=Symbol("symbol detection");return!Gv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ms&&ms<41}),Wv=Ol,kl=Wv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Vv=H,Zv=Il,gs=me,Jv=Tl,Yv=Ol,Xv=kl,Ot=Vv.Symbol,ua=Zv("wks"),qv=Xv?Ot.for||Ot:Ot&&Ot.withoutSetter||Jv,Q=function(e){return gs(ua,e)||(ua[e]=Yv&&gs(Ot,e)?Ot[e]:qv("Symbol."+e)),ua[e]},la=typeof document=="object"&&document.all,W=typeof la>"u"&&la!==void 0?function(e){return typeof e=="function"||e===la}:function(e){return typeof e=="function"},Qv=W,ge=function(e){return typeof e=="object"?e!==null:Qv(e)},eh=ge,th=String,rh=TypeError,Ee=function(e){if(eh(e))return e;throw new rh(th(e)+" is not an object")},_l={},nh=q,ee=!nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ah=ee,ih=q,Rl=ah&&ih(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ae={},oh=H,ys=ge,$i=oh.document,sh=ys($i)&&ys($i.createElement),zn=function(e){return sh?$i.createElement(e):{}},ch=ee,uh=q,lh=zn,Cl=!ch&&!uh(function(){return Object.defineProperty(lh("div"),"a",{get:function(){return 7}}).a!==7}),fh=Un,xr=Function.prototype.call,te=fh?xr.bind(xr):function(){return xr.apply(xr,arguments)},fa=H,dh=W,vh=function(e){return dh(e)?e:void 0},Pe=function(e,t){return arguments.length<2?vh(fa[e]):fa[e]&&fa[e][t]},hh=K,Bn=hh({}.isPrototypeOf),ph=Pe,mh=W,gh=Bn,yh=kl,wh=Object,Al=yh?function(e){return typeof e=="symbol"}:function(e){var t=ph("Symbol");return mh(t)&&gh(t.prototype,wh(e))},bh=String,Hn=function(e){try{return bh(e)}catch{return"Object"}},Sh=W,$h=Hn,Ih=TypeError,Oe=function(e){if(Sh(e))return e;throw new Ih($h(e)+" is not a function")},Th=Oe,Eh=Dn,co=function(e,t){var r=e[t];return Eh(r)?void 0:Th(r)},da=te,va=W,ha=ge,Ph=TypeError,Oh=function(e,t){var r,n;if(t==="string"&&va(r=e.toString)&&!ha(n=da(r,e))||va(r=e.valueOf)&&!ha(n=da(r,e))||t!=="string"&&va(r=e.toString)&&!ha(n=da(r,e)))return n;throw new Ph("Can't convert object to primitive value")},kh=te,ws=ge,bs=Al,_h=co,Rh=Oh,Ch=Q,Ah=TypeError,jh=Ch("toPrimitive"),Lh=function(e,t){if(!ws(e)||bs(e))return e;var r=_h(e,jh),n;if(r){if(t===void 0&&(t="default"),n=kh(r,e,t),!ws(n)||bs(n))return n;throw new Ah("Can't convert object to primitive value")}return t===void 0&&(t="number"),Rh(e,t)},Nh=Lh,Uh=Al,jl=function(e){var t=Nh(e,"string");return Uh(t)?t:t+""},xh=ee,Dh=Cl,Mh=Rl,Dr=Ee,Ss=jl,Fh=TypeError,pa=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,ma="enumerable",ga="configurable",ya="writable";Ae.f=xh?Mh?function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ya in n&&!n[ya]){var a=zh(t,r);a&&a[ya]&&(t[r]=n.value,n={configurable:ga in n?n[ga]:a[ga],enumerable:ma in n?n[ma]:a[ma],writable:!1})}return pa(t,r,n)}:pa:function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),Dh)try{return pa(t,r,n)}catch{}if("get"in n||"set"in n)throw new Fh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Bh=Math.ceil,Hh=Math.floor,Kh=Math.trunc||function(t){var r=+t;return(r>0?Hh:Bh)(r)},Gh=Kh,uo=function(e){var t=+e;return t!==t||t===0?0:Gh(t)},Wh=uo,Vh=Math.max,Zh=Math.min,Jh=function(e,t){var r=Wh(e);return r<0?Vh(r+t,0):Zh(r,t)},Yh=uo,Xh=Math.min,qh=function(e){var t=Yh(e);return t>0?Xh(t,9007199254740991):0},Qh=qh,lo=function(e){return Qh(e.length)},ep=Pr,tp=Jh,rp=lo,$s=function(e){return function(t,r,n){var a=ep(t),i=rp(a);if(i===0)return!e&&-1;var o=tp(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}},np={includes:$s(!0),indexOf:$s(!1)},fo={},ap=K,wa=me,ip=Pr,op=np.indexOf,sp=fo,Is=ap([].push),Ll=function(e,t){var r=ip(e),n=0,a=[],i;for(i in r)!wa(sp,i)&&wa(r,i)&&Is(a,i);for(;t.length>n;)wa(r,i=t[n++])&&(~op(a,i)||Is(a,i));return a},vo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],cp=Ll,up=vo,Nl=Object.keys||function(t){return cp(t,up)},lp=ee,fp=Rl,dp=Ae,vp=Ee,hp=Pr,pp=Nl;_l.f=lp&&!fp?Object.defineProperties:function(t,r){vp(t);for(var n=hp(r),a=pp(r),i=a.length,o=0,s;i>o;)dp.f(t,s=a[o++],n[s]);return t};var mp=Pe,Ul=mp("document","documentElement"),gp=Il,yp=Tl,Ts=gp("keys"),ho=function(e){return Ts[e]||(Ts[e]=yp(e))},wp=Ee,bp=_l,Es=vo,Sp=fo,$p=Ul,Ip=zn,Tp=ho,Ps=">",Os="<",Ii="prototype",Ti="script",xl=Tp("IE_PROTO"),ba=function(){},Dl=function(e){return Os+Ti+Ps+e+Os+"/"+Ti+Ps},ks=function(e){e.write(Dl("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ep=function(){var e=Ip("iframe"),t="java"+Ti+":",r;return e.style.display="none",$p.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Dl("document.F=Object")),r.close(),r.F},Mr,fn=function(){try{Mr=new ActiveXObject("htmlfile")}catch{}fn=typeof document<"u"?document.domain&&Mr?ks(Mr):Ep():ks(Mr);for(var e=Es.length;e--;)delete fn[Ii][Es[e]];return fn()};Sp[xl]=!0;var Kn=Object.create||function(t,r){var n;return t!==null?(ba[Ii]=wp(t),n=new ba,ba[Ii]=null,n[xl]=t):n=fn(),r===void 0?n:bp.f(n,r)},Pp=Q,Op=Kn,kp=Ae.f,Ei=Pp("unscopables"),Pi=Array.prototype;Pi[Ei]===void 0&&kp(Pi,Ei,{configurable:!0,value:Op(null)});var _p=function(e){Pi[Ei][e]=!0},kr={},Rp=H,Cp=W,_s=Rp.WeakMap,Ap=Cp(_s)&&/native code/.test(String(_s)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},jp=ee,Lp=Ae,Np=vt,ht=jp?function(e,t,r){return Lp.f(e,t,Np(1,r))}:function(e,t,r){return e[t]=r,e},Up=Ap,Ml=H,xp=ge,Dp=ht,Sa=me,$a=so,Mp=ho,Fp=fo,Rs="Object already initialized",Oi=Ml.TypeError,zp=Ml.WeakMap,bn,Ir,Sn,Bp=function(e){return Sn(e)?Ir(e):bn(e,{})},Hp=function(e){return function(t){var r;if(!xp(t)||(r=Ir(t)).type!==e)throw new Oi("Incompatible receiver, "+e+" required");return r}};if(Up||$a.state){var ke=$a.state||($a.state=new zp);ke.get=ke.get,ke.has=ke.has,ke.set=ke.set,bn=function(e,t){if(ke.has(e))throw new Oi(Rs);return t.facade=e,ke.set(e,t),t},Ir=function(e){return ke.get(e)||{}},Sn=function(e){return ke.has(e)}}else{var gt=Mp("state");Fp[gt]=!0,bn=function(e,t){if(Sa(e,gt))throw new Oi(Rs);return t.facade=e,Dp(e,gt,t),t},Ir=function(e){return Sa(e,gt)?e[gt]:{}},Sn=function(e){return Sa(e,gt)}}var Wt={set:bn,get:Ir,has:Sn,enforce:Bp,getterFor:Hp},po={},mo={},Fl={}.propertyIsEnumerable,zl=Object.getOwnPropertyDescriptor,Kp=zl&&!Fl.call({1:2},1);mo.f=Kp?function(t){var r=zl(this,t);return!!r&&r.enumerable}:Fl;var Gp=ee,Wp=te,Vp=mo,Zp=vt,Jp=Pr,Yp=jl,Xp=me,qp=Cl,Cs=Object.getOwnPropertyDescriptor;po.f=Gp?Cs:function(t,r){if(t=Jp(t),r=Yp(r),qp)try{return Cs(t,r)}catch{}if(Xp(t,r))return Zp(!Wp(Vp.f,t,r),t[r])};var Bl={exports:{}},ki=ee,Qp=me,Hl=Function.prototype,em=ki&&Object.getOwnPropertyDescriptor,go=Qp(Hl,"name"),tm=go&&(function(){}).name==="something",rm=go&&(!ki||ki&&em(Hl,"name").configurable),Kl={EXISTS:go,PROPER:tm,CONFIGURABLE:rm},nm=K,am=W,_i=so,im=nm(Function.toString);am(_i.inspectSource)||(_i.inspectSource=function(e){return im(e)});var yo=_i.inspectSource,wo=K,om=q,sm=W,Fr=me,Ri=ee,cm=Kl.CONFIGURABLE,um=yo,Gl=Wt,lm=Gl.enforce,fm=Gl.get,As=String,dn=Object.defineProperty,dm=wo("".slice),vm=wo("".replace),hm=wo([].join),pm=Ri&&!om(function(){return dn(function(){},"length",{value:8}).length!==8}),mm=String(String).split("String"),gm=Bl.exports=function(e,t,r){dm(As(t),0,7)==="Symbol("&&(t="["+vm(As(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Fr(e,"name")||cm&&e.name!==t)&&(Ri?dn(e,"name",{value:t,configurable:!0}):e.name=t),pm&&r&&Fr(r,"arity")&&e.length!==r.arity&&dn(e,"length",{value:r.arity});try{r&&Fr(r,"constructor")&&r.constructor?Ri&&dn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=lm(e);return Fr(n,"source")||(n.source=hm(mm,typeof t=="string"?t:"")),e};Function.prototype.toString=gm(function(){return sm(this)&&fm(this).source||um(this)},"toString");var Wl=Bl.exports,ym=W,wm=Ae,bm=Wl,Sm=oo,ye=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(ym(r)&&bm(r,i,n),n.global)a?e[t]=r:Sm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:wm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Vl={},$m=Ll,Im=vo,Tm=Im.concat("length","prototype");Vl.f=Object.getOwnPropertyNames||function(t){return $m(t,Tm)};var bo={};bo.f=Object.getOwnPropertySymbols;var Em=Pe,Pm=K,Om=Vl,km=bo,_m=Ee,Rm=Pm([].concat),Cm=Em("Reflect","ownKeys")||function(t){var r=Om.f(_m(t)),n=km.f;return n?Rm(r,n(t)):r},js=me,Am=Cm,jm=po,Lm=Ae,Zl=function(e,t,r){for(var n=Am(t),a=Lm.f,i=jm.f,o=0;o<n.length;o++){var s=n[o];!js(e,s)&&!(r&&js(r,s))&&a(e,s,i(t,s))}},Nm=q,Um=W,xm=/#|\.prototype\./,_r=function(e,t){var r=Mm[Dm(e)];return r===zm?!0:r===Fm?!1:Um(t)?Nm(t):!!t},Dm=_r.normalize=function(e){return String(e).replace(xm,".").toLowerCase()},Mm=_r.data={},Fm=_r.NATIVE="N",zm=_r.POLYFILL="P",Jl=_r,zr=H,Bm=po.f,Hm=ht,Km=ye,Gm=oo,Wm=Zl,Vm=Jl,Y=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=zr:a?o=zr[r]||Gm(r,{}):o=zr[r]&&zr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Bm(o,s),u=l&&l.value):u=o[s],i=Vm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Wm(f,u)}(e.sham||u&&u.sham)&&Hm(f,"sham",!0),Km(o,s,f,e)}},Zm=q,Jm=!Zm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ym=me,Xm=W,qm=Fn,Qm=ho,eg=Jm,Ls=Qm("IE_PROTO"),Ci=Object,tg=Ci.prototype,So=eg?Ci.getPrototypeOf:function(e){var t=qm(e);if(Ym(t,Ls))return t[Ls];var r=t.constructor;return Xm(r)&&t instanceof r?r.prototype:t instanceof Ci?tg:null},rg=q,ng=W,ag=ge,Ns=So,ig=ye,og=Q,Ai=og("iterator"),Yl=!1,ut,Ia,Ta;[].keys&&(Ta=[].keys(),"next"in Ta?(Ia=Ns(Ns(Ta)),Ia!==Object.prototype&&(ut=Ia)):Yl=!0);var sg=!ag(ut)||rg(function(){var e={};return ut[Ai].call(e)!==e});sg&&(ut={});ng(ut[Ai])||ig(ut,Ai,function(){return this});var Xl={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Yl},cg=Ae.f,ug=me,lg=Q,Us=lg("toStringTag"),Vt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ug(e,Us)&&cg(e,Us,{configurable:!0,value:t})},fg=Xl.IteratorPrototype,dg=Kn,vg=vt,hg=Vt,pg=kr,mg=function(){return this},ql=function(e,t,r,n){var a=t+" Iterator";return e.prototype=dg(fg,{next:vg(+!n,r)}),hg(e,a,!1),pg[a]=mg,e},gg=K,yg=Oe,wg=function(e,t,r){try{return gg(yg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},bg=ge,Sg=function(e){return bg(e)||e===null},$g=Sg,Ig=String,Tg=TypeError,Eg=function(e){if($g(e))return e;throw new Tg("Can't set "+Ig(e)+" as a prototype")},Pg=wg,Og=ge,kg=Mn,_g=Eg,$o=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Pg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return kg(a),_g(i),Og(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Rg=Y,Cg=te,Ql=Kl,Ag=W,jg=ql,xs=So,Ds=$o,Lg=Vt,Ng=ht,Ea=ye,Ug=Q,xg=kr,ef=Xl,Dg=Ql.PROPER,Mg=Ql.CONFIGURABLE,Ms=ef.IteratorPrototype,Br=ef.BUGGY_SAFARI_ITERATORS,er=Ug("iterator"),Fs="keys",tr="values",zs="entries",Fg=function(){return this},tf=function(e,t,r,n,a,i,o){jg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Br&&T&&T in l)return l[T];switch(T){case Fs:return function(){return new r(this,T)};case tr: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[er]||l["@@iterator"]||a&&l[a],d=!Br&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=xs(v.call(new e)),p!==Object.prototype&&p.next&&(xs(p)!==Ms&&(Ds?Ds(p,Ms):Ag(p[er])||Ea(p,er,Fg)),Lg(p,u,!0))),Dg&&a===tr&&c&&c.name!==tr&&(Mg?Ng(l,"name",tr):(f=!0,d=function(){return Cg(c,this)})),a)if(S={values:s(tr),keys:i?d:s(Fs),entries:s(zs)},o)for(g in S)(Br||f||!(g in l))&&Ea(l,g,S[g]);else Rg({target:t,proto:!0,forced:Br||f},S);return l[er]!==d&&Ea(l,er,d,{name:a}),xg[t]=d,S},Io=function(e,t){return{value:e,done:t}},zg=Pr,To=_p,Bs=kr,rf=Wt,Bg=Ae.f,Hg=tf,Hr=Io,Kg=ee,nf="Array Iterator",Gg=rf.set,Wg=rf.getterFor(nf),Vg=Hg(Array,"Array",function(e,t){Gg(this,{type:nf,target:zg(e),index:0,kind:t})},function(){var e=Wg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Hr(void 0,!0);switch(e.kind){case"keys":return Hr(r,!1);case"values":return Hr(t[r],!1)}return Hr([r,t[r]],!1)},"values"),Hs=Bs.Arguments=Bs.Array;To("keys");To("values");To("entries");if(Kg&&Hs.name!=="values")try{Bg(Hs,"name",{value:"values"})}catch{}var Ks=H,Zg=ee,Jg=Object.getOwnPropertyDescriptor,af=function(e){if(!Zg)return Ks[e];var t=Jg(Ks,e);return t&&t.value},Yg=q,Xg=Q,qg=ee,Gs=_v,Qg=Xg("iterator"),Gn=!Yg(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),Gs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Gs||!qg)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Qg]||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"}),Ws=Wl,ey=Ae,Wn=function(e,t,r){return r.get&&Ws(r.get,t,{getter:!0}),r.set&&Ws(r.set,t,{setter:!0}),ey.f(e,t,r)},ty=ye,ry=function(e,t,r){for(var n in t)ty(e,n,t[n],r);return e},ny=Bn,ay=TypeError,Eo=function(e,t){if(ny(t,e))return e;throw new ay("Incorrect invocation")},iy=xn,oy=K,sy=function(e){if(iy(e)==="Function")return oy(e)},Vs=sy,cy=Oe,uy=Un,ly=Vs(Vs.bind),Zt=function(e,t){return cy(e),t===void 0?e:uy?ly(e,t):function(){return e.apply(t,arguments)}},fy=Q,dy=fy("toStringTag"),of={};of[dy]="z";var Po=String(of)==="[object z]",vy=Po,hy=W,vn=xn,py=Q,my=py("toStringTag"),gy=Object,yy=vn(function(){return arguments}())==="Arguments",wy=function(e,t){try{return e[t]}catch{}},Rr=vy?vn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=wy(t=gy(e),my))=="string"?r:yy?vn(t):(n=vn(t))==="Object"&&hy(t.callee)?"Arguments":n},by=Rr,Sy=String,Fe=function(e){if(by(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Sy(e)},$y=Rr,Zs=co,Iy=Dn,Ty=kr,Ey=Q,Py=Ey("iterator"),Vn=function(e){if(!Iy(e))return Zs(e,Py)||Zs(e,"@@iterator")||Ty[$y(e)]},Oy=te,ky=Oe,_y=Ee,Ry=Hn,Cy=Vn,Ay=TypeError,Oo=function(e,t){var r=arguments.length<2?Cy(e):t;if(ky(r))return _y(Oy(r,e));throw new Ay(Ry(e)+" is not iterable")},jy=TypeError,pt=function(e,t){if(e<t)throw new jy("Not enough arguments");return e},Ly=K,Zn=Ly([].slice),Js=Zn,Ny=Math.floor,ji=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=Ny(r/2),s=ji(Js(e,0,o),t),u=ji(Js(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},Uy=ji,Li=Y,Jn=H,ko=af,Kr=te,Ce=K,vr=ee,sf=Gn,cf=ye,xy=Wn,Dy=ry,My=Vt,Fy=ql,_o=Wt,uf=Eo,Pa=W,zy=me,By=Zt,Hy=Rr,Ky=Ee,lf=ge,ne=Fe,Gy=Kn,Ys=vt,Xs=Oo,Wy=Vn,Gr=Io,yt=pt,Vy=Q,Zy=Uy,Jy=Vy("iterator"),Jt="URLSearchParams",ff=Jt+"Iterator",df=_o.set,he=_o.getterFor(Jt),Yy=_o.getterFor(ff),qs=ko("fetch"),$n=ko("Request"),hr=ko("Headers"),Oa=$n&&$n.prototype,Qs=hr&&hr.prototype,Xy=Jn.RegExp,qy=Jn.TypeError,vf=Jn.decodeURIComponent,Qy=Jn.encodeURIComponent,ew=Ce("".charAt),ec=Ce([].join),at=Ce([].push),Ni=Ce("".replace),tw=Ce([].shift),tc=Ce([].splice),rc=Ce("".split),rw=Ce("".slice),nw=/\+/g,nc=Array(4),aw=function(e){return nc[e-1]||(nc[e-1]=Xy("((?:%[\\da-f]{2}){"+e+"})","gi"))},iw=function(e){try{return vf(e)}catch{return e}},ac=function(e){var t=Ni(e,nw," "),r=4;try{return vf(t)}catch{for(;r;)t=Ni(t,aw(r--),iw);return t}},ow=/[!'()~]|%20/g,sw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},cw=function(e){return sw[e]},ic=function(e){return Ni(Qy(e),ow,cw)},ka=Fy(function(t,r){df(this,{type:ff,target:he(t).entries,index:0,kind:r})},Jt,function(){var t=Yy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Gr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Gr(a.key,!1);case"values":return Gr(a.value,!1)}return Gr([a.key,a.value],!1)},!0),hf=function(e){this.entries=[],this.url=null,e!==void 0&&(lf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?ew(e,0)==="?"?rw(e,1):e:ne(e)))};hf.prototype={type:Jt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Wy(e),n,a,i,o,s,u,f;if(r)for(n=Xs(e,r),a=n.next;!(i=Kr(a,n)).done;){if(o=Xs(Ky(i.value)),s=o.next,(u=Kr(s,o)).done||(f=Kr(s,o)).done||!Kr(s,o).done)throw new qy("Expected sequence with length 2");at(t,{key:ne(u.value),value:ne(f.value)})}else for(var l in e)zy(e,l)&&at(t,{key:l,value:ne(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=rc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=rc(a,"="),at(t,{key:ac(tw(i)),value:ac(ec(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],at(t,ic(n.key)+"="+ic(n.value));return ec(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Yn=function(){uf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=df(this,new hf(t));vr||(this.size=r.entries.length)},Ut=Yn.prototype;Dy(Ut,{append:function(t,r){var n=he(this);yt(arguments.length,2),at(n.entries,{key:ne(t),value:ne(r)}),vr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=yt(arguments.length,1),n=t.entries,a=ne(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(tc(n,s,1),o!==void 0)break}else s++}vr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=[],i=0;i<r.length;i++)r[i].key===n&&at(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=yt(arguments.length,1),a=ne(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ne(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=he(this);yt(arguments.length,1);for(var a=n.entries,i=!1,o=ne(t),s=ne(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?tc(a,u--,1):(i=!0,f.value=s));i||at(a,{key:o,value:s}),vr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Zy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=By(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 ka(this,"keys")},values:function(){return new ka(this,"values")},entries:function(){return new ka(this,"entries")}},{enumerable:!0});cf(Ut,Jy,Ut.entries,{name:"entries"});cf(Ut,"toString",function(){return he(this).serialize()},{enumerable:!0});vr&&xy(Ut,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0});My(Yn,Jt);Li({global:!0,constructor:!0,forced:!sf},{URLSearchParams:Yn});if(!sf&&Pa(hr)){var uw=Ce(Qs.has),lw=Ce(Qs.set),oc=function(e){if(lf(e)){var t=e.body,r;if(Hy(t)===Jt)return r=e.headers?new hr(e.headers):new hr,uw(r,"content-type")||lw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Gy(e,{body:Ys(0,ne(t)),headers:Ys(0,r)})}return e};if(Pa(qs)&&Li({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return qs(t,arguments.length>1?oc(arguments[1]):{})}}),Pa($n)){var _a=function(t){return uf(this,Oa),new $n(t,arguments.length>1?oc(arguments[1]):{})};Oa.constructor=_a,_a.prototype=Oa,Li({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_a})}}var fw={URLSearchParams:Yn,getState:he},dw=ye,Xn=K,sc=Fe,vw=pt,pf=URLSearchParams,qn=pf.prototype,hw=Xn(qn.append),cc=Xn(qn.delete),pw=Xn(qn.forEach),mw=Xn([].push),Ro=new pf("a=1&a=2&b=3");Ro.delete("a",1);Ro.delete("b",void 0);Ro+""!="a=2"&&dw(qn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return cc(this,e);var n=[];pw(this,function(c,d){mw(n,{key:d,value:c})}),vw(t,1);for(var a=sc(e),i=sc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,cc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||hw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var gw=ye,mf=K,yw=Fe,ww=pt,gf=URLSearchParams,Co=gf.prototype,bw=mf(Co.getAll),Sw=mf(Co.has),uc=new gf("a=1");(uc.has("a",2)||!uc.has("a",void 0))&&gw(Co,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Sw(this,t);var a=bw(this,t);ww(r,1);for(var i=yw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var $w=ee,Iw=K,Tw=Wn,Ui=URLSearchParams.prototype,Ew=Iw(Ui.forEach);$w&&!("size"in Ui)&&Tw(Ui,"size",{get:function(){var t=0;return Ew(this,function(){t++}),t},configurable:!0,enumerable:!0});var Pw=H,Ao=Pw,Ow=Ao;Ow.URLSearchParams;var jo=K,kw=uo,_w=Fe,Rw=Mn,Cw=jo("".charAt),lc=jo("".charCodeAt),Aw=jo("".slice),fc=function(e){return function(t,r){var n=_w(Rw(t)),a=kw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=lc(n,a),o<55296||o>56319||a+1===i||(s=lc(n,a+1))<56320||s>57343?e?Cw(n,a):o:e?Aw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},yf={codeAt:fc(!1),charAt:fc(!0)},jw=yf.charAt,Lw=Fe,wf=Wt,Nw=tf,dc=Io,bf="String Iterator",Uw=wf.set,xw=wf.getterFor(bf);Nw(String,"String",function(e){Uw(this,{type:bf,string:Lw(e),index:0})},function(){var t=xw(this),r=t.string,n=t.index,a;return n>=r.length?dc(void 0,!0):(a=jw(r,n),t.index+=a.length,dc(a,!1))});var vc=ee,Dw=K,Mw=te,Fw=q,Ra=Nl,zw=bo,Bw=mo,Hw=Fn,Kw=Sl,wt=Object.assign,hc=Object.defineProperty,Gw=Dw([].concat),Ww=!wt||Fw(function(){if(vc&&wt({b:1},wt(hc({},"a",{enumerable:!0,get:function(){hc(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}),wt({},e)[r]!==7||Ra(wt({},t)).join("")!==n})?function(t,r){for(var n=Hw(t),a=arguments.length,i=1,o=zw.f,s=Bw.f;a>i;)for(var u=Kw(arguments[i++]),f=o?Gw(Ra(u),o(u)):Ra(u),l=f.length,c=0,d;l>c;)d=f[c++],(!vc||Mw(s,u,d))&&(n[d]=u[d]);return n}:wt,Vw=te,pc=Ee,Zw=co,Sf=function(e,t,r){var n,a;pc(e);try{if(n=Zw(e,"return"),!n){if(t==="throw")throw r;return r}n=Vw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return pc(n),r},Jw=Ee,Yw=Sf,Xw=function(e,t,r,n){try{return n?t(Jw(r)[0],r[1]):t(r)}catch(a){Yw(e,"throw",a)}},qw=Q,Qw=kr,eb=qw("iterator"),tb=Array.prototype,$f=function(e){return e!==void 0&&(Qw.Array===e||tb[eb]===e)},rb=K,nb=q,If=W,ab=Rr,ib=Pe,ob=yo,Tf=function(){},Ef=ib("Reflect","construct"),Lo=/^\s*(?:class|function)\b/,sb=rb(Lo.exec),cb=!Lo.test(Tf),rr=function(t){if(!If(t))return!1;try{return Ef(Tf,[],t),!0}catch{return!1}},Pf=function(t){if(!If(t))return!1;switch(ab(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return cb||!!sb(Lo,ob(t))}catch{return!0}};Pf.sham=!0;var Of=!Ef||nb(function(){var e;return rr(rr.call)||!rr(Object)||!rr(function(){e=!0})||e})?Pf:rr,ub=ee,lb=Ae,fb=vt,db=function(e,t,r){ub?lb.f(e,t,fb(0,r)):e[t]=r},vb=Zt,hb=te,pb=Fn,mb=Xw,gb=$f,yb=Of,wb=lo,mc=db,bb=Oo,Sb=Vn,gc=Array,$b=function(t){var r=pb(t),n=yb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=vb(i,a>2?arguments[2]:void 0));var s=Sb(r),u=0,f,l,c,d,v,p;if(s&&!(this===gc&&gb(s)))for(l=n?new this:[],d=bb(r,s),v=d.next;!(c=hb(v,d)).done;u++)p=o?mb(d,i,[c.value,u],!0):c.value,mc(l,u,p);else for(f=wb(r),l=n?new this(f):gc(f);f>u;u++)p=o?i(r[u],u):r[u],mc(l,u,p);return l.length=u,l},mt=K,Ca=2147483647,pr=36,kf=1,xi=26,Ib=38,Tb=700,Eb=72,Pb=128,Ob="-",kb=/[^\0-\u007E]/,_f=/[.\u3002\uFF0E\uFF61]/g,yc="Overflow: input needs wider integers to process",Aa=pr-kf,wc=RangeError,_b=mt(_f.exec),kt=Math.floor,ja=String.fromCharCode,bc=mt("".charCodeAt),Rf=mt([].join),We=mt([].push),Rb=mt("".replace),Cb=mt("".split),Ab=mt("".toLowerCase),jb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=bc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=bc(e,r++);(i&64512)===56320?We(t,((a&1023)<<10)+(i&1023)+65536):(We(t,a),r--)}else We(t,a)}return t},Sc=function(e){return e+22+75*(e<26)},Lb=function(e,t,r){var n=0;for(e=r?kt(e/Tb):e>>1,e+=kt(e/t);e>Aa*xi>>1;)e=kt(e/Aa),n+=pr;return kt(n+(Aa+1)*e/(e+Ib))},Nb=function(e){var t=[];e=jb(e);var r=e.length,n=Pb,a=0,i=Eb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&We(t,ja(s));var u=t.length,f=u;for(u&&We(t,Ob);f<r;){var l=Ca;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((Ca-a)/c))throw new wc(yc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Ca)throw new wc(yc);if(s===n){for(var d=a,v=pr;;){var p=v<=i?kf:v>=i+xi?xi:v-i;if(d<p)break;var S=d-p,g=pr-p;We(t,ja(Sc(p+S%g))),d=kt(S/g),v+=pr}We(t,ja(Sc(d))),i=Lb(a,c,f===u),a=0,f++}}a++,n++}return Rf(t,"")},Ub=function(e){var t=[],r=Cb(Rb(Ab(e),_f,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],We(t,_b(kb,a)?"xn--"+Nb(a):a);return Rf(t,".")},xb=Y,No=ee,Db=Gn,Uo=H,$c=Zt,we=K,In=ye,fe=Wn,Mb=Eo,Di=me,xo=Ww,bt=$b,be=Zn,Fb=yf.codeAt,zb=Ub,Ue=Fe,Bb=Vt,Hb=pt,Cf=fw,Af=Wt,Kb=Af.set,Tn=Af.getterFor("URL"),Gb=Cf.URLSearchParams,Wb=Cf.getState,nr=Uo.URL,Mi=Uo.TypeError,En=Uo.parseInt,Vb=Math.floor,Ic=Math.pow,pe=we("".charAt),Ie=we(/./.exec),ur=we([].join),Zb=we(1 .toString),Jb=we([].pop),Tt=we([].push),La=we("".replace),Yb=we([].shift),Xb=we("".split),mr=we("".slice),Pn=we("".toLowerCase),qb=we([].unshift),Qb="Invalid authority",Na="Invalid scheme",Xe="Invalid host",Tc="Invalid port",jf=/[a-z]/i,eS=/[\d+-.a-z]/i,Fi=/\d/,tS=/^0x/i,rS=/^[0-7]+$/,nS=/^\d+$/,Lf=/^[\da-f]+$/i,aS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,iS=/[\0\t\n\r #/:<>?@[\\\]^|]/,oS=/^[\u0000-\u0020]+/,sS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,cS=/[\t\n\r]/g,de,uS=function(e){var t=Xb(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&&pe(i,0)==="0"&&(o=Ie(tS,i)?16:8,i=mr(i,o===8?1:2)),i==="")s=0;else{if(!Ie(o===10?nS:o===8?rS:Lf,i))return e;s=En(i,o)}Tt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Ic(256,5-r))return null}else if(s>255)return null;for(u=Jb(n),a=0;a<n.length;a++)u+=n[a]*Ic(256,3-a);return u},lS=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 pe(e,a)};if(d()===":"){if(pe(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&&Ie(Lf,d());)i=i*16+En(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(!Ie(Fi,d()))return;for(;Ie(Fi,d());){if(f=En(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},fS=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},ar=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)qb(t,e%256),e=Vb(e/256);return ur(t,".")}if(typeof e=="object"){for(t="",n=fS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Zb(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},hn={},Nf=xo({},hn,{" ":1,'"':1,"<":1,">":1,"`":1}),Uf=xo({},Nf,{"#":1,"?":1,"{":1,"}":1}),Ua=xo({},Uf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Be=function(e,t){var r=Fb(e,0);return r>32&&r<127&&!Di(t,e)?e:encodeURIComponent(e)},Wr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},lr=function(e,t){var r;return e.length===2&&Ie(jf,pe(e,0))&&((r=pe(e,1))===":"||!t&&r==="|")},Ec=function(e){var t;return e.length>1&&lr(mr(e,0,2))&&(e.length===2||(t=pe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},dS=function(e){return e==="."||Pn(e)==="%2e"},vS=function(e){return e=Pn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},xa={},Pc={},Da={},Oc={},kc={},Ma={},_c={},Rc={},Vr={},Zr={},Fa={},za={},Ba={},Ha={},Cc={},Ka={},St={},_e={},Ac={},qe={},Ne={},Do=function(e,t,r){var n=Ue(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Mi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Do(r,!0)),i=this.parse(n,null,a),i)throw new Mi(i);o=Wb(new Gb),o.bindURL(this),this.searchParams=o}};Do.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||xa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(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=La(e,oS,""),e=La(e,sS,"$1")),e=La(e,cS,""),l=bt(e);i<=l.length;){switch(c=l[i],a){case xa:if(c&&Ie(jf,c))o+=Pn(c),a=Pc;else{if(t)return Na;a=Da;continue}break;case Pc:if(c&&(Ie(eS,c)||c==="+"||c==="-"||c==="."))o+=Pn(c);else if(c===":"){if(t&&(n.isSpecial()!==Di(Wr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Wr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ha:n.isSpecial()&&r&&r.scheme===n.scheme?a=Oc:n.isSpecial()?a=Rc:l[i+1]==="/"?(a=kc,i++):(n.cannotBeABaseURL=!0,Tt(n.path,""),a=Ac)}else{if(t)return Na;o="",a=Da,i=0;continue}break;case Da:if(!r||r.cannotBeABaseURL&&c!=="#")return Na;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=be(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Ne;break}a=r.scheme==="file"?Ha:Ma;continue;case Oc:if(c==="/"&&l[i+1]==="/")a=Vr,i++;else{a=Ma;continue}break;case kc:if(c==="/"){a=Zr;break}else{a=_e;continue}case Ma:if(n.scheme=r.scheme,c===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=_c;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query="",a=qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.path.length--,a=_e;continue}break;case _c:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Vr;else if(c==="/")a=Zr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=_e;continue}break;case Rc:if(a=Vr,c!=="/"||pe(o,i+1)!=="/")continue;i++;break;case Vr:if(c!=="/"&&c!=="\\"){a=Zr;continue}break;case Zr:if(c==="@"){s&&(o="%40"+o),s=!0,d=bt(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=Be(S,Ua);f?n.password+=g:n.username+=g}o=""}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return Qb;i-=bt(o).length+1,o="",a=Fa}else o+=c;break;case Fa:case za:if(t&&n.scheme==="file"){a=Ka;continue}else if(c===":"&&!u){if(o==="")return Xe;if(v=n.parseHost(o),v)return v;if(o="",a=Ba,t===za)return}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Xe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=St,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ba:if(Ie(Fi,c))o+=c;else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=En(o,10);if(T>65535)return Tc;n.port=n.isSpecial()&&T===Wr[n.scheme]?null:T,o=""}if(t)return;a=St;continue}else return Tc;break;case Ha:if(n.scheme="file",c==="/"||c==="\\")a=Cc;else if(r&&r.scheme==="file")switch(c){case de:n.host=r.host,n.path=be(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=be(r.path),n.query="",a=qe;break;case"#":n.host=r.host,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;break;default:Ec(ur(be(l,i),""))||(n.host=r.host,n.path=be(r.path),n.shortenPath()),a=_e;continue}else{a=_e;continue}break;case Cc:if(c==="/"||c==="\\"){a=Ka;break}r&&r.scheme==="file"&&!Ec(ur(be(l,i),""))&&(lr(r.path[0],!0)?Tt(n.path,r.path[0]):n.host=r.host),a=_e;continue;case Ka:if(c===de||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&lr(o))a=_e;else if(o===""){if(n.host="",t)return;a=St}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=St}continue}else o+=c;break;case St:if(n.isSpecial()){if(a=_e,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=qe;else if(!t&&c==="#")n.fragment="",a=Ne;else if(c!==de&&(a=_e,c!=="/"))continue;break;case _e:if(c===de||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(vS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,"")):dS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,""):(n.scheme==="file"&&!n.path.length&&lr(o)&&(n.host&&(n.host=""),o=pe(o,0)+":"),Tt(n.path,o)),o="",n.scheme==="file"&&(c===de||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Yb(n.path);c==="?"?(n.query="",a=qe):c==="#"&&(n.fragment="",a=Ne)}else o+=Be(c,Uf);break;case Ac:c==="?"?(n.query="",a=qe):c==="#"?(n.fragment="",a=Ne):c!==de&&(n.path[0]+=Be(c,hn));break;case qe:!t&&c==="#"?(n.fragment="",a=Ne):c!==de&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Be(c,hn));break;case Ne:c!==de&&(n.fragment+=Be(c,Nf));break}i++}},parseHost:function(e){var t,r,n;if(pe(e,0)==="["){if(pe(e,e.length-1)!=="]"||(t=lS(mr(e,1,-1)),!t))return Xe;this.host=t}else if(this.isSpecial()){if(e=zb(e),Ie(aS,e)||(t=uS(e),t===null))return Xe;this.host=t}else{if(Ie(iS,e))return Xe;for(t="",r=bt(e),n=0;n<r.length;n++)t+=Be(r[n],hn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Di(Wr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!lr(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+=ar(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+ur(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Mi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new xt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ar(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",xa)},getUsername:function(){return this.username},setUsername:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Be(t[r],Ua)}},getPassword:function(){return this.password},setPassword:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Be(t[r],Ua)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ar(e):ar(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Fa)},getHostname:function(){var e=this.host;return e===null?"":ar(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,za)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,Ba))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+ur(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,St))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(pe(e,0)==="?"&&(e=mr(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}pe(e,0)==="#"&&(e=mr(e,1)),this.fragment="",this.parse(e,Ne)},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var r=Mb(this,re),n=Hb(arguments.length,1)>1?arguments[1]:void 0,a=Kb(r,new Do(t,!1,n));No||(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())},re=xt.prototype,ve=function(e,t){return{get:function(){return Tn(this)[e]()},set:t&&function(r){return Tn(this)[t](r)},configurable:!0,enumerable:!0}};No&&(fe(re,"href",ve("serialize","setHref")),fe(re,"origin",ve("getOrigin")),fe(re,"protocol",ve("getProtocol","setProtocol")),fe(re,"username",ve("getUsername","setUsername")),fe(re,"password",ve("getPassword","setPassword")),fe(re,"host",ve("getHost","setHost")),fe(re,"hostname",ve("getHostname","setHostname")),fe(re,"port",ve("getPort","setPort")),fe(re,"pathname",ve("getPathname","setPathname")),fe(re,"search",ve("getSearch","setSearch")),fe(re,"searchParams",ve("getSearchParams")),fe(re,"hash",ve("getHash","setHash")));In(re,"toJSON",function(){return Tn(this).serialize()},{enumerable:!0});In(re,"toString",function(){return Tn(this).serialize()},{enumerable:!0});if(nr){var jc=nr.createObjectURL,Lc=nr.revokeObjectURL;jc&&In(xt,"createObjectURL",$c(jc,nr)),Lc&&In(xt,"revokeObjectURL",$c(Lc,nr))}Bb(xt,"URL");xb({global:!0,constructor:!0,forced:!Db,sham:!No},{URL:xt});var hS=Y,pS=Pe,xf=q,mS=pt,Nc=Fe,gS=Gn,Mo=pS("URL"),yS=gS&&xf(function(){Mo.canParse()}),wS=xf(function(){return Mo.canParse.length!==1});hS({target:"URL",stat:!0,forced:!yS||wS},{canParse:function(t){var r=mS(arguments.length,1),n=Nc(t),a=r<2||arguments[1]===void 0?void 0:Nc(arguments[1]);try{return!!new Mo(n,a)}catch{return!1}}});var bS=Y,SS=Pe,$S=pt,Uc=Fe,IS=Gn,TS=SS("URL");bS({target:"URL",stat:!0,forced:!IS},{parse:function(t){var r=$S(arguments.length,1),n=Uc(t),a=r<2||arguments[1]===void 0?void 0:Uc(arguments[1]);try{return new TS(n,a)}catch{return null}}});var ES=Y,PS=te;ES({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return PS(URL.prototype.toString,this)}});var OS=Ao;OS.URL;var kS={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},_S=zn,Ga=_S("span").classList,xc=Ga&&Ga.constructor&&Ga.constructor.prototype,RS=xc===Object.prototype?void 0:xc,Dc=H,Df=kS,CS=RS,fr=Vg,Mc=ht,AS=Vt,jS=Q,Wa=jS("iterator"),Va=fr.values,Mf=function(e,t){if(e){if(e[Wa]!==Va)try{Mc(e,Wa,Va)}catch{e[Wa]=Va}if(AS(e,t,!0),Df[t]){for(var r in fr)if(e[r]!==fr[r])try{Mc(e,r,fr[r])}catch{e[r]=fr[r]}}}};for(var Za in Df)Mf(Dc[Za]&&Dc[Za].prototype,Za);Mf(CS,"DOMTokenList");var LS=ge,NS=ht,US=function(e,t){LS(t)&&"cause"in t&&NS(e,"cause",t.cause)},xS=K,Ff=Error,DS=xS("".replace),MS=function(e){return String(new Ff(e).stack)}("zxcasd"),zf=/\n\s*at [^:]*:[^\n]*/,FS=zf.test(MS),zS=function(e,t){if(FS&&typeof e=="string"&&!Ff.prepareStackTrace)for(;t--;)e=DS(e,zf,"");return e},BS=q,HS=vt,KS=!BS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",HS(1,7)),e.stack!==7):!0}),GS=ht,WS=zS,VS=KS,Fc=Error.captureStackTrace,ZS=function(e,t,r,n){VS&&(Fc?Fc(e,t):GS(e,"stack",WS(r,n)))},JS=Zt,YS=te,XS=Ee,qS=Hn,QS=$f,e$=lo,zc=Bn,t$=Oo,r$=Vn,Bc=Sf,n$=TypeError,pn=function(e,t){this.stopped=e,this.result=t},Hc=pn.prototype,Cr=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=JS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&Bc(f,"normal",I),new pn(!0,I)},T=function(I){return a?(XS(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=r$(e),!l)throw new n$(qS(e)+" is not iterable");if(QS(l)){for(c=0,d=e$(e);d>c;c++)if(v=T(e[c]),v&&zc(Hc,v))return v;return new pn(!1)}f=t$(e,l)}for(p=i?e.next:f.next;!(S=YS(p,f)).done;){try{v=T(S.value)}catch(I){Bc(f,"throw",I)}if(typeof v=="object"&&v&&zc(Hc,v))return v}return new pn(!1)},a$=Fe,i$=function(e,t){return e===void 0?arguments.length<2?"":t:a$(e)},o$=Y,s$=Bn,c$=So,On=$o,u$=Zl,Bf=Kn,Ja=ht,Ya=vt,l$=US,f$=ZS,d$=Cr,v$=i$,h$=Q,p$=h$("toStringTag"),kn=Error,m$=[].push,Dt=function(t,r){var n=s$(Xa,this),a;On?a=On(new kn,n?c$(this):Xa):(a=n?this:Bf(Xa),Ja(a,p$,"Error")),r!==void 0&&Ja(a,"message",v$(r)),f$(a,Dt,a.stack,1),arguments.length>2&&l$(a,arguments[2]);var i=[];return d$(t,m$,{that:i}),Ja(a,"errors",i),a};On?On(Dt,kn):u$(Dt,kn,{name:!0});var Xa=Dt.prototype=Bf(kn.prototype,{constructor:Ya(1,Dt),message:Ya(1,""),name:Ya(1,"AggregateError")});o$({global:!0,constructor:!0,arity:2},{AggregateError:Dt});var g$=Po,y$=Rr,w$=g$?{}.toString:function(){return"[object "+y$(this)+"]"},b$=Po,S$=ye,$$=w$;b$||S$(Object.prototype,"toString",$$,{unsafe:!0});var ir=H,I$=Or,T$=xn,Jr=function(e){return I$.slice(0,e.length)===e},Hf=function(){return Jr("Bun/")?"BUN":Jr("Cloudflare-Workers")?"CLOUDFLARE":Jr("Deno/")?"DENO":Jr("Node.js/")?"NODE":ir.Bun&&typeof Bun.version=="string"?"BUN":ir.Deno&&typeof Deno.version=="object"?"DENO":T$(ir.process)==="process"?"NODE":ir.window&&ir.document?"BROWSER":"REST"}(),E$=Hf,Fo=E$==="NODE",P$=Pe,O$=Wn,k$=Q,_$=ee,Kc=k$("species"),R$=function(e){var t=P$(e);_$&&t&&!t[Kc]&&O$(t,Kc,{configurable:!0,get:function(){return this}})},C$=Of,A$=Hn,j$=TypeError,L$=function(e){if(C$(e))return e;throw new j$(A$(e)+" is not a constructor")},Gc=Ee,N$=L$,U$=Dn,x$=Q,D$=x$("species"),Kf=function(e,t){var r=Gc(e).constructor,n;return r===void 0||U$(n=Gc(r)[D$])?t:N$(n)},M$=Un,Gf=Function.prototype,Wc=Gf.apply,Vc=Gf.call,Wf=typeof Reflect=="object"&&Reflect.apply||(M$?Vc.bind(Wc):function(){return Vc.apply(Wc,arguments)}),F$=Or,Vf=/(?:ipad|iphone|ipod).*applewebkit/i.test(F$),ce=H,z$=Wf,B$=Zt,Zc=W,H$=me,Zf=q,Jc=Ul,K$=Zn,Yc=zn,G$=pt,W$=Vf,V$=Fo,zi=ce.setImmediate,Bi=ce.clearImmediate,Z$=ce.process,qa=ce.Dispatch,J$=ce.Function,Xc=ce.MessageChannel,Y$=ce.String,Qa=0,gr={},qc="onreadystatechange",Tr,Qe,ei,ti;Zf(function(){Tr=ce.location});var zo=function(e){if(H$(gr,e)){var t=gr[e];delete gr[e],t()}},ri=function(e){return function(){zo(e)}},Qc=function(e){zo(e.data)},eu=function(e){ce.postMessage(Y$(e),Tr.protocol+"//"+Tr.host)};(!zi||!Bi)&&(zi=function(t){G$(arguments.length,1);var r=Zc(t)?t:J$(t),n=K$(arguments,1);return gr[++Qa]=function(){z$(r,void 0,n)},Qe(Qa),Qa},Bi=function(t){delete gr[t]},V$?Qe=function(e){Z$.nextTick(ri(e))}:qa&&qa.now?Qe=function(e){qa.now(ri(e))}:Xc&&!W$?(ei=new Xc,ti=ei.port2,ei.port1.onmessage=Qc,Qe=B$(ti.postMessage,ti)):ce.addEventListener&&Zc(ce.postMessage)&&!ce.importScripts&&Tr&&Tr.protocol!=="file:"&&!Zf(eu)?(Qe=eu,ce.addEventListener("message",Qc,!1)):qc in Yc("script")?Qe=function(e){Jc.appendChild(Yc("script"))[qc]=function(){Jc.removeChild(this),zo(e)}}:Qe=function(e){setTimeout(ri(e),0)});var Jf={set:zi,clear:Bi},Yf=function(){this.head=null,this.tail=null};Yf.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 Xf=Yf,X$=Or,q$=/ipad|iphone|ipod/i.test(X$)&&typeof Pebble<"u",Q$=Or,eI=/web0s(?!.*chrome)/i.test(Q$),Mt=H,tI=af,tu=Zt,ni=Jf.set,rI=Xf,nI=Vf,aI=q$,iI=eI,ai=Fo,ru=Mt.MutationObserver||Mt.WebKitMutationObserver,nu=Mt.document,au=Mt.process,Yr=Mt.Promise,Hi=tI("queueMicrotask"),$t,ii,oi,Xr,iu;if(!Hi){var qr=new rI,Qr=function(){var e,t;for(ai&&(e=au.domain)&&e.exit();t=qr.get();)try{t()}catch(r){throw qr.head&&$t(),r}e&&e.enter()};!nI&&!ai&&!iI&&ru&&nu?(ii=!0,oi=nu.createTextNode(""),new ru(Qr).observe(oi,{characterData:!0}),$t=function(){oi.data=ii=!ii}):!aI&&Yr&&Yr.resolve?(Xr=Yr.resolve(void 0),Xr.constructor=Yr,iu=tu(Xr.then,Xr),$t=function(){iu(Qr)}):ai?$t=function(){au.nextTick(Qr)}:(ni=tu(ni,Mt),$t=function(){ni(Qr)}),Hi=function(e){qr.head||$t(),qr.add(e)}}var oI=Hi,sI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Yt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},cI=H,Ar=cI.Promise,uI=H,yr=Ar,lI=W,fI=Jl,dI=yo,vI=Q,ou=Hf,si=Pl;yr&&yr.prototype;var hI=vI("species"),Ki=!1,qf=lI(uI.PromiseRejectionEvent),pI=fI("Promise",function(){var e=dI(yr),t=e!==String(yr);if(!t&&si===66)return!0;if(!si||si<51||!/native code/.test(e)){var r=new yr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[hI]=n,Ki=r.then(function(){})instanceof n,!Ki)return!0}return!t&&(ou==="BROWSER"||ou==="DENO")&&!qf}),jr={CONSTRUCTOR:pI,REJECTION_EVENT:qf,SUBCLASSING:Ki},je={},su=Oe,mI=TypeError,gI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new mI("Bad Promise constructor");t=n,r=a}),this.resolve=su(t),this.reject=su(r)};je.f=function(e){return new gI(e)};var yI=Y,_n=Fo,Je=H,Ft=te,cu=ye,uu=$o,wI=Vt,bI=R$,SI=Oe,mn=W,$I=ge,II=Eo,TI=Kf,Qf=Jf.set,Bo=oI,EI=sI,PI=Yt,OI=Xf,ed=Wt,Rn=Ar,Ho=jr,td=je,Qn="Promise",rd=Ho.CONSTRUCTOR,kI=Ho.REJECTION_EVENT,_I=Ho.SUBCLASSING,ci=ed.getterFor(Qn),RI=ed.set,Et=Rn&&Rn.prototype,tt=Rn,en=Et,nd=Je.TypeError,Gi=Je.document,Ko=Je.process,Wi=td.f,CI=Wi,AI=!!(Gi&&Gi.createEvent&&Je.dispatchEvent),ad="unhandledrejection",jI="rejectionhandled",lu=0,id=1,LI=2,Go=1,od=2,tn,fu,NI,du,sd=function(e){var t;return $I(e)&&mn(t=e.then)?t:!1},cd=function(e,t){var r=t.value,n=t.state===id,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===od&&xI(t),t.rejection=Go),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new nd("Promise-chain cycle")):(f=sd(u))?Ft(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},ud=function(e,t){e.notified||(e.notified=!0,Bo(function(){for(var r=e.reactions,n;n=r.get();)cd(n,e);e.notified=!1,t&&!e.rejection&&UI(e)}))},ld=function(e,t,r){var n,a;AI?(n=Gi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Je.dispatchEvent(n)):n={promise:t,reason:r},!kI&&(a=Je["on"+e])?a(n):e===ad&&EI("Unhandled promise rejection",r)},UI=function(e){Ft(Qf,Je,function(){var t=e.facade,r=e.value,n=vu(e),a;if(n&&(a=PI(function(){_n?Ko.emit("unhandledRejection",r,t):ld(ad,t,r)}),e.rejection=_n||vu(e)?od:Go,a.error))throw a.value})},vu=function(e){return e.rejection!==Go&&!e.parent},xI=function(e){Ft(Qf,Je,function(){var t=e.facade;_n?Ko.emit("rejectionHandled",t):ld(jI,t,e.value)})},_t=function(e,t,r){return function(n){e(t,n,r)}},At=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=LI,ud(e,!0))},Vi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new nd("Promise can't be resolved itself");var n=sd(t);n?Bo(function(){var a={done:!1};try{Ft(n,t,_t(Vi,a,e),_t(At,a,e))}catch(i){At(a,i,e)}}):(e.value=t,e.state=id,ud(e,!1))}catch(a){At({done:!1},a,e)}}};if(rd&&(tt=function(t){II(this,en),SI(t),Ft(tn,this);var r=ci(this);try{t(_t(Vi,r),_t(At,r))}catch(n){At(r,n)}},en=tt.prototype,tn=function(t){RI(this,{type:Qn,done:!1,notified:!1,parent:!1,reactions:new OI,rejection:!1,state:lu,value:void 0})},tn.prototype=cu(en,"then",function(t,r){var n=ci(this),a=Wi(TI(this,tt));return n.parent=!0,a.ok=mn(t)?t:!0,a.fail=mn(r)&&r,a.domain=_n?Ko.domain:void 0,n.state===lu?n.reactions.add(a):Bo(function(){cd(a,n)}),a.promise}),fu=function(){var e=new tn,t=ci(e);this.promise=e,this.resolve=_t(Vi,t),this.reject=_t(At,t)},td.f=Wi=function(e){return e===tt||e===NI?new fu(e):CI(e)},mn(Rn)&&Et!==Object.prototype)){du=Et.then,_I||cu(Et,"then",function(t,r){var n=this;return new tt(function(a,i){Ft(du,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Et.constructor}catch{}uu&&uu(Et,en)}yI({global:!0,constructor:!0,wrap:!0,forced:rd},{Promise:tt});wI(tt,Qn,!1);bI(Qn);var DI=Q,fd=DI("iterator"),dd=!1;try{var MI=0,hu={next:function(){return{done:!!MI++}},return:function(){dd=!0}};hu[fd]=function(){return this},Array.from(hu,function(){throw 2})}catch{}var FI=function(e,t){try{if(!t&&!dd)return!1}catch{return!1}var r=!1;try{var n={};n[fd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},zI=Ar,BI=FI,HI=jr.CONSTRUCTOR,ea=HI||!BI(function(e){zI.all(e).then(void 0,function(){})}),KI=Y,GI=te,WI=Oe,VI=je,ZI=Yt,JI=Cr,YI=ea;KI({target:"Promise",stat:!0,forced:YI},{all:function(t){var r=this,n=VI.f(r),a=n.resolve,i=n.reject,o=ZI(function(){var s=WI(r.resolve),u=[],f=0,l=1;JI(t,function(c){var d=f++,v=!1;l++,GI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var XI=Y,qI=jr.CONSTRUCTOR,Zi=Ar,QI=Pe,e0=W,t0=ye,pu=Zi&&Zi.prototype;XI({target:"Promise",proto:!0,forced:qI,real:!0},{catch:function(e){return this.then(void 0,e)}});if(e0(Zi)){var mu=QI("Promise").prototype.catch;pu.catch!==mu&&t0(pu,"catch",mu,{unsafe:!0})}var r0=Y,n0=te,a0=Oe,i0=je,o0=Yt,s0=Cr,c0=ea;r0({target:"Promise",stat:!0,forced:c0},{race:function(t){var r=this,n=i0.f(r),a=n.reject,i=o0(function(){var o=a0(r.resolve);s0(t,function(s){n0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var u0=Y,l0=je,f0=jr.CONSTRUCTOR;u0({target:"Promise",stat:!0,forced:f0},{reject:function(t){var r=l0.f(this),n=r.reject;return n(t),r.promise}});var d0=Ee,v0=ge,h0=je,vd=function(e,t){if(d0(e),v0(t)&&t.constructor===e)return t;var r=h0.f(e),n=r.resolve;return n(t),r.promise},p0=Y,m0=Pe,g0=jr.CONSTRUCTOR,y0=vd;m0("Promise");p0({target:"Promise",stat:!0,forced:g0},{resolve:function(t){return y0(this,t)}});var w0=Y,b0=te,S0=Oe,$0=je,I0=Yt,T0=Cr,E0=ea;w0({target:"Promise",stat:!0,forced:E0},{allSettled:function(t){var r=this,n=$0.f(r),a=n.resolve,i=n.reject,o=I0(function(){var s=S0(r.resolve),u=[],f=0,l=1;T0(t,function(c){var d=f++,v=!1;l++,b0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var P0=Y,O0=te,k0=Oe,_0=Pe,R0=je,C0=Yt,A0=Cr,j0=ea,gu="No one promise resolved";P0({target:"Promise",stat:!0,forced:j0},{any:function(t){var r=this,n=_0("AggregateError"),a=R0.f(r),i=a.resolve,o=a.reject,s=C0(function(){var u=k0(r.resolve),f=[],l=0,c=1,d=!1;A0(t,function(v){var p=l++,S=!1;c++,O0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,gu)))})}),--c||o(new n(f,gu))});return s.error&&o(s.value),a.promise}});var L0=Y,N0=je;L0({target:"Promise",stat:!0},{withResolvers:function(){var t=N0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var U0=Y,Cn=Ar,x0=q,hd=Pe,pd=W,D0=Kf,yu=vd,M0=ye,Ji=Cn&&Cn.prototype,F0=!!Cn&&x0(function(){Ji.finally.call({then:function(){}},function(){})});U0({target:"Promise",proto:!0,real:!0,forced:F0},{finally:function(e){var t=D0(this,hd("Promise")),r=pd(e);return this.then(r?function(n){return yu(t,e()).then(function(){return n})}:e,r?function(n){return yu(t,e()).then(function(){throw n})}:e)}});if(pd(Cn)){var wu=hd("Promise").prototype.finally;Ji.finally!==wu&&M0(Ji,"finally",wu,{unsafe:!0})}var z0=Ao;z0.Promise;var B0=Y,H0=H,K0=Wf,G0=Zn,W0=je,V0=Oe,md=Yt,ui=H0.Promise,bu=!1,Z0=!ui||!ui.try||md(function(){ui.try(function(e){bu=e===8},8)}).error||!bu;B0({target:"Promise",stat:!0,forced:Z0},{try:function(e){var t=arguments.length>1?G0(arguments,1):[],r=W0.f(this),n=md(function(){return K0(V0(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function Ye(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Re(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 rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vo(e,t){return e(t={exports:{}},t.exports),t.exports}var et=Vo(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()}});Wo(et);var J0=Wo(Vo(function(e,t){var r=rt&&rt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function T(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,T)}I((v=v.apply(l,c||[])).next())})},n=rt&&rt.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[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(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},a=rt;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="",v=0;v<l;v++)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 v,p,S,g,T,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=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 v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,et.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?(et.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),et.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(et.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(v){var p=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(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,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,et.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),et.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var T=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const Y0={timeoutInSeconds:60},gd={name:"auth0-spa-js",version:"2.1.3"},yd=()=>Date.now();let se=class Yi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Yi.prototype)}static fromPayload({error:t,error_description:r}){return new Yi(t,r)}},X0=class wd extends se{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,wd.prototype)}},Xi=class bd extends se{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,bd.prototype)}},q0=class Sd extends Xi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Sd.prototype)}},Q0=class $d extends se{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,$d.prototype)}},eT=class Id extends se{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Id.prototype)}},Td=class Ed extends se{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Su(t,["default"])}', scope: '${Su(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Ed.prototype)}};function Su(e,t=[]){return e&&!t.includes(e)?e:""}const gn=()=>window.crypto,li=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(gn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},$u=e=>btoa(e),qi=e=>{var{clientId:t}=e,r=Re(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()},Iu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),tT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},rT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([tT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},nT=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},aT=async(e,t,r,n,a,i,o=1e4)=>a?nT(e,t,r,n,o,a,i):rT(e,n,o);async function iT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Re(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?qi(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let T,I=null;for(let C=0;C<3;C++)try{T=await aT(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=T.json,{error:h,error_description:$}=b,k=Re(b,["error","error_description"]),{ok:_}=T;if(!_){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new eT(h,C,k.mfa_token):h==="missing_refresh_token"?new Td(d,v):new se(h||"request_error",C)}return k}(`${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||gd))}},t,s)}const rn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class Qi{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 Qi({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Qi({scope:r,audience:n,clientId:a})}},oT=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@@"))}},Pd=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)}}()}},sT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||yd}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 it({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 it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.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]}},cT=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 or=e=>typeof e=="number",uT=["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"],lT=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(Iu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],uT.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Iu(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&&!or(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||!or(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!or(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&&or(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&&or(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 ot=Vo(function(e,t){var r=rt&&rt.__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 v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.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}))}});Wo(ot),ot.encode,ot.parse,ot.getAll;var fT=ot.get,Od=ot.set,kd=ot.remove;const Pt={get(e){const t=fT(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),Od(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r)}},dT={get(e){return Pt.get(e)||Pt.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),Od(`_legacy_${e}`,JSON.stringify(t),n),Pt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r),Pt.remove(e,t),Pt.remove(`_legacy_${e}`,t)}},vT={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 hT(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,v=l.length;d<v;++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(`
|
|
1
|
+
"use strict";var pv=Object.defineProperty;var mv=(e,t,r)=>t in e?pv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>mv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},q=function(e){try{return!!e()}catch{return!0}},gv=q,Un=!gv(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),yl=Un,wl=Function.prototype,Si=wl.call,yv=yl&&wl.bind.bind(Si,Si),K=yl?yv:function(e){return function(){return Si.apply(e,arguments)}},bl=K,wv=bl({}.toString),bv=bl("".slice),xn=function(e){return bv(wv(e),8,-1)},Sv=K,$v=q,Iv=xn,sa=Object,Tv=Sv("".split),Sl=$v(function(){return!sa("z").propertyIsEnumerable(0)})?function(e){return Iv(e)==="String"?Tv(e,""):sa(e)}:sa,Dn=function(e){return e==null},Ev=Dn,Pv=TypeError,Mn=function(e){if(Ev(e))throw new Pv("Can't call method on "+e);return e},Ov=Sl,kv=Mn,Pr=function(e){return Ov(kv(e))},Qt=function(e){return e&&e.Math===Math&&e},H=Qt(typeof globalThis=="object"&&globalThis)||Qt(typeof window=="object"&&window)||Qt(typeof self=="object"&&self)||Qt(typeof Ur=="object"&&Ur)||Qt(typeof Ur=="object"&&Ur)||function(){return this}()||Function("return this")(),$l={exports:{}},_v=!1,os=H,Rv=Object.defineProperty,oo=function(e,t){try{Rv(os,e,{value:t,configurable:!0,writable:!0})}catch{os[e]=t}return t},Cv=H,Av=oo,ss="__core-js_shared__",cs=$l.exports=Cv[ss]||Av(ss,{});(cs.versions||(cs.versions=[])).push({version:"3.38.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"});var so=$l.exports,us=so,Il=function(e,t){return us[e]||(us[e]=t||{})},jv=Mn,Lv=Object,Fn=function(e){return Lv(jv(e))},Nv=K,Uv=Fn,xv=Nv({}.hasOwnProperty),me=Object.hasOwn||function(t,r){return xv(Uv(t),r)},Dv=K,Mv=0,Fv=Math.random(),Bv=Dv(1 .toString),Tl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Bv(++Mv+Fv,36)},zv=H,ls=zv.navigator,fs=ls&&ls.userAgent,Or=fs?String(fs):"",El=H,ca=Or,ds=El.process,vs=El.Deno,hs=ds&&ds.versions||vs&&vs.version,ps=hs&&hs.v8,$e,wn;ps&&($e=ps.split("."),wn=$e[0]>0&&$e[0]<4?1:+($e[0]+$e[1]));!wn&&ca&&($e=ca.match(/Edge\/(\d+)/),(!$e||$e[1]>=74)&&($e=ca.match(/Chrome\/(\d+)/),$e&&(wn=+$e[1])));var Pl=wn,ms=Pl,Hv=q,Kv=H,Gv=Kv.String,Ol=!!Object.getOwnPropertySymbols&&!Hv(function(){var e=Symbol("symbol detection");return!Gv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ms&&ms<41}),Wv=Ol,kl=Wv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Vv=H,Zv=Il,gs=me,Jv=Tl,Yv=Ol,Xv=kl,Ot=Vv.Symbol,ua=Zv("wks"),qv=Xv?Ot.for||Ot:Ot&&Ot.withoutSetter||Jv,Q=function(e){return gs(ua,e)||(ua[e]=Yv&&gs(Ot,e)?Ot[e]:qv("Symbol."+e)),ua[e]},la=typeof document=="object"&&document.all,W=typeof la>"u"&&la!==void 0?function(e){return typeof e=="function"||e===la}:function(e){return typeof e=="function"},Qv=W,ge=function(e){return typeof e=="object"?e!==null:Qv(e)},eh=ge,th=String,rh=TypeError,Ee=function(e){if(eh(e))return e;throw new rh(th(e)+" is not an object")},_l={},nh=q,ee=!nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ah=ee,ih=q,Rl=ah&&ih(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ae={},oh=H,ys=ge,$i=oh.document,sh=ys($i)&&ys($i.createElement),Bn=function(e){return sh?$i.createElement(e):{}},ch=ee,uh=q,lh=Bn,Cl=!ch&&!uh(function(){return Object.defineProperty(lh("div"),"a",{get:function(){return 7}}).a!==7}),fh=Un,xr=Function.prototype.call,te=fh?xr.bind(xr):function(){return xr.apply(xr,arguments)},fa=H,dh=W,vh=function(e){return dh(e)?e:void 0},Pe=function(e,t){return arguments.length<2?vh(fa[e]):fa[e]&&fa[e][t]},hh=K,zn=hh({}.isPrototypeOf),ph=Pe,mh=W,gh=zn,yh=kl,wh=Object,Al=yh?function(e){return typeof e=="symbol"}:function(e){var t=ph("Symbol");return mh(t)&&gh(t.prototype,wh(e))},bh=String,Hn=function(e){try{return bh(e)}catch{return"Object"}},Sh=W,$h=Hn,Ih=TypeError,Oe=function(e){if(Sh(e))return e;throw new Ih($h(e)+" is not a function")},Th=Oe,Eh=Dn,co=function(e,t){var r=e[t];return Eh(r)?void 0:Th(r)},da=te,va=W,ha=ge,Ph=TypeError,Oh=function(e,t){var r,n;if(t==="string"&&va(r=e.toString)&&!ha(n=da(r,e))||va(r=e.valueOf)&&!ha(n=da(r,e))||t!=="string"&&va(r=e.toString)&&!ha(n=da(r,e)))return n;throw new Ph("Can't convert object to primitive value")},kh=te,ws=ge,bs=Al,_h=co,Rh=Oh,Ch=Q,Ah=TypeError,jh=Ch("toPrimitive"),Lh=function(e,t){if(!ws(e)||bs(e))return e;var r=_h(e,jh),n;if(r){if(t===void 0&&(t="default"),n=kh(r,e,t),!ws(n)||bs(n))return n;throw new Ah("Can't convert object to primitive value")}return t===void 0&&(t="number"),Rh(e,t)},Nh=Lh,Uh=Al,jl=function(e){var t=Nh(e,"string");return Uh(t)?t:t+""},xh=ee,Dh=Cl,Mh=Rl,Dr=Ee,Ss=jl,Fh=TypeError,pa=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,ma="enumerable",ga="configurable",ya="writable";Ae.f=xh?Mh?function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ya in n&&!n[ya]){var a=Bh(t,r);a&&a[ya]&&(t[r]=n.value,n={configurable:ga in n?n[ga]:a[ga],enumerable:ma in n?n[ma]:a[ma],writable:!1})}return pa(t,r,n)}:pa:function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),Dh)try{return pa(t,r,n)}catch{}if("get"in n||"set"in n)throw new Fh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var zh=Math.ceil,Hh=Math.floor,Kh=Math.trunc||function(t){var r=+t;return(r>0?Hh:zh)(r)},Gh=Kh,uo=function(e){var t=+e;return t!==t||t===0?0:Gh(t)},Wh=uo,Vh=Math.max,Zh=Math.min,Jh=function(e,t){var r=Wh(e);return r<0?Vh(r+t,0):Zh(r,t)},Yh=uo,Xh=Math.min,qh=function(e){var t=Yh(e);return t>0?Xh(t,9007199254740991):0},Qh=qh,lo=function(e){return Qh(e.length)},ep=Pr,tp=Jh,rp=lo,$s=function(e){return function(t,r,n){var a=ep(t),i=rp(a);if(i===0)return!e&&-1;var o=tp(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}},np={includes:$s(!0),indexOf:$s(!1)},fo={},ap=K,wa=me,ip=Pr,op=np.indexOf,sp=fo,Is=ap([].push),Ll=function(e,t){var r=ip(e),n=0,a=[],i;for(i in r)!wa(sp,i)&&wa(r,i)&&Is(a,i);for(;t.length>n;)wa(r,i=t[n++])&&(~op(a,i)||Is(a,i));return a},vo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],cp=Ll,up=vo,Nl=Object.keys||function(t){return cp(t,up)},lp=ee,fp=Rl,dp=Ae,vp=Ee,hp=Pr,pp=Nl;_l.f=lp&&!fp?Object.defineProperties:function(t,r){vp(t);for(var n=hp(r),a=pp(r),i=a.length,o=0,s;i>o;)dp.f(t,s=a[o++],n[s]);return t};var mp=Pe,Ul=mp("document","documentElement"),gp=Il,yp=Tl,Ts=gp("keys"),ho=function(e){return Ts[e]||(Ts[e]=yp(e))},wp=Ee,bp=_l,Es=vo,Sp=fo,$p=Ul,Ip=Bn,Tp=ho,Ps=">",Os="<",Ii="prototype",Ti="script",xl=Tp("IE_PROTO"),ba=function(){},Dl=function(e){return Os+Ti+Ps+e+Os+"/"+Ti+Ps},ks=function(e){e.write(Dl("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ep=function(){var e=Ip("iframe"),t="java"+Ti+":",r;return e.style.display="none",$p.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Dl("document.F=Object")),r.close(),r.F},Mr,fn=function(){try{Mr=new ActiveXObject("htmlfile")}catch{}fn=typeof document<"u"?document.domain&&Mr?ks(Mr):Ep():ks(Mr);for(var e=Es.length;e--;)delete fn[Ii][Es[e]];return fn()};Sp[xl]=!0;var Kn=Object.create||function(t,r){var n;return t!==null?(ba[Ii]=wp(t),n=new ba,ba[Ii]=null,n[xl]=t):n=fn(),r===void 0?n:bp.f(n,r)},Pp=Q,Op=Kn,kp=Ae.f,Ei=Pp("unscopables"),Pi=Array.prototype;Pi[Ei]===void 0&&kp(Pi,Ei,{configurable:!0,value:Op(null)});var _p=function(e){Pi[Ei][e]=!0},kr={},Rp=H,Cp=W,_s=Rp.WeakMap,Ap=Cp(_s)&&/native code/.test(String(_s)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},jp=ee,Lp=Ae,Np=vt,ht=jp?function(e,t,r){return Lp.f(e,t,Np(1,r))}:function(e,t,r){return e[t]=r,e},Up=Ap,Ml=H,xp=ge,Dp=ht,Sa=me,$a=so,Mp=ho,Fp=fo,Rs="Object already initialized",Oi=Ml.TypeError,Bp=Ml.WeakMap,bn,Ir,Sn,zp=function(e){return Sn(e)?Ir(e):bn(e,{})},Hp=function(e){return function(t){var r;if(!xp(t)||(r=Ir(t)).type!==e)throw new Oi("Incompatible receiver, "+e+" required");return r}};if(Up||$a.state){var ke=$a.state||($a.state=new Bp);ke.get=ke.get,ke.has=ke.has,ke.set=ke.set,bn=function(e,t){if(ke.has(e))throw new Oi(Rs);return t.facade=e,ke.set(e,t),t},Ir=function(e){return ke.get(e)||{}},Sn=function(e){return ke.has(e)}}else{var gt=Mp("state");Fp[gt]=!0,bn=function(e,t){if(Sa(e,gt))throw new Oi(Rs);return t.facade=e,Dp(e,gt,t),t},Ir=function(e){return Sa(e,gt)?e[gt]:{}},Sn=function(e){return Sa(e,gt)}}var Wt={set:bn,get:Ir,has:Sn,enforce:zp,getterFor:Hp},po={},mo={},Fl={}.propertyIsEnumerable,Bl=Object.getOwnPropertyDescriptor,Kp=Bl&&!Fl.call({1:2},1);mo.f=Kp?function(t){var r=Bl(this,t);return!!r&&r.enumerable}:Fl;var Gp=ee,Wp=te,Vp=mo,Zp=vt,Jp=Pr,Yp=jl,Xp=me,qp=Cl,Cs=Object.getOwnPropertyDescriptor;po.f=Gp?Cs:function(t,r){if(t=Jp(t),r=Yp(r),qp)try{return Cs(t,r)}catch{}if(Xp(t,r))return Zp(!Wp(Vp.f,t,r),t[r])};var zl={exports:{}},ki=ee,Qp=me,Hl=Function.prototype,em=ki&&Object.getOwnPropertyDescriptor,go=Qp(Hl,"name"),tm=go&&(function(){}).name==="something",rm=go&&(!ki||ki&&em(Hl,"name").configurable),Kl={EXISTS:go,PROPER:tm,CONFIGURABLE:rm},nm=K,am=W,_i=so,im=nm(Function.toString);am(_i.inspectSource)||(_i.inspectSource=function(e){return im(e)});var yo=_i.inspectSource,wo=K,om=q,sm=W,Fr=me,Ri=ee,cm=Kl.CONFIGURABLE,um=yo,Gl=Wt,lm=Gl.enforce,fm=Gl.get,As=String,dn=Object.defineProperty,dm=wo("".slice),vm=wo("".replace),hm=wo([].join),pm=Ri&&!om(function(){return dn(function(){},"length",{value:8}).length!==8}),mm=String(String).split("String"),gm=zl.exports=function(e,t,r){dm(As(t),0,7)==="Symbol("&&(t="["+vm(As(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Fr(e,"name")||cm&&e.name!==t)&&(Ri?dn(e,"name",{value:t,configurable:!0}):e.name=t),pm&&r&&Fr(r,"arity")&&e.length!==r.arity&&dn(e,"length",{value:r.arity});try{r&&Fr(r,"constructor")&&r.constructor?Ri&&dn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=lm(e);return Fr(n,"source")||(n.source=hm(mm,typeof t=="string"?t:"")),e};Function.prototype.toString=gm(function(){return sm(this)&&fm(this).source||um(this)},"toString");var Wl=zl.exports,ym=W,wm=Ae,bm=Wl,Sm=oo,ye=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(ym(r)&&bm(r,i,n),n.global)a?e[t]=r:Sm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:wm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Vl={},$m=Ll,Im=vo,Tm=Im.concat("length","prototype");Vl.f=Object.getOwnPropertyNames||function(t){return $m(t,Tm)};var bo={};bo.f=Object.getOwnPropertySymbols;var Em=Pe,Pm=K,Om=Vl,km=bo,_m=Ee,Rm=Pm([].concat),Cm=Em("Reflect","ownKeys")||function(t){var r=Om.f(_m(t)),n=km.f;return n?Rm(r,n(t)):r},js=me,Am=Cm,jm=po,Lm=Ae,Zl=function(e,t,r){for(var n=Am(t),a=Lm.f,i=jm.f,o=0;o<n.length;o++){var s=n[o];!js(e,s)&&!(r&&js(r,s))&&a(e,s,i(t,s))}},Nm=q,Um=W,xm=/#|\.prototype\./,_r=function(e,t){var r=Mm[Dm(e)];return r===Bm?!0:r===Fm?!1:Um(t)?Nm(t):!!t},Dm=_r.normalize=function(e){return String(e).replace(xm,".").toLowerCase()},Mm=_r.data={},Fm=_r.NATIVE="N",Bm=_r.POLYFILL="P",Jl=_r,Br=H,zm=po.f,Hm=ht,Km=ye,Gm=oo,Wm=Zl,Vm=Jl,Y=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Br:a?o=Br[r]||Gm(r,{}):o=Br[r]&&Br[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=zm(o,s),u=l&&l.value):u=o[s],i=Vm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Wm(f,u)}(e.sham||u&&u.sham)&&Hm(f,"sham",!0),Km(o,s,f,e)}},Zm=q,Jm=!Zm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ym=me,Xm=W,qm=Fn,Qm=ho,eg=Jm,Ls=Qm("IE_PROTO"),Ci=Object,tg=Ci.prototype,So=eg?Ci.getPrototypeOf:function(e){var t=qm(e);if(Ym(t,Ls))return t[Ls];var r=t.constructor;return Xm(r)&&t instanceof r?r.prototype:t instanceof Ci?tg:null},rg=q,ng=W,ag=ge,Ns=So,ig=ye,og=Q,Ai=og("iterator"),Yl=!1,ut,Ia,Ta;[].keys&&(Ta=[].keys(),"next"in Ta?(Ia=Ns(Ns(Ta)),Ia!==Object.prototype&&(ut=Ia)):Yl=!0);var sg=!ag(ut)||rg(function(){var e={};return ut[Ai].call(e)!==e});sg&&(ut={});ng(ut[Ai])||ig(ut,Ai,function(){return this});var Xl={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Yl},cg=Ae.f,ug=me,lg=Q,Us=lg("toStringTag"),Vt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ug(e,Us)&&cg(e,Us,{configurable:!0,value:t})},fg=Xl.IteratorPrototype,dg=Kn,vg=vt,hg=Vt,pg=kr,mg=function(){return this},ql=function(e,t,r,n){var a=t+" Iterator";return e.prototype=dg(fg,{next:vg(+!n,r)}),hg(e,a,!1),pg[a]=mg,e},gg=K,yg=Oe,wg=function(e,t,r){try{return gg(yg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},bg=ge,Sg=function(e){return bg(e)||e===null},$g=Sg,Ig=String,Tg=TypeError,Eg=function(e){if($g(e))return e;throw new Tg("Can't set "+Ig(e)+" as a prototype")},Pg=wg,Og=ge,kg=Mn,_g=Eg,$o=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Pg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return kg(a),_g(i),Og(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Rg=Y,Cg=te,Ql=Kl,Ag=W,jg=ql,xs=So,Ds=$o,Lg=Vt,Ng=ht,Ea=ye,Ug=Q,xg=kr,ef=Xl,Dg=Ql.PROPER,Mg=Ql.CONFIGURABLE,Ms=ef.IteratorPrototype,zr=ef.BUGGY_SAFARI_ITERATORS,er=Ug("iterator"),Fs="keys",tr="values",Bs="entries",Fg=function(){return this},tf=function(e,t,r,n,a,i,o){jg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!zr&&T&&T in l)return l[T];switch(T){case Fs:return function(){return new r(this,T)};case tr:return function(){return new r(this,T)};case Bs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[er]||l["@@iterator"]||a&&l[a],d=!zr&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=xs(v.call(new e)),p!==Object.prototype&&p.next&&(xs(p)!==Ms&&(Ds?Ds(p,Ms):Ag(p[er])||Ea(p,er,Fg)),Lg(p,u,!0))),Dg&&a===tr&&c&&c.name!==tr&&(Mg?Ng(l,"name",tr):(f=!0,d=function(){return Cg(c,this)})),a)if(S={values:s(tr),keys:i?d:s(Fs),entries:s(Bs)},o)for(g in S)(zr||f||!(g in l))&&Ea(l,g,S[g]);else Rg({target:t,proto:!0,forced:zr||f},S);return l[er]!==d&&Ea(l,er,d,{name:a}),xg[t]=d,S},Io=function(e,t){return{value:e,done:t}},Bg=Pr,To=_p,zs=kr,rf=Wt,zg=Ae.f,Hg=tf,Hr=Io,Kg=ee,nf="Array Iterator",Gg=rf.set,Wg=rf.getterFor(nf),Vg=Hg(Array,"Array",function(e,t){Gg(this,{type:nf,target:Bg(e),index:0,kind:t})},function(){var e=Wg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Hr(void 0,!0);switch(e.kind){case"keys":return Hr(r,!1);case"values":return Hr(t[r],!1)}return Hr([r,t[r]],!1)},"values"),Hs=zs.Arguments=zs.Array;To("keys");To("values");To("entries");if(Kg&&Hs.name!=="values")try{zg(Hs,"name",{value:"values"})}catch{}var Ks=H,Zg=ee,Jg=Object.getOwnPropertyDescriptor,af=function(e){if(!Zg)return Ks[e];var t=Jg(Ks,e);return t&&t.value},Yg=q,Xg=Q,qg=ee,Gs=_v,Qg=Xg("iterator"),Gn=!Yg(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),Gs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Gs||!qg)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Qg]||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"}),Ws=Wl,ey=Ae,Wn=function(e,t,r){return r.get&&Ws(r.get,t,{getter:!0}),r.set&&Ws(r.set,t,{setter:!0}),ey.f(e,t,r)},ty=ye,ry=function(e,t,r){for(var n in t)ty(e,n,t[n],r);return e},ny=zn,ay=TypeError,Eo=function(e,t){if(ny(t,e))return e;throw new ay("Incorrect invocation")},iy=xn,oy=K,sy=function(e){if(iy(e)==="Function")return oy(e)},Vs=sy,cy=Oe,uy=Un,ly=Vs(Vs.bind),Zt=function(e,t){return cy(e),t===void 0?e:uy?ly(e,t):function(){return e.apply(t,arguments)}},fy=Q,dy=fy("toStringTag"),of={};of[dy]="z";var Po=String(of)==="[object z]",vy=Po,hy=W,vn=xn,py=Q,my=py("toStringTag"),gy=Object,yy=vn(function(){return arguments}())==="Arguments",wy=function(e,t){try{return e[t]}catch{}},Rr=vy?vn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=wy(t=gy(e),my))=="string"?r:yy?vn(t):(n=vn(t))==="Object"&&hy(t.callee)?"Arguments":n},by=Rr,Sy=String,Fe=function(e){if(by(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Sy(e)},$y=Rr,Zs=co,Iy=Dn,Ty=kr,Ey=Q,Py=Ey("iterator"),Vn=function(e){if(!Iy(e))return Zs(e,Py)||Zs(e,"@@iterator")||Ty[$y(e)]},Oy=te,ky=Oe,_y=Ee,Ry=Hn,Cy=Vn,Ay=TypeError,Oo=function(e,t){var r=arguments.length<2?Cy(e):t;if(ky(r))return _y(Oy(r,e));throw new Ay(Ry(e)+" is not iterable")},jy=TypeError,pt=function(e,t){if(e<t)throw new jy("Not enough arguments");return e},Ly=K,Zn=Ly([].slice),Js=Zn,Ny=Math.floor,ji=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=Ny(r/2),s=ji(Js(e,0,o),t),u=ji(Js(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},Uy=ji,Li=Y,Jn=H,ko=af,Kr=te,Ce=K,vr=ee,sf=Gn,cf=ye,xy=Wn,Dy=ry,My=Vt,Fy=ql,_o=Wt,uf=Eo,Pa=W,By=me,zy=Zt,Hy=Rr,Ky=Ee,lf=ge,ne=Fe,Gy=Kn,Ys=vt,Xs=Oo,Wy=Vn,Gr=Io,yt=pt,Vy=Q,Zy=Uy,Jy=Vy("iterator"),Jt="URLSearchParams",ff=Jt+"Iterator",df=_o.set,he=_o.getterFor(Jt),Yy=_o.getterFor(ff),qs=ko("fetch"),$n=ko("Request"),hr=ko("Headers"),Oa=$n&&$n.prototype,Qs=hr&&hr.prototype,Xy=Jn.RegExp,qy=Jn.TypeError,vf=Jn.decodeURIComponent,Qy=Jn.encodeURIComponent,ew=Ce("".charAt),ec=Ce([].join),at=Ce([].push),Ni=Ce("".replace),tw=Ce([].shift),tc=Ce([].splice),rc=Ce("".split),rw=Ce("".slice),nw=/\+/g,nc=Array(4),aw=function(e){return nc[e-1]||(nc[e-1]=Xy("((?:%[\\da-f]{2}){"+e+"})","gi"))},iw=function(e){try{return vf(e)}catch{return e}},ac=function(e){var t=Ni(e,nw," "),r=4;try{return vf(t)}catch{for(;r;)t=Ni(t,aw(r--),iw);return t}},ow=/[!'()~]|%20/g,sw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},cw=function(e){return sw[e]},ic=function(e){return Ni(Qy(e),ow,cw)},ka=Fy(function(t,r){df(this,{type:ff,target:he(t).entries,index:0,kind:r})},Jt,function(){var t=Yy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Gr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Gr(a.key,!1);case"values":return Gr(a.value,!1)}return Gr([a.key,a.value],!1)},!0),hf=function(e){this.entries=[],this.url=null,e!==void 0&&(lf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?ew(e,0)==="?"?rw(e,1):e:ne(e)))};hf.prototype={type:Jt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Wy(e),n,a,i,o,s,u,f;if(r)for(n=Xs(e,r),a=n.next;!(i=Kr(a,n)).done;){if(o=Xs(Ky(i.value)),s=o.next,(u=Kr(s,o)).done||(f=Kr(s,o)).done||!Kr(s,o).done)throw new qy("Expected sequence with length 2");at(t,{key:ne(u.value),value:ne(f.value)})}else for(var l in e)By(e,l)&&at(t,{key:l,value:ne(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=rc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=rc(a,"="),at(t,{key:ac(tw(i)),value:ac(ec(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],at(t,ic(n.key)+"="+ic(n.value));return ec(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Yn=function(){uf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=df(this,new hf(t));vr||(this.size=r.entries.length)},Ut=Yn.prototype;Dy(Ut,{append:function(t,r){var n=he(this);yt(arguments.length,2),at(n.entries,{key:ne(t),value:ne(r)}),vr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=yt(arguments.length,1),n=t.entries,a=ne(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(tc(n,s,1),o!==void 0)break}else s++}vr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=[],i=0;i<r.length;i++)r[i].key===n&&at(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=yt(arguments.length,1),a=ne(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ne(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=he(this);yt(arguments.length,1);for(var a=n.entries,i=!1,o=ne(t),s=ne(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?tc(a,u--,1):(i=!0,f.value=s));i||at(a,{key:o,value:s}),vr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Zy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=zy(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 ka(this,"keys")},values:function(){return new ka(this,"values")},entries:function(){return new ka(this,"entries")}},{enumerable:!0});cf(Ut,Jy,Ut.entries,{name:"entries"});cf(Ut,"toString",function(){return he(this).serialize()},{enumerable:!0});vr&&xy(Ut,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0});My(Yn,Jt);Li({global:!0,constructor:!0,forced:!sf},{URLSearchParams:Yn});if(!sf&&Pa(hr)){var uw=Ce(Qs.has),lw=Ce(Qs.set),oc=function(e){if(lf(e)){var t=e.body,r;if(Hy(t)===Jt)return r=e.headers?new hr(e.headers):new hr,uw(r,"content-type")||lw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Gy(e,{body:Ys(0,ne(t)),headers:Ys(0,r)})}return e};if(Pa(qs)&&Li({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return qs(t,arguments.length>1?oc(arguments[1]):{})}}),Pa($n)){var _a=function(t){return uf(this,Oa),new $n(t,arguments.length>1?oc(arguments[1]):{})};Oa.constructor=_a,_a.prototype=Oa,Li({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_a})}}var fw={URLSearchParams:Yn,getState:he},dw=ye,Xn=K,sc=Fe,vw=pt,pf=URLSearchParams,qn=pf.prototype,hw=Xn(qn.append),cc=Xn(qn.delete),pw=Xn(qn.forEach),mw=Xn([].push),Ro=new pf("a=1&a=2&b=3");Ro.delete("a",1);Ro.delete("b",void 0);Ro+""!="a=2"&&dw(qn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return cc(this,e);var n=[];pw(this,function(c,d){mw(n,{key:d,value:c})}),vw(t,1);for(var a=sc(e),i=sc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,cc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||hw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var gw=ye,mf=K,yw=Fe,ww=pt,gf=URLSearchParams,Co=gf.prototype,bw=mf(Co.getAll),Sw=mf(Co.has),uc=new gf("a=1");(uc.has("a",2)||!uc.has("a",void 0))&&gw(Co,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Sw(this,t);var a=bw(this,t);ww(r,1);for(var i=yw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var $w=ee,Iw=K,Tw=Wn,Ui=URLSearchParams.prototype,Ew=Iw(Ui.forEach);$w&&!("size"in Ui)&&Tw(Ui,"size",{get:function(){var t=0;return Ew(this,function(){t++}),t},configurable:!0,enumerable:!0});var Pw=H,Ao=Pw,Ow=Ao;Ow.URLSearchParams;var jo=K,kw=uo,_w=Fe,Rw=Mn,Cw=jo("".charAt),lc=jo("".charCodeAt),Aw=jo("".slice),fc=function(e){return function(t,r){var n=_w(Rw(t)),a=kw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=lc(n,a),o<55296||o>56319||a+1===i||(s=lc(n,a+1))<56320||s>57343?e?Cw(n,a):o:e?Aw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},yf={codeAt:fc(!1),charAt:fc(!0)},jw=yf.charAt,Lw=Fe,wf=Wt,Nw=tf,dc=Io,bf="String Iterator",Uw=wf.set,xw=wf.getterFor(bf);Nw(String,"String",function(e){Uw(this,{type:bf,string:Lw(e),index:0})},function(){var t=xw(this),r=t.string,n=t.index,a;return n>=r.length?dc(void 0,!0):(a=jw(r,n),t.index+=a.length,dc(a,!1))});var vc=ee,Dw=K,Mw=te,Fw=q,Ra=Nl,Bw=bo,zw=mo,Hw=Fn,Kw=Sl,wt=Object.assign,hc=Object.defineProperty,Gw=Dw([].concat),Ww=!wt||Fw(function(){if(vc&&wt({b:1},wt(hc({},"a",{enumerable:!0,get:function(){hc(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}),wt({},e)[r]!==7||Ra(wt({},t)).join("")!==n})?function(t,r){for(var n=Hw(t),a=arguments.length,i=1,o=Bw.f,s=zw.f;a>i;)for(var u=Kw(arguments[i++]),f=o?Gw(Ra(u),o(u)):Ra(u),l=f.length,c=0,d;l>c;)d=f[c++],(!vc||Mw(s,u,d))&&(n[d]=u[d]);return n}:wt,Vw=te,pc=Ee,Zw=co,Sf=function(e,t,r){var n,a;pc(e);try{if(n=Zw(e,"return"),!n){if(t==="throw")throw r;return r}n=Vw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return pc(n),r},Jw=Ee,Yw=Sf,Xw=function(e,t,r,n){try{return n?t(Jw(r)[0],r[1]):t(r)}catch(a){Yw(e,"throw",a)}},qw=Q,Qw=kr,eb=qw("iterator"),tb=Array.prototype,$f=function(e){return e!==void 0&&(Qw.Array===e||tb[eb]===e)},rb=K,nb=q,If=W,ab=Rr,ib=Pe,ob=yo,Tf=function(){},Ef=ib("Reflect","construct"),Lo=/^\s*(?:class|function)\b/,sb=rb(Lo.exec),cb=!Lo.test(Tf),rr=function(t){if(!If(t))return!1;try{return Ef(Tf,[],t),!0}catch{return!1}},Pf=function(t){if(!If(t))return!1;switch(ab(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return cb||!!sb(Lo,ob(t))}catch{return!0}};Pf.sham=!0;var Of=!Ef||nb(function(){var e;return rr(rr.call)||!rr(Object)||!rr(function(){e=!0})||e})?Pf:rr,ub=ee,lb=Ae,fb=vt,db=function(e,t,r){ub?lb.f(e,t,fb(0,r)):e[t]=r},vb=Zt,hb=te,pb=Fn,mb=Xw,gb=$f,yb=Of,wb=lo,mc=db,bb=Oo,Sb=Vn,gc=Array,$b=function(t){var r=pb(t),n=yb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=vb(i,a>2?arguments[2]:void 0));var s=Sb(r),u=0,f,l,c,d,v,p;if(s&&!(this===gc&&gb(s)))for(l=n?new this:[],d=bb(r,s),v=d.next;!(c=hb(v,d)).done;u++)p=o?mb(d,i,[c.value,u],!0):c.value,mc(l,u,p);else for(f=wb(r),l=n?new this(f):gc(f);f>u;u++)p=o?i(r[u],u):r[u],mc(l,u,p);return l.length=u,l},mt=K,Ca=2147483647,pr=36,kf=1,xi=26,Ib=38,Tb=700,Eb=72,Pb=128,Ob="-",kb=/[^\0-\u007E]/,_f=/[.\u3002\uFF0E\uFF61]/g,yc="Overflow: input needs wider integers to process",Aa=pr-kf,wc=RangeError,_b=mt(_f.exec),kt=Math.floor,ja=String.fromCharCode,bc=mt("".charCodeAt),Rf=mt([].join),We=mt([].push),Rb=mt("".replace),Cb=mt("".split),Ab=mt("".toLowerCase),jb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=bc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=bc(e,r++);(i&64512)===56320?We(t,((a&1023)<<10)+(i&1023)+65536):(We(t,a),r--)}else We(t,a)}return t},Sc=function(e){return e+22+75*(e<26)},Lb=function(e,t,r){var n=0;for(e=r?kt(e/Tb):e>>1,e+=kt(e/t);e>Aa*xi>>1;)e=kt(e/Aa),n+=pr;return kt(n+(Aa+1)*e/(e+Ib))},Nb=function(e){var t=[];e=jb(e);var r=e.length,n=Pb,a=0,i=Eb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&We(t,ja(s));var u=t.length,f=u;for(u&&We(t,Ob);f<r;){var l=Ca;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((Ca-a)/c))throw new wc(yc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Ca)throw new wc(yc);if(s===n){for(var d=a,v=pr;;){var p=v<=i?kf:v>=i+xi?xi:v-i;if(d<p)break;var S=d-p,g=pr-p;We(t,ja(Sc(p+S%g))),d=kt(S/g),v+=pr}We(t,ja(Sc(d))),i=Lb(a,c,f===u),a=0,f++}}a++,n++}return Rf(t,"")},Ub=function(e){var t=[],r=Cb(Rb(Ab(e),_f,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],We(t,_b(kb,a)?"xn--"+Nb(a):a);return Rf(t,".")},xb=Y,No=ee,Db=Gn,Uo=H,$c=Zt,we=K,In=ye,fe=Wn,Mb=Eo,Di=me,xo=Ww,bt=$b,be=Zn,Fb=yf.codeAt,Bb=Ub,Ue=Fe,zb=Vt,Hb=pt,Cf=fw,Af=Wt,Kb=Af.set,Tn=Af.getterFor("URL"),Gb=Cf.URLSearchParams,Wb=Cf.getState,nr=Uo.URL,Mi=Uo.TypeError,En=Uo.parseInt,Vb=Math.floor,Ic=Math.pow,pe=we("".charAt),Ie=we(/./.exec),ur=we([].join),Zb=we(1 .toString),Jb=we([].pop),Tt=we([].push),La=we("".replace),Yb=we([].shift),Xb=we("".split),mr=we("".slice),Pn=we("".toLowerCase),qb=we([].unshift),Qb="Invalid authority",Na="Invalid scheme",Xe="Invalid host",Tc="Invalid port",jf=/[a-z]/i,eS=/[\d+-.a-z]/i,Fi=/\d/,tS=/^0x/i,rS=/^[0-7]+$/,nS=/^\d+$/,Lf=/^[\da-f]+$/i,aS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,iS=/[\0\t\n\r #/:<>?@[\\\]^|]/,oS=/^[\u0000-\u0020]+/,sS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,cS=/[\t\n\r]/g,de,uS=function(e){var t=Xb(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&&pe(i,0)==="0"&&(o=Ie(tS,i)?16:8,i=mr(i,o===8?1:2)),i==="")s=0;else{if(!Ie(o===10?nS:o===8?rS:Lf,i))return e;s=En(i,o)}Tt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Ic(256,5-r))return null}else if(s>255)return null;for(u=Jb(n),a=0;a<n.length;a++)u+=n[a]*Ic(256,3-a);return u},lS=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 pe(e,a)};if(d()===":"){if(pe(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&&Ie(Lf,d());)i=i*16+En(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(!Ie(Fi,d()))return;for(;Ie(Fi,d());){if(f=En(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},fS=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},ar=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)qb(t,e%256),e=Vb(e/256);return ur(t,".")}if(typeof e=="object"){for(t="",n=fS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Zb(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},hn={},Nf=xo({},hn,{" ":1,'"':1,"<":1,">":1,"`":1}),Uf=xo({},Nf,{"#":1,"?":1,"{":1,"}":1}),Ua=xo({},Uf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ze=function(e,t){var r=Fb(e,0);return r>32&&r<127&&!Di(t,e)?e:encodeURIComponent(e)},Wr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},lr=function(e,t){var r;return e.length===2&&Ie(jf,pe(e,0))&&((r=pe(e,1))===":"||!t&&r==="|")},Ec=function(e){var t;return e.length>1&&lr(mr(e,0,2))&&(e.length===2||(t=pe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},dS=function(e){return e==="."||Pn(e)==="%2e"},vS=function(e){return e=Pn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},xa={},Pc={},Da={},Oc={},kc={},Ma={},_c={},Rc={},Vr={},Zr={},Fa={},Ba={},za={},Ha={},Cc={},Ka={},St={},_e={},Ac={},qe={},Ne={},Do=function(e,t,r){var n=Ue(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Mi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Do(r,!0)),i=this.parse(n,null,a),i)throw new Mi(i);o=Wb(new Gb),o.bindURL(this),this.searchParams=o}};Do.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||xa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(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=La(e,oS,""),e=La(e,sS,"$1")),e=La(e,cS,""),l=bt(e);i<=l.length;){switch(c=l[i],a){case xa:if(c&&Ie(jf,c))o+=Pn(c),a=Pc;else{if(t)return Na;a=Da;continue}break;case Pc:if(c&&(Ie(eS,c)||c==="+"||c==="-"||c==="."))o+=Pn(c);else if(c===":"){if(t&&(n.isSpecial()!==Di(Wr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Wr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ha:n.isSpecial()&&r&&r.scheme===n.scheme?a=Oc:n.isSpecial()?a=Rc:l[i+1]==="/"?(a=kc,i++):(n.cannotBeABaseURL=!0,Tt(n.path,""),a=Ac)}else{if(t)return Na;o="",a=Da,i=0;continue}break;case Da:if(!r||r.cannotBeABaseURL&&c!=="#")return Na;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=be(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Ne;break}a=r.scheme==="file"?Ha:Ma;continue;case Oc:if(c==="/"&&l[i+1]==="/")a=Vr,i++;else{a=Ma;continue}break;case kc:if(c==="/"){a=Zr;break}else{a=_e;continue}case Ma:if(n.scheme=r.scheme,c===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=_c;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query="",a=qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.path.length--,a=_e;continue}break;case _c:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Vr;else if(c==="/")a=Zr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=_e;continue}break;case Rc:if(a=Vr,c!=="/"||pe(o,i+1)!=="/")continue;i++;break;case Vr:if(c!=="/"&&c!=="\\"){a=Zr;continue}break;case Zr:if(c==="@"){s&&(o="%40"+o),s=!0,d=bt(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=ze(S,Ua);f?n.password+=g:n.username+=g}o=""}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return Qb;i-=bt(o).length+1,o="",a=Fa}else o+=c;break;case Fa:case Ba:if(t&&n.scheme==="file"){a=Ka;continue}else if(c===":"&&!u){if(o==="")return Xe;if(v=n.parseHost(o),v)return v;if(o="",a=za,t===Ba)return}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Xe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=St,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case za:if(Ie(Fi,c))o+=c;else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=En(o,10);if(T>65535)return Tc;n.port=n.isSpecial()&&T===Wr[n.scheme]?null:T,o=""}if(t)return;a=St;continue}else return Tc;break;case Ha:if(n.scheme="file",c==="/"||c==="\\")a=Cc;else if(r&&r.scheme==="file")switch(c){case de:n.host=r.host,n.path=be(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=be(r.path),n.query="",a=qe;break;case"#":n.host=r.host,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;break;default:Ec(ur(be(l,i),""))||(n.host=r.host,n.path=be(r.path),n.shortenPath()),a=_e;continue}else{a=_e;continue}break;case Cc:if(c==="/"||c==="\\"){a=Ka;break}r&&r.scheme==="file"&&!Ec(ur(be(l,i),""))&&(lr(r.path[0],!0)?Tt(n.path,r.path[0]):n.host=r.host),a=_e;continue;case Ka:if(c===de||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&lr(o))a=_e;else if(o===""){if(n.host="",t)return;a=St}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=St}continue}else o+=c;break;case St:if(n.isSpecial()){if(a=_e,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=qe;else if(!t&&c==="#")n.fragment="",a=Ne;else if(c!==de&&(a=_e,c!=="/"))continue;break;case _e:if(c===de||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(vS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,"")):dS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,""):(n.scheme==="file"&&!n.path.length&&lr(o)&&(n.host&&(n.host=""),o=pe(o,0)+":"),Tt(n.path,o)),o="",n.scheme==="file"&&(c===de||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Yb(n.path);c==="?"?(n.query="",a=qe):c==="#"&&(n.fragment="",a=Ne)}else o+=ze(c,Uf);break;case Ac:c==="?"?(n.query="",a=qe):c==="#"?(n.fragment="",a=Ne):c!==de&&(n.path[0]+=ze(c,hn));break;case qe:!t&&c==="#"?(n.fragment="",a=Ne):c!==de&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=ze(c,hn));break;case Ne:c!==de&&(n.fragment+=ze(c,Nf));break}i++}},parseHost:function(e){var t,r,n;if(pe(e,0)==="["){if(pe(e,e.length-1)!=="]"||(t=lS(mr(e,1,-1)),!t))return Xe;this.host=t}else if(this.isSpecial()){if(e=Bb(e),Ie(aS,e)||(t=uS(e),t===null))return Xe;this.host=t}else{if(Ie(iS,e))return Xe;for(t="",r=bt(e),n=0;n<r.length;n++)t+=ze(r[n],hn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Di(Wr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!lr(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+=ar(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+ur(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Mi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new xt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ar(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",xa)},getUsername:function(){return this.username},setUsername:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=ze(t[r],Ua)}},getPassword:function(){return this.password},setPassword:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=ze(t[r],Ua)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ar(e):ar(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Fa)},getHostname:function(){var e=this.host;return e===null?"":ar(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ba)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,za))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+ur(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,St))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(pe(e,0)==="?"&&(e=mr(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}pe(e,0)==="#"&&(e=mr(e,1)),this.fragment="",this.parse(e,Ne)},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var r=Mb(this,re),n=Hb(arguments.length,1)>1?arguments[1]:void 0,a=Kb(r,new Do(t,!1,n));No||(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())},re=xt.prototype,ve=function(e,t){return{get:function(){return Tn(this)[e]()},set:t&&function(r){return Tn(this)[t](r)},configurable:!0,enumerable:!0}};No&&(fe(re,"href",ve("serialize","setHref")),fe(re,"origin",ve("getOrigin")),fe(re,"protocol",ve("getProtocol","setProtocol")),fe(re,"username",ve("getUsername","setUsername")),fe(re,"password",ve("getPassword","setPassword")),fe(re,"host",ve("getHost","setHost")),fe(re,"hostname",ve("getHostname","setHostname")),fe(re,"port",ve("getPort","setPort")),fe(re,"pathname",ve("getPathname","setPathname")),fe(re,"search",ve("getSearch","setSearch")),fe(re,"searchParams",ve("getSearchParams")),fe(re,"hash",ve("getHash","setHash")));In(re,"toJSON",function(){return Tn(this).serialize()},{enumerable:!0});In(re,"toString",function(){return Tn(this).serialize()},{enumerable:!0});if(nr){var jc=nr.createObjectURL,Lc=nr.revokeObjectURL;jc&&In(xt,"createObjectURL",$c(jc,nr)),Lc&&In(xt,"revokeObjectURL",$c(Lc,nr))}zb(xt,"URL");xb({global:!0,constructor:!0,forced:!Db,sham:!No},{URL:xt});var hS=Y,pS=Pe,xf=q,mS=pt,Nc=Fe,gS=Gn,Mo=pS("URL"),yS=gS&&xf(function(){Mo.canParse()}),wS=xf(function(){return Mo.canParse.length!==1});hS({target:"URL",stat:!0,forced:!yS||wS},{canParse:function(t){var r=mS(arguments.length,1),n=Nc(t),a=r<2||arguments[1]===void 0?void 0:Nc(arguments[1]);try{return!!new Mo(n,a)}catch{return!1}}});var bS=Y,SS=Pe,$S=pt,Uc=Fe,IS=Gn,TS=SS("URL");bS({target:"URL",stat:!0,forced:!IS},{parse:function(t){var r=$S(arguments.length,1),n=Uc(t),a=r<2||arguments[1]===void 0?void 0:Uc(arguments[1]);try{return new TS(n,a)}catch{return null}}});var ES=Y,PS=te;ES({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return PS(URL.prototype.toString,this)}});var OS=Ao;OS.URL;var kS={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},_S=Bn,Ga=_S("span").classList,xc=Ga&&Ga.constructor&&Ga.constructor.prototype,RS=xc===Object.prototype?void 0:xc,Dc=H,Df=kS,CS=RS,fr=Vg,Mc=ht,AS=Vt,jS=Q,Wa=jS("iterator"),Va=fr.values,Mf=function(e,t){if(e){if(e[Wa]!==Va)try{Mc(e,Wa,Va)}catch{e[Wa]=Va}if(AS(e,t,!0),Df[t]){for(var r in fr)if(e[r]!==fr[r])try{Mc(e,r,fr[r])}catch{e[r]=fr[r]}}}};for(var Za in Df)Mf(Dc[Za]&&Dc[Za].prototype,Za);Mf(CS,"DOMTokenList");var LS=ge,NS=ht,US=function(e,t){LS(t)&&"cause"in t&&NS(e,"cause",t.cause)},xS=K,Ff=Error,DS=xS("".replace),MS=function(e){return String(new Ff(e).stack)}("zxcasd"),Bf=/\n\s*at [^:]*:[^\n]*/,FS=Bf.test(MS),BS=function(e,t){if(FS&&typeof e=="string"&&!Ff.prepareStackTrace)for(;t--;)e=DS(e,Bf,"");return e},zS=q,HS=vt,KS=!zS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",HS(1,7)),e.stack!==7):!0}),GS=ht,WS=BS,VS=KS,Fc=Error.captureStackTrace,ZS=function(e,t,r,n){VS&&(Fc?Fc(e,t):GS(e,"stack",WS(r,n)))},JS=Zt,YS=te,XS=Ee,qS=Hn,QS=$f,e$=lo,Bc=zn,t$=Oo,r$=Vn,zc=Sf,n$=TypeError,pn=function(e,t){this.stopped=e,this.result=t},Hc=pn.prototype,Cr=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=JS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&zc(f,"normal",I),new pn(!0,I)},T=function(I){return a?(XS(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=r$(e),!l)throw new n$(qS(e)+" is not iterable");if(QS(l)){for(c=0,d=e$(e);d>c;c++)if(v=T(e[c]),v&&Bc(Hc,v))return v;return new pn(!1)}f=t$(e,l)}for(p=i?e.next:f.next;!(S=YS(p,f)).done;){try{v=T(S.value)}catch(I){zc(f,"throw",I)}if(typeof v=="object"&&v&&Bc(Hc,v))return v}return new pn(!1)},a$=Fe,i$=function(e,t){return e===void 0?arguments.length<2?"":t:a$(e)},o$=Y,s$=zn,c$=So,On=$o,u$=Zl,zf=Kn,Ja=ht,Ya=vt,l$=US,f$=ZS,d$=Cr,v$=i$,h$=Q,p$=h$("toStringTag"),kn=Error,m$=[].push,Dt=function(t,r){var n=s$(Xa,this),a;On?a=On(new kn,n?c$(this):Xa):(a=n?this:zf(Xa),Ja(a,p$,"Error")),r!==void 0&&Ja(a,"message",v$(r)),f$(a,Dt,a.stack,1),arguments.length>2&&l$(a,arguments[2]);var i=[];return d$(t,m$,{that:i}),Ja(a,"errors",i),a};On?On(Dt,kn):u$(Dt,kn,{name:!0});var Xa=Dt.prototype=zf(kn.prototype,{constructor:Ya(1,Dt),message:Ya(1,""),name:Ya(1,"AggregateError")});o$({global:!0,constructor:!0,arity:2},{AggregateError:Dt});var g$=Po,y$=Rr,w$=g$?{}.toString:function(){return"[object "+y$(this)+"]"},b$=Po,S$=ye,$$=w$;b$||S$(Object.prototype,"toString",$$,{unsafe:!0});var ir=H,I$=Or,T$=xn,Jr=function(e){return I$.slice(0,e.length)===e},Hf=function(){return Jr("Bun/")?"BUN":Jr("Cloudflare-Workers")?"CLOUDFLARE":Jr("Deno/")?"DENO":Jr("Node.js/")?"NODE":ir.Bun&&typeof Bun.version=="string"?"BUN":ir.Deno&&typeof Deno.version=="object"?"DENO":T$(ir.process)==="process"?"NODE":ir.window&&ir.document?"BROWSER":"REST"}(),E$=Hf,Fo=E$==="NODE",P$=Pe,O$=Wn,k$=Q,_$=ee,Kc=k$("species"),R$=function(e){var t=P$(e);_$&&t&&!t[Kc]&&O$(t,Kc,{configurable:!0,get:function(){return this}})},C$=Of,A$=Hn,j$=TypeError,L$=function(e){if(C$(e))return e;throw new j$(A$(e)+" is not a constructor")},Gc=Ee,N$=L$,U$=Dn,x$=Q,D$=x$("species"),Kf=function(e,t){var r=Gc(e).constructor,n;return r===void 0||U$(n=Gc(r)[D$])?t:N$(n)},M$=Un,Gf=Function.prototype,Wc=Gf.apply,Vc=Gf.call,Wf=typeof Reflect=="object"&&Reflect.apply||(M$?Vc.bind(Wc):function(){return Vc.apply(Wc,arguments)}),F$=Or,Vf=/(?:ipad|iphone|ipod).*applewebkit/i.test(F$),ce=H,B$=Wf,z$=Zt,Zc=W,H$=me,Zf=q,Jc=Ul,K$=Zn,Yc=Bn,G$=pt,W$=Vf,V$=Fo,Bi=ce.setImmediate,zi=ce.clearImmediate,Z$=ce.process,qa=ce.Dispatch,J$=ce.Function,Xc=ce.MessageChannel,Y$=ce.String,Qa=0,gr={},qc="onreadystatechange",Tr,Qe,ei,ti;Zf(function(){Tr=ce.location});var Bo=function(e){if(H$(gr,e)){var t=gr[e];delete gr[e],t()}},ri=function(e){return function(){Bo(e)}},Qc=function(e){Bo(e.data)},eu=function(e){ce.postMessage(Y$(e),Tr.protocol+"//"+Tr.host)};(!Bi||!zi)&&(Bi=function(t){G$(arguments.length,1);var r=Zc(t)?t:J$(t),n=K$(arguments,1);return gr[++Qa]=function(){B$(r,void 0,n)},Qe(Qa),Qa},zi=function(t){delete gr[t]},V$?Qe=function(e){Z$.nextTick(ri(e))}:qa&&qa.now?Qe=function(e){qa.now(ri(e))}:Xc&&!W$?(ei=new Xc,ti=ei.port2,ei.port1.onmessage=Qc,Qe=z$(ti.postMessage,ti)):ce.addEventListener&&Zc(ce.postMessage)&&!ce.importScripts&&Tr&&Tr.protocol!=="file:"&&!Zf(eu)?(Qe=eu,ce.addEventListener("message",Qc,!1)):qc in Yc("script")?Qe=function(e){Jc.appendChild(Yc("script"))[qc]=function(){Jc.removeChild(this),Bo(e)}}:Qe=function(e){setTimeout(ri(e),0)});var Jf={set:Bi,clear:zi},Yf=function(){this.head=null,this.tail=null};Yf.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 Xf=Yf,X$=Or,q$=/ipad|iphone|ipod/i.test(X$)&&typeof Pebble<"u",Q$=Or,eI=/web0s(?!.*chrome)/i.test(Q$),Mt=H,tI=af,tu=Zt,ni=Jf.set,rI=Xf,nI=Vf,aI=q$,iI=eI,ai=Fo,ru=Mt.MutationObserver||Mt.WebKitMutationObserver,nu=Mt.document,au=Mt.process,Yr=Mt.Promise,Hi=tI("queueMicrotask"),$t,ii,oi,Xr,iu;if(!Hi){var qr=new rI,Qr=function(){var e,t;for(ai&&(e=au.domain)&&e.exit();t=qr.get();)try{t()}catch(r){throw qr.head&&$t(),r}e&&e.enter()};!nI&&!ai&&!iI&&ru&&nu?(ii=!0,oi=nu.createTextNode(""),new ru(Qr).observe(oi,{characterData:!0}),$t=function(){oi.data=ii=!ii}):!aI&&Yr&&Yr.resolve?(Xr=Yr.resolve(void 0),Xr.constructor=Yr,iu=tu(Xr.then,Xr),$t=function(){iu(Qr)}):ai?$t=function(){au.nextTick(Qr)}:(ni=tu(ni,Mt),$t=function(){ni(Qr)}),Hi=function(e){qr.head||$t(),qr.add(e)}}var oI=Hi,sI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Yt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},cI=H,Ar=cI.Promise,uI=H,yr=Ar,lI=W,fI=Jl,dI=yo,vI=Q,ou=Hf,si=Pl;yr&&yr.prototype;var hI=vI("species"),Ki=!1,qf=lI(uI.PromiseRejectionEvent),pI=fI("Promise",function(){var e=dI(yr),t=e!==String(yr);if(!t&&si===66)return!0;if(!si||si<51||!/native code/.test(e)){var r=new yr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[hI]=n,Ki=r.then(function(){})instanceof n,!Ki)return!0}return!t&&(ou==="BROWSER"||ou==="DENO")&&!qf}),jr={CONSTRUCTOR:pI,REJECTION_EVENT:qf,SUBCLASSING:Ki},je={},su=Oe,mI=TypeError,gI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new mI("Bad Promise constructor");t=n,r=a}),this.resolve=su(t),this.reject=su(r)};je.f=function(e){return new gI(e)};var yI=Y,_n=Fo,Je=H,Ft=te,cu=ye,uu=$o,wI=Vt,bI=R$,SI=Oe,mn=W,$I=ge,II=Eo,TI=Kf,Qf=Jf.set,zo=oI,EI=sI,PI=Yt,OI=Xf,ed=Wt,Rn=Ar,Ho=jr,td=je,Qn="Promise",rd=Ho.CONSTRUCTOR,kI=Ho.REJECTION_EVENT,_I=Ho.SUBCLASSING,ci=ed.getterFor(Qn),RI=ed.set,Et=Rn&&Rn.prototype,tt=Rn,en=Et,nd=Je.TypeError,Gi=Je.document,Ko=Je.process,Wi=td.f,CI=Wi,AI=!!(Gi&&Gi.createEvent&&Je.dispatchEvent),ad="unhandledrejection",jI="rejectionhandled",lu=0,id=1,LI=2,Go=1,od=2,tn,fu,NI,du,sd=function(e){var t;return $I(e)&&mn(t=e.then)?t:!1},cd=function(e,t){var r=t.value,n=t.state===id,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===od&&xI(t),t.rejection=Go),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new nd("Promise-chain cycle")):(f=sd(u))?Ft(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},ud=function(e,t){e.notified||(e.notified=!0,zo(function(){for(var r=e.reactions,n;n=r.get();)cd(n,e);e.notified=!1,t&&!e.rejection&&UI(e)}))},ld=function(e,t,r){var n,a;AI?(n=Gi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Je.dispatchEvent(n)):n={promise:t,reason:r},!kI&&(a=Je["on"+e])?a(n):e===ad&&EI("Unhandled promise rejection",r)},UI=function(e){Ft(Qf,Je,function(){var t=e.facade,r=e.value,n=vu(e),a;if(n&&(a=PI(function(){_n?Ko.emit("unhandledRejection",r,t):ld(ad,t,r)}),e.rejection=_n||vu(e)?od:Go,a.error))throw a.value})},vu=function(e){return e.rejection!==Go&&!e.parent},xI=function(e){Ft(Qf,Je,function(){var t=e.facade;_n?Ko.emit("rejectionHandled",t):ld(jI,t,e.value)})},_t=function(e,t,r){return function(n){e(t,n,r)}},At=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=LI,ud(e,!0))},Vi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new nd("Promise can't be resolved itself");var n=sd(t);n?zo(function(){var a={done:!1};try{Ft(n,t,_t(Vi,a,e),_t(At,a,e))}catch(i){At(a,i,e)}}):(e.value=t,e.state=id,ud(e,!1))}catch(a){At({done:!1},a,e)}}};if(rd&&(tt=function(t){II(this,en),SI(t),Ft(tn,this);var r=ci(this);try{t(_t(Vi,r),_t(At,r))}catch(n){At(r,n)}},en=tt.prototype,tn=function(t){RI(this,{type:Qn,done:!1,notified:!1,parent:!1,reactions:new OI,rejection:!1,state:lu,value:void 0})},tn.prototype=cu(en,"then",function(t,r){var n=ci(this),a=Wi(TI(this,tt));return n.parent=!0,a.ok=mn(t)?t:!0,a.fail=mn(r)&&r,a.domain=_n?Ko.domain:void 0,n.state===lu?n.reactions.add(a):zo(function(){cd(a,n)}),a.promise}),fu=function(){var e=new tn,t=ci(e);this.promise=e,this.resolve=_t(Vi,t),this.reject=_t(At,t)},td.f=Wi=function(e){return e===tt||e===NI?new fu(e):CI(e)},mn(Rn)&&Et!==Object.prototype)){du=Et.then,_I||cu(Et,"then",function(t,r){var n=this;return new tt(function(a,i){Ft(du,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Et.constructor}catch{}uu&&uu(Et,en)}yI({global:!0,constructor:!0,wrap:!0,forced:rd},{Promise:tt});wI(tt,Qn,!1);bI(Qn);var DI=Q,fd=DI("iterator"),dd=!1;try{var MI=0,hu={next:function(){return{done:!!MI++}},return:function(){dd=!0}};hu[fd]=function(){return this},Array.from(hu,function(){throw 2})}catch{}var FI=function(e,t){try{if(!t&&!dd)return!1}catch{return!1}var r=!1;try{var n={};n[fd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},BI=Ar,zI=FI,HI=jr.CONSTRUCTOR,ea=HI||!zI(function(e){BI.all(e).then(void 0,function(){})}),KI=Y,GI=te,WI=Oe,VI=je,ZI=Yt,JI=Cr,YI=ea;KI({target:"Promise",stat:!0,forced:YI},{all:function(t){var r=this,n=VI.f(r),a=n.resolve,i=n.reject,o=ZI(function(){var s=WI(r.resolve),u=[],f=0,l=1;JI(t,function(c){var d=f++,v=!1;l++,GI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var XI=Y,qI=jr.CONSTRUCTOR,Zi=Ar,QI=Pe,e0=W,t0=ye,pu=Zi&&Zi.prototype;XI({target:"Promise",proto:!0,forced:qI,real:!0},{catch:function(e){return this.then(void 0,e)}});if(e0(Zi)){var mu=QI("Promise").prototype.catch;pu.catch!==mu&&t0(pu,"catch",mu,{unsafe:!0})}var r0=Y,n0=te,a0=Oe,i0=je,o0=Yt,s0=Cr,c0=ea;r0({target:"Promise",stat:!0,forced:c0},{race:function(t){var r=this,n=i0.f(r),a=n.reject,i=o0(function(){var o=a0(r.resolve);s0(t,function(s){n0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var u0=Y,l0=je,f0=jr.CONSTRUCTOR;u0({target:"Promise",stat:!0,forced:f0},{reject:function(t){var r=l0.f(this),n=r.reject;return n(t),r.promise}});var d0=Ee,v0=ge,h0=je,vd=function(e,t){if(d0(e),v0(t)&&t.constructor===e)return t;var r=h0.f(e),n=r.resolve;return n(t),r.promise},p0=Y,m0=Pe,g0=jr.CONSTRUCTOR,y0=vd;m0("Promise");p0({target:"Promise",stat:!0,forced:g0},{resolve:function(t){return y0(this,t)}});var w0=Y,b0=te,S0=Oe,$0=je,I0=Yt,T0=Cr,E0=ea;w0({target:"Promise",stat:!0,forced:E0},{allSettled:function(t){var r=this,n=$0.f(r),a=n.resolve,i=n.reject,o=I0(function(){var s=S0(r.resolve),u=[],f=0,l=1;T0(t,function(c){var d=f++,v=!1;l++,b0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var P0=Y,O0=te,k0=Oe,_0=Pe,R0=je,C0=Yt,A0=Cr,j0=ea,gu="No one promise resolved";P0({target:"Promise",stat:!0,forced:j0},{any:function(t){var r=this,n=_0("AggregateError"),a=R0.f(r),i=a.resolve,o=a.reject,s=C0(function(){var u=k0(r.resolve),f=[],l=0,c=1,d=!1;A0(t,function(v){var p=l++,S=!1;c++,O0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,gu)))})}),--c||o(new n(f,gu))});return s.error&&o(s.value),a.promise}});var L0=Y,N0=je;L0({target:"Promise",stat:!0},{withResolvers:function(){var t=N0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var U0=Y,Cn=Ar,x0=q,hd=Pe,pd=W,D0=Kf,yu=vd,M0=ye,Ji=Cn&&Cn.prototype,F0=!!Cn&&x0(function(){Ji.finally.call({then:function(){}},function(){})});U0({target:"Promise",proto:!0,real:!0,forced:F0},{finally:function(e){var t=D0(this,hd("Promise")),r=pd(e);return this.then(r?function(n){return yu(t,e()).then(function(){return n})}:e,r?function(n){return yu(t,e()).then(function(){throw n})}:e)}});if(pd(Cn)){var wu=hd("Promise").prototype.finally;Ji.finally!==wu&&M0(Ji,"finally",wu,{unsafe:!0})}var B0=Ao;B0.Promise;var z0=Y,H0=H,K0=Wf,G0=Zn,W0=je,V0=Oe,md=Yt,ui=H0.Promise,bu=!1,Z0=!ui||!ui.try||md(function(){ui.try(function(e){bu=e===8},8)}).error||!bu;z0({target:"Promise",stat:!0,forced:Z0},{try:function(e){var t=arguments.length>1?G0(arguments,1):[],r=W0.f(this),n=md(function(){return K0(V0(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function Ye(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Re(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 rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vo(e,t){return e(t={exports:{}},t.exports),t.exports}var et=Vo(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()}});Wo(et);var J0=Wo(Vo(function(e,t){var r=rt&&rt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function T(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,T)}I((v=v.apply(l,c||[])).next())})},n=rt&&rt.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[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(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},a=rt;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="",v=0;v<l;v++)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 v,p,S,g,T,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=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 v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,et.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?(et.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),et.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(et.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(v){var p=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(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,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,et.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),et.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var T=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const Y0={timeoutInSeconds:60},gd={name:"auth0-spa-js",version:"2.1.3"},yd=()=>Date.now();let se=class Yi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Yi.prototype)}static fromPayload({error:t,error_description:r}){return new Yi(t,r)}},X0=class wd extends se{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,wd.prototype)}},Xi=class bd extends se{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,bd.prototype)}},q0=class Sd extends Xi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Sd.prototype)}},Q0=class $d extends se{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,$d.prototype)}},eT=class Id extends se{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Id.prototype)}},Td=class Ed extends se{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Su(t,["default"])}', scope: '${Su(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Ed.prototype)}};function Su(e,t=[]){return e&&!t.includes(e)?e:""}const gn=()=>window.crypto,li=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(gn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},$u=e=>btoa(e),qi=e=>{var{clientId:t}=e,r=Re(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()},Iu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),tT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},rT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([tT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},nT=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},aT=async(e,t,r,n,a,i,o=1e4)=>a?nT(e,t,r,n,o,a,i):rT(e,n,o);async function iT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Re(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?qi(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let T,I=null;for(let C=0;C<3;C++)try{T=await aT(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=T.json,{error:h,error_description:$}=b,k=Re(b,["error","error_description"]),{ok:_}=T;if(!_){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new eT(h,C,k.mfa_token):h==="missing_refresh_token"?new Td(d,v):new se(h||"request_error",C)}return k}(`${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||gd))}},t,s)}const rn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class Qi{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 Qi({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Qi({scope:r,audience:n,clientId:a})}},oT=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@@"))}},Pd=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)}}()}},sT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||yd}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 it({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 it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.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]}},cT=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 or=e=>typeof e=="number",uT=["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"],lT=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(Iu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],uT.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Iu(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&&!or(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||!or(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!or(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&&or(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&&or(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 ot=Vo(function(e,t){var r=rt&&rt.__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 v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.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}))}});Wo(ot),ot.encode,ot.parse,ot.getAll;var fT=ot.get,Od=ot.set,kd=ot.remove;const Pt={get(e){const t=fT(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),Od(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r)}},dT={get(e){return Pt.get(e)||Pt.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),Od(`_legacy_${e}`,JSON.stringify(t),n),Pt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r),Pt.remove(e,t),Pt.remove(`_legacy_${e}`,t)}},vT={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 hT(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,v=l.length;d<v;++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
2
|
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Tu,Eu,Pu,fi,pT=(Tu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Eu=null,Pu=!1,function(e){return fi=fi||hT(Tu,Eu,Pu),new Worker(fi,e)});const di={};let mT=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 gT={memory:()=>new Pd().enclosedCache,localstorage:()=>new oT},Ou=e=>gT[e],ku=e=>{const{openUrl:t,onRedirect:r}=e,n=Re(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},vi=new J0;let yT=class{constructor(t){let r,n;if(this.userCache=new Pd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await vi.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(!gn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(gn().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",!Ou(r))throw new Error(`Invalid cache location "${r}"`);n=Ou(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Pt:dT,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:vT;var i;this.scope=rn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new cT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||yd,this.cacheManager=new sT(n,n.allKeys?void 0:new mT(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 pT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||gd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${qi(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return lT({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=$u(li()),i=$u(li()),o=li(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await gn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:rn(c,d.scope),response_type:"code",response_mode:T||"query",state:v,nonce:p,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 Q0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new q0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(se.fromPayload(v.data.response));u(v.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 se("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=ku(t),{openUrl:a,fragment:i,appState:o}=n,s=Re(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=Re(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 se("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new X0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new se("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:rn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=di[o];return s||(s=i().finally(()=>{delete di[o],s=null}),di[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=Re(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})(()=>vi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Xi;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 vi.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:rn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},Y0),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({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=Re(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${qi(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=ku(t),{openUrl:n}=r,a=Re(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 se("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((p,S,g=60)=>new Promise((T,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Xi),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.close(),_.data.response.error?I(se.fromPayload(_.data.response)):T(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new se("state_mismatch","Invalid state");const v=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({},v),{scope:f,oauthTokenScope:v.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 it({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 Td(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=Re(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 it({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 it({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 iT(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 wT(e){const t=new yT(e);return await t.checkSession(),t}var Te=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Te||{});const bT="sesamy.com",ST="sesamy.dev",$T="https://sesa.my",eo="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?ST:bT}`}let ue,_d,Rd=!1;const zt="sesamyAccessToken",hi="sesamyRefreshToken";async function Lr(){return new Promise((r,n)=>{let a=0;const i=()=>{Rd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function IT(e){if(!e)return null;const t=localStorage.getItem(hi);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(hi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(hi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{Cd()}}async function Zo(){const e=localStorage.getItem(zt);if(!e)return null;const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await IT(t);if(r)return r;localStorage.removeItem(zt)}return e}function _u(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 TT(e){if(e.enabled===!1)return;_d=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(_u(window.location.href)!==_u(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await wT(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();Ye(Te.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)}Rd=!0}async function Jo(){return await Lr(),await Zo()?!0:ue?ue.isAuthenticated():!1}async function ET(){return await Lr(),await Zo()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Yo(e){if(await Lr(),localStorage.removeItem(zt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:_d,redirect_uri:window.location.href,...t}})}async function sr(e=!0){await Lr();const t=await Zo();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Cd(e={}){if(await Lr(),localStorage.removeItem(zt),Ye(Te.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Ad(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 jd(e){const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Ye(Te.AUTHENTICATED,t)}const PT=(e,t)=>t.skipDedupe||t.method!=="GET",OT=(e,t)=>t.method+"@"+e,kT=e=>e.clone(),Ru=({skip:e=PT,key:t=OT,resolver:r=kT}={})=>{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,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},_T=(e,t)=>e*t,RT=e=>e&&e.ok,Cu=({delayTimer:e=500,delayRamp:t=_T,maxAttempts:r=10,until:n=RT,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=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},CT="application/json",Ld="Content-Type",It=Symbol(),Nd=Symbol();function Au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Ld.toLowerCase()))===null||t===void 0?void 0:t[1]}function ju(e){return/^application\/.*json.*/.test(e)}const st=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]=st(o,i,r):n[a]=i,n},{...e})},Bt={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 AT(e,t=!1){Bt.options=t?e:st(Bt.options,e)}function jT(e,t=!1){Bt.polyfills=t?e:st(Bt.polyfills,e)}function LT(e){Bt.errorType=e}const NT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Ud extends Error{}const UT=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=NT(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[It]:b}}).then(b=>{if(!b.ok){const h=new Ud;if(h.cause=v,h.stack=h.stack+`
|
|
5
|
-
CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(It),k=$?h[It]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(It)&&f.get(It);if(_)return _(k,e);const C=f.get(Nd);if(C)return C(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),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(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(It,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),T);return o.reduce((b,h)=>h(b,e),I)},xT={_url:"",_options:{},_config:Bt,_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:st(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:st(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:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Ld]: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(Nd,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=Au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||ju(a));return n=r?o?n.json(r,a):n.body(r):n,UT(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=Au(this._options.headers);return this.content(t||ju(r)&&r||CT).body(JSON.stringify(e))}};function Me(e="",t={}){return{...xT,_url:e,_options:t}}Me.default=Me;Me.options=AT;Me.errorType=LT;Me.polyfills=jT;Me.WretchError=Ud;function Se(){sessionStorage.removeItem(eo),Ye(Te.CLEAR_CACHE,{})}function Lu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function DT(e){const t=Ke("api2",e.environment),r=w=>async(E,P)=>{let B=sessionStorage.getItem(eo);B||(B=Date.now().toString(),sessionStorage.setItem(eo,B));const ae={...P,headers:{...P.headers,"Cache-Timestamp":B}};return w(E,ae)},n=(w=!0)=>E=>async(P,B)=>{let ae=null;if(ae=await sr(w),!ae){if(w)throw new Error("No access token available");return E(P,B)}const ze={...B,headers:{...B.headers,...ae?{Authorization:`Bearer ${ae}`}:{}}};return E(P,ze)},a=w=>(E,P)=>{if(P.headers.Authorization)return w(E,P);const B=localStorage.getItem("__anon_id"),ae=btoa(`${B}:`),ze={...P,headers:{...P.headers,Authorization:`Basic ${ae}`}};return w(E,ze)},i=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const E=await i.get("/entitlements").json();return E==null?void 0:E.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const E=await i.get("/contracts").json();return E==null?void 0:E.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const E=await i.get("/bills").json();return E==null?void 0:E.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const E=await i.get("/transactions").json();return E==null?void 0:E.find(P=>P.id===w)}async function T(w,E){const P=await i.url(`/user-metadata/${w}`).put(E).json();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),P}async function I(w){const E=await i.url(`/user-metadata/${w}`).delete().res();return Se(),E.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const E=await i.url(`/tags/${w}`).delete().res();return Se(),E.ok}async function _(w){const E=await i.url("/tags").post(w).res();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),E.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const E=await o.url(`/tallies/${w}`).delete().res();return Se(),E.ok}async function V(w,E){return await o.url(`/tallies/${w}/push`).post(E).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await sr(!1)?await i.url("/profile").get().json():null}async function z(w){const E=await i.url("/profile").patch(w).res();return Se(),E.ok}async function R(){return await i.url("/payment-issues").get().json()}async function G(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function J(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Le(w){const E=await sr(!1);if(!E)throw new Error("No access token available");const P=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",E),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const E=await i.url(`/products/${w}/auto-onboard`).post().json();return E.length&&Se(),E}async function y(w,E=3600){const{shortlink:P}=await Me($T).post({url:w,ttl:E}).json();return P}async function O(w){const E=await sr(!1);let P;const B=w.language||Lu();switch(w.target){case"account":P=new URL(`${Ke("account",e.environment)}/${B}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ke("consume",e.environment)}/${B}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),E&&(P.hash=`#access_token=${E}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Lu(),...w,vendorId:e.clientId})).json()}async function U(w,E){return(await o.url(`/checkouts/${w}`).patch(E)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await sr(!1),E=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);w&&(E.hash=`#access_token=${w}`),window.location.href=E.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:z,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:T,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:C,getTallies:M,deleteTally:F,pushTally:V,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:G,unlinkSpotify:J,linkSpotify:Le,generateLink:O,openHostedAccountPage:Z}}const xd="@sesamy/sesamy-js",Xo="1.19.1";function Nu(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 nn="undefined",Uu="object",to=function(){},Dd="any",Md="*",lt="__",An=typeof process<"u"?process:{};An.env&&An.env.NODE_ENV;var X=typeof document<"u";An.versions!=null&&An.versions.node!=null;typeof Deno<"u"&&Deno.core;X&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Fd(e,t){return t.charAt(0)[e]()+t.slice(1)}var MT=Fd.bind(null,"toUpperCase"),FT=Fd.bind(null,"toLowerCase");function zT(e){return zd(e)?MT("null"):typeof e=="object"?GT(e):Object.prototype.toString.call(e).slice(8,-1)}function jn(e,t){t===void 0&&(t=!0);var r=zT(e);return t?FT(r):r}function Nr(e,t){return typeof t===e}var oe=Nr.bind(null,"function"),Ve=Nr.bind(null,"string"),Rt=Nr.bind(null,"undefined"),BT=Nr.bind(null,"boolean");Nr.bind(null,"symbol");function zd(e){return e===null}function HT(e){return jn(e)==="number"&&!isNaN(e)}function Bd(e){return jn(e)==="array"}function ie(e){if(!KT(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function KT(e){return e&&(typeof e=="object"||e!==null)}function GT(e){return oe(e.constructor)?e.constructor.name:null}function WT(e){return e instanceof Error||Ve(e.message)&&e.constructor&&HT(e.constructor.stackTraceLimit)}function Hd(e,t){if(typeof t!="object"||zd(t))return!1;if(t instanceof e)return!0;var r=jn(new e(""));if(WT(t))for(;t;){if(jn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Hd.bind(null,TypeError);Hd.bind(null,SyntaxError);function ta(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?VT(e,t):r}function VT(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ra(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ra(ta,"form");ra(ta,"button");ra(ta,"input");ra(ta,"select");function ZT(e){return e?Bd(e)?e:[e]:[]}function xu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function JT(){if(X){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function YT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function XT(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=xu(r[1]),o=xu(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&&(qT(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return X&&window.location.search.substring(1)}())}function qT(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 na(){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 QT(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 wr="global",Ht=lt+"global"+lt,Kt=typeof self===Uu&&self.self===self&&self||typeof global===Uu&&global.global===global&&global||void 0;function ft(e){return Kt[Ht][e]}function dt(e,t){return Kt[Ht][e]=t}function Xt(e){delete Kt[Ht][e]}function qt(e,t,r){var n;try{if(qo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Ht]||(Kt[Ht]={});var an={};function qo(e){if(typeof an[e]!==nn)return an[e];try{var t=window[e];t.setItem(nn,nn),t.removeItem(nn)}catch{return an[e]=!1}return an[e]=!0}function j(){return j=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},j.apply(this,arguments)}var Ge="function",De="undefined",eE="@@redux/"+Math.random().toString(36),Du=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),on=" != "+Ge;function Kd(e,t,r){var n;if(typeof t===Ge&&typeof r===De&&(r=t,t=void 0),typeof r!==De){if(typeof r!==Ge)throw new Error("enhancer"+on);return r(Kd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+on);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+on);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===De)throw new Error("ActType "+De);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+on);a=v,d({type:"@@redux/INIT"})}})[Du]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Du]=function(){return this},v},n}function tE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+De}function Gt(){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 rE(){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)}),j({},o,{dispatch:s=Gt.apply(void 0,i)(o.dispatch)})}}}var Ze=lt+"anon_id",ct=lt+"user_id",jt=lt+"user_traits",He="userId",Ct="anonymousId",yn=["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"],ro=["name","EVENTS","config","loaded"],A=yn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Mu=/^utm_/,Fu=/^an_prop_/,zu=/^an_trait_/;function nE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ze,o.anonymousId),f||t(ct,o.userId),u.traits&&t(jt,j({},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,v=l.reduce(function(p,S){if(S.match(Mu)||S.match(/^(d|g)clid/)){var g=S.replace(Mu,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Fu)&&(p.props[S.replace(Fu,"")]=i[S]),S.match(zu)&&(p.traits[S.replace(zu,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function aE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ze)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Ze,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Bu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Ze),traits:e.getItem(jt)}}var no=function(e){return lt+"TEMP"+lt+e};function iE(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===A.reset&&([ct,jt,Ze].forEach(function(v){n(v)}),[He,Ct,"traits"].forEach(function(v){Xt(no(v))})),s.type===A.identify){a(Ze)||r(Ze,na());var c=a(ct),d=a(jt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(jt,j({},d,f))}return o(s)}}}}var dr={};function Hu(e,t){dr[e]&&oe(dr[e])&&(dr[e](t),delete dr[e])}function Gd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Gd(e,t,r-10).then(n,a)})})}function oE(e){return{abort:e}}function Wd(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,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&oe(S)){var g,T=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[He,Ct].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[v].config,instance:r,abort:oE}))&&ie(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(j({},T,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var pi=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(Lt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,T){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var C=I.type.match(Lt)?function(M,F,V,L,x){return function(z,R){var G=L?L.name:M,J=R&&Er(R)?R:V;if(L&&(!(J=R&&Er(R)?R:[M]).includes(M)||J.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(J)+" input valid");return j({},x,{abort:{reason:z,plugins:J,caller:F,_:G}})}}(k,_,T,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:sE(I),instance:g,config:$||{},abort:C}}}(n,v),S=t.exact.reduce(function(g,T){var I=T.pluginName,b=T.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var b=T.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&oe(C.method)?(function(z,R){var G=Yu(z);if(G&&G.name===R){var J=Yu(G.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+G.method+" "+(J?"or "+J.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
-
`))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(V=F,L=b,x=C.pluginName,function(z,R){return j({},V,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Wu(C.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(j({},F,R))})):F;var V,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(T).then(function(_){var C=g[$]?g[$]:{};if(d&&(C=_),gi(C,$))return mi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(gi(_,$))return h&&mi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:C,instance:n,config:Wu($,f,i),plugins:f})).then(function(F){var V=ie(F)?F:{},L=j({},_,V),x=g[$];if(gi(x,$))mi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Ku)&&!c.match(Gu)&&n.dispatch(j({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Lt)||c.match(/^registerPlugin/)||c.match(Gu)||c.match(Ku)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});Vd(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Ku=/^bootstrap/,Gu=/^ready/;function mi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Wu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Vu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Zu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function gi(e,t){var r=e.abort;return!!r&&(r===!0||Ju(r,t)||r&&Ju(r.plugins,t))}function Vd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ve(r))return!0;var n=r.plugins;return Er(r)&&r.length===t||Er(n)&&n.length===t}function Er(e){return Array.isArray(e)}function Ju(e,t){return!(!e||!Er(e))&&e.includes(t)}function Yu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function sE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function cE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Hu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],T=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return Gd(h,function(){return $({config:_})},1e4).then(function(C){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!ro.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){v.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Wd(a,t,e)},0),Promise.resolve(function(h,$,k,_,C){try{var M=oe($)?$():$,F=h.type,V=F.replace(Lt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(G=M,(J=L.plugins)===void 0&&(J={}),(Le=h.options)===void 0&&(Le={}),Object.keys(G).filter(function(m){var y=Le.plugins||{};return BT(y[m])?y[m]:y.all!==!1&&(!J[m]||J[m].enabled!==!1)}).map(function(m){return G[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,y,O){var N=Zu(m).map(function(U){return Vu(U,y)});return y.reduce(function(U,D){var Z=D.name,w=Zu(m,Z).map(function(ae){return Vu(ae,y)}),E=w[0],P=w[1],B=w[2];return E.length&&(U.beforeNS[Z]=E),P.length&&(U.duringNS[Z]=P),B.length&&(U.afterNS[Z]=B),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(pi({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(m){function y(){var U=function(){if(F.match(Lt))return Promise.resolve(pi({action:j({},O,{type:V+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Hu(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(Vd(m,z.length))return m;var O,N=function(){if(F!==V)return Promise.resolve(pi({action:j({},m,{type:V}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var G,J,Le}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function uE(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===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var lE=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 Gt.apply(void 0,o)(n)(a)}}}}};function fE(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=Xu(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},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Xu(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,qu(r.plugins,!1,t));case A.enablePlugin:return j({},t,qu(r.plugins,!0,t));default:return t}}}function Xu(e,t){return e.substring(t.length+1,e.length)}function qu(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Zd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var dE={last:{},history:[]};function vE(e,t){e===void 0&&(e=dE);var r=t.options,n=t.meta;if(t.type===A.track){var a=Zd(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var hE={actions:[]};function pE(e,t){e===void 0&&(e=hE);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Jd=/#.*$/;function mE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Jd,""):"")}var Yd,Xd,qd,Qd,gE=function(e){if(e===void 0&&(e={}),!X)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 v=function(){if(X){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(Jd,"")}(f),c={title:r,url:l,path:mE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},yE={last:{},history:[]};function wE(e,t){e===void 0&&(e=yE);var r=t.options;if(t.type===A.page){var n=Zd(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}Yd=function(){if(!X)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"}(),Xd=X?document.referrer:null,qd=JT(),Qd=YT();var Qu={initialized:!1,sessionId:na(),app:null,version:null,debug:!1,offline:!!X&&!navigator.onLine,os:{name:Yd},userAgent:X?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Qd,locale:qd,campaign:{},referrer:Xd};function bE(e,t){e===void 0&&(e=Qu);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},Qu,e,{initialized:!0})}}var SE=["plugins","reducers","storage"];function $E(e,t,r){if(X){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function IE(e){var t=$E.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function ev(){return dt("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 Kt[Ht].analytics.push(o.action||o),i(o)}})}}}function el(e){return function(){return Gt(Gt.apply(null,arguments),ev())}}function yi(e){return e?Bd(e)?e:[e]:[]}function tl(e,t,r){e===void 0&&(e={});var n,a,i=na();return t&&(dr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function TE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var E=Array.prototype.slice.call(arguments),P=new Array(w.length),B=0;B<E.length;B++)P[B]=E[B];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:Xt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Bu(m)[y]||ft(no(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!ro.includes(m)}).sort(),u=new Set(s.concat(yn).filter(function(m){return!ro.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new lE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=XT(),T=Bu(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=na());var b=j({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:yi(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:yi(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ve(m)?m:null,D=ie(m)?m:y,Z=O||{},w=$.user();dt(no(He),U);var E=U||D.userId||i(He,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(j({type:A.identifyStart,userId:E,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ve(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},Z=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:Z,userId:i(He,$,y),anonymousId:i(Ct,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:gE(N),options:U,userId:i(He,$,N),anonymousId:i(Ct,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===He||m==="id")return i(He,$);if(m===Ct||m==="anonId")return i(Ct,$);var y=$.getState("user");return m?Nu(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(E){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),E(P)}}},U=function(w){return function(E){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),E(P)}}};return d(N,sn),d(U,cn),function(){v(N,sn),v(U,cn)}}var D=m.match(O)?sn:cn,Z=function(w){return function(E){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),E(P)}}};return d(Z,D),function(){return v(Z,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?Nu(y,m):Object.assign({},y)},dispatch:function(m){var y=Ve(m)?{type:m}:m;if(yn.includes(y.type))throw new Error("reserved action "+y.type);var O=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ze,m,y)},events:{core:yn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=tl()),y(O)}}},p(sn),cE($,l,{all:f,plugins:s}),uE(a),nE($),iE($),p(cn)]),_={context:bE,user:aE(a),page:wE,track:vE,plugins:fE(l),queue:pE},C=Gt,M=Gt;if(X&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?ev():ie(typeof arguments[0])?el():el().apply(null,arguments)}}var V,L=function(m){return Object.keys(m).reduce(function(y,O){return SE.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),z={context:L,user:I,plugins:x},R=Kd(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Ge&&(O[U]=m[U])}var D,Z=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(E){var P=w[E];if(typeof P(void 0,{type:"@@redux/INIT"})===De||typeof P(void 0,{type:eE})===De)throw new Error("reducer "+E+" "+De)})})(O)}catch(w){D=w}return function(w,E){if(w===void 0&&(w={}),D)throw D;for(var P=!1,B={},ae=0;ae<Z.length;ae++){var ze=Z[ae],is=w[ze],oa=(0,O[ze])(is,E);if(typeof oa===De){var hv=tE(ze,E);throw new Error(hv)}B[ze]=oa,P=P||oa!==is}return P?B:w}}(j({},_,t)),z,M(C(rE.apply(void 0,k))));R.dispatch=(V=R.dispatch,function(m,y,O){var N=j({},m,{meta:tl(m.meta,y,yi(O))});return V.apply(null,[N])});var G=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:G,config:L,params:g,user:I,initialUser:r,persistedUser:T});var J=G.filter(function(m){return n.pluginEnabled[m]}),Le=G.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:G,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&oe(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:J,disabled:Le})}),IE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return Wd(m,y,O)},3e3)}(R,l,$),$}var sn="before",cn="after",br="cookie",nt=nv(),tv=aa,EE=aa;function rv(e){return nt?aa(e,"",-1):Xt(e)}function nv(){if(nt!==void 0)return nt;var e="cookiecookie";try{aa(e,e),nt=document.cookie.indexOf(e)!==-1,rv(e)}catch{nt=!1}return nt}function aa(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return nt===!1&&(o?dt(e,t):ft(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 Sr="localStorage",PE=qo.bind(null,"localStorage");qt("localStorage","getItem",ft);qt("localStorage","setItem",dt);qt("localStorage","removeItem",Xt);var $r="sessionStorage",OE=qo.bind(null,"sessionStorage");qt("sessionStorage","getItem",ft);qt("sessionStorage","setItem",dt);qt("sessionStorage","removeItem",Xt);function Nt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var kE=PE(),_E=OE(),RE=nv();function av(e,t){if(e){var r=Qo(t),n=!ns(r),a=es(r)?Nt(localStorage.getItem(e)):void 0;if(n&&!Rt(a))return a;var i=ts(r)?Nt(tv(e)):void 0;if(n&&i)return i;var o=rs(r)?Nt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function CE(e,t,r){if(e&&!Rt(t)){var n={},a=Qo(r),i=JSON.stringify(t),o=!ns(a);return es(a)&&(n[Sr]=un(Sr,t,Nt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Sr]:ts(a)&&(n[br]=un(br,t,Nt(tv(e))),EE(e,i),o)?n[br]:rs(a)&&(n[$r]=un($r,t,Nt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[$r]:(n[wr]=un(wr,t,ft(e)),dt(e,t),o?n[wr]:n)}}function AE(e,t){if(e){var r=Qo(t),n=av(e,Md),a={};return!Rt(n.localStorage)&&es(r)&&(localStorage.removeItem(e),a[Sr]=n.localStorage),!Rt(n.cookie)&&ts(r)&&(rv(e),a[br]=n.cookie),!Rt(n.sessionStorage)&&rs(r)&&(sessionStorage.removeItem(e),a[$r]=n.sessionStorage),!Rt(n.global)&&ia(r,wr)&&(Xt(e),a[wr]=n.global),a}}function Qo(e){return e?Ve(e)?e:e.storage:Dd}function es(e){return kE&&ia(e,Sr)}function ts(e){return RE&&ia(e,br)}function rs(e){return _E&&ia(e,$r)}function ns(e){return e===Md||e==="all"}function ia(e,t){return e===Dd||e===t||ns(e)}function un(e,t,r){return{location:e,current:t,previous:r}}var jE={setItem:CE,getItem:av,removeItem:AE};function LE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rl(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 nl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rl(Object(r),!0).forEach(function(n){LE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:jE};return TE(nl(nl({},t),e))}function UE(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 xE(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=ME(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function DE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function ME(e){return["#","?"].forEach(t=>e=DE(e,t)),e}function FE(){xE(()=>{xe.page()})}function zE(e){if(e===void 0&&(e={}),!X)return to;var t=il(),r=ao(),n=al(),a=ln(n,t),i=ln(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return to;var v=d.map(function(S){return Number(S)}),p=QT(function(){var S=il(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,v),T=ao(),I=al(),b=ln(I,S),h=ln(T,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,C=v;(k==="up"||$)&&(_=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(G){return G!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(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:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,V=M.direction;oe(e[F])&&e[F]({trigger:F,direction:V,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function ao(){return X?document.body.scrollTop||document.documentElement.scrollTop:0}function BE(){return X?window.innerHeight||document.documentElement.clientHeight:0}function al(){return Math.round(ao()+BE())}function il(){if(!X)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function ln(e,t){return Math.round(e/t*100)}var ol="EventListener";function HE(e){return function(t,r,n,a){var i=n||to,o=a||!1;if(!X)return i;var s=Ln(r),u=Ln(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"+ol:"remove"+ol,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?KE(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function Ln(e,t){if(Ve(e))return t?Ln(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=ZT(e);return t?i.map(function(o){return Ve(o)?Ln(o,!0):o}).flat():i}function KE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var wi=HE("Event");function iv(e,t){return X&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}iv.bind(null,"onerror");iv.bind(null,"onload");var ov=typeof window>"u",sl="hidden";function GE(e){if(ov)return!1;var t=WE(),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 WE(){var e=["webkit","moz","ms","o"];return ov||sl in document?sl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var VE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function ZE(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=GE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(VE.map(function(s){return wi(document,s,r)})).concat(wi(window,"load",r)).concat(wi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function JE(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,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(cr(d),g),a&&l&&(l=!1,a(cr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(cr(d),g))},s)}var S=ZE(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:cr(d,c),idle:l?cr(r,c):0}}}}function cr(e,t){return t?0:Math.round((new Date-e)/1e3)}const cl=5e3;class YE{constructor(t){le(this,"element");le(this,"isInViewport",!1);le(this,"isAwake",!1);le(this,"isFlushing");le(this,"observer");le(this,"lastEventAt",Date.now());le(this,"registeredView",!1);le(this,"viewCallback");le(this,"activeDurationCallback");le(this,"idleDurationCallback");le(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),JE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:cl}),zE({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*cl: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 ul="sesamy_session_id";function XE(){let e=sessionStorage.getItem(ul);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ul,e)),e}let sv=!1,io,ll,Nn;const cv=new Map;function qE({clientId:e,enabled:t=!0,environment:r}){if(io=e,ll=t,Nn=`${Ke("logs",r)}/events`,!ll)return;window.addEventListener("beforeunload",()=>{lv.forEach((a,i)=>{a.bind(i)()}),eP()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&cv.forEach((a,i)=>{a.bind(i)()})}),FE();const n=new YE({element:document.body,viewCallback:()=>{xe.page()},activeDurationCallback:(a,i,o)=>{xe.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{xe.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{xe.track("scroll",{scroll:a.scrollMax})}});tP(document.body,()=>{n.flush()}),rP(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Te.AUTHENTICATED,async a=>{const i=a;await xe.identify(i.detail.sub)}),window.addEventListener(Te.LOGOUT,async()=>{await xe.track("logout",{}),as.flush(),await xe.reset()})}function uv(e){return JSON.stringify(e.map(t=>({...t,clientId:io,requestId:Math.random().toString(36).slice(2,9),sessionId:XE(),timestamp:new Date().toISOString(),version:Xo,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:xd,userAgent:navigator.userAgent,clientId:io}})))}const as=UE(async e=>{if(e.length>0){const t=uv(e);sv?navigator.sendBeacon(Nn,t):(await fetch(Nn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function bi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Nn,uv([r]))}else as.push(e)}const xe=NE({app:xd,version:Xo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;bi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function QE(e,t){xe.track(e,t)}function eP(){return sv=!0,as.flush()}const lv=new Map;function tP(e,t){lv.set(e,t)}function rP(e,t){cv.set(e,t)}const fv="sesamySignedURLs";function dv(){const e=sessionStorage.getItem(fv);return e?JSON.parse(e):[]}function nP(e){const t=dv();t.push(e),sessionStorage.setItem(fv,JSON.stringify(t))}function aP(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:T,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:C,pushTally:M,deleteTally:F,getProduct:V,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:G,openHostedAccountPage:J,generateLink:Le}=DT(e),m={auth:{getUser:p,isAuthenticated:Jo,loginWithRedirect:Yo,logout:Cd,setToken:jd},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:J,isSpotifyLinked:x,unlinkSpotify:z},analytics:{track:QE},tags:{list:g,set:I,delete:T},entitlements:{get:a,list:i,access:o,signedLinks:dv},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:V,autoOnboard:G,linkSpotify:R},getVersion:iP,getPaymentIssues:L,generateLink:Le,clearCache:Se};return e.namespace&&(window[e.namespace]=m),m}function iP(){return Xo}async function oP({enabled:e=!1,rules:t}){if(!e)return;const r=await Jo(),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)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function fl(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}}function sP(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){jd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const dl="sesamy-refresh",vl="force-refetch-entitlements";function cP(){const e=new URLSearchParams(window.location.search),t=e.get(vl),r=e.get(dl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(vl),e.delete(dl),n.search=e.toString(),Se(),window.history.replaceState(null,"",n)}}function uP(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;nP({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const hl="sesamy-user";async function lP(){const t=new URLSearchParams(window.location.search).get(hl);if(!t)return;const r=await ET();(r==null?void 0:r.email)!==t&&(Se(),Yo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(hl),window.history.replaceState(null,"",n)}const pl="sesamy-purchase";function fP(){const e=new URLSearchParams(window.location.search),t=e.get(pl);if(t!==null){const r=new URL(window.location.href);e.delete(pl),r.search=e.toString(),Ye(Te.PURCHASE,{itemSrc:t}),Se(),window.history.replaceState(null,"",r)}}const ml="sesamy-login";async function dP(){if(!new URLSearchParams(window.location.search).get(ml))return;await Jo()||Yo();const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const vP=typeof window<"u";async function gl(e){qE({clientId:e.clientId,environment:e.environment,...e.analytics}),await TT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await oP(e.transform),sP(),cP(),uP(),await dP(),await lP(),fP(),Ye(Te.READY,{})}async function vv(e){const t=aP({clientId:e.clientId,environment:e.environment,...e.api});return vP&&(e.awaitAllServices?await gl(e):gl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);vv(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=vv;
|
|
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",!Ou(r))throw new Error(`Invalid cache location "${r}"`);n=Ou(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Pt:dT,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:vT;var i;this.scope=rn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new cT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||yd,this.cacheManager=new sT(n,n.allKeys?void 0:new mT(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 pT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||gd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${qi(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return lT({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=$u(li()),i=$u(li()),o=li(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await gn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:rn(c,d.scope),response_type:"code",response_mode:T||"query",state:v,nonce:p,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 Q0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new q0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(se.fromPayload(v.data.response));u(v.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 se("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=ku(t),{openUrl:a,fragment:i,appState:o}=n,s=Re(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=Re(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 se("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new X0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new se("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:rn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=di[o];return s||(s=i().finally(()=>{delete di[o],s=null}),di[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=Re(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})(()=>vi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Xi;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 vi.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:rn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},Y0),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({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=Re(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${qi(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=ku(t),{openUrl:n}=r,a=Re(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 se("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((p,S,g=60)=>new Promise((T,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Xi),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.close(),_.data.response.error?I(se.fromPayload(_.data.response)):T(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new se("state_mismatch","Invalid state");const v=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({},v),{scope:f,oauthTokenScope:v.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 it({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 Td(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=Re(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 it({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 it({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 iT(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 wT(e){const t=new yT(e);return await t.checkSession(),t}var Te=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Te||{});const bT="sesamy.com",ST="sesamy.dev",$T="https://sesa.my",eo="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?ST:bT}`}let ue,_d,Rd=!1;const Bt="sesamyAccessToken",hi="sesamyRefreshToken";async function Lr(){return new Promise((r,n)=>{let a=0;const i=()=>{Rd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function IT(e){if(!e)return null;const t=localStorage.getItem(hi);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(hi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(hi,i.refresh_token),localStorage.setItem(Bt,i.access_token),i.access_token}catch{Cd()}}async function Zo(){const e=localStorage.getItem(Bt);if(!e)return null;const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await IT(t);if(r)return r;localStorage.removeItem(Bt)}return e}function _u(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 TT(e){if(e.enabled===!1)return;_d=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(_u(window.location.href)!==_u(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await wT(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();Ye(Te.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)}Rd=!0}async function Jo(){return await Lr(),await Zo()?!0:ue?ue.isAuthenticated():!1}async function ET(){return await Lr(),await Zo()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Yo(e){if(await Lr(),localStorage.removeItem(Bt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:_d,redirect_uri:window.location.href,...t}})}async function sr(e=!0){await Lr();const t=await Zo();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Cd(e={}){if(await Lr(),localStorage.removeItem(Bt),Ye(Te.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Ad(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 jd(e){const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Bt,e),Ye(Te.AUTHENTICATED,t)}const PT=(e,t)=>t.skipDedupe||t.method!=="GET",OT=(e,t)=>t.method+"@"+e,kT=e=>e.clone(),Ru=({skip:e=PT,key:t=OT,resolver:r=kT}={})=>{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,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},_T=(e,t)=>e*t,RT=e=>e&&e.ok,Cu=({delayTimer:e=500,delayRamp:t=_T,maxAttempts:r=10,until:n=RT,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=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},CT="application/json",Ld="Content-Type",It=Symbol(),Nd=Symbol();function Au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Ld.toLowerCase()))===null||t===void 0?void 0:t[1]}function ju(e){return/^application\/.*json.*/.test(e)}const st=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]=st(o,i,r):n[a]=i,n},{...e})},zt={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 AT(e,t=!1){zt.options=t?e:st(zt.options,e)}function jT(e,t=!1){zt.polyfills=t?e:st(zt.polyfills,e)}function LT(e){zt.errorType=e}const NT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Ud extends Error{}const UT=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=NT(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[It]:b}}).then(b=>{if(!b.ok){const h=new Ud;if(h.cause=v,h.stack=h.stack+`
|
|
5
|
+
CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(It),k=$?h[It]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(It)&&f.get(It);if(_)return _(k,e);const C=f.get(Nd);if(C)return C(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),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(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(It,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),T);return o.reduce((b,h)=>h(b,e),I)},xT={_url:"",_options:{},_config:zt,_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:st(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:st(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:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Ld]: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(Nd,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=Au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||ju(a));return n=r?o?n.json(r,a):n.body(r):n,UT(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=Au(this._options.headers);return this.content(t||ju(r)&&r||CT).body(JSON.stringify(e))}};function Me(e="",t={}){return{...xT,_url:e,_options:t}}Me.default=Me;Me.options=AT;Me.errorType=LT;Me.polyfills=jT;Me.WretchError=Ud;function Se(){sessionStorage.removeItem(eo),Ye(Te.CLEAR_CACHE,{})}function Lu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function DT(e){const t=Ke("api2",e.environment),r=w=>async(E,P)=>{let z=sessionStorage.getItem(eo);z||(z=Date.now().toString(),sessionStorage.setItem(eo,z));const ae={...P,headers:{...P.headers,"Cache-Timestamp":z}};return w(E,ae)},n=(w=!0)=>E=>async(P,z)=>{let ae=null;if(ae=await sr(w),!ae){if(w)throw new Error("No access token available");return E(P,z)}const Be={...z,headers:{...z.headers,...ae?{Authorization:`Bearer ${ae}`}:{}}};return E(P,Be)},a=w=>(E,P)=>{if(P.headers.Authorization)return w(E,P);const z=localStorage.getItem("__anon_id"),ae=btoa(`${z}:`),Be={...P,headers:{...P.headers,Authorization:`Basic ${ae}`}};return w(E,Be)},i=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const E=await i.get("/entitlements").json();return E==null?void 0:E.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const E=await i.get("/contracts").json();return E==null?void 0:E.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const E=await i.get("/bills").json();return E==null?void 0:E.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const E=await i.get("/transactions").json();return E==null?void 0:E.find(P=>P.id===w)}async function T(w,E){const P=await i.url(`/user-metadata/${w}`).put(E).json();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),P}async function I(w){const E=await i.url(`/user-metadata/${w}`).delete().res();return Se(),E.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const E=await i.url(`/tags/${w}`).delete().res();return Se(),E.ok}async function _(w){const E=await i.url("/tags").post(w).res();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),E.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const E=await o.url(`/tallies/${w}`).delete().res();return Se(),E.ok}async function V(w,E){return await o.url(`/tallies/${w}/push`).post(E).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await sr(!1)?await i.url("/profile").get().json():null}async function B(w){const E=await i.url("/profile").patch(w).res();return Se(),E.ok}async function R(){return await i.url("/payment-issues").get().json()}async function G(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function J(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Le(w){const E=await sr(!1);if(!E)throw new Error("No access token available");const P=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",E),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const E=await i.url(`/products/${w}/auto-onboard`).post().json();return E.length&&Se(),E}async function y(w,E=3600){const{shortlink:P}=await Me($T).post({url:w,ttl:E}).json();return P}async function O(w){const E=await sr(!1);let P;const z=w.language||Lu();switch(w.target){case"account":P=new URL(`${Ke("account",e.environment)}/${z}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ke("consume",e.environment)}/${z}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),E&&(P.hash=`#access_token=${E}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Lu(),...w,vendorId:e.clientId})).json()}async function U(w,E){return(await o.url(`/checkouts/${w}`).patch(E)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await sr(!1),E=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);w&&(E.hash=`#access_token=${w}`),window.location.href=E.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:B,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:T,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:C,getTallies:M,deleteTally:F,pushTally:V,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:G,unlinkSpotify:J,linkSpotify:Le,generateLink:O,openHostedAccountPage:Z}}const xd="@sesamy/sesamy-js",Xo="1.19.1";function Nu(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 nn="undefined",Uu="object",to=function(){},Dd="any",Md="*",lt="__",An=typeof process<"u"?process:{};An.env&&An.env.NODE_ENV;var X=typeof document<"u";An.versions!=null&&An.versions.node!=null;typeof Deno<"u"&&Deno.core;X&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Fd(e,t){return t.charAt(0)[e]()+t.slice(1)}var MT=Fd.bind(null,"toUpperCase"),FT=Fd.bind(null,"toLowerCase");function BT(e){return Bd(e)?MT("null"):typeof e=="object"?GT(e):Object.prototype.toString.call(e).slice(8,-1)}function jn(e,t){t===void 0&&(t=!0);var r=BT(e);return t?FT(r):r}function Nr(e,t){return typeof t===e}var oe=Nr.bind(null,"function"),Ve=Nr.bind(null,"string"),Rt=Nr.bind(null,"undefined"),zT=Nr.bind(null,"boolean");Nr.bind(null,"symbol");function Bd(e){return e===null}function HT(e){return jn(e)==="number"&&!isNaN(e)}function zd(e){return jn(e)==="array"}function ie(e){if(!KT(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function KT(e){return e&&(typeof e=="object"||e!==null)}function GT(e){return oe(e.constructor)?e.constructor.name:null}function WT(e){return e instanceof Error||Ve(e.message)&&e.constructor&&HT(e.constructor.stackTraceLimit)}function Hd(e,t){if(typeof t!="object"||Bd(t))return!1;if(t instanceof e)return!0;var r=jn(new e(""));if(WT(t))for(;t;){if(jn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Hd.bind(null,TypeError);Hd.bind(null,SyntaxError);function ta(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?VT(e,t):r}function VT(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ra(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ra(ta,"form");ra(ta,"button");ra(ta,"input");ra(ta,"select");function ZT(e){return e?zd(e)?e:[e]:[]}function xu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function JT(){if(X){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function YT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function XT(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=xu(r[1]),o=xu(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&&(qT(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return X&&window.location.search.substring(1)}())}function qT(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 na(){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 QT(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 wr="global",Ht=lt+"global"+lt,Kt=typeof self===Uu&&self.self===self&&self||typeof global===Uu&&global.global===global&&global||void 0;function ft(e){return Kt[Ht][e]}function dt(e,t){return Kt[Ht][e]=t}function Xt(e){delete Kt[Ht][e]}function qt(e,t,r){var n;try{if(qo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Ht]||(Kt[Ht]={});var an={};function qo(e){if(typeof an[e]!==nn)return an[e];try{var t=window[e];t.setItem(nn,nn),t.removeItem(nn)}catch{return an[e]=!1}return an[e]=!0}function j(){return j=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},j.apply(this,arguments)}var Ge="function",De="undefined",eE="@@redux/"+Math.random().toString(36),Du=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),on=" != "+Ge;function Kd(e,t,r){var n;if(typeof t===Ge&&typeof r===De&&(r=t,t=void 0),typeof r!==De){if(typeof r!==Ge)throw new Error("enhancer"+on);return r(Kd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+on);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+on);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===De)throw new Error("ActType "+De);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+on);a=v,d({type:"@@redux/INIT"})}})[Du]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Du]=function(){return this},v},n}function tE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+De}function Gt(){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 rE(){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)}),j({},o,{dispatch:s=Gt.apply(void 0,i)(o.dispatch)})}}}var Ze=lt+"anon_id",ct=lt+"user_id",jt=lt+"user_traits",He="userId",Ct="anonymousId",yn=["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"],ro=["name","EVENTS","config","loaded"],A=yn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Mu=/^utm_/,Fu=/^an_prop_/,Bu=/^an_trait_/;function nE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ze,o.anonymousId),f||t(ct,o.userId),u.traits&&t(jt,j({},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,v=l.reduce(function(p,S){if(S.match(Mu)||S.match(/^(d|g)clid/)){var g=S.replace(Mu,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Fu)&&(p.props[S.replace(Fu,"")]=i[S]),S.match(Bu)&&(p.traits[S.replace(Bu,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function aE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ze)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Ze,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function zu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Ze),traits:e.getItem(jt)}}var no=function(e){return lt+"TEMP"+lt+e};function iE(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===A.reset&&([ct,jt,Ze].forEach(function(v){n(v)}),[He,Ct,"traits"].forEach(function(v){Xt(no(v))})),s.type===A.identify){a(Ze)||r(Ze,na());var c=a(ct),d=a(jt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(jt,j({},d,f))}return o(s)}}}}var dr={};function Hu(e,t){dr[e]&&oe(dr[e])&&(dr[e](t),delete dr[e])}function Gd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Gd(e,t,r-10).then(n,a)})})}function oE(e){return{abort:e}}function Wd(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,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&oe(S)){var g,T=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[He,Ct].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[v].config,instance:r,abort:oE}))&&ie(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(j({},T,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var pi=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(Lt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,T){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var C=I.type.match(Lt)?function(M,F,V,L,x){return function(B,R){var G=L?L.name:M,J=R&&Er(R)?R:V;if(L&&(!(J=R&&Er(R)?R:[M]).includes(M)||J.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(J)+" input valid");return j({},x,{abort:{reason:B,plugins:J,caller:F,_:G}})}}(k,_,T,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:sE(I),instance:g,config:$||{},abort:C}}}(n,v),S=t.exact.reduce(function(g,T){var I=T.pluginName,b=T.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var b=T.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&oe(C.method)?(function(B,R){var G=Yu(B);if(G&&G.name===R){var J=Yu(G.method);throw new Error([R+" plugin is calling method "+B,"Plugins cant call self","Use "+G.method+" "+(J?"or "+J.method:"")+" in "+R+" plugin insteadof "+B].join(`
|
|
6
|
+
`))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(V=F,L=b,x=C.pluginName,function(B,R){return j({},V,{abort:{reason:B,plugins:R||[L],caller:c,from:x||L}})}),config:Wu(C.pluginName,f,i),plugins:f})).then(function(B){var R=ie(B)?B:{};return Promise.resolve(j({},F,R))})):F;var V,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(T).then(function(_){var C=g[$]?g[$]:{};if(d&&(C=_),gi(C,$))return mi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(gi(_,$))return h&&mi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:C,instance:n,config:Wu($,f,i),plugins:f})).then(function(F){var V=ie(F)?F:{},L=j({},_,V),x=g[$];if(gi(x,$))mi({data:x,method:c,instance:n,pluginName:$,store:s});else{var B=c+":"+$;(B.match(/:/g)||[]).length<2&&!c.match(Ku)&&!c.match(Gu)&&n.dispatch(j({},d?L:C,{type:B,_:{called:B,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Lt)||c.match(/^registerPlugin/)||c.match(Gu)||c.match(Ku)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});Vd(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Ku=/^bootstrap/,Gu=/^ready/;function mi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Wu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Vu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Zu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function gi(e,t){var r=e.abort;return!!r&&(r===!0||Ju(r,t)||r&&Ju(r.plugins,t))}function Vd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ve(r))return!0;var n=r.plugins;return Er(r)&&r.length===t||Er(n)&&n.length===t}function Er(e){return Array.isArray(e)}function Ju(e,t){return!(!e||!Er(e))&&e.includes(t)}function Yu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function sE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function cE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Hu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],T=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return Gd(h,function(){return $({config:_})},1e4).then(function(C){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!ro.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){v.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Wd(a,t,e)},0),Promise.resolve(function(h,$,k,_,C){try{var M=oe($)?$():$,F=h.type,V=F.replace(Lt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(G=M,(J=L.plugins)===void 0&&(J={}),(Le=h.options)===void 0&&(Le={}),Object.keys(G).filter(function(m){var y=Le.plugins||{};return zT(y[m])?y[m]:y.all!==!1&&(!J[m]||J[m].enabled!==!1)}).map(function(m){return G[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var B=x.map(function(m){return m.name}),R=function(m,y,O){var N=Zu(m).map(function(U){return Vu(U,y)});return y.reduce(function(U,D){var Z=D.name,w=Zu(m,Z).map(function(ae){return Vu(ae,y)}),E=w[0],P=w[1],z=w[2];return E.length&&(U.beforeNS[Z]=E),P.length&&(U.duringNS[Z]=P),z.length&&(U.afterNS[Z]=z),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(pi({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(m){function y(){var U=function(){if(F.match(Lt))return Promise.resolve(pi({action:j({},O,{type:V+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Hu(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(Vd(m,B.length))return m;var O,N=function(){if(F!==V)return Promise.resolve(pi({action:j({},m,{type:V}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var G,J,Le}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function uE(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===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var lE=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 Gt.apply(void 0,o)(n)(a)}}}}};function fE(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=Xu(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},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Xu(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,qu(r.plugins,!1,t));case A.enablePlugin:return j({},t,qu(r.plugins,!0,t));default:return t}}}function Xu(e,t){return e.substring(t.length+1,e.length)}function qu(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Zd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var dE={last:{},history:[]};function vE(e,t){e===void 0&&(e=dE);var r=t.options,n=t.meta;if(t.type===A.track){var a=Zd(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var hE={actions:[]};function pE(e,t){e===void 0&&(e=hE);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Jd=/#.*$/;function mE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Jd,""):"")}var Yd,Xd,qd,Qd,gE=function(e){if(e===void 0&&(e={}),!X)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 v=function(){if(X){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(Jd,"")}(f),c={title:r,url:l,path:mE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},yE={last:{},history:[]};function wE(e,t){e===void 0&&(e=yE);var r=t.options;if(t.type===A.page){var n=Zd(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}Yd=function(){if(!X)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"}(),Xd=X?document.referrer:null,qd=JT(),Qd=YT();var Qu={initialized:!1,sessionId:na(),app:null,version:null,debug:!1,offline:!!X&&!navigator.onLine,os:{name:Yd},userAgent:X?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Qd,locale:qd,campaign:{},referrer:Xd};function bE(e,t){e===void 0&&(e=Qu);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},Qu,e,{initialized:!0})}}var SE=["plugins","reducers","storage"];function $E(e,t,r){if(X){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function IE(e){var t=$E.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function ev(){return dt("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 Kt[Ht].analytics.push(o.action||o),i(o)}})}}}function el(e){return function(){return Gt(Gt.apply(null,arguments),ev())}}function yi(e){return e?zd(e)?e:[e]:[]}function tl(e,t,r){e===void 0&&(e={});var n,a,i=na();return t&&(dr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function TE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var E=Array.prototype.slice.call(arguments),P=new Array(w.length),z=0;z<E.length;z++)P[z]=E[z];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:Xt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:zu(m)[y]||ft(no(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!ro.includes(m)}).sort(),u=new Set(s.concat(yn).filter(function(m){return!ro.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new lE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=XT(),T=zu(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=na());var b=j({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:yi(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:yi(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ve(m)?m:null,D=ie(m)?m:y,Z=O||{},w=$.user();dt(no(He),U);var E=U||D.userId||i(He,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(j({type:A.identifyStart,userId:E,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ve(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},Z=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:Z,userId:i(He,$,y),anonymousId:i(Ct,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:gE(N),options:U,userId:i(He,$,N),anonymousId:i(Ct,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===He||m==="id")return i(He,$);if(m===Ct||m==="anonId")return i(Ct,$);var y=$.getState("user");return m?Nu(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(E){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),E(P)}}},U=function(w){return function(E){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),E(P)}}};return d(N,sn),d(U,cn),function(){v(N,sn),v(U,cn)}}var D=m.match(O)?sn:cn,Z=function(w){return function(E){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),E(P)}}};return d(Z,D),function(){return v(Z,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?Nu(y,m):Object.assign({},y)},dispatch:function(m){var y=Ve(m)?{type:m}:m;if(yn.includes(y.type))throw new Error("reserved action "+y.type);var O=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ze,m,y)},events:{core:yn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=tl()),y(O)}}},p(sn),cE($,l,{all:f,plugins:s}),uE(a),nE($),iE($),p(cn)]),_={context:bE,user:aE(a),page:wE,track:vE,plugins:fE(l),queue:pE},C=Gt,M=Gt;if(X&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?ev():ie(typeof arguments[0])?el():el().apply(null,arguments)}}var V,L=function(m){return Object.keys(m).reduce(function(y,O){return SE.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),B={context:L,user:I,plugins:x},R=Kd(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Ge&&(O[U]=m[U])}var D,Z=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(E){var P=w[E];if(typeof P(void 0,{type:"@@redux/INIT"})===De||typeof P(void 0,{type:eE})===De)throw new Error("reducer "+E+" "+De)})})(O)}catch(w){D=w}return function(w,E){if(w===void 0&&(w={}),D)throw D;for(var P=!1,z={},ae=0;ae<Z.length;ae++){var Be=Z[ae],is=w[Be],oa=(0,O[Be])(is,E);if(typeof oa===De){var hv=tE(Be,E);throw new Error(hv)}z[Be]=oa,P=P||oa!==is}return P?z:w}}(j({},_,t)),B,M(C(rE.apply(void 0,k))));R.dispatch=(V=R.dispatch,function(m,y,O){var N=j({},m,{meta:tl(m.meta,y,yi(O))});return V.apply(null,[N])});var G=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:G,config:L,params:g,user:I,initialUser:r,persistedUser:T});var J=G.filter(function(m){return n.pluginEnabled[m]}),Le=G.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:G,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&oe(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:J,disabled:Le})}),IE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return Wd(m,y,O)},3e3)}(R,l,$),$}var sn="before",cn="after",br="cookie",nt=nv(),tv=aa,EE=aa;function rv(e){return nt?aa(e,"",-1):Xt(e)}function nv(){if(nt!==void 0)return nt;var e="cookiecookie";try{aa(e,e),nt=document.cookie.indexOf(e)!==-1,rv(e)}catch{nt=!1}return nt}function aa(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return nt===!1&&(o?dt(e,t):ft(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 Sr="localStorage",PE=qo.bind(null,"localStorage");qt("localStorage","getItem",ft);qt("localStorage","setItem",dt);qt("localStorage","removeItem",Xt);var $r="sessionStorage",OE=qo.bind(null,"sessionStorage");qt("sessionStorage","getItem",ft);qt("sessionStorage","setItem",dt);qt("sessionStorage","removeItem",Xt);function Nt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var kE=PE(),_E=OE(),RE=nv();function av(e,t){if(e){var r=Qo(t),n=!ns(r),a=es(r)?Nt(localStorage.getItem(e)):void 0;if(n&&!Rt(a))return a;var i=ts(r)?Nt(tv(e)):void 0;if(n&&i)return i;var o=rs(r)?Nt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function CE(e,t,r){if(e&&!Rt(t)){var n={},a=Qo(r),i=JSON.stringify(t),o=!ns(a);return es(a)&&(n[Sr]=un(Sr,t,Nt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Sr]:ts(a)&&(n[br]=un(br,t,Nt(tv(e))),EE(e,i),o)?n[br]:rs(a)&&(n[$r]=un($r,t,Nt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[$r]:(n[wr]=un(wr,t,ft(e)),dt(e,t),o?n[wr]:n)}}function AE(e,t){if(e){var r=Qo(t),n=av(e,Md),a={};return!Rt(n.localStorage)&&es(r)&&(localStorage.removeItem(e),a[Sr]=n.localStorage),!Rt(n.cookie)&&ts(r)&&(rv(e),a[br]=n.cookie),!Rt(n.sessionStorage)&&rs(r)&&(sessionStorage.removeItem(e),a[$r]=n.sessionStorage),!Rt(n.global)&&ia(r,wr)&&(Xt(e),a[wr]=n.global),a}}function Qo(e){return e?Ve(e)?e:e.storage:Dd}function es(e){return kE&&ia(e,Sr)}function ts(e){return RE&&ia(e,br)}function rs(e){return _E&&ia(e,$r)}function ns(e){return e===Md||e==="all"}function ia(e,t){return e===Dd||e===t||ns(e)}function un(e,t,r){return{location:e,current:t,previous:r}}var jE={setItem:CE,getItem:av,removeItem:AE};function LE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rl(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 nl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rl(Object(r),!0).forEach(function(n){LE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:jE};return TE(nl(nl({},t),e))}function UE(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 xE(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=ME(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function DE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function ME(e){return["#","?"].forEach(t=>e=DE(e,t)),e}function FE(){xE(()=>{xe.page()})}function BE(e){if(e===void 0&&(e={}),!X)return to;var t=il(),r=ao(),n=al(),a=ln(n,t),i=ln(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return to;var v=d.map(function(S){return Number(S)}),p=QT(function(){var S=il(),g=function(L,x){return x.map(function(B){return B===100?L-5:L*(B/100)})}(S,v),T=ao(),I=al(),b=ln(I,S),h=ln(T,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,C=v;(k==="up"||$)&&(_=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,x,B){var R=_[B];return u.includes(x)&&I<=R&&(u=u.filter(function(G){return G!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(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:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,V=M.direction;oe(e[F])&&e[F]({trigger:F,direction:V,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function ao(){return X?document.body.scrollTop||document.documentElement.scrollTop:0}function zE(){return X?window.innerHeight||document.documentElement.clientHeight:0}function al(){return Math.round(ao()+zE())}function il(){if(!X)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function ln(e,t){return Math.round(e/t*100)}var ol="EventListener";function HE(e){return function(t,r,n,a){var i=n||to,o=a||!1;if(!X)return i;var s=Ln(r),u=Ln(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"+ol:"remove"+ol,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?KE(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function Ln(e,t){if(Ve(e))return t?Ln(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=ZT(e);return t?i.map(function(o){return Ve(o)?Ln(o,!0):o}).flat():i}function KE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var wi=HE("Event");function iv(e,t){return X&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}iv.bind(null,"onerror");iv.bind(null,"onload");var ov=typeof window>"u",sl="hidden";function GE(e){if(ov)return!1;var t=WE(),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 WE(){var e=["webkit","moz","ms","o"];return ov||sl in document?sl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var VE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function ZE(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=GE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(VE.map(function(s){return wi(document,s,r)})).concat(wi(window,"load",r)).concat(wi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function JE(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,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(cr(d),g),a&&l&&(l=!1,a(cr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(cr(d),g))},s)}var S=ZE(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:cr(d,c),idle:l?cr(r,c):0}}}}function cr(e,t){return t?0:Math.round((new Date-e)/1e3)}const cl=5e3;class YE{constructor(t){le(this,"element");le(this,"isInViewport",!1);le(this,"isAwake",!1);le(this,"isFlushing");le(this,"observer");le(this,"lastEventAt",Date.now());le(this,"registeredView",!1);le(this,"viewCallback");le(this,"activeDurationCallback");le(this,"idleDurationCallback");le(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),JE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:cl}),BE({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*cl: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 ul="sesamy_session_id";function XE(){let e=sessionStorage.getItem(ul);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ul,e)),e}let sv=!1,io,ll,Nn;const cv=new Map;function qE({clientId:e,enabled:t=!0,environment:r}){if(io=e,ll=t,Nn=`${Ke("logs",r)}/events`,!ll)return;window.addEventListener("beforeunload",()=>{lv.forEach((a,i)=>{a.bind(i)()}),eP()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&cv.forEach((a,i)=>{a.bind(i)()})}),FE();const n=new YE({element:document.body,viewCallback:()=>{xe.page()},activeDurationCallback:(a,i,o)=>{xe.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{xe.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{xe.track("scroll",{scroll:a.scrollMax})}});tP(document.body,()=>{n.flush()}),rP(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Te.AUTHENTICATED,async a=>{const i=a;await xe.identify(i.detail.sub)}),window.addEventListener(Te.LOGOUT,async()=>{await xe.track("logout",{}),as.flush(),await xe.reset()})}function uv(e){return JSON.stringify(e.map(t=>({...t,clientId:io,requestId:Math.random().toString(36).slice(2,9),sessionId:XE(),timestamp:new Date().toISOString(),version:Xo,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:xd,userAgent:navigator.userAgent,clientId:io}})))}const as=UE(async e=>{if(e.length>0){const t=uv(e);sv?navigator.sendBeacon(Nn,t):(await fetch(Nn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function bi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Nn,uv([r]))}else as.push(e)}const xe=NE({app:xd,version:Xo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;bi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function QE(e,t){xe.track(e,t)}function eP(){return sv=!0,as.flush()}const lv=new Map;function tP(e,t){lv.set(e,t)}function rP(e,t){cv.set(e,t)}const fv="sesamySignedURLs";function dv(){const e=sessionStorage.getItem(fv);return e?JSON.parse(e):[]}function nP(e){const t=dv();t.push(e),sessionStorage.setItem(fv,JSON.stringify(t))}const aP=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function iP(){return new Promise(e=>{const t=aP.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",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 oP(){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 sP(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:T,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:C,pushTally:M,deleteTally:F,getProduct:V,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:B,linkSpotify:R,autoOnboardProduct:G,openHostedAccountPage:J,generateLink:Le}=DT(e),m={auth:{getUser:p,isAuthenticated:Jo,loginWithRedirect:Yo,logout:Cd,setToken:jd},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:J,isSpotifyLinked:x,unlinkSpotify:B},analytics:{track:QE},tags:{list:g,set:I,delete:T},entitlements:{get:a,list:i,access:o,signedLinks:dv},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:V,autoOnboard:G,linkSpotify:R},browser:{detectAdblock:iP,isInAppBrowser:oP},getVersion:cP,getPaymentIssues:L,generateLink:Le,clearCache:Se};return e.namespace&&(window[e.namespace]=m),m}function cP(){return Xo}async function uP({enabled:e=!1,rules:t}){if(!e)return;const r=await Jo(),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)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function fl(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}}function lP(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){jd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const dl="sesamy-refresh",vl="force-refetch-entitlements";function fP(){const e=new URLSearchParams(window.location.search),t=e.get(vl),r=e.get(dl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(vl),e.delete(dl),n.search=e.toString(),Se(),window.history.replaceState(null,"",n)}}function dP(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;nP({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const hl="sesamy-user";async function vP(){const t=new URLSearchParams(window.location.search).get(hl);if(!t)return;const r=await ET();(r==null?void 0:r.email)!==t&&(Se(),Yo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(hl),window.history.replaceState(null,"",n)}const pl="sesamy-purchase";function hP(){const e=new URLSearchParams(window.location.search),t=e.get(pl);if(t!==null){const r=new URL(window.location.href);e.delete(pl),r.search=e.toString(),Ye(Te.PURCHASE,{itemSrc:t}),Se(),window.history.replaceState(null,"",r)}}const ml="sesamy-login";async function pP(){if(!new URLSearchParams(window.location.search).get(ml))return;await Jo()||Yo();const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const mP=typeof window<"u";async function gl(e){qE({clientId:e.clientId,environment:e.environment,...e.analytics}),await TT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await uP(e.transform),lP(),fP(),dP(),await pP(),await vP(),hP(),Ye(Te.READY,{})}async function vv(e){const t=sP({clientId:e.clientId,environment:e.environment,...e.api});return mP&&(e.awaitAllServices?await gl(e):gl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);vv(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=vv;
|