@sesamy/sesamy-js 1.28.0 → 1.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- "use strict";var Vh=Object.defineProperty;var Zh=(e,t,r)=>t in e?Vh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Zh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ne=function(e){try{return!!e()}catch{return!0}},Jh=ne,Vn=!Jh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Fl=Vn,Bl=Function.prototype,jo=Bl.call,Yh=Fl&&Bl.bind.bind(jo,jo),G=Fl?Yh:function(e){return function(){return jo.apply(e,arguments)}},zl=G,qh=zl({}.toString),Xh=zl("".slice),Zn=function(e){return Xh(qh(e),8,-1)},Qh=G,ev=ne,tv=Zn,ma=Object,rv=Qh("".split),Hl=ev(function(){return!ma("z").propertyIsEnumerable(0)})?function(e){return tv(e)==="String"?rv(e,""):ma(e)}:ma,Jn=function(e){return e==null},nv=Jn,av=TypeError,Yn=function(e){if(nv(e))throw new av("Can't call method on "+e);return e},ov=Hl,iv=Yn,Ur=function(e){return ov(iv(e))},sr=function(e){return e&&e.Math===Math&&e},K=sr(typeof globalThis=="object"&&globalThis)||sr(typeof window=="object"&&window)||sr(typeof self=="object"&&self)||sr(typeof Kr=="object"&&Kr)||sr(typeof Kr=="object"&&Kr)||function(){return this}()||Function("return this")(),Gl={exports:{}},sv=!1,Is=K,cv=Object.defineProperty,$i=function(e,t){try{cv(Is,e,{value:t,configurable:!0,writable:!0})}catch{Is[e]=t}return t},uv=K,lv=$i,Ts="__core-js_shared__",Ps=Gl.exports=uv[Ts]||lv(Ts,{});(Ps.versions||(Ps.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 Ii=Gl.exports,Es=Ii,Kl=function(e,t){return Es[e]||(Es[e]=t||{})},fv=Yn,dv=Object,qn=function(e){return dv(fv(e))},hv=G,vv=qn,pv=hv({}.hasOwnProperty),Ie=Object.hasOwn||function(t,r){return pv(vv(t),r)},mv=G,gv=0,yv=Math.random(),wv=mv(1 .toString),Wl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+wv(++gv+yv,36)},bv=K,Os=bv.navigator,ks=Os&&Os.userAgent,xr=ks?String(ks):"",Vl=K,ga=xr,_s=Vl.process,Rs=Vl.Deno,Cs=_s&&_s.versions||Rs&&Rs.version,As=Cs&&Cs.v8,Re,_n;As&&(Re=As.split("."),_n=Re[0]>0&&Re[0]<4?1:+(Re[0]+Re[1]));!_n&&ga&&(Re=ga.match(/Edge\/(\d+)/),(!Re||Re[1]>=74)&&(Re=ga.match(/Chrome\/(\d+)/),Re&&(_n=+Re[1])));var Zl=_n,js=Zl,Sv=ne,$v=K,Iv=$v.String,Jl=!!Object.getOwnPropertySymbols&&!Sv(function(){var e=Symbol("symbol detection");return!Iv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&js&&js<41}),Tv=Jl,Yl=Tv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pv=K,Ev=Kl,Ls=Ie,Ov=Wl,kv=Jl,_v=Yl,Lt=Pv.Symbol,ya=Ev("wks"),Rv=_v?Lt.for||Lt:Lt&&Lt.withoutSetter||Ov,ae=function(e){return Ls(ya,e)||(ya[e]=kv&&Ls(Lt,e)?Lt[e]:Rv("Symbol."+e)),ya[e]},wa=typeof document=="object"&&document.all,Y=typeof wa>"u"&&wa!==void 0?function(e){return typeof e=="function"||e===wa}:function(e){return typeof e=="function"},Cv=Y,Te=function(e){return typeof e=="object"?e!==null:Cv(e)},Av=Te,jv=String,Lv=TypeError,je=function(e){if(Av(e))return e;throw new Lv(jv(e)+" is not an object")},ql={},Uv=ne,oe=!Uv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),xv=oe,Nv=ne,Xl=xv&&Nv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),De={},Dv=K,Us=Te,Lo=Dv.document,Mv=Us(Lo)&&Us(Lo.createElement),Xn=function(e){return Mv?Lo.createElement(e):{}},Fv=oe,Bv=ne,zv=Xn,Ql=!Fv&&!Bv(function(){return Object.defineProperty(zv("div"),"a",{get:function(){return 7}}).a!==7}),Hv=Vn,Wr=Function.prototype.call,ie=Hv?Wr.bind(Wr):function(){return Wr.apply(Wr,arguments)},ba=K,Gv=Y,Kv=function(e){return Gv(e)?e:void 0},Pe=function(e,t){return arguments.length<2?Kv(ba[e]):ba[e]&&ba[e][t]},Wv=G,Qn=Wv({}.isPrototypeOf),Vv=Pe,Zv=Y,Jv=Qn,Yv=Yl,qv=Object,ef=Yv?function(e){return typeof e=="symbol"}:function(e){var t=Vv("Symbol");return Zv(t)&&Jv(t.prototype,qv(e))},Xv=String,ea=function(e){try{return Xv(e)}catch{return"Object"}},Qv=Y,ep=ea,tp=TypeError,Le=function(e){if(Qv(e))return e;throw new tp(ep(e)+" is not a function")},rp=Le,np=Jn,Ti=function(e,t){var r=e[t];return np(r)?void 0:rp(r)},Sa=ie,$a=Y,Ia=Te,ap=TypeError,op=function(e,t){var r,n;if(t==="string"&&$a(r=e.toString)&&!Ia(n=Sa(r,e))||$a(r=e.valueOf)&&!Ia(n=Sa(r,e))||t!=="string"&&$a(r=e.toString)&&!Ia(n=Sa(r,e)))return n;throw new ap("Can't convert object to primitive value")},ip=ie,xs=Te,Ns=ef,sp=Ti,cp=op,up=ae,lp=TypeError,fp=up("toPrimitive"),dp=function(e,t){if(!xs(e)||Ns(e))return e;var r=sp(e,fp),n;if(r){if(t===void 0&&(t="default"),n=ip(r,e,t),!xs(n)||Ns(n))return n;throw new lp("Can't convert object to primitive value")}return t===void 0&&(t="number"),cp(e,t)},hp=dp,vp=ef,tf=function(e){var t=hp(e,"string");return vp(t)?t:t+""},pp=oe,mp=Ql,gp=Xl,Vr=je,Ds=tf,yp=TypeError,Ta=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,Pa="enumerable",Ea="configurable",Oa="writable";De.f=pp?gp?function(t,r,n){if(Vr(t),r=Ds(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Oa in n&&!n[Oa]){var a=wp(t,r);a&&a[Oa]&&(t[r]=n.value,n={configurable:Ea in n?n[Ea]:a[Ea],enumerable:Pa in n?n[Pa]:a[Pa],writable:!1})}return Ta(t,r,n)}:Ta:function(t,r,n){if(Vr(t),r=Ds(r),Vr(n),mp)try{return Ta(t,r,n)}catch{}if("get"in n||"set"in n)throw new yp("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var bp=Math.ceil,Sp=Math.floor,$p=Math.trunc||function(t){var r=+t;return(r>0?Sp:bp)(r)},Ip=$p,Pi=function(e){var t=+e;return t!==t||t===0?0:Ip(t)},Tp=Pi,Pp=Math.max,Ep=Math.min,rf=function(e,t){var r=Tp(e);return r<0?Pp(r+t,0):Ep(r,t)},Op=Pi,kp=Math.min,_p=function(e){var t=Op(e);return t>0?kp(t,9007199254740991):0},Rp=_p,Ei=function(e){return Rp(e.length)},Cp=Ur,Ap=rf,jp=Ei,Ms=function(e){return function(t,r,n){var a=Cp(t),o=jp(a);if(o===0)return!e&&-1;var i=Ap(n,o),s;if(e&&r!==r){for(;o>i;)if(s=a[i++],s!==s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===r)return e||i||0;return!e&&-1}},Lp={includes:Ms(!0),indexOf:Ms(!1)},Oi={},Up=G,ka=Ie,xp=Ur,Np=Lp.indexOf,Dp=Oi,Fs=Up([].push),nf=function(e,t){var r=xp(e),n=0,a=[],o;for(o in r)!ka(Dp,o)&&ka(r,o)&&Fs(a,o);for(;t.length>n;)ka(r,o=t[n++])&&(~Np(a,o)||Fs(a,o));return a},ki=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mp=nf,Fp=ki,af=Object.keys||function(t){return Mp(t,Fp)},Bp=oe,zp=Xl,Hp=De,Gp=je,Kp=Ur,Wp=af;ql.f=Bp&&!zp?Object.defineProperties:function(t,r){Gp(t);for(var n=Kp(r),a=Wp(r),o=a.length,i=0,s;o>i;)Hp.f(t,s=a[i++],n[s]);return t};var Vp=Pe,of=Vp("document","documentElement"),Zp=Kl,Jp=Wl,Bs=Zp("keys"),_i=function(e){return Bs[e]||(Bs[e]=Jp(e))},Yp=je,qp=ql,zs=ki,Xp=Oi,Qp=of,em=Xn,tm=_i,Hs=">",Gs="<",Uo="prototype",xo="script",sf=tm("IE_PROTO"),_a=function(){},cf=function(e){return Gs+xo+Hs+e+Gs+"/"+xo+Hs},Ks=function(e){e.write(cf("")),e.close();var t=e.parentWindow.Object;return e=null,t},rm=function(){var e=em("iframe"),t="java"+xo+":",r;return e.style.display="none",Qp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(cf("document.F=Object")),r.close(),r.F},Zr,bn=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}bn=typeof document<"u"?document.domain&&Zr?Ks(Zr):rm():Ks(Zr);for(var e=zs.length;e--;)delete bn[Uo][zs[e]];return bn()};Xp[sf]=!0;var ta=Object.create||function(t,r){var n;return t!==null?(_a[Uo]=Yp(t),n=new _a,_a[Uo]=null,n[sf]=t):n=bn(),r===void 0?n:qp.f(n,r)},nm=ae,am=ta,om=De.f,No=nm("unscopables"),Do=Array.prototype;Do[No]===void 0&&om(Do,No,{configurable:!0,value:am(null)});var im=function(e){Do[No][e]=!0},Nr={},sm=K,cm=Y,Ws=sm.WeakMap,um=cm(Ws)&&/native code/.test(String(Ws)),wt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},lm=oe,fm=De,dm=wt,bt=lm?function(e,t,r){return fm.f(e,t,dm(1,r))}:function(e,t,r){return e[t]=r,e},hm=um,uf=K,vm=Te,pm=bt,Ra=Ie,Ca=Ii,mm=_i,gm=Oi,Vs="Object already initialized",Mo=uf.TypeError,ym=uf.WeakMap,Rn,Cr,Cn,wm=function(e){return Cn(e)?Cr(e):Rn(e,{})},bm=function(e){return function(t){var r;if(!vm(t)||(r=Cr(t)).type!==e)throw new Mo("Incompatible receiver, "+e+" required");return r}};if(hm||Ca.state){var Ue=Ca.state||(Ca.state=new ym);Ue.get=Ue.get,Ue.has=Ue.has,Ue.set=Ue.set,Rn=function(e,t){if(Ue.has(e))throw new Mo(Vs);return t.facade=e,Ue.set(e,t),t},Cr=function(e){return Ue.get(e)||{}},Cn=function(e){return Ue.has(e)}}else{var Tt=mm("state");gm[Tt]=!0,Rn=function(e,t){if(Ra(e,Tt))throw new Mo(Vs);return t.facade=e,pm(e,Tt,t),t},Cr=function(e){return Ra(e,Tt)?e[Tt]:{}},Cn=function(e){return Ra(e,Tt)}}var Qt={set:Rn,get:Cr,has:Cn,enforce:wm,getterFor:bm},Ri={},Ci={},lf={}.propertyIsEnumerable,ff=Object.getOwnPropertyDescriptor,Sm=ff&&!lf.call({1:2},1);Ci.f=Sm?function(t){var r=ff(this,t);return!!r&&r.enumerable}:lf;var $m=oe,Im=ie,Tm=Ci,Pm=wt,Em=Ur,Om=tf,km=Ie,_m=Ql,Zs=Object.getOwnPropertyDescriptor;Ri.f=$m?Zs:function(t,r){if(t=Em(t),r=Om(r),_m)try{return Zs(t,r)}catch{}if(km(t,r))return Pm(!Im(Tm.f,t,r),t[r])};var df={exports:{}},Fo=oe,Rm=Ie,hf=Function.prototype,Cm=Fo&&Object.getOwnPropertyDescriptor,Ai=Rm(hf,"name"),Am=Ai&&(function(){}).name==="something",jm=Ai&&(!Fo||Fo&&Cm(hf,"name").configurable),vf={EXISTS:Ai,PROPER:Am,CONFIGURABLE:jm},Lm=G,Um=Y,Bo=Ii,xm=Lm(Function.toString);Um(Bo.inspectSource)||(Bo.inspectSource=function(e){return xm(e)});var ji=Bo.inspectSource,Li=G,Nm=ne,Dm=Y,Jr=Ie,zo=oe,Mm=vf.CONFIGURABLE,Fm=ji,pf=Qt,Bm=pf.enforce,zm=pf.get,Js=String,Sn=Object.defineProperty,Hm=Li("".slice),Gm=Li("".replace),Km=Li([].join),Wm=zo&&!Nm(function(){return Sn(function(){},"length",{value:8}).length!==8}),Vm=String(String).split("String"),Zm=df.exports=function(e,t,r){Hm(Js(t),0,7)==="Symbol("&&(t="["+Gm(Js(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||Mm&&e.name!==t)&&(zo?Sn(e,"name",{value:t,configurable:!0}):e.name=t),Wm&&r&&Jr(r,"arity")&&e.length!==r.arity&&Sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?zo&&Sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Bm(e);return Jr(n,"source")||(n.source=Km(Vm,typeof t=="string"?t:"")),e};Function.prototype.toString=Zm(function(){return Dm(this)&&zm(this).source||Fm(this)},"toString");var mf=df.exports,Jm=Y,Ym=De,qm=mf,Xm=$i,Ee=function(e,t,r,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:t;if(Jm(r)&&qm(r,o,n),n.global)a?e[t]=r:Xm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Ym.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},gf={},Qm=nf,eg=ki,tg=eg.concat("length","prototype");gf.f=Object.getOwnPropertyNames||function(t){return Qm(t,tg)};var Ui={};Ui.f=Object.getOwnPropertySymbols;var rg=Pe,ng=G,ag=gf,og=Ui,ig=je,sg=ng([].concat),cg=rg("Reflect","ownKeys")||function(t){var r=ag.f(ig(t)),n=og.f;return n?sg(r,n(t)):r},Ys=Ie,ug=cg,lg=Ri,fg=De,yf=function(e,t,r){for(var n=ug(t),a=fg.f,o=lg.f,i=0;i<n.length;i++){var s=n[i];!Ys(e,s)&&!(r&&Ys(r,s))&&a(e,s,o(t,s))}},dg=ne,hg=Y,vg=/#|\.prototype\./,Dr=function(e,t){var r=mg[pg(e)];return r===yg?!0:r===gg?!1:hg(t)?dg(t):!!t},pg=Dr.normalize=function(e){return String(e).replace(vg,".").toLowerCase()},mg=Dr.data={},gg=Dr.NATIVE="N",yg=Dr.POLYFILL="P",wf=Dr,Yr=K,wg=Ri.f,bg=bt,Sg=Ee,$g=$i,Ig=yf,Tg=wf,ee=function(e,t){var r=e.target,n=e.global,a=e.stat,o,i,s,l,f,u;if(n?i=Yr:a?i=Yr[r]||$g(r,{}):i=Yr[r]&&Yr[r].prototype,i)for(s in t){if(f=t[s],e.dontCallGetSet?(u=wg(i,s),l=u&&u.value):l=i[s],o=Tg(n?s:r+(a?".":"#")+s,e.forced),!o&&l!==void 0){if(typeof f==typeof l)continue;Ig(f,l)}(e.sham||l&&l.sham)&&bg(f,"sham",!0),Sg(i,s,f,e)}},Pg=ne,Eg=!Pg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Og=Ie,kg=Y,_g=qn,Rg=_i,Cg=Eg,qs=Rg("IE_PROTO"),Ho=Object,Ag=Ho.prototype,xi=Cg?Ho.getPrototypeOf:function(e){var t=_g(e);if(Og(t,qs))return t[qs];var r=t.constructor;return kg(r)&&t instanceof r?r.prototype:t instanceof Ho?Ag:null},jg=ne,Lg=Y,Ug=Te,Xs=xi,xg=Ee,Ng=ae,Go=Ng("iterator"),bf=!1,pt,Aa,ja;[].keys&&(ja=[].keys(),"next"in ja?(Aa=Xs(Xs(ja)),Aa!==Object.prototype&&(pt=Aa)):bf=!0);var Dg=!Ug(pt)||jg(function(){var e={};return pt[Go].call(e)!==e});Dg&&(pt={});Lg(pt[Go])||xg(pt,Go,function(){return this});var Sf={IteratorPrototype:pt,BUGGY_SAFARI_ITERATORS:bf},Mg=De.f,Fg=Ie,Bg=ae,Qs=Bg("toStringTag"),er=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Fg(e,Qs)&&Mg(e,Qs,{configurable:!0,value:t})},zg=Sf.IteratorPrototype,Hg=ta,Gg=wt,Kg=er,Wg=Nr,Vg=function(){return this},$f=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Hg(zg,{next:Gg(+!n,r)}),Kg(e,a,!1),Wg[a]=Vg,e},Zg=G,Jg=Le,Yg=function(e,t,r){try{return Zg(Jg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},qg=Te,Xg=function(e){return qg(e)||e===null},Qg=Xg,ey=String,ty=TypeError,ry=function(e){if(Qg(e))return e;throw new ty("Can't set "+ey(e)+" as a prototype")},ny=Yg,ay=Te,oy=Yn,iy=ry,Ni=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=ny(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,o){return oy(a),iy(o),ay(a)&&(e?r(a,o):a.__proto__=o),a}}():void 0),sy=ee,cy=ie,If=vf,uy=Y,ly=$f,ec=xi,tc=Ni,fy=er,dy=bt,La=Ee,hy=ae,vy=Nr,Tf=Sf,py=If.PROPER,my=If.CONFIGURABLE,rc=Tf.IteratorPrototype,qr=Tf.BUGGY_SAFARI_ITERATORS,cr=hy("iterator"),nc="keys",ur="values",ac="entries",gy=function(){return this},Pf=function(e,t,r,n,a,o,i){ly(r,t,n);var s=function(I){if(I===a&&d)return d;if(!qr&&I&&I in u)return u[I];switch(I){case nc:return function(){return new r(this,I)};case ur:return function(){return new r(this,I)};case ac:return function(){return new r(this,I)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,c=u[cr]||u["@@iterator"]||a&&u[a],d=!qr&&c||s(a),h=t==="Array"&&u.entries||c,v,b,g;if(h&&(v=ec(h.call(new e)),v!==Object.prototype&&v.next&&(ec(v)!==rc&&(tc?tc(v,rc):uy(v[cr])||La(v,cr,gy)),fy(v,l,!0))),py&&a===ur&&c&&c.name!==ur&&(my?dy(u,"name",ur):(f=!0,d=function(){return cy(c,this)})),a)if(b={values:s(ur),keys:o?d:s(nc),entries:s(ac)},i)for(g in b)(qr||f||!(g in u))&&La(u,g,b[g]);else sy({target:t,proto:!0,forced:qr||f},b);return u[cr]!==d&&La(u,cr,d,{name:a}),vy[t]=d,b},Di=function(e,t){return{value:e,done:t}},yy=Ur,Mi=im,oc=Nr,Ef=Qt,wy=De.f,by=Pf,Xr=Di,Sy=oe,Of="Array Iterator",$y=Ef.set,Iy=Ef.getterFor(Of),Ty=by(Array,"Array",function(e,t){$y(this,{type:Of,target:yy(e),index:0,kind:t})},function(){var e=Iy(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Xr(void 0,!0);switch(e.kind){case"keys":return Xr(r,!1);case"values":return Xr(t[r],!1)}return Xr([r,t[r]],!1)},"values"),ic=oc.Arguments=oc.Array;Mi("keys");Mi("values");Mi("entries");if(Sy&&ic.name!=="values")try{wy(ic,"name",{value:"values"})}catch{}var Py=ee,Ey=G,Oy=rf,ky=RangeError,sc=String.fromCharCode,cc=String.fromCodePoint,_y=Ey([].join),Ry=!!cc&&cc.length!==1;Py({target:"String",stat:!0,arity:1,forced:Ry},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,o;n>a;){if(o=+arguments[a++],Oy(o,1114111)!==o)throw new ky(o+" is not a valid code point");r[a]=o<65536?sc(o):sc(((o-=65536)>>10)+55296,o%1024+56320)}return _y(r,"")}});var uc=K,Cy=oe,Ay=Object.getOwnPropertyDescriptor,kf=function(e){if(!Cy)return uc[e];var t=Ay(uc,e);return t&&t.value},jy=ne,Ly=ae,Uy=oe,lc=sv,xy=Ly("iterator"),ra=!jy(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,o){t.delete("b"),n+=o+a}),r.delete("a",2),r.delete("b",void 0),lc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(lc||!Uy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[xy]||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"}),fc=mf,Ny=De,na=function(e,t,r){return r.get&&fc(r.get,t,{getter:!0}),r.set&&fc(r.set,t,{setter:!0}),Ny.f(e,t,r)},Dy=Ee,My=function(e,t,r){for(var n in t)Dy(e,n,t[n],r);return e},Fy=Qn,By=TypeError,Fi=function(e,t){if(Fy(t,e))return e;throw new By("Incorrect invocation")},zy=Zn,Hy=G,Gy=function(e){if(zy(e)==="Function")return Hy(e)},dc=Gy,Ky=Le,Wy=Vn,Vy=dc(dc.bind),tr=function(e,t){return Ky(e),t===void 0?e:Wy?Vy(e,t):function(){return e.apply(t,arguments)}},Zy=ae,Jy=Zy("toStringTag"),_f={};_f[Jy]="z";var Bi=String(_f)==="[object z]",Yy=Bi,qy=Y,$n=Zn,Xy=ae,Qy=Xy("toStringTag"),ew=Object,tw=$n(function(){return arguments}())==="Arguments",rw=function(e,t){try{return e[t]}catch{}},Mr=Yy?$n:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=rw(t=ew(e),Qy))=="string"?r:tw?$n(t):(n=$n(t))==="Object"&&qy(t.callee)?"Arguments":n},nw=Mr,aw=String,Ze=function(e){if(nw(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return aw(e)},ow=Mr,hc=Ti,iw=Jn,sw=Nr,cw=ae,uw=cw("iterator"),aa=function(e){if(!iw(e))return hc(e,uw)||hc(e,"@@iterator")||sw[ow(e)]},lw=ie,fw=Le,dw=je,hw=ea,vw=aa,pw=TypeError,zi=function(e,t){var r=arguments.length<2?vw(e):t;if(fw(r))return dw(lw(r,e));throw new pw(hw(e)+" is not iterable")},mw=TypeError,St=function(e,t){if(e<t)throw new mw("Not enough arguments");return e},gw=G,oa=gw([].slice),vc=oa,yw=Math.floor,Ko=function(e,t){var r=e.length;if(r<8)for(var n=1,a,o;n<r;){for(o=n,a=e[n];o&&t(e[o-1],a)>0;)e[o]=e[--o];o!==n++&&(e[o]=a)}else for(var i=yw(r/2),s=Ko(vc(e,0,i),t),l=Ko(vc(e,i),t),f=s.length,u=l.length,c=0,d=0;c<f||d<u;)e[c+d]=c<f&&d<u?t(s[c],l[d])<=0?s[c++]:l[d++]:c<f?s[c++]:l[d++];return e},ww=Ko,Wo=ee,Rf=K,Hi=kf,bw=Pe,Qr=ie,Ae=G,Sr=oe,Cf=ra,Af=Ee,Sw=na,$w=My,Iw=er,Tw=$f,Gi=Qt,jf=Fi,Ua=Y,Pw=Ie,Ew=tr,Ow=Mr,kw=je,Lf=Te,ce=Ze,_w=ta,pc=wt,mc=zi,Rw=aa,en=Di,Pt=St,Cw=ae,Aw=ww,jw=Cw("iterator"),rr="URLSearchParams",Uf=rr+"Iterator",xf=Gi.set,be=Gi.getterFor(rr),Lw=Gi.getterFor(Uf),gc=Hi("fetch"),An=Hi("Request"),$r=Hi("Headers"),xa=An&&An.prototype,yc=$r&&$r.prototype,Uw=Rf.TypeError,xw=Rf.encodeURIComponent,Nw=String.fromCharCode,Dw=bw("String","fromCodePoint"),Mw=parseInt,In=Ae("".charAt),wc=Ae([].join),Qe=Ae([].push),Nf=Ae("".replace),Fw=Ae([].shift),bc=Ae([].splice),Sc=Ae("".split),Df=Ae("".slice),Bw=Ae(/./.exec),zw=/\+/g,Na="�",Hw=/^[0-9a-f]+$/i,$c=function(e,t){var r=Df(e,t,t+2);return Bw(Hw,r)?Mw(r,16):NaN},Gw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Kw=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},Ic=function(e){e=Nf(e,zw," ");for(var t=e.length,r="",n=0;n<t;){var a=In(e,n);if(a==="%"){if(In(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var o=$c(e,n+1);if(o!==o){r+=a,n++;continue}n+=2;var i=Gw(o);if(i===0)a=Nw(o);else{if(i===1||i>4){r+=Na,n++;continue}for(var s=[o],l=1;l<i&&(n++,!(n+3>t||In(e,n)!=="%"));){var f=$c(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Qe(s,f),n+=2,l++}if(s.length!==i){r+=Na;continue}var u=Kw(s);u===null?r+=Na:a=Dw(u)}}r+=a,n++}return r},Ww=/[!'()~]|%20/g,Vw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Zw=function(e){return Vw[e]},Tc=function(e){return Nf(xw(e),Ww,Zw)},Da=Tw(function(t,r){xf(this,{type:Uf,target:be(t).entries,index:0,kind:r})},rr,function(){var t=Lw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,en(void 0,!0);var a=r[n];switch(t.kind){case"keys":return en(a.key,!1);case"values":return en(a.value,!1)}return en([a.key,a.value],!1)},!0),Mf=function(e){this.entries=[],this.url=null,e!==void 0&&(Lf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?In(e,0)==="?"?Df(e,1):e:ce(e)))};Mf.prototype={type:rr,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Rw(e),n,a,o,i,s,l,f;if(r)for(n=mc(e,r),a=n.next;!(o=Qr(a,n)).done;){if(i=mc(kw(o.value)),s=i.next,(l=Qr(s,i)).done||(f=Qr(s,i)).done||!Qr(s,i).done)throw new Uw("Expected sequence with length 2");Qe(t,{key:ce(l.value),value:ce(f.value)})}else for(var u in e)Pw(e,u)&&Qe(t,{key:u,value:ce(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Sc(e,"&"),n=0,a,o;n<r.length;)a=r[n++],a.length&&(o=Sc(a,"="),Qe(t,{key:Ic(Fw(o)),value:Ic(wc(o,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Qe(t,Tc(n.key)+"="+Tc(n.value));return wc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ia=function(){jf(this,Ht);var t=arguments.length>0?arguments[0]:void 0,r=xf(this,new Mf(t));Sr||(this.size=r.entries.length)},Ht=ia.prototype;$w(Ht,{append:function(t,r){var n=be(this);Pt(arguments.length,2),Qe(n.entries,{key:ce(t),value:ce(r)}),Sr||this.length++,n.updateURL()},delete:function(e){for(var t=be(this),r=Pt(arguments.length,1),n=t.entries,a=ce(e),o=r<2?void 0:arguments[1],i=o===void 0?o:ce(o),s=0;s<n.length;){var l=n[s];if(l.key===a&&(i===void 0||l.value===i)){if(bc(n,s,1),i!==void 0)break}else s++}Sr||(this.size=n.length),t.updateURL()},get:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=ce(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=ce(t),a=[],o=0;o<r.length;o++)r[o].key===n&&Qe(a,r[o].value);return a},has:function(t){for(var r=be(this).entries,n=Pt(arguments.length,1),a=ce(t),o=n<2?void 0:arguments[1],i=o===void 0?o:ce(o),s=0;s<r.length;){var l=r[s++];if(l.key===a&&(i===void 0||l.value===i))return!0}return!1},set:function(t,r){var n=be(this);Pt(arguments.length,1);for(var a=n.entries,o=!1,i=ce(t),s=ce(r),l=0,f;l<a.length;l++)f=a[l],f.key===i&&(o?bc(a,l--,1):(o=!0,f.value=s));o||Qe(a,{key:i,value:s}),Sr||(this.size=a.length),n.updateURL()},sort:function(){var t=be(this);Aw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=be(this).entries,n=Ew(t,arguments.length>1?arguments[1]:void 0),a=0,o;a<r.length;)o=r[a++],n(o.value,o.key,this)},keys:function(){return new Da(this,"keys")},values:function(){return new Da(this,"values")},entries:function(){return new Da(this,"entries")}},{enumerable:!0});Af(Ht,jw,Ht.entries,{name:"entries"});Af(Ht,"toString",function(){return be(this).serialize()},{enumerable:!0});Sr&&Sw(Ht,"size",{get:function(){return be(this).entries.length},configurable:!0,enumerable:!0});Iw(ia,rr);Wo({global:!0,constructor:!0,forced:!Cf},{URLSearchParams:ia});if(!Cf&&Ua($r)){var Jw=Ae(yc.has),Yw=Ae(yc.set),Pc=function(e){if(Lf(e)){var t=e.body,r;if(Ow(t)===rr)return r=e.headers?new $r(e.headers):new $r,Jw(r,"content-type")||Yw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),_w(e,{body:pc(0,ce(t)),headers:pc(0,r)})}return e};if(Ua(gc)&&Wo({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return gc(t,arguments.length>1?Pc(arguments[1]):{})}}),Ua(An)){var Ma=function(t){return jf(this,xa),new An(t,arguments.length>1?Pc(arguments[1]):{})};xa.constructor=Ma,Ma.prototype=xa,Wo({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ma})}}var qw={URLSearchParams:ia,getState:be},Xw=Ee,sa=G,Ec=Ze,Qw=St,Ff=URLSearchParams,ca=Ff.prototype,eb=sa(ca.append),Oc=sa(ca.delete),tb=sa(ca.forEach),rb=sa([].push),Ki=new Ff("a=1&a=2&b=3");Ki.delete("a",1);Ki.delete("b",void 0);Ki+""!="a=2"&&Xw(ca,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Oc(this,e);var n=[];tb(this,function(c,d){rb(n,{key:d,value:c})}),Qw(t,1);for(var a=Ec(e),o=Ec(r),i=0,s=0,l=!1,f=n.length,u;i<f;)u=n[i++],l||u.key===a?(l=!0,Oc(this,u.key)):s++;for(;s<f;)u=n[s++],u.key===a&&u.value===o||eb(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var nb=Ee,Bf=G,ab=Ze,ob=St,zf=URLSearchParams,Wi=zf.prototype,ib=Bf(Wi.getAll),sb=Bf(Wi.has),kc=new zf("a=1");(kc.has("a",2)||!kc.has("a",void 0))&&nb(Wi,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return sb(this,t);var a=ib(this,t);ob(r,1);for(var o=ab(n),i=0;i<a.length;)if(a[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0});var cb=oe,ub=G,lb=na,Vo=URLSearchParams.prototype,fb=ub(Vo.forEach);cb&&!("size"in Vo)&&lb(Vo,"size",{get:function(){var t=0;return fb(this,function(){t++}),t},configurable:!0,enumerable:!0});var db=K,Vi=db,hb=Vi;hb.URLSearchParams;var Zi=G,vb=Pi,pb=Ze,mb=Yn,gb=Zi("".charAt),_c=Zi("".charCodeAt),yb=Zi("".slice),Rc=function(e){return function(t,r){var n=pb(mb(t)),a=vb(r),o=n.length,i,s;return a<0||a>=o?e?"":void 0:(i=_c(n,a),i<55296||i>56319||a+1===o||(s=_c(n,a+1))<56320||s>57343?e?gb(n,a):i:e?yb(n,a,a+2):(i-55296<<10)+(s-56320)+65536)}},Hf={codeAt:Rc(!1),charAt:Rc(!0)},wb=Hf.charAt,bb=Ze,Gf=Qt,Sb=Pf,Cc=Di,Kf="String Iterator",$b=Gf.set,Ib=Gf.getterFor(Kf);Sb(String,"String",function(e){$b(this,{type:Kf,string:bb(e),index:0})},function(){var t=Ib(this),r=t.string,n=t.index,a;return n>=r.length?Cc(void 0,!0):(a=wb(r,n),t.index+=a.length,Cc(a,!1))});var Ac=oe,Tb=G,Pb=ie,Eb=ne,Fa=af,Ob=Ui,kb=Ci,_b=qn,Rb=Hl,Et=Object.assign,jc=Object.defineProperty,Cb=Tb([].concat),Ab=!Et||Eb(function(){if(Ac&&Et({b:1},Et(jc({},"a",{enumerable:!0,get:function(){jc(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}),Et({},e)[r]!==7||Fa(Et({},t)).join("")!==n})?function(t,r){for(var n=_b(t),a=arguments.length,o=1,i=Ob.f,s=kb.f;a>o;)for(var l=Rb(arguments[o++]),f=i?Cb(Fa(l),i(l)):Fa(l),u=f.length,c=0,d;u>c;)d=f[c++],(!Ac||Pb(s,l,d))&&(n[d]=l[d]);return n}:Et,jb=ie,Lc=je,Lb=Ti,Wf=function(e,t,r){var n,a;Lc(e);try{if(n=Lb(e,"return"),!n){if(t==="throw")throw r;return r}n=jb(n,e)}catch(o){a=!0,n=o}if(t==="throw")throw r;if(a)throw n;return Lc(n),r},Ub=je,xb=Wf,Nb=function(e,t,r,n){try{return n?t(Ub(r)[0],r[1]):t(r)}catch(a){xb(e,"throw",a)}},Db=ae,Mb=Nr,Fb=Db("iterator"),Bb=Array.prototype,Vf=function(e){return e!==void 0&&(Mb.Array===e||Bb[Fb]===e)},zb=G,Hb=ne,Zf=Y,Gb=Mr,Kb=Pe,Wb=ji,Jf=function(){},Yf=Kb("Reflect","construct"),Ji=/^\s*(?:class|function)\b/,Vb=zb(Ji.exec),Zb=!Ji.test(Jf),lr=function(t){if(!Zf(t))return!1;try{return Yf(Jf,[],t),!0}catch{return!1}},qf=function(t){if(!Zf(t))return!1;switch(Gb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Zb||!!Vb(Ji,Wb(t))}catch{return!0}};qf.sham=!0;var Xf=!Yf||Hb(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?qf:lr,Jb=oe,Yb=De,qb=wt,Xb=function(e,t,r){Jb?Yb.f(e,t,qb(0,r)):e[t]=r},Qb=tr,eS=ie,tS=qn,rS=Nb,nS=Vf,aS=Xf,oS=Ei,Uc=Xb,iS=zi,sS=aa,xc=Array,cS=function(t){var r=tS(t),n=aS(this),a=arguments.length,o=a>1?arguments[1]:void 0,i=o!==void 0;i&&(o=Qb(o,a>2?arguments[2]:void 0));var s=sS(r),l=0,f,u,c,d,h,v;if(s&&!(this===xc&&nS(s)))for(u=n?new this:[],d=iS(r,s),h=d.next;!(c=eS(h,d)).done;l++)v=i?rS(d,o,[c.value,l],!0):c.value,Uc(u,l,v);else for(f=oS(r),u=n?new this(f):xc(f);f>l;l++)v=i?o(r[l],l):r[l],Uc(u,l,v);return u.length=l,u},$t=G,Ba=2147483647,Ir=36,Qf=1,Zo=26,uS=38,lS=700,fS=72,dS=128,hS="-",vS=/[^\0-\u007E]/,ed=/[.\u3002\uFF0E\uFF61]/g,Nc="Overflow: input needs wider integers to process",za=Ir-Qf,Dc=RangeError,pS=$t(ed.exec),Ut=Math.floor,Ha=String.fromCharCode,Mc=$t("".charCodeAt),td=$t([].join),et=$t([].push),mS=$t("".replace),gS=$t("".split),yS=$t("".toLowerCase),wS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Mc(e,r++);if(a>=55296&&a<=56319&&r<n){var o=Mc(e,r++);(o&64512)===56320?et(t,((a&1023)<<10)+(o&1023)+65536):(et(t,a),r--)}else et(t,a)}return t},Fc=function(e){return e+22+75*(e<26)},bS=function(e,t,r){var n=0;for(e=r?Ut(e/lS):e>>1,e+=Ut(e/t);e>za*Zo>>1;)e=Ut(e/za),n+=Ir;return Ut(n+(za+1)*e/(e+uS))},SS=function(e){var t=[];e=wS(e);var r=e.length,n=dS,a=0,o=fS,i,s;for(i=0;i<e.length;i++)s=e[i],s<128&&et(t,Ha(s));var l=t.length,f=l;for(l&&et(t,hS);f<r;){var u=Ba;for(i=0;i<e.length;i++)s=e[i],s>=n&&s<u&&(u=s);var c=f+1;if(u-n>Ut((Ba-a)/c))throw new Dc(Nc);for(a+=(u-n)*c,n=u,i=0;i<e.length;i++){if(s=e[i],s<n&&++a>Ba)throw new Dc(Nc);if(s===n){for(var d=a,h=Ir;;){var v=h<=o?Qf:h>=o+Zo?Zo:h-o;if(d<v)break;var b=d-v,g=Ir-v;et(t,Ha(Fc(v+b%g))),d=Ut(b/g),h+=Ir}et(t,Ha(Fc(d))),o=bS(a,c,f===l),a=0,f++}}a++,n++}return td(t,"")},$S=function(e){var t=[],r=gS(mS(yS(e),ed,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],et(t,pS(vS,a)?"xn--"+SS(a):a);return td(t,".")},IS=ee,Yi=oe,TS=ra,qi=K,Bc=tr,Oe=G,jn=Ee,ge=na,PS=Fi,Jo=Ie,Xi=Ab,Ot=cS,ke=oa,ES=Hf.codeAt,OS=$S,ze=Ze,kS=er,_S=St,rd=qw,nd=Qt,RS=nd.set,Ln=nd.getterFor("URL"),CS=rd.URLSearchParams,AS=rd.getState,fr=qi.URL,Yo=qi.TypeError,Un=qi.parseInt,jS=Math.floor,zc=Math.pow,$e=Oe("".charAt),Ce=Oe(/./.exec),gr=Oe([].join),LS=Oe(1 .toString),US=Oe([].pop),Ct=Oe([].push),Ga=Oe("".replace),xS=Oe([].shift),NS=Oe("".split),Tr=Oe("".slice),xn=Oe("".toLowerCase),DS=Oe([].unshift),MS="Invalid authority",Ka="Invalid scheme",at="Invalid host",Hc="Invalid port",ad=/[a-z]/i,FS=/[\d+-.a-z]/i,qo=/\d/,BS=/^0x/i,zS=/^[0-7]+$/,HS=/^\d+$/,od=/^[\da-f]+$/i,GS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,KS=/[\0\t\n\r #/:<>?@[\\\]^|]/,WS=/^[\u0000-\u0020]+/,VS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ZS=/[\t\n\r]/g,ye,JS=function(e){var t=NS(e,"."),r,n,a,o,i,s,l;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(o=t[a],o==="")return e;if(i=10,o.length>1&&$e(o,0)==="0"&&(i=Ce(BS,o)?16:8,o=Tr(o,i===8?1:2)),o==="")s=0;else{if(!Ce(i===10?HS:i===8?zS:od,o))return e;s=Un(o,i)}Ct(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=zc(256,5-r))return null}else if(s>255)return null;for(l=US(n),a=0;a<n.length;a++)l+=n[a]*zc(256,3-a);return l},YS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,o,i,s,l,f,u,c,d=function(){return $e(e,a)};if(d()===":"){if($e(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(o=i=0;i<4&&Ce(od,d());)o=o*16+Un(d(),16),a++,i++;if(d()==="."){if(i===0||(a-=i,r>6))return;for(s=0;d();){if(l=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ce(qo,d()))return;for(;Ce(qo,d());){if(f=Un(d(),10),l===null)l=f;else{if(l===0)return;l=l*10+f}if(l>255)return;a++}t[r]=t[r]*256+l,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=o}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)c=t[r],t[r--]=t[n+u-1],t[n+--u]=c;else if(r!==8)return;return t},qS=function(e){for(var t=null,r=1,n=null,a=0,o=0;o<8;o++)e[o]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=o),++a);return a>r?n:t},dr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)DS(t,e%256),e=jS(e/256);return gr(t,".")}if(typeof e=="object"){for(t="",n=qS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=LS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Tn={},id=Xi({},Tn,{" ":1,'"':1,"<":1,">":1,"`":1}),sd=Xi({},id,{"#":1,"?":1,"{":1,"}":1}),Wa=Xi({},sd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ye=function(e,t){var r=ES(e,0);return r>32&&r<127&&!Jo(t,e)?e:encodeURIComponent(e)},tn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},yr=function(e,t){var r;return e.length===2&&Ce(ad,$e(e,0))&&((r=$e(e,1))===":"||!t&&r==="|")},Gc=function(e){var t;return e.length>1&&yr(Tr(e,0,2))&&(e.length===2||(t=$e(e,2))==="/"||t==="\\"||t==="?"||t==="#")},XS=function(e){return e==="."||xn(e)==="%2e"},QS=function(e){return e=xn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Va={},Kc={},Za={},Wc={},Vc={},Ja={},Zc={},Jc={},rn={},nn={},Ya={},qa={},Xa={},Qa={},Yc={},eo={},kt={},xe={},qc={},ot={},Be={},Qi=function(e,t,r){var n=ze(e),a,o,i;if(t){if(o=this.parse(n),o)throw new Yo(o);this.searchParams=null}else{if(r!==void 0&&(a=new Qi(r,!0)),o=this.parse(n,null,a),o)throw new Yo(o);i=AS(new CS),i.bindURL(this),this.searchParams=i}};Qi.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Va,o=0,i="",s=!1,l=!1,f=!1,u,c,d,h;for(e=ze(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=Ga(e,WS,""),e=Ga(e,VS,"$1")),e=Ga(e,ZS,""),u=Ot(e);o<=u.length;){switch(c=u[o],a){case Va:if(c&&Ce(ad,c))i+=xn(c),a=Kc;else{if(t)return Ka;a=Za;continue}break;case Kc:if(c&&(Ce(FS,c)||c==="+"||c==="-"||c==="."))i+=xn(c);else if(c===":"){if(t&&(n.isSpecial()!==Jo(tn,i)||i==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=i,t){n.isSpecial()&&tn[n.scheme]===n.port&&(n.port=null);return}i="",n.scheme==="file"?a=Qa:n.isSpecial()&&r&&r.scheme===n.scheme?a=Wc:n.isSpecial()?a=Jc:u[o+1]==="/"?(a=Vc,o++):(n.cannotBeABaseURL=!0,Ct(n.path,""),a=qc)}else{if(t)return Ka;i="",a=Za,o=0;continue}break;case Za:if(!r||r.cannotBeABaseURL&&c!=="#")return Ka;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=ke(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Be;break}a=r.scheme==="file"?Qa:Ja;continue;case Wc:if(c==="/"&&u[o+1]==="/")a=rn,o++;else{a=Ja;continue}break;case Vc:if(c==="/"){a=nn;break}else{a=xe;continue}case Ja:if(n.scheme=r.scheme,c===ye)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Zc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query="",a=ot;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query=r.query,n.fragment="",a=Be;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.path.length--,a=xe;continue}break;case Zc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=rn;else if(c==="/")a=nn;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=xe;continue}break;case Jc:if(a=rn,c!=="/"||$e(i,o+1)!=="/")continue;o++;break;case rn:if(c!=="/"&&c!=="\\"){a=nn;continue}break;case nn:if(c==="@"){s&&(i="%40"+i),s=!0,d=Ot(i);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ye(b,Wa);f?n.password+=g:n.username+=g}i=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&i==="")return MS;o-=Ot(i).length+1,i="",a=Ya}else i+=c;break;case Ya:case qa:if(t&&n.scheme==="file"){a=eo;continue}else if(c===":"&&!l){if(i==="")return at;if(h=n.parseHost(i),h)return h;if(i="",a=Xa,t===qa)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&i==="")return at;if(t&&i===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(i),h)return h;if(i="",a=kt,t)return;continue}else c==="["?l=!0:c==="]"&&(l=!1),i+=c;break;case Xa:if(Ce(qo,c))i+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(i!==""){var I=Un(i,10);if(I>65535)return Hc;n.port=n.isSpecial()&&I===tn[n.scheme]?null:I,i=""}if(t)return;a=kt;continue}else return Hc;break;case Qa:if(n.scheme="file",c==="/"||c==="\\")a=Yc;else if(r&&r.scheme==="file")switch(c){case ye:n.host=r.host,n.path=ke(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ke(r.path),n.query="",a=ot;break;case"#":n.host=r.host,n.path=ke(r.path),n.query=r.query,n.fragment="",a=Be;break;default:Gc(gr(ke(u,o),""))||(n.host=r.host,n.path=ke(r.path),n.shortenPath()),a=xe;continue}else{a=xe;continue}break;case Yc:if(c==="/"||c==="\\"){a=eo;break}r&&r.scheme==="file"&&!Gc(gr(ke(u,o),""))&&(yr(r.path[0],!0)?Ct(n.path,r.path[0]):n.host=r.host),a=xe;continue;case eo:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&yr(i))a=xe;else if(i===""){if(n.host="",t)return;a=kt}else{if(h=n.parseHost(i),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;i="",a=kt}continue}else i+=c;break;case kt:if(n.isSpecial()){if(a=xe,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=ot;else if(!t&&c==="#")n.fragment="",a=Be;else if(c!==ye&&(a=xe,c!=="/"))continue;break;case xe:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(QS(i)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,"")):XS(i)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,""):(n.scheme==="file"&&!n.path.length&&yr(i)&&(n.host&&(n.host=""),i=$e(i,0)+":"),Ct(n.path,i)),i="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)xS(n.path);c==="?"?(n.query="",a=ot):c==="#"&&(n.fragment="",a=Be)}else i+=Ye(c,sd);break;case qc:c==="?"?(n.query="",a=ot):c==="#"?(n.fragment="",a=Be):c!==ye&&(n.path[0]+=Ye(c,Tn));break;case ot:!t&&c==="#"?(n.fragment="",a=Be):c!==ye&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ye(c,Tn));break;case Be:c!==ye&&(n.fragment+=Ye(c,id));break}o++}},parseHost:function(e){var t,r,n;if($e(e,0)==="["){if($e(e,e.length-1)!=="]"||(t=YS(Tr(e,1,-1)),!t))return at;this.host=t}else if(this.isSpecial()){if(e=OS(e),Ce(GS,e)||(t=JS(e),t===null))return at;this.host=t}else{if(Ce(KS,e))return at;for(t="",r=Ot(e),n=0;n<r.length;n++)t+=Ye(r[n],Tn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Jo(tn,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!yr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,o=e.port,i=e.path,s=e.query,l=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=dr(a),o!==null&&(f+=":"+o)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?i[0]:i.length?"/"+gr(i,"/"):"",s!==null&&(f+="?"+s),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new Yo(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Gt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+dr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(ze(e)+":",Va)},getUsername:function(){return this.username},setUsername:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ye(t[r],Wa)}},getPassword:function(){return this.password},setPassword:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ye(t[r],Wa)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?dr(e):dr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ya)},getHostname:function(){var e=this.host;return e===null?"":dr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,qa)},getPort:function(){var e=this.port;return e===null?"":ze(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=ze(e),e===""?this.port=null:this.parse(e,Xa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+gr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,kt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=ze(e),e===""?this.query=null:($e(e,0)==="?"&&(e=Tr(e,1)),this.query="",this.parse(e,ot)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=ze(e),e===""){this.fragment=null;return}$e(e,0)==="#"&&(e=Tr(e,1)),this.fragment="",this.parse(e,Be)},update:function(){this.query=this.searchParams.serialize()||null}};var Gt=function(t){var r=PS(this,se),n=_S(arguments.length,1)>1?arguments[1]:void 0,a=RS(r,new Qi(t,!1,n));Yi||(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())},se=Gt.prototype,we=function(e,t){return{get:function(){return Ln(this)[e]()},set:t&&function(r){return Ln(this)[t](r)},configurable:!0,enumerable:!0}};Yi&&(ge(se,"href",we("serialize","setHref")),ge(se,"origin",we("getOrigin")),ge(se,"protocol",we("getProtocol","setProtocol")),ge(se,"username",we("getUsername","setUsername")),ge(se,"password",we("getPassword","setPassword")),ge(se,"host",we("getHost","setHost")),ge(se,"hostname",we("getHostname","setHostname")),ge(se,"port",we("getPort","setPort")),ge(se,"pathname",we("getPathname","setPathname")),ge(se,"search",we("getSearch","setSearch")),ge(se,"searchParams",we("getSearchParams")),ge(se,"hash",we("getHash","setHash")));jn(se,"toJSON",function(){return Ln(this).serialize()},{enumerable:!0});jn(se,"toString",function(){return Ln(this).serialize()},{enumerable:!0});if(fr){var Xc=fr.createObjectURL,Qc=fr.revokeObjectURL;Xc&&jn(Gt,"createObjectURL",Bc(Xc,fr)),Qc&&jn(Gt,"revokeObjectURL",Bc(Qc,fr))}kS(Gt,"URL");IS({global:!0,constructor:!0,forced:!TS,sham:!Yi},{URL:Gt});var e$=ee,t$=Pe,cd=ne,r$=St,eu=Ze,n$=ra,es=t$("URL"),a$=n$&&cd(function(){es.canParse()}),o$=cd(function(){return es.canParse.length!==1});e$({target:"URL",stat:!0,forced:!a$||o$},{canParse:function(t){var r=r$(arguments.length,1),n=eu(t),a=r<2||arguments[1]===void 0?void 0:eu(arguments[1]);try{return!!new es(n,a)}catch{return!1}}});var i$=ee,s$=Pe,c$=St,tu=Ze,u$=ra,l$=s$("URL");i$({target:"URL",stat:!0,forced:!u$},{parse:function(t){var r=c$(arguments.length,1),n=tu(t),a=r<2||arguments[1]===void 0?void 0:tu(arguments[1]);try{return new l$(n,a)}catch{return null}}});var f$=ee,d$=ie;f$({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return d$(URL.prototype.toString,this)}});var h$=Vi;h$.URL;var v$={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},p$=Xn,to=p$("span").classList,ru=to&&to.constructor&&to.constructor.prototype,m$=ru===Object.prototype?void 0:ru,nu=K,ud=v$,g$=m$,wr=Ty,au=bt,y$=er,w$=ae,ro=w$("iterator"),no=wr.values,ld=function(e,t){if(e){if(e[ro]!==no)try{au(e,ro,no)}catch{e[ro]=no}if(y$(e,t,!0),ud[t]){for(var r in wr)if(e[r]!==wr[r])try{au(e,r,wr[r])}catch{e[r]=wr[r]}}}};for(var ao in ud)ld(nu[ao]&&nu[ao].prototype,ao);ld(g$,"DOMTokenList");var b$=Te,S$=bt,$$=function(e,t){b$(t)&&"cause"in t&&S$(e,"cause",t.cause)},I$=G,fd=Error,T$=I$("".replace),P$=function(e){return String(new fd(e).stack)}("zxcasd"),dd=/\n\s*at [^:]*:[^\n]*/,E$=dd.test(P$),O$=function(e,t){if(E$&&typeof e=="string"&&!fd.prepareStackTrace)for(;t--;)e=T$(e,dd,"");return e},k$=ne,_$=wt,R$=!k$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",_$(1,7)),e.stack!==7):!0}),C$=bt,A$=O$,j$=R$,ou=Error.captureStackTrace,L$=function(e,t,r,n){j$&&(ou?ou(e,t):C$(e,"stack",A$(r,n)))},U$=tr,x$=ie,N$=je,D$=ea,M$=Vf,F$=Ei,iu=Qn,B$=zi,z$=aa,su=Wf,H$=TypeError,Pn=function(e,t){this.stopped=e,this.result=t},cu=Pn.prototype,Fr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),i=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),l=U$(t,n),f,u,c,d,h,v,b,g=function(T){return f&&su(f,"normal",T),new Pn(!0,T)},I=function(T){return a?(N$(T),s?l(T[0],T[1],g):l(T[0],T[1])):s?l(T,g):l(T)};if(o)f=e.iterator;else if(i)f=e;else{if(u=z$(e),!u)throw new H$(D$(e)+" is not iterable");if(M$(u)){for(c=0,d=F$(e);d>c;c++)if(h=I(e[c]),h&&iu(cu,h))return h;return new Pn(!1)}f=B$(e,u)}for(v=o?e.next:f.next;!(b=x$(v,f)).done;){try{h=I(b.value)}catch(T){su(f,"throw",T)}if(typeof h=="object"&&h&&iu(cu,h))return h}return new Pn(!1)},G$=Ze,K$=function(e,t){return e===void 0?arguments.length<2?"":t:G$(e)},W$=ee,V$=Qn,Z$=xi,Nn=Ni,J$=yf,hd=ta,oo=bt,io=wt,Y$=$$,q$=L$,X$=Fr,Q$=K$,eI=ae,tI=eI("toStringTag"),Dn=Error,rI=[].push,Kt=function(t,r){var n=V$(so,this),a;Nn?a=Nn(new Dn,n?Z$(this):so):(a=n?this:hd(so),oo(a,tI,"Error")),r!==void 0&&oo(a,"message",Q$(r)),q$(a,Kt,a.stack,1),arguments.length>2&&Y$(a,arguments[2]);var o=[];return X$(t,rI,{that:o}),oo(a,"errors",o),a};Nn?Nn(Kt,Dn):J$(Kt,Dn,{name:!0});var so=Kt.prototype=hd(Dn.prototype,{constructor:io(1,Kt),message:io(1,""),name:io(1,"AggregateError")});W$({global:!0,constructor:!0,arity:2},{AggregateError:Kt});var nI=Bi,aI=Mr,oI=nI?{}.toString:function(){return"[object "+aI(this)+"]"},iI=Bi,sI=Ee,cI=oI;iI||sI(Object.prototype,"toString",cI,{unsafe:!0});var hr=K,uI=xr,lI=Zn,an=function(e){return uI.slice(0,e.length)===e},vd=function(){return an("Bun/")?"BUN":an("Cloudflare-Workers")?"CLOUDFLARE":an("Deno/")?"DENO":an("Node.js/")?"NODE":hr.Bun&&typeof Bun.version=="string"?"BUN":hr.Deno&&typeof Deno.version=="object"?"DENO":lI(hr.process)==="process"?"NODE":hr.window&&hr.document?"BROWSER":"REST"}(),fI=vd,ts=fI==="NODE",dI=Pe,hI=na,vI=ae,pI=oe,uu=vI("species"),mI=function(e){var t=dI(e);pI&&t&&!t[uu]&&hI(t,uu,{configurable:!0,get:function(){return this}})},gI=Xf,yI=ea,wI=TypeError,bI=function(e){if(gI(e))return e;throw new wI(yI(e)+" is not a constructor")},lu=je,SI=bI,$I=Jn,II=ae,TI=II("species"),pd=function(e,t){var r=lu(e).constructor,n;return r===void 0||$I(n=lu(r)[TI])?t:SI(n)},PI=Vn,md=Function.prototype,fu=md.apply,du=md.call,gd=typeof Reflect=="object"&&Reflect.apply||(PI?du.bind(fu):function(){return du.apply(fu,arguments)}),EI=xr,yd=/(?:ipad|iphone|ipod).*applewebkit/i.test(EI),de=K,OI=gd,kI=tr,hu=Y,_I=Ie,wd=ne,vu=of,RI=oa,pu=Xn,CI=St,AI=yd,jI=ts,Xo=de.setImmediate,Qo=de.clearImmediate,LI=de.process,co=de.Dispatch,UI=de.Function,mu=de.MessageChannel,xI=de.String,uo=0,Pr={},gu="onreadystatechange",Ar,it,lo,fo;wd(function(){Ar=de.location});var rs=function(e){if(_I(Pr,e)){var t=Pr[e];delete Pr[e],t()}},ho=function(e){return function(){rs(e)}},yu=function(e){rs(e.data)},wu=function(e){de.postMessage(xI(e),Ar.protocol+"//"+Ar.host)};(!Xo||!Qo)&&(Xo=function(t){CI(arguments.length,1);var r=hu(t)?t:UI(t),n=RI(arguments,1);return Pr[++uo]=function(){OI(r,void 0,n)},it(uo),uo},Qo=function(t){delete Pr[t]},jI?it=function(e){LI.nextTick(ho(e))}:co&&co.now?it=function(e){co.now(ho(e))}:mu&&!AI?(lo=new mu,fo=lo.port2,lo.port1.onmessage=yu,it=kI(fo.postMessage,fo)):de.addEventListener&&hu(de.postMessage)&&!de.importScripts&&Ar&&Ar.protocol!=="file:"&&!wd(wu)?(it=wu,de.addEventListener("message",yu,!1)):gu in pu("script")?it=function(e){vu.appendChild(pu("script"))[gu]=function(){vu.removeChild(this),rs(e)}}:it=function(e){setTimeout(ho(e),0)});var bd={set:Xo,clear:Qo},Sd=function(){this.head=null,this.tail=null};Sd.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 $d=Sd,NI=xr,DI=/ipad|iphone|ipod/i.test(NI)&&typeof Pebble<"u",MI=xr,FI=/web0s(?!.*chrome)/i.test(MI),Wt=K,BI=kf,bu=tr,vo=bd.set,zI=$d,HI=yd,GI=DI,KI=FI,po=ts,Su=Wt.MutationObserver||Wt.WebKitMutationObserver,$u=Wt.document,Iu=Wt.process,on=Wt.Promise,ei=BI("queueMicrotask"),_t,mo,go,sn,Tu;if(!ei){var cn=new zI,un=function(){var e,t;for(po&&(e=Iu.domain)&&e.exit();t=cn.get();)try{t()}catch(r){throw cn.head&&_t(),r}e&&e.enter()};!HI&&!po&&!KI&&Su&&$u?(mo=!0,go=$u.createTextNode(""),new Su(un).observe(go,{characterData:!0}),_t=function(){go.data=mo=!mo}):!GI&&on&&on.resolve?(sn=on.resolve(void 0),sn.constructor=on,Tu=bu(sn.then,sn),_t=function(){Tu(un)}):po?_t=function(){Iu.nextTick(un)}:(vo=bu(vo,Wt),_t=function(){vo(un)}),ei=function(e){cn.head||_t(),cn.add(e)}}var WI=ei,VI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},nr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},ZI=K,Br=ZI.Promise,JI=K,Er=Br,YI=Y,qI=wf,XI=ji,QI=ae,Pu=vd,yo=Zl;Er&&Er.prototype;var e0=QI("species"),ti=!1,Id=YI(JI.PromiseRejectionEvent),t0=qI("Promise",function(){var e=XI(Er),t=e!==String(Er);if(!t&&yo===66)return!0;if(!yo||yo<51||!/native code/.test(e)){var r=new Er(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=r.constructor={};if(a[e0]=n,ti=r.then(function(){})instanceof n,!ti)return!0}return!t&&(Pu==="BROWSER"||Pu==="DENO")&&!Id}),zr={CONSTRUCTOR:t0,REJECTION_EVENT:Id,SUBCLASSING:ti},Me={},Eu=Le,r0=TypeError,n0=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new r0("Bad Promise constructor");t=n,r=a}),this.resolve=Eu(t),this.reject=Eu(r)};Me.f=function(e){return new n0(e)};var a0=ee,Mn=ts,nt=K,Vt=ie,Ou=Ee,ku=Ni,o0=er,i0=mI,s0=Le,En=Y,c0=Te,u0=Fi,l0=pd,Td=bd.set,ns=WI,f0=VI,d0=nr,h0=$d,Pd=Qt,Fn=Br,as=zr,Ed=Me,ua="Promise",Od=as.CONSTRUCTOR,v0=as.REJECTION_EVENT,p0=as.SUBCLASSING,wo=Pd.getterFor(ua),m0=Pd.set,At=Fn&&Fn.prototype,ct=Fn,ln=At,kd=nt.TypeError,ri=nt.document,os=nt.process,ni=Ed.f,g0=ni,y0=!!(ri&&ri.createEvent&&nt.dispatchEvent),_d="unhandledrejection",w0="rejectionhandled",_u=0,Rd=1,b0=2,is=1,Cd=2,fn,Ru,S0,Cu,Ad=function(e){var t;return c0(e)&&En(t=e.then)?t:!1},jd=function(e,t){var r=t.value,n=t.state===Rd,a=n?e.ok:e.fail,o=e.resolve,i=e.reject,s=e.domain,l,f,u;try{a?(n||(t.rejection===Cd&&I0(t),t.rejection=is),a===!0?l=r:(s&&s.enter(),l=a(r),s&&(s.exit(),u=!0)),l===e.promise?i(new kd("Promise-chain cycle")):(f=Ad(l))?Vt(f,l,o,i):o(l)):i(r)}catch(c){s&&!u&&s.exit(),i(c)}},Ld=function(e,t){e.notified||(e.notified=!0,ns(function(){for(var r=e.reactions,n;n=r.get();)jd(n,e);e.notified=!1,t&&!e.rejection&&$0(e)}))},Ud=function(e,t,r){var n,a;y0?(n=ri.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),nt.dispatchEvent(n)):n={promise:t,reason:r},!v0&&(a=nt["on"+e])?a(n):e===_d&&f0("Unhandled promise rejection",r)},$0=function(e){Vt(Td,nt,function(){var t=e.facade,r=e.value,n=Au(e),a;if(n&&(a=d0(function(){Mn?os.emit("unhandledRejection",r,t):Ud(_d,t,r)}),e.rejection=Mn||Au(e)?Cd:is,a.error))throw a.value})},Au=function(e){return e.rejection!==is&&!e.parent},I0=function(e){Vt(Td,nt,function(){var t=e.facade;Mn?os.emit("rejectionHandled",t):Ud(w0,t,e.value)})},xt=function(e,t,r){return function(n){e(t,n,r)}},Mt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=b0,Ld(e,!0))},ai=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new kd("Promise can't be resolved itself");var n=Ad(t);n?ns(function(){var a={done:!1};try{Vt(n,t,xt(ai,a,e),xt(Mt,a,e))}catch(o){Mt(a,o,e)}}):(e.value=t,e.state=Rd,Ld(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(Od&&(ct=function(t){u0(this,ln),s0(t),Vt(fn,this);var r=wo(this);try{t(xt(ai,r),xt(Mt,r))}catch(n){Mt(r,n)}},ln=ct.prototype,fn=function(t){m0(this,{type:ua,done:!1,notified:!1,parent:!1,reactions:new h0,rejection:!1,state:_u,value:null})},fn.prototype=Ou(ln,"then",function(t,r){var n=wo(this),a=ni(l0(this,ct));return n.parent=!0,a.ok=En(t)?t:!0,a.fail=En(r)&&r,a.domain=Mn?os.domain:void 0,n.state===_u?n.reactions.add(a):ns(function(){jd(a,n)}),a.promise}),Ru=function(){var e=new fn,t=wo(e);this.promise=e,this.resolve=xt(ai,t),this.reject=xt(Mt,t)},Ed.f=ni=function(e){return e===ct||e===S0?new Ru(e):g0(e)},En(Fn)&&At!==Object.prototype)){Cu=At.then,p0||Ou(At,"then",function(t,r){var n=this;return new ct(function(a,o){Vt(Cu,n,a,o)}).then(t,r)},{unsafe:!0});try{delete At.constructor}catch{}ku&&ku(At,ln)}a0({global:!0,constructor:!0,wrap:!0,forced:Od},{Promise:ct});o0(ct,ua,!1);i0(ua);var T0=ae,xd=T0("iterator"),Nd=!1;try{var P0=0,ju={next:function(){return{done:!!P0++}},return:function(){Nd=!0}};ju[xd]=function(){return this},Array.from(ju,function(){throw 2})}catch{}var E0=function(e,t){try{if(!t&&!Nd)return!1}catch{return!1}var r=!1;try{var n={};n[xd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},O0=Br,k0=E0,_0=zr.CONSTRUCTOR,la=_0||!k0(function(e){O0.all(e).then(void 0,function(){})}),R0=ee,C0=ie,A0=Le,j0=Me,L0=nr,U0=Fr,x0=la;R0({target:"Promise",stat:!0,forced:x0},{all:function(t){var r=this,n=j0.f(r),a=n.resolve,o=n.reject,i=L0(function(){var s=A0(r.resolve),l=[],f=0,u=1;U0(t,function(c){var d=f++,h=!1;u++,C0(s,r,c).then(function(v){h||(h=!0,l[d]=v,--u||a(l))},o)}),--u||a(l)});return i.error&&o(i.value),n.promise}});var N0=ee,D0=zr.CONSTRUCTOR,oi=Br,M0=Pe,F0=Y,B0=Ee,Lu=oi&&oi.prototype;N0({target:"Promise",proto:!0,forced:D0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(F0(oi)){var Uu=M0("Promise").prototype.catch;Lu.catch!==Uu&&B0(Lu,"catch",Uu,{unsafe:!0})}var z0=ee,H0=ie,G0=Le,K0=Me,W0=nr,V0=Fr,Z0=la;z0({target:"Promise",stat:!0,forced:Z0},{race:function(t){var r=this,n=K0.f(r),a=n.reject,o=W0(function(){var i=G0(r.resolve);V0(t,function(s){H0(i,r,s).then(n.resolve,a)})});return o.error&&a(o.value),n.promise}});var J0=ee,Y0=Me,q0=zr.CONSTRUCTOR;J0({target:"Promise",stat:!0,forced:q0},{reject:function(t){var r=Y0.f(this),n=r.reject;return n(t),r.promise}});var X0=je,Q0=Te,eT=Me,Dd=function(e,t){if(X0(e),Q0(t)&&t.constructor===e)return t;var r=eT.f(e),n=r.resolve;return n(t),r.promise},tT=ee,rT=Pe,nT=zr.CONSTRUCTOR,aT=Dd;rT("Promise");tT({target:"Promise",stat:!0,forced:nT},{resolve:function(t){return aT(this,t)}});var oT=ee,iT=ie,sT=Le,cT=Me,uT=nr,lT=Fr,fT=la;oT({target:"Promise",stat:!0,forced:fT},{allSettled:function(t){var r=this,n=cT.f(r),a=n.resolve,o=n.reject,i=uT(function(){var s=sT(r.resolve),l=[],f=0,u=1;lT(t,function(c){var d=f++,h=!1;u++,iT(s,r,c).then(function(v){h||(h=!0,l[d]={status:"fulfilled",value:v},--u||a(l))},function(v){h||(h=!0,l[d]={status:"rejected",reason:v},--u||a(l))})}),--u||a(l)});return i.error&&o(i.value),n.promise}});var dT=ee,hT=ie,vT=Le,pT=Pe,mT=Me,gT=nr,yT=Fr,wT=la,xu="No one promise resolved";dT({target:"Promise",stat:!0,forced:wT},{any:function(t){var r=this,n=pT("AggregateError"),a=mT.f(r),o=a.resolve,i=a.reject,s=gT(function(){var l=vT(r.resolve),f=[],u=0,c=1,d=!1;yT(t,function(h){var v=u++,b=!1;c++,hT(l,r,h).then(function(g){b||d||(d=!0,o(g))},function(g){b||d||(b=!0,f[v]=g,--c||i(new n(f,xu)))})}),--c||i(new n(f,xu))});return s.error&&i(s.value),a.promise}});var bT=ee,ST=Me;bT({target:"Promise",stat:!0},{withResolvers:function(){var t=ST.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var $T=ee,Bn=Br,IT=ne,Md=Pe,Fd=Y,TT=pd,Nu=Dd,PT=Ee,ii=Bn&&Bn.prototype,ET=!!Bn&&IT(function(){ii.finally.call({then:function(){}},function(){})});$T({target:"Promise",proto:!0,real:!0,forced:ET},{finally:function(e){var t=TT(this,Md("Promise")),r=Fd(e);return this.then(r?function(n){return Nu(t,e()).then(function(){return n})}:e,r?function(n){return Nu(t,e()).then(function(){throw n})}:e)}});if(Fd(Bn)){var Du=Md("Promise").prototype.finally;ii.finally!==Du&&PT(ii,"finally",Du,{unsafe:!0})}var OT=Vi;OT.Promise;var kT=ee,_T=K,RT=gd,CT=oa,AT=Me,jT=Le,Bd=nr,bo=_T.Promise,Mu=!1,LT=!bo||!bo.try||Bd(function(){bo.try(function(e){Mu=e===8},8)}).error||!Mu;kT({target:"Promise",stat:!0,forced:LT},{try:function(e){var t=arguments.length>1?CT(arguments,1):[],r=AT.f(this),n=Bd(function(){return RT(jT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const zd="sesamy-debug";function UT(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 xT(e){if(typeof document>"u")return null;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 NT(e){UT(zd,e.toString(),1)}function DT(){return xT(zd)==="true"}function q(e){DT()&&console.log(e)}function Ve(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});q(`Triggering event: ${e}`),dispatchEvent(r)}function Ne(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 ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ss(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cs(e,t){return e(t={exports:{}},t.exports),t.exports}var st=cs(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(o,i){var s=a.locked.get(o);s===void 0?i===void 0?a.locked.set(o,[]):a.locked.set(o,[i]):i!==void 0&&(s.unshift(i),a.locked.set(o,s))},this.isLocked=function(o){return a.locked.has(o)},this.lock=function(o){return new Promise(function(i,s){a.isLocked(o)?a.addToLocked(o,i):(a.addToLocked(o),i())})},this.unlock=function(o){var i=a.locked.get(o);if(i!==void 0&&i.length!==0){var s=i.pop();a.locked.set(o,i),s!==void 0&&setTimeout(s,0)}else a.locked.delete(o)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});ss(st);var MT=ss(cs(function(e,t){var r=ut&&ut.__awaiter||function(u,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{T(h.next(y))}catch(p){b(p)}}function I(y){try{T(h.throw(y))}catch(p){b(p)}}function T(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,I)}T((h=h.apply(u,c||[])).next())})},n=ut&&ut.__generator||function(u,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:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function I(T){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(u,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}}([T,y])}}},a=ut;Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key",i={key:function(u){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(u){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(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(u,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,c){return window.localStorage.setItem(u,c)}};function s(u){return new Promise(function(c){return setTimeout(c,u)})}function l(u){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<u;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function u(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(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,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,b,g,I,T,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+l(4),v=Date.now()+d,b=o+"-"+c,g=this.storageHandler===void 0?i: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]:(I=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:I,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(T=g.getItemSync(b))!==null&&(y=JSON.parse(T)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?i:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.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,I;return n(this,function(T){switch(T.label){case 0:return[4,st.default().lock(d)];case 1:return T.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?i:this.storageHandler,(g=b.getItemSync(c))===null?(st.default().unlock(d),[2]):((I=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(I)),st.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(st.default().unlock(d),[2])}})})},1e3),[2]})})},u.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 I(){if(g||(window.removeEventListener("storage",I),u.removeFromWaiting(I),clearTimeout(T),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",I),u.addToWaiting(I);var T=setTimeout(I,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},u.addToWaiting=function(c){this.removeFromWaiting(c),u.waiters!==void 0&&u.waiters.push(c)},u.removeFromWaiting=function(c){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(d){return d!==c}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(c){return c()})},u.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()]}})})},u.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?i:this.storageHandler,h=o+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,st.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),st.default().unlock(b.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}})})},u.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 I=!1,T=0;T<v.length;T++){var y=v[T];if(y.includes(o)){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),I=!0)}}}I&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=f}));const FT={timeoutInSeconds:60},Hd={name:"auth0-spa-js",version:"2.1.3"},Gd=()=>Date.now();let fe=class si extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,si.prototype)}static fromPayload({error:t,error_description:r}){return new si(t,r)}},BT=class Kd extends fe{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Kd.prototype)}},ci=class Wd extends fe{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Wd.prototype)}},zT=class Vd extends ci{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Vd.prototype)}},HT=class Zd extends fe{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Zd.prototype)}},GT=class Jd extends fe{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Jd.prototype)}},Yd=class qd extends fe{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Fu(t,["default"])}', scope: '${Fu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,qd.prototype)}};function Fu(e,t=[]){return e&&!t.includes(e)?e:""}const On=()=>window.crypto,So=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(On().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Bu=e=>btoa(e),ui=e=>{var{clientId:t}=e,r=Ne(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,o)=>Object.assign(Object.assign({},a),{[o]:n[o]}),{}))(Object.assign({client_id:t},r))).toString()},zu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),KT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},WT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([KT(e,t),new Promise((o,i)=>{a=setTimeout(()=>{n.abort(),i(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},VT=async(e,t,r,n,a,o,i)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:i},l=o,new Promise(function(f,u){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?u(new Error(d.data.error)):f(d.data),c.port1.close()},l.postMessage(s,[c.port2])});var s,l},ZT=async(e,t,r,n,a,o,i=1e4)=>a?VT(e,t,r,n,i,a,o):WT(e,n,i);async function JT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:o,auth0Client:i,useFormData:s}=e,l=Ne(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?ui(l):JSON.stringify(l);return await async function(u,c,d,h,v,b,g){let I,T=null;for(let k=0;k<3;k++)try{I=await ZT(u,d,h,v,b,g,c),T=null;break}catch(M){T=M}if(T)throw T;const y=I.json,{error:p,error_description:S}=y,O=Ne(y,["error","error_description"]),{ok:_}=I;if(!_){const k=S||`HTTP error. Unable to fetch ${u}`;throw p==="mfa_required"?new GT(p,k,O.mfa_token):p==="missing_refresh_token"?new Yd(d,h):new fe(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",o,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(i||Hd))}},t,s)}const dn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ft=class li{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,o]=t.split("::");return new li({clientId:n,scope:o,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new li({scope:r,audience:n,clientId:a})}},YT=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)}}()}},qT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Gd}async setIdToken(t,r,n){var a;const o=this.getIdTokenCacheKey(t);await this.cache.set(o,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(o))}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 l=this.matchExistingCacheKey(t,s);l&&(a=await this.cache.get(l))}if(!a)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return a.expiresAt-r<i?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 ft({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,o)=>{await a,await this.cache.remove(o)},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 ft({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const o=ft.fromKey(n),i=new Set(o.scope&&o.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],l=o.scope&&s.reduce((f,u)=>f&&i.has(u),!0);return o.prefix==="@@auth0spajs@@"&&o.clientId===t.clientId&&o.audience===t.audience&&l})[0]}},XT=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 vr=e=>typeof e=="number",QT=["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"],eP=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(o=>{const i=o.split("."),[s,l,f]=i;if(i.length!==3||!s||!l||!f)throw new Error("ID token could not be decoded");const u=JSON.parse(zu(l)),c={__raw:o},d={};return Object.keys(u).forEach(h=>{c[h]=u[h],QT.includes(h)||(d[h]=u[h])}),{encoded:{header:s,payload:l,signature:f},header:JSON.parse(zu(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&&!vr(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||!vr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!vr(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&&vr(t.claims.nbf)){const o=new Date(0);if(o.setUTCSeconds(t.claims.nbf-r),n<o)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 ${o}`)}if(t.claims.auth_time!=null&&vr(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>o)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 ${o}`)}if(e.organization){const o=e.organization.trim();if(o.startsWith("org_")){const i=o;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(i!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${i}", found "${t.claims.org_id}"`)}else{const i=o.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(i!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${i}", found "${t.claims.org_name}"`)}}return t};var dt=cs(function(e,t){var r=ut&&ut.__assign||function(){return r=Object.assign||function(l){for(var f,u=1,c=arguments.length;u<c;u++)for(var d in f=arguments[u])Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l},r.apply(this,arguments)};function n(l,f){if(!f)return"";var u="; "+l;return f===!0?u:u+"="+f}function a(l,f,u){return encodeURIComponent(l).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)}(u)}function o(l){for(var f={},u=l?l.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<u.length;d++){var h=u[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 i(){return o(document.cookie)}function s(l,f,u){document.cookie=a(l,f,r({path:"/"},u))}t.__esModule=!0,t.encode=a,t.parse=o,t.getAll=i,t.get=function(l){return i()[l]},t.set=s,t.remove=function(l,f){s(l,"",r(r({},f),{expires:-1}))}});ss(dt),dt.encode,dt.parse,dt.getAll;var tP=dt.get,Qd=dt.set,eh=dt.remove;const jt={get(e){const t=tP(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),Qd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),eh(e,r)}},rP={get(e){return jt.get(e)||jt.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),Qd(`_legacy_${e}`,JSON.stringify(t),n),jt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),eh(e,r),jt.remove(e,t),jt.remove(`_legacy_${e}`,t)}},nP={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 aP(e,t,r){var n=t===void 0?null:t,a=function(l,f){var u=atob(l);if(f){for(var c=new Uint8Array(u.length),d=0,h=u.length;d<h;++d)c[d]=u.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return u}(e,r!==void 0&&r),o=a.indexOf(`
2
- `,10)+1,i=a.substring(o)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var Hu,Gu,Ku,$o,oP=(Hu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Gu=null,Ku=!1,function(e){return $o=$o||aP(Hu,Gu,Ku),new Worker($o,e)});const Io={};let iP=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 sP={memory:()=>new Xd().enclosedCache,localstorage:()=>new YT},Wu=e=>sP[e],Vu=e=>{const{openUrl:t,onRedirect:r}=e,n=Ne(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},To=new MT;let cP=class{constructor(t){let r,n;if(this.userCache=new Xd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await To.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(!On())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(On().subtle===void 0)throw new Error(`
1
+ "use strict";var Zh=Object.defineProperty;var Jh=(e,t,r)=>t in e?Zh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Jh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ne=function(e){try{return!!e()}catch{return!0}},Yh=ne,Vn=!Yh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Bl=Vn,zl=Function.prototype,jo=zl.call,qh=Bl&&zl.bind.bind(jo,jo),G=Bl?qh:function(e){return function(){return jo.apply(e,arguments)}},Hl=G,Xh=Hl({}.toString),Qh=Hl("".slice),Zn=function(e){return Qh(Xh(e),8,-1)},ev=G,tv=ne,rv=Zn,ma=Object,nv=ev("".split),Gl=tv(function(){return!ma("z").propertyIsEnumerable(0)})?function(e){return rv(e)==="String"?nv(e,""):ma(e)}:ma,Jn=function(e){return e==null},av=Jn,ov=TypeError,Yn=function(e){if(av(e))throw new ov("Can't call method on "+e);return e},iv=Gl,sv=Yn,Ur=function(e){return iv(sv(e))},sr=function(e){return e&&e.Math===Math&&e},K=sr(typeof globalThis=="object"&&globalThis)||sr(typeof window=="object"&&window)||sr(typeof self=="object"&&self)||sr(typeof Kr=="object"&&Kr)||sr(typeof Kr=="object"&&Kr)||function(){return this}()||Function("return this")(),Kl={exports:{}},cv=!1,Ts=K,uv=Object.defineProperty,Ii=function(e,t){try{uv(Ts,e,{value:t,configurable:!0,writable:!0})}catch{Ts[e]=t}return t},lv=K,fv=Ii,Ps="__core-js_shared__",Es=Kl.exports=lv[Ps]||fv(Ps,{});(Es.versions||(Es.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Ti=Kl.exports,Os=Ti,Wl=function(e,t){return Os[e]||(Os[e]=t||{})},dv=Yn,hv=Object,qn=function(e){return hv(dv(e))},vv=G,pv=qn,mv=vv({}.hasOwnProperty),Ie=Object.hasOwn||function(t,r){return mv(pv(t),r)},gv=G,yv=0,wv=Math.random(),bv=gv(1 .toString),Vl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+bv(++yv+wv,36)},Sv=K,ks=Sv.navigator,_s=ks&&ks.userAgent,xr=_s?String(_s):"",Zl=K,ga=xr,Rs=Zl.process,Cs=Zl.Deno,As=Rs&&Rs.versions||Cs&&Cs.version,js=As&&As.v8,Re,_n;js&&(Re=js.split("."),_n=Re[0]>0&&Re[0]<4?1:+(Re[0]+Re[1]));!_n&&ga&&(Re=ga.match(/Edge\/(\d+)/),(!Re||Re[1]>=74)&&(Re=ga.match(/Chrome\/(\d+)/),Re&&(_n=+Re[1])));var Jl=_n,Ls=Jl,$v=ne,Iv=K,Tv=Iv.String,Yl=!!Object.getOwnPropertySymbols&&!$v(function(){var e=Symbol("symbol detection");return!Tv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ls&&Ls<41}),Pv=Yl,ql=Pv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ev=K,Ov=Wl,Us=Ie,kv=Vl,_v=Yl,Rv=ql,Lt=Ev.Symbol,ya=Ov("wks"),Cv=Rv?Lt.for||Lt:Lt&&Lt.withoutSetter||kv,ae=function(e){return Us(ya,e)||(ya[e]=_v&&Us(Lt,e)?Lt[e]:Cv("Symbol."+e)),ya[e]},wa=typeof document=="object"&&document.all,q=typeof wa>"u"&&wa!==void 0?function(e){return typeof e=="function"||e===wa}:function(e){return typeof e=="function"},Av=q,Te=function(e){return typeof e=="object"?e!==null:Av(e)},jv=Te,Lv=String,Uv=TypeError,je=function(e){if(jv(e))return e;throw new Uv(Lv(e)+" is not an object")},Xl={},xv=ne,oe=!xv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Nv=oe,Dv=ne,Ql=Nv&&Dv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),De={},Mv=K,xs=Te,Lo=Mv.document,Fv=xs(Lo)&&xs(Lo.createElement),Xn=function(e){return Fv?Lo.createElement(e):{}},Bv=oe,zv=ne,Hv=Xn,ef=!Bv&&!zv(function(){return Object.defineProperty(Hv("div"),"a",{get:function(){return 7}}).a!==7}),Gv=Vn,Wr=Function.prototype.call,ie=Gv?Wr.bind(Wr):function(){return Wr.apply(Wr,arguments)},ba=K,Kv=q,Wv=function(e){return Kv(e)?e:void 0},Pe=function(e,t){return arguments.length<2?Wv(ba[e]):ba[e]&&ba[e][t]},Vv=G,Qn=Vv({}.isPrototypeOf),Zv=Pe,Jv=q,Yv=Qn,qv=ql,Xv=Object,tf=qv?function(e){return typeof e=="symbol"}:function(e){var t=Zv("Symbol");return Jv(t)&&Yv(t.prototype,Xv(e))},Qv=String,ea=function(e){try{return Qv(e)}catch{return"Object"}},ep=q,tp=ea,rp=TypeError,Le=function(e){if(ep(e))return e;throw new rp(tp(e)+" is not a function")},np=Le,ap=Jn,Pi=function(e,t){var r=e[t];return ap(r)?void 0:np(r)},Sa=ie,$a=q,Ia=Te,op=TypeError,ip=function(e,t){var r,n;if(t==="string"&&$a(r=e.toString)&&!Ia(n=Sa(r,e))||$a(r=e.valueOf)&&!Ia(n=Sa(r,e))||t!=="string"&&$a(r=e.toString)&&!Ia(n=Sa(r,e)))return n;throw new op("Can't convert object to primitive value")},sp=ie,Ns=Te,Ds=tf,cp=Pi,up=ip,lp=ae,fp=TypeError,dp=lp("toPrimitive"),hp=function(e,t){if(!Ns(e)||Ds(e))return e;var r=cp(e,dp),n;if(r){if(t===void 0&&(t="default"),n=sp(r,e,t),!Ns(n)||Ds(n))return n;throw new fp("Can't convert object to primitive value")}return t===void 0&&(t="number"),up(e,t)},vp=hp,pp=tf,rf=function(e){var t=vp(e,"string");return pp(t)?t:t+""},mp=oe,gp=ef,yp=Ql,Vr=je,Ms=rf,wp=TypeError,Ta=Object.defineProperty,bp=Object.getOwnPropertyDescriptor,Pa="enumerable",Ea="configurable",Oa="writable";De.f=mp?yp?function(t,r,n){if(Vr(t),r=Ms(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Oa in n&&!n[Oa]){var a=bp(t,r);a&&a[Oa]&&(t[r]=n.value,n={configurable:Ea in n?n[Ea]:a[Ea],enumerable:Pa in n?n[Pa]:a[Pa],writable:!1})}return Ta(t,r,n)}:Ta:function(t,r,n){if(Vr(t),r=Ms(r),Vr(n),gp)try{return Ta(t,r,n)}catch{}if("get"in n||"set"in n)throw new wp("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Sp=Math.ceil,$p=Math.floor,Ip=Math.trunc||function(t){var r=+t;return(r>0?$p:Sp)(r)},Tp=Ip,Ei=function(e){var t=+e;return t!==t||t===0?0:Tp(t)},Pp=Ei,Ep=Math.max,Op=Math.min,nf=function(e,t){var r=Pp(e);return r<0?Ep(r+t,0):Op(r,t)},kp=Ei,_p=Math.min,Rp=function(e){var t=kp(e);return t>0?_p(t,9007199254740991):0},Cp=Rp,Oi=function(e){return Cp(e.length)},Ap=Ur,jp=nf,Lp=Oi,Fs=function(e){return function(t,r,n){var a=Ap(t),o=Lp(a);if(o===0)return!e&&-1;var i=jp(n,o),s;if(e&&r!==r){for(;o>i;)if(s=a[i++],s!==s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===r)return e||i||0;return!e&&-1}},Up={includes:Fs(!0),indexOf:Fs(!1)},ki={},xp=G,ka=Ie,Np=Ur,Dp=Up.indexOf,Mp=ki,Bs=xp([].push),af=function(e,t){var r=Np(e),n=0,a=[],o;for(o in r)!ka(Mp,o)&&ka(r,o)&&Bs(a,o);for(;t.length>n;)ka(r,o=t[n++])&&(~Dp(a,o)||Bs(a,o));return a},_i=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Fp=af,Bp=_i,of=Object.keys||function(t){return Fp(t,Bp)},zp=oe,Hp=Ql,Gp=De,Kp=je,Wp=Ur,Vp=of;Xl.f=zp&&!Hp?Object.defineProperties:function(t,r){Kp(t);for(var n=Wp(r),a=Vp(r),o=a.length,i=0,s;o>i;)Gp.f(t,s=a[i++],n[s]);return t};var Zp=Pe,sf=Zp("document","documentElement"),Jp=Wl,Yp=Vl,zs=Jp("keys"),Ri=function(e){return zs[e]||(zs[e]=Yp(e))},qp=je,Xp=Xl,Hs=_i,Qp=ki,em=sf,tm=Xn,rm=Ri,Gs=">",Ks="<",Uo="prototype",xo="script",cf=rm("IE_PROTO"),_a=function(){},uf=function(e){return Ks+xo+Gs+e+Ks+"/"+xo+Gs},Ws=function(e){e.write(uf("")),e.close();var t=e.parentWindow.Object;return e=null,t},nm=function(){var e=tm("iframe"),t="java"+xo+":",r;return e.style.display="none",em.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(uf("document.F=Object")),r.close(),r.F},Zr,bn=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}bn=typeof document<"u"?document.domain&&Zr?Ws(Zr):nm():Ws(Zr);for(var e=Hs.length;e--;)delete bn[Uo][Hs[e]];return bn()};Qp[cf]=!0;var ta=Object.create||function(t,r){var n;return t!==null?(_a[Uo]=qp(t),n=new _a,_a[Uo]=null,n[cf]=t):n=bn(),r===void 0?n:Xp.f(n,r)},am=ae,om=ta,im=De.f,No=am("unscopables"),Do=Array.prototype;Do[No]===void 0&&im(Do,No,{configurable:!0,value:om(null)});var sm=function(e){Do[No][e]=!0},Nr={},cm=K,um=q,Vs=cm.WeakMap,lm=um(Vs)&&/native code/.test(String(Vs)),wt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},fm=oe,dm=De,hm=wt,bt=fm?function(e,t,r){return dm.f(e,t,hm(1,r))}:function(e,t,r){return e[t]=r,e},vm=lm,lf=K,pm=Te,mm=bt,Ra=Ie,Ca=Ti,gm=Ri,ym=ki,Zs="Object already initialized",Mo=lf.TypeError,wm=lf.WeakMap,Rn,Cr,Cn,bm=function(e){return Cn(e)?Cr(e):Rn(e,{})},Sm=function(e){return function(t){var r;if(!pm(t)||(r=Cr(t)).type!==e)throw new Mo("Incompatible receiver, "+e+" required");return r}};if(vm||Ca.state){var Ue=Ca.state||(Ca.state=new wm);Ue.get=Ue.get,Ue.has=Ue.has,Ue.set=Ue.set,Rn=function(e,t){if(Ue.has(e))throw new Mo(Zs);return t.facade=e,Ue.set(e,t),t},Cr=function(e){return Ue.get(e)||{}},Cn=function(e){return Ue.has(e)}}else{var Tt=gm("state");ym[Tt]=!0,Rn=function(e,t){if(Ra(e,Tt))throw new Mo(Zs);return t.facade=e,mm(e,Tt,t),t},Cr=function(e){return Ra(e,Tt)?e[Tt]:{}},Cn=function(e){return Ra(e,Tt)}}var Qt={set:Rn,get:Cr,has:Cn,enforce:bm,getterFor:Sm},Ci={},Ai={},ff={}.propertyIsEnumerable,df=Object.getOwnPropertyDescriptor,$m=df&&!ff.call({1:2},1);Ai.f=$m?function(t){var r=df(this,t);return!!r&&r.enumerable}:ff;var Im=oe,Tm=ie,Pm=Ai,Em=wt,Om=Ur,km=rf,_m=Ie,Rm=ef,Js=Object.getOwnPropertyDescriptor;Ci.f=Im?Js:function(t,r){if(t=Om(t),r=km(r),Rm)try{return Js(t,r)}catch{}if(_m(t,r))return Em(!Tm(Pm.f,t,r),t[r])};var hf={exports:{}},Fo=oe,Cm=Ie,vf=Function.prototype,Am=Fo&&Object.getOwnPropertyDescriptor,ji=Cm(vf,"name"),jm=ji&&(function(){}).name==="something",Lm=ji&&(!Fo||Fo&&Am(vf,"name").configurable),pf={EXISTS:ji,PROPER:jm,CONFIGURABLE:Lm},Um=G,xm=q,Bo=Ti,Nm=Um(Function.toString);xm(Bo.inspectSource)||(Bo.inspectSource=function(e){return Nm(e)});var Li=Bo.inspectSource,Ui=G,Dm=ne,Mm=q,Jr=Ie,zo=oe,Fm=pf.CONFIGURABLE,Bm=Li,mf=Qt,zm=mf.enforce,Hm=mf.get,Ys=String,Sn=Object.defineProperty,Gm=Ui("".slice),Km=Ui("".replace),Wm=Ui([].join),Vm=zo&&!Dm(function(){return Sn(function(){},"length",{value:8}).length!==8}),Zm=String(String).split("String"),Jm=hf.exports=function(e,t,r){Gm(Ys(t),0,7)==="Symbol("&&(t="["+Km(Ys(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||Fm&&e.name!==t)&&(zo?Sn(e,"name",{value:t,configurable:!0}):e.name=t),Vm&&r&&Jr(r,"arity")&&e.length!==r.arity&&Sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?zo&&Sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=zm(e);return Jr(n,"source")||(n.source=Wm(Zm,typeof t=="string"?t:"")),e};Function.prototype.toString=Jm(function(){return Mm(this)&&Hm(this).source||Bm(this)},"toString");var gf=hf.exports,Ym=q,qm=De,Xm=gf,Qm=Ii,Ee=function(e,t,r,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:t;if(Ym(r)&&Xm(r,o,n),n.global)a?e[t]=r:Qm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:qm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},yf={},eg=af,tg=_i,rg=tg.concat("length","prototype");yf.f=Object.getOwnPropertyNames||function(t){return eg(t,rg)};var xi={};xi.f=Object.getOwnPropertySymbols;var ng=Pe,ag=G,og=yf,ig=xi,sg=je,cg=ag([].concat),ug=ng("Reflect","ownKeys")||function(t){var r=og.f(sg(t)),n=ig.f;return n?cg(r,n(t)):r},qs=Ie,lg=ug,fg=Ci,dg=De,wf=function(e,t,r){for(var n=lg(t),a=dg.f,o=fg.f,i=0;i<n.length;i++){var s=n[i];!qs(e,s)&&!(r&&qs(r,s))&&a(e,s,o(t,s))}},hg=ne,vg=q,pg=/#|\.prototype\./,Dr=function(e,t){var r=gg[mg(e)];return r===wg?!0:r===yg?!1:vg(t)?hg(t):!!t},mg=Dr.normalize=function(e){return String(e).replace(pg,".").toLowerCase()},gg=Dr.data={},yg=Dr.NATIVE="N",wg=Dr.POLYFILL="P",bf=Dr,Yr=K,bg=Ci.f,Sg=bt,$g=Ee,Ig=Ii,Tg=wf,Pg=bf,ee=function(e,t){var r=e.target,n=e.global,a=e.stat,o,i,s,l,f,u;if(n?i=Yr:a?i=Yr[r]||Ig(r,{}):i=Yr[r]&&Yr[r].prototype,i)for(s in t){if(f=t[s],e.dontCallGetSet?(u=bg(i,s),l=u&&u.value):l=i[s],o=Pg(n?s:r+(a?".":"#")+s,e.forced),!o&&l!==void 0){if(typeof f==typeof l)continue;Tg(f,l)}(e.sham||l&&l.sham)&&Sg(f,"sham",!0),$g(i,s,f,e)}},Eg=ne,Og=!Eg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),kg=Ie,_g=q,Rg=qn,Cg=Ri,Ag=Og,Xs=Cg("IE_PROTO"),Ho=Object,jg=Ho.prototype,Ni=Ag?Ho.getPrototypeOf:function(e){var t=Rg(e);if(kg(t,Xs))return t[Xs];var r=t.constructor;return _g(r)&&t instanceof r?r.prototype:t instanceof Ho?jg:null},Lg=ne,Ug=q,xg=Te,Qs=Ni,Ng=Ee,Dg=ae,Go=Dg("iterator"),Sf=!1,pt,Aa,ja;[].keys&&(ja=[].keys(),"next"in ja?(Aa=Qs(Qs(ja)),Aa!==Object.prototype&&(pt=Aa)):Sf=!0);var Mg=!xg(pt)||Lg(function(){var e={};return pt[Go].call(e)!==e});Mg&&(pt={});Ug(pt[Go])||Ng(pt,Go,function(){return this});var $f={IteratorPrototype:pt,BUGGY_SAFARI_ITERATORS:Sf},Fg=De.f,Bg=Ie,zg=ae,ec=zg("toStringTag"),er=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Bg(e,ec)&&Fg(e,ec,{configurable:!0,value:t})},Hg=$f.IteratorPrototype,Gg=ta,Kg=wt,Wg=er,Vg=Nr,Zg=function(){return this},If=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Gg(Hg,{next:Kg(+!n,r)}),Wg(e,a,!1),Vg[a]=Zg,e},Jg=G,Yg=Le,qg=function(e,t,r){try{return Jg(Yg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Xg=Te,Qg=function(e){return Xg(e)||e===null},ey=Qg,ty=String,ry=TypeError,ny=function(e){if(ey(e))return e;throw new ry("Can't set "+ty(e)+" as a prototype")},ay=qg,oy=Te,iy=Yn,sy=ny,Di=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=ay(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,o){return iy(a),sy(o),oy(a)&&(e?r(a,o):a.__proto__=o),a}}():void 0),cy=ee,uy=ie,Tf=pf,ly=q,fy=If,tc=Ni,rc=Di,dy=er,hy=bt,La=Ee,vy=ae,py=Nr,Pf=$f,my=Tf.PROPER,gy=Tf.CONFIGURABLE,nc=Pf.IteratorPrototype,qr=Pf.BUGGY_SAFARI_ITERATORS,cr=vy("iterator"),ac="keys",ur="values",oc="entries",yy=function(){return this},Ef=function(e,t,r,n,a,o,i){fy(r,t,n);var s=function(I){if(I===a&&d)return d;if(!qr&&I&&I in u)return u[I];switch(I){case ac:return function(){return new r(this,I)};case ur:return function(){return new r(this,I)};case oc:return function(){return new r(this,I)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,c=u[cr]||u["@@iterator"]||a&&u[a],d=!qr&&c||s(a),h=t==="Array"&&u.entries||c,v,b,g;if(h&&(v=tc(h.call(new e)),v!==Object.prototype&&v.next&&(tc(v)!==nc&&(rc?rc(v,nc):ly(v[cr])||La(v,cr,yy)),dy(v,l,!0))),my&&a===ur&&c&&c.name!==ur&&(gy?hy(u,"name",ur):(f=!0,d=function(){return uy(c,this)})),a)if(b={values:s(ur),keys:o?d:s(ac),entries:s(oc)},i)for(g in b)(qr||f||!(g in u))&&La(u,g,b[g]);else cy({target:t,proto:!0,forced:qr||f},b);return u[cr]!==d&&La(u,cr,d,{name:a}),py[t]=d,b},Mi=function(e,t){return{value:e,done:t}},wy=Ur,Fi=sm,ic=Nr,Of=Qt,by=De.f,Sy=Ef,Xr=Mi,$y=oe,kf="Array Iterator",Iy=Of.set,Ty=Of.getterFor(kf),Py=Sy(Array,"Array",function(e,t){Iy(this,{type:kf,target:wy(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,Xr(void 0,!0);switch(e.kind){case"keys":return Xr(r,!1);case"values":return Xr(t[r],!1)}return Xr([r,t[r]],!1)},"values"),sc=ic.Arguments=ic.Array;Fi("keys");Fi("values");Fi("entries");if($y&&sc.name!=="values")try{by(sc,"name",{value:"values"})}catch{}var Ey=ee,Oy=G,ky=nf,_y=RangeError,cc=String.fromCharCode,uc=String.fromCodePoint,Ry=Oy([].join),Cy=!!uc&&uc.length!==1;Ey({target:"String",stat:!0,arity:1,forced:Cy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,o;n>a;){if(o=+arguments[a++],ky(o,1114111)!==o)throw new _y(o+" is not a valid code point");r[a]=o<65536?cc(o):cc(((o-=65536)>>10)+55296,o%1024+56320)}return Ry(r,"")}});var lc=K,Ay=oe,jy=Object.getOwnPropertyDescriptor,_f=function(e){if(!Ay)return lc[e];var t=jy(lc,e);return t&&t.value},Ly=ne,Uy=ae,xy=oe,fc=cv,Ny=Uy("iterator"),ra=!Ly(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,o){t.delete("b"),n+=o+a}),r.delete("a",2),r.delete("b",void 0),fc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(fc||!xy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Ny]||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"}),dc=gf,Dy=De,na=function(e,t,r){return r.get&&dc(r.get,t,{getter:!0}),r.set&&dc(r.set,t,{setter:!0}),Dy.f(e,t,r)},My=Ee,Fy=function(e,t,r){for(var n in t)My(e,n,t[n],r);return e},By=Qn,zy=TypeError,Bi=function(e,t){if(By(t,e))return e;throw new zy("Incorrect invocation")},Hy=Zn,Gy=G,Ky=function(e){if(Hy(e)==="Function")return Gy(e)},hc=Ky,Wy=Le,Vy=Vn,Zy=hc(hc.bind),tr=function(e,t){return Wy(e),t===void 0?e:Vy?Zy(e,t):function(){return e.apply(t,arguments)}},Jy=ae,Yy=Jy("toStringTag"),Rf={};Rf[Yy]="z";var zi=String(Rf)==="[object z]",qy=zi,Xy=q,$n=Zn,Qy=ae,ew=Qy("toStringTag"),tw=Object,rw=$n(function(){return arguments}())==="Arguments",nw=function(e,t){try{return e[t]}catch{}},Mr=qy?$n:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=nw(t=tw(e),ew))=="string"?r:rw?$n(t):(n=$n(t))==="Object"&&Xy(t.callee)?"Arguments":n},aw=Mr,ow=String,Ze=function(e){if(aw(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ow(e)},iw=Mr,vc=Pi,sw=Jn,cw=Nr,uw=ae,lw=uw("iterator"),aa=function(e){if(!sw(e))return vc(e,lw)||vc(e,"@@iterator")||cw[iw(e)]},fw=ie,dw=Le,hw=je,vw=ea,pw=aa,mw=TypeError,Hi=function(e,t){var r=arguments.length<2?pw(e):t;if(dw(r))return hw(fw(r,e));throw new mw(vw(e)+" is not iterable")},gw=TypeError,St=function(e,t){if(e<t)throw new gw("Not enough arguments");return e},yw=G,oa=yw([].slice),pc=oa,ww=Math.floor,Ko=function(e,t){var r=e.length;if(r<8)for(var n=1,a,o;n<r;){for(o=n,a=e[n];o&&t(e[o-1],a)>0;)e[o]=e[--o];o!==n++&&(e[o]=a)}else for(var i=ww(r/2),s=Ko(pc(e,0,i),t),l=Ko(pc(e,i),t),f=s.length,u=l.length,c=0,d=0;c<f||d<u;)e[c+d]=c<f&&d<u?t(s[c],l[d])<=0?s[c++]:l[d++]:c<f?s[c++]:l[d++];return e},bw=Ko,Wo=ee,Cf=K,Gi=_f,Sw=Pe,Qr=ie,Ae=G,Sr=oe,Af=ra,jf=Ee,$w=na,Iw=Fy,Tw=er,Pw=If,Ki=Qt,Lf=Bi,Ua=q,Ew=Ie,Ow=tr,kw=Mr,_w=je,Uf=Te,ce=Ze,Rw=ta,mc=wt,gc=Hi,Cw=aa,en=Mi,Pt=St,Aw=ae,jw=bw,Lw=Aw("iterator"),rr="URLSearchParams",xf=rr+"Iterator",Nf=Ki.set,be=Ki.getterFor(rr),Uw=Ki.getterFor(xf),yc=Gi("fetch"),An=Gi("Request"),$r=Gi("Headers"),xa=An&&An.prototype,wc=$r&&$r.prototype,xw=Cf.TypeError,Nw=Cf.encodeURIComponent,Dw=String.fromCharCode,Mw=Sw("String","fromCodePoint"),Fw=parseInt,In=Ae("".charAt),bc=Ae([].join),Qe=Ae([].push),Df=Ae("".replace),Bw=Ae([].shift),Sc=Ae([].splice),$c=Ae("".split),Mf=Ae("".slice),zw=Ae(/./.exec),Hw=/\+/g,Na="�",Gw=/^[0-9a-f]+$/i,Ic=function(e,t){var r=Mf(e,t,t+2);return zw(Gw,r)?Fw(r,16):NaN},Kw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Ww=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},Tc=function(e){e=Df(e,Hw," ");for(var t=e.length,r="",n=0;n<t;){var a=In(e,n);if(a==="%"){if(In(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var o=Ic(e,n+1);if(o!==o){r+=a,n++;continue}n+=2;var i=Kw(o);if(i===0)a=Dw(o);else{if(i===1||i>4){r+=Na,n++;continue}for(var s=[o],l=1;l<i&&(n++,!(n+3>t||In(e,n)!=="%"));){var f=Ic(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Qe(s,f),n+=2,l++}if(s.length!==i){r+=Na;continue}var u=Ww(s);u===null?r+=Na:a=Mw(u)}}r+=a,n++}return r},Vw=/[!'()~]|%20/g,Zw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Jw=function(e){return Zw[e]},Pc=function(e){return Df(Nw(e),Vw,Jw)},Da=Pw(function(t,r){Nf(this,{type:xf,target:be(t).entries,index:0,kind:r})},rr,function(){var t=Uw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,en(void 0,!0);var a=r[n];switch(t.kind){case"keys":return en(a.key,!1);case"values":return en(a.value,!1)}return en([a.key,a.value],!1)},!0),Ff=function(e){this.entries=[],this.url=null,e!==void 0&&(Uf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?In(e,0)==="?"?Mf(e,1):e:ce(e)))};Ff.prototype={type:rr,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Cw(e),n,a,o,i,s,l,f;if(r)for(n=gc(e,r),a=n.next;!(o=Qr(a,n)).done;){if(i=gc(_w(o.value)),s=i.next,(l=Qr(s,i)).done||(f=Qr(s,i)).done||!Qr(s,i).done)throw new xw("Expected sequence with length 2");Qe(t,{key:ce(l.value),value:ce(f.value)})}else for(var u in e)Ew(e,u)&&Qe(t,{key:u,value:ce(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=$c(e,"&"),n=0,a,o;n<r.length;)a=r[n++],a.length&&(o=$c(a,"="),Qe(t,{key:Tc(Bw(o)),value:Tc(bc(o,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Qe(t,Pc(n.key)+"="+Pc(n.value));return bc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ia=function(){Lf(this,Ht);var t=arguments.length>0?arguments[0]:void 0,r=Nf(this,new Ff(t));Sr||(this.size=r.entries.length)},Ht=ia.prototype;Iw(Ht,{append:function(t,r){var n=be(this);Pt(arguments.length,2),Qe(n.entries,{key:ce(t),value:ce(r)}),Sr||this.length++,n.updateURL()},delete:function(e){for(var t=be(this),r=Pt(arguments.length,1),n=t.entries,a=ce(e),o=r<2?void 0:arguments[1],i=o===void 0?o:ce(o),s=0;s<n.length;){var l=n[s];if(l.key===a&&(i===void 0||l.value===i)){if(Sc(n,s,1),i!==void 0)break}else s++}Sr||(this.size=n.length),t.updateURL()},get:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=ce(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=ce(t),a=[],o=0;o<r.length;o++)r[o].key===n&&Qe(a,r[o].value);return a},has:function(t){for(var r=be(this).entries,n=Pt(arguments.length,1),a=ce(t),o=n<2?void 0:arguments[1],i=o===void 0?o:ce(o),s=0;s<r.length;){var l=r[s++];if(l.key===a&&(i===void 0||l.value===i))return!0}return!1},set:function(t,r){var n=be(this);Pt(arguments.length,1);for(var a=n.entries,o=!1,i=ce(t),s=ce(r),l=0,f;l<a.length;l++)f=a[l],f.key===i&&(o?Sc(a,l--,1):(o=!0,f.value=s));o||Qe(a,{key:i,value:s}),Sr||(this.size=a.length),n.updateURL()},sort:function(){var t=be(this);jw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=be(this).entries,n=Ow(t,arguments.length>1?arguments[1]:void 0),a=0,o;a<r.length;)o=r[a++],n(o.value,o.key,this)},keys:function(){return new Da(this,"keys")},values:function(){return new Da(this,"values")},entries:function(){return new Da(this,"entries")}},{enumerable:!0});jf(Ht,Lw,Ht.entries,{name:"entries"});jf(Ht,"toString",function(){return be(this).serialize()},{enumerable:!0});Sr&&$w(Ht,"size",{get:function(){return be(this).entries.length},configurable:!0,enumerable:!0});Tw(ia,rr);Wo({global:!0,constructor:!0,forced:!Af},{URLSearchParams:ia});if(!Af&&Ua($r)){var Yw=Ae(wc.has),qw=Ae(wc.set),Ec=function(e){if(Uf(e)){var t=e.body,r;if(kw(t)===rr)return r=e.headers?new $r(e.headers):new $r,Yw(r,"content-type")||qw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Rw(e,{body:mc(0,ce(t)),headers:mc(0,r)})}return e};if(Ua(yc)&&Wo({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return yc(t,arguments.length>1?Ec(arguments[1]):{})}}),Ua(An)){var Ma=function(t){return Lf(this,xa),new An(t,arguments.length>1?Ec(arguments[1]):{})};xa.constructor=Ma,Ma.prototype=xa,Wo({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ma})}}var Xw={URLSearchParams:ia,getState:be},Qw=Ee,sa=G,Oc=Ze,eb=St,Bf=URLSearchParams,ca=Bf.prototype,tb=sa(ca.append),kc=sa(ca.delete),rb=sa(ca.forEach),nb=sa([].push),Wi=new Bf("a=1&a=2&b=3");Wi.delete("a",1);Wi.delete("b",void 0);Wi+""!="a=2"&&Qw(ca,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return kc(this,e);var n=[];rb(this,function(c,d){nb(n,{key:d,value:c})}),eb(t,1);for(var a=Oc(e),o=Oc(r),i=0,s=0,l=!1,f=n.length,u;i<f;)u=n[i++],l||u.key===a?(l=!0,kc(this,u.key)):s++;for(;s<f;)u=n[s++],u.key===a&&u.value===o||tb(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var ab=Ee,zf=G,ob=Ze,ib=St,Hf=URLSearchParams,Vi=Hf.prototype,sb=zf(Vi.getAll),cb=zf(Vi.has),_c=new Hf("a=1");(_c.has("a",2)||!_c.has("a",void 0))&&ab(Vi,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return cb(this,t);var a=sb(this,t);ib(r,1);for(var o=ob(n),i=0;i<a.length;)if(a[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0});var ub=oe,lb=G,fb=na,Vo=URLSearchParams.prototype,db=lb(Vo.forEach);ub&&!("size"in Vo)&&fb(Vo,"size",{get:function(){var t=0;return db(this,function(){t++}),t},configurable:!0,enumerable:!0});var hb=K,Zi=hb,vb=Zi;vb.URLSearchParams;var Ji=G,pb=Ei,mb=Ze,gb=Yn,yb=Ji("".charAt),Rc=Ji("".charCodeAt),wb=Ji("".slice),Cc=function(e){return function(t,r){var n=mb(gb(t)),a=pb(r),o=n.length,i,s;return a<0||a>=o?e?"":void 0:(i=Rc(n,a),i<55296||i>56319||a+1===o||(s=Rc(n,a+1))<56320||s>57343?e?yb(n,a):i:e?wb(n,a,a+2):(i-55296<<10)+(s-56320)+65536)}},Gf={codeAt:Cc(!1),charAt:Cc(!0)},bb=Gf.charAt,Sb=Ze,Kf=Qt,$b=Ef,Ac=Mi,Wf="String Iterator",Ib=Kf.set,Tb=Kf.getterFor(Wf);$b(String,"String",function(e){Ib(this,{type:Wf,string:Sb(e),index:0})},function(){var t=Tb(this),r=t.string,n=t.index,a;return n>=r.length?Ac(void 0,!0):(a=bb(r,n),t.index+=a.length,Ac(a,!1))});var jc=oe,Pb=G,Eb=ie,Ob=ne,Fa=of,kb=xi,_b=Ai,Rb=qn,Cb=Gl,Et=Object.assign,Lc=Object.defineProperty,Ab=Pb([].concat),jb=!Et||Ob(function(){if(jc&&Et({b:1},Et(Lc({},"a",{enumerable:!0,get:function(){Lc(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}),Et({},e)[r]!==7||Fa(Et({},t)).join("")!==n})?function(t,r){for(var n=Rb(t),a=arguments.length,o=1,i=kb.f,s=_b.f;a>o;)for(var l=Cb(arguments[o++]),f=i?Ab(Fa(l),i(l)):Fa(l),u=f.length,c=0,d;u>c;)d=f[c++],(!jc||Eb(s,l,d))&&(n[d]=l[d]);return n}:Et,Lb=ie,Uc=je,Ub=Pi,Vf=function(e,t,r){var n,a;Uc(e);try{if(n=Ub(e,"return"),!n){if(t==="throw")throw r;return r}n=Lb(n,e)}catch(o){a=!0,n=o}if(t==="throw")throw r;if(a)throw n;return Uc(n),r},xb=je,Nb=Vf,Db=function(e,t,r,n){try{return n?t(xb(r)[0],r[1]):t(r)}catch(a){Nb(e,"throw",a)}},Mb=ae,Fb=Nr,Bb=Mb("iterator"),zb=Array.prototype,Zf=function(e){return e!==void 0&&(Fb.Array===e||zb[Bb]===e)},Hb=G,Gb=ne,Jf=q,Kb=Mr,Wb=Pe,Vb=Li,Yf=function(){},qf=Wb("Reflect","construct"),Yi=/^\s*(?:class|function)\b/,Zb=Hb(Yi.exec),Jb=!Yi.test(Yf),lr=function(t){if(!Jf(t))return!1;try{return qf(Yf,[],t),!0}catch{return!1}},Xf=function(t){if(!Jf(t))return!1;switch(Kb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Jb||!!Zb(Yi,Vb(t))}catch{return!0}};Xf.sham=!0;var Qf=!qf||Gb(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?Xf:lr,Yb=oe,qb=De,Xb=wt,Qb=function(e,t,r){Yb?qb.f(e,t,Xb(0,r)):e[t]=r},eS=tr,tS=ie,rS=qn,nS=Db,aS=Zf,oS=Qf,iS=Oi,xc=Qb,sS=Hi,cS=aa,Nc=Array,uS=function(t){var r=rS(t),n=oS(this),a=arguments.length,o=a>1?arguments[1]:void 0,i=o!==void 0;i&&(o=eS(o,a>2?arguments[2]:void 0));var s=cS(r),l=0,f,u,c,d,h,v;if(s&&!(this===Nc&&aS(s)))for(u=n?new this:[],d=sS(r,s),h=d.next;!(c=tS(h,d)).done;l++)v=i?nS(d,o,[c.value,l],!0):c.value,xc(u,l,v);else for(f=iS(r),u=n?new this(f):Nc(f);f>l;l++)v=i?o(r[l],l):r[l],xc(u,l,v);return u.length=l,u},$t=G,Ba=2147483647,Ir=36,ed=1,Zo=26,lS=38,fS=700,dS=72,hS=128,vS="-",pS=/[^\0-\u007E]/,td=/[.\u3002\uFF0E\uFF61]/g,Dc="Overflow: input needs wider integers to process",za=Ir-ed,Mc=RangeError,mS=$t(td.exec),Ut=Math.floor,Ha=String.fromCharCode,Fc=$t("".charCodeAt),rd=$t([].join),et=$t([].push),gS=$t("".replace),yS=$t("".split),wS=$t("".toLowerCase),bS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Fc(e,r++);if(a>=55296&&a<=56319&&r<n){var o=Fc(e,r++);(o&64512)===56320?et(t,((a&1023)<<10)+(o&1023)+65536):(et(t,a),r--)}else et(t,a)}return t},Bc=function(e){return e+22+75*(e<26)},SS=function(e,t,r){var n=0;for(e=r?Ut(e/fS):e>>1,e+=Ut(e/t);e>za*Zo>>1;)e=Ut(e/za),n+=Ir;return Ut(n+(za+1)*e/(e+lS))},$S=function(e){var t=[];e=bS(e);var r=e.length,n=hS,a=0,o=dS,i,s;for(i=0;i<e.length;i++)s=e[i],s<128&&et(t,Ha(s));var l=t.length,f=l;for(l&&et(t,vS);f<r;){var u=Ba;for(i=0;i<e.length;i++)s=e[i],s>=n&&s<u&&(u=s);var c=f+1;if(u-n>Ut((Ba-a)/c))throw new Mc(Dc);for(a+=(u-n)*c,n=u,i=0;i<e.length;i++){if(s=e[i],s<n&&++a>Ba)throw new Mc(Dc);if(s===n){for(var d=a,h=Ir;;){var v=h<=o?ed:h>=o+Zo?Zo:h-o;if(d<v)break;var b=d-v,g=Ir-v;et(t,Ha(Bc(v+b%g))),d=Ut(b/g),h+=Ir}et(t,Ha(Bc(d))),o=SS(a,c,f===l),a=0,f++}}a++,n++}return rd(t,"")},IS=function(e){var t=[],r=yS(gS(wS(e),td,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],et(t,mS(pS,a)?"xn--"+$S(a):a);return rd(t,".")},TS=ee,qi=oe,PS=ra,Xi=K,zc=tr,Oe=G,jn=Ee,ge=na,ES=Bi,Jo=Ie,Qi=jb,Ot=uS,ke=oa,OS=Gf.codeAt,kS=IS,ze=Ze,_S=er,RS=St,nd=Xw,ad=Qt,CS=ad.set,Ln=ad.getterFor("URL"),AS=nd.URLSearchParams,jS=nd.getState,fr=Xi.URL,Yo=Xi.TypeError,Un=Xi.parseInt,LS=Math.floor,Hc=Math.pow,$e=Oe("".charAt),Ce=Oe(/./.exec),gr=Oe([].join),US=Oe(1 .toString),xS=Oe([].pop),Ct=Oe([].push),Ga=Oe("".replace),NS=Oe([].shift),DS=Oe("".split),Tr=Oe("".slice),xn=Oe("".toLowerCase),MS=Oe([].unshift),FS="Invalid authority",Ka="Invalid scheme",at="Invalid host",Gc="Invalid port",od=/[a-z]/i,BS=/[\d+-.a-z]/i,qo=/\d/,zS=/^0x/i,HS=/^[0-7]+$/,GS=/^\d+$/,id=/^[\da-f]+$/i,KS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,WS=/[\0\t\n\r #/:<>?@[\\\]^|]/,VS=/^[\u0000-\u0020]+/,ZS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,JS=/[\t\n\r]/g,ye,YS=function(e){var t=DS(e,"."),r,n,a,o,i,s,l;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(o=t[a],o==="")return e;if(i=10,o.length>1&&$e(o,0)==="0"&&(i=Ce(zS,o)?16:8,o=Tr(o,i===8?1:2)),o==="")s=0;else{if(!Ce(i===10?GS:i===8?HS:id,o))return e;s=Un(o,i)}Ct(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Hc(256,5-r))return null}else if(s>255)return null;for(l=xS(n),a=0;a<n.length;a++)l+=n[a]*Hc(256,3-a);return l},qS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,o,i,s,l,f,u,c,d=function(){return $e(e,a)};if(d()===":"){if($e(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(o=i=0;i<4&&Ce(id,d());)o=o*16+Un(d(),16),a++,i++;if(d()==="."){if(i===0||(a-=i,r>6))return;for(s=0;d();){if(l=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ce(qo,d()))return;for(;Ce(qo,d());){if(f=Un(d(),10),l===null)l=f;else{if(l===0)return;l=l*10+f}if(l>255)return;a++}t[r]=t[r]*256+l,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=o}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)c=t[r],t[r--]=t[n+u-1],t[n+--u]=c;else if(r!==8)return;return t},XS=function(e){for(var t=null,r=1,n=null,a=0,o=0;o<8;o++)e[o]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=o),++a);return a>r?n:t},dr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)MS(t,e%256),e=LS(e/256);return gr(t,".")}if(typeof e=="object"){for(t="",n=XS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=US(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Tn={},sd=Qi({},Tn,{" ":1,'"':1,"<":1,">":1,"`":1}),cd=Qi({},sd,{"#":1,"?":1,"{":1,"}":1}),Wa=Qi({},cd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ye=function(e,t){var r=OS(e,0);return r>32&&r<127&&!Jo(t,e)?e:encodeURIComponent(e)},tn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},yr=function(e,t){var r;return e.length===2&&Ce(od,$e(e,0))&&((r=$e(e,1))===":"||!t&&r==="|")},Kc=function(e){var t;return e.length>1&&yr(Tr(e,0,2))&&(e.length===2||(t=$e(e,2))==="/"||t==="\\"||t==="?"||t==="#")},QS=function(e){return e==="."||xn(e)==="%2e"},e$=function(e){return e=xn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Va={},Wc={},Za={},Vc={},Zc={},Ja={},Jc={},Yc={},rn={},nn={},Ya={},qa={},Xa={},Qa={},qc={},eo={},kt={},xe={},Xc={},ot={},Be={},es=function(e,t,r){var n=ze(e),a,o,i;if(t){if(o=this.parse(n),o)throw new Yo(o);this.searchParams=null}else{if(r!==void 0&&(a=new es(r,!0)),o=this.parse(n,null,a),o)throw new Yo(o);i=jS(new AS),i.bindURL(this),this.searchParams=i}};es.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Va,o=0,i="",s=!1,l=!1,f=!1,u,c,d,h;for(e=ze(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=Ga(e,VS,""),e=Ga(e,ZS,"$1")),e=Ga(e,JS,""),u=Ot(e);o<=u.length;){switch(c=u[o],a){case Va:if(c&&Ce(od,c))i+=xn(c),a=Wc;else{if(t)return Ka;a=Za;continue}break;case Wc:if(c&&(Ce(BS,c)||c==="+"||c==="-"||c==="."))i+=xn(c);else if(c===":"){if(t&&(n.isSpecial()!==Jo(tn,i)||i==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=i,t){n.isSpecial()&&tn[n.scheme]===n.port&&(n.port=null);return}i="",n.scheme==="file"?a=Qa:n.isSpecial()&&r&&r.scheme===n.scheme?a=Vc:n.isSpecial()?a=Yc:u[o+1]==="/"?(a=Zc,o++):(n.cannotBeABaseURL=!0,Ct(n.path,""),a=Xc)}else{if(t)return Ka;i="",a=Za,o=0;continue}break;case Za:if(!r||r.cannotBeABaseURL&&c!=="#")return Ka;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=ke(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Be;break}a=r.scheme==="file"?Qa:Ja;continue;case Vc:if(c==="/"&&u[o+1]==="/")a=rn,o++;else{a=Ja;continue}break;case Zc:if(c==="/"){a=nn;break}else{a=xe;continue}case Ja:if(n.scheme=r.scheme,c===ye)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Jc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query="",a=ot;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.query=r.query,n.fragment="",a=Be;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ke(r.path),n.path.length--,a=xe;continue}break;case Jc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=rn;else if(c==="/")a=nn;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=xe;continue}break;case Yc:if(a=rn,c!=="/"||$e(i,o+1)!=="/")continue;o++;break;case rn:if(c!=="/"&&c!=="\\"){a=nn;continue}break;case nn:if(c==="@"){s&&(i="%40"+i),s=!0,d=Ot(i);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ye(b,Wa);f?n.password+=g:n.username+=g}i=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&i==="")return FS;o-=Ot(i).length+1,i="",a=Ya}else i+=c;break;case Ya:case qa:if(t&&n.scheme==="file"){a=eo;continue}else if(c===":"&&!l){if(i==="")return at;if(h=n.parseHost(i),h)return h;if(i="",a=Xa,t===qa)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&i==="")return at;if(t&&i===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(i),h)return h;if(i="",a=kt,t)return;continue}else c==="["?l=!0:c==="]"&&(l=!1),i+=c;break;case Xa:if(Ce(qo,c))i+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(i!==""){var I=Un(i,10);if(I>65535)return Gc;n.port=n.isSpecial()&&I===tn[n.scheme]?null:I,i=""}if(t)return;a=kt;continue}else return Gc;break;case Qa:if(n.scheme="file",c==="/"||c==="\\")a=qc;else if(r&&r.scheme==="file")switch(c){case ye:n.host=r.host,n.path=ke(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ke(r.path),n.query="",a=ot;break;case"#":n.host=r.host,n.path=ke(r.path),n.query=r.query,n.fragment="",a=Be;break;default:Kc(gr(ke(u,o),""))||(n.host=r.host,n.path=ke(r.path),n.shortenPath()),a=xe;continue}else{a=xe;continue}break;case qc:if(c==="/"||c==="\\"){a=eo;break}r&&r.scheme==="file"&&!Kc(gr(ke(u,o),""))&&(yr(r.path[0],!0)?Ct(n.path,r.path[0]):n.host=r.host),a=xe;continue;case eo:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&yr(i))a=xe;else if(i===""){if(n.host="",t)return;a=kt}else{if(h=n.parseHost(i),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;i="",a=kt}continue}else i+=c;break;case kt:if(n.isSpecial()){if(a=xe,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=ot;else if(!t&&c==="#")n.fragment="",a=Be;else if(c!==ye&&(a=xe,c!=="/"))continue;break;case xe:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(e$(i)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,"")):QS(i)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,""):(n.scheme==="file"&&!n.path.length&&yr(i)&&(n.host&&(n.host=""),i=$e(i,0)+":"),Ct(n.path,i)),i="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)NS(n.path);c==="?"?(n.query="",a=ot):c==="#"&&(n.fragment="",a=Be)}else i+=Ye(c,cd);break;case Xc:c==="?"?(n.query="",a=ot):c==="#"?(n.fragment="",a=Be):c!==ye&&(n.path[0]+=Ye(c,Tn));break;case ot:!t&&c==="#"?(n.fragment="",a=Be):c!==ye&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ye(c,Tn));break;case Be:c!==ye&&(n.fragment+=Ye(c,sd));break}o++}},parseHost:function(e){var t,r,n;if($e(e,0)==="["){if($e(e,e.length-1)!=="]"||(t=qS(Tr(e,1,-1)),!t))return at;this.host=t}else if(this.isSpecial()){if(e=kS(e),Ce(KS,e)||(t=YS(e),t===null))return at;this.host=t}else{if(Ce(WS,e))return at;for(t="",r=Ot(e),n=0;n<r.length;n++)t+=Ye(r[n],Tn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Jo(tn,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!yr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,o=e.port,i=e.path,s=e.query,l=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=dr(a),o!==null&&(f+=":"+o)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?i[0]:i.length?"/"+gr(i,"/"):"",s!==null&&(f+="?"+s),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new Yo(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Gt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+dr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(ze(e)+":",Va)},getUsername:function(){return this.username},setUsername:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ye(t[r],Wa)}},getPassword:function(){return this.password},setPassword:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ye(t[r],Wa)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?dr(e):dr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ya)},getHostname:function(){var e=this.host;return e===null?"":dr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,qa)},getPort:function(){var e=this.port;return e===null?"":ze(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=ze(e),e===""?this.port=null:this.parse(e,Xa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+gr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,kt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=ze(e),e===""?this.query=null:($e(e,0)==="?"&&(e=Tr(e,1)),this.query="",this.parse(e,ot)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=ze(e),e===""){this.fragment=null;return}$e(e,0)==="#"&&(e=Tr(e,1)),this.fragment="",this.parse(e,Be)},update:function(){this.query=this.searchParams.serialize()||null}};var Gt=function(t){var r=ES(this,se),n=RS(arguments.length,1)>1?arguments[1]:void 0,a=CS(r,new es(t,!1,n));qi||(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())},se=Gt.prototype,we=function(e,t){return{get:function(){return Ln(this)[e]()},set:t&&function(r){return Ln(this)[t](r)},configurable:!0,enumerable:!0}};qi&&(ge(se,"href",we("serialize","setHref")),ge(se,"origin",we("getOrigin")),ge(se,"protocol",we("getProtocol","setProtocol")),ge(se,"username",we("getUsername","setUsername")),ge(se,"password",we("getPassword","setPassword")),ge(se,"host",we("getHost","setHost")),ge(se,"hostname",we("getHostname","setHostname")),ge(se,"port",we("getPort","setPort")),ge(se,"pathname",we("getPathname","setPathname")),ge(se,"search",we("getSearch","setSearch")),ge(se,"searchParams",we("getSearchParams")),ge(se,"hash",we("getHash","setHash")));jn(se,"toJSON",function(){return Ln(this).serialize()},{enumerable:!0});jn(se,"toString",function(){return Ln(this).serialize()},{enumerable:!0});if(fr){var Qc=fr.createObjectURL,eu=fr.revokeObjectURL;Qc&&jn(Gt,"createObjectURL",zc(Qc,fr)),eu&&jn(Gt,"revokeObjectURL",zc(eu,fr))}_S(Gt,"URL");TS({global:!0,constructor:!0,forced:!PS,sham:!qi},{URL:Gt});var t$=ee,r$=Pe,ud=ne,n$=St,tu=Ze,a$=ra,ts=r$("URL"),o$=a$&&ud(function(){ts.canParse()}),i$=ud(function(){return ts.canParse.length!==1});t$({target:"URL",stat:!0,forced:!o$||i$},{canParse:function(t){var r=n$(arguments.length,1),n=tu(t),a=r<2||arguments[1]===void 0?void 0:tu(arguments[1]);try{return!!new ts(n,a)}catch{return!1}}});var s$=ee,c$=Pe,u$=St,ru=Ze,l$=ra,f$=c$("URL");s$({target:"URL",stat:!0,forced:!l$},{parse:function(t){var r=u$(arguments.length,1),n=ru(t),a=r<2||arguments[1]===void 0?void 0:ru(arguments[1]);try{return new f$(n,a)}catch{return null}}});var d$=ee,h$=ie;d$({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return h$(URL.prototype.toString,this)}});var v$=Zi;v$.URL;var p$={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},m$=Xn,to=m$("span").classList,nu=to&&to.constructor&&to.constructor.prototype,g$=nu===Object.prototype?void 0:nu,au=K,ld=p$,y$=g$,wr=Py,ou=bt,w$=er,b$=ae,ro=b$("iterator"),no=wr.values,fd=function(e,t){if(e){if(e[ro]!==no)try{ou(e,ro,no)}catch{e[ro]=no}if(w$(e,t,!0),ld[t]){for(var r in wr)if(e[r]!==wr[r])try{ou(e,r,wr[r])}catch{e[r]=wr[r]}}}};for(var ao in ld)fd(au[ao]&&au[ao].prototype,ao);fd(y$,"DOMTokenList");var S$=Te,$$=bt,I$=function(e,t){S$(t)&&"cause"in t&&$$(e,"cause",t.cause)},T$=G,dd=Error,P$=T$("".replace),E$=function(e){return String(new dd(e).stack)}("zxcasd"),hd=/\n\s*at [^:]*:[^\n]*/,O$=hd.test(E$),k$=function(e,t){if(O$&&typeof e=="string"&&!dd.prepareStackTrace)for(;t--;)e=P$(e,hd,"");return e},_$=ne,R$=wt,C$=!_$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",R$(1,7)),e.stack!==7):!0}),A$=bt,j$=k$,L$=C$,iu=Error.captureStackTrace,U$=function(e,t,r,n){L$&&(iu?iu(e,t):A$(e,"stack",j$(r,n)))},x$=tr,N$=ie,D$=je,M$=ea,F$=Zf,B$=Oi,su=Qn,z$=Hi,H$=aa,cu=Vf,G$=TypeError,Pn=function(e,t){this.stopped=e,this.result=t},uu=Pn.prototype,Fr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),i=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),l=x$(t,n),f,u,c,d,h,v,b,g=function(T){return f&&cu(f,"normal",T),new Pn(!0,T)},I=function(T){return a?(D$(T),s?l(T[0],T[1],g):l(T[0],T[1])):s?l(T,g):l(T)};if(o)f=e.iterator;else if(i)f=e;else{if(u=H$(e),!u)throw new G$(M$(e)+" is not iterable");if(F$(u)){for(c=0,d=B$(e);d>c;c++)if(h=I(e[c]),h&&su(uu,h))return h;return new Pn(!1)}f=z$(e,u)}for(v=o?e.next:f.next;!(b=N$(v,f)).done;){try{h=I(b.value)}catch(T){cu(f,"throw",T)}if(typeof h=="object"&&h&&su(uu,h))return h}return new Pn(!1)},K$=Ze,W$=function(e,t){return e===void 0?arguments.length<2?"":t:K$(e)},V$=ee,Z$=Qn,J$=Ni,Nn=Di,Y$=wf,vd=ta,oo=bt,io=wt,q$=I$,X$=U$,Q$=Fr,eI=W$,tI=ae,rI=tI("toStringTag"),Dn=Error,nI=[].push,Kt=function(t,r){var n=Z$(so,this),a;Nn?a=Nn(new Dn,n?J$(this):so):(a=n?this:vd(so),oo(a,rI,"Error")),r!==void 0&&oo(a,"message",eI(r)),X$(a,Kt,a.stack,1),arguments.length>2&&q$(a,arguments[2]);var o=[];return Q$(t,nI,{that:o}),oo(a,"errors",o),a};Nn?Nn(Kt,Dn):Y$(Kt,Dn,{name:!0});var so=Kt.prototype=vd(Dn.prototype,{constructor:io(1,Kt),message:io(1,""),name:io(1,"AggregateError")});V$({global:!0,constructor:!0,arity:2},{AggregateError:Kt});var aI=zi,oI=Mr,iI=aI?{}.toString:function(){return"[object "+oI(this)+"]"},sI=zi,cI=Ee,uI=iI;sI||cI(Object.prototype,"toString",uI,{unsafe:!0});var hr=K,lI=xr,fI=Zn,an=function(e){return lI.slice(0,e.length)===e},pd=function(){return an("Bun/")?"BUN":an("Cloudflare-Workers")?"CLOUDFLARE":an("Deno/")?"DENO":an("Node.js/")?"NODE":hr.Bun&&typeof Bun.version=="string"?"BUN":hr.Deno&&typeof Deno.version=="object"?"DENO":fI(hr.process)==="process"?"NODE":hr.window&&hr.document?"BROWSER":"REST"}(),dI=pd,rs=dI==="NODE",hI=Pe,vI=na,pI=ae,mI=oe,lu=pI("species"),gI=function(e){var t=hI(e);mI&&t&&!t[lu]&&vI(t,lu,{configurable:!0,get:function(){return this}})},yI=Qf,wI=ea,bI=TypeError,SI=function(e){if(yI(e))return e;throw new bI(wI(e)+" is not a constructor")},fu=je,$I=SI,II=Jn,TI=ae,PI=TI("species"),md=function(e,t){var r=fu(e).constructor,n;return r===void 0||II(n=fu(r)[PI])?t:$I(n)},EI=Vn,gd=Function.prototype,du=gd.apply,hu=gd.call,yd=typeof Reflect=="object"&&Reflect.apply||(EI?hu.bind(du):function(){return hu.apply(du,arguments)}),OI=xr,wd=/(?:ipad|iphone|ipod).*applewebkit/i.test(OI),de=K,kI=yd,_I=tr,vu=q,RI=Ie,bd=ne,pu=sf,CI=oa,mu=Xn,AI=St,jI=wd,LI=rs,Xo=de.setImmediate,Qo=de.clearImmediate,UI=de.process,co=de.Dispatch,xI=de.Function,gu=de.MessageChannel,NI=de.String,uo=0,Pr={},yu="onreadystatechange",Ar,it,lo,fo;bd(function(){Ar=de.location});var ns=function(e){if(RI(Pr,e)){var t=Pr[e];delete Pr[e],t()}},ho=function(e){return function(){ns(e)}},wu=function(e){ns(e.data)},bu=function(e){de.postMessage(NI(e),Ar.protocol+"//"+Ar.host)};(!Xo||!Qo)&&(Xo=function(t){AI(arguments.length,1);var r=vu(t)?t:xI(t),n=CI(arguments,1);return Pr[++uo]=function(){kI(r,void 0,n)},it(uo),uo},Qo=function(t){delete Pr[t]},LI?it=function(e){UI.nextTick(ho(e))}:co&&co.now?it=function(e){co.now(ho(e))}:gu&&!jI?(lo=new gu,fo=lo.port2,lo.port1.onmessage=wu,it=_I(fo.postMessage,fo)):de.addEventListener&&vu(de.postMessage)&&!de.importScripts&&Ar&&Ar.protocol!=="file:"&&!bd(bu)?(it=bu,de.addEventListener("message",wu,!1)):yu in mu("script")?it=function(e){pu.appendChild(mu("script"))[yu]=function(){pu.removeChild(this),ns(e)}}:it=function(e){setTimeout(ho(e),0)});var Sd={set:Xo,clear:Qo},$d=function(){this.head=null,this.tail=null};$d.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 Id=$d,DI=xr,MI=/ipad|iphone|ipod/i.test(DI)&&typeof Pebble<"u",FI=xr,BI=/web0s(?!.*chrome)/i.test(FI),Wt=K,zI=_f,Su=tr,vo=Sd.set,HI=Id,GI=wd,KI=MI,WI=BI,po=rs,$u=Wt.MutationObserver||Wt.WebKitMutationObserver,Iu=Wt.document,Tu=Wt.process,on=Wt.Promise,ei=zI("queueMicrotask"),_t,mo,go,sn,Pu;if(!ei){var cn=new HI,un=function(){var e,t;for(po&&(e=Tu.domain)&&e.exit();t=cn.get();)try{t()}catch(r){throw cn.head&&_t(),r}e&&e.enter()};!GI&&!po&&!WI&&$u&&Iu?(mo=!0,go=Iu.createTextNode(""),new $u(un).observe(go,{characterData:!0}),_t=function(){go.data=mo=!mo}):!KI&&on&&on.resolve?(sn=on.resolve(void 0),sn.constructor=on,Pu=Su(sn.then,sn),_t=function(){Pu(un)}):po?_t=function(){Tu.nextTick(un)}:(vo=Su(vo,Wt),_t=function(){vo(un)}),ei=function(e){cn.head||_t(),cn.add(e)}}var VI=ei,ZI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},nr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},JI=K,Br=JI.Promise,YI=K,Er=Br,qI=q,XI=bf,QI=Li,e0=ae,Eu=pd,yo=Jl;Er&&Er.prototype;var t0=e0("species"),ti=!1,Td=qI(YI.PromiseRejectionEvent),r0=XI("Promise",function(){var e=QI(Er),t=e!==String(Er);if(!t&&yo===66)return!0;if(!yo||yo<51||!/native code/.test(e)){var r=new Er(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=r.constructor={};if(a[t0]=n,ti=r.then(function(){})instanceof n,!ti)return!0}return!t&&(Eu==="BROWSER"||Eu==="DENO")&&!Td}),zr={CONSTRUCTOR:r0,REJECTION_EVENT:Td,SUBCLASSING:ti},Me={},Ou=Le,n0=TypeError,a0=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new n0("Bad Promise constructor");t=n,r=a}),this.resolve=Ou(t),this.reject=Ou(r)};Me.f=function(e){return new a0(e)};var o0=ee,Mn=rs,nt=K,Vt=ie,ku=Ee,_u=Di,i0=er,s0=gI,c0=Le,En=q,u0=Te,l0=Bi,f0=md,Pd=Sd.set,as=VI,d0=ZI,h0=nr,v0=Id,Ed=Qt,Fn=Br,os=zr,Od=Me,ua="Promise",kd=os.CONSTRUCTOR,p0=os.REJECTION_EVENT,m0=os.SUBCLASSING,wo=Ed.getterFor(ua),g0=Ed.set,At=Fn&&Fn.prototype,ct=Fn,ln=At,_d=nt.TypeError,ri=nt.document,is=nt.process,ni=Od.f,y0=ni,w0=!!(ri&&ri.createEvent&&nt.dispatchEvent),Rd="unhandledrejection",b0="rejectionhandled",Ru=0,Cd=1,S0=2,ss=1,Ad=2,fn,Cu,$0,Au,jd=function(e){var t;return u0(e)&&En(t=e.then)?t:!1},Ld=function(e,t){var r=t.value,n=t.state===Cd,a=n?e.ok:e.fail,o=e.resolve,i=e.reject,s=e.domain,l,f,u;try{a?(n||(t.rejection===Ad&&T0(t),t.rejection=ss),a===!0?l=r:(s&&s.enter(),l=a(r),s&&(s.exit(),u=!0)),l===e.promise?i(new _d("Promise-chain cycle")):(f=jd(l))?Vt(f,l,o,i):o(l)):i(r)}catch(c){s&&!u&&s.exit(),i(c)}},Ud=function(e,t){e.notified||(e.notified=!0,as(function(){for(var r=e.reactions,n;n=r.get();)Ld(n,e);e.notified=!1,t&&!e.rejection&&I0(e)}))},xd=function(e,t,r){var n,a;w0?(n=ri.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),nt.dispatchEvent(n)):n={promise:t,reason:r},!p0&&(a=nt["on"+e])?a(n):e===Rd&&d0("Unhandled promise rejection",r)},I0=function(e){Vt(Pd,nt,function(){var t=e.facade,r=e.value,n=ju(e),a;if(n&&(a=h0(function(){Mn?is.emit("unhandledRejection",r,t):xd(Rd,t,r)}),e.rejection=Mn||ju(e)?Ad:ss,a.error))throw a.value})},ju=function(e){return e.rejection!==ss&&!e.parent},T0=function(e){Vt(Pd,nt,function(){var t=e.facade;Mn?is.emit("rejectionHandled",t):xd(b0,t,e.value)})},xt=function(e,t,r){return function(n){e(t,n,r)}},Mt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=S0,Ud(e,!0))},ai=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new _d("Promise can't be resolved itself");var n=jd(t);n?as(function(){var a={done:!1};try{Vt(n,t,xt(ai,a,e),xt(Mt,a,e))}catch(o){Mt(a,o,e)}}):(e.value=t,e.state=Cd,Ud(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(kd&&(ct=function(t){l0(this,ln),c0(t),Vt(fn,this);var r=wo(this);try{t(xt(ai,r),xt(Mt,r))}catch(n){Mt(r,n)}},ln=ct.prototype,fn=function(t){g0(this,{type:ua,done:!1,notified:!1,parent:!1,reactions:new v0,rejection:!1,state:Ru,value:null})},fn.prototype=ku(ln,"then",function(t,r){var n=wo(this),a=ni(f0(this,ct));return n.parent=!0,a.ok=En(t)?t:!0,a.fail=En(r)&&r,a.domain=Mn?is.domain:void 0,n.state===Ru?n.reactions.add(a):as(function(){Ld(a,n)}),a.promise}),Cu=function(){var e=new fn,t=wo(e);this.promise=e,this.resolve=xt(ai,t),this.reject=xt(Mt,t)},Od.f=ni=function(e){return e===ct||e===$0?new Cu(e):y0(e)},En(Fn)&&At!==Object.prototype)){Au=At.then,m0||ku(At,"then",function(t,r){var n=this;return new ct(function(a,o){Vt(Au,n,a,o)}).then(t,r)},{unsafe:!0});try{delete At.constructor}catch{}_u&&_u(At,ln)}o0({global:!0,constructor:!0,wrap:!0,forced:kd},{Promise:ct});i0(ct,ua,!1);s0(ua);var P0=ae,Nd=P0("iterator"),Dd=!1;try{var E0=0,Lu={next:function(){return{done:!!E0++}},return:function(){Dd=!0}};Lu[Nd]=function(){return this},Array.from(Lu,function(){throw 2})}catch{}var O0=function(e,t){try{if(!t&&!Dd)return!1}catch{return!1}var r=!1;try{var n={};n[Nd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},k0=Br,_0=O0,R0=zr.CONSTRUCTOR,la=R0||!_0(function(e){k0.all(e).then(void 0,function(){})}),C0=ee,A0=ie,j0=Le,L0=Me,U0=nr,x0=Fr,N0=la;C0({target:"Promise",stat:!0,forced:N0},{all:function(t){var r=this,n=L0.f(r),a=n.resolve,o=n.reject,i=U0(function(){var s=j0(r.resolve),l=[],f=0,u=1;x0(t,function(c){var d=f++,h=!1;u++,A0(s,r,c).then(function(v){h||(h=!0,l[d]=v,--u||a(l))},o)}),--u||a(l)});return i.error&&o(i.value),n.promise}});var D0=ee,M0=zr.CONSTRUCTOR,oi=Br,F0=Pe,B0=q,z0=Ee,Uu=oi&&oi.prototype;D0({target:"Promise",proto:!0,forced:M0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(B0(oi)){var xu=F0("Promise").prototype.catch;Uu.catch!==xu&&z0(Uu,"catch",xu,{unsafe:!0})}var H0=ee,G0=ie,K0=Le,W0=Me,V0=nr,Z0=Fr,J0=la;H0({target:"Promise",stat:!0,forced:J0},{race:function(t){var r=this,n=W0.f(r),a=n.reject,o=V0(function(){var i=K0(r.resolve);Z0(t,function(s){G0(i,r,s).then(n.resolve,a)})});return o.error&&a(o.value),n.promise}});var Y0=ee,q0=Me,X0=zr.CONSTRUCTOR;Y0({target:"Promise",stat:!0,forced:X0},{reject:function(t){var r=q0.f(this),n=r.reject;return n(t),r.promise}});var Q0=je,eT=Te,tT=Me,Md=function(e,t){if(Q0(e),eT(t)&&t.constructor===e)return t;var r=tT.f(e),n=r.resolve;return n(t),r.promise},rT=ee,nT=Pe,aT=zr.CONSTRUCTOR,oT=Md;nT("Promise");rT({target:"Promise",stat:!0,forced:aT},{resolve:function(t){return oT(this,t)}});var iT=ee,sT=ie,cT=Le,uT=Me,lT=nr,fT=Fr,dT=la;iT({target:"Promise",stat:!0,forced:dT},{allSettled:function(t){var r=this,n=uT.f(r),a=n.resolve,o=n.reject,i=lT(function(){var s=cT(r.resolve),l=[],f=0,u=1;fT(t,function(c){var d=f++,h=!1;u++,sT(s,r,c).then(function(v){h||(h=!0,l[d]={status:"fulfilled",value:v},--u||a(l))},function(v){h||(h=!0,l[d]={status:"rejected",reason:v},--u||a(l))})}),--u||a(l)});return i.error&&o(i.value),n.promise}});var hT=ee,vT=ie,pT=Le,mT=Pe,gT=Me,yT=nr,wT=Fr,bT=la,Nu="No one promise resolved";hT({target:"Promise",stat:!0,forced:bT},{any:function(t){var r=this,n=mT("AggregateError"),a=gT.f(r),o=a.resolve,i=a.reject,s=yT(function(){var l=pT(r.resolve),f=[],u=0,c=1,d=!1;wT(t,function(h){var v=u++,b=!1;c++,vT(l,r,h).then(function(g){b||d||(d=!0,o(g))},function(g){b||d||(b=!0,f[v]=g,--c||i(new n(f,Nu)))})}),--c||i(new n(f,Nu))});return s.error&&i(s.value),a.promise}});var ST=ee,$T=K,IT=yd,TT=oa,PT=Me,ET=Le,Fd=nr,bo=$T.Promise,Du=!1,OT=!bo||!bo.try||Fd(function(){bo.try(function(e){Du=e===8},8)}).error||!Du;ST({target:"Promise",stat:!0,forced:OT},{try:function(e){var t=arguments.length>1?TT(arguments,1):[],r=PT.f(this),n=Fd(function(){return IT(ET(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});var kT=ee,_T=Me;kT({target:"Promise",stat:!0},{withResolvers:function(){var t=_T.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var RT=ee,Bn=Br,CT=ne,Bd=Pe,zd=q,AT=md,Mu=Md,jT=Ee,ii=Bn&&Bn.prototype,LT=!!Bn&&CT(function(){ii.finally.call({then:function(){}},function(){})});RT({target:"Promise",proto:!0,real:!0,forced:LT},{finally:function(e){var t=AT(this,Bd("Promise")),r=zd(e);return this.then(r?function(n){return Mu(t,e()).then(function(){return n})}:e,r?function(n){return Mu(t,e()).then(function(){throw n})}:e)}});if(zd(Bn)){var Fu=Bd("Promise").prototype.finally;ii.finally!==Fu&&jT(ii,"finally",Fu,{unsafe:!0})}var UT=Zi;UT.Promise;const Hd="sesamy-debug";function xT(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 NT(e){if(typeof document>"u")return null;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 DT(e){xT(Hd,e.toString(),1)}function MT(){return NT(Hd)==="true"}function Y(e){MT()&&console.log(e)}function Ve(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});Y(`Triggering event: ${e}`),dispatchEvent(r)}function Ne(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 ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function us(e,t){return e(t={exports:{}},t.exports),t.exports}var st=us(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(o,i){var s=a.locked.get(o);s===void 0?i===void 0?a.locked.set(o,[]):a.locked.set(o,[i]):i!==void 0&&(s.unshift(i),a.locked.set(o,s))},this.isLocked=function(o){return a.locked.has(o)},this.lock=function(o){return new Promise(function(i,s){a.isLocked(o)?a.addToLocked(o,i):(a.addToLocked(o),i())})},this.unlock=function(o){var i=a.locked.get(o);if(i!==void 0&&i.length!==0){var s=i.pop();a.locked.set(o,i),s!==void 0&&setTimeout(s,0)}else a.locked.delete(o)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});cs(st);var FT=cs(us(function(e,t){var r=ut&&ut.__awaiter||function(u,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{T(h.next(y))}catch(p){b(p)}}function I(y){try{T(h.throw(y))}catch(p){b(p)}}function T(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,I)}T((h=h.apply(u,c||[])).next())})},n=ut&&ut.__generator||function(u,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:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function I(T){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(u,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}}([T,y])}}},a=ut;Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key",i={key:function(u){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(u){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(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(u,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,c){return window.localStorage.setItem(u,c)}};function s(u){return new Promise(function(c){return setTimeout(c,u)})}function l(u){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<u;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function u(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(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,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,b,g,I,T,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+l(4),v=Date.now()+d,b=o+"-"+c,g=this.storageHandler===void 0?i: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]:(I=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:I,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(T=g.getItemSync(b))!==null&&(y=JSON.parse(T)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?i:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.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,I;return n(this,function(T){switch(T.label){case 0:return[4,st.default().lock(d)];case 1:return T.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?i:this.storageHandler,(g=b.getItemSync(c))===null?(st.default().unlock(d),[2]):((I=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(I)),st.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(st.default().unlock(d),[2])}})})},1e3),[2]})})},u.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 I(){if(g||(window.removeEventListener("storage",I),u.removeFromWaiting(I),clearTimeout(T),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",I),u.addToWaiting(I);var T=setTimeout(I,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},u.addToWaiting=function(c){this.removeFromWaiting(c),u.waiters!==void 0&&u.waiters.push(c)},u.removeFromWaiting=function(c){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(d){return d!==c}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(c){return c()})},u.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()]}})})},u.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?i:this.storageHandler,h=o+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,st.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),st.default().unlock(b.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}})})},u.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 I=!1,T=0;T<v.length;T++){var y=v[T];if(y.includes(o)){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),I=!0)}}}I&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=f}));const BT={timeoutInSeconds:60},Gd={name:"auth0-spa-js",version:"2.1.3"},Kd=()=>Date.now();let fe=class si extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,si.prototype)}static fromPayload({error:t,error_description:r}){return new si(t,r)}},zT=class Wd extends fe{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Wd.prototype)}},ci=class Vd extends fe{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Vd.prototype)}},HT=class Zd extends ci{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Zd.prototype)}},GT=class Jd extends fe{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Jd.prototype)}},KT=class Yd extends fe{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Yd.prototype)}},qd=class Xd extends fe{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Bu(t,["default"])}', scope: '${Bu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Xd.prototype)}};function Bu(e,t=[]){return e&&!t.includes(e)?e:""}const On=()=>window.crypto,So=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(On().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},zu=e=>btoa(e),ui=e=>{var{clientId:t}=e,r=Ne(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,o)=>Object.assign(Object.assign({},a),{[o]:n[o]}),{}))(Object.assign({client_id:t},r))).toString()},Hu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),WT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},VT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([WT(e,t),new Promise((o,i)=>{a=setTimeout(()=>{n.abort(),i(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},ZT=async(e,t,r,n,a,o,i)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:i},l=o,new Promise(function(f,u){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?u(new Error(d.data.error)):f(d.data),c.port1.close()},l.postMessage(s,[c.port2])});var s,l},JT=async(e,t,r,n,a,o,i=1e4)=>a?ZT(e,t,r,n,i,a,o):VT(e,n,i);async function YT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:o,auth0Client:i,useFormData:s}=e,l=Ne(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?ui(l):JSON.stringify(l);return await async function(u,c,d,h,v,b,g){let I,T=null;for(let k=0;k<3;k++)try{I=await JT(u,d,h,v,b,g,c),T=null;break}catch(M){T=M}if(T)throw T;const y=I.json,{error:p,error_description:S}=y,O=Ne(y,["error","error_description"]),{ok:_}=I;if(!_){const k=S||`HTTP error. Unable to fetch ${u}`;throw p==="mfa_required"?new KT(p,k,O.mfa_token):p==="missing_refresh_token"?new qd(d,h):new fe(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",o,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(i||Gd))}},t,s)}const dn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ft=class li{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,o]=t.split("::");return new li({clientId:n,scope:o,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new li({scope:r,audience:n,clientId:a})}},qT=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@@"))}},Qd=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)}}()}},XT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Kd}async setIdToken(t,r,n){var a;const o=this.getIdTokenCacheKey(t);await this.cache.set(o,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(o))}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 l=this.matchExistingCacheKey(t,s);l&&(a=await this.cache.get(l))}if(!a)return;const o=await this.nowProvider(),i=Math.floor(o/1e3);return a.expiresAt-r<i?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 ft({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,o)=>{await a,await this.cache.remove(o)},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 ft({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const o=ft.fromKey(n),i=new Set(o.scope&&o.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],l=o.scope&&s.reduce((f,u)=>f&&i.has(u),!0);return o.prefix==="@@auth0spajs@@"&&o.clientId===t.clientId&&o.audience===t.audience&&l})[0]}},QT=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 vr=e=>typeof e=="number",eP=["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"],tP=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(o=>{const i=o.split("."),[s,l,f]=i;if(i.length!==3||!s||!l||!f)throw new Error("ID token could not be decoded");const u=JSON.parse(Hu(l)),c={__raw:o},d={};return Object.keys(u).forEach(h=>{c[h]=u[h],eP.includes(h)||(d[h]=u[h])}),{encoded:{header:s,payload:l,signature:f},header:JSON.parse(Hu(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&&!vr(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||!vr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!vr(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&&vr(t.claims.nbf)){const o=new Date(0);if(o.setUTCSeconds(t.claims.nbf-r),n<o)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 ${o}`)}if(t.claims.auth_time!=null&&vr(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>o)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 ${o}`)}if(e.organization){const o=e.organization.trim();if(o.startsWith("org_")){const i=o;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(i!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${i}", found "${t.claims.org_id}"`)}else{const i=o.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(i!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${i}", found "${t.claims.org_name}"`)}}return t};var dt=us(function(e,t){var r=ut&&ut.__assign||function(){return r=Object.assign||function(l){for(var f,u=1,c=arguments.length;u<c;u++)for(var d in f=arguments[u])Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l},r.apply(this,arguments)};function n(l,f){if(!f)return"";var u="; "+l;return f===!0?u:u+"="+f}function a(l,f,u){return encodeURIComponent(l).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)}(u)}function o(l){for(var f={},u=l?l.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<u.length;d++){var h=u[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 i(){return o(document.cookie)}function s(l,f,u){document.cookie=a(l,f,r({path:"/"},u))}t.__esModule=!0,t.encode=a,t.parse=o,t.getAll=i,t.get=function(l){return i()[l]},t.set=s,t.remove=function(l,f){s(l,"",r(r({},f),{expires:-1}))}});cs(dt),dt.encode,dt.parse,dt.getAll;var rP=dt.get,eh=dt.set,th=dt.remove;const jt={get(e){const t=rP(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),eh(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),th(e,r)}},nP={get(e){return jt.get(e)||jt.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),eh(`_legacy_${e}`,JSON.stringify(t),n),jt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),th(e,r),jt.remove(e,t),jt.remove(`_legacy_${e}`,t)}},aP={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 oP(e,t,r){var n=t===void 0?null:t,a=function(l,f){var u=atob(l);if(f){for(var c=new Uint8Array(u.length),d=0,h=u.length;d<h;++d)c[d]=u.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return u}(e,r!==void 0&&r),o=a.indexOf(`
2
+ `,10)+1,i=a.substring(o)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var Gu,Ku,Wu,$o,iP=(Gu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Ku=null,Wu=!1,function(e){return $o=$o||oP(Gu,Ku,Wu),new Worker($o,e)});const Io={};let sP=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 cP={memory:()=>new Qd().enclosedCache,localstorage:()=>new qT},Vu=e=>cP[e],Zu=e=>{const{openUrl:t,onRedirect:r}=e,n=Ne(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},To=new FT;let uP=class{constructor(t){let r,n;if(this.userCache=new Qd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await To.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(!On())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(On().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",!Wu(r))throw new Error(`Invalid cache location "${r}"`);n=Wu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?jt:rP,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(i=>`auth0.${i}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:nP;var o;this.scope=dn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new XT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Gd,this.cacheManager=new qT(n,n.allKeys?void 0:new iP(n,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((i,s)=>i?i.startsWith("https://")?i:`https://${i}/`:`${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 oP)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Hd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ui(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return eP({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:a});var o}_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=Bu(So()),o=Bu(So()),i=So(),s=(u=>{const c=new Uint8Array(u);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async u=>await On().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(i)),l=((u,c,d,h,v,b,g,I)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),d),{scope:dn(c,d.scope),response_type:"code",response_mode:I||"query",state:h,nonce:v,redirect_uri:g||u.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256"}))(this.options,this.scope,t,a,o,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(l);return{nonce:o,code_verifier:i,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const l=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${l},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 o=await(s=>new Promise((l,f)=>{let u;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",u,!1),f(new HT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new zT(s.popup)),window.removeEventListener("message",u,!1)},1e3*(s.timeoutInSeconds||60));u=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",u,!1),s.popup.close(),h.data.response.error)return f(fe.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==o.state)throw new fe("state_mismatch","Invalid state");const i=((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:o.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:i})}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=Vu(t),{openUrl:a,fragment:o,appState:i}=n,s=Ne(n,["openUrl","fragment","appState"]),l=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=f,c=Ne(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:i}),l&&{organization:l}));const d=o?`${u}#${o}`:u;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:o,error_description:i}=(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 fe("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new BT(o,i||o,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new fe("state_mismatch","Invalid state");const l=s.organization,f=s.nonce,u=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},u?{redirect_uri:u}:{}),{nonceIn:f,organization:l}),{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:dn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((o,i)=>{let s=Io[i];return s||(s=o().finally(()=>{delete Io[i],s=null}),Io[i]=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=Ne(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,o=3)=>{for(let i=0;i<o;i++)if(await a())return!0;return!1})(()=>To.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ci;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:o,access_token:i,oauthTokenScope:s,expires_in:l}=a;return Object.assign(Object.assign({id_token:o,access_token:i},s?{scope:s}:null),{expires_in:l})}finally{await To.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:dn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},FT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new ft({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=Ne(r,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${ui(Object.assign({clientId:t.clientId},a))}`)+o}async logout(t={}){const r=Vu(t),{openUrl:n}=r,a=Ne(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 o=this._buildLogoutUrl(a);n?await n(o):n!==!1&&window.location.assign(o)}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:o,nonce:i,code_verifier:s,redirect_uri:l,scope:f,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new fe("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((I,T)=>{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(()=>{T(new ci),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?T(fe.fromPayload(_.data.response)):I(_.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(o!==d.state)throw new fe("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:l,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:u})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new ft({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 Yd(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 o=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({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=Ne(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 ft({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 ft({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:o,oauthTokenScope:i,expires_in:s}=a,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:o},i?{scope:i}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},o=await JT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),i=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}};async function uP(e){const t=new cP(e);return await t.checkSession(),t}var ve=(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))(ve||{});const lP="sesamy.com",fP="sesamy.dev",dP="https://sesa.my",fi="sesamyCacheTimestamp";function Ge(e,t){return`https://${e}.${t==="dev"?fP:lP}`}function di(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}/*!
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",!Vu(r))throw new Error(`Invalid cache location "${r}"`);n=Vu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?jt:nP,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(i=>`auth0.${i}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:aP;var o;this.scope=dn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new QT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Kd,this.cacheManager=new XT(n,n.allKeys?void 0:new sP(n,this.options.clientId),this.nowProvider),this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((i,s)=>i?i.startsWith("https://")?i:`https://${i}/`:`${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 iP)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Gd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ui(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return tP({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:a});var o}_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=zu(So()),o=zu(So()),i=So(),s=(u=>{const c=new Uint8Array(u);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async u=>await On().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(i)),l=((u,c,d,h,v,b,g,I)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),d),{scope:dn(c,d.scope),response_type:"code",response_mode:I||"query",state:h,nonce:v,redirect_uri:g||u.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256"}))(this.options,this.scope,t,a,o,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(l);return{nonce:o,code_verifier:i,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const l=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${l},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 o=await(s=>new Promise((l,f)=>{let u;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",u,!1),f(new GT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new HT(s.popup)),window.removeEventListener("message",u,!1)},1e3*(s.timeoutInSeconds||60));u=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",u,!1),s.popup.close(),h.data.response.error)return f(fe.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==o.state)throw new fe("state_mismatch","Invalid state");const i=((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:o.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:i})}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=Zu(t),{openUrl:a,fragment:o,appState:i}=n,s=Ne(n,["openUrl","fragment","appState"]),l=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=f,c=Ne(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:i}),l&&{organization:l}));const d=o?`${u}#${o}`:u;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:o,error_description:i}=(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 fe("missing_transaction","Invalid state");if(this.transactionManager.remove(),o)throw new zT(o,i||o,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new fe("state_mismatch","Invalid state");const l=s.organization,f=s.nonce,u=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},u?{redirect_uri:u}:{}),{nonceIn:f,organization:l}),{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:dn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((o,i)=>{let s=Io[i];return s||(s=o().finally(()=>{delete Io[i],s=null}),Io[i]=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=Ne(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,o=3)=>{for(let i=0;i<o;i++)if(await a())return!0;return!1})(()=>To.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ci;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:o,access_token:i,oauthTokenScope:s,expires_in:l}=a;return Object.assign(Object.assign({id_token:o,access_token:i},s?{scope:s}:null),{expires_in:l})}finally{await To.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:dn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},BT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new ft({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=Ne(r,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${ui(Object.assign({clientId:t.clientId},a))}`)+o}async logout(t={}){const r=Zu(t),{openUrl:n}=r,a=Ne(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 o=this._buildLogoutUrl(a);n?await n(o):n!==!1&&window.location.assign(o)}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:o,nonce:i,code_verifier:s,redirect_uri:l,scope:f,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new fe("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((I,T)=>{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(()=>{T(new ci),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?T(fe.fromPayload(_.data.response)):I(_.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(o!==d.state)throw new fe("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:l,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:u})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new ft({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 qd(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 o=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({},o),{scope:t.authorizationParams.scope,oauthTokenScope:o.scope,audience:t.authorizationParams.audience||"default"})}catch(o){if((o.message.indexOf("Missing Refresh Token")>-1||o.message&&o.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw o}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=Ne(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 ft({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 ft({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:o,oauthTokenScope:i,expires_in:s}=a,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:o},i?{scope:i}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},o=await YT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),i=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:i,scope:t.scope,audience:t.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||i.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:i})}};async function lP(e){const t=new uP(e);return await t.checkSession(),t}var ve=(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))(ve||{});const fP="sesamy.com",dP="sesamy.dev",hP="https://sesa.my",fi="sesamyCacheTimestamp",di="sesamyContentReload";function Ge(e,t){return`https://${e}.${t==="dev"?dP:fP}`}function hi(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}/*!
5
5
  *
6
6
  * detectIncognito v1.3.5
7
7
  *
@@ -31,9 +31,9 @@
31
31
  *
32
32
  * Please keep this comment intact in order to properly abide by the MIT License.
33
33
  *
34
- **/var hi={d:(e,t)=>{for(var r in t)hi.o(t,r)&&!hi.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},us={};hi.d(us,{A:()=>pP,k:()=>ls});var hP=function(e,t,r,n){return new(r||(r=Promise))(function(a,o){function i(f){try{l(n.next(f))}catch(u){o(u)}}function s(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){var u;f.done?a(f.value):(u=f.value,u instanceof r?u:new r(function(c){c(u)})).then(i,s)}l((n=n.apply(e,[])).next())})},vP=function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!((a=a.length>0&&a[a.length-1])||u[0]!==6&&u[0]!==2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(c){u=[6,c],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([l,f])}}};function ls(){return hP(this,void 0,Promise,function(){return vP(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n,a,o="Unknown";function i(c){t({isPrivate:c,browserName:o})}function s(c){return c===eval.toString().length}function l(){navigator.maxTouchPoints!==void 0?function(){var c=String(Math.random());try{window.indexedDB.open(c,1).onupgradeneeded=function(d){var h,v,b=(h=d.target)===null||h===void 0?void 0:h.result;try{b.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(I){var g=I;return I instanceof Error&&(g=(v=I.message)!==null&&v!==void 0?v:I),typeof g!="string"?void i(!1):void i(g.includes("BlobURLs are not yet supported"))}finally{b.close(),window.indexedDB.deleteDatabase(c)}}}catch{i(!1)}}():function(){var c=window.openDatabase,d=window.localStorage;try{c(null,null,null,null)}catch{return void i(!0)}try{d.setItem("test","1"),d.removeItem("test")}catch{return void i(!0)}i(!1)}()}function f(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(c,d){var h;i(Math.round(d/1048576)<2*Math.round(((h=window).performance!==void 0&&h.performance.memory!==void 0&&h.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(c){r(new Error("detectIncognito somehow failed to query storage quota: "+c.message))})}function u(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?f():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}(a=navigator.vendor)!==void 0&&a.indexOf("Apple")===0&&s(37)?(o="Safari",l()):function(){var c=navigator.vendor;return c!==void 0&&c.indexOf("Google")===0&&s(33)}()?(n=navigator.userAgent,o=n.match(/Chrome/)?navigator.brave!==void 0?"Brave":n.match(/Edg/)?"Edge":n.match(/OPR/)?"Opera":"Chrome":"Chromium",u()):document.documentElement!==void 0&&document.documentElement.style.MozAppearance!==void 0&&s(37)?(o="Firefox",i(navigator.serviceWorker===void 0)):navigator.msSaveBlob!==void 0&&s(39)?(o="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser"))})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=ls);const pP=ls;us.A;var mP=us.k;async function th(){try{const{isPrivate:e}=await mP();return e}catch{return!1}}let he,rh,vi=!1,Zu=!1;const Zt="sesamyAccessToken",Po="sesamyRefreshToken";async function Hr(){return vi?!0:new Promise((e,t)=>{const r=setTimeout(()=>{vi?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function gP(e){if(!e)return null;const t=localStorage.getItem(Po);if(!t)return q("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(Po),new Error("Renew token failed");const o=await a.json();return localStorage.setItem(Po,o.refresh_token),localStorage.setItem(Zt,o.access_token),o.access_token}catch{nh()}}async function fs(){const e=localStorage.getItem(Zt);if(!e)return null;const t=ah(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await gP(t);if(r)return r;localStorage.removeItem(Zt)}return e}function Ju(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function yP(e){if(e.enabled===!1)return;rh=e.organization;const t={domain:Ge("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Ju(window.location.href)!==Ju(Ge("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),he=await uP(t),window.location.search.includes("code=")){q("Code found in URL, handling redirect");try{const r=await he.handleRedirectCallback();q(`Login result: ${JSON.stringify(r)}`);const n=await he.getUser();if(!n)throw q("No user found"),new Error("No user found");q(`User found ${JSON.stringify(n)}`),Ve(ve.AUTHENTICATED,n);const a=new URL(location.href),o=a.searchParams;o.delete("code"),o.delete("state"),a.search=o.toString(),window.history.replaceState({},document.title,a.toString()),q("Rewrite url")}catch(r){alert("There was an error logging in"),console.error(r)}}vi=!0,Ve(ve.AUTH_INITIALIZED,{})}async function jr(){return await Hr(),await fs()?!0:he?he.isAuthenticated():!1}async function wP(){return await Hr(),await fs()?(q("Using local user"),{sub:"local",name:"Local User"}):he?he.getUser():null}async function ds(e){if(Zu){q("Login already in progress");return}if(Zu=!0,await Hr(),localStorage.removeItem(Zt),!he)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{},r=await th();return he.loginWithRedirect({...e,authorizationParams:{organization:rh,redirect_uri:window.location.href,ui_locales:di(),incognito:r,...t}})}async function pr(e=!0){await Hr();const t=await fs();if(t)return t;try{return he?await he.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function nh(e={}){if(await Hr(),localStorage.removeItem(Zt),Ve(ve.LOGOUT,{}),!!he)return he.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function ah(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(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function oh(e){const t=ah(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Zt,e),Ve(ve.AUTHENTICATED,t)}const bP=(e,t)=>t.skipDedupe||t.method!=="GET",SP=(e,t)=>t.method+"@"+e,$P=e=>e.clone(),Yu=({skip:e=bP,key:t=SP,resolver:r=$P}={})=>{const n=new Map;return a=>(o,i)=>{if(e(o,i))return a(o,i);const s=t(o,i);if(!n.has(s))n.set(s,[]);else return new Promise((l,f)=>{n.get(s).push([l,f])});try{return a(o,i).then(l=>(n.get(s).forEach(([f])=>f(r(l))),n.delete(s),l)).catch(l=>{throw n.get(s).forEach(([,f])=>f(l)),n.delete(s),l})}catch(l){return n.delete(s),Promise.reject(l)}}},IP=(e,t)=>e*t,TP=e=>e&&e.ok,qu=({delayTimer:e=500,delayRamp:t=IP,maxAttempts:r=10,until:n=TP,onRetry:a=null,retryOnNetworkError:o=!1,resolveWithLatestResponse:i=!1,skip:s}={})=>l=>(f,u)=>{let c=0;if(s&&s(f,u))return l(f,u);const d=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&i?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const I=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:u})).then((T={})=>{var y,p;g(l((y=T&&T.url)!==null&&y!==void 0?y:f,(p=T&&T.options)!==null&&p!==void 0?p:u))}):g(l(f,u))},I)}).then(d).catch(g=>{if(!o)throw g;return d(null,g)}):h&&i?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return l(f,u).then(d).catch(h=>{if(!o)throw h;return d(null,h)})},PP="application/json",ih="Content-Type",Rt=Symbol(),sh=Symbol();function Xu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===ih.toLowerCase()))===null||t===void 0?void 0:t[1]}function Qu(e){return/^application\/.*json.*/.test(e)}const ht=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,o])=>{const i=e[a];return Array.isArray(i)&&Array.isArray(o)?n[a]=r?[...i,...o]:o:typeof i=="object"&&typeof o=="object"?n[a]=ht(i,o,r):n[a]=o,n},{...e})},Jt={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){Jt.options=t?e:ht(Jt.options,e)}function OP(e,t=!1){Jt.polyfills=t?e:ht(Jt.polyfills,e)}function kP(e){Jt.errorType=e}const _P=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class ch extends Error{}const RP=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:o,_resolvers:i,_middlewares:s,_addons:l}=e,f=new Map(o),u=ht(a.options,n);let c=r;const d=_P(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,u),h=new Error,v=d.catch(y=>{throw{[Rt]:y}}).then(y=>{var p;if(!y.ok){const S=new ch;if(S.cause=h,S.stack=S.stack+`
35
- 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,Rt),O=S?p[Rt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||S&&f.has(Rt)&&f.get(Rt);if(_)return _(O,e);const k=f.get(sh);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)),I={_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(Rt,y)}},T=l.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),I);return i.reduce((y,p)=>p(y,e),T)},CP={_url:"",_options:{},_config:Jt,_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:ht(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:ht(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:ht(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[ih]: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(sh,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=Xu(n._options.headers),o=this._config.polyfill("FormData",!1),i=typeof r=="object"&&!(o&&r instanceof o)&&(!n._options.headers||!a||Qu(a));return n=r?i?n.json(r,a):n.body(r):n,RP(n._deferred.reduce((s,l)=>l(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=Xu(this._options.headers);return this.content(t||Qu(r)&&r||PP).body(JSON.stringify(e))}};function We(e="",t={}){return{...CP,_url:e,_options:t}}We.default=We;We.options=EP;We.errorType=kP;We.polyfills=OP;We.WretchError=ch;function _e(){sessionStorage.removeItem(fi),console.log("Cache cleared"),Ve(ve.CLEAR_CACHE,{})}function pi(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function uh(e,t){if(pi(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function el(e){return e.endsWith("/")?e.slice(0,-1):e}function tl(e,t){if(!pi(e)||!pi(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&el(r.pathname)===el(n.pathname)}function AP(e,t){const r=new URL(`${Ge("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:i,purchaseOption:s,itemSrc:l}=uh(t.itemSrc,t.purchaseOptionId);l&&r.searchParams.set("url",l),i&&r.searchParams.set("sku",i),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(i=>{const[s,l]=i.trim().split("=");return{key:s,value:l}}).filter(i=>n.some(s=>s===i.key)).forEach(i=>{r.searchParams.append(i.key,i.value)});const o=new URL(t.redirectUrl||window.location.href);return o.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&o.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",o.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:i,methods:s})=>s?s.map(l=>`${i}|${l}`):i).join(",")),r}const lh="sesamySignedURLs";function hs(){const e=sessionStorage.getItem(lh);return e?JSON.parse(e):[]}function jP(e){const t=hs();t.push(e),q(`Adding signed URL: ${e}`),sessionStorage.setItem(lh,JSON.stringify(t))}function LP(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];n!=null&&(t[r]=n.toString())}),t}const mi="sesamyAttribution";function UP(e){const t=sessionStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch{return console.error(`Failed to parse ${e}`),null}}function xP(e){return Object.keys(e).find(t=>t.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function vs(){return UP(mi)||{}}function fh(e){if(e===null)sessionStorage.removeItem(mi);else{q(`Setting attribution ${JSON.stringify(e)}`);const t=vs()??{},r=LP({...t,...xP(e)});sessionStorage.setItem(mi,JSON.stringify({value:r}))}}function NP(e){const t=Ge("api2",e.environment),r=$=>async(P,C)=>{let W=sessionStorage.getItem(fi);W||(W=Date.now().toString(),sessionStorage.setItem(fi,W));const V={...C,headers:{...C.headers,"Cache-Timestamp":W}};return $(P,V)},n=($=!0)=>P=>async(C,W)=>{let V=null;if(V=await pr($),!V){if($)throw new Error("No access token available");return P(C,W)}const Je={...W,headers:{...W.headers,...V?{Authorization:`Bearer ${V}`}:{}}};return P(C,Je)},a=$=>(P,C)=>{if(C.headers.Authorization)return $(P,C);const W=localStorage.getItem("__anon_id"),V=btoa(`${e.clientId}|${W}:`),Je={...C,headers:{...C.headers,Authorization:`Basic ${V}`}};return $(P,Je)},o=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Yu(),qu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),i=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Yu(),qu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]);async function s($={}){const{waitForEntitlementAfter:P,includeSignedLinks:C=!0}=$,W=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",V=await jr()?await o.get(`/entitlements${W}`).json():[];return C&&V.push(...hs()),V}async function l($,P=[]){const C=await s();return C==null?void 0:C.find(V=>{const{sku:Je,purchaseOption:It}=uh($);let ir="sku"in V&&Je===V.sku;ir&&It&&"purchaseOptionId"in V&&(ir=It===V.purchaseOptionId);const Gh=tl($,V.url),Kh=P.some(Wh=>tl(Wh,V.url));return ir||Gh||Kh})}async function f($){const P=await o.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function u($){return o.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await jr()?await o.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return o.get("/contracts").json()}async function h($){const P=await o.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await o.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function g(){return o.get("/bills").json()}async function I($){const P=await o.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function T(){return o.get("/transactions").json()}async function y($){const P=await o.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await o.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),C}async function S($){const P=await o.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function O($){return(await o.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await o.url("/user-metadata").get().json()}async function k(){return await o.url("/tags").get().json()}async function M($){const P=await o.url(`/tags/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function F($){const P=await o.url("/tags").post(encodeURIComponent($)).res();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),P.ok}async function X($){return(await i.url("/tallies").get().json())[$]}async function L(){return await i.url("/tallies").get().json()}async function N($){const P=await i.url(`/tallies/${$}`).delete().res();return _e(),P.ok}async function H($,P){return await i.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await o.url(`/products/${encodeURIComponent($)}`).get().json()}async function Z(){return await pr(!1)?await o.url("/profile").get().json():null}async function te($){const P=await o.url("/profile").patch($).res();return _e(),P.ok}async function Fe(){return await o.url("/payment-issues").get().json()}async function m(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await pr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${Ge("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 o.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&_e(),P}async function x($,P=3600){const{shortlink:C}=await We(dP).post({url:$,ttl:P}).json();return C}async function D($){const P=await pr(!1);let C;const W=$.language||di();switch($.target){case"account":C=new URL(`${Ge("account",e.environment)}/${encodeURIComponent($.language||W)}/subscriptions/${encodeURIComponent(e.clientId)}`),C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"consume":C=new URL(`${Ge("consume",e.environment)}/${encodeURIComponent($.language||W)}/@${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=AP(e,{language:W,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?x(C.href,$.ttl):C.href}async function Q($){const P=vs(),C=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(V=>{const Je=P,[It,ir]=V.trim().split("=");C.includes(It)&&!Je[It]&&(Je[It]=ir)}),(await i.url("/checkouts").post({language:di(),attribution:{...P,...$.attribution},...$,vendorId:e.clientId})).json()}async function z($,P){return(await i.url(`/checkouts/${$}`).patch(P)).json()}async function J($){return(await i.url(`/checkouts/${$}`).get()).json()}async function B($){return(await i.url(`/paywalls/${$}`).get()).json()}async function pe(){const $=await pr(!1),P=new URL(`${Ge("account",e.environment)}/subscriptions/${e.clientId}`);$&&(P.hash=`#access_token=${$}`),window.location.href=P.toString()}return{autoOnboardProduct:U,cancelContract:v,createCheckout:Q,deleteTag:M,deleteTally:N,deleteUserMetadata:S,generateLink:D,getBill:I,getBills:g,getCheckout:J,getContract:h,getContracts:d,getEntitlement:f,getEntitlementAccess:u,getEntitlements:s,getFulfillments:c,getPaywall:B,getPaymentIssues:Fe,getProfile:Z,getProduct:R,getSubscriptions:b,getTally:X,getTallies:L,getTags:k,getTransaction:y,getTransactions:T,getUserMetadata:O,hasAccess:l,isSpotifyLinked:m,linkSpotify:E,listUserMetadata:_,openHostedAccountPage:pe,pushTally:H,setTag:F,setUserMetadata:p,unlinkSpotify:w,updateCheckout:z,updateProfile:te}}const dh="@sesamy/sesamy-js",ps="1.19.1";function rl(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 hn="undefined",nl="object",gi=function(){},hh="any",vh="*",mt="__",zn=typeof process<"u"?process:{};zn.env&&zn.env.NODE_ENV;var re=typeof document<"u";zn.versions!=null&&zn.versions.node!=null;typeof Deno<"u"&&Deno.core;re&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ph(e,t){return t.charAt(0)[e]()+t.slice(1)}var DP=ph.bind(null,"toUpperCase"),MP=ph.bind(null,"toLowerCase");function FP(e){return mh(e)?DP("null"):typeof e=="object"?GP(e):Object.prototype.toString.call(e).slice(8,-1)}function Hn(e,t){t===void 0&&(t=!0);var r=FP(e);return t?MP(r):r}function Gr(e,t){return typeof t===e}var le=Gr.bind(null,"function"),tt=Gr.bind(null,"string"),Nt=Gr.bind(null,"undefined"),BP=Gr.bind(null,"boolean");Gr.bind(null,"symbol");function mh(e){return e===null}function zP(e){return Hn(e)==="number"&&!isNaN(e)}function gh(e){return Hn(e)==="array"}function ue(e){if(!HP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function HP(e){return e&&(typeof e=="object"||e!==null)}function GP(e){return le(e.constructor)?e.constructor.name:null}function KP(e){return e instanceof Error||tt(e.message)&&e.constructor&&zP(e.constructor.stackTraceLimit)}function yh(e,t){if(typeof t!="object"||mh(t))return!1;if(t instanceof e)return!0;var r=Hn(new e(""));if(KP(t))for(;t;){if(Hn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}yh.bind(null,TypeError);yh.bind(null,SyntaxError);function fa(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 da(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}da(fa,"form");da(fa,"button");da(fa,"input");da(fa,"select");function VP(e){return e?gh(e)?e:[e]:[]}function al(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function ZP(){if(re){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function JP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function YP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var o=al(r[1]),i=al(r[2]);o.substring(o.length-2)==="[]"?(n[o=o.substring(0,o.length-2)]||(n[o]=[])).push(i):n[o]=i===""||i}for(var s in n){var l=s.split("[");l.length>1&&(qP(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return re&&window.location.search.substring(1)}())}function qP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var o=t[a];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[n]]=r}function ha(){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 XP(e,t){var r,n,a,o=null,i=0,s=function(){i=new Date,o=null,a=e.apply(r,n)};return function(){var l=new Date;i||(i=l);var f=t-(l-i);return r=this,n=arguments,f<=0?(clearTimeout(o),o=null,i=l,a=e.apply(r,n)):o||(o=setTimeout(s,f)),a}}var Or="global",Yt=mt+"global"+mt,qt=typeof self===nl&&self.self===self&&self||typeof global===nl&&global.global===global&&global||void 0;function gt(e){return qt[Yt][e]}function yt(e,t){return qt[Yt][e]=t}function ar(e){delete qt[Yt][e]}function or(e,t,r){var n;try{if(ms(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}qt[Yt]||(qt[Yt]={});var vn={};function ms(e){if(typeof vn[e]!==hn)return vn[e];try{var t=window[e];t.setItem(hn,hn),t.removeItem(hn)}catch{return vn[e]=!1}return vn[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 Xe="function",Ke="undefined",QP="@@redux/"+Math.random().toString(36),ol=function(){return typeof Symbol===Xe&&Symbol.observable||"@@observable"}(),pn=" != "+Xe;function wh(e,t,r){var n;if(typeof t===Xe&&typeof r===Ke&&(r=t,t=void 0),typeof r!==Ke){if(typeof r!==Xe)throw new Error("enhancer"+pn);return r(wh)(e,t)}if(typeof e!==Xe)throw new Error("reducer"+pn);var a=e,o=t,i=[],s=i,l=!1;function f(){s===i&&(s=i.slice())}function u(){return o}function c(h){if(typeof h!==Xe)throw new Error("Listener"+pn);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(!ue(h))throw new Error("Act != obj");if(typeof h.type===Ke)throw new Error("ActType "+Ke);if(l)throw new Error("Dispatch in reducer");try{l=!0,o=a(o,h)}finally{l=!1}for(var v=i=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:u,replaceReducer:function(h){if(typeof h!==Xe)throw new Error("next reducer"+pn);a=h,d({type:"@@redux/INIT"})}})[ol]=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(u())}return g(),{unsubscribe:v(g)}}})[ol]=function(){return this},h},n}function eE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ke}function Xt(){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 tE(){var e=arguments;return function(t){return function(r,n,a){var o,i=t(r,n,a),s=i.dispatch,l={getState:i.getState,dispatch:function(f){return s(f)}};return o=[].slice.call(e).map(function(f){return f(l)}),j({},i,{dispatch:s=Xt.apply(void 0,o)(i.dispatch)})}}}var rt=mt+"anon_id",vt=mt+"user_id",Ft=mt+"user_traits",qe="userId",Dt="anonymousId",kn=["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"],yi=["name","EVENTS","config","loaded"],A=kn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),il=/^utm_/,sl=/^an_prop_/,cl=/^an_trait_/;function rE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var o=a.params,i=a.user,s=a.persistedUser,l=a.initialUser,f=s.userId===i.userId;s.anonymousId!==i.anonymousId&&t(rt,i.anonymousId),f||t(vt,i.userId),l.traits&&t(Ft,j({},f&&s.traits?s.traits:{},l.traits));var u=Object.keys(a.params);if(u.length){var c=o.an_uid,d=o.an_event,h=u.reduce(function(v,b){if(b.match(il)||b.match(/^(d|g)clid/)){var g=b.replace(il,"");v.campaign[g==="campaign"?"name":g]=o[b]}return b.match(sl)&&(v.props[b.replace(sl,"")]=o[b]),b.match(cl)&&(v.traits[b.replace(cl,"")]=o[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:o},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 nE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===rt)return j({},t,{anonymousId:r.value});if(r.key===vt)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[vt,rt,Ft].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function ul(e){return{userId:e.getItem(vt),anonymousId:e.getItem(rt),traits:e.getItem(Ft)}}var wi=function(e){return mt+"TEMP"+mt+e};function aE(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(o){return function(i){return function(s){var l=s.userId,f=s.traits,u=s.options;if(s.type===A.reset&&([vt,Ft,rt].forEach(function(h){n(h)}),[qe,Dt,"traits"].forEach(function(h){ar(wi(h))})),s.type===A.identify){a(rt)||r(rt,ha());var c=a(vt),d=a(Ft)||{};c&&c!==l&&o.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:l,traits:f},options:u}),l&&r(vt,l),f&&r(Ft,j({},d,f))}return i(s)}}}}var br={};function ll(e,t){br[e]&&le(br[e])&&(br[e](t),delete br[e])}function bh(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return bh(e,t,r-10).then(n,a)})})}function oE(e){return{abort:e}}function Sh(e,t,r){var n={},a=t(),o=e.getState(),i=o.plugins,s=o.queue,l=o.user;if(!o.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return i[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&&le(b)){var g,I=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[qe,Dt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,l),T=n[I.meta.rid];if(!T&&(g=b({payload:I,config:i[h].config,instance:r,abort:oE}))&&ue(g)&&g.abort)return void(n[I.meta.rid]=!0);if(!T){var y=v+":"+h;e.dispatch(j({},I,{type:y,_:{called:y,from:"queueDrain"}}))}}});var u=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=u}}}var Eo=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,o=e.allPlugins,i=e.allMatches,s=e.store,l=e.EVENTS;try{var f=a.plugins,u=a.context,c=r.type,d=c.match(Bt),h=t.exact.map(function(g){return g.pluginName});d&&(h=i.during.map(function(g){return g.pluginName}));var v=function(g,I){return function(T,y,p){var S=y.config,O=y.name,_=O+"."+T.type;p&&(_=p.event);var k=T.type.match(Bt)?function(M,F,X,L,N){return function(H,R){var Z=L?L.name:M,te=R&&Lr(R)?R:X;if(L&&(!(te=R&&Lr(R)?R:[M]).includes(M)||te.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(te)+" input valid");return j({},N,{abort:{reason:H,plugins:te,caller:F,_:Z}})}}(O,_,I,p,T):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(T,_);return{payload:iE(T),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,I){var T=I.pluginName,y=I.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[T].loaded),u.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+T]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,I,T){try{var y=I.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&&le(k.method)?(function(H,R){var Z=gl(H);if(Z&&Z.name===R){var te=gl(Z.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+Z.method+" "+(te?"or "+te.method:"")+" in "+R+" plugin insteadof "+H].join(`
36
- `))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,N=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:N||L}})}),config:hl(k.pluginName,f,o),plugins:f})).then(function(H){var R=ue(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,N})}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(I,T,y){try{var p=t.exact.length===y+1,S=T.pluginName,O=o[S];return Promise.resolve(I).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),ko(k,S))return Oo({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(ko(_,S))return p&&Oo({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],o[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:hl(S,f,o),plugins:f})).then(function(F){var X=ue(F)?F:{},L=j({},_,X),N=g[S];if(ko(N,S))Oo({data:N,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(fl)&&!c.match(dl)&&n.dispatch(j({},d?L:k,{type:H,_:{called:H,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(I){if(!(c.match(Bt)||c.match(/^registerPlugin/)||c.match(dl)||c.match(fl)||c.match(/^params/)||c.match(/^userIdChanged/))){if(l.plugins.includes(c),I._&&I._.originalAction===c)return I;var T=j({},I,{_:{originalAction:I.type,called:I.type,from:"engineEnd"}});$h(I,t.exact.length)&&!c.match(/End$/)&&(T=j({},T,{type:I.type+"Aborted"})),s.dispatch(T)}return I})})}catch(g){return Promise.reject(g)}},Bt=/Start$/,fl=/^bootstrap/,dl=/^ready/;function Oo(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function hl(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function vl(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function pl(e,t){var r=e.replace(Bt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function ko(e,t){var r=e.abort;return!!r&&(r===!0||ml(r,t)||r&&ml(r.plugins,t))}function $h(e,t){var r=e.abort;if(!r)return!1;if(r===!0||tt(r))return!0;var n=r.plugins;return Lr(r)&&r.length===t||Lr(n)&&n.length===t}function Lr(e){return Array.isArray(e)}function ml(e,t){return!(!e||!Lr(e))&&e.includes(t)}function gl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function iE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ue(e[r])?Object.assign({},e[r]):e[r]),t},{})}function sE(e,t,r){var n={};return function(a){return function(o){return function(i){try{var s,l=function(p){return s?p:o(c)},f=i.type,u=i.plugins,c=i;if(i.abort)return Promise.resolve(o(i));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:i.meta}),f===A.disablePlugin&&setTimeout(function(){return ll(i.meta.rid,{payload:i})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return u.includes(p)}).map(function(p){return d[p]}),b=[],g=[],I=i.disabled,T=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return bh(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!yi.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(T).then(function(p){var S={plugins:b,failed:g,disabled:I};setTimeout(function(){h.length===T.length+I.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Sh(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=le(S)?S():S,F=p.type,X=F.replace(Bt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),N=(Z=M,(te=L.plugins)===void 0&&(te={}),(Fe=p.options)===void 0&&(Fe={}),Object.keys(Z).filter(function(m){var w=Fe.plugins||{};return BP(w[m])?w[m]:w.all!==!1&&(!te[m]||te[m].enabled!==!1)}).map(function(m){return Z[m]}));F===A.initializeStart&&p.fromEnable&&(N=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 H=N.map(function(m){return m.name}),R=function(m,w,E){var U=pl(m).map(function(x){return vl(x,w)});return w.reduce(function(x,D){var Q=D.name,z=pl(m,Q).map(function($){return vl($,w)}),J=z[0],B=z[1],pe=z[2];return J.length&&(x.beforeNS[Q]=J),B.length&&(x.duringNS[Q]=B),pe.length&&(x.afterNS[Q]=pe),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(Eo({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 x=function(){if(F.match(Bt))return Promise.resolve(Eo({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&&ll(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return m}):m}if($h(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Eo({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(x){E=x});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var Z,te,Fe}(i,t,e,a,r)).then(function(p){return s=1,o(p)})}();return Promise.resolve(y&&y.then?y.then(l):l(y))}catch(p){return Promise.reject(p)}}}}}function cE(e){return function(t){return function(r){return function(n){var a=n.type,o=n.key,i=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(o,i,s):e.removeItem(o,s)}return r(n)}}}}var uE=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 o={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},i=e[t].map(function(s){return s(o)});return Xt.apply(void 0,i)(n)(a)}}}}};function lE(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=yl(r.type,"registerPlugin"),o=e()[a];if(!o||!a)return t;var i=r.enabled,s=o.config;return n[a]={enabled:i,initialized:!!i&&!o.initialize,loaded:!!i&&!!o.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=yl(r.type,A.initialize),f=e()[l];return f&&l?(n[l]=j({},t[l],{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,wl(r.plugins,!1,t));case A.enablePlugin:return j({},t,wl(r.plugins,!0,t));default:return t}}}function yl(e,t){return e.substring(t.length+1,e.length)}function wl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Ih(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var fE={last:{},history:[]};function dE(e,t){e===void 0&&(e=fE);var r=t.options,n=t.meta;if(t.type===A.track){var a=Ih(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var hE={actions:[]};function vE(e,t){e===void 0&&(e=hE);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Th=/#.*$/;function pE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Th,""):"")}var Ph,Eh,Oh,kh,mE=function(e){if(e===void 0&&(e={}),!re)return e;var t=document,r=t.title,n=t.referrer,a=window,o=a.location,i=a.innerWidth,s=a.innerHeight,l=o.hash,f=o.search,u=function(d){var h=function(){if(re){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(Th,"")}(f),c={title:r,url:u,path:pE(u),hash:l,search:f,width:i,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},gE={last:{},history:[]};function yE(e,t){e===void 0&&(e=gE);var r=t.options;if(t.type===A.page){var n=Ih(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}Ph=function(){if(!re)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"}(),Eh=re?document.referrer:null,Oh=ZP(),kh=JP();var bl={initialized:!1,sessionId:ha(),app:null,version:null,debug:!1,offline:!!re&&!navigator.onLine,os:{name:Ph},userAgent:re?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:kh,locale:Oh,campaign:{},referrer:Eh};function wE(e,t){e===void 0&&(e=bl);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({},bl,e,{initialized:!0})}}var bE=["plugins","reducers","storage"];function SE(e,t,r){if(re){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function $E(e){var t=SE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function _h(){return yt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),o=a.dispatch;return Object.assign(a,{dispatch:function(i){return qt[Yt].analytics.push(i.action||i),o(i)}})}}}function Sl(e){return function(){return Xt(Xt.apply(null,arguments),_h())}}function _o(e){return e?gh(e)?e:[e]:[]}function $l(e,t,r){e===void 0&&(e={});var n,a,o=ha();return t&&(br[o]=(n=t,a=function(i){for(var s,l=i||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(le(l[f])){s=l[f];break}return s}(r),function(i){a&&a(i),n(i)})),j({},e,{rid:o,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function IE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(le(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 z;return D[Q]=(z=w.methods[Q],function(){for(var J=Array.prototype.slice.call(arguments),B=new Array(z.length),pe=0;pe<J.length;pe++)B[pe]=J[pe];return B[B.length]=S,z.apply({instance:S},B)}),D},{}),delete w.methods);var U=Object.keys(w).concat(E),x=new Set(m.events.concat(U));if(m.events=Array.from(x),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:gt,setItem:yt,removeItem:ar},o=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ue(U)&&U[w]?U[w]:ul(m)[w]||gt(wi(w))||null)}}(a),i=n.plugins,s=n.events.filter(function(m){return!yi.includes(m)}).sort(),l=new Set(s.concat(kn).filter(function(m){return!yi.includes(m)})),f=Array.from(l).sort(),u=function(){return i},c=new uE,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=YP(),I=ul(a),T=j({},I,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});T.anonymousId||(T.anonymousId=ha());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:_o(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:_o(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var x=tt(m)?m:null,D=ue(m)?m:w,Q=E||{},z=S.user();yt(wi(qe),x);var J=x||D.userId||o(qe,S,D);return Promise.resolve(new Promise(function(B){R.dispatch(j({type:A.identifyStart,userId:J,traits:D||{},options:Q,anonymousId:z.anonymousId},z.id&&z.id!==x&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var x=ue(m)?m.event:m;if(!x||!tt(x))throw new Error("EventMissing");var D=ue(m)?m:w||{},Q=ue(E)?E:{};return Promise.resolve(new Promise(function(z){R.dispatch({type:A.trackStart,event:x,properties:D,options:Q,userId:o(qe,S,w),anonymousId:o(Dt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ue(m)?m:{},x=ue(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:mE(U),options:x,userId:o(qe,S,U),anonymousId:o(Dt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===qe||m==="id")return o(qe,S);if(m===Dt||m==="anonId")return o(Dt,S);var w=S.getState("user");return m?rl(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||!le(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(z){return function(J){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:i}),J(B)}}},x=function(z){return function(J){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:i}),J(B)}}};return d(U,mn),d(x,gn),function(){h(U,mn),h(x,gn)}}var D=m.match(E)?mn:gn,Q=function(z){return function(J){return function(B){return B.type===m&&w({payload:B,instance:S,plugins:i,abort:b}),J(B)}}};return d(Q,D),function(){return h(Q,D)}},once:function(m,w){if(!m||!le(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:i,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?rl(w,m):Object.assign({},w)},dispatch:function(m){var w=tt(m)?{type:m}:m;if(kn.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(rt,m,w)},events:{core:kn,plugins:s}},O=n.middlewares.concat([function(m){return function(w){return function(E){return E.meta||(E.meta=$l()),w(E)}}},v(mn),sE(S,u,{all:f,plugins:s}),cE(a),rE(S),aE(S),v(gn)]),_={context:wE,user:nE(a),page:yE,track:dE,plugins:lE(u),queue:vE},k=Xt,M=Xt;if(re&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?_h():ue(typeof arguments[0])?Sl():Sl().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return bE.includes(E)||(w[E]=m[E]),w},{})}(e),N=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,x=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!x({config:U}),config:U},m},{}),H={context:L,user:T,plugins:N},R=wh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var x=w[U];typeof m[x]===Xe&&(E[x]=m[x])}var D,Q=Object.keys(E);try{(function(z){Object.keys(z).forEach(function(J){var B=z[J];if(typeof B(void 0,{type:"@@redux/INIT"})===Ke||typeof B(void 0,{type:QP})===Ke)throw new Error("reducer "+J+" "+Ke)})})(E)}catch(z){D=z}return function(z,J){if(z===void 0&&(z={}),D)throw D;for(var B=!1,pe={},$=0;$<Q.length;$++){var P=Q[$],C=z[P],W=(0,E[P])(C,J);if(typeof W===Ke){var V=eE(P,J);throw new Error(V)}pe[P]=W,B=B||W!==C}return B?pe:z}}(j({},_,t)),H,M(k(tE.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:$l(m.meta,w,_o(E))});return X.apply(null,[U])});var Z=Object.keys(i);R.dispatch({type:A.bootstrap,plugins:Z,config:L,params:g,user:T,initialUser:r,persistedUser:I});var te=Z.filter(function(m){return n.pluginEnabled[m]}),Fe=Z.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:Z,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,w){var E=m.bootstrap,U=m.config,x=m.name;E&&le(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:te,disabled:Fe})}),$E(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return Sh(m,w,E)},3e3)}(R,u,S),S}var mn="before",gn="after",kr="cookie",lt=Ah(),Rh=va,TE=va;function Ch(e){return lt?va(e,"",-1):ar(e)}function Ah(){if(lt!==void 0)return lt;var e="cookiecookie";try{va(e,e),lt=document.cookie.indexOf(e)!==-1,Ch(e)}catch{lt=!1}return lt}function va(e,t,r,n,a,o){if(typeof window<"u"){var i=arguments.length>1;return lt===!1&&(i?yt(e,t):gt(e)),i?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var _r="localStorage",PE=ms.bind(null,"localStorage");or("localStorage","getItem",gt);or("localStorage","setItem",yt);or("localStorage","removeItem",ar);var Rr="sessionStorage",EE=ms.bind(null,"sessionStorage");or("sessionStorage","getItem",gt);or("sessionStorage","setItem",yt);or("sessionStorage","removeItem",ar);function zt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ue(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var OE=PE(),kE=EE(),_E=Ah();function jh(e,t){if(e){var r=gs(t),n=!Ss(r),a=ys(r)?zt(localStorage.getItem(e)):void 0;if(n&&!Nt(a))return a;var o=ws(r)?zt(Rh(e)):void 0;if(n&&o)return o;var i=bs(r)?zt(sessionStorage.getItem(e)):void 0;if(n&&i)return i;var s=gt(e);return n?s:{localStorage:a,sessionStorage:i,cookie:o,global:s}}}function RE(e,t,r){if(e&&!Nt(t)){var n={},a=gs(r),o=JSON.stringify(t),i=!Ss(a);return ys(a)&&(n[_r]=yn(_r,t,zt(localStorage.getItem(e))),localStorage.setItem(e,o),i)?n[_r]:ws(a)&&(n[kr]=yn(kr,t,zt(Rh(e))),TE(e,o),i)?n[kr]:bs(a)&&(n[Rr]=yn(Rr,t,zt(sessionStorage.getItem(e))),sessionStorage.setItem(e,o),i)?n[Rr]:(n[Or]=yn(Or,t,gt(e)),yt(e,t),i?n[Or]:n)}}function CE(e,t){if(e){var r=gs(t),n=jh(e,vh),a={};return!Nt(n.localStorage)&&ys(r)&&(localStorage.removeItem(e),a[_r]=n.localStorage),!Nt(n.cookie)&&ws(r)&&(Ch(e),a[kr]=n.cookie),!Nt(n.sessionStorage)&&bs(r)&&(sessionStorage.removeItem(e),a[Rr]=n.sessionStorage),!Nt(n.global)&&pa(r,Or)&&(ar(e),a[Or]=n.global),a}}function gs(e){return e?tt(e)?e:e.storage:hh}function ys(e){return OE&&pa(e,_r)}function ws(e){return _E&&pa(e,kr)}function bs(e){return kE&&pa(e,Rr)}function Ss(e){return e===vh||e==="all"}function pa(e,t){return e===hh||e===t||Ss(e)}function yn(e,t,r){return{location:e,current:t,previous:r}}var AE={setItem:RE,getItem:jh,removeItem:CE};function jE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Tl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Il(Object(r),!0).forEach(function(n){jE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Il(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:AE};return IE(Tl(Tl({},t),e))}function UE(e,t){t=t||{};var r,n,a=[],o=t.max||1/0;function i(){clearInterval(r),e(a.splice(0,o)),s()}function s(){r=setInterval(i,t.interval||1e4)}return s(),{flush:i,push:function(l){return n=a.push(l),n>=o&&i(),n},size:function(){return a.length},end:function(l){l&&i(),clearInterval(r)}}}function xE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(o=>{const i=`${o}State`;if(i!=="pushState"&&i!=="replaceState")return;const s=r[i];r[i]=function(...l){var c;const f=((c=l[2])==null?void 0:c.toString())||"",u=DE(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),s.apply(r,l)}})}function NE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function DE(e){return["#","?"].forEach(t=>e=NE(e,t)),e}function ME(){xE(()=>{He.page()})}function FE(e){if(e===void 0&&(e={}),!re)return gi;var t=El(),r=bi(),n=Pl(),a=wn(n,t),o=wn(r,t),i=[],s=[],l=[],f=n,u=a,c=o,d=Object.keys(e);if(!d.length)return gi;var h=d.map(function(b){return Number(b)}),v=XP(function(){var b=El(),g=function(L,N){return N.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),I=bi(),T=Pl(),y=wn(T,b),p=wn(I,b);if(u=y>u?y:u,c=p<c?p:c,!(i.length>=h.length)){var S=f===T,O="up";S?O="initial":f<=T&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,N,H){var R=_[H];return l.includes(N)&&T<=R&&(l=l.filter(function(Z){return Z!==N}),L.singleFunction=N),O==="down"&&!i.includes(N)&&T>=R&&N>o?(s.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!i.includes(N)&&T<=R&&N<=y?(L.foundFunc=[N],L):(S&&T>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!s.includes(N)&&T>=R&&(s.push(N),L.singleFunction?l.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=T,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){le(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:u,range:[c,u]}),i.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;le(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:u,range:[c,u]}),i.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function bi(){return re?document.body.scrollTop||document.documentElement.scrollTop:0}function BE(){return re?window.innerHeight||document.documentElement.clientHeight:0}function Pl(){return Math.round(bi()+BE())}function El(){if(!re)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function wn(e,t){return Math.round(e/t*100)}var Ol="EventListener";function zE(e){return function(t,r,n,a){var o=n||gi,i=a||!1;if(!re)return o;var s=Gn(r),l=Gn(t,!0);if(!l.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function u(c){c&&(f=[]);for(var d=c?"add"+Ol:"remove"+Ol,h=0;h<l.length;h++){var v=l[h];f[h]=c?i&&i.once?HE(o):o:f[h]||o;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],i)}return u.bind(null,!c)}(e)}}function Gn(e,t){if(tt(e))return t?Gn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(i){return i.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var o=VP(e);return t?o.map(function(i){return tt(i)?Gn(i,!0):i}).flat():o}function HE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ro=zE("Event");function Lh(e,t){return re&&le(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),le(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Lh.bind(null,"onerror");Lh.bind(null,"onload");var Uh=typeof window>"u",kl="hidden";function GE(e){if(Uh)return!1;var t=KE(),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 KE(){var e=["webkit","moz","ms","o"];return Uh||kl in document?kl: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 VE(e,t){t===void 0&&(t={});var r=function(i,s){var l=this,f=!1;return function(u){f||(i.call(l,u),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var i=GE(function(s){s||r({type:"tabVisible"})});return n=[i].concat(WE.map(function(s){return Ro(document,s,r)})).concat(Ro(window,"load",r)).concat(Ro(window,"scroll",r,{capture:!0,passive:!0})),o}function o(){n.map(function(i){return i()})}return a(),function(){return o(),a}}function ZE(e){var t,r,n=e.onIdle,a=e.onWakeUp,o=e.onHeartbeat,i=e.timeout,s=i===void 0?1e4:i,l=e.throttle,f=l===void 0?2e3:l,u=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),o&&!u&&o(mr(d),g),a&&u&&(u=!1,a(mr(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(mr(d),g))},s)}var b=VE(v,{throttle:f});return{disable:function(){c=!0,u=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:c,active:u?0:mr(d,c),idle:u?mr(r,c):0}}}}function mr(e,t){return t?0:Math.round((new Date-e)/1e3)}const _l=5e3;class JE{constructor(t){me(this,"element");me(this,"isInViewport",!1);me(this,"isAwake",!1);me(this,"isFlushing");me(this,"observer");me(this,"lastEventAt",Date.now());me(this,"registeredView",!1);me(this,"viewCallback");me(this,"activeDurationCallback");me(this,"idleDurationCallback");me(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),ZE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:_l}),FE({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*_l: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 Rl="sesamy_session_id";function YE(){let e=sessionStorage.getItem(Rl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Rl,e)),e}let xh=!1,Si,Cl,Kn;const Nh=new Map;function qE({clientId:e,enabled:t=!0,environment:r}){if(Si=e,Cl=t,Kn=`${Ge("logs",r)}/events`,!Cl)return;window.addEventListener("beforeunload",()=>{Mh.forEach((a,o)=>{a.bind(o)()}),QE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Nh.forEach((a,o)=>{a.bind(o)()})}),ME();const n=new JE({element:document.body,viewCallback:()=>{He.page()},activeDurationCallback:(a,o,i)=>{He.track("activeDuration",{duration:a,durationStart:i,flushing:o})},idleDurationCallback:(a,o,i)=>{He.track("idleDuration",{duration:a,durationStart:i,flushing:o})},scrollCallback:a=>{He.track("scroll",{scroll:a.scrollMax})}});eO(document.body,()=>{n.flush()}),tO(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const o=a;await He.identify(o.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await He.track("logout",{}),$s.flush(),await He.reset()})}function Dh(e){return JSON.stringify(e.map(t=>({...t,clientId:Si,requestId:Math.random().toString(36).slice(2,9),sessionId:YE(),timestamp:new Date().toISOString(),version:ps,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:dh,userAgent:navigator.userAgent,clientId:Si}})))}const $s=UE(async e=>{if(e.length>0){const t=Dh(e);xh?navigator.sendBeacon(Kn,t):(await fetch(Kn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Co(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Kn,Dh([r]))}else $s.push(e)}const He=LE({app:dh,version:ps,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Co({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Co({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Co({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function XE(e,t){He.track(e,t)}function QE(){return xh=!0,$s.flush()}const Mh=new Map;function eO(e,t){Mh.set(e,t)}function tO(e,t){Nh.set(e,t)}const rO=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function nO(){return new Promise(e=>{const t=rO.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function aO(){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}}let Se={article:{selector:"article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"article",attribute:"data-price"},currency:{selector:"article",attribute:"data-currency"},url:{selector:"link",attribute:"href"},id:{selector:"article",attribute:"data-id"},pass:{selector:"article",attribute:"data-pass"}};function oO(e){var t;Se={...Se,...(t=e.content)==null?void 0:t.article}}function iO(e,t){const{selector:r}=t;return r===Se.article.selector?e:e.querySelector(r)}function Fh(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??Fh(e.parentElement,t):e.textContent??void 0}function Ao(e){var t,r;return((t=document.head.querySelector(`[property~='${e}'][content]`))==null?void 0:t.content)??((r=document.head.querySelector(`[name~='${e}'][content]`))==null?void 0:r.content)}function sO({publisherContentId:e,key:t,defaultValue:r=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null;return(n==null?void 0:n.getAttribute(t))||Ao(`sesamy:${t}`)||Ao(`og:${t}`)||Ao(t)||r}function cO(){const e=document.querySelectorAll(Se.article.selector);return Array.from(e).map(Bh).filter(t=>t!==null)}function Bh(e){const t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;const r={element:t},n=(a,o,i,s)=>{const l=iO(t,o);if(l){const f=Fh(l,o)||sO({publisherContentId:i,key:a});f!==void 0&&(r[a]=s?s(f):f)}};return n("id",Se.id),n("title",Se.title,r.id),n("excerpt",Se.excerpt,r.id),n("image",Se.image,r.id),n("price",Se.price,r.id,a=>parseFloat(a)),n("currency",Se.currency,r.id),n("url",Se.url,r.id),n("pass",Se.pass,r.id),r}function uO(e){const{autoOnboardProduct:t,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:o,deleteUserMetadata:i,generateLink:s,getBill:l,getBills:f,getCheckout:u,getContract:c,getContracts:d,getEntitlement:h,getEntitlementAccess:v,getEntitlements:b,getFulfillments:g,getPaywall:I,getPaymentIssues:T,getProfile:y,getProduct:p,getSubscriptions:S,getTags:O,getTally:_,getTallies:k,getTransaction:M,getTransactions:F,getUserMetadata:X,hasAccess:L,isSpotifyLinked:N,linkSpotify:H,listUserMetadata:R,openHostedAccountPage:Z,pushTally:te,setTag:Fe,setUserMetadata:m,unlinkSpotify:w,updateCheckout:E,updateProfile:U}=NP(e),x={analytics:{track:XE},attribution:{get:vs,set:fh},auth:{getUser:y,isAuthenticated:jr,loginWithRedirect:ds,logout:nh,setToken:oh},bills:{get:l,list:f},browser:{detectAdblock:nO,isInAppBrowser:aO,isIncognito:th},checkouts:{create:n,get:u,update:E},clearCache:_e,content:{list:cO,get:Bh},contracts:{cancel:r,get:c,list:d},entitlements:{access:v,get:h,hasAccess:L,list:b,signedLinks:hs},fulfillments:{list:g},generateLink:s,getPaymentIssues:T,getVersion:lO,log:q,paywalls:{get:I},products:{autoOnboard:t,get:p,linkSpotify:H},profile:{get:y,isSpotifyLinked:N,openHostedAccountPage:Z,unlinkSpotify:w,update:U},subscriptions:{list:S},tags:{delete:a,list:O,set:Fe},tallies:{delete:o,get:_,list:k,push:te},transactions:{get:M,list:F},userMetadata:{delete:i,get:X,list:R,set:m}};return e.namespace&&(window[e.namespace]=x),x}function lO(){return ps}function fO(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 i of a){const s=i.offsetHeight;n+s>200?i.remove():n+=s}const o=document.createElement("style");o.innerHTML=`
34
+ **/var vi={d:(e,t)=>{for(var r in t)vi.o(t,r)&&!vi.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},ls={};vi.d(ls,{A:()=>mP,k:()=>fs});var vP=function(e,t,r,n){return new(r||(r=Promise))(function(a,o){function i(f){try{l(n.next(f))}catch(u){o(u)}}function s(f){try{l(n.throw(f))}catch(u){o(u)}}function l(f){var u;f.done?a(f.value):(u=f.value,u instanceof r?u:new r(function(c){c(u)})).then(i,s)}l((n=n.apply(e,[])).next())})},pP=function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!((a=a.length>0&&a[a.length-1])||u[0]!==6&&u[0]!==2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(c){u=[6,c],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([l,f])}}};function fs(){return vP(this,void 0,Promise,function(){return pP(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n,a,o="Unknown";function i(c){t({isPrivate:c,browserName:o})}function s(c){return c===eval.toString().length}function l(){navigator.maxTouchPoints!==void 0?function(){var c=String(Math.random());try{window.indexedDB.open(c,1).onupgradeneeded=function(d){var h,v,b=(h=d.target)===null||h===void 0?void 0:h.result;try{b.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(I){var g=I;return I instanceof Error&&(g=(v=I.message)!==null&&v!==void 0?v:I),typeof g!="string"?void i(!1):void i(g.includes("BlobURLs are not yet supported"))}finally{b.close(),window.indexedDB.deleteDatabase(c)}}}catch{i(!1)}}():function(){var c=window.openDatabase,d=window.localStorage;try{c(null,null,null,null)}catch{return void i(!0)}try{d.setItem("test","1"),d.removeItem("test")}catch{return void i(!0)}i(!1)}()}function f(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(c,d){var h;i(Math.round(d/1048576)<2*Math.round(((h=window).performance!==void 0&&h.performance.memory!==void 0&&h.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(c){r(new Error("detectIncognito somehow failed to query storage quota: "+c.message))})}function u(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?f():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}(a=navigator.vendor)!==void 0&&a.indexOf("Apple")===0&&s(37)?(o="Safari",l()):function(){var c=navigator.vendor;return c!==void 0&&c.indexOf("Google")===0&&s(33)}()?(n=navigator.userAgent,o=n.match(/Chrome/)?navigator.brave!==void 0?"Brave":n.match(/Edg/)?"Edge":n.match(/OPR/)?"Opera":"Chrome":"Chromium",u()):document.documentElement!==void 0&&document.documentElement.style.MozAppearance!==void 0&&s(37)?(o="Firefox",i(navigator.serviceWorker===void 0)):navigator.msSaveBlob!==void 0&&s(39)?(o="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser"))})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=fs);const mP=fs;ls.A;var gP=ls.k;async function rh(){try{const{isPrivate:e}=await gP();return e}catch{return!1}}let he,nh,pi=!1,Ju=!1;const Zt="sesamyAccessToken",Po="sesamyRefreshToken";async function Hr(){return pi?!0:new Promise((e,t)=>{const r=setTimeout(()=>{pi?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function yP(e){if(!e)return null;const t=localStorage.getItem(Po);if(!t)return Y("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(Po),new Error("Renew token failed");const o=await a.json();return localStorage.setItem(Po,o.refresh_token),localStorage.setItem(Zt,o.access_token),o.access_token}catch{ah()}}async function ds(){const e=localStorage.getItem(Zt);if(!e)return null;const t=oh(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await yP(t);if(r)return r;localStorage.removeItem(Zt)}return e}function Yu(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 wP(e){if(e.enabled===!1)return;nh=e.organization;const t={domain:Ge("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Yu(window.location.href)!==Yu(Ge("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),he=await lP(t),window.location.search.includes("code=")){Y("Code found in URL, handling redirect");try{const r=await he.handleRedirectCallback();Y(`Login result: ${JSON.stringify(r)}`);const n=await he.getUser();if(!n)throw Y("No user found"),new Error("No user found");Y(`User found ${JSON.stringify(n)}`),Ve(ve.AUTHENTICATED,n);const a=new URL(location.href),o=a.searchParams;o.delete("code"),o.delete("state"),a.search=o.toString(),window.history.replaceState({},document.title,a.toString()),Y("Rewrite url")}catch(r){alert("There was an error logging in"),console.error(r)}}pi=!0,Ve(ve.AUTH_INITIALIZED,{})}async function jr(){return await Hr(),await ds()?!0:he?he.isAuthenticated():!1}async function bP(){return await Hr(),await ds()?(Y("Using local user"),{sub:"local",name:"Local User"}):he?he.getUser():null}async function hs(e){if(Ju){Y("Login already in progress");return}if(Ju=!0,await Hr(),localStorage.removeItem(Zt),!he)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return await rh()&&navigator.userAgent.includes("Safari")&&navigator.userAgent.includes("iPhone")&&sessionStorage.setItem(di,"true"),he.loginWithRedirect({...e,authorizationParams:{organization:nh,redirect_uri:window.location.href,ui_locales:hi(),...t}})}async function pr(e=!0){await Hr();const t=await ds();if(t)return t;try{return he?await he.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function ah(e={}){if(await Hr(),localStorage.removeItem(Zt),Ve(ve.LOGOUT,{}),!!he)return he.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function oh(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(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function ih(e){const t=oh(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Zt,e),Ve(ve.AUTHENTICATED,t)}const SP=(e,t)=>t.skipDedupe||t.method!=="GET",$P=(e,t)=>t.method+"@"+e,IP=e=>e.clone(),qu=({skip:e=SP,key:t=$P,resolver:r=IP}={})=>{const n=new Map;return a=>(o,i)=>{if(e(o,i))return a(o,i);const s=t(o,i);if(!n.has(s))n.set(s,[]);else return new Promise((l,f)=>{n.get(s).push([l,f])});try{return a(o,i).then(l=>(n.get(s).forEach(([f])=>f(r(l))),n.delete(s),l)).catch(l=>{throw n.get(s).forEach(([,f])=>f(l)),n.delete(s),l})}catch(l){return n.delete(s),Promise.reject(l)}}},TP=(e,t)=>e*t,PP=e=>e&&e.ok,Xu=({delayTimer:e=500,delayRamp:t=TP,maxAttempts:r=10,until:n=PP,onRetry:a=null,retryOnNetworkError:o=!1,resolveWithLatestResponse:i=!1,skip:s}={})=>l=>(f,u)=>{let c=0;if(s&&s(f,u))return l(f,u);const d=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&i?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const I=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:u})).then((T={})=>{var y,p;g(l((y=T&&T.url)!==null&&y!==void 0?y:f,(p=T&&T.options)!==null&&p!==void 0?p:u))}):g(l(f,u))},I)}).then(d).catch(g=>{if(!o)throw g;return d(null,g)}):h&&i?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return l(f,u).then(d).catch(h=>{if(!o)throw h;return d(null,h)})},EP="application/json",sh="Content-Type",Rt=Symbol(),ch=Symbol();function Qu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===sh.toLowerCase()))===null||t===void 0?void 0:t[1]}function el(e){return/^application\/.*json.*/.test(e)}const ht=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,o])=>{const i=e[a];return Array.isArray(i)&&Array.isArray(o)?n[a]=r?[...i,...o]:o:typeof i=="object"&&typeof o=="object"?n[a]=ht(i,o,r):n[a]=o,n},{...e})},Jt={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 OP(e,t=!1){Jt.options=t?e:ht(Jt.options,e)}function kP(e,t=!1){Jt.polyfills=t?e:ht(Jt.polyfills,e)}function _P(e){Jt.errorType=e}const RP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class uh extends Error{}const CP=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:o,_resolvers:i,_middlewares:s,_addons:l}=e,f=new Map(o),u=ht(a.options,n);let c=r;const d=RP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,u),h=new Error,v=d.catch(y=>{throw{[Rt]:y}}).then(y=>{var p;if(!y.ok){const S=new uh;if(S.cause=h,S.stack=S.stack+`
35
+ 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,Rt),O=S?p[Rt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||S&&f.has(Rt)&&f.get(Rt);if(_)return _(O,e);const k=f.get(ch);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)),I={_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(Rt,y)}},T=l.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),I);return i.reduce((y,p)=>p(y,e),T)},AP={_url:"",_options:{},_config:Jt,_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:ht(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:ht(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:ht(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[sh]: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(ch,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=Qu(n._options.headers),o=this._config.polyfill("FormData",!1),i=typeof r=="object"&&!(o&&r instanceof o)&&(!n._options.headers||!a||el(a));return n=r?i?n.json(r,a):n.body(r):n,CP(n._deferred.reduce((s,l)=>l(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=Qu(this._options.headers);return this.content(t||el(r)&&r||EP).body(JSON.stringify(e))}};function We(e="",t={}){return{...AP,_url:e,_options:t}}We.default=We;We.options=OP;We.errorType=_P;We.polyfills=kP;We.WretchError=uh;function _e(){sessionStorage.removeItem(fi),console.log("Cache cleared"),Ve(ve.CLEAR_CACHE,{})}function mi(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function lh(e,t){if(mi(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function tl(e){return e.endsWith("/")?e.slice(0,-1):e}function rl(e,t){if(!mi(e)||!mi(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&tl(r.pathname)===tl(n.pathname)}function jP(e,t){const r=new URL(`${Ge("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:i,purchaseOption:s,itemSrc:l}=lh(t.itemSrc,t.purchaseOptionId);l&&r.searchParams.set("url",l),i&&r.searchParams.set("sku",i),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(i=>{const[s,l]=i.trim().split("=");return{key:s,value:l}}).filter(i=>n.some(s=>s===i.key)).forEach(i=>{r.searchParams.append(i.key,i.value)});const o=new URL(t.redirectUrl||window.location.href);return o.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&o.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",o.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:i,methods:s})=>s?s.map(l=>`${i}|${l}`):i).join(",")),r}const fh="sesamySignedURLs";function vs(){const e=sessionStorage.getItem(fh);return e?JSON.parse(e):[]}function LP(e){const t=vs();t.push(e),Y(`Adding signed URL: ${e}`),sessionStorage.setItem(fh,JSON.stringify(t))}function UP(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];n!=null&&(t[r]=n.toString())}),t}const gi="sesamyAttribution";function xP(e){const t=sessionStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch{return console.error(`Failed to parse ${e}`),null}}function NP(e){return Object.keys(e).find(t=>t.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function ps(){return xP(gi)||{}}function dh(e){if(e===null)sessionStorage.removeItem(gi);else{Y(`Setting attribution ${JSON.stringify(e)}`);const t=ps()??{},r=UP({...t,...NP(e)});sessionStorage.setItem(gi,JSON.stringify({value:r}))}}function DP(e){const t=Ge("api2",e.environment),r=$=>async(P,C)=>{let W=sessionStorage.getItem(fi);W||(W=Date.now().toString(),sessionStorage.setItem(fi,W));const V={...C,headers:{...C.headers,"Cache-Timestamp":W}};return $(P,V)},n=($=!0)=>P=>async(C,W)=>{let V=null;if(V=await pr($),!V){if($)throw new Error("No access token available");return P(C,W)}const Je={...W,headers:{...W.headers,...V?{Authorization:`Bearer ${V}`}:{}}};return P(C,Je)},a=$=>(P,C)=>{if(C.headers.Authorization)return $(P,C);const W=localStorage.getItem("__anon_id"),V=btoa(`${e.clientId}|${W}:`),Je={...C,headers:{...C.headers,Authorization:`Basic ${V}`}};return $(P,Je)},o=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),qu(),Xu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),i=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,qu(),Xu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]);async function s($={}){const{waitForEntitlementAfter:P,includeSignedLinks:C=!0}=$,W=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",V=await jr()?await o.get(`/entitlements${W}`).json():[];return C&&V.push(...vs()),V}async function l($,P=[]){const C=await s();return C==null?void 0:C.find(V=>{const{sku:Je,purchaseOption:It}=lh($);let ir="sku"in V&&Je===V.sku;ir&&It&&"purchaseOptionId"in V&&(ir=It===V.purchaseOptionId);const Kh=rl($,V.url),Wh=P.some(Vh=>rl(Vh,V.url));return ir||Kh||Wh})}async function f($){const P=await o.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function u($){return o.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await jr()?await o.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return o.get("/contracts").json()}async function h($){const P=await o.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await o.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function g(){return o.get("/bills").json()}async function I($){const P=await o.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function T(){return o.get("/transactions").json()}async function y($){const P=await o.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await o.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),C}async function S($){const P=await o.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function O($){return(await o.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await o.url("/user-metadata").get().json()}async function k(){return await o.url("/tags").get().json()}async function M($){const P=await o.url(`/tags/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function F($){const P=await o.url("/tags").post(encodeURIComponent($)).res();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),P.ok}async function X($){return(await i.url("/tallies").get().json())[$]}async function L(){return await i.url("/tallies").get().json()}async function N($){const P=await i.url(`/tallies/${$}`).delete().res();return _e(),P.ok}async function H($,P){return await i.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await o.url(`/products/${encodeURIComponent($)}`).get().json()}async function Z(){return await pr(!1)?await o.url("/profile").get().json():null}async function te($){const P=await o.url("/profile").patch($).res();return _e(),P.ok}async function Fe(){return await o.url("/payment-issues").get().json()}async function m(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await pr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${Ge("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 o.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&_e(),P}async function x($,P=3600){const{shortlink:C}=await We(hP).post({url:$,ttl:P}).json();return C}async function D($){const P=await pr(!1);let C;const W=$.language||hi();switch($.target){case"account":C=new URL(`${Ge("account",e.environment)}/${encodeURIComponent($.language||W)}/subscriptions/${encodeURIComponent(e.clientId)}`),C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"consume":C=new URL(`${Ge("consume",e.environment)}/${encodeURIComponent($.language||W)}/@${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=jP(e,{language:W,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?x(C.href,$.ttl):C.href}async function Q($){const P=ps(),C=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(V=>{const Je=P,[It,ir]=V.trim().split("=");C.includes(It)&&!Je[It]&&(Je[It]=ir)}),(await i.url("/checkouts").post({language:hi(),attribution:{...P,...$.attribution},...$,vendorId:e.clientId})).json()}async function z($,P){return(await i.url(`/checkouts/${$}`).patch(P)).json()}async function J($){return(await i.url(`/checkouts/${$}`).get()).json()}async function B($){return(await i.url(`/paywalls/${$}`).get()).json()}async function pe(){const $=await pr(!1),P=new URL(`${Ge("account",e.environment)}/subscriptions/${e.clientId}`);$&&(P.hash=`#access_token=${$}`),window.location.href=P.toString()}return{autoOnboardProduct:U,cancelContract:v,createCheckout:Q,deleteTag:M,deleteTally:N,deleteUserMetadata:S,generateLink:D,getBill:I,getBills:g,getCheckout:J,getContract:h,getContracts:d,getEntitlement:f,getEntitlementAccess:u,getEntitlements:s,getFulfillments:c,getPaywall:B,getPaymentIssues:Fe,getProfile:Z,getProduct:R,getSubscriptions:b,getTally:X,getTallies:L,getTags:k,getTransaction:y,getTransactions:T,getUserMetadata:O,hasAccess:l,isSpotifyLinked:m,linkSpotify:E,listUserMetadata:_,openHostedAccountPage:pe,pushTally:H,setTag:F,setUserMetadata:p,unlinkSpotify:w,updateCheckout:z,updateProfile:te}}const hh="@sesamy/sesamy-js",ms="1.19.1";function nl(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 hn="undefined",al="object",yi=function(){},vh="any",ph="*",mt="__",zn=typeof process<"u"?process:{};zn.env&&zn.env.NODE_ENV;var re=typeof document<"u";zn.versions!=null&&zn.versions.node!=null;typeof Deno<"u"&&Deno.core;re&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function mh(e,t){return t.charAt(0)[e]()+t.slice(1)}var MP=mh.bind(null,"toUpperCase"),FP=mh.bind(null,"toLowerCase");function BP(e){return gh(e)?MP("null"):typeof e=="object"?KP(e):Object.prototype.toString.call(e).slice(8,-1)}function Hn(e,t){t===void 0&&(t=!0);var r=BP(e);return t?FP(r):r}function Gr(e,t){return typeof t===e}var le=Gr.bind(null,"function"),tt=Gr.bind(null,"string"),Nt=Gr.bind(null,"undefined"),zP=Gr.bind(null,"boolean");Gr.bind(null,"symbol");function gh(e){return e===null}function HP(e){return Hn(e)==="number"&&!isNaN(e)}function yh(e){return Hn(e)==="array"}function ue(e){if(!GP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function GP(e){return e&&(typeof e=="object"||e!==null)}function KP(e){return le(e.constructor)?e.constructor.name:null}function WP(e){return e instanceof Error||tt(e.message)&&e.constructor&&HP(e.constructor.stackTraceLimit)}function wh(e,t){if(typeof t!="object"||gh(t))return!1;if(t instanceof e)return!0;var r=Hn(new e(""));if(WP(t))for(;t;){if(Hn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}wh.bind(null,TypeError);wh.bind(null,SyntaxError);function fa(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?VP(e,t):r}function VP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function da(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}da(fa,"form");da(fa,"button");da(fa,"input");da(fa,"select");function ZP(e){return e?yh(e)?e:[e]:[]}function ol(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function JP(){if(re){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function YP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function qP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var o=ol(r[1]),i=ol(r[2]);o.substring(o.length-2)==="[]"?(n[o=o.substring(0,o.length-2)]||(n[o]=[])).push(i):n[o]=i===""||i}for(var s in n){var l=s.split("[");l.length>1&&(XP(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return re&&window.location.search.substring(1)}())}function XP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var o=t[a];if(o==="__proto__"||o==="constructor")break;o in e||(e[o]={}),e=e[o]}e[t[n]]=r}function ha(){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 QP(e,t){var r,n,a,o=null,i=0,s=function(){i=new Date,o=null,a=e.apply(r,n)};return function(){var l=new Date;i||(i=l);var f=t-(l-i);return r=this,n=arguments,f<=0?(clearTimeout(o),o=null,i=l,a=e.apply(r,n)):o||(o=setTimeout(s,f)),a}}var Or="global",Yt=mt+"global"+mt,qt=typeof self===al&&self.self===self&&self||typeof global===al&&global.global===global&&global||void 0;function gt(e){return qt[Yt][e]}function yt(e,t){return qt[Yt][e]=t}function ar(e){delete qt[Yt][e]}function or(e,t,r){var n;try{if(gs(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}qt[Yt]||(qt[Yt]={});var vn={};function gs(e){if(typeof vn[e]!==hn)return vn[e];try{var t=window[e];t.setItem(hn,hn),t.removeItem(hn)}catch{return vn[e]=!1}return vn[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 Xe="function",Ke="undefined",eE="@@redux/"+Math.random().toString(36),il=function(){return typeof Symbol===Xe&&Symbol.observable||"@@observable"}(),pn=" != "+Xe;function bh(e,t,r){var n;if(typeof t===Xe&&typeof r===Ke&&(r=t,t=void 0),typeof r!==Ke){if(typeof r!==Xe)throw new Error("enhancer"+pn);return r(bh)(e,t)}if(typeof e!==Xe)throw new Error("reducer"+pn);var a=e,o=t,i=[],s=i,l=!1;function f(){s===i&&(s=i.slice())}function u(){return o}function c(h){if(typeof h!==Xe)throw new Error("Listener"+pn);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(!ue(h))throw new Error("Act != obj");if(typeof h.type===Ke)throw new Error("ActType "+Ke);if(l)throw new Error("Dispatch in reducer");try{l=!0,o=a(o,h)}finally{l=!1}for(var v=i=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:u,replaceReducer:function(h){if(typeof h!==Xe)throw new Error("next reducer"+pn);a=h,d({type:"@@redux/INIT"})}})[il]=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(u())}return g(),{unsubscribe:v(g)}}})[il]=function(){return this},h},n}function tE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ke}function Xt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function rE(){var e=arguments;return function(t){return function(r,n,a){var o,i=t(r,n,a),s=i.dispatch,l={getState:i.getState,dispatch:function(f){return s(f)}};return o=[].slice.call(e).map(function(f){return f(l)}),j({},i,{dispatch:s=Xt.apply(void 0,o)(i.dispatch)})}}}var rt=mt+"anon_id",vt=mt+"user_id",Ft=mt+"user_traits",qe="userId",Dt="anonymousId",kn=["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"],wi=["name","EVENTS","config","loaded"],A=kn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),sl=/^utm_/,cl=/^an_prop_/,ul=/^an_trait_/;function nE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var o=a.params,i=a.user,s=a.persistedUser,l=a.initialUser,f=s.userId===i.userId;s.anonymousId!==i.anonymousId&&t(rt,i.anonymousId),f||t(vt,i.userId),l.traits&&t(Ft,j({},f&&s.traits?s.traits:{},l.traits));var u=Object.keys(a.params);if(u.length){var c=o.an_uid,d=o.an_event,h=u.reduce(function(v,b){if(b.match(sl)||b.match(/^(d|g)clid/)){var g=b.replace(sl,"");v.campaign[g==="campaign"?"name":g]=o[b]}return b.match(cl)&&(v.props[b.replace(cl,"")]=o[b]),b.match(ul)&&(v.traits[b.replace(ul,"")]=o[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:o},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 aE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===rt)return j({},t,{anonymousId:r.value});if(r.key===vt)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[vt,rt,Ft].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function ll(e){return{userId:e.getItem(vt),anonymousId:e.getItem(rt),traits:e.getItem(Ft)}}var bi=function(e){return mt+"TEMP"+mt+e};function oE(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(o){return function(i){return function(s){var l=s.userId,f=s.traits,u=s.options;if(s.type===A.reset&&([vt,Ft,rt].forEach(function(h){n(h)}),[qe,Dt,"traits"].forEach(function(h){ar(bi(h))})),s.type===A.identify){a(rt)||r(rt,ha());var c=a(vt),d=a(Ft)||{};c&&c!==l&&o.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:l,traits:f},options:u}),l&&r(vt,l),f&&r(Ft,j({},d,f))}return i(s)}}}}var br={};function fl(e,t){br[e]&&le(br[e])&&(br[e](t),delete br[e])}function Sh(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(o){return setTimeout(o,10)}).then(function(o){return Sh(e,t,r-10).then(n,a)})})}function iE(e){return{abort:e}}function $h(e,t,r){var n={},a=t(),o=e.getState(),i=o.plugins,s=o.queue,l=o.user;if(!o.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return i[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&&le(b)){var g,I=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[qe,Dt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,l),T=n[I.meta.rid];if(!T&&(g=b({payload:I,config:i[h].config,instance:r,abort:iE}))&&ue(g)&&g.abort)return void(n[I.meta.rid]=!0);if(!T){var y=v+":"+h;e.dispatch(j({},I,{type:y,_:{called:y,from:"queueDrain"}}))}}});var u=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=u}}}var Eo=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,o=e.allPlugins,i=e.allMatches,s=e.store,l=e.EVENTS;try{var f=a.plugins,u=a.context,c=r.type,d=c.match(Bt),h=t.exact.map(function(g){return g.pluginName});d&&(h=i.during.map(function(g){return g.pluginName}));var v=function(g,I){return function(T,y,p){var S=y.config,O=y.name,_=O+"."+T.type;p&&(_=p.event);var k=T.type.match(Bt)?function(M,F,X,L,N){return function(H,R){var Z=L?L.name:M,te=R&&Lr(R)?R:X;if(L&&(!(te=R&&Lr(R)?R:[M]).includes(M)||te.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(te)+" input valid");return j({},N,{abort:{reason:H,plugins:te,caller:F,_:Z}})}}(O,_,I,p,T):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(T,_);return{payload:sE(T),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,I){var T=I.pluginName,y=I.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[T].loaded),u.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+T]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,I,T){try{var y=I.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&&le(k.method)?(function(H,R){var Z=yl(H);if(Z&&Z.name===R){var te=yl(Z.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+Z.method+" "+(te?"or "+te.method:"")+" in "+R+" plugin insteadof "+H].join(`
36
+ `))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,N=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:N||L}})}),config:vl(k.pluginName,f,o),plugins:f})).then(function(H){var R=ue(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,N})}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(I,T,y){try{var p=t.exact.length===y+1,S=T.pluginName,O=o[S];return Promise.resolve(I).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),ko(k,S))return Oo({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(ko(_,S))return p&&Oo({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],o[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:vl(S,f,o),plugins:f})).then(function(F){var X=ue(F)?F:{},L=j({},_,X),N=g[S];if(ko(N,S))Oo({data:N,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(dl)&&!c.match(hl)&&n.dispatch(j({},d?L:k,{type:H,_:{called:H,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(I){if(!(c.match(Bt)||c.match(/^registerPlugin/)||c.match(hl)||c.match(dl)||c.match(/^params/)||c.match(/^userIdChanged/))){if(l.plugins.includes(c),I._&&I._.originalAction===c)return I;var T=j({},I,{_:{originalAction:I.type,called:I.type,from:"engineEnd"}});Ih(I,t.exact.length)&&!c.match(/End$/)&&(T=j({},T,{type:I.type+"Aborted"})),s.dispatch(T)}return I})})}catch(g){return Promise.reject(g)}},Bt=/Start$/,dl=/^bootstrap/,hl=/^ready/;function Oo(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function vl(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function pl(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function ml(e,t){var r=e.replace(Bt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function ko(e,t){var r=e.abort;return!!r&&(r===!0||gl(r,t)||r&&gl(r.plugins,t))}function Ih(e,t){var r=e.abort;if(!r)return!1;if(r===!0||tt(r))return!0;var n=r.plugins;return Lr(r)&&r.length===t||Lr(n)&&n.length===t}function Lr(e){return Array.isArray(e)}function gl(e,t){return!(!e||!Lr(e))&&e.includes(t)}function yl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function sE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ue(e[r])?Object.assign({},e[r]):e[r]),t},{})}function cE(e,t,r){var n={};return function(a){return function(o){return function(i){try{var s,l=function(p){return s?p:o(c)},f=i.type,u=i.plugins,c=i;if(i.abort)return Promise.resolve(o(i));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:i.meta}),f===A.disablePlugin&&setTimeout(function(){return fl(i.meta.rid,{payload:i})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return u.includes(p)}).map(function(p){return d[p]}),b=[],g=[],I=i.disabled,T=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return Sh(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!wi.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(T).then(function(p){var S={plugins:b,failed:g,disabled:I};setTimeout(function(){h.length===T.length+I.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return $h(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=le(S)?S():S,F=p.type,X=F.replace(Bt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),N=(Z=M,(te=L.plugins)===void 0&&(te={}),(Fe=p.options)===void 0&&(Fe={}),Object.keys(Z).filter(function(m){var w=Fe.plugins||{};return zP(w[m])?w[m]:w.all!==!1&&(!te[m]||te[m].enabled!==!1)}).map(function(m){return Z[m]}));F===A.initializeStart&&p.fromEnable&&(N=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 H=N.map(function(m){return m.name}),R=function(m,w,E){var U=ml(m).map(function(x){return pl(x,w)});return w.reduce(function(x,D){var Q=D.name,z=ml(m,Q).map(function($){return pl($,w)}),J=z[0],B=z[1],pe=z[2];return J.length&&(x.beforeNS[Q]=J),B.length&&(x.duringNS[Q]=B),pe.length&&(x.afterNS[Q]=pe),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(Eo({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 x=function(){if(F.match(Bt))return Promise.resolve(Eo({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&&fl(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return m}):m}if(Ih(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Eo({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(x){E=x});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var Z,te,Fe}(i,t,e,a,r)).then(function(p){return s=1,o(p)})}();return Promise.resolve(y&&y.then?y.then(l):l(y))}catch(p){return Promise.reject(p)}}}}}function uE(e){return function(t){return function(r){return function(n){var a=n.type,o=n.key,i=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(o,i,s):e.removeItem(o,s)}return r(n)}}}}var lE=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var o={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},i=e[t].map(function(s){return s(o)});return Xt.apply(void 0,i)(n)(a)}}}}};function fE(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=wl(r.type,"registerPlugin"),o=e()[a];if(!o||!a)return t;var i=r.enabled,s=o.config;return n[a]={enabled:i,initialized:!!i&&!o.initialize,loaded:!!i&&!!o.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=wl(r.type,A.initialize),f=e()[l];return f&&l?(n[l]=j({},t[l],{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,bl(r.plugins,!1,t));case A.enablePlugin:return j({},t,bl(r.plugins,!0,t));default:return t}}}function wl(e,t){return e.substring(t.length+1,e.length)}function bl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Th(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var dE={last:{},history:[]};function hE(e,t){e===void 0&&(e=dE);var r=t.options,n=t.meta;if(t.type===A.track){var a=Th(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 vE={actions:[]};function pE(e,t){e===void 0&&(e=vE);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 Ph=/#.*$/;function mE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Ph,""):"")}var Eh,Oh,kh,_h,gE=function(e){if(e===void 0&&(e={}),!re)return e;var t=document,r=t.title,n=t.referrer,a=window,o=a.location,i=a.innerWidth,s=a.innerHeight,l=o.hash,f=o.search,u=function(d){var h=function(){if(re){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(Ph,"")}(f),c={title:r,url:u,path:mE(u),hash:l,search:f,width:i,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},yE={last:{},history:[]};function wE(e,t){e===void 0&&(e=yE);var r=t.options;if(t.type===A.page){var n=Th(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}Eh=function(){if(!re)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"}(),Oh=re?document.referrer:null,kh=JP(),_h=YP();var Sl={initialized:!1,sessionId:ha(),app:null,version:null,debug:!1,offline:!!re&&!navigator.onLine,os:{name:Eh},userAgent:re?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:_h,locale:kh,campaign:{},referrer:Oh};function bE(e,t){e===void 0&&(e=Sl);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({},Sl,e,{initialized:!0})}}var SE=["plugins","reducers","storage"];function $E(e,t,r){if(re){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function IE(e){var t=$E.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Rh(){return yt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),o=a.dispatch;return Object.assign(a,{dispatch:function(i){return qt[Yt].analytics.push(i.action||i),o(i)}})}}}function $l(e){return function(){return Xt(Xt.apply(null,arguments),Rh())}}function _o(e){return e?yh(e)?e:[e]:[]}function Il(e,t,r){e===void 0&&(e={});var n,a,o=ha();return t&&(br[o]=(n=t,a=function(i){for(var s,l=i||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(le(l[f])){s=l[f];break}return s}(r),function(i){a&&a(i),n(i)})),j({},e,{rid:o,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function TE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(le(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 z;return D[Q]=(z=w.methods[Q],function(){for(var J=Array.prototype.slice.call(arguments),B=new Array(z.length),pe=0;pe<J.length;pe++)B[pe]=J[pe];return B[B.length]=S,z.apply({instance:S},B)}),D},{}),delete w.methods);var U=Object.keys(w).concat(E),x=new Set(m.events.concat(U));if(m.events=Array.from(x),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:gt,setItem:yt,removeItem:ar},o=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ue(U)&&U[w]?U[w]:ll(m)[w]||gt(bi(w))||null)}}(a),i=n.plugins,s=n.events.filter(function(m){return!wi.includes(m)}).sort(),l=new Set(s.concat(kn).filter(function(m){return!wi.includes(m)})),f=Array.from(l).sort(),u=function(){return i},c=new lE,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=qP(),I=ll(a),T=j({},I,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});T.anonymousId||(T.anonymousId=ha());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:_o(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:_o(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var x=tt(m)?m:null,D=ue(m)?m:w,Q=E||{},z=S.user();yt(bi(qe),x);var J=x||D.userId||o(qe,S,D);return Promise.resolve(new Promise(function(B){R.dispatch(j({type:A.identifyStart,userId:J,traits:D||{},options:Q,anonymousId:z.anonymousId},z.id&&z.id!==x&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var x=ue(m)?m.event:m;if(!x||!tt(x))throw new Error("EventMissing");var D=ue(m)?m:w||{},Q=ue(E)?E:{};return Promise.resolve(new Promise(function(z){R.dispatch({type:A.trackStart,event:x,properties:D,options:Q,userId:o(qe,S,w),anonymousId:o(Dt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ue(m)?m:{},x=ue(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:gE(U),options:x,userId:o(qe,S,U),anonymousId:o(Dt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===qe||m==="id")return o(qe,S);if(m===Dt||m==="anonId")return o(Dt,S);var w=S.getState("user");return m?nl(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||!le(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(z){return function(J){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:i}),J(B)}}},x=function(z){return function(J){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:i}),J(B)}}};return d(U,mn),d(x,gn),function(){h(U,mn),h(x,gn)}}var D=m.match(E)?mn:gn,Q=function(z){return function(J){return function(B){return B.type===m&&w({payload:B,instance:S,plugins:i,abort:b}),J(B)}}};return d(Q,D),function(){return h(Q,D)}},once:function(m,w){if(!m||!le(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:i,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?nl(w,m):Object.assign({},w)},dispatch:function(m){var w=tt(m)?{type:m}:m;if(kn.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(rt,m,w)},events:{core:kn,plugins:s}},O=n.middlewares.concat([function(m){return function(w){return function(E){return E.meta||(E.meta=Il()),w(E)}}},v(mn),cE(S,u,{all:f,plugins:s}),uE(a),nE(S),oE(S),v(gn)]),_={context:bE,user:aE(a),page:wE,track:hE,plugins:fE(u),queue:pE},k=Xt,M=Xt;if(re&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Rh():ue(typeof arguments[0])?$l():$l().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return SE.includes(E)||(w[E]=m[E]),w},{})}(e),N=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,x=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!x({config:U}),config:U},m},{}),H={context:L,user:T,plugins:N},R=bh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var x=w[U];typeof m[x]===Xe&&(E[x]=m[x])}var D,Q=Object.keys(E);try{(function(z){Object.keys(z).forEach(function(J){var B=z[J];if(typeof B(void 0,{type:"@@redux/INIT"})===Ke||typeof B(void 0,{type:eE})===Ke)throw new Error("reducer "+J+" "+Ke)})})(E)}catch(z){D=z}return function(z,J){if(z===void 0&&(z={}),D)throw D;for(var B=!1,pe={},$=0;$<Q.length;$++){var P=Q[$],C=z[P],W=(0,E[P])(C,J);if(typeof W===Ke){var V=tE(P,J);throw new Error(V)}pe[P]=W,B=B||W!==C}return B?pe:z}}(j({},_,t)),H,M(k(rE.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:Il(m.meta,w,_o(E))});return X.apply(null,[U])});var Z=Object.keys(i);R.dispatch({type:A.bootstrap,plugins:Z,config:L,params:g,user:T,initialUser:r,persistedUser:I});var te=Z.filter(function(m){return n.pluginEnabled[m]}),Fe=Z.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:Z,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,w){var E=m.bootstrap,U=m.config,x=m.name;E&&le(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:te,disabled:Fe})}),IE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return $h(m,w,E)},3e3)}(R,u,S),S}var mn="before",gn="after",kr="cookie",lt=jh(),Ch=va,PE=va;function Ah(e){return lt?va(e,"",-1):ar(e)}function jh(){if(lt!==void 0)return lt;var e="cookiecookie";try{va(e,e),lt=document.cookie.indexOf(e)!==-1,Ah(e)}catch{lt=!1}return lt}function va(e,t,r,n,a,o){if(typeof window<"u"){var i=arguments.length>1;return lt===!1&&(i?yt(e,t):gt(e)),i?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var _r="localStorage",EE=gs.bind(null,"localStorage");or("localStorage","getItem",gt);or("localStorage","setItem",yt);or("localStorage","removeItem",ar);var Rr="sessionStorage",OE=gs.bind(null,"sessionStorage");or("sessionStorage","getItem",gt);or("sessionStorage","setItem",yt);or("sessionStorage","removeItem",ar);function zt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ue(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var kE=EE(),_E=OE(),RE=jh();function Lh(e,t){if(e){var r=ys(t),n=!$s(r),a=ws(r)?zt(localStorage.getItem(e)):void 0;if(n&&!Nt(a))return a;var o=bs(r)?zt(Ch(e)):void 0;if(n&&o)return o;var i=Ss(r)?zt(sessionStorage.getItem(e)):void 0;if(n&&i)return i;var s=gt(e);return n?s:{localStorage:a,sessionStorage:i,cookie:o,global:s}}}function CE(e,t,r){if(e&&!Nt(t)){var n={},a=ys(r),o=JSON.stringify(t),i=!$s(a);return ws(a)&&(n[_r]=yn(_r,t,zt(localStorage.getItem(e))),localStorage.setItem(e,o),i)?n[_r]:bs(a)&&(n[kr]=yn(kr,t,zt(Ch(e))),PE(e,o),i)?n[kr]:Ss(a)&&(n[Rr]=yn(Rr,t,zt(sessionStorage.getItem(e))),sessionStorage.setItem(e,o),i)?n[Rr]:(n[Or]=yn(Or,t,gt(e)),yt(e,t),i?n[Or]:n)}}function AE(e,t){if(e){var r=ys(t),n=Lh(e,ph),a={};return!Nt(n.localStorage)&&ws(r)&&(localStorage.removeItem(e),a[_r]=n.localStorage),!Nt(n.cookie)&&bs(r)&&(Ah(e),a[kr]=n.cookie),!Nt(n.sessionStorage)&&Ss(r)&&(sessionStorage.removeItem(e),a[Rr]=n.sessionStorage),!Nt(n.global)&&pa(r,Or)&&(ar(e),a[Or]=n.global),a}}function ys(e){return e?tt(e)?e:e.storage:vh}function ws(e){return kE&&pa(e,_r)}function bs(e){return RE&&pa(e,kr)}function Ss(e){return _E&&pa(e,Rr)}function $s(e){return e===ph||e==="all"}function pa(e,t){return e===vh||e===t||$s(e)}function yn(e,t,r){return{location:e,current:t,previous:r}}var jE={setItem:CE,getItem:Lh,removeItem:AE};function LE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tl(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?Tl(Object(r),!0).forEach(function(n){LE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:jE};return TE(Pl(Pl({},t),e))}function xE(e,t){t=t||{};var r,n,a=[],o=t.max||1/0;function i(){clearInterval(r),e(a.splice(0,o)),s()}function s(){r=setInterval(i,t.interval||1e4)}return s(),{flush:i,push:function(l){return n=a.push(l),n>=o&&i(),n},size:function(){return a.length},end:function(l){l&&i(),clearInterval(r)}}}function NE(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(o=>{const i=`${o}State`;if(i!=="pushState"&&i!=="replaceState")return;const s=r[i];r[i]=function(...l){var c;const f=((c=l[2])==null?void 0:c.toString())||"",u=ME(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),s.apply(r,l)}})}function DE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function ME(e){return["#","?"].forEach(t=>e=DE(e,t)),e}function FE(){NE(()=>{He.page()})}function BE(e){if(e===void 0&&(e={}),!re)return yi;var t=Ol(),r=Si(),n=El(),a=wn(n,t),o=wn(r,t),i=[],s=[],l=[],f=n,u=a,c=o,d=Object.keys(e);if(!d.length)return yi;var h=d.map(function(b){return Number(b)}),v=QP(function(){var b=Ol(),g=function(L,N){return N.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),I=Si(),T=El(),y=wn(T,b),p=wn(I,b);if(u=y>u?y:u,c=p<c?p:c,!(i.length>=h.length)){var S=f===T,O="up";S?O="initial":f<=T&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,N,H){var R=_[H];return l.includes(N)&&T<=R&&(l=l.filter(function(Z){return Z!==N}),L.singleFunction=N),O==="down"&&!i.includes(N)&&T>=R&&N>o?(s.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!i.includes(N)&&T<=R&&N<=y?(L.foundFunc=[N],L):(S&&T>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!s.includes(N)&&T>=R&&(s.push(N),L.singleFunction?l.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=T,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){le(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:u,range:[c,u]}),i.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;le(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:u,range:[c,u]}),i.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function Si(){return re?document.body.scrollTop||document.documentElement.scrollTop:0}function zE(){return re?window.innerHeight||document.documentElement.clientHeight:0}function El(){return Math.round(Si()+zE())}function Ol(){if(!re)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function wn(e,t){return Math.round(e/t*100)}var kl="EventListener";function HE(e){return function(t,r,n,a){var o=n||yi,i=a||!1;if(!re)return o;var s=Gn(r),l=Gn(t,!0);if(!l.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function u(c){c&&(f=[]);for(var d=c?"add"+kl:"remove"+kl,h=0;h<l.length;h++){var v=l[h];f[h]=c?i&&i.once?GE(o):o:f[h]||o;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],i)}return u.bind(null,!c)}(e)}}function Gn(e,t){if(tt(e))return t?Gn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(i){return i.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var o=ZP(e);return t?o.map(function(i){return tt(i)?Gn(i,!0):i}).flat():o}function GE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ro=HE("Event");function Uh(e,t){return re&&le(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),le(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Uh.bind(null,"onerror");Uh.bind(null,"onload");var xh=typeof window>"u",_l="hidden";function KE(e){if(xh)return!1;var t=WE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function WE(){var e=["webkit","moz","ms","o"];return xh||_l in document?_l:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var VE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function ZE(e,t){t===void 0&&(t={});var r=function(i,s){var l=this,f=!1;return function(u){f||(i.call(l,u),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var i=KE(function(s){s||r({type:"tabVisible"})});return n=[i].concat(VE.map(function(s){return Ro(document,s,r)})).concat(Ro(window,"load",r)).concat(Ro(window,"scroll",r,{capture:!0,passive:!0})),o}function o(){n.map(function(i){return i()})}return a(),function(){return o(),a}}function JE(e){var t,r,n=e.onIdle,a=e.onWakeUp,o=e.onHeartbeat,i=e.timeout,s=i===void 0?1e4:i,l=e.throttle,f=l===void 0?2e3:l,u=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),o&&!u&&o(mr(d),g),a&&u&&(u=!1,a(mr(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(mr(d),g))},s)}var b=ZE(v,{throttle:f});return{disable:function(){c=!0,u=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:c,active:u?0:mr(d,c),idle:u?mr(r,c):0}}}}function mr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Rl=5e3;class YE{constructor(t){me(this,"element");me(this,"isInViewport",!1);me(this,"isAwake",!1);me(this,"isFlushing");me(this,"observer");me(this,"lastEventAt",Date.now());me(this,"registeredView",!1);me(this,"viewCallback");me(this,"activeDurationCallback");me(this,"idleDurationCallback");me(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),JE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Rl}),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*Rl: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 Cl="sesamy_session_id";function qE(){let e=sessionStorage.getItem(Cl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Cl,e)),e}let Nh=!1,$i,Al,Kn;const Dh=new Map;function XE({clientId:e,enabled:t=!0,environment:r}){if($i=e,Al=t,Kn=`${Ge("logs",r)}/events`,!Al)return;window.addEventListener("beforeunload",()=>{Fh.forEach((a,o)=>{a.bind(o)()}),eO()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Dh.forEach((a,o)=>{a.bind(o)()})}),FE();const n=new YE({element:document.body,viewCallback:()=>{He.page()},activeDurationCallback:(a,o,i)=>{He.track("activeDuration",{duration:a,durationStart:i,flushing:o})},idleDurationCallback:(a,o,i)=>{He.track("idleDuration",{duration:a,durationStart:i,flushing:o})},scrollCallback:a=>{He.track("scroll",{scroll:a.scrollMax})}});tO(document.body,()=>{n.flush()}),rO(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const o=a;await He.identify(o.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await He.track("logout",{}),Is.flush(),await He.reset()})}function Mh(e){return JSON.stringify(e.map(t=>({...t,clientId:$i,requestId:Math.random().toString(36).slice(2,9),sessionId:qE(),timestamp:new Date().toISOString(),version:ms,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:hh,userAgent:navigator.userAgent,clientId:$i}})))}const Is=xE(async e=>{if(e.length>0){const t=Mh(e);Nh?navigator.sendBeacon(Kn,t):(await fetch(Kn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Co(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Kn,Mh([r]))}else Is.push(e)}const He=UE({app:hh,version:ms,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Co({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Co({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Co({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function QE(e,t){He.track(e,t)}function eO(){return Nh=!0,Is.flush()}const Fh=new Map;function tO(e,t){Fh.set(e,t)}function rO(e,t){Dh.set(e,t)}const nO=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function aO(){return new Promise(e=>{const t=nO.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function oO(){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}}let Se={article:{selector:"article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"article",attribute:"data-price"},currency:{selector:"article",attribute:"data-currency"},url:{selector:"link",attribute:"href"},id:{selector:"article",attribute:"data-id"},pass:{selector:"article",attribute:"data-pass"}};function iO(e){var t;Se={...Se,...(t=e.content)==null?void 0:t.article}}function sO(e,t){const{selector:r}=t;return r===Se.article.selector?e:e.querySelector(r)}function Bh(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??Bh(e.parentElement,t):e.textContent??void 0}function Ao(e){var t,r;return((t=document.head.querySelector(`[property~='${e}'][content]`))==null?void 0:t.content)??((r=document.head.querySelector(`[name~='${e}'][content]`))==null?void 0:r.content)}function cO({publisherContentId:e,key:t,defaultValue:r=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null;return(n==null?void 0:n.getAttribute(t))||Ao(`sesamy:${t}`)||Ao(`og:${t}`)||Ao(t)||r}function uO(){const e=document.querySelectorAll(Se.article.selector);return Array.from(e).map(zh).filter(t=>t!==null)}function zh(e){const t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;const r={element:t},n=(a,o,i,s)=>{const l=sO(t,o);if(l){const f=Bh(l,o)||cO({publisherContentId:i,key:a});f!==void 0&&(r[a]=s?s(f):f)}};return n("id",Se.id),n("title",Se.title,r.id),n("excerpt",Se.excerpt,r.id),n("image",Se.image,r.id),n("price",Se.price,r.id,a=>parseFloat(a)),n("currency",Se.currency,r.id),n("url",Se.url,r.id),n("pass",Se.pass,r.id),r}function lO(e){const{autoOnboardProduct:t,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:o,deleteUserMetadata:i,generateLink:s,getBill:l,getBills:f,getCheckout:u,getContract:c,getContracts:d,getEntitlement:h,getEntitlementAccess:v,getEntitlements:b,getFulfillments:g,getPaywall:I,getPaymentIssues:T,getProfile:y,getProduct:p,getSubscriptions:S,getTags:O,getTally:_,getTallies:k,getTransaction:M,getTransactions:F,getUserMetadata:X,hasAccess:L,isSpotifyLinked:N,linkSpotify:H,listUserMetadata:R,openHostedAccountPage:Z,pushTally:te,setTag:Fe,setUserMetadata:m,unlinkSpotify:w,updateCheckout:E,updateProfile:U}=DP(e),x={analytics:{track:QE},attribution:{get:ps,set:dh},auth:{getUser:y,isAuthenticated:jr,loginWithRedirect:hs,logout:ah,setToken:ih},bills:{get:l,list:f},browser:{detectAdblock:aO,isInAppBrowser:oO,isIncognito:rh},checkouts:{create:n,get:u,update:E},clearCache:_e,content:{list:uO,get:zh},contracts:{cancel:r,get:c,list:d},entitlements:{access:v,get:h,hasAccess:L,list:b,signedLinks:vs},fulfillments:{list:g},generateLink:s,getPaymentIssues:T,getVersion:fO,log:Y,paywalls:{get:I},products:{autoOnboard:t,get:p,linkSpotify:H},profile:{get:y,isSpotifyLinked:N,openHostedAccountPage:Z,unlinkSpotify:w,update:U},subscriptions:{list:S},tags:{delete:a,list:O,set:Fe},tallies:{delete:o,get:_,list:k,push:te},transactions:{get:M,list:F},userMetadata:{delete:i,get:X,list:R,set:m}};return e.namespace&&(window[e.namespace]=x),x}function fO(){return ms}function dO(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 i of a){const s=i.offsetHeight;n+s>200?i.remove():n+=s}const o=document.createElement("style");o.innerHTML=`
37
37
  ${t.selector}::before {
38
38
  content: '';
39
39
  position: absolute;
@@ -44,4 +44,4 @@ CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw
44
44
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
45
45
  pointer-events: none;
46
46
  }
47
- `,document.head.appendChild(o)}async function zh(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 dO(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 zh(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 hO(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 zh(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 vO({enabled:e=!1,rules:t}){if(!e)return;const r=await jr(),n=window.location.href;for(const a of t){const o=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const i of o){const s=i;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await dO(s,a);break;case"replace":await hO(s,a);break;case"remove":i.remove();break;case"gradient":fO(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const Al="access_token";function pO(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(Al);if(t){oh(t);const r=new URL(window.location.href);e.delete(Al),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const jl="sesamy-refresh",Ll="force-refetch-entitlements";function mO(){const e=new URLSearchParams(window.location.search),t=e.get(Ll),r=e.get(jl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(Ll),e.delete(jl),n.search=e.toString(),_e(),window.history.replaceState(null,"",n)}}function gO(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function yO(){var n,a,o,i;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=gO(t),l=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:(o=s.pid)==null?void 0:o.toString(),url:(i=s.url)==null?void 0:i.toString(),token:t,type:"article",expiresAt:l.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};jP(f)}catch(s){q(`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 Ul="sesamy-user";async function wO(){var a;const t=(a=new URLSearchParams(window.location.search).get(Ul))==null?void 0:a.toLowerCase();if(!t)return;const r=await wP();(r==null?void 0:r.email)!==t?(q(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),_e(),ds({authorizationParams:{email_hint:t,login_hint:t}})):q(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(Ul),window.history.replaceState(null,"",n)}const xl="sesamy-purchase";function bO(){const e=new URLSearchParams(window.location.search),t=e.get(xl);if(t!==null){const r=new URL(window.location.href);e.delete(xl),r.search=e.toString(),q(`Purchase ${t}`),Ve(ve.PURCHASE,{itemSrc:t}),_e(),window.history.replaceState(null,"",r)}}const Nl="sesamy-login",SO="sesamy_login";async function $O(){const e=new URLSearchParams(window.location.search);if(!(e.get(Nl)||e.get(SO)))return;await jr()||ds();const n=new URL(window.location.href);n.searchParams.delete(Nl),window.history.replaceState(null,"",n)}const Dl="sesamy-debug";async function IO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Dl))==null?void 0:n.toLowerCase();if(!t)return;NT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Dl),window.history.replaceState(null,"",r)}function Wn(){return typeof window<"u"}function TO(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function PO(){if(!Wn())return;const e=new URLSearchParams(window.location.search),t={utmSource:e.get("utm_source")??void 0,utmMedium:e.get("utm_medium")??void 0,utmCampaign:e.get("utm_campaign")??void 0,utmTerm:e.get("utm_term")??void 0,utmContent:e.get("utm_content")??void 0,ref:e.get("ref")??void 0,referrer:TO()};fh(t)}async function Ml(e){q(`Init with config: ${JSON.stringify(e)}`);try{qE({clientId:e.clientId,environment:e.environment,...e.analytics}),await yP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),oO(e),e.transform&&await vO(e.transform),IO(),PO(),pO(),mO(),yO(),await $O(),await wO(),bO(),Ve(ve.READY,{})}catch(t){q(`Failed to init ${t.message}`)}}async function Hh(e){var n;q("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(Wn()&&t in window)return q("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=uO({clientId:e.clientId,environment:e.environment,...e.api});return Wn()&&(e.awaitAllServices?await Ml(e):Ml(e)),r}if(Wn()){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Hh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Hh;
47
+ `,document.head.appendChild(o)}async function Hh(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 hO(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 Hh(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 vO(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 Hh(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 pO({enabled:e=!1,rules:t}){if(!e)return;const r=await jr(),n=window.location.href;for(const a of t){const o=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const i of o){const s=i;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await hO(s,a);break;case"replace":await vO(s,a);break;case"remove":i.remove();break;case"gradient":dO(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const jl="access_token";function mO(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(jl);if(t){ih(t);const r=new URL(window.location.href);e.delete(jl),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const Ll="sesamy-refresh",Ul="force-refetch-entitlements";function gO(){const e=new URLSearchParams(window.location.search),t=e.get(Ul),r=e.get(Ll);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(Ul),e.delete(Ll),n.search=e.toString(),_e(),window.history.replaceState(null,"",n)}}function yO(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function wO(){var n,a,o,i;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=yO(t),l=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:(o=s.pid)==null?void 0:o.toString(),url:(i=s.url)==null?void 0:i.toString(),token:t,type:"article",expiresAt:l.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};LP(f)}catch(s){Y(`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 xl="sesamy-user";async function bO(){var a;const t=(a=new URLSearchParams(window.location.search).get(xl))==null?void 0:a.toLowerCase();if(!t)return;const r=await bP();(r==null?void 0:r.email)!==t?(Y(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),_e(),hs({authorizationParams:{email_hint:t,login_hint:t}})):Y(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(xl),window.history.replaceState(null,"",n)}const Nl="sesamy-purchase";function SO(){const e=new URLSearchParams(window.location.search),t=e.get(Nl);if(t!==null){const r=new URL(window.location.href);e.delete(Nl),r.search=e.toString(),Y(`Purchase ${t}`),Ve(ve.PURCHASE,{itemSrc:t}),_e(),window.history.replaceState(null,"",r)}}const Dl="sesamy-login",$O="sesamy_login";async function IO(){const e=new URLSearchParams(window.location.search);if(!(e.get(Dl)||e.get($O)))return;await jr()||hs();const n=new URL(window.location.href);n.searchParams.delete(Dl),window.history.replaceState(null,"",n)}const Ml="sesamy-debug";async function TO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Ml))==null?void 0:n.toLowerCase();if(!t)return;DT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Ml),window.history.replaceState(null,"",r)}function Wn(){return typeof window<"u"}function PO(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function EO(){if(!Wn())return;const e=new URLSearchParams(window.location.search),t={utmSource:e.get("utm_source")??void 0,utmMedium:e.get("utm_medium")??void 0,utmCampaign:e.get("utm_campaign")??void 0,utmTerm:e.get("utm_term")??void 0,utmContent:e.get("utm_content")??void 0,ref:e.get("ref")??void 0,referrer:PO()};dh(t)}function OO(){sessionStorage.getItem(di)==="true"&&(sessionStorage.removeItem(di),window.location.search.includes("code=")||(Y("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Fl(e){Y(`Init with config: ${JSON.stringify(e)}`);try{OO(),XE({clientId:e.clientId,environment:e.environment,...e.analytics}),await wP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),iO(e),e.transform&&await pO(e.transform),TO(),EO(),mO(),gO(),wO(),await IO(),await bO(),SO(),Ve(ve.READY,{})}catch(t){Y(`Failed to init ${t.message}`)}}async function Gh(e){var n;Y("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(Wn()&&t in window)return Y("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=lO({clientId:e.clientId,environment:e.environment,...e.api});return Wn()&&(e.awaitAllServices?await Fl(e):Fl(e)),r}if(Wn()){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Gh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Gh;