@sesamy/sesamy-js 1.22.7 → 1.22.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/dist/sesamy-js.cjs +6 -6
- package/dist/sesamy-js.d.ts +1 -0
- package/dist/sesamy-js.iife.js +6 -6
- package/dist/sesamy-js.mjs +2323 -2301
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Ph=Object.defineProperty;var Eh=(e,t,r)=>t in e?Ph(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var he=(e,t,r)=>Eh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ee=function(e){try{return!!e()}catch{return!0}},Oh=ee,Bn=!Oh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Pl=Bn,El=Function.prototype,Pi=El.call,kh=Pl&&El.bind.bind(Pi,Pi),z=Pl?kh:function(e){return function(){return Pi.apply(e,arguments)}},Ol=z,_h=Ol({}.toString),Rh=Ol("".slice),Hn=function(e){return Rh(_h(e),8,-1)},Ch=z,Ah=ee,jh=Hn,la=Object,Lh=Ch("".split),kl=Ah(function(){return!la("z").propertyIsEnumerable(0)})?function(e){return jh(e)==="String"?Lh(e,""):la(e)}:la,zn=function(e){return e==null},Uh=zn,Nh=TypeError,Gn=function(e){if(Uh(e))throw new Nh("Can't call method on "+e);return e},xh=kl,Dh=Gn,Rr=function(e){return xh(Dh(e))},rr=function(e){return e&&e.Math===Math&&e},G=rr(typeof globalThis=="object"&&globalThis)||rr(typeof window=="object"&&window)||rr(typeof self=="object"&&self)||rr(typeof Fr=="object"&&Fr)||rr(typeof Fr=="object"&&Fr)||function(){return this}()||Function("return this")(),_l={exports:{}},Mh=!1,ls=G,Fh=Object.defineProperty,fo=function(e,t){try{Fh(ls,e,{value:t,configurable:!0,writable:!0})}catch{ls[e]=t}return t},Bh=G,Hh=fo,fs="__core-js_shared__",ds=_l.exports=Bh[fs]||Hh(fs,{});(ds.versions||(ds.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ho=_l.exports,hs=ho,Rl=function(e,t){return hs[e]||(hs[e]=t||{})},zh=Gn,Gh=Object,Kn=function(e){return Gh(zh(e))},Kh=z,Wh=Kn,Vh=Kh({}.hasOwnProperty),we=Object.hasOwn||function(t,r){return Vh(Wh(t),r)},Zh=z,Jh=0,Yh=Math.random(),Xh=Zh(1 .toString),Cl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Xh(++Jh+Yh,36)},qh=G,vs=qh.navigator,ps=vs&&vs.userAgent,Cr=ps?String(ps):"",Al=G,fa=Cr,ms=Al.process,gs=Al.Deno,ys=ms&&ms.versions||gs&&gs.version,ws=ys&&ys.v8,Ee,Tn;ws&&(Ee=ws.split("."),Tn=Ee[0]>0&&Ee[0]<4?1:+(Ee[0]+Ee[1]));!Tn&&fa&&(Ee=fa.match(/Edge\/(\d+)/),(!Ee||Ee[1]>=74)&&(Ee=fa.match(/Chrome\/(\d+)/),Ee&&(Tn=+Ee[1])));var jl=Tn,bs=jl,Qh=ee,ev=G,tv=ev.String,Ll=!!Object.getOwnPropertySymbols&&!Qh(function(){var e=Symbol("symbol detection");return!tv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&bs&&bs<41}),rv=Ll,Ul=rv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",nv=G,av=Rl,Ss=we,iv=Cl,ov=Ll,sv=Ul,Rt=nv.Symbol,da=av("wks"),cv=sv?Rt.for||Rt:Rt&&Rt.withoutSetter||iv,te=function(e){return Ss(da,e)||(da[e]=ov&&Ss(Rt,e)?Rt[e]:cv("Symbol."+e)),da[e]},ha=typeof document=="object"&&document.all,Z=typeof ha>"u"&&ha!==void 0?function(e){return typeof e=="function"||e===ha}:function(e){return typeof e=="function"},uv=Z,be=function(e){return typeof e=="object"?e!==null:uv(e)},lv=be,fv=String,dv=TypeError,_e=function(e){if(lv(e))return e;throw new dv(fv(e)+" is not an object")},Nl={},hv=ee,re=!hv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),vv=re,pv=ee,xl=vv&&pv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ue={},mv=G,$s=be,Ei=mv.document,gv=$s(Ei)&&$s(Ei.createElement),Wn=function(e){return gv?Ei.createElement(e):{}},yv=re,wv=ee,bv=Wn,Dl=!yv&&!wv(function(){return Object.defineProperty(bv("div"),"a",{get:function(){return 7}}).a!==7}),Sv=Bn,Br=Function.prototype.call,ne=Sv?Br.bind(Br):function(){return Br.apply(Br,arguments)},va=G,$v=Z,Iv=function(e){return $v(e)?e:void 0},Se=function(e,t){return arguments.length<2?Iv(va[e]):va[e]&&va[e][t]},Tv=z,Vn=Tv({}.isPrototypeOf),Pv=Se,Ev=Z,Ov=Vn,kv=Ul,_v=Object,Ml=kv?function(e){return typeof e=="symbol"}:function(e){var t=Pv("Symbol");return Ev(t)&&Ov(t.prototype,_v(e))},Rv=String,Zn=function(e){try{return Rv(e)}catch{return"Object"}},Cv=Z,Av=Zn,jv=TypeError,Re=function(e){if(Cv(e))return e;throw new jv(Av(e)+" is not a function")},Lv=Re,Uv=zn,vo=function(e,t){var r=e[t];return Uv(r)?void 0:Lv(r)},pa=ne,ma=Z,ga=be,Nv=TypeError,xv=function(e,t){var r,n;if(t==="string"&&ma(r=e.toString)&&!ga(n=pa(r,e))||ma(r=e.valueOf)&&!ga(n=pa(r,e))||t!=="string"&&ma(r=e.toString)&&!ga(n=pa(r,e)))return n;throw new Nv("Can't convert object to primitive value")},Dv=ne,Is=be,Ts=Ml,Mv=vo,Fv=xv,Bv=te,Hv=TypeError,zv=Bv("toPrimitive"),Gv=function(e,t){if(!Is(e)||Ts(e))return e;var r=Mv(e,zv),n;if(r){if(t===void 0&&(t="default"),n=Dv(r,e,t),!Is(n)||Ts(n))return n;throw new Hv("Can't convert object to primitive value")}return t===void 0&&(t="number"),Fv(e,t)},Kv=Gv,Wv=Ml,Fl=function(e){var t=Kv(e,"string");return Wv(t)?t:t+""},Vv=re,Zv=Dl,Jv=xl,Hr=_e,Ps=Fl,Yv=TypeError,ya=Object.defineProperty,Xv=Object.getOwnPropertyDescriptor,wa="enumerable",ba="configurable",Sa="writable";Ue.f=Vv?Jv?function(t,r,n){if(Hr(t),r=Ps(r),Hr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Sa in n&&!n[Sa]){var a=Xv(t,r);a&&a[Sa]&&(t[r]=n.value,n={configurable:ba in n?n[ba]:a[ba],enumerable:wa in n?n[wa]:a[wa],writable:!1})}return ya(t,r,n)}:ya:function(t,r,n){if(Hr(t),r=Ps(r),Hr(n),Zv)try{return ya(t,r,n)}catch{}if("get"in n||"set"in n)throw new Yv("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var qv=Math.ceil,Qv=Math.floor,ep=Math.trunc||function(t){var r=+t;return(r>0?Qv:qv)(r)},tp=ep,po=function(e){var t=+e;return t!==t||t===0?0:tp(t)},rp=po,np=Math.max,ap=Math.min,Bl=function(e,t){var r=rp(e);return r<0?np(r+t,0):ap(r,t)},ip=po,op=Math.min,sp=function(e){var t=ip(e);return t>0?op(t,9007199254740991):0},cp=sp,mo=function(e){return cp(e.length)},up=Rr,lp=Bl,fp=mo,Es=function(e){return function(t,r,n){var a=up(t),i=fp(a);if(i===0)return!e&&-1;var o=lp(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}},dp={includes:Es(!0),indexOf:Es(!1)},go={},hp=z,$a=we,vp=Rr,pp=dp.indexOf,mp=go,Os=hp([].push),Hl=function(e,t){var r=vp(e),n=0,a=[],i;for(i in r)!$a(mp,i)&&$a(r,i)&&Os(a,i);for(;t.length>n;)$a(r,i=t[n++])&&(~pp(a,i)||Os(a,i));return a},yo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],gp=Hl,yp=yo,zl=Object.keys||function(t){return gp(t,yp)},wp=re,bp=xl,Sp=Ue,$p=_e,Ip=Rr,Tp=zl;Nl.f=wp&&!bp?Object.defineProperties:function(t,r){$p(t);for(var n=Ip(r),a=Tp(r),i=a.length,o=0,s;i>o;)Sp.f(t,s=a[o++],n[s]);return t};var Pp=Se,Gl=Pp("document","documentElement"),Ep=Rl,Op=Cl,ks=Ep("keys"),wo=function(e){return ks[e]||(ks[e]=Op(e))},kp=_e,_p=Nl,_s=yo,Rp=go,Cp=Gl,Ap=Wn,jp=wo,Rs=">",Cs="<",Oi="prototype",ki="script",Kl=jp("IE_PROTO"),Ia=function(){},Wl=function(e){return Cs+ki+Rs+e+Cs+"/"+ki+Rs},As=function(e){e.write(Wl("")),e.close();var t=e.parentWindow.Object;return e=null,t},Lp=function(){var e=Ap("iframe"),t="java"+ki+":",r;return e.style.display="none",Cp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Wl("document.F=Object")),r.close(),r.F},zr,pn=function(){try{zr=new ActiveXObject("htmlfile")}catch{}pn=typeof document<"u"?document.domain&&zr?As(zr):Lp():As(zr);for(var e=_s.length;e--;)delete pn[Oi][_s[e]];return pn()};Rp[Kl]=!0;var Jn=Object.create||function(t,r){var n;return t!==null?(Ia[Oi]=kp(t),n=new Ia,Ia[Oi]=null,n[Kl]=t):n=pn(),r===void 0?n:_p.f(n,r)},Up=te,Np=Jn,xp=Ue.f,_i=Up("unscopables"),Ri=Array.prototype;Ri[_i]===void 0&&xp(Ri,_i,{configurable:!0,value:Np(null)});var Dp=function(e){Ri[_i][e]=!0},Ar={},Mp=G,Fp=Z,js=Mp.WeakMap,Bp=Fp(js)&&/native code/.test(String(js)),mt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Hp=re,zp=Ue,Gp=mt,gt=Hp?function(e,t,r){return zp.f(e,t,Gp(1,r))}:function(e,t,r){return e[t]=r,e},Kp=Bp,Vl=G,Wp=be,Vp=gt,Ta=we,Pa=ho,Zp=wo,Jp=go,Ls="Object already initialized",Ci=Vl.TypeError,Yp=Vl.WeakMap,Pn,Er,En,Xp=function(e){return En(e)?Er(e):Pn(e,{})},qp=function(e){return function(t){var r;if(!Wp(t)||(r=Er(t)).type!==e)throw new Ci("Incompatible receiver, "+e+" required");return r}};if(Kp||Pa.state){var Ce=Pa.state||(Pa.state=new Yp);Ce.get=Ce.get,Ce.has=Ce.has,Ce.set=Ce.set,Pn=function(e,t){if(Ce.has(e))throw new Ci(Ls);return t.facade=e,Ce.set(e,t),t},Er=function(e){return Ce.get(e)||{}},En=function(e){return Ce.has(e)}}else{var bt=Zp("state");Jp[bt]=!0,Pn=function(e,t){if(Ta(e,bt))throw new Ci(Ls);return t.facade=e,Vp(e,bt,t),t},Er=function(e){return Ta(e,bt)?e[bt]:{}},En=function(e){return Ta(e,bt)}}var Jt={set:Pn,get:Er,has:En,enforce:Xp,getterFor:qp},bo={},So={},Zl={}.propertyIsEnumerable,Jl=Object.getOwnPropertyDescriptor,Qp=Jl&&!Zl.call({1:2},1);So.f=Qp?function(t){var r=Jl(this,t);return!!r&&r.enumerable}:Zl;var em=re,tm=ne,rm=So,nm=mt,am=Rr,im=Fl,om=we,sm=Dl,Us=Object.getOwnPropertyDescriptor;bo.f=em?Us:function(t,r){if(t=am(t),r=im(r),sm)try{return Us(t,r)}catch{}if(om(t,r))return nm(!tm(rm.f,t,r),t[r])};var Yl={exports:{}},Ai=re,cm=we,Xl=Function.prototype,um=Ai&&Object.getOwnPropertyDescriptor,$o=cm(Xl,"name"),lm=$o&&(function(){}).name==="something",fm=$o&&(!Ai||Ai&&um(Xl,"name").configurable),ql={EXISTS:$o,PROPER:lm,CONFIGURABLE:fm},dm=z,hm=Z,ji=ho,vm=dm(Function.toString);hm(ji.inspectSource)||(ji.inspectSource=function(e){return vm(e)});var Io=ji.inspectSource,To=z,pm=ee,mm=Z,Gr=we,Li=re,gm=ql.CONFIGURABLE,ym=Io,Ql=Jt,wm=Ql.enforce,bm=Ql.get,Ns=String,mn=Object.defineProperty,Sm=To("".slice),$m=To("".replace),Im=To([].join),Tm=Li&&!pm(function(){return mn(function(){},"length",{value:8}).length!==8}),Pm=String(String).split("String"),Em=Yl.exports=function(e,t,r){Sm(Ns(t),0,7)==="Symbol("&&(t="["+$m(Ns(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Gr(e,"name")||gm&&e.name!==t)&&(Li?mn(e,"name",{value:t,configurable:!0}):e.name=t),Tm&&r&&Gr(r,"arity")&&e.length!==r.arity&&mn(e,"length",{value:r.arity});try{r&&Gr(r,"constructor")&&r.constructor?Li&&mn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=wm(e);return Gr(n,"source")||(n.source=Im(Pm,typeof t=="string"?t:"")),e};Function.prototype.toString=Em(function(){return mm(this)&&bm(this).source||ym(this)},"toString");var ef=Yl.exports,Om=Z,km=Ue,_m=ef,Rm=fo,$e=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Om(r)&&_m(r,i,n),n.global)a?e[t]=r:Rm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:km.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},tf={},Cm=Hl,Am=yo,jm=Am.concat("length","prototype");tf.f=Object.getOwnPropertyNames||function(t){return Cm(t,jm)};var Po={};Po.f=Object.getOwnPropertySymbols;var Lm=Se,Um=z,Nm=tf,xm=Po,Dm=_e,Mm=Um([].concat),Fm=Lm("Reflect","ownKeys")||function(t){var r=Nm.f(Dm(t)),n=xm.f;return n?Mm(r,n(t)):r},xs=we,Bm=Fm,Hm=bo,zm=Ue,rf=function(e,t,r){for(var n=Bm(t),a=zm.f,i=Hm.f,o=0;o<n.length;o++){var s=n[o];!xs(e,s)&&!(r&&xs(r,s))&&a(e,s,i(t,s))}},Gm=ee,Km=Z,Wm=/#|\.prototype\./,jr=function(e,t){var r=Zm[Vm(e)];return r===Ym?!0:r===Jm?!1:Km(t)?Gm(t):!!t},Vm=jr.normalize=function(e){return String(e).replace(Wm,".").toLowerCase()},Zm=jr.data={},Jm=jr.NATIVE="N",Ym=jr.POLYFILL="P",nf=jr,Kr=G,Xm=bo.f,qm=gt,Qm=$e,eg=fo,tg=rf,rg=nf,X=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Kr:a?o=Kr[r]||eg(r,{}):o=Kr[r]&&Kr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Xm(o,s),u=l&&l.value):u=o[s],i=rg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;tg(f,u)}(e.sham||u&&u.sham)&&qm(f,"sham",!0),Qm(o,s,f,e)}},ng=ee,ag=!ng(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ig=we,og=Z,sg=Kn,cg=wo,ug=ag,Ds=cg("IE_PROTO"),Ui=Object,lg=Ui.prototype,Eo=ug?Ui.getPrototypeOf:function(e){var t=sg(e);if(ig(t,Ds))return t[Ds];var r=t.constructor;return og(r)&&t instanceof r?r.prototype:t instanceof Ui?lg:null},fg=ee,dg=Z,hg=be,Ms=Eo,vg=$e,pg=te,Ni=pg("iterator"),af=!1,dt,Ea,Oa;[].keys&&(Oa=[].keys(),"next"in Oa?(Ea=Ms(Ms(Oa)),Ea!==Object.prototype&&(dt=Ea)):af=!0);var mg=!hg(dt)||fg(function(){var e={};return dt[Ni].call(e)!==e});mg&&(dt={});dg(dt[Ni])||vg(dt,Ni,function(){return this});var of={IteratorPrototype:dt,BUGGY_SAFARI_ITERATORS:af},gg=Ue.f,yg=we,wg=te,Fs=wg("toStringTag"),Yt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!yg(e,Fs)&&gg(e,Fs,{configurable:!0,value:t})},bg=of.IteratorPrototype,Sg=Jn,$g=mt,Ig=Yt,Tg=Ar,Pg=function(){return this},sf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Sg(bg,{next:$g(+!n,r)}),Ig(e,a,!1),Tg[a]=Pg,e},Eg=z,Og=Re,kg=function(e,t,r){try{return Eg(Og(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},_g=be,Rg=function(e){return _g(e)||e===null},Cg=Rg,Ag=String,jg=TypeError,Lg=function(e){if(Cg(e))return e;throw new jg("Can't set "+Ag(e)+" as a prototype")},Ug=kg,Ng=be,xg=Gn,Dg=Lg,Oo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Ug(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return xg(a),Dg(i),Ng(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Mg=X,Fg=ne,cf=ql,Bg=Z,Hg=sf,Bs=Eo,Hs=Oo,zg=Yt,Gg=gt,ka=$e,Kg=te,Wg=Ar,uf=of,Vg=cf.PROPER,Zg=cf.CONFIGURABLE,zs=uf.IteratorPrototype,Wr=uf.BUGGY_SAFARI_ITERATORS,nr=Kg("iterator"),Gs="keys",ar="values",Ks="entries",Jg=function(){return this},lf=function(e,t,r,n,a,i,o){Hg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Wr&&T&&T in l)return l[T];switch(T){case Gs:return function(){return new r(this,T)};case ar:return function(){return new r(this,T)};case Ks:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[nr]||l["@@iterator"]||a&&l[a],d=!Wr&&c||s(a),h=t==="Array"&&l.entries||c,v,S,g;if(h&&(v=Bs(h.call(new e)),v!==Object.prototype&&v.next&&(Bs(v)!==zs&&(Hs?Hs(v,zs):Bg(v[nr])||ka(v,nr,Jg)),zg(v,u,!0))),Vg&&a===ar&&c&&c.name!==ar&&(Zg?Gg(l,"name",ar):(f=!0,d=function(){return Fg(c,this)})),a)if(S={values:s(ar),keys:i?d:s(Gs),entries:s(Ks)},o)for(g in S)(Wr||f||!(g in l))&&ka(l,g,S[g]);else Mg({target:t,proto:!0,forced:Wr||f},S);return l[nr]!==d&&ka(l,nr,d,{name:a}),Wg[t]=d,S},ko=function(e,t){return{value:e,done:t}},Yg=Rr,_o=Dp,Ws=Ar,ff=Jt,Xg=Ue.f,qg=lf,Vr=ko,Qg=re,df="Array Iterator",ey=ff.set,ty=ff.getterFor(df),ry=qg(Array,"Array",function(e,t){ey(this,{type:df,target:Yg(e),index:0,kind:t})},function(){var e=ty(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Vr(void 0,!0);switch(e.kind){case"keys":return Vr(r,!1);case"values":return Vr(t[r],!1)}return Vr([r,t[r]],!1)},"values"),Vs=Ws.Arguments=Ws.Array;_o("keys");_o("values");_o("entries");if(Qg&&Vs.name!=="values")try{Xg(Vs,"name",{value:"values"})}catch{}var ny=X,ay=z,iy=Bl,oy=RangeError,Zs=String.fromCharCode,Js=String.fromCodePoint,sy=ay([].join),cy=!!Js&&Js.length!==1;ny({target:"String",stat:!0,arity:1,forced:cy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],iy(i,1114111)!==i)throw new oy(i+" is not a valid code point");r[a]=i<65536?Zs(i):Zs(((i-=65536)>>10)+55296,i%1024+56320)}return sy(r,"")}});var Ys=G,uy=re,ly=Object.getOwnPropertyDescriptor,hf=function(e){if(!uy)return Ys[e];var t=ly(Ys,e);return t&&t.value},fy=ee,dy=te,hy=re,Xs=Mh,vy=dy("iterator"),Yn=!fy(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),Xs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Xs||!hy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[vy]||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"}),qs=ef,py=Ue,Xn=function(e,t,r){return r.get&&qs(r.get,t,{getter:!0}),r.set&&qs(r.set,t,{setter:!0}),py.f(e,t,r)},my=$e,gy=function(e,t,r){for(var n in t)my(e,n,t[n],r);return e},yy=Vn,wy=TypeError,Ro=function(e,t){if(yy(t,e))return e;throw new wy("Incorrect invocation")},by=Hn,Sy=z,$y=function(e){if(by(e)==="Function")return Sy(e)},Qs=$y,Iy=Re,Ty=Bn,Py=Qs(Qs.bind),Xt=function(e,t){return Iy(e),t===void 0?e:Ty?Py(e,t):function(){return e.apply(t,arguments)}},Ey=te,Oy=Ey("toStringTag"),vf={};vf[Oy]="z";var Co=String(vf)==="[object z]",ky=Co,_y=Z,gn=Hn,Ry=te,Cy=Ry("toStringTag"),Ay=Object,jy=gn(function(){return arguments}())==="Arguments",Ly=function(e,t){try{return e[t]}catch{}},Lr=ky?gn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Ly(t=Ay(e),Cy))=="string"?r:jy?gn(t):(n=gn(t))==="Object"&&_y(t.callee)?"Arguments":n},Uy=Lr,Ny=String,Ke=function(e){if(Uy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Ny(e)},xy=Lr,ec=vo,Dy=zn,My=Ar,Fy=te,By=Fy("iterator"),qn=function(e){if(!Dy(e))return ec(e,By)||ec(e,"@@iterator")||My[xy(e)]},Hy=ne,zy=Re,Gy=_e,Ky=Zn,Wy=qn,Vy=TypeError,Ao=function(e,t){var r=arguments.length<2?Wy(e):t;if(zy(r))return Gy(Hy(r,e));throw new Vy(Ky(e)+" is not iterable")},Zy=TypeError,yt=function(e,t){if(e<t)throw new Zy("Not enough arguments");return e},Jy=z,Qn=Jy([].slice),tc=Qn,Yy=Math.floor,xi=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=Yy(r/2),s=xi(tc(e,0,o),t),u=xi(tc(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},Xy=xi,Di=X,pf=G,jo=hf,qy=Se,Zr=ne,ke=z,mr=re,mf=Yn,gf=$e,Qy=Xn,ew=gy,tw=Yt,rw=sf,Lo=Jt,yf=Ro,_a=Z,nw=we,aw=Xt,iw=Lr,ow=_e,wf=be,ie=Ke,sw=Jn,rc=mt,nc=Ao,cw=qn,Jr=ko,St=yt,uw=te,lw=Xy,fw=uw("iterator"),qt="URLSearchParams",bf=qt+"Iterator",Sf=Lo.set,ge=Lo.getterFor(qt),dw=Lo.getterFor(bf),ac=jo("fetch"),On=jo("Request"),gr=jo("Headers"),Ra=On&&On.prototype,ic=gr&&gr.prototype,hw=pf.TypeError,vw=pf.encodeURIComponent,pw=String.fromCharCode,mw=qy("String","fromCodePoint"),gw=parseInt,yn=ke("".charAt),oc=ke([].join),Je=ke([].push),$f=ke("".replace),yw=ke([].shift),sc=ke([].splice),cc=ke("".split),If=ke("".slice),ww=ke(/./.exec),bw=/\+/g,Ca="�",Sw=/^[0-9a-f]+$/i,uc=function(e,t){var r=If(e,t,t+2);return ww(Sw,r)?gw(r,16):NaN},$w=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Iw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},lc=function(e){e=$f(e,bw," ");for(var t=e.length,r="",n=0;n<t;){var a=yn(e,n);if(a==="%"){if(yn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=uc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=$w(i);if(o===0)a=pw(i);else{if(o===1||o>4){r+=Ca,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||yn(e,n)!=="%"));){var f=uc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Je(s,f),n+=2,u++}if(s.length!==o){r+=Ca;continue}var l=Iw(s);l===null?r+=Ca:a=mw(l)}}r+=a,n++}return r},Tw=/[!'()~]|%20/g,Pw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Ew=function(e){return Pw[e]},fc=function(e){return $f(vw(e),Tw,Ew)},Aa=rw(function(t,r){Sf(this,{type:bf,target:ge(t).entries,index:0,kind:r})},qt,function(){var t=dw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Jr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Jr(a.key,!1);case"values":return Jr(a.value,!1)}return Jr([a.key,a.value],!1)},!0),Tf=function(e){this.entries=[],this.url=null,e!==void 0&&(wf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?yn(e,0)==="?"?If(e,1):e:ie(e)))};Tf.prototype={type:qt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=cw(e),n,a,i,o,s,u,f;if(r)for(n=nc(e,r),a=n.next;!(i=Zr(a,n)).done;){if(o=nc(ow(i.value)),s=o.next,(u=Zr(s,o)).done||(f=Zr(s,o)).done||!Zr(s,o).done)throw new hw("Expected sequence with length 2");Je(t,{key:ie(u.value),value:ie(f.value)})}else for(var l in e)nw(e,l)&&Je(t,{key:l,value:ie(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=cc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=cc(a,"="),Je(t,{key:lc(yw(i)),value:lc(oc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Je(t,fc(n.key)+"="+fc(n.value));return oc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ea=function(){yf(this,Mt);var t=arguments.length>0?arguments[0]:void 0,r=Sf(this,new Tf(t));mr||(this.size=r.entries.length)},Mt=ea.prototype;ew(Mt,{append:function(t,r){var n=ge(this);St(arguments.length,2),Je(n.entries,{key:ie(t),value:ie(r)}),mr||this.length++,n.updateURL()},delete:function(e){for(var t=ge(this),r=St(arguments.length,1),n=t.entries,a=ie(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(sc(n,s,1),o!==void 0)break}else s++}mr||(this.size=n.length),t.updateURL()},get:function(t){var r=ge(this).entries;St(arguments.length,1);for(var n=ie(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=ge(this).entries;St(arguments.length,1);for(var n=ie(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Je(a,r[i].value);return a},has:function(t){for(var r=ge(this).entries,n=St(arguments.length,1),a=ie(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ie(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=ge(this);St(arguments.length,1);for(var a=n.entries,i=!1,o=ie(t),s=ie(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?sc(a,u--,1):(i=!0,f.value=s));i||Je(a,{key:o,value:s}),mr||(this.size=a.length),n.updateURL()},sort:function(){var t=ge(this);lw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=ge(this).entries,n=aw(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 Aa(this,"keys")},values:function(){return new Aa(this,"values")},entries:function(){return new Aa(this,"entries")}},{enumerable:!0});gf(Mt,fw,Mt.entries,{name:"entries"});gf(Mt,"toString",function(){return ge(this).serialize()},{enumerable:!0});mr&&Qy(Mt,"size",{get:function(){return ge(this).entries.length},configurable:!0,enumerable:!0});tw(ea,qt);Di({global:!0,constructor:!0,forced:!mf},{URLSearchParams:ea});if(!mf&&_a(gr)){var Ow=ke(ic.has),kw=ke(ic.set),dc=function(e){if(wf(e)){var t=e.body,r;if(iw(t)===qt)return r=e.headers?new gr(e.headers):new gr,Ow(r,"content-type")||kw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),sw(e,{body:rc(0,ie(t)),headers:rc(0,r)})}return e};if(_a(ac)&&Di({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return ac(t,arguments.length>1?dc(arguments[1]):{})}}),_a(On)){var ja=function(t){return yf(this,Ra),new On(t,arguments.length>1?dc(arguments[1]):{})};Ra.constructor=ja,ja.prototype=Ra,Di({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ja})}}var _w={URLSearchParams:ea,getState:ge},Rw=$e,ta=z,hc=Ke,Cw=yt,Pf=URLSearchParams,ra=Pf.prototype,Aw=ta(ra.append),vc=ta(ra.delete),jw=ta(ra.forEach),Lw=ta([].push),Uo=new Pf("a=1&a=2&b=3");Uo.delete("a",1);Uo.delete("b",void 0);Uo+""!="a=2"&&Rw(ra,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return vc(this,e);var n=[];jw(this,function(c,d){Lw(n,{key:d,value:c})}),Cw(t,1);for(var a=hc(e),i=hc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,vc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Aw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Uw=$e,Ef=z,Nw=Ke,xw=yt,Of=URLSearchParams,No=Of.prototype,Dw=Ef(No.getAll),Mw=Ef(No.has),pc=new Of("a=1");(pc.has("a",2)||!pc.has("a",void 0))&&Uw(No,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Mw(this,t);var a=Dw(this,t);xw(r,1);for(var i=Nw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Fw=re,Bw=z,Hw=Xn,Mi=URLSearchParams.prototype,zw=Bw(Mi.forEach);Fw&&!("size"in Mi)&&Hw(Mi,"size",{get:function(){var t=0;return zw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Gw=G,xo=Gw,Kw=xo;Kw.URLSearchParams;var Do=z,Ww=po,Vw=Ke,Zw=Gn,Jw=Do("".charAt),mc=Do("".charCodeAt),Yw=Do("".slice),gc=function(e){return function(t,r){var n=Vw(Zw(t)),a=Ww(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=mc(n,a),o<55296||o>56319||a+1===i||(s=mc(n,a+1))<56320||s>57343?e?Jw(n,a):o:e?Yw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},kf={codeAt:gc(!1),charAt:gc(!0)},Xw=kf.charAt,qw=Ke,_f=Jt,Qw=lf,yc=ko,Rf="String Iterator",eb=_f.set,tb=_f.getterFor(Rf);Qw(String,"String",function(e){eb(this,{type:Rf,string:qw(e),index:0})},function(){var t=tb(this),r=t.string,n=t.index,a;return n>=r.length?yc(void 0,!0):(a=Xw(r,n),t.index+=a.length,yc(a,!1))});var wc=re,rb=z,nb=ne,ab=ee,La=zl,ib=Po,ob=So,sb=Kn,cb=kl,$t=Object.assign,bc=Object.defineProperty,ub=rb([].concat),lb=!$t||ab(function(){if(wc&&$t({b:1},$t(bc({},"a",{enumerable:!0,get:function(){bc(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}),$t({},e)[r]!==7||La($t({},t)).join("")!==n})?function(t,r){for(var n=sb(t),a=arguments.length,i=1,o=ib.f,s=ob.f;a>i;)for(var u=cb(arguments[i++]),f=o?ub(La(u),o(u)):La(u),l=f.length,c=0,d;l>c;)d=f[c++],(!wc||nb(s,u,d))&&(n[d]=u[d]);return n}:$t,fb=ne,Sc=_e,db=vo,Cf=function(e,t,r){var n,a;Sc(e);try{if(n=db(e,"return"),!n){if(t==="throw")throw r;return r}n=fb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Sc(n),r},hb=_e,vb=Cf,pb=function(e,t,r,n){try{return n?t(hb(r)[0],r[1]):t(r)}catch(a){vb(e,"throw",a)}},mb=te,gb=Ar,yb=mb("iterator"),wb=Array.prototype,Af=function(e){return e!==void 0&&(gb.Array===e||wb[yb]===e)},bb=z,Sb=ee,jf=Z,$b=Lr,Ib=Se,Tb=Io,Lf=function(){},Uf=Ib("Reflect","construct"),Mo=/^\s*(?:class|function)\b/,Pb=bb(Mo.exec),Eb=!Mo.test(Lf),ir=function(t){if(!jf(t))return!1;try{return Uf(Lf,[],t),!0}catch{return!1}},Nf=function(t){if(!jf(t))return!1;switch($b(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Eb||!!Pb(Mo,Tb(t))}catch{return!0}};Nf.sham=!0;var xf=!Uf||Sb(function(){var e;return ir(ir.call)||!ir(Object)||!ir(function(){e=!0})||e})?Nf:ir,Ob=re,kb=Ue,_b=mt,Rb=function(e,t,r){Ob?kb.f(e,t,_b(0,r)):e[t]=r},Cb=Xt,Ab=ne,jb=Kn,Lb=pb,Ub=Af,Nb=xf,xb=mo,$c=Rb,Db=Ao,Mb=qn,Ic=Array,Fb=function(t){var r=jb(t),n=Nb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Cb(i,a>2?arguments[2]:void 0));var s=Mb(r),u=0,f,l,c,d,h,v;if(s&&!(this===Ic&&Ub(s)))for(l=n?new this:[],d=Db(r,s),h=d.next;!(c=Ab(h,d)).done;u++)v=o?Lb(d,i,[c.value,u],!0):c.value,$c(l,u,v);else for(f=xb(r),l=n?new this(f):Ic(f);f>u;u++)v=o?i(r[u],u):r[u],$c(l,u,v);return l.length=u,l},wt=z,Ua=2147483647,yr=36,Df=1,Fi=26,Bb=38,Hb=700,zb=72,Gb=128,Kb="-",Wb=/[^\0-\u007E]/,Mf=/[.\u3002\uFF0E\uFF61]/g,Tc="Overflow: input needs wider integers to process",Na=yr-Df,Pc=RangeError,Vb=wt(Mf.exec),Ct=Math.floor,xa=String.fromCharCode,Ec=wt("".charCodeAt),Ff=wt([].join),Ye=wt([].push),Zb=wt("".replace),Jb=wt("".split),Yb=wt("".toLowerCase),Xb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Ec(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Ec(e,r++);(i&64512)===56320?Ye(t,((a&1023)<<10)+(i&1023)+65536):(Ye(t,a),r--)}else Ye(t,a)}return t},Oc=function(e){return e+22+75*(e<26)},qb=function(e,t,r){var n=0;for(e=r?Ct(e/Hb):e>>1,e+=Ct(e/t);e>Na*Fi>>1;)e=Ct(e/Na),n+=yr;return Ct(n+(Na+1)*e/(e+Bb))},Qb=function(e){var t=[];e=Xb(e);var r=e.length,n=Gb,a=0,i=zb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Ye(t,xa(s));var u=t.length,f=u;for(u&&Ye(t,Kb);f<r;){var l=Ua;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Ct((Ua-a)/c))throw new Pc(Tc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Ua)throw new Pc(Tc);if(s===n){for(var d=a,h=yr;;){var v=h<=i?Df:h>=i+Fi?Fi:h-i;if(d<v)break;var S=d-v,g=yr-v;Ye(t,xa(Oc(v+S%g))),d=Ct(S/g),h+=yr}Ye(t,xa(Oc(d))),i=qb(a,c,f===u),a=0,f++}}a++,n++}return Ff(t,"")},eS=function(e){var t=[],r=Jb(Zb(Yb(e),Mf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ye(t,Vb(Wb,a)?"xn--"+Qb(a):a);return Ff(t,".")},tS=X,Fo=re,rS=Yn,Bo=G,kc=Xt,Ie=z,kn=$e,ve=Xn,nS=Ro,Bi=we,Ho=lb,It=Fb,Te=Qn,aS=kf.codeAt,iS=eS,Me=Ke,oS=Yt,sS=yt,Bf=_w,Hf=Jt,cS=Hf.set,_n=Hf.getterFor("URL"),uS=Bf.URLSearchParams,lS=Bf.getState,or=Bo.URL,Hi=Bo.TypeError,Rn=Bo.parseInt,fS=Math.floor,_c=Math.pow,ye=Ie("".charAt),Oe=Ie(/./.exec),dr=Ie([].join),dS=Ie(1 .toString),hS=Ie([].pop),Ot=Ie([].push),Da=Ie("".replace),vS=Ie([].shift),pS=Ie("".split),wr=Ie("".slice),Cn=Ie("".toLowerCase),mS=Ie([].unshift),gS="Invalid authority",Ma="Invalid scheme",tt="Invalid host",Rc="Invalid port",zf=/[a-z]/i,yS=/[\d+-.a-z]/i,zi=/\d/,wS=/^0x/i,bS=/^[0-7]+$/,SS=/^\d+$/,Gf=/^[\da-f]+$/i,$S=/[\0\t\n\r #%/:<>?@[\\\]^|]/,IS=/[\0\t\n\r #/:<>?@[\\\]^|]/,TS=/^[\u0000-\u0020]+/,PS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ES=/[\t\n\r]/g,pe,OS=function(e){var t=pS(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&&ye(i,0)==="0"&&(o=Oe(wS,i)?16:8,i=wr(i,o===8?1:2)),i==="")s=0;else{if(!Oe(o===10?SS:o===8?bS:Gf,i))return e;s=Rn(i,o)}Ot(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=_c(256,5-r))return null}else if(s>255)return null;for(u=hS(n),a=0;a<n.length;a++)u+=n[a]*_c(256,3-a);return u},kS=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 ye(e,a)};if(d()===":"){if(ye(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&&Oe(Gf,d());)i=i*16+Rn(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(!Oe(zi,d()))return;for(;Oe(zi,d());){if(f=Rn(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},_S=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},sr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)mS(t,e%256),e=fS(e/256);return dr(t,".")}if(typeof e=="object"){for(t="",n=_S(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=dS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},wn={},Kf=Ho({},wn,{" ":1,'"':1,"<":1,">":1,"`":1}),Wf=Ho({},Kf,{"#":1,"?":1,"{":1,"}":1}),Fa=Ho({},Wf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),We=function(e,t){var r=aS(e,0);return r>32&&r<127&&!Bi(t,e)?e:encodeURIComponent(e)},Yr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},hr=function(e,t){var r;return e.length===2&&Oe(zf,ye(e,0))&&((r=ye(e,1))===":"||!t&&r==="|")},Cc=function(e){var t;return e.length>1&&hr(wr(e,0,2))&&(e.length===2||(t=ye(e,2))==="/"||t==="\\"||t==="?"||t==="#")},RS=function(e){return e==="."||Cn(e)==="%2e"},CS=function(e){return e=Cn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ba={},Ac={},Ha={},jc={},Lc={},za={},Uc={},Nc={},Xr={},qr={},Ga={},Ka={},Wa={},Va={},xc={},Za={},Tt={},Ae={},Dc={},rt={},De={},zo=function(e,t,r){var n=Me(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Hi(i);this.searchParams=null}else{if(r!==void 0&&(a=new zo(r,!0)),i=this.parse(n,null,a),i)throw new Hi(i);o=lS(new uS),o.bindURL(this),this.searchParams=o}};zo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ba,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=Me(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=Da(e,TS,""),e=Da(e,PS,"$1")),e=Da(e,ES,""),l=It(e);i<=l.length;){switch(c=l[i],a){case Ba:if(c&&Oe(zf,c))o+=Cn(c),a=Ac;else{if(t)return Ma;a=Ha;continue}break;case Ac:if(c&&(Oe(yS,c)||c==="+"||c==="-"||c==="."))o+=Cn(c);else if(c===":"){if(t&&(n.isSpecial()!==Bi(Yr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Yr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Va:n.isSpecial()&&r&&r.scheme===n.scheme?a=jc:n.isSpecial()?a=Nc:l[i+1]==="/"?(a=Lc,i++):(n.cannotBeABaseURL=!0,Ot(n.path,""),a=Dc)}else{if(t)return Ma;o="",a=Ha,i=0;continue}break;case Ha:if(!r||r.cannotBeABaseURL&&c!=="#")return Ma;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Te(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=De;break}a=r.scheme==="file"?Va:za;continue;case jc:if(c==="/"&&l[i+1]==="/")a=Xr,i++;else{a=za;continue}break;case Lc:if(c==="/"){a=qr;break}else{a=Ae;continue}case za:if(n.scheme=r.scheme,c===pe)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Te(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Uc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Te(r.path),n.query="",a=rt;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Te(r.path),n.query=r.query,n.fragment="",a=De;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Te(r.path),n.path.length--,a=Ae;continue}break;case Uc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Xr;else if(c==="/")a=qr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ae;continue}break;case Nc:if(a=Xr,c!=="/"||ye(o,i+1)!=="/")continue;i++;break;case Xr:if(c!=="/"&&c!=="\\"){a=qr;continue}break;case qr:if(c==="@"){s&&(o="%40"+o),s=!0,d=It(o);for(var v=0;v<d.length;v++){var S=d[v];if(S===":"&&!f){f=!0;continue}var g=We(S,Fa);f?n.password+=g:n.username+=g}o=""}else if(c===pe||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return gS;i-=It(o).length+1,o="",a=Ga}else o+=c;break;case Ga:case Ka:if(t&&n.scheme==="file"){a=Za;continue}else if(c===":"&&!u){if(o==="")return tt;if(h=n.parseHost(o),h)return h;if(o="",a=Wa,t===Ka)return}else if(c===pe||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return tt;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=Tt,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Wa:if(Oe(zi,c))o+=c;else if(c===pe||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=Rn(o,10);if(T>65535)return Rc;n.port=n.isSpecial()&&T===Yr[n.scheme]?null:T,o=""}if(t)return;a=Tt;continue}else return Rc;break;case Va:if(n.scheme="file",c==="/"||c==="\\")a=xc;else if(r&&r.scheme==="file")switch(c){case pe:n.host=r.host,n.path=Te(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Te(r.path),n.query="",a=rt;break;case"#":n.host=r.host,n.path=Te(r.path),n.query=r.query,n.fragment="",a=De;break;default:Cc(dr(Te(l,i),""))||(n.host=r.host,n.path=Te(r.path),n.shortenPath()),a=Ae;continue}else{a=Ae;continue}break;case xc:if(c==="/"||c==="\\"){a=Za;break}r&&r.scheme==="file"&&!Cc(dr(Te(l,i),""))&&(hr(r.path[0],!0)?Ot(n.path,r.path[0]):n.host=r.host),a=Ae;continue;case Za:if(c===pe||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&hr(o))a=Ae;else if(o===""){if(n.host="",t)return;a=Tt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=Tt}continue}else o+=c;break;case Tt:if(n.isSpecial()){if(a=Ae,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=rt;else if(!t&&c==="#")n.fragment="",a=De;else if(c!==pe&&(a=Ae,c!=="/"))continue;break;case Ae:if(c===pe||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(CS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ot(n.path,"")):RS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ot(n.path,""):(n.scheme==="file"&&!n.path.length&&hr(o)&&(n.host&&(n.host=""),o=ye(o,0)+":"),Ot(n.path,o)),o="",n.scheme==="file"&&(c===pe||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)vS(n.path);c==="?"?(n.query="",a=rt):c==="#"&&(n.fragment="",a=De)}else o+=We(c,Wf);break;case Dc:c==="?"?(n.query="",a=rt):c==="#"?(n.fragment="",a=De):c!==pe&&(n.path[0]+=We(c,wn));break;case rt:!t&&c==="#"?(n.fragment="",a=De):c!==pe&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=We(c,wn));break;case De:c!==pe&&(n.fragment+=We(c,Kf));break}i++}},parseHost:function(e){var t,r,n;if(ye(e,0)==="["){if(ye(e,e.length-1)!=="]"||(t=kS(wr(e,1,-1)),!t))return tt;this.host=t}else if(this.isSpecial()){if(e=iS(e),Oe($S,e)||(t=OS(e),t===null))return tt;this.host=t}else{if(Oe(IS,e))return tt;for(t="",r=It(e),n=0;n<r.length;n++)t+=We(r[n],wn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Bi(Yr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!hr(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+=sr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+dr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Hi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Ft(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+sr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Me(e)+":",Ba)},getUsername:function(){return this.username},setUsername:function(e){var t=It(Me(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=We(t[r],Fa)}},getPassword:function(){return this.password},setPassword:function(e){var t=It(Me(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=We(t[r],Fa)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?sr(e):sr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ga)},getHostname:function(){var e=this.host;return e===null?"":sr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ka)},getPort:function(){var e=this.port;return e===null?"":Me(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Me(e),e===""?this.port=null:this.parse(e,Wa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+dr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Tt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Me(e),e===""?this.query=null:(ye(e,0)==="?"&&(e=wr(e,1)),this.query="",this.parse(e,rt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Me(e),e===""){this.fragment=null;return}ye(e,0)==="#"&&(e=wr(e,1)),this.fragment="",this.parse(e,De)},update:function(){this.query=this.searchParams.serialize()||null}};var Ft=function(t){var r=nS(this,ae),n=sS(arguments.length,1)>1?arguments[1]:void 0,a=cS(r,new zo(t,!1,n));Fo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ae=Ft.prototype,me=function(e,t){return{get:function(){return _n(this)[e]()},set:t&&function(r){return _n(this)[t](r)},configurable:!0,enumerable:!0}};Fo&&(ve(ae,"href",me("serialize","setHref")),ve(ae,"origin",me("getOrigin")),ve(ae,"protocol",me("getProtocol","setProtocol")),ve(ae,"username",me("getUsername","setUsername")),ve(ae,"password",me("getPassword","setPassword")),ve(ae,"host",me("getHost","setHost")),ve(ae,"hostname",me("getHostname","setHostname")),ve(ae,"port",me("getPort","setPort")),ve(ae,"pathname",me("getPathname","setPathname")),ve(ae,"search",me("getSearch","setSearch")),ve(ae,"searchParams",me("getSearchParams")),ve(ae,"hash",me("getHash","setHash")));kn(ae,"toJSON",function(){return _n(this).serialize()},{enumerable:!0});kn(ae,"toString",function(){return _n(this).serialize()},{enumerable:!0});if(or){var Mc=or.createObjectURL,Fc=or.revokeObjectURL;Mc&&kn(Ft,"createObjectURL",kc(Mc,or)),Fc&&kn(Ft,"revokeObjectURL",kc(Fc,or))}oS(Ft,"URL");tS({global:!0,constructor:!0,forced:!rS,sham:!Fo},{URL:Ft});var AS=X,jS=Se,Vf=ee,LS=yt,Bc=Ke,US=Yn,Go=jS("URL"),NS=US&&Vf(function(){Go.canParse()}),xS=Vf(function(){return Go.canParse.length!==1});AS({target:"URL",stat:!0,forced:!NS||xS},{canParse:function(t){var r=LS(arguments.length,1),n=Bc(t),a=r<2||arguments[1]===void 0?void 0:Bc(arguments[1]);try{return!!new Go(n,a)}catch{return!1}}});var DS=X,MS=Se,FS=yt,Hc=Ke,BS=Yn,HS=MS("URL");DS({target:"URL",stat:!0,forced:!BS},{parse:function(t){var r=FS(arguments.length,1),n=Hc(t),a=r<2||arguments[1]===void 0?void 0:Hc(arguments[1]);try{return new HS(n,a)}catch{return null}}});var zS=X,GS=ne;zS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return GS(URL.prototype.toString,this)}});var KS=xo;KS.URL;var WS={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},VS=Wn,Ja=VS("span").classList,zc=Ja&&Ja.constructor&&Ja.constructor.prototype,ZS=zc===Object.prototype?void 0:zc,Gc=G,Zf=WS,JS=ZS,vr=ry,Kc=gt,YS=Yt,XS=te,Ya=XS("iterator"),Xa=vr.values,Jf=function(e,t){if(e){if(e[Ya]!==Xa)try{Kc(e,Ya,Xa)}catch{e[Ya]=Xa}if(YS(e,t,!0),Zf[t]){for(var r in vr)if(e[r]!==vr[r])try{Kc(e,r,vr[r])}catch{e[r]=vr[r]}}}};for(var qa in Zf)Jf(Gc[qa]&&Gc[qa].prototype,qa);Jf(JS,"DOMTokenList");var qS=be,QS=gt,e$=function(e,t){qS(t)&&"cause"in t&&QS(e,"cause",t.cause)},t$=z,Yf=Error,r$=t$("".replace),n$=function(e){return String(new Yf(e).stack)}("zxcasd"),Xf=/\n\s*at [^:]*:[^\n]*/,a$=Xf.test(n$),i$=function(e,t){if(a$&&typeof e=="string"&&!Yf.prepareStackTrace)for(;t--;)e=r$(e,Xf,"");return e},o$=ee,s$=mt,c$=!o$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",s$(1,7)),e.stack!==7):!0}),u$=gt,l$=i$,f$=c$,Wc=Error.captureStackTrace,d$=function(e,t,r,n){f$&&(Wc?Wc(e,t):u$(e,"stack",l$(r,n)))},h$=Xt,v$=ne,p$=_e,m$=Zn,g$=Af,y$=mo,Vc=Vn,w$=Ao,b$=qn,Zc=Cf,S$=TypeError,bn=function(e,t){this.stopped=e,this.result=t},Jc=bn.prototype,Ur=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=h$(t,n),f,l,c,d,h,v,S,g=function(I){return f&&Zc(f,"normal",I),new bn(!0,I)},T=function(I){return a?(p$(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=b$(e),!l)throw new S$(m$(e)+" is not iterable");if(g$(l)){for(c=0,d=y$(e);d>c;c++)if(h=T(e[c]),h&&Vc(Jc,h))return h;return new bn(!1)}f=w$(e,l)}for(v=i?e.next:f.next;!(S=v$(v,f)).done;){try{h=T(S.value)}catch(I){Zc(f,"throw",I)}if(typeof h=="object"&&h&&Vc(Jc,h))return h}return new bn(!1)},$$=Ke,I$=function(e,t){return e===void 0?arguments.length<2?"":t:$$(e)},T$=X,P$=Vn,E$=Eo,An=Oo,O$=rf,qf=Jn,Qa=gt,ei=mt,k$=e$,_$=d$,R$=Ur,C$=I$,A$=te,j$=A$("toStringTag"),jn=Error,L$=[].push,Bt=function(t,r){var n=P$(ti,this),a;An?a=An(new jn,n?E$(this):ti):(a=n?this:qf(ti),Qa(a,j$,"Error")),r!==void 0&&Qa(a,"message",C$(r)),_$(a,Bt,a.stack,1),arguments.length>2&&k$(a,arguments[2]);var i=[];return R$(t,L$,{that:i}),Qa(a,"errors",i),a};An?An(Bt,jn):O$(Bt,jn,{name:!0});var ti=Bt.prototype=qf(jn.prototype,{constructor:ei(1,Bt),message:ei(1,""),name:ei(1,"AggregateError")});T$({global:!0,constructor:!0,arity:2},{AggregateError:Bt});var U$=Co,N$=Lr,x$=U$?{}.toString:function(){return"[object "+N$(this)+"]"},D$=Co,M$=$e,F$=x$;D$||M$(Object.prototype,"toString",F$,{unsafe:!0});var cr=G,B$=Cr,H$=Hn,Qr=function(e){return B$.slice(0,e.length)===e},Qf=function(){return Qr("Bun/")?"BUN":Qr("Cloudflare-Workers")?"CLOUDFLARE":Qr("Deno/")?"DENO":Qr("Node.js/")?"NODE":cr.Bun&&typeof Bun.version=="string"?"BUN":cr.Deno&&typeof Deno.version=="object"?"DENO":H$(cr.process)==="process"?"NODE":cr.window&&cr.document?"BROWSER":"REST"}(),z$=Qf,Ko=z$==="NODE",G$=Se,K$=Xn,W$=te,V$=re,Yc=W$("species"),Z$=function(e){var t=G$(e);V$&&t&&!t[Yc]&&K$(t,Yc,{configurable:!0,get:function(){return this}})},J$=xf,Y$=Zn,X$=TypeError,q$=function(e){if(J$(e))return e;throw new X$(Y$(e)+" is not a constructor")},Xc=_e,Q$=q$,eI=zn,tI=te,rI=tI("species"),ed=function(e,t){var r=Xc(e).constructor,n;return r===void 0||eI(n=Xc(r)[rI])?t:Q$(n)},nI=Bn,td=Function.prototype,qc=td.apply,Qc=td.call,rd=typeof Reflect=="object"&&Reflect.apply||(nI?Qc.bind(qc):function(){return Qc.apply(qc,arguments)}),aI=Cr,nd=/(?:ipad|iphone|ipod).*applewebkit/i.test(aI),le=G,iI=rd,oI=Xt,eu=Z,sI=we,ad=ee,tu=Gl,cI=Qn,ru=Wn,uI=yt,lI=nd,fI=Ko,Gi=le.setImmediate,Ki=le.clearImmediate,dI=le.process,ri=le.Dispatch,hI=le.Function,nu=le.MessageChannel,vI=le.String,ni=0,br={},au="onreadystatechange",Or,nt,ai,ii;ad(function(){Or=le.location});var Wo=function(e){if(sI(br,e)){var t=br[e];delete br[e],t()}},oi=function(e){return function(){Wo(e)}},iu=function(e){Wo(e.data)},ou=function(e){le.postMessage(vI(e),Or.protocol+"//"+Or.host)};(!Gi||!Ki)&&(Gi=function(t){uI(arguments.length,1);var r=eu(t)?t:hI(t),n=cI(arguments,1);return br[++ni]=function(){iI(r,void 0,n)},nt(ni),ni},Ki=function(t){delete br[t]},fI?nt=function(e){dI.nextTick(oi(e))}:ri&&ri.now?nt=function(e){ri.now(oi(e))}:nu&&!lI?(ai=new nu,ii=ai.port2,ai.port1.onmessage=iu,nt=oI(ii.postMessage,ii)):le.addEventListener&&eu(le.postMessage)&&!le.importScripts&&Or&&Or.protocol!=="file:"&&!ad(ou)?(nt=ou,le.addEventListener("message",iu,!1)):au in ru("script")?nt=function(e){tu.appendChild(ru("script"))[au]=function(){tu.removeChild(this),Wo(e)}}:nt=function(e){setTimeout(oi(e),0)});var id={set:Gi,clear:Ki},od=function(){this.head=null,this.tail=null};od.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 sd=od,pI=Cr,mI=/ipad|iphone|ipod/i.test(pI)&&typeof Pebble<"u",gI=Cr,yI=/web0s(?!.*chrome)/i.test(gI),Ht=G,wI=hf,su=Xt,si=id.set,bI=sd,SI=nd,$I=mI,II=yI,ci=Ko,cu=Ht.MutationObserver||Ht.WebKitMutationObserver,uu=Ht.document,lu=Ht.process,en=Ht.Promise,Wi=wI("queueMicrotask"),Pt,ui,li,tn,fu;if(!Wi){var rn=new bI,nn=function(){var e,t;for(ci&&(e=lu.domain)&&e.exit();t=rn.get();)try{t()}catch(r){throw rn.head&&Pt(),r}e&&e.enter()};!SI&&!ci&&!II&&cu&&uu?(ui=!0,li=uu.createTextNode(""),new cu(nn).observe(li,{characterData:!0}),Pt=function(){li.data=ui=!ui}):!$I&&en&&en.resolve?(tn=en.resolve(void 0),tn.constructor=en,fu=su(tn.then,tn),Pt=function(){fu(nn)}):ci?Pt=function(){lu.nextTick(nn)}:(si=su(si,Ht),Pt=function(){si(nn)}),Wi=function(e){rn.head||Pt(),rn.add(e)}}var TI=Wi,PI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Qt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},EI=G,Nr=EI.Promise,OI=G,Sr=Nr,kI=Z,_I=nf,RI=Io,CI=te,du=Qf,fi=jl;Sr&&Sr.prototype;var AI=CI("species"),Vi=!1,cd=kI(OI.PromiseRejectionEvent),jI=_I("Promise",function(){var e=RI(Sr),t=e!==String(Sr);if(!t&&fi===66)return!0;if(!fi||fi<51||!/native code/.test(e)){var r=new Sr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[AI]=n,Vi=r.then(function(){})instanceof n,!Vi)return!0}return!t&&(du==="BROWSER"||du==="DENO")&&!cd}),xr={CONSTRUCTOR:jI,REJECTION_EVENT:cd,SUBCLASSING:Vi},Ne={},hu=Re,LI=TypeError,UI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new LI("Bad Promise constructor");t=n,r=a}),this.resolve=hu(t),this.reject=hu(r)};Ne.f=function(e){return new UI(e)};var NI=X,Ln=Ko,Qe=G,zt=ne,vu=$e,pu=Oo,xI=Yt,DI=Z$,MI=Re,Sn=Z,FI=be,BI=Ro,HI=ed,ud=id.set,Vo=TI,zI=PI,GI=Qt,KI=sd,ld=Jt,Un=Nr,Zo=xr,fd=Ne,na="Promise",dd=Zo.CONSTRUCTOR,WI=Zo.REJECTION_EVENT,VI=Zo.SUBCLASSING,di=ld.getterFor(na),ZI=ld.set,kt=Un&&Un.prototype,it=Un,an=kt,hd=Qe.TypeError,Zi=Qe.document,Jo=Qe.process,Ji=fd.f,JI=Ji,YI=!!(Zi&&Zi.createEvent&&Qe.dispatchEvent),vd="unhandledrejection",XI="rejectionhandled",mu=0,pd=1,qI=2,Yo=1,md=2,on,gu,QI,yu,gd=function(e){var t;return FI(e)&&Sn(t=e.then)?t:!1},yd=function(e,t){var r=t.value,n=t.state===pd,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===md&&t0(t),t.rejection=Yo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new hd("Promise-chain cycle")):(f=gd(u))?zt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},wd=function(e,t){e.notified||(e.notified=!0,Vo(function(){for(var r=e.reactions,n;n=r.get();)yd(n,e);e.notified=!1,t&&!e.rejection&&e0(e)}))},bd=function(e,t,r){var n,a;YI?(n=Zi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Qe.dispatchEvent(n)):n={promise:t,reason:r},!WI&&(a=Qe["on"+e])?a(n):e===vd&&zI("Unhandled promise rejection",r)},e0=function(e){zt(ud,Qe,function(){var t=e.facade,r=e.value,n=wu(e),a;if(n&&(a=GI(function(){Ln?Jo.emit("unhandledRejection",r,t):bd(vd,t,r)}),e.rejection=Ln||wu(e)?md:Yo,a.error))throw a.value})},wu=function(e){return e.rejection!==Yo&&!e.parent},t0=function(e){zt(ud,Qe,function(){var t=e.facade;Ln?Jo.emit("rejectionHandled",t):bd(XI,t,e.value)})},At=function(e,t,r){return function(n){e(t,n,r)}},Ut=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=qI,wd(e,!0))},Yi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new hd("Promise can't be resolved itself");var n=gd(t);n?Vo(function(){var a={done:!1};try{zt(n,t,At(Yi,a,e),At(Ut,a,e))}catch(i){Ut(a,i,e)}}):(e.value=t,e.state=pd,wd(e,!1))}catch(a){Ut({done:!1},a,e)}}};if(dd&&(it=function(t){BI(this,an),MI(t),zt(on,this);var r=di(this);try{t(At(Yi,r),At(Ut,r))}catch(n){Ut(r,n)}},an=it.prototype,on=function(t){ZI(this,{type:na,done:!1,notified:!1,parent:!1,reactions:new KI,rejection:!1,state:mu,value:null})},on.prototype=vu(an,"then",function(t,r){var n=di(this),a=Ji(HI(this,it));return n.parent=!0,a.ok=Sn(t)?t:!0,a.fail=Sn(r)&&r,a.domain=Ln?Jo.domain:void 0,n.state===mu?n.reactions.add(a):Vo(function(){yd(a,n)}),a.promise}),gu=function(){var e=new on,t=di(e);this.promise=e,this.resolve=At(Yi,t),this.reject=At(Ut,t)},fd.f=Ji=function(e){return e===it||e===QI?new gu(e):JI(e)},Sn(Un)&&kt!==Object.prototype)){yu=kt.then,VI||vu(kt,"then",function(t,r){var n=this;return new it(function(a,i){zt(yu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete kt.constructor}catch{}pu&&pu(kt,an)}NI({global:!0,constructor:!0,wrap:!0,forced:dd},{Promise:it});xI(it,na,!1);DI(na);var r0=te,Sd=r0("iterator"),$d=!1;try{var n0=0,bu={next:function(){return{done:!!n0++}},return:function(){$d=!0}};bu[Sd]=function(){return this},Array.from(bu,function(){throw 2})}catch{}var a0=function(e,t){try{if(!t&&!$d)return!1}catch{return!1}var r=!1;try{var n={};n[Sd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},i0=Nr,o0=a0,s0=xr.CONSTRUCTOR,aa=s0||!o0(function(e){i0.all(e).then(void 0,function(){})}),c0=X,u0=ne,l0=Re,f0=Ne,d0=Qt,h0=Ur,v0=aa;c0({target:"Promise",stat:!0,forced:v0},{all:function(t){var r=this,n=f0.f(r),a=n.resolve,i=n.reject,o=d0(function(){var s=l0(r.resolve),u=[],f=0,l=1;h0(t,function(c){var d=f++,h=!1;l++,u0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var p0=X,m0=xr.CONSTRUCTOR,Xi=Nr,g0=Se,y0=Z,w0=$e,Su=Xi&&Xi.prototype;p0({target:"Promise",proto:!0,forced:m0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(y0(Xi)){var $u=g0("Promise").prototype.catch;Su.catch!==$u&&w0(Su,"catch",$u,{unsafe:!0})}var b0=X,S0=ne,$0=Re,I0=Ne,T0=Qt,P0=Ur,E0=aa;b0({target:"Promise",stat:!0,forced:E0},{race:function(t){var r=this,n=I0.f(r),a=n.reject,i=T0(function(){var o=$0(r.resolve);P0(t,function(s){S0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var O0=X,k0=Ne,_0=xr.CONSTRUCTOR;O0({target:"Promise",stat:!0,forced:_0},{reject:function(t){var r=k0.f(this),n=r.reject;return n(t),r.promise}});var R0=_e,C0=be,A0=Ne,Id=function(e,t){if(R0(e),C0(t)&&t.constructor===e)return t;var r=A0.f(e),n=r.resolve;return n(t),r.promise},j0=X,L0=Se,U0=xr.CONSTRUCTOR,N0=Id;L0("Promise");j0({target:"Promise",stat:!0,forced:U0},{resolve:function(t){return N0(this,t)}});var x0=X,D0=ne,M0=Re,F0=Ne,B0=Qt,H0=Ur,z0=aa;x0({target:"Promise",stat:!0,forced:z0},{allSettled:function(t){var r=this,n=F0.f(r),a=n.resolve,i=n.reject,o=B0(function(){var s=M0(r.resolve),u=[],f=0,l=1;H0(t,function(c){var d=f++,h=!1;l++,D0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var G0=X,K0=ne,W0=Re,V0=Se,Z0=Ne,J0=Qt,Y0=Ur,X0=aa,Iu="No one promise resolved";G0({target:"Promise",stat:!0,forced:X0},{any:function(t){var r=this,n=V0("AggregateError"),a=Z0.f(r),i=a.resolve,o=a.reject,s=J0(function(){var u=W0(r.resolve),f=[],l=0,c=1,d=!1;Y0(t,function(h){var v=l++,S=!1;c++,K0(u,r,h).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[v]=g,--c||o(new n(f,Iu)))})}),--c||o(new n(f,Iu))});return s.error&&o(s.value),a.promise}});var q0=X,Q0=Ne;q0({target:"Promise",stat:!0},{withResolvers:function(){var t=Q0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var eT=X,Nn=Nr,tT=ee,Td=Se,Pd=Z,rT=ed,Tu=Id,nT=$e,qi=Nn&&Nn.prototype,aT=!!Nn&&tT(function(){qi.finally.call({then:function(){}},function(){})});eT({target:"Promise",proto:!0,real:!0,forced:aT},{finally:function(e){var t=rT(this,Td("Promise")),r=Pd(e);return this.then(r?function(n){return Tu(t,e()).then(function(){return n})}:e,r?function(n){return Tu(t,e()).then(function(){throw n})}:e)}});if(Pd(Nn)){var Pu=Td("Promise").prototype.finally;qi.finally!==Pu&&nT(qi,"finally",Pu,{unsafe:!0})}var iT=xo;iT.Promise;var oT=X,sT=G,cT=rd,uT=Qn,lT=Ne,fT=Re,Ed=Qt,hi=sT.Promise,Eu=!1,dT=!hi||!hi.try||Ed(function(){hi.try(function(e){Eu=e===8},8)}).error||!Eu;oT({target:"Promise",stat:!0,forced:dT},{try:function(e){var t=arguments.length>1?uT(arguments,1):[],r=lT.f(this),n=Ed(function(){return cT(fT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const Od="sesamy-debug";function hT(e,t,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${t}; ${a}; path=/`}function vT(e){const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null}function pT(e){hT(Od,e.toString(),1)}function mT(){return vT(Od)==="true"}function Le(e){mT()&&console.log(e)}function Ge(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});Le(`Triggering event: ${e}`),dispatchEvent(r)}function je(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qo(e,t){return e(t={exports:{}},t.exports),t.exports}var at=qo(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()}});Xo(at);var gT=Xo(qo(function(e,t){var r=ot&&ot.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,S){function g(w){try{I(h.next(w))}catch(p){S(p)}}function T(w){try{I(h.throw(w))}catch(p){S(p)}}function I(w){w.done?v(w.value):new d(function(p){p(w.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=ot&&ot.__generator||function(l,c){var d,h,v,S,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return S={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function T(I){return function(w){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch($){p=[6,$],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,w])}}},a=ot;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,S,g,T,I,w;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(S))!==null&&(w=JSON.parse(I)).id===this.id&&w.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,at.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?(at.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),at.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(at.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var w=50-(Date.now()-S);w>0?setTimeout(h,w):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(S=JSON.parse(v)).id!==this.id?[3,2]:[4,at.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),at.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],S=0;;){var g=h.keySync(S);if(g===null)break;v.push(g),S++}for(var T=!1,I=0;I<v.length;I++){var w=v[I];if(w.includes(i)){var p=h.getItemSync(w);if(p!==null){var $=JSON.parse(p);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(h.removeItemSync(w),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const yT={timeoutInSeconds:60},kd={name:"auth0-spa-js",version:"2.1.3"},_d=()=>Date.now();let ue=class Qi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Qi.prototype)}static fromPayload({error:t,error_description:r}){return new Qi(t,r)}},wT=class Rd extends ue{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Rd.prototype)}},eo=class Cd extends ue{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Cd.prototype)}},bT=class Ad extends eo{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Ad.prototype)}},ST=class jd extends ue{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,jd.prototype)}},$T=class Ld extends ue{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Ld.prototype)}},Ud=class Nd extends ue{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Ou(t,["default"])}', scope: '${Ou(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Nd.prototype)}};function Ou(e,t=[]){return e&&!t.includes(e)?e:""}const $n=()=>window.crypto,vi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from($n().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},ku=e=>btoa(e),to=e=>{var{clientId:t}=e,r=je(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},_u=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),IT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},TT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([IT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},PT=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},ET=async(e,t,r,n,a,i,o=1e4)=>a?PT(e,t,r,n,o,a,i):TT(e,n,o);async function OT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=je(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?to(u):JSON.stringify(u);return await async function(l,c,d,h,v,S,g){let T,I=null;for(let k=0;k<3;k++)try{T=await ET(l,d,h,v,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const w=T.json,{error:p,error_description:$}=w,O=je(w,["error","error_description"]),{ok:_}=T;if(!_){const k=$||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new $T(p,k,O.mfa_token):p==="missing_refresh_token"?new Ud(d,h):new ue(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||kd))}},t,s)}const sn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ct=class ro{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 ro({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new ro({scope:r,audience:n,clientId:a})}},kT=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@@"))}},xd=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)}}()}},_T=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||_d}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 ct({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 ct({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=ct.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]}},RT=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 ur=e=>typeof e=="number",CT=["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"],AT=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(_u(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],CT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(_u(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&&!ur(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||!ur(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ur(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&&ur(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&&ur(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 ut=qo(function(e,t){var r=ot&&ot.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Xo(ut),ut.encode,ut.parse,ut.getAll;var jT=ut.get,Dd=ut.set,Md=ut.remove;const _t={get(e){const t=jT(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),Dd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Md(e,r)}},LT={get(e){return _t.get(e)||_t.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),Dd(`_legacy_${e}`,JSON.stringify(t),n),_t.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Md(e,r),_t.remove(e,t),_t.remove(`_legacy_${e}`,t)}},UT={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 NT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
-
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var
|
|
1
|
+
"use strict";var Lh=Object.defineProperty;var Uh=(e,t,r)=>t in e?Lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ve=(e,t,r)=>Uh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},re=function(e){try{return!!e()}catch{return!0}},Nh=re,Hn=!Nh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Cl=Hn,Al=Function.prototype,Oi=Al.call,xh=Cl&&Al.bind.bind(Oi,Oi),G=Cl?xh:function(e){return function(){return Oi.apply(e,arguments)}},jl=G,Dh=jl({}.toString),Mh=jl("".slice),zn=function(e){return Mh(Dh(e),8,-1)},Fh=G,Bh=re,Hh=zn,da=Object,zh=Fh("".split),Ll=Bh(function(){return!da("z").propertyIsEnumerable(0)})?function(e){return Hh(e)==="String"?zh(e,""):da(e)}:da,Gn=function(e){return e==null},Gh=Gn,Kh=TypeError,Kn=function(e){if(Gh(e))throw new Kh("Can't call method on "+e);return e},Wh=Ll,Vh=Kn,Cr=function(e){return Wh(Vh(e))},nr=function(e){return e&&e.Math===Math&&e},K=nr(typeof globalThis=="object"&&globalThis)||nr(typeof window=="object"&&window)||nr(typeof self=="object"&&self)||nr(typeof Br=="object"&&Br)||nr(typeof Br=="object"&&Br)||function(){return this}()||Function("return this")(),Ul={exports:{}},Zh=!1,vs=K,Jh=Object.defineProperty,po=function(e,t){try{Jh(vs,e,{value:t,configurable:!0,writable:!0})}catch{vs[e]=t}return t},Yh=K,Xh=po,ps="__core-js_shared__",ms=Ul.exports=Yh[ps]||Xh(ps,{});(ms.versions||(ms.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var mo=Ul.exports,gs=mo,Nl=function(e,t){return gs[e]||(gs[e]=t||{})},qh=Kn,Qh=Object,Wn=function(e){return Qh(qh(e))},ev=G,tv=Wn,rv=ev({}.hasOwnProperty),be=Object.hasOwn||function(t,r){return rv(tv(t),r)},nv=G,av=0,iv=Math.random(),ov=nv(1 .toString),xl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ov(++av+iv,36)},sv=K,ys=sv.navigator,ws=ys&&ys.userAgent,Ar=ws?String(ws):"",Dl=K,ha=Ar,bs=Dl.process,Ss=Dl.Deno,$s=bs&&bs.versions||Ss&&Ss.version,Is=$s&&$s.v8,Oe,Pn;Is&&(Oe=Is.split("."),Pn=Oe[0]>0&&Oe[0]<4?1:+(Oe[0]+Oe[1]));!Pn&&ha&&(Oe=ha.match(/Edge\/(\d+)/),(!Oe||Oe[1]>=74)&&(Oe=ha.match(/Chrome\/(\d+)/),Oe&&(Pn=+Oe[1])));var Ml=Pn,Ts=Ml,cv=re,uv=K,lv=uv.String,Fl=!!Object.getOwnPropertySymbols&&!cv(function(){var e=Symbol("symbol detection");return!lv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ts&&Ts<41}),fv=Fl,Bl=fv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",dv=K,hv=Nl,Ps=be,vv=xl,pv=Fl,mv=Bl,Ct=dv.Symbol,va=hv("wks"),gv=mv?Ct.for||Ct:Ct&&Ct.withoutSetter||vv,ne=function(e){return Ps(va,e)||(va[e]=pv&&Ps(Ct,e)?Ct[e]:gv("Symbol."+e)),va[e]},pa=typeof document=="object"&&document.all,J=typeof pa>"u"&&pa!==void 0?function(e){return typeof e=="function"||e===pa}:function(e){return typeof e=="function"},yv=J,Se=function(e){return typeof e=="object"?e!==null:yv(e)},wv=Se,bv=String,Sv=TypeError,Ce=function(e){if(wv(e))return e;throw new Sv(bv(e)+" is not an object")},Hl={},$v=re,ae=!$v(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Iv=ae,Tv=re,zl=Iv&&Tv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ne={},Pv=K,Es=Se,ki=Pv.document,Ev=Es(ki)&&Es(ki.createElement),Vn=function(e){return Ev?ki.createElement(e):{}},Ov=ae,kv=re,_v=Vn,Gl=!Ov&&!kv(function(){return Object.defineProperty(_v("div"),"a",{get:function(){return 7}}).a!==7}),Rv=Hn,Hr=Function.prototype.call,ie=Rv?Hr.bind(Hr):function(){return Hr.apply(Hr,arguments)},ma=K,Cv=J,Av=function(e){return Cv(e)?e:void 0},$e=function(e,t){return arguments.length<2?Av(ma[e]):ma[e]&&ma[e][t]},jv=G,Zn=jv({}.isPrototypeOf),Lv=$e,Uv=J,Nv=Zn,xv=Bl,Dv=Object,Kl=xv?function(e){return typeof e=="symbol"}:function(e){var t=Lv("Symbol");return Uv(t)&&Nv(t.prototype,Dv(e))},Mv=String,Jn=function(e){try{return Mv(e)}catch{return"Object"}},Fv=J,Bv=Jn,Hv=TypeError,Ae=function(e){if(Fv(e))return e;throw new Hv(Bv(e)+" is not a function")},zv=Ae,Gv=Gn,go=function(e,t){var r=e[t];return Gv(r)?void 0:zv(r)},ga=ie,ya=J,wa=Se,Kv=TypeError,Wv=function(e,t){var r,n;if(t==="string"&&ya(r=e.toString)&&!wa(n=ga(r,e))||ya(r=e.valueOf)&&!wa(n=ga(r,e))||t!=="string"&&ya(r=e.toString)&&!wa(n=ga(r,e)))return n;throw new Kv("Can't convert object to primitive value")},Vv=ie,Os=Se,ks=Kl,Zv=go,Jv=Wv,Yv=ne,Xv=TypeError,qv=Yv("toPrimitive"),Qv=function(e,t){if(!Os(e)||ks(e))return e;var r=Zv(e,qv),n;if(r){if(t===void 0&&(t="default"),n=Vv(r,e,t),!Os(n)||ks(n))return n;throw new Xv("Can't convert object to primitive value")}return t===void 0&&(t="number"),Jv(e,t)},ep=Qv,tp=Kl,Wl=function(e){var t=ep(e,"string");return tp(t)?t:t+""},rp=ae,np=Gl,ap=zl,zr=Ce,_s=Wl,ip=TypeError,ba=Object.defineProperty,op=Object.getOwnPropertyDescriptor,Sa="enumerable",$a="configurable",Ia="writable";Ne.f=rp?ap?function(t,r,n){if(zr(t),r=_s(r),zr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ia in n&&!n[Ia]){var a=op(t,r);a&&a[Ia]&&(t[r]=n.value,n={configurable:$a in n?n[$a]:a[$a],enumerable:Sa in n?n[Sa]:a[Sa],writable:!1})}return ba(t,r,n)}:ba:function(t,r,n){if(zr(t),r=_s(r),zr(n),np)try{return ba(t,r,n)}catch{}if("get"in n||"set"in n)throw new ip("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var sp=Math.ceil,cp=Math.floor,up=Math.trunc||function(t){var r=+t;return(r>0?cp:sp)(r)},lp=up,yo=function(e){var t=+e;return t!==t||t===0?0:lp(t)},fp=yo,dp=Math.max,hp=Math.min,Vl=function(e,t){var r=fp(e);return r<0?dp(r+t,0):hp(r,t)},vp=yo,pp=Math.min,mp=function(e){var t=vp(e);return t>0?pp(t,9007199254740991):0},gp=mp,wo=function(e){return gp(e.length)},yp=Cr,wp=Vl,bp=wo,Rs=function(e){return function(t,r,n){var a=yp(t),i=bp(a);if(i===0)return!e&&-1;var o=wp(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},Sp={includes:Rs(!0),indexOf:Rs(!1)},bo={},$p=G,Ta=be,Ip=Cr,Tp=Sp.indexOf,Pp=bo,Cs=$p([].push),Zl=function(e,t){var r=Ip(e),n=0,a=[],i;for(i in r)!Ta(Pp,i)&&Ta(r,i)&&Cs(a,i);for(;t.length>n;)Ta(r,i=t[n++])&&(~Tp(a,i)||Cs(a,i));return a},So=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ep=Zl,Op=So,Jl=Object.keys||function(t){return Ep(t,Op)},kp=ae,_p=zl,Rp=Ne,Cp=Ce,Ap=Cr,jp=Jl;Hl.f=kp&&!_p?Object.defineProperties:function(t,r){Cp(t);for(var n=Ap(r),a=jp(r),i=a.length,o=0,s;i>o;)Rp.f(t,s=a[o++],n[s]);return t};var Lp=$e,Yl=Lp("document","documentElement"),Up=Nl,Np=xl,As=Up("keys"),$o=function(e){return As[e]||(As[e]=Np(e))},xp=Ce,Dp=Hl,js=So,Mp=bo,Fp=Yl,Bp=Vn,Hp=$o,Ls=">",Us="<",_i="prototype",Ri="script",Xl=Hp("IE_PROTO"),Pa=function(){},ql=function(e){return Us+Ri+Ls+e+Us+"/"+Ri+Ls},Ns=function(e){e.write(ql("")),e.close();var t=e.parentWindow.Object;return e=null,t},zp=function(){var e=Bp("iframe"),t="java"+Ri+":",r;return e.style.display="none",Fp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(ql("document.F=Object")),r.close(),r.F},Gr,mn=function(){try{Gr=new ActiveXObject("htmlfile")}catch{}mn=typeof document<"u"?document.domain&&Gr?Ns(Gr):zp():Ns(Gr);for(var e=js.length;e--;)delete mn[_i][js[e]];return mn()};Mp[Xl]=!0;var Yn=Object.create||function(t,r){var n;return t!==null?(Pa[_i]=xp(t),n=new Pa,Pa[_i]=null,n[Xl]=t):n=mn(),r===void 0?n:Dp.f(n,r)},Gp=ne,Kp=Yn,Wp=Ne.f,Ci=Gp("unscopables"),Ai=Array.prototype;Ai[Ci]===void 0&&Wp(Ai,Ci,{configurable:!0,value:Kp(null)});var Vp=function(e){Ai[Ci][e]=!0},jr={},Zp=K,Jp=J,xs=Zp.WeakMap,Yp=Jp(xs)&&/native code/.test(String(xs)),gt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Xp=ae,qp=Ne,Qp=gt,yt=Xp?function(e,t,r){return qp.f(e,t,Qp(1,r))}:function(e,t,r){return e[t]=r,e},em=Yp,Ql=K,tm=Se,rm=yt,Ea=be,Oa=mo,nm=$o,am=bo,Ds="Object already initialized",ji=Ql.TypeError,im=Ql.WeakMap,En,Or,On,om=function(e){return On(e)?Or(e):En(e,{})},sm=function(e){return function(t){var r;if(!tm(t)||(r=Or(t)).type!==e)throw new ji("Incompatible receiver, "+e+" required");return r}};if(em||Oa.state){var je=Oa.state||(Oa.state=new im);je.get=je.get,je.has=je.has,je.set=je.set,En=function(e,t){if(je.has(e))throw new ji(Ds);return t.facade=e,je.set(e,t),t},Or=function(e){return je.get(e)||{}},On=function(e){return je.has(e)}}else{var St=nm("state");am[St]=!0,En=function(e,t){if(Ea(e,St))throw new ji(Ds);return t.facade=e,rm(e,St,t),t},Or=function(e){return Ea(e,St)?e[St]:{}},On=function(e){return Ea(e,St)}}var Yt={set:En,get:Or,has:On,enforce:om,getterFor:sm},Io={},To={},ef={}.propertyIsEnumerable,tf=Object.getOwnPropertyDescriptor,cm=tf&&!ef.call({1:2},1);To.f=cm?function(t){var r=tf(this,t);return!!r&&r.enumerable}:ef;var um=ae,lm=ie,fm=To,dm=gt,hm=Cr,vm=Wl,pm=be,mm=Gl,Ms=Object.getOwnPropertyDescriptor;Io.f=um?Ms:function(t,r){if(t=hm(t),r=vm(r),mm)try{return Ms(t,r)}catch{}if(pm(t,r))return dm(!lm(fm.f,t,r),t[r])};var rf={exports:{}},Li=ae,gm=be,nf=Function.prototype,ym=Li&&Object.getOwnPropertyDescriptor,Po=gm(nf,"name"),wm=Po&&(function(){}).name==="something",bm=Po&&(!Li||Li&&ym(nf,"name").configurable),af={EXISTS:Po,PROPER:wm,CONFIGURABLE:bm},Sm=G,$m=J,Ui=mo,Im=Sm(Function.toString);$m(Ui.inspectSource)||(Ui.inspectSource=function(e){return Im(e)});var Eo=Ui.inspectSource,Oo=G,Tm=re,Pm=J,Kr=be,Ni=ae,Em=af.CONFIGURABLE,Om=Eo,of=Yt,km=of.enforce,_m=of.get,Fs=String,gn=Object.defineProperty,Rm=Oo("".slice),Cm=Oo("".replace),Am=Oo([].join),jm=Ni&&!Tm(function(){return gn(function(){},"length",{value:8}).length!==8}),Lm=String(String).split("String"),Um=rf.exports=function(e,t,r){Rm(Fs(t),0,7)==="Symbol("&&(t="["+Cm(Fs(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Kr(e,"name")||Em&&e.name!==t)&&(Ni?gn(e,"name",{value:t,configurable:!0}):e.name=t),jm&&r&&Kr(r,"arity")&&e.length!==r.arity&&gn(e,"length",{value:r.arity});try{r&&Kr(r,"constructor")&&r.constructor?Ni&&gn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=km(e);return Kr(n,"source")||(n.source=Am(Lm,typeof t=="string"?t:"")),e};Function.prototype.toString=Um(function(){return Pm(this)&&_m(this).source||Om(this)},"toString");var sf=rf.exports,Nm=J,xm=Ne,Dm=sf,Mm=po,Ie=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Nm(r)&&Dm(r,i,n),n.global)a?e[t]=r:Mm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:xm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},cf={},Fm=Zl,Bm=So,Hm=Bm.concat("length","prototype");cf.f=Object.getOwnPropertyNames||function(t){return Fm(t,Hm)};var ko={};ko.f=Object.getOwnPropertySymbols;var zm=$e,Gm=G,Km=cf,Wm=ko,Vm=Ce,Zm=Gm([].concat),Jm=zm("Reflect","ownKeys")||function(t){var r=Km.f(Vm(t)),n=Wm.f;return n?Zm(r,n(t)):r},Bs=be,Ym=Jm,Xm=Io,qm=Ne,uf=function(e,t,r){for(var n=Ym(t),a=qm.f,i=Xm.f,o=0;o<n.length;o++){var s=n[o];!Bs(e,s)&&!(r&&Bs(r,s))&&a(e,s,i(t,s))}},Qm=re,eg=J,tg=/#|\.prototype\./,Lr=function(e,t){var r=ng[rg(e)];return r===ig?!0:r===ag?!1:eg(t)?Qm(t):!!t},rg=Lr.normalize=function(e){return String(e).replace(tg,".").toLowerCase()},ng=Lr.data={},ag=Lr.NATIVE="N",ig=Lr.POLYFILL="P",lf=Lr,Wr=K,og=Io.f,sg=yt,cg=Ie,ug=po,lg=uf,fg=lf,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Wr:a?o=Wr[r]||ug(r,{}):o=Wr[r]&&Wr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=og(o,s),u=l&&l.value):u=o[s],i=fg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;lg(f,u)}(e.sham||u&&u.sham)&&sg(f,"sham",!0),cg(o,s,f,e)}},dg=re,hg=!dg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),vg=be,pg=J,mg=Wn,gg=$o,yg=hg,Hs=gg("IE_PROTO"),xi=Object,wg=xi.prototype,_o=yg?xi.getPrototypeOf:function(e){var t=mg(e);if(vg(t,Hs))return t[Hs];var r=t.constructor;return pg(r)&&t instanceof r?r.prototype:t instanceof xi?wg:null},bg=re,Sg=J,$g=Se,zs=_o,Ig=Ie,Tg=ne,Di=Tg("iterator"),ff=!1,ht,ka,_a;[].keys&&(_a=[].keys(),"next"in _a?(ka=zs(zs(_a)),ka!==Object.prototype&&(ht=ka)):ff=!0);var Pg=!$g(ht)||bg(function(){var e={};return ht[Di].call(e)!==e});Pg&&(ht={});Sg(ht[Di])||Ig(ht,Di,function(){return this});var df={IteratorPrototype:ht,BUGGY_SAFARI_ITERATORS:ff},Eg=Ne.f,Og=be,kg=ne,Gs=kg("toStringTag"),Xt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Og(e,Gs)&&Eg(e,Gs,{configurable:!0,value:t})},_g=df.IteratorPrototype,Rg=Yn,Cg=gt,Ag=Xt,jg=jr,Lg=function(){return this},hf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Rg(_g,{next:Cg(+!n,r)}),Ag(e,a,!1),jg[a]=Lg,e},Ug=G,Ng=Ae,xg=function(e,t,r){try{return Ug(Ng(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Dg=Se,Mg=function(e){return Dg(e)||e===null},Fg=Mg,Bg=String,Hg=TypeError,zg=function(e){if(Fg(e))return e;throw new Hg("Can't set "+Bg(e)+" as a prototype")},Gg=xg,Kg=Se,Wg=Kn,Vg=zg,Ro=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Gg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Wg(a),Vg(i),Kg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Zg=Q,Jg=ie,vf=af,Yg=J,Xg=hf,Ks=_o,Ws=Ro,qg=Xt,Qg=yt,Ra=Ie,ey=ne,ty=jr,pf=df,ry=vf.PROPER,ny=vf.CONFIGURABLE,Vs=pf.IteratorPrototype,Vr=pf.BUGGY_SAFARI_ITERATORS,ar=ey("iterator"),Zs="keys",ir="values",Js="entries",ay=function(){return this},mf=function(e,t,r,n,a,i,o){Xg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Vr&&T&&T in l)return l[T];switch(T){case Zs:return function(){return new r(this,T)};case ir:return function(){return new r(this,T)};case Js:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[ar]||l["@@iterator"]||a&&l[a],d=!Vr&&c||s(a),h=t==="Array"&&l.entries||c,v,b,g;if(h&&(v=Ks(h.call(new e)),v!==Object.prototype&&v.next&&(Ks(v)!==Vs&&(Ws?Ws(v,Vs):Yg(v[ar])||Ra(v,ar,ay)),qg(v,u,!0))),ry&&a===ir&&c&&c.name!==ir&&(ny?Qg(l,"name",ir):(f=!0,d=function(){return Jg(c,this)})),a)if(b={values:s(ir),keys:i?d:s(Zs),entries:s(Js)},o)for(g in b)(Vr||f||!(g in l))&&Ra(l,g,b[g]);else Zg({target:t,proto:!0,forced:Vr||f},b);return l[ar]!==d&&Ra(l,ar,d,{name:a}),ty[t]=d,b},Co=function(e,t){return{value:e,done:t}},iy=Cr,Ao=Vp,Ys=jr,gf=Yt,oy=Ne.f,sy=mf,Zr=Co,cy=ae,yf="Array Iterator",uy=gf.set,ly=gf.getterFor(yf),fy=sy(Array,"Array",function(e,t){uy(this,{type:yf,target:iy(e),index:0,kind:t})},function(){var e=ly(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Zr(void 0,!0);switch(e.kind){case"keys":return Zr(r,!1);case"values":return Zr(t[r],!1)}return Zr([r,t[r]],!1)},"values"),Xs=Ys.Arguments=Ys.Array;Ao("keys");Ao("values");Ao("entries");if(cy&&Xs.name!=="values")try{oy(Xs,"name",{value:"values"})}catch{}var dy=Q,hy=G,vy=Vl,py=RangeError,qs=String.fromCharCode,Qs=String.fromCodePoint,my=hy([].join),gy=!!Qs&&Qs.length!==1;dy({target:"String",stat:!0,arity:1,forced:gy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],vy(i,1114111)!==i)throw new py(i+" is not a valid code point");r[a]=i<65536?qs(i):qs(((i-=65536)>>10)+55296,i%1024+56320)}return my(r,"")}});var ec=K,yy=ae,wy=Object.getOwnPropertyDescriptor,wf=function(e){if(!yy)return ec[e];var t=wy(ec,e);return t&&t.value},by=re,Sy=ne,$y=ae,tc=Zh,Iy=Sy("iterator"),Xn=!by(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),tc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(tc||!$y)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Iy]||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"}),rc=sf,Ty=Ne,qn=function(e,t,r){return r.get&&rc(r.get,t,{getter:!0}),r.set&&rc(r.set,t,{setter:!0}),Ty.f(e,t,r)},Py=Ie,Ey=function(e,t,r){for(var n in t)Py(e,n,t[n],r);return e},Oy=Zn,ky=TypeError,jo=function(e,t){if(Oy(t,e))return e;throw new ky("Incorrect invocation")},_y=zn,Ry=G,Cy=function(e){if(_y(e)==="Function")return Ry(e)},nc=Cy,Ay=Ae,jy=Hn,Ly=nc(nc.bind),qt=function(e,t){return Ay(e),t===void 0?e:jy?Ly(e,t):function(){return e.apply(t,arguments)}},Uy=ne,Ny=Uy("toStringTag"),bf={};bf[Ny]="z";var Lo=String(bf)==="[object z]",xy=Lo,Dy=J,yn=zn,My=ne,Fy=My("toStringTag"),By=Object,Hy=yn(function(){return arguments}())==="Arguments",zy=function(e,t){try{return e[t]}catch{}},Ur=xy?yn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=zy(t=By(e),Fy))=="string"?r:Hy?yn(t):(n=yn(t))==="Object"&&Dy(t.callee)?"Arguments":n},Gy=Ur,Ky=String,We=function(e){if(Gy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Ky(e)},Wy=Ur,ac=go,Vy=Gn,Zy=jr,Jy=ne,Yy=Jy("iterator"),Qn=function(e){if(!Vy(e))return ac(e,Yy)||ac(e,"@@iterator")||Zy[Wy(e)]},Xy=ie,qy=Ae,Qy=Ce,ew=Jn,tw=Qn,rw=TypeError,Uo=function(e,t){var r=arguments.length<2?tw(e):t;if(qy(r))return Qy(Xy(r,e));throw new rw(ew(e)+" is not iterable")},nw=TypeError,wt=function(e,t){if(e<t)throw new nw("Not enough arguments");return e},aw=G,ea=aw([].slice),ic=ea,iw=Math.floor,Mi=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=iw(r/2),s=Mi(ic(e,0,o),t),u=Mi(ic(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},ow=Mi,Fi=Q,Sf=K,No=wf,sw=$e,Jr=ie,_e=G,gr=ae,$f=Xn,If=Ie,cw=qn,uw=Ey,lw=Xt,fw=hf,xo=Yt,Tf=jo,Ca=J,dw=be,hw=qt,vw=Ur,pw=Ce,Pf=Se,se=We,mw=Yn,oc=gt,sc=Uo,gw=Qn,Yr=Co,$t=wt,yw=ne,ww=ow,bw=yw("iterator"),Qt="URLSearchParams",Ef=Qt+"Iterator",Of=xo.set,ye=xo.getterFor(Qt),Sw=xo.getterFor(Ef),cc=No("fetch"),kn=No("Request"),yr=No("Headers"),Aa=kn&&kn.prototype,uc=yr&&yr.prototype,$w=Sf.TypeError,Iw=Sf.encodeURIComponent,Tw=String.fromCharCode,Pw=sw("String","fromCodePoint"),Ew=parseInt,wn=_e("".charAt),lc=_e([].join),Ye=_e([].push),kf=_e("".replace),Ow=_e([].shift),fc=_e([].splice),dc=_e("".split),_f=_e("".slice),kw=_e(/./.exec),_w=/\+/g,ja="�",Rw=/^[0-9a-f]+$/i,hc=function(e,t){var r=_f(e,t,t+2);return kw(Rw,r)?Ew(r,16):NaN},Cw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Aw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},vc=function(e){e=kf(e,_w," ");for(var t=e.length,r="",n=0;n<t;){var a=wn(e,n);if(a==="%"){if(wn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=hc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=Cw(i);if(o===0)a=Tw(i);else{if(o===1||o>4){r+=ja,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||wn(e,n)!=="%"));){var f=hc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Ye(s,f),n+=2,u++}if(s.length!==o){r+=ja;continue}var l=Aw(s);l===null?r+=ja:a=Pw(l)}}r+=a,n++}return r},jw=/[!'()~]|%20/g,Lw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Uw=function(e){return Lw[e]},pc=function(e){return kf(Iw(e),jw,Uw)},La=fw(function(t,r){Of(this,{type:Ef,target:ye(t).entries,index:0,kind:r})},Qt,function(){var t=Sw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Yr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Yr(a.key,!1);case"values":return Yr(a.value,!1)}return Yr([a.key,a.value],!1)},!0),Rf=function(e){this.entries=[],this.url=null,e!==void 0&&(Pf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?wn(e,0)==="?"?_f(e,1):e:se(e)))};Rf.prototype={type:Qt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=gw(e),n,a,i,o,s,u,f;if(r)for(n=sc(e,r),a=n.next;!(i=Jr(a,n)).done;){if(o=sc(pw(i.value)),s=o.next,(u=Jr(s,o)).done||(f=Jr(s,o)).done||!Jr(s,o).done)throw new $w("Expected sequence with length 2");Ye(t,{key:se(u.value),value:se(f.value)})}else for(var l in e)dw(e,l)&&Ye(t,{key:l,value:se(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=dc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=dc(a,"="),Ye(t,{key:vc(Ow(i)),value:vc(lc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ye(t,pc(n.key)+"="+pc(n.value));return lc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ta=function(){Tf(this,Ft);var t=arguments.length>0?arguments[0]:void 0,r=Of(this,new Rf(t));gr||(this.size=r.entries.length)},Ft=ta.prototype;uw(Ft,{append:function(t,r){var n=ye(this);$t(arguments.length,2),Ye(n.entries,{key:se(t),value:se(r)}),gr||this.length++,n.updateURL()},delete:function(e){for(var t=ye(this),r=$t(arguments.length,1),n=t.entries,a=se(e),i=r<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(fc(n,s,1),o!==void 0)break}else s++}gr||(this.size=n.length),t.updateURL()},get:function(t){var r=ye(this).entries;$t(arguments.length,1);for(var n=se(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=ye(this).entries;$t(arguments.length,1);for(var n=se(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ye(a,r[i].value);return a},has:function(t){for(var r=ye(this).entries,n=$t(arguments.length,1),a=se(t),i=n<2?void 0:arguments[1],o=i===void 0?i:se(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=ye(this);$t(arguments.length,1);for(var a=n.entries,i=!1,o=se(t),s=se(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?fc(a,u--,1):(i=!0,f.value=s));i||Ye(a,{key:o,value:s}),gr||(this.size=a.length),n.updateURL()},sort:function(){var t=ye(this);ww(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=ye(this).entries,n=hw(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 La(this,"keys")},values:function(){return new La(this,"values")},entries:function(){return new La(this,"entries")}},{enumerable:!0});If(Ft,bw,Ft.entries,{name:"entries"});If(Ft,"toString",function(){return ye(this).serialize()},{enumerable:!0});gr&&cw(Ft,"size",{get:function(){return ye(this).entries.length},configurable:!0,enumerable:!0});lw(ta,Qt);Fi({global:!0,constructor:!0,forced:!$f},{URLSearchParams:ta});if(!$f&&Ca(yr)){var Nw=_e(uc.has),xw=_e(uc.set),mc=function(e){if(Pf(e)){var t=e.body,r;if(vw(t)===Qt)return r=e.headers?new yr(e.headers):new yr,Nw(r,"content-type")||xw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),mw(e,{body:oc(0,se(t)),headers:oc(0,r)})}return e};if(Ca(cc)&&Fi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return cc(t,arguments.length>1?mc(arguments[1]):{})}}),Ca(kn)){var Ua=function(t){return Tf(this,Aa),new kn(t,arguments.length>1?mc(arguments[1]):{})};Aa.constructor=Ua,Ua.prototype=Aa,Fi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ua})}}var Dw={URLSearchParams:ta,getState:ye},Mw=Ie,ra=G,gc=We,Fw=wt,Cf=URLSearchParams,na=Cf.prototype,Bw=ra(na.append),yc=ra(na.delete),Hw=ra(na.forEach),zw=ra([].push),Do=new Cf("a=1&a=2&b=3");Do.delete("a",1);Do.delete("b",void 0);Do+""!="a=2"&&Mw(na,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return yc(this,e);var n=[];Hw(this,function(c,d){zw(n,{key:d,value:c})}),Fw(t,1);for(var a=gc(e),i=gc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,yc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Bw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Gw=Ie,Af=G,Kw=We,Ww=wt,jf=URLSearchParams,Mo=jf.prototype,Vw=Af(Mo.getAll),Zw=Af(Mo.has),wc=new jf("a=1");(wc.has("a",2)||!wc.has("a",void 0))&&Gw(Mo,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Zw(this,t);var a=Vw(this,t);Ww(r,1);for(var i=Kw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Jw=ae,Yw=G,Xw=qn,Bi=URLSearchParams.prototype,qw=Yw(Bi.forEach);Jw&&!("size"in Bi)&&Xw(Bi,"size",{get:function(){var t=0;return qw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Qw=K,Fo=Qw,eb=Fo;eb.URLSearchParams;var Bo=G,tb=yo,rb=We,nb=Kn,ab=Bo("".charAt),bc=Bo("".charCodeAt),ib=Bo("".slice),Sc=function(e){return function(t,r){var n=rb(nb(t)),a=tb(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=bc(n,a),o<55296||o>56319||a+1===i||(s=bc(n,a+1))<56320||s>57343?e?ab(n,a):o:e?ib(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},Lf={codeAt:Sc(!1),charAt:Sc(!0)},ob=Lf.charAt,sb=We,Uf=Yt,cb=mf,$c=Co,Nf="String Iterator",ub=Uf.set,lb=Uf.getterFor(Nf);cb(String,"String",function(e){ub(this,{type:Nf,string:sb(e),index:0})},function(){var t=lb(this),r=t.string,n=t.index,a;return n>=r.length?$c(void 0,!0):(a=ob(r,n),t.index+=a.length,$c(a,!1))});var Ic=ae,fb=G,db=ie,hb=re,Na=Jl,vb=ko,pb=To,mb=Wn,gb=Ll,It=Object.assign,Tc=Object.defineProperty,yb=fb([].concat),wb=!It||hb(function(){if(Ic&&It({b:1},It(Tc({},"a",{enumerable:!0,get:function(){Tc(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}),It({},e)[r]!==7||Na(It({},t)).join("")!==n})?function(t,r){for(var n=mb(t),a=arguments.length,i=1,o=vb.f,s=pb.f;a>i;)for(var u=gb(arguments[i++]),f=o?yb(Na(u),o(u)):Na(u),l=f.length,c=0,d;l>c;)d=f[c++],(!Ic||db(s,u,d))&&(n[d]=u[d]);return n}:It,bb=ie,Pc=Ce,Sb=go,xf=function(e,t,r){var n,a;Pc(e);try{if(n=Sb(e,"return"),!n){if(t==="throw")throw r;return r}n=bb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Pc(n),r},$b=Ce,Ib=xf,Tb=function(e,t,r,n){try{return n?t($b(r)[0],r[1]):t(r)}catch(a){Ib(e,"throw",a)}},Pb=ne,Eb=jr,Ob=Pb("iterator"),kb=Array.prototype,Df=function(e){return e!==void 0&&(Eb.Array===e||kb[Ob]===e)},_b=G,Rb=re,Mf=J,Cb=Ur,Ab=$e,jb=Eo,Ff=function(){},Bf=Ab("Reflect","construct"),Ho=/^\s*(?:class|function)\b/,Lb=_b(Ho.exec),Ub=!Ho.test(Ff),or=function(t){if(!Mf(t))return!1;try{return Bf(Ff,[],t),!0}catch{return!1}},Hf=function(t){if(!Mf(t))return!1;switch(Cb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ub||!!Lb(Ho,jb(t))}catch{return!0}};Hf.sham=!0;var zf=!Bf||Rb(function(){var e;return or(or.call)||!or(Object)||!or(function(){e=!0})||e})?Hf:or,Nb=ae,xb=Ne,Db=gt,Mb=function(e,t,r){Nb?xb.f(e,t,Db(0,r)):e[t]=r},Fb=qt,Bb=ie,Hb=Wn,zb=Tb,Gb=Df,Kb=zf,Wb=wo,Ec=Mb,Vb=Uo,Zb=Qn,Oc=Array,Jb=function(t){var r=Hb(t),n=Kb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Fb(i,a>2?arguments[2]:void 0));var s=Zb(r),u=0,f,l,c,d,h,v;if(s&&!(this===Oc&&Gb(s)))for(l=n?new this:[],d=Vb(r,s),h=d.next;!(c=Bb(h,d)).done;u++)v=o?zb(d,i,[c.value,u],!0):c.value,Ec(l,u,v);else for(f=Wb(r),l=n?new this(f):Oc(f);f>u;u++)v=o?i(r[u],u):r[u],Ec(l,u,v);return l.length=u,l},bt=G,xa=2147483647,wr=36,Gf=1,Hi=26,Yb=38,Xb=700,qb=72,Qb=128,eS="-",tS=/[^\0-\u007E]/,Kf=/[.\u3002\uFF0E\uFF61]/g,kc="Overflow: input needs wider integers to process",Da=wr-Gf,_c=RangeError,rS=bt(Kf.exec),At=Math.floor,Ma=String.fromCharCode,Rc=bt("".charCodeAt),Wf=bt([].join),Xe=bt([].push),nS=bt("".replace),aS=bt("".split),iS=bt("".toLowerCase),oS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Rc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Rc(e,r++);(i&64512)===56320?Xe(t,((a&1023)<<10)+(i&1023)+65536):(Xe(t,a),r--)}else Xe(t,a)}return t},Cc=function(e){return e+22+75*(e<26)},sS=function(e,t,r){var n=0;for(e=r?At(e/Xb):e>>1,e+=At(e/t);e>Da*Hi>>1;)e=At(e/Da),n+=wr;return At(n+(Da+1)*e/(e+Yb))},cS=function(e){var t=[];e=oS(e);var r=e.length,n=Qb,a=0,i=qb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Xe(t,Ma(s));var u=t.length,f=u;for(u&&Xe(t,eS);f<r;){var l=xa;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>At((xa-a)/c))throw new _c(kc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>xa)throw new _c(kc);if(s===n){for(var d=a,h=wr;;){var v=h<=i?Gf:h>=i+Hi?Hi:h-i;if(d<v)break;var b=d-v,g=wr-v;Xe(t,Ma(Cc(v+b%g))),d=At(b/g),h+=wr}Xe(t,Ma(Cc(d))),i=sS(a,c,f===u),a=0,f++}}a++,n++}return Wf(t,"")},uS=function(e){var t=[],r=aS(nS(iS(e),Kf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Xe(t,rS(tS,a)?"xn--"+cS(a):a);return Wf(t,".")},lS=Q,zo=ae,fS=Xn,Go=K,Ac=qt,Te=G,_n=Ie,pe=qn,dS=jo,zi=be,Ko=wb,Tt=Jb,Pe=ea,hS=Lf.codeAt,vS=uS,Fe=We,pS=Xt,mS=wt,Vf=Dw,Zf=Yt,gS=Zf.set,Rn=Zf.getterFor("URL"),yS=Vf.URLSearchParams,wS=Vf.getState,sr=Go.URL,Gi=Go.TypeError,Cn=Go.parseInt,bS=Math.floor,jc=Math.pow,we=Te("".charAt),ke=Te(/./.exec),hr=Te([].join),SS=Te(1 .toString),$S=Te([].pop),kt=Te([].push),Fa=Te("".replace),IS=Te([].shift),TS=Te("".split),br=Te("".slice),An=Te("".toLowerCase),PS=Te([].unshift),ES="Invalid authority",Ba="Invalid scheme",rt="Invalid host",Lc="Invalid port",Jf=/[a-z]/i,OS=/[\d+-.a-z]/i,Ki=/\d/,kS=/^0x/i,_S=/^[0-7]+$/,RS=/^\d+$/,Yf=/^[\da-f]+$/i,CS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,AS=/[\0\t\n\r #/:<>?@[\\\]^|]/,jS=/^[\u0000-\u0020]+/,LS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,US=/[\t\n\r]/g,me,NS=function(e){var t=TS(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&&we(i,0)==="0"&&(o=ke(kS,i)?16:8,i=br(i,o===8?1:2)),i==="")s=0;else{if(!ke(o===10?RS:o===8?_S:Yf,i))return e;s=Cn(i,o)}kt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=jc(256,5-r))return null}else if(s>255)return null;for(u=$S(n),a=0;a<n.length;a++)u+=n[a]*jc(256,3-a);return u},xS=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 we(e,a)};if(d()===":"){if(we(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&&ke(Yf,d());)i=i*16+Cn(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(!ke(Ki,d()))return;for(;ke(Ki,d());){if(f=Cn(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},DS=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},cr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)PS(t,e%256),e=bS(e/256);return hr(t,".")}if(typeof e=="object"){for(t="",n=DS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=SS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},bn={},Xf=Ko({},bn,{" ":1,'"':1,"<":1,">":1,"`":1}),qf=Ko({},Xf,{"#":1,"?":1,"{":1,"}":1}),Ha=Ko({},qf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ve=function(e,t){var r=hS(e,0);return r>32&&r<127&&!zi(t,e)?e:encodeURIComponent(e)},Xr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},vr=function(e,t){var r;return e.length===2&&ke(Jf,we(e,0))&&((r=we(e,1))===":"||!t&&r==="|")},Uc=function(e){var t;return e.length>1&&vr(br(e,0,2))&&(e.length===2||(t=we(e,2))==="/"||t==="\\"||t==="?"||t==="#")},MS=function(e){return e==="."||An(e)==="%2e"},FS=function(e){return e=An(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},za={},Nc={},Ga={},xc={},Dc={},Ka={},Mc={},Fc={},qr={},Qr={},Wa={},Va={},Za={},Ja={},Bc={},Ya={},Pt={},Le={},Hc={},nt={},Me={},Wo=function(e,t,r){var n=Fe(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Gi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Wo(r,!0)),i=this.parse(n,null,a),i)throw new Gi(i);o=wS(new yS),o.bindURL(this),this.searchParams=o}};Wo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||za,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=Fe(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=Fa(e,jS,""),e=Fa(e,LS,"$1")),e=Fa(e,US,""),l=Tt(e);i<=l.length;){switch(c=l[i],a){case za:if(c&&ke(Jf,c))o+=An(c),a=Nc;else{if(t)return Ba;a=Ga;continue}break;case Nc:if(c&&(ke(OS,c)||c==="+"||c==="-"||c==="."))o+=An(c);else if(c===":"){if(t&&(n.isSpecial()!==zi(Xr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Xr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ja:n.isSpecial()&&r&&r.scheme===n.scheme?a=xc:n.isSpecial()?a=Fc:l[i+1]==="/"?(a=Dc,i++):(n.cannotBeABaseURL=!0,kt(n.path,""),a=Hc)}else{if(t)return Ba;o="",a=Ga,i=0;continue}break;case Ga:if(!r||r.cannotBeABaseURL&&c!=="#")return Ba;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Pe(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Me;break}a=r.scheme==="file"?Ja:Ka;continue;case xc:if(c==="/"&&l[i+1]==="/")a=qr,i++;else{a=Ka;continue}break;case Dc:if(c==="/"){a=Qr;break}else{a=Le;continue}case Ka:if(n.scheme=r.scheme,c===me)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Pe(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Mc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Pe(r.path),n.query="",a=nt;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Pe(r.path),n.query=r.query,n.fragment="",a=Me;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Pe(r.path),n.path.length--,a=Le;continue}break;case Mc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=qr;else if(c==="/")a=Qr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Le;continue}break;case Fc:if(a=qr,c!=="/"||we(o,i+1)!=="/")continue;i++;break;case qr:if(c!=="/"&&c!=="\\"){a=Qr;continue}break;case Qr:if(c==="@"){s&&(o="%40"+o),s=!0,d=Tt(o);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ve(b,Ha);f?n.password+=g:n.username+=g}o=""}else if(c===me||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return ES;i-=Tt(o).length+1,o="",a=Wa}else o+=c;break;case Wa:case Va:if(t&&n.scheme==="file"){a=Ya;continue}else if(c===":"&&!u){if(o==="")return rt;if(h=n.parseHost(o),h)return h;if(o="",a=Za,t===Va)return}else if(c===me||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return rt;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=Pt,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Za:if(ke(Ki,c))o+=c;else if(c===me||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=Cn(o,10);if(T>65535)return Lc;n.port=n.isSpecial()&&T===Xr[n.scheme]?null:T,o=""}if(t)return;a=Pt;continue}else return Lc;break;case Ja:if(n.scheme="file",c==="/"||c==="\\")a=Bc;else if(r&&r.scheme==="file")switch(c){case me:n.host=r.host,n.path=Pe(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Pe(r.path),n.query="",a=nt;break;case"#":n.host=r.host,n.path=Pe(r.path),n.query=r.query,n.fragment="",a=Me;break;default:Uc(hr(Pe(l,i),""))||(n.host=r.host,n.path=Pe(r.path),n.shortenPath()),a=Le;continue}else{a=Le;continue}break;case Bc:if(c==="/"||c==="\\"){a=Ya;break}r&&r.scheme==="file"&&!Uc(hr(Pe(l,i),""))&&(vr(r.path[0],!0)?kt(n.path,r.path[0]):n.host=r.host),a=Le;continue;case Ya:if(c===me||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&vr(o))a=Le;else if(o===""){if(n.host="",t)return;a=Pt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=Pt}continue}else o+=c;break;case Pt:if(n.isSpecial()){if(a=Le,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=nt;else if(!t&&c==="#")n.fragment="",a=Me;else if(c!==me&&(a=Le,c!=="/"))continue;break;case Le:if(c===me||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(FS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&kt(n.path,"")):MS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&kt(n.path,""):(n.scheme==="file"&&!n.path.length&&vr(o)&&(n.host&&(n.host=""),o=we(o,0)+":"),kt(n.path,o)),o="",n.scheme==="file"&&(c===me||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)IS(n.path);c==="?"?(n.query="",a=nt):c==="#"&&(n.fragment="",a=Me)}else o+=Ve(c,qf);break;case Hc:c==="?"?(n.query="",a=nt):c==="#"?(n.fragment="",a=Me):c!==me&&(n.path[0]+=Ve(c,bn));break;case nt:!t&&c==="#"?(n.fragment="",a=Me):c!==me&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ve(c,bn));break;case Me:c!==me&&(n.fragment+=Ve(c,Xf));break}i++}},parseHost:function(e){var t,r,n;if(we(e,0)==="["){if(we(e,e.length-1)!=="]"||(t=xS(br(e,1,-1)),!t))return rt;this.host=t}else if(this.isSpecial()){if(e=vS(e),ke(CS,e)||(t=NS(e),t===null))return rt;this.host=t}else{if(ke(AS,e))return rt;for(t="",r=Tt(e),n=0;n<r.length;n++)t+=Ve(r[n],bn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return zi(Xr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!vr(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+=cr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+hr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Gi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Bt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+cr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Fe(e)+":",za)},getUsername:function(){return this.username},setUsername:function(e){var t=Tt(Fe(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ve(t[r],Ha)}},getPassword:function(){return this.password},setPassword:function(e){var t=Tt(Fe(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ve(t[r],Ha)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?cr(e):cr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Wa)},getHostname:function(){var e=this.host;return e===null?"":cr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Va)},getPort:function(){var e=this.port;return e===null?"":Fe(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Fe(e),e===""?this.port=null:this.parse(e,Za))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+hr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Pt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Fe(e),e===""?this.query=null:(we(e,0)==="?"&&(e=br(e,1)),this.query="",this.parse(e,nt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Fe(e),e===""){this.fragment=null;return}we(e,0)==="#"&&(e=br(e,1)),this.fragment="",this.parse(e,Me)},update:function(){this.query=this.searchParams.serialize()||null}};var Bt=function(t){var r=dS(this,oe),n=mS(arguments.length,1)>1?arguments[1]:void 0,a=gS(r,new Wo(t,!1,n));zo||(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())},oe=Bt.prototype,ge=function(e,t){return{get:function(){return Rn(this)[e]()},set:t&&function(r){return Rn(this)[t](r)},configurable:!0,enumerable:!0}};zo&&(pe(oe,"href",ge("serialize","setHref")),pe(oe,"origin",ge("getOrigin")),pe(oe,"protocol",ge("getProtocol","setProtocol")),pe(oe,"username",ge("getUsername","setUsername")),pe(oe,"password",ge("getPassword","setPassword")),pe(oe,"host",ge("getHost","setHost")),pe(oe,"hostname",ge("getHostname","setHostname")),pe(oe,"port",ge("getPort","setPort")),pe(oe,"pathname",ge("getPathname","setPathname")),pe(oe,"search",ge("getSearch","setSearch")),pe(oe,"searchParams",ge("getSearchParams")),pe(oe,"hash",ge("getHash","setHash")));_n(oe,"toJSON",function(){return Rn(this).serialize()},{enumerable:!0});_n(oe,"toString",function(){return Rn(this).serialize()},{enumerable:!0});if(sr){var zc=sr.createObjectURL,Gc=sr.revokeObjectURL;zc&&_n(Bt,"createObjectURL",Ac(zc,sr)),Gc&&_n(Bt,"revokeObjectURL",Ac(Gc,sr))}pS(Bt,"URL");lS({global:!0,constructor:!0,forced:!fS,sham:!zo},{URL:Bt});var BS=Q,HS=$e,Qf=re,zS=wt,Kc=We,GS=Xn,Vo=HS("URL"),KS=GS&&Qf(function(){Vo.canParse()}),WS=Qf(function(){return Vo.canParse.length!==1});BS({target:"URL",stat:!0,forced:!KS||WS},{canParse:function(t){var r=zS(arguments.length,1),n=Kc(t),a=r<2||arguments[1]===void 0?void 0:Kc(arguments[1]);try{return!!new Vo(n,a)}catch{return!1}}});var VS=Q,ZS=$e,JS=wt,Wc=We,YS=Xn,XS=ZS("URL");VS({target:"URL",stat:!0,forced:!YS},{parse:function(t){var r=JS(arguments.length,1),n=Wc(t),a=r<2||arguments[1]===void 0?void 0:Wc(arguments[1]);try{return new XS(n,a)}catch{return null}}});var qS=Q,QS=ie;qS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return QS(URL.prototype.toString,this)}});var e$=Fo;e$.URL;var t$={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},r$=Vn,Xa=r$("span").classList,Vc=Xa&&Xa.constructor&&Xa.constructor.prototype,n$=Vc===Object.prototype?void 0:Vc,Zc=K,ed=t$,a$=n$,pr=fy,Jc=yt,i$=Xt,o$=ne,qa=o$("iterator"),Qa=pr.values,td=function(e,t){if(e){if(e[qa]!==Qa)try{Jc(e,qa,Qa)}catch{e[qa]=Qa}if(i$(e,t,!0),ed[t]){for(var r in pr)if(e[r]!==pr[r])try{Jc(e,r,pr[r])}catch{e[r]=pr[r]}}}};for(var ei in ed)td(Zc[ei]&&Zc[ei].prototype,ei);td(a$,"DOMTokenList");var s$=Se,c$=yt,u$=function(e,t){s$(t)&&"cause"in t&&c$(e,"cause",t.cause)},l$=G,rd=Error,f$=l$("".replace),d$=function(e){return String(new rd(e).stack)}("zxcasd"),nd=/\n\s*at [^:]*:[^\n]*/,h$=nd.test(d$),v$=function(e,t){if(h$&&typeof e=="string"&&!rd.prepareStackTrace)for(;t--;)e=f$(e,nd,"");return e},p$=re,m$=gt,g$=!p$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",m$(1,7)),e.stack!==7):!0}),y$=yt,w$=v$,b$=g$,Yc=Error.captureStackTrace,S$=function(e,t,r,n){b$&&(Yc?Yc(e,t):y$(e,"stack",w$(r,n)))},$$=qt,I$=ie,T$=Ce,P$=Jn,E$=Df,O$=wo,Xc=Zn,k$=Uo,_$=Qn,qc=xf,R$=TypeError,Sn=function(e,t){this.stopped=e,this.result=t},Qc=Sn.prototype,Nr=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=$$(t,n),f,l,c,d,h,v,b,g=function(I){return f&&qc(f,"normal",I),new Sn(!0,I)},T=function(I){return a?(T$(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=_$(e),!l)throw new R$(P$(e)+" is not iterable");if(E$(l)){for(c=0,d=O$(e);d>c;c++)if(h=T(e[c]),h&&Xc(Qc,h))return h;return new Sn(!1)}f=k$(e,l)}for(v=i?e.next:f.next;!(b=I$(v,f)).done;){try{h=T(b.value)}catch(I){qc(f,"throw",I)}if(typeof h=="object"&&h&&Xc(Qc,h))return h}return new Sn(!1)},C$=We,A$=function(e,t){return e===void 0?arguments.length<2?"":t:C$(e)},j$=Q,L$=Zn,U$=_o,jn=Ro,N$=uf,ad=Yn,ti=yt,ri=gt,x$=u$,D$=S$,M$=Nr,F$=A$,B$=ne,H$=B$("toStringTag"),Ln=Error,z$=[].push,Ht=function(t,r){var n=L$(ni,this),a;jn?a=jn(new Ln,n?U$(this):ni):(a=n?this:ad(ni),ti(a,H$,"Error")),r!==void 0&&ti(a,"message",F$(r)),D$(a,Ht,a.stack,1),arguments.length>2&&x$(a,arguments[2]);var i=[];return M$(t,z$,{that:i}),ti(a,"errors",i),a};jn?jn(Ht,Ln):N$(Ht,Ln,{name:!0});var ni=Ht.prototype=ad(Ln.prototype,{constructor:ri(1,Ht),message:ri(1,""),name:ri(1,"AggregateError")});j$({global:!0,constructor:!0,arity:2},{AggregateError:Ht});var G$=Lo,K$=Ur,W$=G$?{}.toString:function(){return"[object "+K$(this)+"]"},V$=Lo,Z$=Ie,J$=W$;V$||Z$(Object.prototype,"toString",J$,{unsafe:!0});var ur=K,Y$=Ar,X$=zn,en=function(e){return Y$.slice(0,e.length)===e},id=function(){return en("Bun/")?"BUN":en("Cloudflare-Workers")?"CLOUDFLARE":en("Deno/")?"DENO":en("Node.js/")?"NODE":ur.Bun&&typeof Bun.version=="string"?"BUN":ur.Deno&&typeof Deno.version=="object"?"DENO":X$(ur.process)==="process"?"NODE":ur.window&&ur.document?"BROWSER":"REST"}(),q$=id,Zo=q$==="NODE",Q$=$e,eI=qn,tI=ne,rI=ae,eu=tI("species"),nI=function(e){var t=Q$(e);rI&&t&&!t[eu]&&eI(t,eu,{configurable:!0,get:function(){return this}})},aI=zf,iI=Jn,oI=TypeError,sI=function(e){if(aI(e))return e;throw new oI(iI(e)+" is not a constructor")},tu=Ce,cI=sI,uI=Gn,lI=ne,fI=lI("species"),od=function(e,t){var r=tu(e).constructor,n;return r===void 0||uI(n=tu(r)[fI])?t:cI(n)},dI=Hn,sd=Function.prototype,ru=sd.apply,nu=sd.call,cd=typeof Reflect=="object"&&Reflect.apply||(dI?nu.bind(ru):function(){return nu.apply(ru,arguments)}),hI=Ar,ud=/(?:ipad|iphone|ipod).*applewebkit/i.test(hI),fe=K,vI=cd,pI=qt,au=J,mI=be,ld=re,iu=Yl,gI=ea,ou=Vn,yI=wt,wI=ud,bI=Zo,Wi=fe.setImmediate,Vi=fe.clearImmediate,SI=fe.process,ai=fe.Dispatch,$I=fe.Function,su=fe.MessageChannel,II=fe.String,ii=0,Sr={},cu="onreadystatechange",kr,at,oi,si;ld(function(){kr=fe.location});var Jo=function(e){if(mI(Sr,e)){var t=Sr[e];delete Sr[e],t()}},ci=function(e){return function(){Jo(e)}},uu=function(e){Jo(e.data)},lu=function(e){fe.postMessage(II(e),kr.protocol+"//"+kr.host)};(!Wi||!Vi)&&(Wi=function(t){yI(arguments.length,1);var r=au(t)?t:$I(t),n=gI(arguments,1);return Sr[++ii]=function(){vI(r,void 0,n)},at(ii),ii},Vi=function(t){delete Sr[t]},bI?at=function(e){SI.nextTick(ci(e))}:ai&&ai.now?at=function(e){ai.now(ci(e))}:su&&!wI?(oi=new su,si=oi.port2,oi.port1.onmessage=uu,at=pI(si.postMessage,si)):fe.addEventListener&&au(fe.postMessage)&&!fe.importScripts&&kr&&kr.protocol!=="file:"&&!ld(lu)?(at=lu,fe.addEventListener("message",uu,!1)):cu in ou("script")?at=function(e){iu.appendChild(ou("script"))[cu]=function(){iu.removeChild(this),Jo(e)}}:at=function(e){setTimeout(ci(e),0)});var fd={set:Wi,clear:Vi},dd=function(){this.head=null,this.tail=null};dd.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 hd=dd,TI=Ar,PI=/ipad|iphone|ipod/i.test(TI)&&typeof Pebble<"u",EI=Ar,OI=/web0s(?!.*chrome)/i.test(EI),zt=K,kI=wf,fu=qt,ui=fd.set,_I=hd,RI=ud,CI=PI,AI=OI,li=Zo,du=zt.MutationObserver||zt.WebKitMutationObserver,hu=zt.document,vu=zt.process,tn=zt.Promise,Zi=kI("queueMicrotask"),Et,fi,di,rn,pu;if(!Zi){var nn=new _I,an=function(){var e,t;for(li&&(e=vu.domain)&&e.exit();t=nn.get();)try{t()}catch(r){throw nn.head&&Et(),r}e&&e.enter()};!RI&&!li&&!AI&&du&&hu?(fi=!0,di=hu.createTextNode(""),new du(an).observe(di,{characterData:!0}),Et=function(){di.data=fi=!fi}):!CI&&tn&&tn.resolve?(rn=tn.resolve(void 0),rn.constructor=tn,pu=fu(rn.then,rn),Et=function(){pu(an)}):li?Et=function(){vu.nextTick(an)}:(ui=fu(ui,zt),Et=function(){ui(an)}),Zi=function(e){nn.head||Et(),nn.add(e)}}var jI=Zi,LI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},er=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},UI=K,xr=UI.Promise,NI=K,$r=xr,xI=J,DI=lf,MI=Eo,FI=ne,mu=id,hi=Ml;$r&&$r.prototype;var BI=FI("species"),Ji=!1,vd=xI(NI.PromiseRejectionEvent),HI=DI("Promise",function(){var e=MI($r),t=e!==String($r);if(!t&&hi===66)return!0;if(!hi||hi<51||!/native code/.test(e)){var r=new $r(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[BI]=n,Ji=r.then(function(){})instanceof n,!Ji)return!0}return!t&&(mu==="BROWSER"||mu==="DENO")&&!vd}),Dr={CONSTRUCTOR:HI,REJECTION_EVENT:vd,SUBCLASSING:Ji},xe={},gu=Ae,zI=TypeError,GI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new zI("Bad Promise constructor");t=n,r=a}),this.resolve=gu(t),this.reject=gu(r)};xe.f=function(e){return new GI(e)};var KI=Q,Un=Zo,et=K,Gt=ie,yu=Ie,wu=Ro,WI=Xt,VI=nI,ZI=Ae,$n=J,JI=Se,YI=jo,XI=od,pd=fd.set,Yo=jI,qI=LI,QI=er,e0=hd,md=Yt,Nn=xr,Xo=Dr,gd=xe,aa="Promise",yd=Xo.CONSTRUCTOR,t0=Xo.REJECTION_EVENT,r0=Xo.SUBCLASSING,vi=md.getterFor(aa),n0=md.set,_t=Nn&&Nn.prototype,ot=Nn,on=_t,wd=et.TypeError,Yi=et.document,qo=et.process,Xi=gd.f,a0=Xi,i0=!!(Yi&&Yi.createEvent&&et.dispatchEvent),bd="unhandledrejection",o0="rejectionhandled",bu=0,Sd=1,s0=2,Qo=1,$d=2,sn,Su,c0,$u,Id=function(e){var t;return JI(e)&&$n(t=e.then)?t:!1},Td=function(e,t){var r=t.value,n=t.state===Sd,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===$d&&l0(t),t.rejection=Qo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new wd("Promise-chain cycle")):(f=Id(u))?Gt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Pd=function(e,t){e.notified||(e.notified=!0,Yo(function(){for(var r=e.reactions,n;n=r.get();)Td(n,e);e.notified=!1,t&&!e.rejection&&u0(e)}))},Ed=function(e,t,r){var n,a;i0?(n=Yi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),et.dispatchEvent(n)):n={promise:t,reason:r},!t0&&(a=et["on"+e])?a(n):e===bd&&qI("Unhandled promise rejection",r)},u0=function(e){Gt(pd,et,function(){var t=e.facade,r=e.value,n=Iu(e),a;if(n&&(a=QI(function(){Un?qo.emit("unhandledRejection",r,t):Ed(bd,t,r)}),e.rejection=Un||Iu(e)?$d:Qo,a.error))throw a.value})},Iu=function(e){return e.rejection!==Qo&&!e.parent},l0=function(e){Gt(pd,et,function(){var t=e.facade;Un?qo.emit("rejectionHandled",t):Ed(o0,t,e.value)})},jt=function(e,t,r){return function(n){e(t,n,r)}},Nt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=s0,Pd(e,!0))},qi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new wd("Promise can't be resolved itself");var n=Id(t);n?Yo(function(){var a={done:!1};try{Gt(n,t,jt(qi,a,e),jt(Nt,a,e))}catch(i){Nt(a,i,e)}}):(e.value=t,e.state=Sd,Pd(e,!1))}catch(a){Nt({done:!1},a,e)}}};if(yd&&(ot=function(t){YI(this,on),ZI(t),Gt(sn,this);var r=vi(this);try{t(jt(qi,r),jt(Nt,r))}catch(n){Nt(r,n)}},on=ot.prototype,sn=function(t){n0(this,{type:aa,done:!1,notified:!1,parent:!1,reactions:new e0,rejection:!1,state:bu,value:null})},sn.prototype=yu(on,"then",function(t,r){var n=vi(this),a=Xi(XI(this,ot));return n.parent=!0,a.ok=$n(t)?t:!0,a.fail=$n(r)&&r,a.domain=Un?qo.domain:void 0,n.state===bu?n.reactions.add(a):Yo(function(){Td(a,n)}),a.promise}),Su=function(){var e=new sn,t=vi(e);this.promise=e,this.resolve=jt(qi,t),this.reject=jt(Nt,t)},gd.f=Xi=function(e){return e===ot||e===c0?new Su(e):a0(e)},$n(Nn)&&_t!==Object.prototype)){$u=_t.then,r0||yu(_t,"then",function(t,r){var n=this;return new ot(function(a,i){Gt($u,n,a,i)}).then(t,r)},{unsafe:!0});try{delete _t.constructor}catch{}wu&&wu(_t,on)}KI({global:!0,constructor:!0,wrap:!0,forced:yd},{Promise:ot});WI(ot,aa,!1);VI(aa);var f0=ne,Od=f0("iterator"),kd=!1;try{var d0=0,Tu={next:function(){return{done:!!d0++}},return:function(){kd=!0}};Tu[Od]=function(){return this},Array.from(Tu,function(){throw 2})}catch{}var h0=function(e,t){try{if(!t&&!kd)return!1}catch{return!1}var r=!1;try{var n={};n[Od]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},v0=xr,p0=h0,m0=Dr.CONSTRUCTOR,ia=m0||!p0(function(e){v0.all(e).then(void 0,function(){})}),g0=Q,y0=ie,w0=Ae,b0=xe,S0=er,$0=Nr,I0=ia;g0({target:"Promise",stat:!0,forced:I0},{all:function(t){var r=this,n=b0.f(r),a=n.resolve,i=n.reject,o=S0(function(){var s=w0(r.resolve),u=[],f=0,l=1;$0(t,function(c){var d=f++,h=!1;l++,y0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var T0=Q,P0=Dr.CONSTRUCTOR,Qi=xr,E0=$e,O0=J,k0=Ie,Pu=Qi&&Qi.prototype;T0({target:"Promise",proto:!0,forced:P0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(O0(Qi)){var Eu=E0("Promise").prototype.catch;Pu.catch!==Eu&&k0(Pu,"catch",Eu,{unsafe:!0})}var _0=Q,R0=ie,C0=Ae,A0=xe,j0=er,L0=Nr,U0=ia;_0({target:"Promise",stat:!0,forced:U0},{race:function(t){var r=this,n=A0.f(r),a=n.reject,i=j0(function(){var o=C0(r.resolve);L0(t,function(s){R0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var N0=Q,x0=xe,D0=Dr.CONSTRUCTOR;N0({target:"Promise",stat:!0,forced:D0},{reject:function(t){var r=x0.f(this),n=r.reject;return n(t),r.promise}});var M0=Ce,F0=Se,B0=xe,_d=function(e,t){if(M0(e),F0(t)&&t.constructor===e)return t;var r=B0.f(e),n=r.resolve;return n(t),r.promise},H0=Q,z0=$e,G0=Dr.CONSTRUCTOR,K0=_d;z0("Promise");H0({target:"Promise",stat:!0,forced:G0},{resolve:function(t){return K0(this,t)}});var W0=Q,V0=ie,Z0=Ae,J0=xe,Y0=er,X0=Nr,q0=ia;W0({target:"Promise",stat:!0,forced:q0},{allSettled:function(t){var r=this,n=J0.f(r),a=n.resolve,i=n.reject,o=Y0(function(){var s=Z0(r.resolve),u=[],f=0,l=1;X0(t,function(c){var d=f++,h=!1;l++,V0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var Q0=Q,eT=ie,tT=Ae,rT=$e,nT=xe,aT=er,iT=Nr,oT=ia,Ou="No one promise resolved";Q0({target:"Promise",stat:!0,forced:oT},{any:function(t){var r=this,n=rT("AggregateError"),a=nT.f(r),i=a.resolve,o=a.reject,s=aT(function(){var u=tT(r.resolve),f=[],l=0,c=1,d=!1;iT(t,function(h){var v=l++,b=!1;c++,eT(u,r,h).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[v]=g,--c||o(new n(f,Ou)))})}),--c||o(new n(f,Ou))});return s.error&&o(s.value),a.promise}});var sT=Q,cT=xe;sT({target:"Promise",stat:!0},{withResolvers:function(){var t=cT.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var uT=Q,xn=xr,lT=re,Rd=$e,Cd=J,fT=od,ku=_d,dT=Ie,eo=xn&&xn.prototype,hT=!!xn&&lT(function(){eo.finally.call({then:function(){}},function(){})});uT({target:"Promise",proto:!0,real:!0,forced:hT},{finally:function(e){var t=fT(this,Rd("Promise")),r=Cd(e);return this.then(r?function(n){return ku(t,e()).then(function(){return n})}:e,r?function(n){return ku(t,e()).then(function(){throw n})}:e)}});if(Cd(xn)){var _u=Rd("Promise").prototype.finally;eo.finally!==_u&&dT(eo,"finally",_u,{unsafe:!0})}var vT=Fo;vT.Promise;var pT=Q,mT=K,gT=cd,yT=ea,wT=xe,bT=Ae,Ad=er,pi=mT.Promise,Ru=!1,ST=!pi||!pi.try||Ad(function(){pi.try(function(e){Ru=e===8},8)}).error||!Ru;pT({target:"Promise",stat:!0,forced:ST},{try:function(e){var t=arguments.length>1?yT(arguments,1):[],r=wT.f(this),n=Ad(function(){return gT(bT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const jd="sesamy-debug";function $T(e,t,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${t}; ${a}; path=/`}function IT(e){const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null}function TT(e){$T(jd,e.toString(),1)}function PT(){return IT(jd)==="true"}function Re(e){PT()&&console.log(e)}function Ke(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});Re(`Triggering event: ${e}`),dispatchEvent(r)}function Ue(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 st=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function es(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ts(e,t){return e(t={exports:{}},t.exports),t.exports}var it=ts(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()}});es(it);var ET=es(ts(function(e,t){var r=st&&st.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{I(h.next(y))}catch(p){b(p)}}function T(y){try{I(h.throw(y))}catch(p){b(p)}}function I(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=st&&st.__generator||function(l,c){var d,h,v,b,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function T(I){return function(y){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch(S){p=[6,S],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,y])}}},a=st;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,b,g,T,I,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(b))!==null&&(y=JSON.parse(I)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var b,g,T;return n(this,function(I){switch(I.label){case 0:return[4,it.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(it.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(T)),it.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(it.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,b=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,it.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),it.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],b=0;;){var g=h.keySync(b);if(g===null)break;v.push(g),b++}for(var T=!1,I=0;I<v.length;I++){var y=v[I];if(y.includes(i)){var p=h.getItemSync(y);if(p!==null){var S=JSON.parse(p);(S.timeRefreshed===void 0&&S.timeAcquired<d||S.timeRefreshed!==void 0&&S.timeRefreshed<d)&&(h.removeItemSync(y),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const OT={timeoutInSeconds:60},Ld={name:"auth0-spa-js",version:"2.1.3"},Ud=()=>Date.now();let le=class to extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,to.prototype)}static fromPayload({error:t,error_description:r}){return new to(t,r)}},kT=class Nd extends le{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Nd.prototype)}},ro=class xd extends le{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,xd.prototype)}},_T=class Dd extends ro{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Dd.prototype)}},RT=class Md extends le{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Md.prototype)}},CT=class Fd extends le{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Fd.prototype)}},Bd=class Hd extends le{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Cu(t,["default"])}', scope: '${Cu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Hd.prototype)}};function Cu(e,t=[]){return e&&!t.includes(e)?e:""}const In=()=>window.crypto,mi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(In().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Au=e=>btoa(e),no=e=>{var{clientId:t}=e,r=Ue(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()},ju=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),AT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},jT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([AT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},LT=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},UT=async(e,t,r,n,a,i,o=1e4)=>a?LT(e,t,r,n,o,a,i):jT(e,n,o);async function NT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Ue(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?no(u):JSON.stringify(u);return await async function(l,c,d,h,v,b,g){let T,I=null;for(let k=0;k<3;k++)try{T=await UT(l,d,h,v,b,g,c),I=null;break}catch(M){I=M}if(I)throw I;const y=T.json,{error:p,error_description:S}=y,O=Ue(y,["error","error_description"]),{ok:_}=T;if(!_){const k=S||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new CT(p,k,O.mfa_token):p==="missing_refresh_token"?new Bd(d,h):new le(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Ld))}},t,s)}const cn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ut=class ao{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 ao({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new ao({scope:r,audience:n,clientId:a})}},xT=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@@"))}},zd=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)}}()}},DT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Ud}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 ut({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 ut({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=ut.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]}},MT=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 lr=e=>typeof e=="number",FT=["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"],BT=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(ju(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],FT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(ju(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&&!lr(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||!lr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!lr(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&&lr(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&&lr(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 lt=ts(function(e,t){var r=st&&st.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});es(lt),lt.encode,lt.parse,lt.getAll;var HT=lt.get,Gd=lt.set,Kd=lt.remove;const Rt={get(e){const t=HT(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),Gd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Kd(e,r)}},zT={get(e){return Rt.get(e)||Rt.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),Gd(`_legacy_${e}`,JSON.stringify(t),n),Rt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Kd(e,r),Rt.remove(e,t),Rt.remove(`_legacy_${e}`,t)}},GT={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 KT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
+
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Lu,Uu,Nu,gi,WT=(Lu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Uu=null,Nu=!1,function(e){return gi=gi||KT(Lu,Uu,Nu),new Worker(gi,e)});const yi={};let VT=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 ZT={memory:()=>new zd().enclosedCache,localstorage:()=>new xT},xu=e=>ZT[e],Du=e=>{const{openUrl:t,onRedirect:r}=e,n=Ue(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},wi=new ET;let JT=class{constructor(t){let r,n;if(this.userCache=new zd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await wi.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(!In())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(In().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",!ju(r))throw new Error(`Invalid cache location "${r}"`);n=ju(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?_t:LT,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:UT;var i;this.scope=sn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new RT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||_d,this.cacheManager=new _T(n,n.allKeys?void 0:new DT(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 xT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||kd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${to(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return AT({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=ku(vi()),i=ku(vi()),o=vi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await $n().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:sn(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new ST(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new bT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(ue.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ue("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Lu(t),{openUrl:a,fragment:i,appState:o}=n,s=je(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=je(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ue("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new wT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ue("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:sn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=mi[o];return s||(s=i().finally(()=>{delete mi[o],s=null}),mi[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=je(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>gi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new eo;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 gi.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:sn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},yT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new ct({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=je(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${to(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Lu(t),{openUrl:n}=r,a=je(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ue("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((v,S,g=60)=>new Promise((T,I)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const p=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",$,!1))};let $;const O=setTimeout(()=>{I(new eo),p()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(ue.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",$,!1),setTimeout(p,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(w),w.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new ue("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new ct({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 Ud(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=je(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new ct({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 ct({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 OT(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 BT(e){const t=new FT(e);return await t.checkSession(),t}var de=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(de||{});const HT="sesamy.com",zT="sesamy.dev",GT="https://sesa.my",no="sesamyCacheTimestamp";function Be(e,t){return`https://${e}.${t==="dev"?zT:HT}`}function ao(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let fe,Fd,io=!1,Uu=!1;const Gt="sesamyAccessToken",yi="sesamyRefreshToken";async function Dr(){return io?!0:new Promise((e,t)=>{const r=setTimeout(()=>{io?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(de.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function KT(e){if(!e)return null;const t=localStorage.getItem(yi);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(yi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(yi,i.refresh_token),localStorage.setItem(Gt,i.access_token),i.access_token}catch{Bd()}}async function Qo(){const e=localStorage.getItem(Gt);if(!e)return null;const t=Hd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await KT(t);if(r)return r;localStorage.removeItem(Gt)}return e}function Nu(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 WT(e){if(e.enabled===!1)return;Fd=e.organization;const t={domain:Be("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Nu(window.location.href)!==Nu(Be("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),fe=await BT(t),window.location.search.includes("code="))try{await fe.handleRedirectCallback();const r=await fe.getUser();if(!r)throw new Error("No user found");Ge(de.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){alert("There was an error logging in"),console.error(r)}io=!0,Ge(de.AUTH_INITIALIZED,{})}async function kr(){return await Dr(),await Qo()?!0:fe?fe.isAuthenticated():!1}async function VT(){return await Dr(),await Qo()?(Le("Using local user"),{sub:"local",name:"Local User"}):fe?fe.getUser():null}async function es(e){if(Uu){Le("Login already in progress");return}if(Uu=!0,await Dr(),localStorage.removeItem(Gt),!fe)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return fe.loginWithRedirect({...e,authorizationParams:{organization:Fd,redirect_uri:window.location.href,ui_locales:ao(),...t}})}async function lr(e=!0){await Dr();const t=await Qo();if(t)return t;try{return fe?await fe.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Bd(e={}){if(await Dr(),localStorage.removeItem(Gt),Ge(de.LOGOUT,{}),!!fe)return fe.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Hd(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 zd(e){const t=Hd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Gt,e),Ge(de.AUTHENTICATED,t)}const ZT=(e,t)=>t.skipDedupe||t.method!=="GET",JT=(e,t)=>t.method+"@"+e,YT=e=>e.clone(),xu=({skip:e=ZT,key:t=JT,resolver:r=YT}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},XT=(e,t)=>e*t,qT=e=>e&&e.ok,Du=({delayTimer:e=500,delayRamp:t=XT,maxAttempts:r=10,until:n=qT,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(S=>S?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var w,p;g(u((w=I&&I.url)!==null&&w!==void 0?w:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},QT="application/json",Gd="Content-Type",Et=Symbol(),Kd=Symbol();function Mu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Gd.toLowerCase()))===null||t===void 0?void 0:t[1]}function Fu(e){return/^application\/.*json.*/.test(e)}const lt=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]=lt(o,i,r):n[a]=i,n},{...e})},Kt={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 eP(e,t=!1){Kt.options=t?e:lt(Kt.options,e)}function tP(e,t=!1){Kt.polyfills=t?e:lt(Kt.polyfills,e)}function rP(e){Kt.errorType=e}const nP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Wd extends Error{}const aP=e=>{const t=Object.create(null);e=e._addons.reduce((w,p)=>p.beforeRequest&&p.beforeRequest(w,e._options,t)||w,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=lt(a.options,n);let c=r;const d=nP(s)((w,p)=>(c=w,a.polyfill("fetch")(w,p)))(r,l),h=new Error,v=d.catch(w=>{throw{[Et]:w}}).then(w=>{var p;if(!w.ok){const $=new Wd;if($.cause=h,$.stack=$.stack+`
|
|
5
|
-
CAUSE: `+h.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw $;const O=a.errorType==="json"||((p=w.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?w.text():w[a.errorType]():Promise.resolve(w.body)).then(k=>{throw $.message=typeof k=="string"?k:w.statusText,k&&(O&&typeof k=="string"?($.text=k,$.json=JSON.parse(k)):$[a.errorType]=k),$})}return w}),S=w=>w.catch(p=>{const $=Object.prototype.hasOwnProperty.call(p,Et),O=$?p[Et]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||$&&f.has(Et)&&f.get(Et);if(_)return _(O,e);const k=f.get(Kd);if(k)return k(O,e);throw O}),g=w=>p=>S(w?v.then($=>$&&$[w]()).then($=>p?p($):$):v.then($=>p?p($):$)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(w,p){return f.set(w,p),this},badRequest(w){return this.error(400,w)},unauthorized(w){return this.error(401,w)},forbidden(w){return this.error(403,w)},notFound(w){return this.error(404,w)},timeout(w){return this.error(408,w)},internalError(w){return this.error(500,w)},fetchError(w){return this.error(Et,w)}},I=u.reduce((w,p)=>({...w,...typeof p.resolver=="function"?p.resolver(w):p.resolver}),T);return o.reduce((w,p)=>p(w,e),I)},iP={_url:"",_options:{},_config:Kt,_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:lt(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:lt(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:lt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Gd]: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(Kd,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=Mu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Fu(a));return n=r?o?n.json(r,a):n.body(r):n,aP(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=Mu(this._options.headers);return this.content(t||Fu(r)&&r||QT).body(JSON.stringify(e))}};function ze(e="",t={}){return{...iP,_url:e,_options:t}}ze.default=ze;ze.options=eP;ze.errorType=rP;ze.polyfills=tP;ze.WretchError=Wd;function Pe(){sessionStorage.removeItem(no),console.log("Cache cleared"),Ge(de.CLEAR_CACHE,{})}function oP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function sP(e,t){if(oP(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function cP(e,t){const r=new URL(`${Be("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=sP(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("itemSrc",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const Vd="sesamySignedURLs";function ts(){const e=sessionStorage.getItem(Vd);return e?JSON.parse(e):[]}function uP(e){const t=ts();t.push(e),Le(`Adding signed URL: ${e}`),sessionStorage.setItem(Vd,JSON.stringify(t))}function lP(e){const t=Be("api2",e.environment),r=y=>async(P,j)=>{let V=sessionStorage.getItem(no);V||(V=Date.now().toString(),sessionStorage.setItem(no,V));const oe={...j,headers:{...j.headers,"Cache-Timestamp":V}};return y(P,oe)},n=(y=!0)=>P=>async(j,V)=>{let oe=null;if(oe=await lr(y),!oe){if(y)throw new Error("No access token available");return P(j,V)}const et={...V,headers:{...V.headers,...oe?{Authorization:`Bearer ${oe}`}:{}}};return P(j,et)},a=y=>(P,j)=>{if(j.headers.Authorization)return y(P,j);const V=localStorage.getItem("__anon_id"),oe=btoa(`${V}:`),et={...j,headers:{...j.headers,Authorization:`Basic ${oe}`}};return y(P,et)},i=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),xu(),Du({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]),o=ze(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,xu(),Du({delayTimer:1e3,delayRamp:(y,P)=>y*P,maxAttempts:3,until:y=>!!(y&&(y.ok||y.status>=400&&y.status<500)),retryOnNetworkError:!1})]);async function s(y={}){const{waitForEntitlementAfter:P,includeSignedLinks:j=!0}=y,V=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",oe=await kr()?await i.get(`/entitlements${V}`).json():[];return j&&oe.push(...ts()),oe}async function u(y){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(j=>j.id===y)}async function f(y){return i.get(`/entitlements/${encodeURIComponent(y)}/access`).json()}async function l(y){return await kr()?await i.get(`/fulfillments?sku=${encodeURIComponent(y)}`).json():[]}async function c(){return i.get("/contracts").json()}async function d(y){const P=await i.get("/contracts").json();return P==null?void 0:P.find(j=>j.id===y)}async function h(y){return(await i.post({},`/contracts/${encodeURIComponent(y)}/cancel`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function S(){return i.get("/bills").json()}async function g(y){const P=await i.get("/bills").json();return P==null?void 0:P.find(j=>j.id===y)}async function T(){return i.get("/transactions").json()}async function I(y){const P=await i.get("/transactions").json();return P==null?void 0:P.find(j=>j.id===y)}async function w(y,P){const j=await i.url(`/user-metadata/${encodeURIComponent(y)}`).put(P).json();return Ge(de.USER_ATTRIBUTE_CHANGED,{}),Pe(),j}async function p(y){const P=await i.url(`/user-metadata/${encodeURIComponent(y)}`).delete().res();return Pe(),P.ok}async function $(y){return(await i.url(`/user-metadata/${encodeURIComponent(y)}`).get().json())[y]}async function O(){return await i.url("/user-metadata").get().json()}async function _(){return await i.url("/tags").get().json()}async function k(y){const P=await i.url(`/tags/${encodeURIComponent(y)}`).delete().res();return Pe(),P.ok}async function M(y){const P=await i.url("/tags").post(encodeURIComponent(y)).res();return Ge(de.USER_ATTRIBUTE_CHANGED,{}),Pe(),P.ok}async function F(y){return(await o.url("/tallies").get().json())[y]}async function J(){return await o.url("/tallies").get().json()}async function L(y){const P=await o.url(`/tallies/${y}`).delete().res();return Pe(),P.ok}async function x(y,P){return await o.url(`/tallies/${encodeURIComponent(y)}/push`).post(P).json()}async function H(y){return await i.url(`/products/${encodeURIComponent(y)}`).get().json()}async function R(){return await lr(!1)?await i.url("/profile").get().json():null}async function K(y){const P=await i.url("/profile").patch(y).res();return Pe(),P.ok}async function q(){return await i.url("/payment-issues").get().json()}async function xe(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function m(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function b(y){const P=await lr(!1);if(!P)throw new Error("No access token available");const j=new URL(`${Be("spotify-oas",e.environment)}/sesamy-callback`);j.searchParams.set("access_token",P),j.searchParams.set("state",y),window.location.href=j.toString()}async function E(y){const P=await i.url(`/products/${encodeURIComponent(y)}/auto-onboard`).post().json();return P.length&&Pe(),P}async function U(y,P=3600){const{shortlink:j}=await ze(GT).post({url:y,ttl:P}).json();return j}async function N(y){const P=await lr(!1);let j;const V=y.language||ao();switch(y.target){case"account":j=new URL(`${Be("account",e.environment)}/${encodeURIComponent(y.language||V)}/subscriptions/${encodeURIComponent(e.clientId)}`),j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"consume":j=new URL(`${Be("consume",e.environment)}/${encodeURIComponent(y.language||V)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(y.sku)}`),y.episodeId?j.href+=`/${y.episodeId}`:j.href+="/listen",j.searchParams.set("sesamy-redirect-url",y.redirectUrl||window.location.href);break;case"checkout":j=cP(e,{language:V,...y});break;default:throw new Error("Invalid target")}return P&&(j.hash=`#access_token=${P}`),y.shorten?U(j.href,y.ttl):j.href}async function D(y){return(await o.url("/checkouts").post({language:ao(),...y,vendorId:e.clientId})).json()}async function Y(y,P){return(await o.url(`/checkouts/${y}`).patch(P)).json()}async function B(y){return(await o.url(`/checkouts/${y}`).get()).json()}async function W(){const y=await lr(!1),P=new URL(`${Be("account",e.environment)}/subscriptions/${e.clientId}`);y&&(P.hash=`#access_token=${y}`),window.location.href=P.toString()}return{createCheckout:D,updateCheckout:Y,getCheckout:B,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getFulfillments:l,getContracts:c,getContract:d,cancelContract:h,getProfile:R,updateProfile:K,getSubscriptions:v,getBills:S,getBill:g,setUserMetadata:w,deleteUserMetadata:p,getUserMetadata:$,listUserMetadata:O,getTags:_,deleteTag:k,setTag:M,getTally:F,getTallies:J,deleteTally:L,pushTally:x,getTransactions:T,getTransaction:I,getProduct:H,getPaymentIssues:q,autoOnboardProduct:E,isSpotifyLinked:xe,unlinkSpotify:m,linkSpotify:b,generateLink:N,openHostedAccountPage:W}}const Zd="@sesamy/sesamy-js",rs="1.19.1";function Bu(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 cn="undefined",Hu="object",oo=function(){},Jd="any",Yd="*",ht="__",xn=typeof process<"u"?process:{};xn.env&&xn.env.NODE_ENV;var Q=typeof document<"u";xn.versions!=null&&xn.versions.node!=null;typeof Deno<"u"&&Deno.core;Q&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Xd(e,t){return t.charAt(0)[e]()+t.slice(1)}var fP=Xd.bind(null,"toUpperCase"),dP=Xd.bind(null,"toLowerCase");function hP(e){return qd(e)?fP("null"):typeof e=="object"?gP(e):Object.prototype.toString.call(e).slice(8,-1)}function Dn(e,t){t===void 0&&(t=!0);var r=hP(e);return t?dP(r):r}function Mr(e,t){return typeof t===e}var ce=Mr.bind(null,"function"),Xe=Mr.bind(null,"string"),jt=Mr.bind(null,"undefined"),vP=Mr.bind(null,"boolean");Mr.bind(null,"symbol");function qd(e){return e===null}function pP(e){return Dn(e)==="number"&&!isNaN(e)}function Qd(e){return Dn(e)==="array"}function se(e){if(!mP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function mP(e){return e&&(typeof e=="object"||e!==null)}function gP(e){return ce(e.constructor)?e.constructor.name:null}function yP(e){return e instanceof Error||Xe(e.message)&&e.constructor&&pP(e.constructor.stackTraceLimit)}function eh(e,t){if(typeof t!="object"||qd(t))return!1;if(t instanceof e)return!0;var r=Dn(new e(""));if(yP(t))for(;t;){if(Dn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}eh.bind(null,TypeError);eh.bind(null,SyntaxError);function ia(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?wP(e,t):r}function wP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function oa(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}oa(ia,"form");oa(ia,"button");oa(ia,"input");oa(ia,"select");function bP(e){return e?Qd(e)?e:[e]:[]}function zu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function SP(){if(Q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function $P(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function IP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=zu(r[1]),o=zu(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&&(TP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return Q&&window.location.search.substring(1)}())}function TP(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 sa(){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 PP(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 $r="global",Wt=ht+"global"+ht,Vt=typeof self===Hu&&self.self===self&&self||typeof global===Hu&&global.global===global&&global||void 0;function vt(e){return Vt[Wt][e]}function pt(e,t){return Vt[Wt][e]=t}function er(e){delete Vt[Wt][e]}function tr(e,t,r){var n;try{if(ns(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Vt[Wt]||(Vt[Wt]={});var un={};function ns(e){if(typeof un[e]!==cn)return un[e];try{var t=window[e];t.setItem(cn,cn),t.removeItem(cn)}catch{return un[e]=!1}return un[e]=!0}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}var Ze="function",He="undefined",EP="@@redux/"+Math.random().toString(36),Gu=function(){return typeof Symbol===Ze&&Symbol.observable||"@@observable"}(),ln=" != "+Ze;function th(e,t,r){var n;if(typeof t===Ze&&typeof r===He&&(r=t,t=void 0),typeof r!==He){if(typeof r!==Ze)throw new Error("enhancer"+ln);return r(th)(e,t)}if(typeof e!==Ze)throw new Error("reducer"+ln);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==Ze)throw new Error("Listener"+ln);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var S=s.indexOf(h);s.splice(S,1)}}}function d(h){if(!se(h))throw new Error("Act != obj");if(typeof h.type===He)throw new Error("ActType "+He);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,S=0;S<v.length;S++)(0,v[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==Ze)throw new Error("next reducer"+ln);a=h,d({type:"@@redux/INIT"})}})[Gu]=function(){var h,v=c;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:v(g)}}})[Gu]=function(){return this},h},n}function OP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+He}function Zt(){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 kP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),A({},o,{dispatch:s=Zt.apply(void 0,i)(o.dispatch)})}}}var qe=ht+"anon_id",ft=ht+"user_id",Nt=ht+"user_traits",Ve="userId",Lt="anonymousId",In=["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"],so=["name","EVENTS","config","loaded"],C=In.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Ku=/^utm_/,Wu=/^an_prop_/,Vu=/^an_trait_/;function _P(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===C.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(qe,o.anonymousId),f||t(ft,o.userId),u.traits&&t(Nt,A({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,h=l.reduce(function(v,S){if(S.match(Ku)||S.match(/^(d|g)clid/)){var g=S.replace(Ku,"");v.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Wu)&&(v.props[S.replace(Wu,"")]=i[S]),S.match(Vu)&&(v.traits[S.replace(Vu,"")]=i[S]),v},{campaign:{},props:{},traits:{}});r.dispatch(A({type:C.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:C.campaign,campaign:h.campaign})}}return n(a)}}}}function RP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===C.setItemEnd){if(r.key===qe)return A({},t,{anonymousId:r.value});if(r.key===ft)return A({},t,{userId:r.value})}switch(r.type){case C.identify:return Object.assign({},t,{userId:r.userId,traits:A({},t.traits,r.traits)});case C.reset:return[ft,qe,Nt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Zu(e){return{userId:e.getItem(ft),anonymousId:e.getItem(qe),traits:e.getItem(Nt)}}var co=function(e){return ht+"TEMP"+ht+e};function CP(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===C.reset&&([ft,Nt,qe].forEach(function(h){n(h)}),[Ve,Lt,"traits"].forEach(function(h){er(co(h))})),s.type===C.identify){a(qe)||r(qe,sa());var c=a(ft),d=a(Nt)||{};c&&c!==u&&i.dispatch({type:C.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ft,u),f&&r(Nt,A({},d,f))}return o(s)}}}}var pr={};function Ju(e,t){pr[e]&&ce(pr[e])&&(pr[e](t),delete pr[e])}function rh(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(A({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return rh(e,t,r-10).then(n,a)})})}function AP(e){return{abort:e}}function nh(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,S=a[h][v];if(S&&ce(S)){var g,T=function(p,$){return p===void 0&&(p={}),$===void 0&&($={}),[Ve,Lt].reduce(function(O,_){return p.hasOwnProperty(_)&&$[_]&&$[_]!==p[_]&&(O[_]=$[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[h].config,instance:r,abort:AP}))&&se(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var w=v+":"+h;e.dispatch(A({},T,{type:w,_:{called:w,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var wi=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(xt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,w,p){var $=w.config,O=w.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(xt)?function(M,F,J,L,x){return function(H,R){var K=L?L.name:M,q=R&&_r(R)?R:J;if(L&&(!(q=R&&_r(R)?R:[M]).includes(M)||q.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(q)+" input valid");return A({},x,{abort:{reason:H,plugins:q,caller:F,_:K}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:jP(I),instance:g,config:$||{},abort:k}}}(n,h),S=t.exact.reduce(function(g,T){var I=T.pluginName,w=T.methodName,p=!1;return w.match(/^initialize/)||w.match(/^reset/)||(p=!f[I].loaded),l.offline&&w.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var w=T.pluginName;return Promise.resolve(g).then(function(p){function $(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[w])return Promise.resolve(t.namespaced[w].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ce(k.method)?(function(H,R){var K=rl(H);if(K&&K.name===R){var q=rl(K.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+K.method+" "+(q?"or "+q.method:"")+" in "+R+" plugin insteadof "+H].join(`
|
|
6
|
-
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(J=F,L=w,x=k.pluginName,function(H,R){return A({},J,{abort:{reason:H,plugins:R||[L],caller:c,from:x||L}})}),config:qu(k.pluginName,f,i),plugins:f})).then(function(H){var R=se(H)?H:{};return Promise.resolve(A({},F,R))})):F;var J,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[w]=_});p[w]=r}();return O&&O.then?O.then($):$()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,w){try{var p=t.exact.length===w+1,$=I.pluginName,O=i[$];return Promise.resolve(T).then(function(_){var k=g[$]?g[$]:{};if(d&&(k=_),Si(k,$))return bi({data:k,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(Si(_,$))return p&&bi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[$],i[$]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:qu($,f,i),plugins:f})).then(function(F){var J=se(F)?F:{},L=A({},_,J),x=g[$];if(Si(x,$))bi({data:x,method:c,instance:n,pluginName:$,store:s});else{var H=c+":"+$;(H.match(/:/g)||[]).length<2&&!c.match(Yu)&&!c.match(Xu)&&n.dispatch(A({},d?L:k,{type:H,_:{called:H,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(xt)||c.match(/^registerPlugin/)||c.match(Xu)||c.match(Yu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=A({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});ah(T,t.exact.length)&&!c.match(/End$/)&&(I=A({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},xt=/Start$/,Yu=/^bootstrap/,Xu=/^ready/;function bi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(A({},e.data,{type:r,_:{called:r,from:"abort"}}))}function qu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Qu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function el(e,t){var r=e.replace(xt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Si(e,t){var r=e.abort;return!!r&&(r===!0||tl(r,t)||r&&tl(r.plugins,t))}function ah(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Xe(r))return!0;var n=r.plugins;return _r(r)&&r.length===t||_r(n)&&n.length===t}function _r(e){return Array.isArray(e)}function tl(e,t){return!(!e||!_r(e))&&e.includes(t)}function rl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function jP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=se(e[r])?Object.assign({},e[r]):e[r]),t},{})}function LP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===C.enablePlugin&&a.dispatch({type:C.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===C.disablePlugin&&setTimeout(function(){return Ju(o.meta.rid,{payload:o})},0),f===C.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),S=[],g=[],T=o.disabled,I=v.map(function(p){var $=p.loaded,O=p.name,_=p.config;return rh(p,function(){return $({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:C.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!so.includes(M)})}),n[O]=!0),S=S.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(A({},{type:C.ready},$))},0)})}var w=function(){if(f!==C.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return nh(a,t,e)},0),Promise.resolve(function(p,$,O,_,k){try{var M=ce($)?$():$,F=p.type,J=F.replace(xt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(K=M,(q=L.plugins)===void 0&&(q={}),(xe=p.options)===void 0&&(xe={}),Object.keys(K).filter(function(m){var b=xe.plugins||{};return vP(b[m])?b[m]:b.all!==!1&&(!q[m]||q[m].enabled!==!1)}).map(function(m){return K[m]}));F===C.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var b=L.plugins[m];return p.plugins.includes(m)&&!b.initialized}).map(function(m){return M[m]}));var H=x.map(function(m){return m.name}),R=function(m,b,E){var U=el(m).map(function(N){return Qu(N,b)});return b.reduce(function(N,D){var Y=D.name,B=el(m,Y).map(function(j){return Qu(j,b)}),W=B[0],y=B[1],P=B[2];return W.length&&(N.beforeNS[Y]=W),y.length&&(N.duringNS[Y]=y),P.length&&(N.afterNS[Y]=P),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(wi({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function b(){var N=function(){if(F.match(xt))return Promise.resolve(wi({action:A({},E,{type:J+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(D){D.meta&&D.meta.hasCallback&&Ju(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(ah(m,H.length))return m;var E,U=function(){if(F!==J)return Promise.resolve(wi({action:A({},m,{type:J}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(b):b()})}catch(m){return Promise.reject(m)}var K,q,xe}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(w&&w.then?w.then(u):u(w))}catch(p){return Promise.reject(p)}}}}}function UP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===C.setItem||a===C.removeItem){if(n.abort)return r(n);a===C.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var NP=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 Zt.apply(void 0,o)(n)(a)}}}}};function xP(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=nl(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},A({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=nl(r.type,C.initialize),f=e()[u];return f&&u?(n[u]=A({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),A({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=A({},t[r.name],{loaded:!0}),A({},t,n);switch(r.type){case C.disablePlugin:return A({},t,al(r.plugins,!1,t));case C.enablePlugin:return A({},t,al(r.plugins,!0,t));default:return t}}}function nl(e,t){return e.substring(t.length+1,e.length)}function al(e,t,r){return e.reduce(function(n,a){return n[a]=A({},r[a],{enabled:t}),n},r)}function ih(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var DP={last:{},history:[]};function MP(e,t){e===void 0&&(e=DP);var r=t.options,n=t.meta;if(t.type===C.track){var a=ih(A({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return A({},e,{last:a,history:e.history.concat(a)})}return e}var FP={actions:[]};function BP(e,t){e===void 0&&(e=FP);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===C.identify?[t].concat(e.actions):e.actions.concat(t),A({},e,{actions:n});case"dequeue":return[];default:return e}}var oh=/#.*$/;function HP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(oh,""):"")}var sh,ch,uh,lh,zP=function(e){if(e===void 0&&(e={}),!Q)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(Q){for(var v,S=document.getElementsByTagName("link"),g=0;v=S[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(oh,"")}(f),c={title:r,url:l,path:HP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),A({},c,e)},GP={last:{},history:[]};function KP(e,t){e===void 0&&(e=GP);var r=t.options;if(t.type===C.page){var n=ih(A({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return A({},e,{last:n,history:e.history.concat(n)})}return e}sh=function(){if(!Q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),ch=Q?document.referrer:null,uh=SP(),lh=$P();var il={initialized:!1,sessionId:sa(),app:null,version:null,debug:!1,offline:!!Q&&!navigator.onLine,os:{name:sh},userAgent:Q?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:lh,locale:uh,campaign:{},referrer:ch};function WP(e,t){e===void 0&&(e=il);var r=e.initialized,n=t.campaign;switch(t.type){case C.campaign:return A({},e,{campaign:n});case C.offline:return A({},e,{offline:!0});case C.online:return A({},e,{offline:!1});default:return r?e:A({},il,e,{initialized:!0})}}var VP=["plugins","reducers","storage"];function ZP(e,t,r){if(Q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function JP(e){var t=ZP.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function fh(){return pt("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 Vt[Wt].analytics.push(o.action||o),i(o)}})}}}function ol(e){return function(){return Zt(Zt.apply(null,arguments),fh())}}function $i(e){return e?Qd(e)?e:[e]:[]}function sl(e,t,r){e===void 0&&(e={});var n,a,i=sa();return t&&(pr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ce(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),A({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function YP(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,b){if(ce(b))return m.middlewares=m.middlewares.concat(b),m;if(b.NAMESPACE&&(b.name=b.NAMESPACE),!b.name)throw new Error("https://lytics.dev/errors/1");b.config||(b.config={});var E=b.EVENTS?Object.keys(b.EVENTS).map(function(D){return b.EVENTS[D]}):[];m.pluginEnabled[b.name]=!(b.enabled===!1||b.config.enabled===!1),delete b.enabled,b.methods&&(m.methods[b.name]=Object.keys(b.methods).reduce(function(D,Y){var B;return D[Y]=(B=b.methods[Y],function(){for(var W=Array.prototype.slice.call(arguments),y=new Array(B.length),P=0;P<W.length;P++)y[P]=W[P];return y[y.length]=$,B.apply({instance:$},y)}),D},{}),delete b.methods);var U=Object.keys(b).concat(E),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(b),m.plugins[b.name])throw new Error(b.name+"AlreadyLoaded");return m.plugins[b.name]=b,m.plugins[b.name].loaded||(m.plugins[b.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:vt,setItem:pt,removeItem:er},i=function(m){return function(b,E,U){return E.getState("user")[b]||(U&&se(U)&&U[b]?U[b]:Zu(m)[b]||vt(co(b))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!so.includes(m)}).sort(),u=new Set(s.concat(In).filter(function(m){return!so.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new NP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=IP(),T=Zu(a),I=A({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=sa());var w=A({enable:function(m,b){return new Promise(function(E){R.dispatch({type:C.enablePlugin,plugins:$i(m),_:{originalAction:C.enablePlugin}},E,[b])})},disable:function(m,b){return new Promise(function(E){R.dispatch({type:C.disablePlugin,plugins:$i(m),_:{originalAction:C.disablePlugin}},E,[b])})}},n.methods),p=!1,$={identify:function(m,b,E,U){try{var N=Xe(m)?m:null,D=se(m)?m:b,Y=E||{},B=$.user();pt(co(Ve),N);var W=N||D.userId||i(Ve,$,D);return Promise.resolve(new Promise(function(y){R.dispatch(A({type:C.identifyStart,userId:W,traits:D||{},options:Y,anonymousId:B.anonymousId},B.id&&B.id!==N&&{previousId:B.id}),y,[b,E,U])}))}catch(y){return Promise.reject(y)}},track:function(m,b,E,U){try{var N=se(m)?m.event:m;if(!N||!Xe(N))throw new Error("EventMissing");var D=se(m)?m:b||{},Y=se(E)?E:{};return Promise.resolve(new Promise(function(B){R.dispatch({type:C.trackStart,event:N,properties:D,options:Y,userId:i(Ve,$,b),anonymousId:i(Lt,$,b)},B,[b,E,U])}))}catch(B){return Promise.reject(B)}},page:function(m,b,E){try{var U=se(m)?m:{},N=se(b)?b:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:C.pageStart,properties:zP(U),options:N,userId:i(Ve,$,U),anonymousId:i(Lt,$,U)},D,[m,b,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ve||m==="id")return i(Ve,$);if(m===Lt||m==="anonId")return i(Lt,$);var b=$.getState("user");return m?Bu(b,m):b},reset:function(m){return new Promise(function(b){R.dispatch({type:C.resetStart},b,m)})},ready:function(m){return p&&m({plugins:w,instance:$}),$.on(C.ready,function(b){m(b),p=!0})},on:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(B){return function(W){return function(y){return y.type.match(E)&&b({payload:y,instance:$,plugins:o}),W(y)}}},N=function(B){return function(W){return function(y){return y.type.match(E)||b({payload:y,instance:$,plugins:o}),W(y)}}};return d(U,fn),d(N,dn),function(){h(U,fn),h(N,dn)}}var D=m.match(E)?fn:dn,Y=function(B){return function(W){return function(y){return y.type===m&&b({payload:y,instance:$,plugins:o,abort:S}),W(y)}}};return d(Y,D),function(){return h(Y,D)}},once:function(m,b){if(!m||!ce(b))return!1;if(m===C.bootstrap)throw new Error(".once disabled for "+m);var E=$.on(m,function(U){b({payload:U.payload,instance:$,plugins:o,abort:S}),E()});return E},getState:function(m){var b=R.getState();return m?Bu(b,m):Object.assign({},b)},dispatch:function(m){var b=Xe(m)?{type:m}:m;if(In.includes(b.type))throw new Error("reserved action "+b.type);var E=A({},b,{_:A({originalAction:b.type},m._||{})});R.dispatch(E)},enablePlugin:w.enable,disablePlugin:w.disable,plugins:w,storage:{getItem:a.getItem,setItem:function(m,b,E){R.dispatch({type:C.setItemStart,key:m,value:b,options:E})},removeItem:function(m,b){R.dispatch({type:C.removeItemStart,key:m,options:b})}},setAnonymousId:function(m,b){$.storage.setItem(qe,m,b)},events:{core:In,plugins:s}},O=n.middlewares.concat([function(m){return function(b){return function(E){return E.meta||(E.meta=sl()),b(E)}}},v(fn),LP($,l,{all:f,plugins:s}),UP(a),_P($),CP($),v(dn)]),_={context:WP,user:RP(a),page:KP,track:MP,plugins:xP(l),queue:BP},k=Zt,M=Zt;if(Q&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?fh():se(typeof arguments[0])?ol():ol().apply(null,arguments)}}var J,L=function(m){return Object.keys(m).reduce(function(b,E){return VP.includes(E)||(b[E]=m[E]),b},{})}(e),x=n.pluginsArray.reduce(function(m,b){var E=b.name,U=b.config,N=b.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!b.initialize,loaded:!!N({config:U}),config:U},m},{}),H={context:L,user:I,plugins:x},R=th(function(m){for(var b=Object.keys(m),E={},U=0;U<b.length;U++){var N=b[U];typeof m[N]===Ze&&(E[N]=m[N])}var D,Y=Object.keys(E);try{(function(B){Object.keys(B).forEach(function(W){var y=B[W];if(typeof y(void 0,{type:"@@redux/INIT"})===He||typeof y(void 0,{type:EP})===He)throw new Error("reducer "+W+" "+He)})})(E)}catch(B){D=B}return function(B,W){if(B===void 0&&(B={}),D)throw D;for(var y=!1,P={},j=0;j<Y.length;j++){var V=Y[j],oe=B[V],et=(0,E[V])(oe,W);if(typeof et===He){var Th=OP(V,W);throw new Error(Th)}P[V]=et,y=y||et!==oe}return y?P:B}}(A({},_,t)),H,M(k(kP.apply(void 0,O))));R.dispatch=(J=R.dispatch,function(m,b,E){var U=A({},m,{meta:sl(m.meta,b,$i(E))});return J.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:C.bootstrap,plugins:K,config:L,params:g,user:I,initialUser:r,persistedUser:T});var q=K.filter(function(m){return n.pluginEnabled[m]}),xe=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:C.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,b){var E=m.bootstrap,U=m.config,N=m.name;E&&ce(E)&&E({instance:$,config:U,payload:m}),R.dispatch({type:C.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===b+1&&R.dispatch({type:C.initializeStart,plugins:q,disabled:xe})}),JP(function(m){R.dispatch({type:m?C.offline:C.online})}),function(m,b,E){setInterval(function(){return nh(m,b,E)},3e3)}(R,l,$),$}var fn="before",dn="after",Ir="cookie",st=vh(),dh=ca,XP=ca;function hh(e){return st?ca(e,"",-1):er(e)}function vh(){if(st!==void 0)return st;var e="cookiecookie";try{ca(e,e),st=document.cookie.indexOf(e)!==-1,hh(e)}catch{st=!1}return st}function ca(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return st===!1&&(o?pt(e,t):vt(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 Tr="localStorage",qP=ns.bind(null,"localStorage");tr("localStorage","getItem",vt);tr("localStorage","setItem",pt);tr("localStorage","removeItem",er);var Pr="sessionStorage",QP=ns.bind(null,"sessionStorage");tr("sessionStorage","getItem",vt);tr("sessionStorage","setItem",pt);tr("sessionStorage","removeItem",er);function Dt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(se(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var eE=qP(),tE=QP(),rE=vh();function ph(e,t){if(e){var r=as(t),n=!cs(r),a=is(r)?Dt(localStorage.getItem(e)):void 0;if(n&&!jt(a))return a;var i=os(r)?Dt(dh(e)):void 0;if(n&&i)return i;var o=ss(r)?Dt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=vt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function nE(e,t,r){if(e&&!jt(t)){var n={},a=as(r),i=JSON.stringify(t),o=!cs(a);return is(a)&&(n[Tr]=hn(Tr,t,Dt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Tr]:os(a)&&(n[Ir]=hn(Ir,t,Dt(dh(e))),XP(e,i),o)?n[Ir]:ss(a)&&(n[Pr]=hn(Pr,t,Dt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Pr]:(n[$r]=hn($r,t,vt(e)),pt(e,t),o?n[$r]:n)}}function aE(e,t){if(e){var r=as(t),n=ph(e,Yd),a={};return!jt(n.localStorage)&&is(r)&&(localStorage.removeItem(e),a[Tr]=n.localStorage),!jt(n.cookie)&&os(r)&&(hh(e),a[Ir]=n.cookie),!jt(n.sessionStorage)&&ss(r)&&(sessionStorage.removeItem(e),a[Pr]=n.sessionStorage),!jt(n.global)&&ua(r,$r)&&(er(e),a[$r]=n.global),a}}function as(e){return e?Xe(e)?e:e.storage:Jd}function is(e){return eE&&ua(e,Tr)}function os(e){return rE&&ua(e,Ir)}function ss(e){return tE&&ua(e,Pr)}function cs(e){return e===Yd||e==="all"}function ua(e,t){return e===Jd||e===t||cs(e)}function hn(e,t,r){return{location:e,current:t,previous:r}}var iE={setItem:nE,getItem:ph,removeItem:aE};function oE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cl(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 ul(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cl(Object(r),!0).forEach(function(n){oE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:iE};return YP(ul(ul({},t),e))}function cE(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 uE(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=fE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function lE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function fE(e){return["#","?"].forEach(t=>e=lE(e,t)),e}function dE(){uE(()=>{Fe.page()})}function hE(e){if(e===void 0&&(e={}),!Q)return oo;var t=fl(),r=uo(),n=ll(),a=vn(n,t),i=vn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return oo;var h=d.map(function(S){return Number(S)}),v=PP(function(){var S=fl(),g=function(L,x){return x.map(function(H){return H===100?L-5:L*(H/100)})}(S,h),T=uo(),I=ll(),w=vn(I,S),p=vn(T,S);if(l=w>l?w:l,c=p<c?p:c,!(o.length>=h.length)){var $=f===I,O="up";$?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||$)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,H){var R=_[H];return u.includes(x)&&I<=R&&(u=u.filter(function(K){return K!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=w?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ce(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,J=M.direction;ce(e[F])&&e[F]({trigger:F,direction:J,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function uo(){return Q?document.body.scrollTop||document.documentElement.scrollTop:0}function vE(){return Q?window.innerHeight||document.documentElement.clientHeight:0}function ll(){return Math.round(uo()+vE())}function fl(){if(!Q)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function vn(e,t){return Math.round(e/t*100)}var dl="EventListener";function pE(e){return function(t,r,n,a){var i=n||oo,o=a||!1;if(!Q)return i;var s=Mn(r),u=Mn(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"+dl:"remove"+dl,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?mE(i):i:f[h]||i;for(var S=0;S<s.length;S++)v[d]?v["on"+s[S]]=c?f[h]:null:v[d](s[S],f[h],o)}return l.bind(null,!c)}(e)}}function Mn(e,t){if(Xe(e))return t?Mn(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=bP(e);return t?i.map(function(o){return Xe(o)?Mn(o,!0):o}).flat():i}function mE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ii=pE("Event");function mh(e,t){return Q&&ce(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ce(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}mh.bind(null,"onerror");mh.bind(null,"onload");var gh=typeof window>"u",hl="hidden";function gE(e){if(gh)return!1;var t=yE(),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 yE(){var e=["webkit","moz","ms","o"];return gh||hl in document?hl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var wE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function bE(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(wE.map(function(s){return Ii(document,s,r)})).concat(Ii(window,"load",r)).concat(Ii(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function SE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(fr(d),g),a&&l&&(l=!1,a(fr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(fr(d),g))},s)}var S=bE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=S();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:fr(d,c),idle:l?fr(r,c):0}}}}function fr(e,t){return t?0:Math.round((new Date-e)/1e3)}const vl=5e3;class $E{constructor(t){he(this,"element");he(this,"isInViewport",!1);he(this,"isAwake",!1);he(this,"isFlushing");he(this,"observer");he(this,"lastEventAt",Date.now());he(this,"registeredView",!1);he(this,"viewCallback");he(this,"activeDurationCallback");he(this,"idleDurationCallback");he(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),SE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:vl}),hE({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*vl: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 pl="sesamy_session_id";function IE(){let e=sessionStorage.getItem(pl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(pl,e)),e}let yh=!1,lo,ml,Fn;const wh=new Map;function TE({clientId:e,enabled:t=!0,environment:r}){if(lo=e,ml=t,Fn=`${Be("logs",r)}/events`,!ml)return;window.addEventListener("beforeunload",()=>{Sh.forEach((a,i)=>{a.bind(i)()}),EE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&wh.forEach((a,i)=>{a.bind(i)()})}),dE();const n=new $E({element:document.body,viewCallback:()=>{Fe.page()},activeDurationCallback:(a,i,o)=>{Fe.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Fe.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Fe.track("scroll",{scroll:a.scrollMax})}});OE(document.body,()=>{n.flush()}),kE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(de.AUTHENTICATED,async a=>{const i=a;await Fe.identify(i.detail.sub)}),window.addEventListener(de.LOGOUT,async()=>{await Fe.track("logout",{}),us.flush(),await Fe.reset()})}function bh(e){return JSON.stringify(e.map(t=>({...t,clientId:lo,requestId:Math.random().toString(36).slice(2,9),sessionId:IE(),timestamp:new Date().toISOString(),version:rs,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:Zd,userAgent:navigator.userAgent,clientId:lo}})))}const us=cE(async e=>{if(e.length>0){const t=bh(e);yh?navigator.sendBeacon(Fn,t):(await fetch(Fn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ti(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Fn,bh([r]))}else us.push(e)}const Fe=sE({app:Zd,version:rs,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ti({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ti({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ti({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function PE(e,t){Fe.track(e,t)}function EE(){return yh=!0,us.flush()}const Sh=new Map;function OE(e,t){Sh.set(e,t)}function kE(e,t){wh.set(e,t)}const _E=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function RE(){return new Promise(e=>{const t=_E.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 CE(){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 AE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:S,getProfile:g,updateProfile:T,getTags:I,deleteTag:w,setTag:p,getUserMetadata:$,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:J,deleteTally:L,getProduct:x,getPaymentIssues:H,isSpotifyLinked:R,unlinkSpotify:K,linkSpotify:q,autoOnboardProduct:xe,openHostedAccountPage:m,generateLink:b}=lP(e),E={auth:{getUser:g,isAuthenticated:kr,loginWithRedirect:es,logout:Bd,setToken:zd},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:K},analytics:{track:PE},tags:{list:I,set:p,delete:w},entitlements:{get:a,list:i,access:o,signedLinks:ts},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:$,list:O,set:_,delete:k},tallies:{get:M,list:F,push:J,delete:L},subscriptions:{list:u},transactions:{get:v,list:S},products:{get:x,autoOnboard:xe,linkSpotify:q},browser:{detectAdblock:RE,isInAppBrowser:CE},getVersion:jE,getPaymentIssues:H,generateLink:b,clearCache:Pe,log:Le};return e.namespace&&(window[e.namespace]=E),E}function jE(){return rs}function LE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
4
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!xu(r))throw new Error(`Invalid cache location "${r}"`);n=xu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Rt:zT,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:GT;var i;this.scope=cn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new MT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Ud,this.cacheManager=new DT(n,n.allKeys?void 0:new VT(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 WT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Ld)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${no(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return BT({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=Au(mi()),i=Au(mi()),o=mi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await In().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,b,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:cn(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:b,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 RT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new _T(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(le.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new le("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=Du(t),{openUrl:a,fragment:i,appState:o}=n,s=Ue(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=Ue(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 le("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new kT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new le("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:cn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=yi[o];return s||(s=i().finally(()=>{delete yi[o],s=null}),yi[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=Ue(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})(()=>wi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ro;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 wi.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:cn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},OT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new ut({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=Ue(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${no(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Du(t),{openUrl:n}=r,a=Ue(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 le("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((v,b,g=60)=>new Promise((T,I)=>{const y=window.document.createElement("iframe");y.setAttribute("width","0"),y.setAttribute("height","0"),y.style.display="none";const p=()=>{window.document.body.contains(y)&&(window.document.body.removeChild(y),window.removeEventListener("message",S,!1))};let S;const O=setTimeout(()=>{I(new ro),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(le.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",S,!1),setTimeout(p,2e3)},window.addEventListener("message",S,!1),window.document.body.appendChild(y),y.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new le("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new ut({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 Bd(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=Ue(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 ut({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 ut({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 NT(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 YT(e){const t=new JT(e);return await t.checkSession(),t}var he=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(he||{});const XT="sesamy.com",qT="sesamy.dev",QT="https://sesa.my",io="sesamyCacheTimestamp";function He(e,t){return`https://${e}.${t==="dev"?qT:XT}`}function oo(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let de,Wd,so=!1,Mu=!1;const Kt="sesamyAccessToken",bi="sesamyRefreshToken";async function Mr(){return so?!0:new Promise((e,t)=>{const r=setTimeout(()=>{so?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(he.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function eP(e){if(!e)return null;const t=localStorage.getItem(bi);if(!t)return Re("No refresh token found in localstorage"),null;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(bi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(bi,i.refresh_token),localStorage.setItem(Kt,i.access_token),i.access_token}catch{Vd()}}async function rs(){const e=localStorage.getItem(Kt);if(!e)return null;const t=Zd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await eP(t);if(r)return r;localStorage.removeItem(Kt)}return e}function Fu(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 tP(e){if(e.enabled===!1)return;Wd=e.organization;const t={domain:He("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Fu(window.location.href)!==Fu(He("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),de=await YT(t),window.location.search.includes("code="))try{await de.handleRedirectCallback();const r=await de.getUser();if(!r)throw new Error("No user found");Ke(he.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){alert("There was an error logging in"),console.error(r)}so=!0,Ke(he.AUTH_INITIALIZED,{})}async function _r(){return await Mr(),await rs()?!0:de?de.isAuthenticated():!1}async function rP(){return await Mr(),await rs()?(Re("Using local user"),{sub:"local",name:"Local User"}):de?de.getUser():null}async function ns(e){if(Mu){Re("Login already in progress");return}if(Mu=!0,await Mr(),localStorage.removeItem(Kt),!de)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return de.loginWithRedirect({...e,authorizationParams:{organization:Wd,redirect_uri:window.location.href,ui_locales:oo(),...t}})}async function fr(e=!0){await Mr();const t=await rs();if(t)return t;try{return de?await de.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Vd(e={}){if(await Mr(),localStorage.removeItem(Kt),Ke(he.LOGOUT,{}),!!de)return de.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Zd(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=Zd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Kt,e),Ke(he.AUTHENTICATED,t)}const nP=(e,t)=>t.skipDedupe||t.method!=="GET",aP=(e,t)=>t.method+"@"+e,iP=e=>e.clone(),Bu=({skip:e=nP,key:t=aP,resolver:r=iP}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},oP=(e,t)=>e*t,sP=e=>e&&e.ok,Hu=({delayTimer:e=500,delayRamp:t=oP,maxAttempts:r=10,until:n=sP,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var y,p;g(u((y=I&&I.url)!==null&&y!==void 0?y:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},cP="application/json",Yd="Content-Type",Ot=Symbol(),Xd=Symbol();function zu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Yd.toLowerCase()))===null||t===void 0?void 0:t[1]}function Gu(e){return/^application\/.*json.*/.test(e)}const ft=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]=ft(o,i,r):n[a]=i,n},{...e})},Wt={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 uP(e,t=!1){Wt.options=t?e:ft(Wt.options,e)}function lP(e,t=!1){Wt.polyfills=t?e:ft(Wt.polyfills,e)}function fP(e){Wt.errorType=e}const dP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class qd extends Error{}const hP=e=>{const t=Object.create(null);e=e._addons.reduce((y,p)=>p.beforeRequest&&p.beforeRequest(y,e._options,t)||y,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ft(a.options,n);let c=r;const d=dP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,l),h=new Error,v=d.catch(y=>{throw{[Ot]:y}}).then(y=>{var p;if(!y.ok){const S=new qd;if(S.cause=h,S.stack=S.stack+`
|
|
5
|
+
CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw S;const O=a.errorType==="json"||((p=y.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(k=>{throw S.message=typeof k=="string"?k:y.statusText,k&&(O&&typeof k=="string"?(S.text=k,S.json=JSON.parse(k)):S[a.errorType]=k),S})}return y}),b=y=>y.catch(p=>{const S=Object.prototype.hasOwnProperty.call(p,Ot),O=S?p[Ot]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||S&&f.has(Ot)&&f.get(Ot);if(_)return _(O,e);const k=f.get(Xd);if(k)return k(O,e);throw O}),g=y=>p=>b(y?v.then(S=>S&&S[y]()).then(S=>p?p(S):S):v.then(S=>p?p(S):S)),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(y,p){return f.set(y,p),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(Ot,y)}},I=u.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),T);return o.reduce((y,p)=>p(y,e),I)},vP={_url:"",_options:{},_config:Wt,_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:ft(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:ft(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:ft(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Yd]: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(Xd,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=zu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Gu(a));return n=r?o?n.json(r,a):n.body(r):n,hP(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=zu(this._options.headers);return this.content(t||Gu(r)&&r||cP).body(JSON.stringify(e))}};function Ge(e="",t={}){return{...vP,_url:e,_options:t}}Ge.default=Ge;Ge.options=uP;Ge.errorType=fP;Ge.polyfills=lP;Ge.WretchError=qd;function Ee(){sessionStorage.removeItem(io),console.log("Cache cleared"),Ke(he.CLEAR_CACHE,{})}function co(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function Qd(e,t){if(co(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function Ku(e){return e.endsWith("/")?e.slice(0,-1):e}function Wu(e,t){if(!co(e)||!co(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&Ku(r.pathname)===Ku(n.pathname)}function pP(e,t){const r=new URL(`${He("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=Qd(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("url",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const eh="sesamySignedURLs";function as(){const e=sessionStorage.getItem(eh);return e?JSON.parse(e):[]}function mP(e){const t=as();t.push(e),Re(`Adding signed URL: ${e}`),sessionStorage.setItem(eh,JSON.stringify(t))}function gP(e){const t=He("api2",e.environment),r=$=>async(P,C)=>{let Y=sessionStorage.getItem(io);Y||(Y=Date.now().toString(),sessionStorage.setItem(io,Y));const W={...C,headers:{...C.headers,"Cache-Timestamp":Y}};return $(P,W)},n=($=!0)=>P=>async(C,Y)=>{let W=null;if(W=await fr($),!W){if($)throw new Error("No access token available");return P(C,Y)}const tt={...Y,headers:{...Y.headers,...W?{Authorization:`Bearer ${W}`}:{}}};return P(C,tt)},a=$=>(P,C)=>{if(C.headers.Authorization)return $(P,C);const Y=localStorage.getItem("__anon_id"),W=btoa(`${Y}:`),tt={...C,headers:{...C.headers,Authorization:`Basic ${W}`}};return $(P,tt)},i=Ge(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Bu(),Hu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),o=Ge(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Bu(),Hu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]);async function s($={}){const{waitForEntitlementAfter:P,includeSignedLinks:C=!0}=$,Y=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",W=await _r()?await i.get(`/entitlements${Y}`).json():[];return C&&W.push(...as()),W}async function u($,P=[]){const C=await s();return C==null?void 0:C.find(W=>{const{sku:tt,purchaseOption:hs}=Qd($);let fa="sku"in W&&tt===W.sku;fa&&hs&&"purchaseOptionId"in W&&(fa=hs===W.purchaseOptionId);const Ch=Wu($,W.url),Ah=P.some(jh=>Wu(jh,W.url));return fa||Ch||Ah})}async function f($){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function l($){return i.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await _r()?await i.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return i.get("/contracts").json()}async function h($){const P=await i.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await i.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function g(){return i.get("/bills").json()}async function T($){const P=await i.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function I(){return i.get("/transactions").json()}async function y($){const P=await i.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await i.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ke(he.USER_ATTRIBUTE_CHANGED,{}),Ee(),C}async function S($){const P=await i.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return Ee(),P.ok}async function O($){return(await i.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await i.url("/user-metadata").get().json()}async function k(){return await i.url("/tags").get().json()}async function M($){const P=await i.url(`/tags/${encodeURIComponent($)}`).delete().res();return Ee(),P.ok}async function F($){const P=await i.url("/tags").post(encodeURIComponent($)).res();return Ke(he.USER_ATTRIBUTE_CHANGED,{}),Ee(),P.ok}async function X($){return(await o.url("/tallies").get().json())[$]}async function L(){return await o.url("/tallies").get().json()}async function x($){const P=await o.url(`/tallies/${$}`).delete().res();return Ee(),P.ok}async function z($,P){return await o.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await i.url(`/products/${encodeURIComponent($)}`).get().json()}async function V(){return await fr(!1)?await i.url("/profile").get().json():null}async function ee($){const P=await i.url("/profile").patch($).res();return Ee(),P.ok}async function De(){return await i.url("/payment-issues").get().json()}async function m(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await fr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${He("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",P),C.searchParams.set("state",$),window.location.href=C.toString()}async function U($){const P=await i.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&Ee(),P}async function N($,P=3600){const{shortlink:C}=await Ge(QT).post({url:$,ttl:P}).json();return C}async function D($){const P=await fr(!1);let C;const Y=$.language||oo();switch($.target){case"account":C=new URL(`${He("account",e.environment)}/${encodeURIComponent($.language||Y)}/subscriptions/${encodeURIComponent(e.clientId)}`),C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"consume":C=new URL(`${He("consume",e.environment)}/${encodeURIComponent($.language||Y)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent($.sku)}`),$.episodeId?C.href+=`/${$.episodeId}`:C.href+="/listen",C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"checkout":C=pP(e,{language:Y,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?N(C.href,$.ttl):C.href}async function q($){return(await o.url("/checkouts").post({language:oo(),...$,vendorId:e.clientId})).json()}async function H($,P){return(await o.url(`/checkouts/${$}`).patch(P)).json()}async function Z($){return(await o.url(`/checkouts/${$}`).get()).json()}async function B(){const $=await fr(!1),P=new URL(`${He("account",e.environment)}/subscriptions/${e.clientId}`);$&&(P.hash=`#access_token=${$}`),window.location.href=P.toString()}return{createCheckout:q,updateCheckout:H,getCheckout:Z,getEntitlements:s,getEntitlement:f,getEntitlementAccess:l,hasAccess:u,getFulfillments:c,getContracts:d,getContract:h,cancelContract:v,getProfile:V,updateProfile:ee,getSubscriptions:b,getBills:g,getBill:T,setUserMetadata:p,deleteUserMetadata:S,getUserMetadata:O,listUserMetadata:_,getTags:k,deleteTag:M,setTag:F,getTally:X,getTallies:L,deleteTally:x,pushTally:z,getTransactions:I,getTransaction:y,getProduct:R,getPaymentIssues:De,autoOnboardProduct:U,isSpotifyLinked:m,unlinkSpotify:w,linkSpotify:E,generateLink:D,openHostedAccountPage:B}}const th="@sesamy/sesamy-js",is="1.19.1";function Vu(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 un="undefined",Zu="object",uo=function(){},rh="any",nh="*",vt="__",Dn=typeof process<"u"?process:{};Dn.env&&Dn.env.NODE_ENV;var te=typeof document<"u";Dn.versions!=null&&Dn.versions.node!=null;typeof Deno<"u"&&Deno.core;te&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ah(e,t){return t.charAt(0)[e]()+t.slice(1)}var yP=ah.bind(null,"toUpperCase"),wP=ah.bind(null,"toLowerCase");function bP(e){return ih(e)?yP("null"):typeof e=="object"?TP(e):Object.prototype.toString.call(e).slice(8,-1)}function Mn(e,t){t===void 0&&(t=!0);var r=bP(e);return t?wP(r):r}function Fr(e,t){return typeof t===e}var ue=Fr.bind(null,"function"),qe=Fr.bind(null,"string"),Lt=Fr.bind(null,"undefined"),SP=Fr.bind(null,"boolean");Fr.bind(null,"symbol");function ih(e){return e===null}function $P(e){return Mn(e)==="number"&&!isNaN(e)}function oh(e){return Mn(e)==="array"}function ce(e){if(!IP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function IP(e){return e&&(typeof e=="object"||e!==null)}function TP(e){return ue(e.constructor)?e.constructor.name:null}function PP(e){return e instanceof Error||qe(e.message)&&e.constructor&&$P(e.constructor.stackTraceLimit)}function sh(e,t){if(typeof t!="object"||ih(t))return!1;if(t instanceof e)return!0;var r=Mn(new e(""));if(PP(t))for(;t;){if(Mn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}sh.bind(null,TypeError);sh.bind(null,SyntaxError);function oa(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?EP(e,t):r}function EP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function sa(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}sa(oa,"form");sa(oa,"button");sa(oa,"input");sa(oa,"select");function OP(e){return e?oh(e)?e:[e]:[]}function Ju(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function kP(){if(te){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function _P(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function RP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Ju(r[1]),o=Ju(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&&(CP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return te&&window.location.search.substring(1)}())}function CP(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 ca(){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 AP(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 Ir="global",Vt=vt+"global"+vt,Zt=typeof self===Zu&&self.self===self&&self||typeof global===Zu&&global.global===global&&global||void 0;function pt(e){return Zt[Vt][e]}function mt(e,t){return Zt[Vt][e]=t}function tr(e){delete Zt[Vt][e]}function rr(e,t,r){var n;try{if(os(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Zt[Vt]||(Zt[Vt]={});var ln={};function os(e){if(typeof ln[e]!==un)return ln[e];try{var t=window[e];t.setItem(un,un),t.removeItem(un)}catch{return ln[e]=!1}return ln[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 Je="function",ze="undefined",jP="@@redux/"+Math.random().toString(36),Yu=function(){return typeof Symbol===Je&&Symbol.observable||"@@observable"}(),fn=" != "+Je;function ch(e,t,r){var n;if(typeof t===Je&&typeof r===ze&&(r=t,t=void 0),typeof r!==ze){if(typeof r!==Je)throw new Error("enhancer"+fn);return r(ch)(e,t)}if(typeof e!==Je)throw new Error("reducer"+fn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==Je)throw new Error("Listener"+fn);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var b=s.indexOf(h);s.splice(b,1)}}}function d(h){if(!ce(h))throw new Error("Act != obj");if(typeof h.type===ze)throw new Error("ActType "+ze);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==Je)throw new Error("next reducer"+fn);a=h,d({type:"@@redux/INIT"})}})[Yu]=function(){var h,v=c;return(h={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:v(g)}}})[Yu]=function(){return this},h},n}function LP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+ze}function Jt(){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 UP(){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=Jt.apply(void 0,i)(o.dispatch)})}}}var Qe=vt+"anon_id",dt=vt+"user_id",xt=vt+"user_traits",Ze="userId",Ut="anonymousId",Tn=["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"],lo=["name","EVENTS","config","loaded"],A=Tn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Xu=/^utm_/,qu=/^an_prop_/,Qu=/^an_trait_/;function NP(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(Qe,o.anonymousId),f||t(dt,o.userId),u.traits&&t(xt,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,h=l.reduce(function(v,b){if(b.match(Xu)||b.match(/^(d|g)clid/)){var g=b.replace(Xu,"");v.campaign[g==="campaign"?"name":g]=i[b]}return b.match(qu)&&(v.props[b.replace(qu,"")]=i[b]),b.match(Qu)&&(v.traits[b.replace(Qu,"")]=i[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:A.campaign,campaign:h.campaign})}}return n(a)}}}}function xP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Qe)return j({},t,{anonymousId:r.value});if(r.key===dt)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[dt,Qe,xt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function el(e){return{userId:e.getItem(dt),anonymousId:e.getItem(Qe),traits:e.getItem(xt)}}var fo=function(e){return vt+"TEMP"+vt+e};function DP(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&&([dt,xt,Qe].forEach(function(h){n(h)}),[Ze,Ut,"traits"].forEach(function(h){tr(fo(h))})),s.type===A.identify){a(Qe)||r(Qe,ca());var c=a(dt),d=a(xt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(dt,u),f&&r(xt,j({},d,f))}return o(s)}}}}var mr={};function tl(e,t){mr[e]&&ue(mr[e])&&(mr[e](t),delete mr[e])}function uh(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 uh(e,t,r-10).then(n,a)})})}function MP(e){return{abort:e}}function lh(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,b=a[h][v];if(b&&ue(b)){var g,T=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[Ze,Ut].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=b({payload:T,config:o[h].config,instance:r,abort:MP}))&&ce(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var y=v+":"+h;e.dispatch(j({},T,{type:y,_:{called:y,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var Si=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(Dt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,y,p){var S=y.config,O=y.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Dt)?function(M,F,X,L,x){return function(z,R){var V=L?L.name:M,ee=R&&Rr(R)?R:X;if(L&&(!(ee=R&&Rr(R)?R:[M]).includes(M)||ee.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(ee)+" input valid");return j({},x,{abort:{reason:z,plugins:ee,caller:F,_:V}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:FP(I),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,T){var I=T.pluginName,y=T.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[I].loaded),l.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var y=T.pluginName;return Promise.resolve(g).then(function(p){function S(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[y])return Promise.resolve(t.namespaced[y].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ue(k.method)?(function(z,R){var V=cl(z);if(V&&V.name===R){var ee=cl(V.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+V.method+" "+(ee?"or "+ee.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
+
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,x=k.pluginName,function(z,R){return j({},X,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:al(k.pluginName,f,i),plugins:f})).then(function(z){var R=ce(z)?z:{};return Promise.resolve(j({},F,R))})):F;var X,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[y]=_});p[y]=r}();return O&&O.then?O.then(S):S()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,y){try{var p=t.exact.length===y+1,S=I.pluginName,O=i[S];return Promise.resolve(T).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),Ii(k,S))return $i({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(Ii(_,S))return p&&$i({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty(S)&&b[S]===!0)return s.dispatch({type:"queue",plugin:S,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[S],i[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:al(S,f,i),plugins:f})).then(function(F){var X=ce(F)?F:{},L=j({},_,X),x=g[S];if(Ii(x,S))$i({data:x,method:c,instance:n,pluginName:S,store:s});else{var z=c+":"+S;(z.match(/:/g)||[]).length<2&&!c.match(rl)&&!c.match(nl)&&n.dispatch(j({},d?L:k,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Dt)||c.match(/^registerPlugin/)||c.match(nl)||c.match(rl)||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"}});fh(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)}},Dt=/Start$/,rl=/^bootstrap/,nl=/^ready/;function $i(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function al(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function il(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function ol(e,t){var r=e.replace(Dt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Ii(e,t){var r=e.abort;return!!r&&(r===!0||sl(r,t)||r&&sl(r.plugins,t))}function fh(e,t){var r=e.abort;if(!r)return!1;if(r===!0||qe(r))return!0;var n=r.plugins;return Rr(r)&&r.length===t||Rr(n)&&n.length===t}function Rr(e){return Array.isArray(e)}function sl(e,t){return!(!e||!Rr(e))&&e.includes(t)}function cl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function FP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ce(e[r])?Object.assign({},e[r]):e[r]),t},{})}function BP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return tl(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],T=o.disabled,I=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return uh(p,function(){return S({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:A.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!lo.includes(M)})}),n[O]=!0),b=b.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var S={plugins:b,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return lh(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=ue(S)?S():S,F=p.type,X=F.replace(Dt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(V=M,(ee=L.plugins)===void 0&&(ee={}),(De=p.options)===void 0&&(De={}),Object.keys(V).filter(function(m){var w=De.plugins||{};return SP(w[m])?w[m]:w.all!==!1&&(!ee[m]||ee[m].enabled!==!1)}).map(function(m){return V[m]}));F===A.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var w=L.plugins[m];return p.plugins.includes(m)&&!w.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,w,E){var U=ol(m).map(function(N){return il(N,w)});return w.reduce(function(N,D){var q=D.name,H=ol(m,q).map(function(P){return il(P,w)}),Z=H[0],B=H[1],$=H[2];return Z.length&&(N.beforeNS[q]=Z),B.length&&(N.duringNS[q]=B),$.length&&(N.afterNS[q]=$),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(Si({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function w(){var N=function(){if(F.match(Dt))return Promise.resolve(Si({action:j({},E,{type:X+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(D){D.meta&&D.meta.hasCallback&&tl(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(fh(m,z.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Si({action:j({},m,{type:X}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var V,ee,De}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(p){return Promise.reject(p)}}}}}function HP(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 zP=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 Jt.apply(void 0,o)(n)(a)}}}}};function GP(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=ul(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=ul(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,ll(r.plugins,!1,t));case A.enablePlugin:return j({},t,ll(r.plugins,!0,t));default:return t}}}function ul(e,t){return e.substring(t.length+1,e.length)}function ll(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function dh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var KP={last:{},history:[]};function WP(e,t){e===void 0&&(e=KP);var r=t.options,n=t.meta;if(t.type===A.track){var a=dh(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 VP={actions:[]};function ZP(e,t){e===void 0&&(e=VP);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 hh=/#.*$/;function JP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(hh,""):"")}var vh,ph,mh,gh,YP=function(e){if(e===void 0&&(e={}),!te)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(te){for(var v,b=document.getElementsByTagName("link"),g=0;v=b[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(hh,"")}(f),c={title:r,url:l,path:JP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},XP={last:{},history:[]};function qP(e,t){e===void 0&&(e=XP);var r=t.options;if(t.type===A.page){var n=dh(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}vh=function(){if(!te)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"}(),ph=te?document.referrer:null,mh=kP(),gh=_P();var fl={initialized:!1,sessionId:ca(),app:null,version:null,debug:!1,offline:!!te&&!navigator.onLine,os:{name:vh},userAgent:te?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:gh,locale:mh,campaign:{},referrer:ph};function QP(e,t){e===void 0&&(e=fl);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({},fl,e,{initialized:!0})}}var eE=["plugins","reducers","storage"];function tE(e,t,r){if(te){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function rE(e){var t=tE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function yh(){return mt("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 Zt[Vt].analytics.push(o.action||o),i(o)}})}}}function dl(e){return function(){return Jt(Jt.apply(null,arguments),yh())}}function Ti(e){return e?oh(e)?e:[e]:[]}function hl(e,t,r){e===void 0&&(e={});var n,a,i=ca();return t&&(mr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ue(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 nE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(ue(w))return m.middlewares=m.middlewares.concat(w),m;if(w.NAMESPACE&&(w.name=w.NAMESPACE),!w.name)throw new Error("https://lytics.dev/errors/1");w.config||(w.config={});var E=w.EVENTS?Object.keys(w.EVENTS).map(function(D){return w.EVENTS[D]}):[];m.pluginEnabled[w.name]=!(w.enabled===!1||w.config.enabled===!1),delete w.enabled,w.methods&&(m.methods[w.name]=Object.keys(w.methods).reduce(function(D,q){var H;return D[q]=(H=w.methods[q],function(){for(var Z=Array.prototype.slice.call(arguments),B=new Array(H.length),$=0;$<Z.length;$++)B[$]=Z[$];return B[B.length]=S,H.apply({instance:S},B)}),D},{}),delete w.methods);var U=Object.keys(w).concat(E),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(w),m.plugins[w.name])throw new Error(w.name+"AlreadyLoaded");return m.plugins[w.name]=w,m.plugins[w.name].loaded||(m.plugins[w.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:pt,setItem:mt,removeItem:tr},i=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ce(U)&&U[w]?U[w]:el(m)[w]||pt(fo(w))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!lo.includes(m)}).sort(),u=new Set(s.concat(Tn).filter(function(m){return!lo.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new zP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=RP(),T=el(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=ca());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:Ti(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:Ti(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var N=qe(m)?m:null,D=ce(m)?m:w,q=E||{},H=S.user();mt(fo(Ze),N);var Z=N||D.userId||i(Ze,S,D);return Promise.resolve(new Promise(function(B){R.dispatch(j({type:A.identifyStart,userId:Z,traits:D||{},options:q,anonymousId:H.anonymousId},H.id&&H.id!==N&&{previousId:H.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var N=ce(m)?m.event:m;if(!N||!qe(N))throw new Error("EventMissing");var D=ce(m)?m:w||{},q=ce(E)?E:{};return Promise.resolve(new Promise(function(H){R.dispatch({type:A.trackStart,event:N,properties:D,options:q,userId:i(Ze,S,w),anonymousId:i(Ut,S,w)},H,[w,E,U])}))}catch(H){return Promise.reject(H)}},page:function(m,w,E){try{var U=ce(m)?m:{},N=ce(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:YP(U),options:N,userId:i(Ze,S,U),anonymousId:i(Ut,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ze||m==="id")return i(Ze,S);if(m===Ut||m==="anonId")return i(Ut,S);var w=S.getState("user");return m?Vu(w,m):w},reset:function(m){return new Promise(function(w){R.dispatch({type:A.resetStart},w,m)})},ready:function(m){return p&&m({plugins:y,instance:S}),S.on(A.ready,function(w){m(w),p=!0})},on:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(H){return function(Z){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:o}),Z(B)}}},N=function(H){return function(Z){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:o}),Z(B)}}};return d(U,dn),d(N,hn),function(){h(U,dn),h(N,hn)}}var D=m.match(E)?dn:hn,q=function(H){return function(Z){return function(B){return B.type===m&&w({payload:B,instance:S,plugins:o,abort:b}),Z(B)}}};return d(q,D),function(){return h(q,D)}},once:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=S.on(m,function(U){w({payload:U.payload,instance:S,plugins:o,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?Vu(w,m):Object.assign({},w)},dispatch:function(m){var w=qe(m)?{type:m}:m;if(Tn.includes(w.type))throw new Error("reserved action "+w.type);var E=j({},w,{_:j({originalAction:w.type},m._||{})});R.dispatch(E)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(m,w,E){R.dispatch({type:A.setItemStart,key:m,value:w,options:E})},removeItem:function(m,w){R.dispatch({type:A.removeItemStart,key:m,options:w})}},setAnonymousId:function(m,w){S.storage.setItem(Qe,m,w)},events:{core:Tn,plugins:s}},O=n.middlewares.concat([function(m){return function(w){return function(E){return E.meta||(E.meta=hl()),w(E)}}},v(dn),BP(S,l,{all:f,plugins:s}),HP(a),NP(S),DP(S),v(hn)]),_={context:QP,user:xP(a),page:qP,track:WP,plugins:GP(l),queue:ZP},k=Jt,M=Jt;if(te&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?yh():ce(typeof arguments[0])?dl():dl().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return eE.includes(E)||(w[E]=m[E]),w},{})}(e),x=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,N=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!N({config:U}),config:U},m},{}),z={context:L,user:I,plugins:x},R=ch(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var N=w[U];typeof m[N]===Je&&(E[N]=m[N])}var D,q=Object.keys(E);try{(function(H){Object.keys(H).forEach(function(Z){var B=H[Z];if(typeof B(void 0,{type:"@@redux/INIT"})===ze||typeof B(void 0,{type:jP})===ze)throw new Error("reducer "+Z+" "+ze)})})(E)}catch(H){D=H}return function(H,Z){if(H===void 0&&(H={}),D)throw D;for(var B=!1,$={},P=0;P<q.length;P++){var C=q[P],Y=H[C],W=(0,E[C])(Y,Z);if(typeof W===ze){var tt=LP(C,Z);throw new Error(tt)}$[C]=W,B=B||W!==Y}return B?$:H}}(j({},_,t)),z,M(k(UP.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:hl(m.meta,w,Ti(E))});return X.apply(null,[U])});var V=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:V,config:L,params:g,user:I,initialUser:r,persistedUser:T});var ee=V.filter(function(m){return n.pluginEnabled[m]}),De=V.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:V,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,w){var E=m.bootstrap,U=m.config,N=m.name;E&&ue(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:ee,disabled:De})}),rE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return lh(m,w,E)},3e3)}(R,l,S),S}var dn="before",hn="after",Tr="cookie",ct=Sh(),wh=ua,aE=ua;function bh(e){return ct?ua(e,"",-1):tr(e)}function Sh(){if(ct!==void 0)return ct;var e="cookiecookie";try{ua(e,e),ct=document.cookie.indexOf(e)!==-1,bh(e)}catch{ct=!1}return ct}function ua(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return ct===!1&&(o?mt(e,t):pt(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 Pr="localStorage",iE=os.bind(null,"localStorage");rr("localStorage","getItem",pt);rr("localStorage","setItem",mt);rr("localStorage","removeItem",tr);var Er="sessionStorage",oE=os.bind(null,"sessionStorage");rr("sessionStorage","getItem",pt);rr("sessionStorage","setItem",mt);rr("sessionStorage","removeItem",tr);function Mt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ce(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var sE=iE(),cE=oE(),uE=Sh();function $h(e,t){if(e){var r=ss(t),n=!fs(r),a=cs(r)?Mt(localStorage.getItem(e)):void 0;if(n&&!Lt(a))return a;var i=us(r)?Mt(wh(e)):void 0;if(n&&i)return i;var o=ls(r)?Mt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=pt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function lE(e,t,r){if(e&&!Lt(t)){var n={},a=ss(r),i=JSON.stringify(t),o=!fs(a);return cs(a)&&(n[Pr]=vn(Pr,t,Mt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Pr]:us(a)&&(n[Tr]=vn(Tr,t,Mt(wh(e))),aE(e,i),o)?n[Tr]:ls(a)&&(n[Er]=vn(Er,t,Mt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Er]:(n[Ir]=vn(Ir,t,pt(e)),mt(e,t),o?n[Ir]:n)}}function fE(e,t){if(e){var r=ss(t),n=$h(e,nh),a={};return!Lt(n.localStorage)&&cs(r)&&(localStorage.removeItem(e),a[Pr]=n.localStorage),!Lt(n.cookie)&&us(r)&&(bh(e),a[Tr]=n.cookie),!Lt(n.sessionStorage)&&ls(r)&&(sessionStorage.removeItem(e),a[Er]=n.sessionStorage),!Lt(n.global)&&la(r,Ir)&&(tr(e),a[Ir]=n.global),a}}function ss(e){return e?qe(e)?e:e.storage:rh}function cs(e){return sE&&la(e,Pr)}function us(e){return uE&&la(e,Tr)}function ls(e){return cE&&la(e,Er)}function fs(e){return e===nh||e==="all"}function la(e,t){return e===rh||e===t||fs(e)}function vn(e,t,r){return{location:e,current:t,previous:r}}var dE={setItem:lE,getItem:$h,removeItem:fE};function hE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vl(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 pl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vl(Object(r),!0).forEach(function(n){hE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:dE};return nE(pl(pl({},t),e))}function pE(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 mE(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=yE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function gE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function yE(e){return["#","?"].forEach(t=>e=gE(e,t)),e}function wE(){mE(()=>{Be.page()})}function bE(e){if(e===void 0&&(e={}),!te)return uo;var t=gl(),r=ho(),n=ml(),a=pn(n,t),i=pn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return uo;var h=d.map(function(b){return Number(b)}),v=AP(function(){var b=gl(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(b,h),T=ho(),I=ml(),y=pn(I,b),p=pn(T,b);if(l=y>l?y:l,c=p<c?p:c,!(o.length>=h.length)){var S=f===I,O="up";S?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(V){return V!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=y?(L.foundFunc=[x],L):(S&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ue(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;ue(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function ho(){return te?document.body.scrollTop||document.documentElement.scrollTop:0}function SE(){return te?window.innerHeight||document.documentElement.clientHeight:0}function ml(){return Math.round(ho()+SE())}function gl(){if(!te)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function pn(e,t){return Math.round(e/t*100)}var yl="EventListener";function $E(e){return function(t,r,n,a){var i=n||uo,o=a||!1;if(!te)return i;var s=Fn(r),u=Fn(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"+yl:"remove"+yl,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?IE(i):i:f[h]||i;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],o)}return l.bind(null,!c)}(e)}}function Fn(e,t){if(qe(e))return t?Fn(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=OP(e);return t?i.map(function(o){return qe(o)?Fn(o,!0):o}).flat():i}function IE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Pi=$E("Event");function Ih(e,t){return te&&ue(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ue(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Ih.bind(null,"onerror");Ih.bind(null,"onload");var Th=typeof window>"u",wl="hidden";function TE(e){if(Th)return!1;var t=PE(),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 PE(){var e=["webkit","moz","ms","o"];return Th||wl in document?wl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var EE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function OE(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=TE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(EE.map(function(s){return Pi(document,s,r)})).concat(Pi(window,"load",r)).concat(Pi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function kE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(dr(d),g),a&&l&&(l=!1,a(dr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(dr(d),g))},s)}var b=OE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:dr(d,c),idle:l?dr(r,c):0}}}}function dr(e,t){return t?0:Math.round((new Date-e)/1e3)}const bl=5e3;class _E{constructor(t){ve(this,"element");ve(this,"isInViewport",!1);ve(this,"isAwake",!1);ve(this,"isFlushing");ve(this,"observer");ve(this,"lastEventAt",Date.now());ve(this,"registeredView",!1);ve(this,"viewCallback");ve(this,"activeDurationCallback");ve(this,"idleDurationCallback");ve(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),kE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:bl}),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*bl: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 Sl="sesamy_session_id";function RE(){let e=sessionStorage.getItem(Sl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Sl,e)),e}let Ph=!1,vo,$l,Bn;const Eh=new Map;function CE({clientId:e,enabled:t=!0,environment:r}){if(vo=e,$l=t,Bn=`${He("logs",r)}/events`,!$l)return;window.addEventListener("beforeunload",()=>{kh.forEach((a,i)=>{a.bind(i)()}),jE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Eh.forEach((a,i)=>{a.bind(i)()})}),wE();const n=new _E({element:document.body,viewCallback:()=>{Be.page()},activeDurationCallback:(a,i,o)=>{Be.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Be.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Be.track("scroll",{scroll:a.scrollMax})}});LE(document.body,()=>{n.flush()}),UE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(he.AUTHENTICATED,async a=>{const i=a;await Be.identify(i.detail.sub)}),window.addEventListener(he.LOGOUT,async()=>{await Be.track("logout",{}),ds.flush(),await Be.reset()})}function Oh(e){return JSON.stringify(e.map(t=>({...t,clientId:vo,requestId:Math.random().toString(36).slice(2,9),sessionId:RE(),timestamp:new Date().toISOString(),version:is,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:th,userAgent:navigator.userAgent,clientId:vo}})))}const ds=pE(async e=>{if(e.length>0){const t=Oh(e);Ph?navigator.sendBeacon(Bn,t):(await fetch(Bn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ei(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Bn,Oh([r]))}else ds.push(e)}const Be=vE({app:th,version:is,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ei({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ei({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ei({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function AE(e,t){Be.track(e,t)}function jE(){return Ph=!0,ds.flush()}const kh=new Map;function LE(e,t){kh.set(e,t)}function UE(e,t){Eh.set(e,t)}const NE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function xE(){return new Promise(e=>{const t=NE.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 DE(){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 ME(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:b,getProfile:g,updateProfile:T,getTags:I,deleteTag:y,setTag:p,getUserMetadata:S,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:X,deleteTally:L,getProduct:x,getPaymentIssues:z,isSpotifyLinked:R,unlinkSpotify:V,linkSpotify:ee,autoOnboardProduct:De,openHostedAccountPage:m,generateLink:w,hasAccess:E}=gP(e),U={auth:{getUser:g,isAuthenticated:_r,loginWithRedirect:ns,logout:Vd,setToken:Jd},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:V},analytics:{track:AE},tags:{list:I,set:p,delete:y},entitlements:{get:a,list:i,hasAccess:E,access:o,signedLinks:as},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:S,list:O,set:_,delete:k},tallies:{get:M,list:F,push:X,delete:L},subscriptions:{list:u},transactions:{get:v,list:b},products:{get:x,autoOnboard:De,linkSpotify:ee},browser:{detectAdblock:xE,isInAppBrowser:DE},getVersion:FE,getPaymentIssues:z,generateLink:w,clearCache:Ee,log:Re};return e.namespace&&(window[e.namespace]=U),U}function FE(){return is}function BE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
7
7
|
${t.selector}::before {
|
|
8
8
|
content: '';
|
|
9
9
|
position: absolute;
|
|
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw
|
|
|
14
14
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
|
-
`,document.head.appendChild(i)}async function
|
|
17
|
+
`,document.head.appendChild(i)}async function _h(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}async function HE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await _h(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function zE(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await _h(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function GE({enabled:e=!1,rules:t}){if(!e)return;const r=await _r(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await HE(s,a);break;case"replace":await zE(s,a);break;case"remove":o.remove();break;case"gradient":BE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const Il="access_token";function KE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(Il);if(t){Jd(t);const r=new URL(window.location.href);e.delete(Il),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const Tl="sesamy-refresh",Pl="force-refetch-entitlements";function WE(){const e=new URLSearchParams(window.location.search),t=e.get(Pl),r=e.get(Tl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(Pl),e.delete(Tl),n.search=e.toString(),Ee(),window.history.replaceState(null,"",n)}}function VE(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function ZE(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=VE(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};mP(f)}catch(s){Re(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const El="sesamy-user";async function JE(){var a;const t=(a=new URLSearchParams(window.location.search).get(El))==null?void 0:a.toLowerCase();if(!t)return;const r=await rP();(r==null?void 0:r.email)!==t?(Re(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),Ee(),ns({authorizationParams:{email_hint:t,login_hint:t}})):Re(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(El),window.history.replaceState(null,"",n)}const Ol="sesamy-purchase";function YE(){const e=new URLSearchParams(window.location.search),t=e.get(Ol);if(t!==null){const r=new URL(window.location.href);e.delete(Ol),r.search=e.toString(),console.log("purchase",t),Ke(he.PURCHASE,{itemSrc:t}),Ee(),window.history.replaceState(null,"",r)}}const kl="sesamy-login",XE="sesamy_login";async function qE(){const e=new URLSearchParams(window.location.search);if(!(e.get(kl)||e.get(XE)))return;await _r()||ns();const n=new URL(window.location.href);n.searchParams.delete(kl),window.history.replaceState(null,"",n)}const _l="sesamy-debug";async function QE(){var n;const t=(n=new URLSearchParams(window.location.search).get(_l))==null?void 0:n.toLowerCase();if(!t)return;TT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(_l),window.history.replaceState(null,"",r)}const eO=typeof window<"u";async function Rl(e){Re(`Init with config: ${JSON.stringify(e)}`);try{CE({clientId:e.clientId,environment:e.environment,...e.analytics}),await tP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await GE(e.transform),QE(),KE(),WE(),ZE(),await qE(),await JE(),YE(),Ke(he.READY,{})}catch(t){Re(`Failed to init ${t.message}`)}}async function Rh(e){const t=ME({clientId:e.clientId,environment:e.environment,...e.api});return eO&&(e.awaitAllServices?await Rl(e):Rl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Rh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Rh;
|