@sesamy/sesamy-js 1.25.0 → 1.25.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.
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +409 -408
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Fh=Object.defineProperty;var Bh=(e,t,r)=>t in e?Fh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Bh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},re=function(e){try{return!!e()}catch{return!0}},zh=re,Wn=!zh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Nl=Wn,xl=Function.prototype,Ri=xl.call,Hh=Nl&&xl.bind.bind(Ri,Ri),K=Nl?Hh:function(e){return function(){return Ri.apply(e,arguments)}},Dl=K,Kh=Dl({}.toString),Gh=Dl("".slice),Vn=function(e){return Gh(Kh(e),8,-1)},Wh=K,Vh=re,Zh=Vn,pa=Object,Jh=Wh("".split),Ml=Vh(function(){return!pa("z").propertyIsEnumerable(0)})?function(e){return Zh(e)==="String"?Jh(e,""):pa(e)}:pa,Zn=function(e){return e==null},Yh=Zn,Xh=TypeError,Jn=function(e){if(Yh(e))throw new Xh("Can't call method on "+e);return e},qh=Ml,Qh=Jn,Ur=function(e){return qh(Qh(e))},sr=function(e){return e&&e.Math===Math&&e},G=sr(typeof globalThis=="object"&&globalThis)||sr(typeof window=="object"&&window)||sr(typeof self=="object"&&self)||sr(typeof Gr=="object"&&Gr)||sr(typeof Gr=="object"&&Gr)||function(){return this}()||Function("return this")(),Fl={exports:{}},ev=!1,ws=G,tv=Object.defineProperty,bo=function(e,t){try{tv(ws,e,{value:t,configurable:!0,writable:!0})}catch{ws[e]=t}return t},rv=G,nv=bo,bs="__core-js_shared__",Ss=Fl.exports=rv[bs]||nv(bs,{});(Ss.versions||(Ss.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 So=Fl.exports,$s=So,Bl=function(e,t){return $s[e]||($s[e]=t||{})},av=Jn,iv=Object,Yn=function(e){return iv(av(e))},ov=K,sv=Yn,cv=ov({}.hasOwnProperty),$e=Object.hasOwn||function(t,r){return cv(sv(t),r)},uv=K,lv=0,fv=Math.random(),dv=uv(1 .toString),zl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+dv(++lv+fv,36)},hv=G,Is=hv.navigator,Ts=Is&&Is.userAgent,Nr=Ts?String(Ts):"",Hl=G,ma=Nr,Ps=Hl.process,Es=Hl.Deno,Os=Ps&&Ps.versions||Es&&Es.version,ks=Os&&Os.v8,Re,_n;ks&&(Re=ks.split("."),_n=Re[0]>0&&Re[0]<4?1:+(Re[0]+Re[1]));!_n&&ma&&(Re=ma.match(/Edge\/(\d+)/),(!Re||Re[1]>=74)&&(Re=ma.match(/Chrome\/(\d+)/),Re&&(_n=+Re[1])));var Kl=_n,_s=Kl,vv=re,pv=G,mv=pv.String,Gl=!!Object.getOwnPropertySymbols&&!vv(function(){var e=Symbol("symbol detection");return!mv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_s&&_s<41}),gv=Gl,Wl=gv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yv=G,wv=Bl,Rs=$e,bv=zl,Sv=Gl,$v=Wl,Lt=yv.Symbol,ga=wv("wks"),Iv=$v?Lt.for||Lt:Lt&&Lt.withoutSetter||bv,ne=function(e){return Rs(ga,e)||(ga[e]=Sv&&Rs(Lt,e)?Lt[e]:Iv("Symbol."+e)),ga[e]},ya=typeof document=="object"&&document.all,Y=typeof ya>"u"&&ya!==void 0?function(e){return typeof e=="function"||e===ya}:function(e){return typeof e=="function"},Tv=Y,Ie=function(e){return typeof e=="object"?e!==null:Tv(e)},Pv=Ie,Ev=String,Ov=TypeError,je=function(e){if(Pv(e))return e;throw new Ov(Ev(e)+" is not an object")},Vl={},kv=re,ae=!kv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),_v=ae,Rv=re,Zl=_v&&Rv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),De={},Cv=G,Cs=Ie,Ci=Cv.document,Av=Cs(Ci)&&Cs(Ci.createElement),Xn=function(e){return Av?Ci.createElement(e):{}},jv=ae,Lv=re,Uv=Xn,Jl=!jv&&!Lv(function(){return Object.defineProperty(Uv("div"),"a",{get:function(){return 7}}).a!==7}),Nv=Wn,Wr=Function.prototype.call,ie=Nv?Wr.bind(Wr):function(){return Wr.apply(Wr,arguments)},wa=G,xv=Y,Dv=function(e){return xv(e)?e:void 0},Te=function(e,t){return arguments.length<2?Dv(wa[e]):wa[e]&&wa[e][t]},Mv=K,qn=Mv({}.isPrototypeOf),Fv=Te,Bv=Y,zv=qn,Hv=Wl,Kv=Object,Yl=Hv?function(e){return typeof e=="symbol"}:function(e){var t=Fv("Symbol");return Bv(t)&&zv(t.prototype,Kv(e))},Gv=String,Qn=function(e){try{return Gv(e)}catch{return"Object"}},Wv=Y,Vv=Qn,Zv=TypeError,Le=function(e){if(Wv(e))return e;throw new Zv(Vv(e)+" is not a function")},Jv=Le,Yv=Zn,$o=function(e,t){var r=e[t];return Yv(r)?void 0:Jv(r)},ba=ie,Sa=Y,$a=Ie,Xv=TypeError,qv=function(e,t){var r,n;if(t==="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e))||Sa(r=e.valueOf)&&!$a(n=ba(r,e))||t!=="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e)))return n;throw new Xv("Can't convert object to primitive value")},Qv=ie,As=Ie,js=Yl,ep=$o,tp=qv,rp=ne,np=TypeError,ap=rp("toPrimitive"),ip=function(e,t){if(!As(e)||js(e))return e;var r=ep(e,ap),n;if(r){if(t===void 0&&(t="default"),n=Qv(r,e,t),!As(n)||js(n))return n;throw new np("Can't convert object to primitive value")}return t===void 0&&(t="number"),tp(e,t)},op=ip,sp=Yl,Xl=function(e){var t=op(e,"string");return sp(t)?t:t+""},cp=ae,up=Jl,lp=Zl,Vr=je,Ls=Xl,fp=TypeError,Ia=Object.defineProperty,dp=Object.getOwnPropertyDescriptor,Ta="enumerable",Pa="configurable",Ea="writable";De.f=cp?lp?function(t,r,n){if(Vr(t),r=Ls(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ea in n&&!n[Ea]){var a=dp(t,r);a&&a[Ea]&&(t[r]=n.value,n={configurable:Pa in n?n[Pa]:a[Pa],enumerable:Ta in n?n[Ta]:a[Ta],writable:!1})}return Ia(t,r,n)}:Ia:function(t,r,n){if(Vr(t),r=Ls(r),Vr(n),up)try{return Ia(t,r,n)}catch{}if("get"in n||"set"in n)throw new fp("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var hp=Math.ceil,vp=Math.floor,pp=Math.trunc||function(t){var r=+t;return(r>0?vp:hp)(r)},mp=pp,Io=function(e){var t=+e;return t!==t||t===0?0:mp(t)},gp=Io,yp=Math.max,wp=Math.min,ql=function(e,t){var r=gp(e);return r<0?yp(r+t,0):wp(r,t)},bp=Io,Sp=Math.min,$p=function(e){var t=bp(e);return t>0?Sp(t,9007199254740991):0},Ip=$p,To=function(e){return Ip(e.length)},Tp=Ur,Pp=ql,Ep=To,Us=function(e){return function(t,r,n){var a=Tp(t),i=Ep(a);if(i===0)return!e&&-1;var o=Pp(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},Op={includes:Us(!0),indexOf:Us(!1)},Po={},kp=K,Oa=$e,_p=Ur,Rp=Op.indexOf,Cp=Po,Ns=kp([].push),Ql=function(e,t){var r=_p(e),n=0,a=[],i;for(i in r)!Oa(Cp,i)&&Oa(r,i)&&Ns(a,i);for(;t.length>n;)Oa(r,i=t[n++])&&(~Rp(a,i)||Ns(a,i));return a},Eo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ap=Ql,jp=Eo,ef=Object.keys||function(t){return Ap(t,jp)},Lp=ae,Up=Zl,Np=De,xp=je,Dp=Ur,Mp=ef;Vl.f=Lp&&!Up?Object.defineProperties:function(t,r){xp(t);for(var n=Dp(r),a=Mp(r),i=a.length,o=0,s;i>o;)Np.f(t,s=a[o++],n[s]);return t};var Fp=Te,tf=Fp("document","documentElement"),Bp=Bl,zp=zl,xs=Bp("keys"),Oo=function(e){return xs[e]||(xs[e]=zp(e))},Hp=je,Kp=Vl,Ds=Eo,Gp=Po,Wp=tf,Vp=Xn,Zp=Oo,Ms=">",Fs="<",Ai="prototype",ji="script",rf=Zp("IE_PROTO"),ka=function(){},nf=function(e){return Fs+ji+Ms+e+Fs+"/"+ji+Ms},Bs=function(e){e.write(nf("")),e.close();var t=e.parentWindow.Object;return e=null,t},Jp=function(){var e=Vp("iframe"),t="java"+ji+":",r;return e.style.display="none",Wp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(nf("document.F=Object")),r.close(),r.F},Zr,bn=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}bn=typeof document<"u"?document.domain&&Zr?Bs(Zr):Jp():Bs(Zr);for(var e=Ds.length;e--;)delete bn[Ai][Ds[e]];return bn()};Gp[rf]=!0;var ea=Object.create||function(t,r){var n;return t!==null?(ka[Ai]=Hp(t),n=new ka,ka[Ai]=null,n[rf]=t):n=bn(),r===void 0?n:Kp.f(n,r)},Yp=ne,Xp=ea,qp=De.f,Li=Yp("unscopables"),Ui=Array.prototype;Ui[Li]===void 0&&qp(Ui,Li,{configurable:!0,value:Xp(null)});var Qp=function(e){Ui[Li][e]=!0},xr={},em=G,tm=Y,zs=em.WeakMap,rm=tm(zs)&&/native code/.test(String(zs)),wt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},nm=ae,am=De,im=wt,bt=nm?function(e,t,r){return am.f(e,t,im(1,r))}:function(e,t,r){return e[t]=r,e},om=rm,af=G,sm=Ie,cm=bt,_a=$e,Ra=So,um=Oo,lm=Po,Hs="Object already initialized",Ni=af.TypeError,fm=af.WeakMap,Rn,Cr,Cn,dm=function(e){return Cn(e)?Cr(e):Rn(e,{})},hm=function(e){return function(t){var r;if(!sm(t)||(r=Cr(t)).type!==e)throw new Ni("Incompatible receiver, "+e+" required");return r}};if(om||Ra.state){var Ue=Ra.state||(Ra.state=new fm);Ue.get=Ue.get,Ue.has=Ue.has,Ue.set=Ue.set,Rn=function(e,t){if(Ue.has(e))throw new Ni(Hs);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=um("state");lm[Tt]=!0,Rn=function(e,t){if(_a(e,Tt))throw new Ni(Hs);return t.facade=e,cm(e,Tt,t),t},Cr=function(e){return _a(e,Tt)?e[Tt]:{}},Cn=function(e){return _a(e,Tt)}}var Qt={set:Rn,get:Cr,has:Cn,enforce:dm,getterFor:hm},ko={},_o={},of={}.propertyIsEnumerable,sf=Object.getOwnPropertyDescriptor,vm=sf&&!of.call({1:2},1);_o.f=vm?function(t){var r=sf(this,t);return!!r&&r.enumerable}:of;var pm=ae,mm=ie,gm=_o,ym=wt,wm=Ur,bm=Xl,Sm=$e,$m=Jl,Ks=Object.getOwnPropertyDescriptor;ko.f=pm?Ks:function(t,r){if(t=wm(t),r=bm(r),$m)try{return Ks(t,r)}catch{}if(Sm(t,r))return ym(!mm(gm.f,t,r),t[r])};var cf={exports:{}},xi=ae,Im=$e,uf=Function.prototype,Tm=xi&&Object.getOwnPropertyDescriptor,Ro=Im(uf,"name"),Pm=Ro&&(function(){}).name==="something",Em=Ro&&(!xi||xi&&Tm(uf,"name").configurable),lf={EXISTS:Ro,PROPER:Pm,CONFIGURABLE:Em},Om=K,km=Y,Di=So,_m=Om(Function.toString);km(Di.inspectSource)||(Di.inspectSource=function(e){return _m(e)});var Co=Di.inspectSource,Ao=K,Rm=re,Cm=Y,Jr=$e,Mi=ae,Am=lf.CONFIGURABLE,jm=Co,ff=Qt,Lm=ff.enforce,Um=ff.get,Gs=String,Sn=Object.defineProperty,Nm=Ao("".slice),xm=Ao("".replace),Dm=Ao([].join),Mm=Mi&&!Rm(function(){return Sn(function(){},"length",{value:8}).length!==8}),Fm=String(String).split("String"),Bm=cf.exports=function(e,t,r){Nm(Gs(t),0,7)==="Symbol("&&(t="["+xm(Gs(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||Am&&e.name!==t)&&(Mi?Sn(e,"name",{value:t,configurable:!0}):e.name=t),Mm&&r&&Jr(r,"arity")&&e.length!==r.arity&&Sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?Mi&&Sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Lm(e);return Jr(n,"source")||(n.source=Dm(Fm,typeof t=="string"?t:"")),e};Function.prototype.toString=Bm(function(){return Cm(this)&&Um(this).source||jm(this)},"toString");var df=cf.exports,zm=Y,Hm=De,Km=df,Gm=bo,Pe=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(zm(r)&&Km(r,i,n),n.global)a?e[t]=r:Gm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Hm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},hf={},Wm=Ql,Vm=Eo,Zm=Vm.concat("length","prototype");hf.f=Object.getOwnPropertyNames||function(t){return Wm(t,Zm)};var jo={};jo.f=Object.getOwnPropertySymbols;var Jm=Te,Ym=K,Xm=hf,qm=jo,Qm=je,eg=Ym([].concat),tg=Jm("Reflect","ownKeys")||function(t){var r=Xm.f(Qm(t)),n=qm.f;return n?eg(r,n(t)):r},Ws=$e,rg=tg,ng=ko,ag=De,vf=function(e,t,r){for(var n=rg(t),a=ag.f,i=ng.f,o=0;o<n.length;o++){var s=n[o];!Ws(e,s)&&!(r&&Ws(r,s))&&a(e,s,i(t,s))}},ig=re,og=Y,sg=/#|\.prototype\./,Dr=function(e,t){var r=ug[cg(e)];return r===fg?!0:r===lg?!1:og(t)?ig(t):!!t},cg=Dr.normalize=function(e){return String(e).replace(sg,".").toLowerCase()},ug=Dr.data={},lg=Dr.NATIVE="N",fg=Dr.POLYFILL="P",pf=Dr,Yr=G,dg=ko.f,hg=bt,vg=Pe,pg=bo,mg=vf,gg=pf,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Yr:a?o=Yr[r]||pg(r,{}):o=Yr[r]&&Yr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=dg(o,s),u=l&&l.value):u=o[s],i=gg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;mg(f,u)}(e.sham||u&&u.sham)&&hg(f,"sham",!0),vg(o,s,f,e)}},yg=re,wg=!yg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bg=$e,Sg=Y,$g=Yn,Ig=Oo,Tg=wg,Vs=Ig("IE_PROTO"),Fi=Object,Pg=Fi.prototype,Lo=Tg?Fi.getPrototypeOf:function(e){var t=$g(e);if(bg(t,Vs))return t[Vs];var r=t.constructor;return Sg(r)&&t instanceof r?r.prototype:t instanceof Fi?Pg:null},Eg=re,Og=Y,kg=Ie,Zs=Lo,_g=Pe,Rg=ne,Bi=Rg("iterator"),mf=!1,pt,Ca,Aa;[].keys&&(Aa=[].keys(),"next"in Aa?(Ca=Zs(Zs(Aa)),Ca!==Object.prototype&&(pt=Ca)):mf=!0);var Cg=!kg(pt)||Eg(function(){var e={};return pt[Bi].call(e)!==e});Cg&&(pt={});Og(pt[Bi])||_g(pt,Bi,function(){return this});var gf={IteratorPrototype:pt,BUGGY_SAFARI_ITERATORS:mf},Ag=De.f,jg=$e,Lg=ne,Js=Lg("toStringTag"),er=function(e,t,r){e&&!r&&(e=e.prototype),e&&!jg(e,Js)&&Ag(e,Js,{configurable:!0,value:t})},Ug=gf.IteratorPrototype,Ng=ea,xg=wt,Dg=er,Mg=xr,Fg=function(){return this},yf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Ng(Ug,{next:xg(+!n,r)}),Dg(e,a,!1),Mg[a]=Fg,e},Bg=K,zg=Le,Hg=function(e,t,r){try{return Bg(zg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Kg=Ie,Gg=function(e){return Kg(e)||e===null},Wg=Gg,Vg=String,Zg=TypeError,Jg=function(e){if(Wg(e))return e;throw new Zg("Can't set "+Vg(e)+" as a prototype")},Yg=Hg,Xg=Ie,qg=Jn,Qg=Jg,Uo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Yg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return qg(a),Qg(i),Xg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),ey=Q,ty=ie,wf=lf,ry=Y,ny=yf,Ys=Lo,Xs=Uo,ay=er,iy=bt,ja=Pe,oy=ne,sy=xr,bf=gf,cy=wf.PROPER,uy=wf.CONFIGURABLE,qs=bf.IteratorPrototype,Xr=bf.BUGGY_SAFARI_ITERATORS,cr=oy("iterator"),Qs="keys",ur="values",ec="entries",ly=function(){return this},Sf=function(e,t,r,n,a,i,o){ny(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Xr&&T&&T in l)return l[T];switch(T){case Qs:return function(){return new r(this,T)};case ur:return function(){return new r(this,T)};case ec:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[cr]||l["@@iterator"]||a&&l[a],d=!Xr&&c||s(a),h=t==="Array"&&l.entries||c,v,b,g;if(h&&(v=Ys(h.call(new e)),v!==Object.prototype&&v.next&&(Ys(v)!==qs&&(Xs?Xs(v,qs):ry(v[cr])||ja(v,cr,ly)),ay(v,u,!0))),cy&&a===ur&&c&&c.name!==ur&&(uy?iy(l,"name",ur):(f=!0,d=function(){return ty(c,this)})),a)if(b={values:s(ur),keys:i?d:s(Qs),entries:s(ec)},o)for(g in b)(Xr||f||!(g in l))&&ja(l,g,b[g]);else ey({target:t,proto:!0,forced:Xr||f},b);return l[cr]!==d&&ja(l,cr,d,{name:a}),sy[t]=d,b},No=function(e,t){return{value:e,done:t}},fy=Ur,xo=Qp,tc=xr,$f=Qt,dy=De.f,hy=Sf,qr=No,vy=ae,If="Array Iterator",py=$f.set,my=$f.getterFor(If),gy=hy(Array,"Array",function(e,t){py(this,{type:If,target:fy(e),index:0,kind:t})},function(){var e=my(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,qr(void 0,!0);switch(e.kind){case"keys":return qr(r,!1);case"values":return qr(t[r],!1)}return qr([r,t[r]],!1)},"values"),rc=tc.Arguments=tc.Array;xo("keys");xo("values");xo("entries");if(vy&&rc.name!=="values")try{dy(rc,"name",{value:"values"})}catch{}var yy=Q,wy=K,by=ql,Sy=RangeError,nc=String.fromCharCode,ac=String.fromCodePoint,$y=wy([].join),Iy=!!ac&&ac.length!==1;yy({target:"String",stat:!0,arity:1,forced:Iy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],by(i,1114111)!==i)throw new Sy(i+" is not a valid code point");r[a]=i<65536?nc(i):nc(((i-=65536)>>10)+55296,i%1024+56320)}return $y(r,"")}});var ic=G,Ty=ae,Py=Object.getOwnPropertyDescriptor,Tf=function(e){if(!Ty)return ic[e];var t=Py(ic,e);return t&&t.value},Ey=re,Oy=ne,ky=ae,oc=ev,_y=Oy("iterator"),ta=!Ey(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),oc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(oc||!ky)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[_y]||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"}),sc=df,Ry=De,ra=function(e,t,r){return r.get&&sc(r.get,t,{getter:!0}),r.set&&sc(r.set,t,{setter:!0}),Ry.f(e,t,r)},Cy=Pe,Ay=function(e,t,r){for(var n in t)Cy(e,n,t[n],r);return e},jy=qn,Ly=TypeError,Do=function(e,t){if(jy(t,e))return e;throw new Ly("Incorrect invocation")},Uy=Vn,Ny=K,xy=function(e){if(Uy(e)==="Function")return Ny(e)},cc=xy,Dy=Le,My=Wn,Fy=cc(cc.bind),tr=function(e,t){return Dy(e),t===void 0?e:My?Fy(e,t):function(){return e.apply(t,arguments)}},By=ne,zy=By("toStringTag"),Pf={};Pf[zy]="z";var Mo=String(Pf)==="[object z]",Hy=Mo,Ky=Y,$n=Vn,Gy=ne,Wy=Gy("toStringTag"),Vy=Object,Zy=$n(function(){return arguments}())==="Arguments",Jy=function(e,t){try{return e[t]}catch{}},Mr=Hy?$n:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Jy(t=Vy(e),Wy))=="string"?r:Zy?$n(t):(n=$n(t))==="Object"&&Ky(t.callee)?"Arguments":n},Yy=Mr,Xy=String,Ze=function(e){if(Yy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Xy(e)},qy=Mr,uc=$o,Qy=Zn,ew=xr,tw=ne,rw=tw("iterator"),na=function(e){if(!Qy(e))return uc(e,rw)||uc(e,"@@iterator")||ew[qy(e)]},nw=ie,aw=Le,iw=je,ow=Qn,sw=na,cw=TypeError,Fo=function(e,t){var r=arguments.length<2?sw(e):t;if(aw(r))return iw(nw(r,e));throw new cw(ow(e)+" is not iterable")},uw=TypeError,St=function(e,t){if(e<t)throw new uw("Not enough arguments");return e},lw=K,aa=lw([].slice),lc=aa,fw=Math.floor,zi=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=fw(r/2),s=zi(lc(e,0,o),t),u=zi(lc(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},dw=zi,Hi=Q,Ef=G,Bo=Tf,hw=Te,Qr=ie,Ae=K,Sr=ae,Of=ta,kf=Pe,vw=ra,pw=Ay,mw=er,gw=yf,zo=Qt,_f=Do,La=Y,yw=$e,ww=tr,bw=Mr,Sw=je,Rf=Ie,se=Ze,$w=ea,fc=wt,dc=Fo,Iw=na,en=No,Pt=St,Tw=ne,Pw=dw,Ew=Tw("iterator"),rr="URLSearchParams",Cf=rr+"Iterator",Af=zo.set,be=zo.getterFor(rr),Ow=zo.getterFor(Cf),hc=Bo("fetch"),An=Bo("Request"),$r=Bo("Headers"),Ua=An&&An.prototype,vc=$r&&$r.prototype,kw=Ef.TypeError,_w=Ef.encodeURIComponent,Rw=String.fromCharCode,Cw=hw("String","fromCodePoint"),Aw=parseInt,In=Ae("".charAt),pc=Ae([].join),Qe=Ae([].push),jf=Ae("".replace),jw=Ae([].shift),mc=Ae([].splice),gc=Ae("".split),Lf=Ae("".slice),Lw=Ae(/./.exec),Uw=/\+/g,Na="�",Nw=/^[0-9a-f]+$/i,yc=function(e,t){var r=Lf(e,t,t+2);return Lw(Nw,r)?Aw(r,16):NaN},xw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Dw=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},wc=function(e){e=jf(e,Uw," ");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 i=yc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=xw(i);if(o===0)a=Rw(i);else{if(o===1||o>4){r+=Na,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||In(e,n)!=="%"));){var f=yc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Qe(s,f),n+=2,u++}if(s.length!==o){r+=Na;continue}var l=Dw(s);l===null?r+=Na:a=Cw(l)}}r+=a,n++}return r},Mw=/[!'()~]|%20/g,Fw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Bw=function(e){return Fw[e]},bc=function(e){return jf(_w(e),Mw,Bw)},xa=gw(function(t,r){Af(this,{type:Cf,target:be(t).entries,index:0,kind:r})},rr,function(){var t=Ow(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),Uf=function(e){this.entries=[],this.url=null,e!==void 0&&(Rf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?In(e,0)==="?"?Lf(e,1):e:se(e)))};Uf.prototype={type:rr,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Iw(e),n,a,i,o,s,u,f;if(r)for(n=dc(e,r),a=n.next;!(i=Qr(a,n)).done;){if(o=dc(Sw(i.value)),s=o.next,(u=Qr(s,o)).done||(f=Qr(s,o)).done||!Qr(s,o).done)throw new kw("Expected sequence with length 2");Qe(t,{key:se(u.value),value:se(f.value)})}else for(var l in e)yw(e,l)&&Qe(t,{key:l,value:se(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=gc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=gc(a,"="),Qe(t,{key:wc(jw(i)),value:wc(pc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Qe(t,bc(n.key)+"="+bc(n.value));return pc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ia=function(){_f(this,Ht);var t=arguments.length>0?arguments[0]:void 0,r=Af(this,new Uf(t));Sr||(this.size=r.entries.length)},Ht=ia.prototype;pw(Ht,{append:function(t,r){var n=be(this);Pt(arguments.length,2),Qe(n.entries,{key:se(t),value:se(r)}),Sr||this.length++,n.updateURL()},delete:function(e){for(var t=be(this),r=Pt(arguments.length,1),n=t.entries,a=se(e),i=r<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(mc(n,s,1),o!==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=se(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=se(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Qe(a,r[i].value);return a},has:function(t){for(var r=be(this).entries,n=Pt(arguments.length,1),a=se(t),i=n<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=be(this);Pt(arguments.length,1);for(var a=n.entries,i=!1,o=se(t),s=se(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?mc(a,u--,1):(i=!0,f.value=s));i||Qe(a,{key:o,value:s}),Sr||(this.size=a.length),n.updateURL()},sort:function(){var t=be(this);Pw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=be(this).entries,n=ww(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new xa(this,"keys")},values:function(){return new xa(this,"values")},entries:function(){return new xa(this,"entries")}},{enumerable:!0});kf(Ht,Ew,Ht.entries,{name:"entries"});kf(Ht,"toString",function(){return be(this).serialize()},{enumerable:!0});Sr&&vw(Ht,"size",{get:function(){return be(this).entries.length},configurable:!0,enumerable:!0});mw(ia,rr);Hi({global:!0,constructor:!0,forced:!Of},{URLSearchParams:ia});if(!Of&&La($r)){var zw=Ae(vc.has),Hw=Ae(vc.set),Sc=function(e){if(Rf(e)){var t=e.body,r;if(bw(t)===rr)return r=e.headers?new $r(e.headers):new $r,zw(r,"content-type")||Hw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),$w(e,{body:fc(0,se(t)),headers:fc(0,r)})}return e};if(La(hc)&&Hi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return hc(t,arguments.length>1?Sc(arguments[1]):{})}}),La(An)){var Da=function(t){return _f(this,Ua),new An(t,arguments.length>1?Sc(arguments[1]):{})};Ua.constructor=Da,Da.prototype=Ua,Hi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Da})}}var Kw={URLSearchParams:ia,getState:be},Gw=Pe,oa=K,$c=Ze,Ww=St,Nf=URLSearchParams,sa=Nf.prototype,Vw=oa(sa.append),Ic=oa(sa.delete),Zw=oa(sa.forEach),Jw=oa([].push),Ho=new Nf("a=1&a=2&b=3");Ho.delete("a",1);Ho.delete("b",void 0);Ho+""!="a=2"&&Gw(sa,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Ic(this,e);var n=[];Zw(this,function(c,d){Jw(n,{key:d,value:c})}),Ww(t,1);for(var a=$c(e),i=$c(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,Ic(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Vw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Yw=Pe,xf=K,Xw=Ze,qw=St,Df=URLSearchParams,Ko=Df.prototype,Qw=xf(Ko.getAll),eb=xf(Ko.has),Tc=new Df("a=1");(Tc.has("a",2)||!Tc.has("a",void 0))&&Yw(Ko,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return eb(this,t);var a=Qw(this,t);qw(r,1);for(var i=Xw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var tb=ae,rb=K,nb=ra,Ki=URLSearchParams.prototype,ab=rb(Ki.forEach);tb&&!("size"in Ki)&&nb(Ki,"size",{get:function(){var t=0;return ab(this,function(){t++}),t},configurable:!0,enumerable:!0});var ib=G,Go=ib,ob=Go;ob.URLSearchParams;var Wo=K,sb=Io,cb=Ze,ub=Jn,lb=Wo("".charAt),Pc=Wo("".charCodeAt),fb=Wo("".slice),Ec=function(e){return function(t,r){var n=cb(ub(t)),a=sb(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=Pc(n,a),o<55296||o>56319||a+1===i||(s=Pc(n,a+1))<56320||s>57343?e?lb(n,a):o:e?fb(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},Mf={codeAt:Ec(!1),charAt:Ec(!0)},db=Mf.charAt,hb=Ze,Ff=Qt,vb=Sf,Oc=No,Bf="String Iterator",pb=Ff.set,mb=Ff.getterFor(Bf);vb(String,"String",function(e){pb(this,{type:Bf,string:hb(e),index:0})},function(){var t=mb(this),r=t.string,n=t.index,a;return n>=r.length?Oc(void 0,!0):(a=db(r,n),t.index+=a.length,Oc(a,!1))});var kc=ae,gb=K,yb=ie,wb=re,Ma=ef,bb=jo,Sb=_o,$b=Yn,Ib=Ml,Et=Object.assign,_c=Object.defineProperty,Tb=gb([].concat),Pb=!Et||wb(function(){if(kc&&Et({b:1},Et(_c({},"a",{enumerable:!0,get:function(){_c(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||Ma(Et({},t)).join("")!==n})?function(t,r){for(var n=$b(t),a=arguments.length,i=1,o=bb.f,s=Sb.f;a>i;)for(var u=Ib(arguments[i++]),f=o?Tb(Ma(u),o(u)):Ma(u),l=f.length,c=0,d;l>c;)d=f[c++],(!kc||yb(s,u,d))&&(n[d]=u[d]);return n}:Et,Eb=ie,Rc=je,Ob=$o,zf=function(e,t,r){var n,a;Rc(e);try{if(n=Ob(e,"return"),!n){if(t==="throw")throw r;return r}n=Eb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Rc(n),r},kb=je,_b=zf,Rb=function(e,t,r,n){try{return n?t(kb(r)[0],r[1]):t(r)}catch(a){_b(e,"throw",a)}},Cb=ne,Ab=xr,jb=Cb("iterator"),Lb=Array.prototype,Hf=function(e){return e!==void 0&&(Ab.Array===e||Lb[jb]===e)},Ub=K,Nb=re,Kf=Y,xb=Mr,Db=Te,Mb=Co,Gf=function(){},Wf=Db("Reflect","construct"),Vo=/^\s*(?:class|function)\b/,Fb=Ub(Vo.exec),Bb=!Vo.test(Gf),lr=function(t){if(!Kf(t))return!1;try{return Wf(Gf,[],t),!0}catch{return!1}},Vf=function(t){if(!Kf(t))return!1;switch(xb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Bb||!!Fb(Vo,Mb(t))}catch{return!0}};Vf.sham=!0;var Zf=!Wf||Nb(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?Vf:lr,zb=ae,Hb=De,Kb=wt,Gb=function(e,t,r){zb?Hb.f(e,t,Kb(0,r)):e[t]=r},Wb=tr,Vb=ie,Zb=Yn,Jb=Rb,Yb=Hf,Xb=Zf,qb=To,Cc=Gb,Qb=Fo,eS=na,Ac=Array,tS=function(t){var r=Zb(t),n=Xb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Wb(i,a>2?arguments[2]:void 0));var s=eS(r),u=0,f,l,c,d,h,v;if(s&&!(this===Ac&&Yb(s)))for(l=n?new this:[],d=Qb(r,s),h=d.next;!(c=Vb(h,d)).done;u++)v=o?Jb(d,i,[c.value,u],!0):c.value,Cc(l,u,v);else for(f=qb(r),l=n?new this(f):Ac(f);f>u;u++)v=o?i(r[u],u):r[u],Cc(l,u,v);return l.length=u,l},$t=K,Fa=2147483647,Ir=36,Jf=1,Gi=26,rS=38,nS=700,aS=72,iS=128,oS="-",sS=/[^\0-\u007E]/,Yf=/[.\u3002\uFF0E\uFF61]/g,jc="Overflow: input needs wider integers to process",Ba=Ir-Jf,Lc=RangeError,cS=$t(Yf.exec),Ut=Math.floor,za=String.fromCharCode,Uc=$t("".charCodeAt),Xf=$t([].join),et=$t([].push),uS=$t("".replace),lS=$t("".split),fS=$t("".toLowerCase),dS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Uc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Uc(e,r++);(i&64512)===56320?et(t,((a&1023)<<10)+(i&1023)+65536):(et(t,a),r--)}else et(t,a)}return t},Nc=function(e){return e+22+75*(e<26)},hS=function(e,t,r){var n=0;for(e=r?Ut(e/nS):e>>1,e+=Ut(e/t);e>Ba*Gi>>1;)e=Ut(e/Ba),n+=Ir;return Ut(n+(Ba+1)*e/(e+rS))},vS=function(e){var t=[];e=dS(e);var r=e.length,n=iS,a=0,i=aS,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&et(t,za(s));var u=t.length,f=u;for(u&&et(t,oS);f<r;){var l=Fa;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Ut((Fa-a)/c))throw new Lc(jc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Fa)throw new Lc(jc);if(s===n){for(var d=a,h=Ir;;){var v=h<=i?Jf:h>=i+Gi?Gi:h-i;if(d<v)break;var b=d-v,g=Ir-v;et(t,za(Nc(v+b%g))),d=Ut(b/g),h+=Ir}et(t,za(Nc(d))),i=hS(a,c,f===u),a=0,f++}}a++,n++}return Xf(t,"")},pS=function(e){var t=[],r=lS(uS(fS(e),Yf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],et(t,cS(sS,a)?"xn--"+vS(a):a);return Xf(t,".")},mS=Q,Zo=ae,gS=ta,Jo=G,xc=tr,Ee=K,jn=Pe,ge=ra,yS=Do,Wi=$e,Yo=Pb,Ot=tS,Oe=aa,wS=Mf.codeAt,bS=pS,ze=Ze,SS=er,$S=St,qf=Kw,Qf=Qt,IS=Qf.set,Ln=Qf.getterFor("URL"),TS=qf.URLSearchParams,PS=qf.getState,fr=Jo.URL,Vi=Jo.TypeError,Un=Jo.parseInt,ES=Math.floor,Dc=Math.pow,Se=Ee("".charAt),Ce=Ee(/./.exec),gr=Ee([].join),OS=Ee(1 .toString),kS=Ee([].pop),Ct=Ee([].push),Ha=Ee("".replace),_S=Ee([].shift),RS=Ee("".split),Tr=Ee("".slice),Nn=Ee("".toLowerCase),CS=Ee([].unshift),AS="Invalid authority",Ka="Invalid scheme",at="Invalid host",Mc="Invalid port",ed=/[a-z]/i,jS=/[\d+-.a-z]/i,Zi=/\d/,LS=/^0x/i,US=/^[0-7]+$/,NS=/^\d+$/,td=/^[\da-f]+$/i,xS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,DS=/[\0\t\n\r #/:<>?@[\\\]^|]/,MS=/^[\u0000-\u0020]+/,FS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,BS=/[\t\n\r]/g,ye,zS=function(e){var t=RS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&Se(i,0)==="0"&&(o=Ce(LS,i)?16:8,i=Tr(i,o===8?1:2)),i==="")s=0;else{if(!Ce(o===10?NS:o===8?US:td,i))return e;s=Un(i,o)}Ct(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Dc(256,5-r))return null}else if(s>255)return null;for(u=kS(n),a=0;a<n.length;a++)u+=n[a]*Dc(256,3-a);return u},HS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return Se(e,a)};if(d()===":"){if(Se(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ce(td,d());)i=i*16+Un(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ce(Zi,d()))return;for(;Ce(Zi,d());){if(f=Un(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},KS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},dr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)CS(t,e%256),e=ES(e/256);return gr(t,".")}if(typeof e=="object"){for(t="",n=KS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=OS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Tn={},rd=Yo({},Tn,{" ":1,'"':1,"<":1,">":1,"`":1}),nd=Yo({},rd,{"#":1,"?":1,"{":1,"}":1}),Ga=Yo({},nd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ye=function(e,t){var r=wS(e,0);return r>32&&r<127&&!Wi(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(ed,Se(e,0))&&((r=Se(e,1))===":"||!t&&r==="|")},Fc=function(e){var t;return e.length>1&&yr(Tr(e,0,2))&&(e.length===2||(t=Se(e,2))==="/"||t==="\\"||t==="?"||t==="#")},GS=function(e){return e==="."||Nn(e)==="%2e"},WS=function(e){return e=Nn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Wa={},Bc={},Va={},zc={},Hc={},Za={},Kc={},Gc={},rn={},nn={},Ja={},Ya={},Xa={},qa={},Wc={},Qa={},kt={},Ne={},Vc={},it={},Be={},Xo=function(e,t,r){var n=ze(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Vi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Xo(r,!0)),i=this.parse(n,null,a),i)throw new Vi(i);o=PS(new TS),o.bindURL(this),this.searchParams=o}};Xo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Wa,i=0,o="",s=!1,u=!1,f=!1,l,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=Ha(e,MS,""),e=Ha(e,FS,"$1")),e=Ha(e,BS,""),l=Ot(e);i<=l.length;){switch(c=l[i],a){case Wa:if(c&&Ce(ed,c))o+=Nn(c),a=Bc;else{if(t)return Ka;a=Va;continue}break;case Bc:if(c&&(Ce(jS,c)||c==="+"||c==="-"||c==="."))o+=Nn(c);else if(c===":"){if(t&&(n.isSpecial()!==Wi(tn,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&tn[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=qa:n.isSpecial()&&r&&r.scheme===n.scheme?a=zc:n.isSpecial()?a=Gc:l[i+1]==="/"?(a=Hc,i++):(n.cannotBeABaseURL=!0,Ct(n.path,""),a=Vc)}else{if(t)return Ka;o="",a=Va,i=0;continue}break;case Va:if(!r||r.cannotBeABaseURL&&c!=="#")return Ka;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Oe(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Be;break}a=r.scheme==="file"?qa:Za;continue;case zc:if(c==="/"&&l[i+1]==="/")a=rn,i++;else{a=Za;continue}break;case Hc:if(c==="/"){a=nn;break}else{a=Ne;continue}case Za: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=Oe(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Kc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.query="",a=it;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(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=Oe(r.path),n.path.length--,a=Ne;continue}break;case Kc: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=Ne;continue}break;case Gc:if(a=rn,c!=="/"||Se(o,i+1)!=="/")continue;i++;break;case rn:if(c!=="/"&&c!=="\\"){a=nn;continue}break;case nn:if(c==="@"){s&&(o="%40"+o),s=!0,d=Ot(o);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ye(b,Ga);f?n.password+=g:n.username+=g}o=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return AS;i-=Ot(o).length+1,o="",a=Ja}else o+=c;break;case Ja:case Ya:if(t&&n.scheme==="file"){a=Qa;continue}else if(c===":"&&!u){if(o==="")return at;if(h=n.parseHost(o),h)return h;if(o="",a=Xa,t===Ya)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return at;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=kt,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Xa:if(Ce(Zi,c))o+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=Un(o,10);if(T>65535)return Mc;n.port=n.isSpecial()&&T===tn[n.scheme]?null:T,o=""}if(t)return;a=kt;continue}else return Mc;break;case qa:if(n.scheme="file",c==="/"||c==="\\")a=Wc;else if(r&&r.scheme==="file")switch(c){case ye:n.host=r.host,n.path=Oe(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Oe(r.path),n.query="",a=it;break;case"#":n.host=r.host,n.path=Oe(r.path),n.query=r.query,n.fragment="",a=Be;break;default:Fc(gr(Oe(l,i),""))||(n.host=r.host,n.path=Oe(r.path),n.shortenPath()),a=Ne;continue}else{a=Ne;continue}break;case Wc:if(c==="/"||c==="\\"){a=Qa;break}r&&r.scheme==="file"&&!Fc(gr(Oe(l,i),""))&&(yr(r.path[0],!0)?Ct(n.path,r.path[0]):n.host=r.host),a=Ne;continue;case Qa:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&yr(o))a=Ne;else if(o===""){if(n.host="",t)return;a=kt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=kt}continue}else o+=c;break;case kt:if(n.isSpecial()){if(a=Ne,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=it;else if(!t&&c==="#")n.fragment="",a=Be;else if(c!==ye&&(a=Ne,c!=="/"))continue;break;case Ne:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(WS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,"")):GS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,""):(n.scheme==="file"&&!n.path.length&&yr(o)&&(n.host&&(n.host=""),o=Se(o,0)+":"),Ct(n.path,o)),o="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)_S(n.path);c==="?"?(n.query="",a=it):c==="#"&&(n.fragment="",a=Be)}else o+=Ye(c,nd);break;case Vc:c==="?"?(n.query="",a=it):c==="#"?(n.fragment="",a=Be):c!==ye&&(n.path[0]+=Ye(c,Tn));break;case it:!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,rd));break}i++}},parseHost:function(e){var t,r,n;if(Se(e,0)==="["){if(Se(e,e.length-1)!=="]"||(t=HS(Tr(e,1,-1)),!t))return at;this.host=t}else if(this.isSpecial()){if(e=bS(e),Ce(xS,e)||(t=zS(e),t===null))return at;this.host=t}else{if(Ce(DS,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 Wi(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,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=dr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+gr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Vi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Kt(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)+":",Wa)},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],Ga)}},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],Ga)}},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,Ja)},getHostname:function(){var e=this.host;return e===null?"":dr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ya)},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:(Se(e,0)==="?"&&(e=Tr(e,1)),this.query="",this.parse(e,it)),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}Se(e,0)==="#"&&(e=Tr(e,1)),this.fragment="",this.parse(e,Be)},update:function(){this.query=this.searchParams.serialize()||null}};var Kt=function(t){var r=yS(this,oe),n=$S(arguments.length,1)>1?arguments[1]:void 0,a=IS(r,new Xo(t,!1,n));Zo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},oe=Kt.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}};Zo&&(ge(oe,"href",we("serialize","setHref")),ge(oe,"origin",we("getOrigin")),ge(oe,"protocol",we("getProtocol","setProtocol")),ge(oe,"username",we("getUsername","setUsername")),ge(oe,"password",we("getPassword","setPassword")),ge(oe,"host",we("getHost","setHost")),ge(oe,"hostname",we("getHostname","setHostname")),ge(oe,"port",we("getPort","setPort")),ge(oe,"pathname",we("getPathname","setPathname")),ge(oe,"search",we("getSearch","setSearch")),ge(oe,"searchParams",we("getSearchParams")),ge(oe,"hash",we("getHash","setHash")));jn(oe,"toJSON",function(){return Ln(this).serialize()},{enumerable:!0});jn(oe,"toString",function(){return Ln(this).serialize()},{enumerable:!0});if(fr){var Zc=fr.createObjectURL,Jc=fr.revokeObjectURL;Zc&&jn(Kt,"createObjectURL",xc(Zc,fr)),Jc&&jn(Kt,"revokeObjectURL",xc(Jc,fr))}SS(Kt,"URL");mS({global:!0,constructor:!0,forced:!gS,sham:!Zo},{URL:Kt});var VS=Q,ZS=Te,ad=re,JS=St,Yc=Ze,YS=ta,qo=ZS("URL"),XS=YS&&ad(function(){qo.canParse()}),qS=ad(function(){return qo.canParse.length!==1});VS({target:"URL",stat:!0,forced:!XS||qS},{canParse:function(t){var r=JS(arguments.length,1),n=Yc(t),a=r<2||arguments[1]===void 0?void 0:Yc(arguments[1]);try{return!!new qo(n,a)}catch{return!1}}});var QS=Q,e$=Te,t$=St,Xc=Ze,r$=ta,n$=e$("URL");QS({target:"URL",stat:!0,forced:!r$},{parse:function(t){var r=t$(arguments.length,1),n=Xc(t),a=r<2||arguments[1]===void 0?void 0:Xc(arguments[1]);try{return new n$(n,a)}catch{return null}}});var a$=Q,i$=ie;a$({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i$(URL.prototype.toString,this)}});var o$=Go;o$.URL;var s$={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},c$=Xn,ei=c$("span").classList,qc=ei&&ei.constructor&&ei.constructor.prototype,u$=qc===Object.prototype?void 0:qc,Qc=G,id=s$,l$=u$,wr=gy,eu=bt,f$=er,d$=ne,ti=d$("iterator"),ri=wr.values,od=function(e,t){if(e){if(e[ti]!==ri)try{eu(e,ti,ri)}catch{e[ti]=ri}if(f$(e,t,!0),id[t]){for(var r in wr)if(e[r]!==wr[r])try{eu(e,r,wr[r])}catch{e[r]=wr[r]}}}};for(var ni in id)od(Qc[ni]&&Qc[ni].prototype,ni);od(l$,"DOMTokenList");var h$=Ie,v$=bt,p$=function(e,t){h$(t)&&"cause"in t&&v$(e,"cause",t.cause)},m$=K,sd=Error,g$=m$("".replace),y$=function(e){return String(new sd(e).stack)}("zxcasd"),cd=/\n\s*at [^:]*:[^\n]*/,w$=cd.test(y$),b$=function(e,t){if(w$&&typeof e=="string"&&!sd.prepareStackTrace)for(;t--;)e=g$(e,cd,"");return e},S$=re,$$=wt,I$=!S$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",$$(1,7)),e.stack!==7):!0}),T$=bt,P$=b$,E$=I$,tu=Error.captureStackTrace,O$=function(e,t,r,n){E$&&(tu?tu(e,t):T$(e,"stack",P$(r,n)))},k$=tr,_$=ie,R$=je,C$=Qn,A$=Hf,j$=To,ru=qn,L$=Fo,U$=na,nu=zf,N$=TypeError,Pn=function(e,t){this.stopped=e,this.result=t},au=Pn.prototype,Fr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=k$(t,n),f,l,c,d,h,v,b,g=function(I){return f&&nu(f,"normal",I),new Pn(!0,I)},T=function(I){return a?(R$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=U$(e),!l)throw new N$(C$(e)+" is not iterable");if(A$(l)){for(c=0,d=j$(e);d>c;c++)if(h=T(e[c]),h&&ru(au,h))return h;return new Pn(!1)}f=L$(e,l)}for(v=i?e.next:f.next;!(b=_$(v,f)).done;){try{h=T(b.value)}catch(I){nu(f,"throw",I)}if(typeof h=="object"&&h&&ru(au,h))return h}return new Pn(!1)},x$=Ze,D$=function(e,t){return e===void 0?arguments.length<2?"":t:x$(e)},M$=Q,F$=qn,B$=Lo,xn=Uo,z$=vf,ud=ea,ai=bt,ii=wt,H$=p$,K$=O$,G$=Fr,W$=D$,V$=ne,Z$=V$("toStringTag"),Dn=Error,J$=[].push,Gt=function(t,r){var n=F$(oi,this),a;xn?a=xn(new Dn,n?B$(this):oi):(a=n?this:ud(oi),ai(a,Z$,"Error")),r!==void 0&&ai(a,"message",W$(r)),K$(a,Gt,a.stack,1),arguments.length>2&&H$(a,arguments[2]);var i=[];return G$(t,J$,{that:i}),ai(a,"errors",i),a};xn?xn(Gt,Dn):z$(Gt,Dn,{name:!0});var oi=Gt.prototype=ud(Dn.prototype,{constructor:ii(1,Gt),message:ii(1,""),name:ii(1,"AggregateError")});M$({global:!0,constructor:!0,arity:2},{AggregateError:Gt});var Y$=Mo,X$=Mr,q$=Y$?{}.toString:function(){return"[object "+X$(this)+"]"},Q$=Mo,eI=Pe,tI=q$;Q$||eI(Object.prototype,"toString",tI,{unsafe:!0});var hr=G,rI=Nr,nI=Vn,an=function(e){return rI.slice(0,e.length)===e},ld=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":nI(hr.process)==="process"?"NODE":hr.window&&hr.document?"BROWSER":"REST"}(),aI=ld,Qo=aI==="NODE",iI=Te,oI=ra,sI=ne,cI=ae,iu=sI("species"),uI=function(e){var t=iI(e);cI&&t&&!t[iu]&&oI(t,iu,{configurable:!0,get:function(){return this}})},lI=Zf,fI=Qn,dI=TypeError,hI=function(e){if(lI(e))return e;throw new dI(fI(e)+" is not a constructor")},ou=je,vI=hI,pI=Zn,mI=ne,gI=mI("species"),fd=function(e,t){var r=ou(e).constructor,n;return r===void 0||pI(n=ou(r)[gI])?t:vI(n)},yI=Wn,dd=Function.prototype,su=dd.apply,cu=dd.call,hd=typeof Reflect=="object"&&Reflect.apply||(yI?cu.bind(su):function(){return cu.apply(su,arguments)}),wI=Nr,vd=/(?:ipad|iphone|ipod).*applewebkit/i.test(wI),fe=G,bI=hd,SI=tr,uu=Y,$I=$e,pd=re,lu=tf,II=aa,fu=Xn,TI=St,PI=vd,EI=Qo,Ji=fe.setImmediate,Yi=fe.clearImmediate,OI=fe.process,si=fe.Dispatch,kI=fe.Function,du=fe.MessageChannel,_I=fe.String,ci=0,Pr={},hu="onreadystatechange",Ar,ot,ui,li;pd(function(){Ar=fe.location});var es=function(e){if($I(Pr,e)){var t=Pr[e];delete Pr[e],t()}},fi=function(e){return function(){es(e)}},vu=function(e){es(e.data)},pu=function(e){fe.postMessage(_I(e),Ar.protocol+"//"+Ar.host)};(!Ji||!Yi)&&(Ji=function(t){TI(arguments.length,1);var r=uu(t)?t:kI(t),n=II(arguments,1);return Pr[++ci]=function(){bI(r,void 0,n)},ot(ci),ci},Yi=function(t){delete Pr[t]},EI?ot=function(e){OI.nextTick(fi(e))}:si&&si.now?ot=function(e){si.now(fi(e))}:du&&!PI?(ui=new du,li=ui.port2,ui.port1.onmessage=vu,ot=SI(li.postMessage,li)):fe.addEventListener&&uu(fe.postMessage)&&!fe.importScripts&&Ar&&Ar.protocol!=="file:"&&!pd(pu)?(ot=pu,fe.addEventListener("message",vu,!1)):hu in fu("script")?ot=function(e){lu.appendChild(fu("script"))[hu]=function(){lu.removeChild(this),es(e)}}:ot=function(e){setTimeout(fi(e),0)});var md={set:Ji,clear:Yi},gd=function(){this.head=null,this.tail=null};gd.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 yd=gd,RI=Nr,CI=/ipad|iphone|ipod/i.test(RI)&&typeof Pebble<"u",AI=Nr,jI=/web0s(?!.*chrome)/i.test(AI),Wt=G,LI=Tf,mu=tr,di=md.set,UI=yd,NI=vd,xI=CI,DI=jI,hi=Qo,gu=Wt.MutationObserver||Wt.WebKitMutationObserver,yu=Wt.document,wu=Wt.process,on=Wt.Promise,Xi=LI("queueMicrotask"),_t,vi,pi,sn,bu;if(!Xi){var cn=new UI,un=function(){var e,t;for(hi&&(e=wu.domain)&&e.exit();t=cn.get();)try{t()}catch(r){throw cn.head&&_t(),r}e&&e.enter()};!NI&&!hi&&!DI&&gu&&yu?(vi=!0,pi=yu.createTextNode(""),new gu(un).observe(pi,{characterData:!0}),_t=function(){pi.data=vi=!vi}):!xI&&on&&on.resolve?(sn=on.resolve(void 0),sn.constructor=on,bu=mu(sn.then,sn),_t=function(){bu(un)}):hi?_t=function(){wu.nextTick(un)}:(di=mu(di,Wt),_t=function(){di(un)}),Xi=function(e){cn.head||_t(),cn.add(e)}}var MI=Xi,FI=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}}},BI=G,Br=BI.Promise,zI=G,Er=Br,HI=Y,KI=pf,GI=Co,WI=ne,Su=ld,mi=Kl;Er&&Er.prototype;var VI=WI("species"),qi=!1,wd=HI(zI.PromiseRejectionEvent),ZI=KI("Promise",function(){var e=GI(Er),t=e!==String(Er);if(!t&&mi===66)return!0;if(!mi||mi<51||!/native code/.test(e)){var r=new Er(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[VI]=n,qi=r.then(function(){})instanceof n,!qi)return!0}return!t&&(Su==="BROWSER"||Su==="DENO")&&!wd}),zr={CONSTRUCTOR:ZI,REJECTION_EVENT:wd,SUBCLASSING:qi},Me={},$u=Le,JI=TypeError,YI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new JI("Bad Promise constructor");t=n,r=a}),this.resolve=$u(t),this.reject=$u(r)};Me.f=function(e){return new YI(e)};var XI=Q,Mn=Qo,nt=G,Vt=ie,Iu=Pe,Tu=Uo,qI=er,QI=uI,e0=Le,En=Y,t0=Ie,r0=Do,n0=fd,bd=md.set,ts=MI,a0=FI,i0=nr,o0=yd,Sd=Qt,Fn=Br,rs=zr,$d=Me,ca="Promise",Id=rs.CONSTRUCTOR,s0=rs.REJECTION_EVENT,c0=rs.SUBCLASSING,gi=Sd.getterFor(ca),u0=Sd.set,At=Fn&&Fn.prototype,ct=Fn,ln=At,Td=nt.TypeError,Qi=nt.document,ns=nt.process,eo=$d.f,l0=eo,f0=!!(Qi&&Qi.createEvent&&nt.dispatchEvent),Pd="unhandledrejection",d0="rejectionhandled",Pu=0,Ed=1,h0=2,as=1,Od=2,fn,Eu,v0,Ou,kd=function(e){var t;return t0(e)&&En(t=e.then)?t:!1},_d=function(e,t){var r=t.value,n=t.state===Ed,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===Od&&m0(t),t.rejection=as),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new Td("Promise-chain cycle")):(f=kd(u))?Vt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Rd=function(e,t){e.notified||(e.notified=!0,ts(function(){for(var r=e.reactions,n;n=r.get();)_d(n,e);e.notified=!1,t&&!e.rejection&&p0(e)}))},Cd=function(e,t,r){var n,a;f0?(n=Qi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),nt.dispatchEvent(n)):n={promise:t,reason:r},!s0&&(a=nt["on"+e])?a(n):e===Pd&&a0("Unhandled promise rejection",r)},p0=function(e){Vt(bd,nt,function(){var t=e.facade,r=e.value,n=ku(e),a;if(n&&(a=i0(function(){Mn?ns.emit("unhandledRejection",r,t):Cd(Pd,t,r)}),e.rejection=Mn||ku(e)?Od:as,a.error))throw a.value})},ku=function(e){return e.rejection!==as&&!e.parent},m0=function(e){Vt(bd,nt,function(){var t=e.facade;Mn?ns.emit("rejectionHandled",t):Cd(d0,t,e.value)})},Nt=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=h0,Rd(e,!0))},to=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new Td("Promise can't be resolved itself");var n=kd(t);n?ts(function(){var a={done:!1};try{Vt(n,t,Nt(to,a,e),Nt(Mt,a,e))}catch(i){Mt(a,i,e)}}):(e.value=t,e.state=Ed,Rd(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(Id&&(ct=function(t){r0(this,ln),e0(t),Vt(fn,this);var r=gi(this);try{t(Nt(to,r),Nt(Mt,r))}catch(n){Mt(r,n)}},ln=ct.prototype,fn=function(t){u0(this,{type:ca,done:!1,notified:!1,parent:!1,reactions:new o0,rejection:!1,state:Pu,value:null})},fn.prototype=Iu(ln,"then",function(t,r){var n=gi(this),a=eo(n0(this,ct));return n.parent=!0,a.ok=En(t)?t:!0,a.fail=En(r)&&r,a.domain=Mn?ns.domain:void 0,n.state===Pu?n.reactions.add(a):ts(function(){_d(a,n)}),a.promise}),Eu=function(){var e=new fn,t=gi(e);this.promise=e,this.resolve=Nt(to,t),this.reject=Nt(Mt,t)},$d.f=eo=function(e){return e===ct||e===v0?new Eu(e):l0(e)},En(Fn)&&At!==Object.prototype)){Ou=At.then,c0||Iu(At,"then",function(t,r){var n=this;return new ct(function(a,i){Vt(Ou,n,a,i)}).then(t,r)},{unsafe:!0});try{delete At.constructor}catch{}Tu&&Tu(At,ln)}XI({global:!0,constructor:!0,wrap:!0,forced:Id},{Promise:ct});qI(ct,ca,!1);QI(ca);var g0=ne,Ad=g0("iterator"),jd=!1;try{var y0=0,_u={next:function(){return{done:!!y0++}},return:function(){jd=!0}};_u[Ad]=function(){return this},Array.from(_u,function(){throw 2})}catch{}var w0=function(e,t){try{if(!t&&!jd)return!1}catch{return!1}var r=!1;try{var n={};n[Ad]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},b0=Br,S0=w0,$0=zr.CONSTRUCTOR,ua=$0||!S0(function(e){b0.all(e).then(void 0,function(){})}),I0=Q,T0=ie,P0=Le,E0=Me,O0=nr,k0=Fr,_0=ua;I0({target:"Promise",stat:!0,forced:_0},{all:function(t){var r=this,n=E0.f(r),a=n.resolve,i=n.reject,o=O0(function(){var s=P0(r.resolve),u=[],f=0,l=1;k0(t,function(c){var d=f++,h=!1;l++,T0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var R0=Q,C0=zr.CONSTRUCTOR,ro=Br,A0=Te,j0=Y,L0=Pe,Ru=ro&&ro.prototype;R0({target:"Promise",proto:!0,forced:C0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(j0(ro)){var Cu=A0("Promise").prototype.catch;Ru.catch!==Cu&&L0(Ru,"catch",Cu,{unsafe:!0})}var U0=Q,N0=ie,x0=Le,D0=Me,M0=nr,F0=Fr,B0=ua;U0({target:"Promise",stat:!0,forced:B0},{race:function(t){var r=this,n=D0.f(r),a=n.reject,i=M0(function(){var o=x0(r.resolve);F0(t,function(s){N0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var z0=Q,H0=Me,K0=zr.CONSTRUCTOR;z0({target:"Promise",stat:!0,forced:K0},{reject:function(t){var r=H0.f(this),n=r.reject;return n(t),r.promise}});var G0=je,W0=Ie,V0=Me,Ld=function(e,t){if(G0(e),W0(t)&&t.constructor===e)return t;var r=V0.f(e),n=r.resolve;return n(t),r.promise},Z0=Q,J0=Te,Y0=zr.CONSTRUCTOR,X0=Ld;J0("Promise");Z0({target:"Promise",stat:!0,forced:Y0},{resolve:function(t){return X0(this,t)}});var q0=Q,Q0=ie,eT=Le,tT=Me,rT=nr,nT=Fr,aT=ua;q0({target:"Promise",stat:!0,forced:aT},{allSettled:function(t){var r=this,n=tT.f(r),a=n.resolve,i=n.reject,o=rT(function(){var s=eT(r.resolve),u=[],f=0,l=1;nT(t,function(c){var d=f++,h=!1;l++,Q0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var iT=Q,oT=ie,sT=Le,cT=Te,uT=Me,lT=nr,fT=Fr,dT=ua,Au="No one promise resolved";iT({target:"Promise",stat:!0,forced:dT},{any:function(t){var r=this,n=cT("AggregateError"),a=uT.f(r),i=a.resolve,o=a.reject,s=lT(function(){var u=sT(r.resolve),f=[],l=0,c=1,d=!1;fT(t,function(h){var v=l++,b=!1;c++,oT(u,r,h).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[v]=g,--c||o(new n(f,Au)))})}),--c||o(new n(f,Au))});return s.error&&o(s.value),a.promise}});var hT=Q,vT=Me;hT({target:"Promise",stat:!0},{withResolvers:function(){var t=vT.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var pT=Q,Bn=Br,mT=re,Ud=Te,Nd=Y,gT=fd,ju=Ld,yT=Pe,no=Bn&&Bn.prototype,wT=!!Bn&&mT(function(){no.finally.call({then:function(){}},function(){})});pT({target:"Promise",proto:!0,real:!0,forced:wT},{finally:function(e){var t=gT(this,Ud("Promise")),r=Nd(e);return this.then(r?function(n){return ju(t,e()).then(function(){return n})}:e,r?function(n){return ju(t,e()).then(function(){throw n})}:e)}});if(Nd(Bn)){var Lu=Ud("Promise").prototype.finally;no.finally!==Lu&&yT(no,"finally",Lu,{unsafe:!0})}var bT=Go;bT.Promise;var ST=Q,$T=G,IT=hd,TT=aa,PT=Me,ET=Le,xd=nr,yi=$T.Promise,Uu=!1,OT=!yi||!yi.try||xd(function(){yi.try(function(e){Uu=e===8},8)}).error||!Uu;ST({target:"Promise",stat:!0,forced:OT},{try:function(e){var t=arguments.length>1?TT(arguments,1):[],r=PT.f(this),n=xd(function(){return IT(ET(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const Dd="sesamy-debug";function kT(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 _T(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 RT(e){kT(Dd,e.toString(),1)}function CT(){return _T(Dd)==="true"}function he(e){CT()&&console.log(e)}function Ve(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});he(`Triggering event: ${e}`),dispatchEvent(r)}function xe(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 is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function os(e,t){return e(t={exports:{}},t.exports),t.exports}var st=os(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});is(st);var AT=is(os(function(e,t){var r=ut&&ut.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{I(h.next(y))}catch(p){b(p)}}function T(y){try{I(h.throw(y))}catch(p){b(p)}}function I(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=ut&&ut.__generator||function(l,c){var d,h,v,b,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function T(I){return function(y){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch(S){p=[6,S],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,y])}}},a=ut;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,b,g,T,I,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(b))!==null&&(y=JSON.parse(I)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var b,g,T;return n(this,function(I){switch(I.label){case 0:return[4,st.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(st.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(T)),st.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(st.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,b=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,st.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),st.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],b=0;;){var g=h.keySync(b);if(g===null)break;v.push(g),b++}for(var T=!1,I=0;I<v.length;I++){var y=v[I];if(y.includes(i)){var p=h.getItemSync(y);if(p!==null){var S=JSON.parse(p);(S.timeRefreshed===void 0&&S.timeAcquired<d||S.timeRefreshed!==void 0&&S.timeRefreshed<d)&&(h.removeItemSync(y),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const jT={timeoutInSeconds:60},Md={name:"auth0-spa-js",version:"2.1.3"},Fd=()=>Date.now();let le=class ao extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ao.prototype)}static fromPayload({error:t,error_description:r}){return new ao(t,r)}},LT=class Bd extends le{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Bd.prototype)}},io=class zd extends le{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,zd.prototype)}},UT=class Hd extends io{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Hd.prototype)}},NT=class Kd extends le{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Kd.prototype)}},xT=class Gd extends le{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Gd.prototype)}},Wd=class Vd extends le{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Nu(t,["default"])}', scope: '${Nu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Vd.prototype)}};function Nu(e,t=[]){return e&&!t.includes(e)?e:""}const On=()=>window.crypto,wi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(On().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},xu=e=>btoa(e),oo=e=>{var{clientId:t}=e,r=xe(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Du=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),DT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},MT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([DT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},FT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},BT=async(e,t,r,n,a,i,o=1e4)=>a?FT(e,t,r,n,o,a,i):MT(e,n,o);async function zT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=xe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?oo(u):JSON.stringify(u);return await async function(l,c,d,h,v,b,g){let T,I=null;for(let k=0;k<3;k++)try{T=await BT(l,d,h,v,b,g,c),I=null;break}catch(M){I=M}if(I)throw I;const y=T.json,{error:p,error_description:S}=y,O=xe(y,["error","error_description"]),{ok:_}=T;if(!_){const k=S||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new xT(p,k,O.mfa_token):p==="missing_refresh_token"?new Wd(d,h):new le(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Md))}},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 so{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new so({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new so({scope:r,audience:n,clientId:a})}},HT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Zd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},KT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Fd}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new 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,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new ft({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=ft.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},GT=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",WT=["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"],VT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Du(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],WT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Du(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 i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&vr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var dt=os(function(e,t){var r=ut&&ut.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});is(dt),dt.encode,dt.parse,dt.getAll;var ZT=dt.get,Jd=dt.set,Yd=dt.remove;const jt={get(e){const t=ZT(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),Jd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r)}},JT={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),Jd(`_legacy_${e}`,JSON.stringify(t),n),jt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r),jt.remove(e,t),jt.remove(`_legacy_${e}`,t)}},YT={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 XT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
1
|
+
"use strict";var Fh=Object.defineProperty;var Bh=(e,t,r)=>t in e?Fh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Bh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},re=function(e){try{return!!e()}catch{return!0}},zh=re,Wn=!zh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Nl=Wn,xl=Function.prototype,Ri=xl.call,Hh=Nl&&xl.bind.bind(Ri,Ri),K=Nl?Hh:function(e){return function(){return Ri.apply(e,arguments)}},Dl=K,Kh=Dl({}.toString),Gh=Dl("".slice),Vn=function(e){return Gh(Kh(e),8,-1)},Wh=K,Vh=re,Zh=Vn,pa=Object,Jh=Wh("".split),Ml=Vh(function(){return!pa("z").propertyIsEnumerable(0)})?function(e){return Zh(e)==="String"?Jh(e,""):pa(e)}:pa,Zn=function(e){return e==null},Yh=Zn,Xh=TypeError,Jn=function(e){if(Yh(e))throw new Xh("Can't call method on "+e);return e},qh=Ml,Qh=Jn,Ur=function(e){return qh(Qh(e))},sr=function(e){return e&&e.Math===Math&&e},G=sr(typeof globalThis=="object"&&globalThis)||sr(typeof window=="object"&&window)||sr(typeof self=="object"&&self)||sr(typeof Gr=="object"&&Gr)||sr(typeof Gr=="object"&&Gr)||function(){return this}()||Function("return this")(),Fl={exports:{}},ev=!1,ws=G,tv=Object.defineProperty,bo=function(e,t){try{tv(ws,e,{value:t,configurable:!0,writable:!0})}catch{ws[e]=t}return t},rv=G,nv=bo,bs="__core-js_shared__",Ss=Fl.exports=rv[bs]||nv(bs,{});(Ss.versions||(Ss.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 So=Fl.exports,$s=So,Bl=function(e,t){return $s[e]||($s[e]=t||{})},av=Jn,iv=Object,Yn=function(e){return iv(av(e))},ov=K,sv=Yn,cv=ov({}.hasOwnProperty),$e=Object.hasOwn||function(t,r){return cv(sv(t),r)},uv=K,lv=0,fv=Math.random(),dv=uv(1 .toString),zl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+dv(++lv+fv,36)},hv=G,Is=hv.navigator,Ts=Is&&Is.userAgent,Nr=Ts?String(Ts):"",Hl=G,ma=Nr,Ps=Hl.process,Es=Hl.Deno,Os=Ps&&Ps.versions||Es&&Es.version,ks=Os&&Os.v8,Re,_n;ks&&(Re=ks.split("."),_n=Re[0]>0&&Re[0]<4?1:+(Re[0]+Re[1]));!_n&&ma&&(Re=ma.match(/Edge\/(\d+)/),(!Re||Re[1]>=74)&&(Re=ma.match(/Chrome\/(\d+)/),Re&&(_n=+Re[1])));var Kl=_n,_s=Kl,vv=re,pv=G,mv=pv.String,Gl=!!Object.getOwnPropertySymbols&&!vv(function(){var e=Symbol("symbol detection");return!mv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_s&&_s<41}),gv=Gl,Wl=gv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",yv=G,wv=Bl,Rs=$e,bv=zl,Sv=Gl,$v=Wl,Lt=yv.Symbol,ga=wv("wks"),Iv=$v?Lt.for||Lt:Lt&&Lt.withoutSetter||bv,ne=function(e){return Rs(ga,e)||(ga[e]=Sv&&Rs(Lt,e)?Lt[e]:Iv("Symbol."+e)),ga[e]},ya=typeof document=="object"&&document.all,Y=typeof ya>"u"&&ya!==void 0?function(e){return typeof e=="function"||e===ya}:function(e){return typeof e=="function"},Tv=Y,Ie=function(e){return typeof e=="object"?e!==null:Tv(e)},Pv=Ie,Ev=String,Ov=TypeError,je=function(e){if(Pv(e))return e;throw new Ov(Ev(e)+" is not an object")},Vl={},kv=re,ae=!kv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),_v=ae,Rv=re,Zl=_v&&Rv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),De={},Cv=G,Cs=Ie,Ci=Cv.document,Av=Cs(Ci)&&Cs(Ci.createElement),Xn=function(e){return Av?Ci.createElement(e):{}},jv=ae,Lv=re,Uv=Xn,Jl=!jv&&!Lv(function(){return Object.defineProperty(Uv("div"),"a",{get:function(){return 7}}).a!==7}),Nv=Wn,Wr=Function.prototype.call,ie=Nv?Wr.bind(Wr):function(){return Wr.apply(Wr,arguments)},wa=G,xv=Y,Dv=function(e){return xv(e)?e:void 0},Te=function(e,t){return arguments.length<2?Dv(wa[e]):wa[e]&&wa[e][t]},Mv=K,qn=Mv({}.isPrototypeOf),Fv=Te,Bv=Y,zv=qn,Hv=Wl,Kv=Object,Yl=Hv?function(e){return typeof e=="symbol"}:function(e){var t=Fv("Symbol");return Bv(t)&&zv(t.prototype,Kv(e))},Gv=String,Qn=function(e){try{return Gv(e)}catch{return"Object"}},Wv=Y,Vv=Qn,Zv=TypeError,Le=function(e){if(Wv(e))return e;throw new Zv(Vv(e)+" is not a function")},Jv=Le,Yv=Zn,$o=function(e,t){var r=e[t];return Yv(r)?void 0:Jv(r)},ba=ie,Sa=Y,$a=Ie,Xv=TypeError,qv=function(e,t){var r,n;if(t==="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e))||Sa(r=e.valueOf)&&!$a(n=ba(r,e))||t!=="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e)))return n;throw new Xv("Can't convert object to primitive value")},Qv=ie,As=Ie,js=Yl,ep=$o,tp=qv,rp=ne,np=TypeError,ap=rp("toPrimitive"),ip=function(e,t){if(!As(e)||js(e))return e;var r=ep(e,ap),n;if(r){if(t===void 0&&(t="default"),n=Qv(r,e,t),!As(n)||js(n))return n;throw new np("Can't convert object to primitive value")}return t===void 0&&(t="number"),tp(e,t)},op=ip,sp=Yl,Xl=function(e){var t=op(e,"string");return sp(t)?t:t+""},cp=ae,up=Jl,lp=Zl,Vr=je,Ls=Xl,fp=TypeError,Ia=Object.defineProperty,dp=Object.getOwnPropertyDescriptor,Ta="enumerable",Pa="configurable",Ea="writable";De.f=cp?lp?function(t,r,n){if(Vr(t),r=Ls(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ea in n&&!n[Ea]){var a=dp(t,r);a&&a[Ea]&&(t[r]=n.value,n={configurable:Pa in n?n[Pa]:a[Pa],enumerable:Ta in n?n[Ta]:a[Ta],writable:!1})}return Ia(t,r,n)}:Ia:function(t,r,n){if(Vr(t),r=Ls(r),Vr(n),up)try{return Ia(t,r,n)}catch{}if("get"in n||"set"in n)throw new fp("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var hp=Math.ceil,vp=Math.floor,pp=Math.trunc||function(t){var r=+t;return(r>0?vp:hp)(r)},mp=pp,Io=function(e){var t=+e;return t!==t||t===0?0:mp(t)},gp=Io,yp=Math.max,wp=Math.min,ql=function(e,t){var r=gp(e);return r<0?yp(r+t,0):wp(r,t)},bp=Io,Sp=Math.min,$p=function(e){var t=bp(e);return t>0?Sp(t,9007199254740991):0},Ip=$p,To=function(e){return Ip(e.length)},Tp=Ur,Pp=ql,Ep=To,Us=function(e){return function(t,r,n){var a=Tp(t),i=Ep(a);if(i===0)return!e&&-1;var o=Pp(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},Op={includes:Us(!0),indexOf:Us(!1)},Po={},kp=K,Oa=$e,_p=Ur,Rp=Op.indexOf,Cp=Po,Ns=kp([].push),Ql=function(e,t){var r=_p(e),n=0,a=[],i;for(i in r)!Oa(Cp,i)&&Oa(r,i)&&Ns(a,i);for(;t.length>n;)Oa(r,i=t[n++])&&(~Rp(a,i)||Ns(a,i));return a},Eo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ap=Ql,jp=Eo,ef=Object.keys||function(t){return Ap(t,jp)},Lp=ae,Up=Zl,Np=De,xp=je,Dp=Ur,Mp=ef;Vl.f=Lp&&!Up?Object.defineProperties:function(t,r){xp(t);for(var n=Dp(r),a=Mp(r),i=a.length,o=0,s;i>o;)Np.f(t,s=a[o++],n[s]);return t};var Fp=Te,tf=Fp("document","documentElement"),Bp=Bl,zp=zl,xs=Bp("keys"),Oo=function(e){return xs[e]||(xs[e]=zp(e))},Hp=je,Kp=Vl,Ds=Eo,Gp=Po,Wp=tf,Vp=Xn,Zp=Oo,Ms=">",Fs="<",Ai="prototype",ji="script",rf=Zp("IE_PROTO"),ka=function(){},nf=function(e){return Fs+ji+Ms+e+Fs+"/"+ji+Ms},Bs=function(e){e.write(nf("")),e.close();var t=e.parentWindow.Object;return e=null,t},Jp=function(){var e=Vp("iframe"),t="java"+ji+":",r;return e.style.display="none",Wp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(nf("document.F=Object")),r.close(),r.F},Zr,bn=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}bn=typeof document<"u"?document.domain&&Zr?Bs(Zr):Jp():Bs(Zr);for(var e=Ds.length;e--;)delete bn[Ai][Ds[e]];return bn()};Gp[rf]=!0;var ea=Object.create||function(t,r){var n;return t!==null?(ka[Ai]=Hp(t),n=new ka,ka[Ai]=null,n[rf]=t):n=bn(),r===void 0?n:Kp.f(n,r)},Yp=ne,Xp=ea,qp=De.f,Li=Yp("unscopables"),Ui=Array.prototype;Ui[Li]===void 0&&qp(Ui,Li,{configurable:!0,value:Xp(null)});var Qp=function(e){Ui[Li][e]=!0},xr={},em=G,tm=Y,zs=em.WeakMap,rm=tm(zs)&&/native code/.test(String(zs)),wt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},nm=ae,am=De,im=wt,bt=nm?function(e,t,r){return am.f(e,t,im(1,r))}:function(e,t,r){return e[t]=r,e},om=rm,af=G,sm=Ie,cm=bt,_a=$e,Ra=So,um=Oo,lm=Po,Hs="Object already initialized",Ni=af.TypeError,fm=af.WeakMap,Rn,Cr,Cn,dm=function(e){return Cn(e)?Cr(e):Rn(e,{})},hm=function(e){return function(t){var r;if(!sm(t)||(r=Cr(t)).type!==e)throw new Ni("Incompatible receiver, "+e+" required");return r}};if(om||Ra.state){var Ue=Ra.state||(Ra.state=new fm);Ue.get=Ue.get,Ue.has=Ue.has,Ue.set=Ue.set,Rn=function(e,t){if(Ue.has(e))throw new Ni(Hs);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=um("state");lm[Tt]=!0,Rn=function(e,t){if(_a(e,Tt))throw new Ni(Hs);return t.facade=e,cm(e,Tt,t),t},Cr=function(e){return _a(e,Tt)?e[Tt]:{}},Cn=function(e){return _a(e,Tt)}}var Qt={set:Rn,get:Cr,has:Cn,enforce:dm,getterFor:hm},ko={},_o={},of={}.propertyIsEnumerable,sf=Object.getOwnPropertyDescriptor,vm=sf&&!of.call({1:2},1);_o.f=vm?function(t){var r=sf(this,t);return!!r&&r.enumerable}:of;var pm=ae,mm=ie,gm=_o,ym=wt,wm=Ur,bm=Xl,Sm=$e,$m=Jl,Ks=Object.getOwnPropertyDescriptor;ko.f=pm?Ks:function(t,r){if(t=wm(t),r=bm(r),$m)try{return Ks(t,r)}catch{}if(Sm(t,r))return ym(!mm(gm.f,t,r),t[r])};var cf={exports:{}},xi=ae,Im=$e,uf=Function.prototype,Tm=xi&&Object.getOwnPropertyDescriptor,Ro=Im(uf,"name"),Pm=Ro&&(function(){}).name==="something",Em=Ro&&(!xi||xi&&Tm(uf,"name").configurable),lf={EXISTS:Ro,PROPER:Pm,CONFIGURABLE:Em},Om=K,km=Y,Di=So,_m=Om(Function.toString);km(Di.inspectSource)||(Di.inspectSource=function(e){return _m(e)});var Co=Di.inspectSource,Ao=K,Rm=re,Cm=Y,Jr=$e,Mi=ae,Am=lf.CONFIGURABLE,jm=Co,ff=Qt,Lm=ff.enforce,Um=ff.get,Gs=String,Sn=Object.defineProperty,Nm=Ao("".slice),xm=Ao("".replace),Dm=Ao([].join),Mm=Mi&&!Rm(function(){return Sn(function(){},"length",{value:8}).length!==8}),Fm=String(String).split("String"),Bm=cf.exports=function(e,t,r){Nm(Gs(t),0,7)==="Symbol("&&(t="["+xm(Gs(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||Am&&e.name!==t)&&(Mi?Sn(e,"name",{value:t,configurable:!0}):e.name=t),Mm&&r&&Jr(r,"arity")&&e.length!==r.arity&&Sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?Mi&&Sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Lm(e);return Jr(n,"source")||(n.source=Dm(Fm,typeof t=="string"?t:"")),e};Function.prototype.toString=Bm(function(){return Cm(this)&&Um(this).source||jm(this)},"toString");var df=cf.exports,zm=Y,Hm=De,Km=df,Gm=bo,Pe=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(zm(r)&&Km(r,i,n),n.global)a?e[t]=r:Gm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Hm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},hf={},Wm=Ql,Vm=Eo,Zm=Vm.concat("length","prototype");hf.f=Object.getOwnPropertyNames||function(t){return Wm(t,Zm)};var jo={};jo.f=Object.getOwnPropertySymbols;var Jm=Te,Ym=K,Xm=hf,qm=jo,Qm=je,eg=Ym([].concat),tg=Jm("Reflect","ownKeys")||function(t){var r=Xm.f(Qm(t)),n=qm.f;return n?eg(r,n(t)):r},Ws=$e,rg=tg,ng=ko,ag=De,vf=function(e,t,r){for(var n=rg(t),a=ag.f,i=ng.f,o=0;o<n.length;o++){var s=n[o];!Ws(e,s)&&!(r&&Ws(r,s))&&a(e,s,i(t,s))}},ig=re,og=Y,sg=/#|\.prototype\./,Dr=function(e,t){var r=ug[cg(e)];return r===fg?!0:r===lg?!1:og(t)?ig(t):!!t},cg=Dr.normalize=function(e){return String(e).replace(sg,".").toLowerCase()},ug=Dr.data={},lg=Dr.NATIVE="N",fg=Dr.POLYFILL="P",pf=Dr,Yr=G,dg=ko.f,hg=bt,vg=Pe,pg=bo,mg=vf,gg=pf,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Yr:a?o=Yr[r]||pg(r,{}):o=Yr[r]&&Yr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=dg(o,s),u=l&&l.value):u=o[s],i=gg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;mg(f,u)}(e.sham||u&&u.sham)&&hg(f,"sham",!0),vg(o,s,f,e)}},yg=re,wg=!yg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bg=$e,Sg=Y,$g=Yn,Ig=Oo,Tg=wg,Vs=Ig("IE_PROTO"),Fi=Object,Pg=Fi.prototype,Lo=Tg?Fi.getPrototypeOf:function(e){var t=$g(e);if(bg(t,Vs))return t[Vs];var r=t.constructor;return Sg(r)&&t instanceof r?r.prototype:t instanceof Fi?Pg:null},Eg=re,Og=Y,kg=Ie,Zs=Lo,_g=Pe,Rg=ne,Bi=Rg("iterator"),mf=!1,pt,Ca,Aa;[].keys&&(Aa=[].keys(),"next"in Aa?(Ca=Zs(Zs(Aa)),Ca!==Object.prototype&&(pt=Ca)):mf=!0);var Cg=!kg(pt)||Eg(function(){var e={};return pt[Bi].call(e)!==e});Cg&&(pt={});Og(pt[Bi])||_g(pt,Bi,function(){return this});var gf={IteratorPrototype:pt,BUGGY_SAFARI_ITERATORS:mf},Ag=De.f,jg=$e,Lg=ne,Js=Lg("toStringTag"),er=function(e,t,r){e&&!r&&(e=e.prototype),e&&!jg(e,Js)&&Ag(e,Js,{configurable:!0,value:t})},Ug=gf.IteratorPrototype,Ng=ea,xg=wt,Dg=er,Mg=xr,Fg=function(){return this},yf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Ng(Ug,{next:xg(+!n,r)}),Dg(e,a,!1),Mg[a]=Fg,e},Bg=K,zg=Le,Hg=function(e,t,r){try{return Bg(zg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Kg=Ie,Gg=function(e){return Kg(e)||e===null},Wg=Gg,Vg=String,Zg=TypeError,Jg=function(e){if(Wg(e))return e;throw new Zg("Can't set "+Vg(e)+" as a prototype")},Yg=Hg,Xg=Ie,qg=Jn,Qg=Jg,Uo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Yg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return qg(a),Qg(i),Xg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),ey=Q,ty=ie,wf=lf,ry=Y,ny=yf,Ys=Lo,Xs=Uo,ay=er,iy=bt,ja=Pe,oy=ne,sy=xr,bf=gf,cy=wf.PROPER,uy=wf.CONFIGURABLE,qs=bf.IteratorPrototype,Xr=bf.BUGGY_SAFARI_ITERATORS,cr=oy("iterator"),Qs="keys",ur="values",ec="entries",ly=function(){return this},Sf=function(e,t,r,n,a,i,o){ny(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Xr&&T&&T in l)return l[T];switch(T){case Qs:return function(){return new r(this,T)};case ur:return function(){return new r(this,T)};case ec:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[cr]||l["@@iterator"]||a&&l[a],d=!Xr&&c||s(a),h=t==="Array"&&l.entries||c,v,b,g;if(h&&(v=Ys(h.call(new e)),v!==Object.prototype&&v.next&&(Ys(v)!==qs&&(Xs?Xs(v,qs):ry(v[cr])||ja(v,cr,ly)),ay(v,u,!0))),cy&&a===ur&&c&&c.name!==ur&&(uy?iy(l,"name",ur):(f=!0,d=function(){return ty(c,this)})),a)if(b={values:s(ur),keys:i?d:s(Qs),entries:s(ec)},o)for(g in b)(Xr||f||!(g in l))&&ja(l,g,b[g]);else ey({target:t,proto:!0,forced:Xr||f},b);return l[cr]!==d&&ja(l,cr,d,{name:a}),sy[t]=d,b},No=function(e,t){return{value:e,done:t}},fy=Ur,xo=Qp,tc=xr,$f=Qt,dy=De.f,hy=Sf,qr=No,vy=ae,If="Array Iterator",py=$f.set,my=$f.getterFor(If),gy=hy(Array,"Array",function(e,t){py(this,{type:If,target:fy(e),index:0,kind:t})},function(){var e=my(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,qr(void 0,!0);switch(e.kind){case"keys":return qr(r,!1);case"values":return qr(t[r],!1)}return qr([r,t[r]],!1)},"values"),rc=tc.Arguments=tc.Array;xo("keys");xo("values");xo("entries");if(vy&&rc.name!=="values")try{dy(rc,"name",{value:"values"})}catch{}var yy=Q,wy=K,by=ql,Sy=RangeError,nc=String.fromCharCode,ac=String.fromCodePoint,$y=wy([].join),Iy=!!ac&&ac.length!==1;yy({target:"String",stat:!0,arity:1,forced:Iy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],by(i,1114111)!==i)throw new Sy(i+" is not a valid code point");r[a]=i<65536?nc(i):nc(((i-=65536)>>10)+55296,i%1024+56320)}return $y(r,"")}});var ic=G,Ty=ae,Py=Object.getOwnPropertyDescriptor,Tf=function(e){if(!Ty)return ic[e];var t=Py(ic,e);return t&&t.value},Ey=re,Oy=ne,ky=ae,oc=ev,_y=Oy("iterator"),ta=!Ey(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),oc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(oc||!ky)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[_y]||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"}),sc=df,Ry=De,ra=function(e,t,r){return r.get&&sc(r.get,t,{getter:!0}),r.set&&sc(r.set,t,{setter:!0}),Ry.f(e,t,r)},Cy=Pe,Ay=function(e,t,r){for(var n in t)Cy(e,n,t[n],r);return e},jy=qn,Ly=TypeError,Do=function(e,t){if(jy(t,e))return e;throw new Ly("Incorrect invocation")},Uy=Vn,Ny=K,xy=function(e){if(Uy(e)==="Function")return Ny(e)},cc=xy,Dy=Le,My=Wn,Fy=cc(cc.bind),tr=function(e,t){return Dy(e),t===void 0?e:My?Fy(e,t):function(){return e.apply(t,arguments)}},By=ne,zy=By("toStringTag"),Pf={};Pf[zy]="z";var Mo=String(Pf)==="[object z]",Hy=Mo,Ky=Y,$n=Vn,Gy=ne,Wy=Gy("toStringTag"),Vy=Object,Zy=$n(function(){return arguments}())==="Arguments",Jy=function(e,t){try{return e[t]}catch{}},Mr=Hy?$n:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Jy(t=Vy(e),Wy))=="string"?r:Zy?$n(t):(n=$n(t))==="Object"&&Ky(t.callee)?"Arguments":n},Yy=Mr,Xy=String,Ze=function(e){if(Yy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Xy(e)},qy=Mr,uc=$o,Qy=Zn,ew=xr,tw=ne,rw=tw("iterator"),na=function(e){if(!Qy(e))return uc(e,rw)||uc(e,"@@iterator")||ew[qy(e)]},nw=ie,aw=Le,iw=je,ow=Qn,sw=na,cw=TypeError,Fo=function(e,t){var r=arguments.length<2?sw(e):t;if(aw(r))return iw(nw(r,e));throw new cw(ow(e)+" is not iterable")},uw=TypeError,St=function(e,t){if(e<t)throw new uw("Not enough arguments");return e},lw=K,aa=lw([].slice),lc=aa,fw=Math.floor,zi=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=fw(r/2),s=zi(lc(e,0,o),t),u=zi(lc(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},dw=zi,Hi=Q,Ef=G,Bo=Tf,hw=Te,Qr=ie,Ae=K,Sr=ae,Of=ta,kf=Pe,vw=ra,pw=Ay,mw=er,gw=yf,zo=Qt,_f=Do,La=Y,yw=$e,ww=tr,bw=Mr,Sw=je,Rf=Ie,se=Ze,$w=ea,fc=wt,dc=Fo,Iw=na,en=No,Pt=St,Tw=ne,Pw=dw,Ew=Tw("iterator"),rr="URLSearchParams",Cf=rr+"Iterator",Af=zo.set,be=zo.getterFor(rr),Ow=zo.getterFor(Cf),hc=Bo("fetch"),An=Bo("Request"),$r=Bo("Headers"),Ua=An&&An.prototype,vc=$r&&$r.prototype,kw=Ef.TypeError,_w=Ef.encodeURIComponent,Rw=String.fromCharCode,Cw=hw("String","fromCodePoint"),Aw=parseInt,In=Ae("".charAt),pc=Ae([].join),Qe=Ae([].push),jf=Ae("".replace),jw=Ae([].shift),mc=Ae([].splice),gc=Ae("".split),Lf=Ae("".slice),Lw=Ae(/./.exec),Uw=/\+/g,Na="�",Nw=/^[0-9a-f]+$/i,yc=function(e,t){var r=Lf(e,t,t+2);return Lw(Nw,r)?Aw(r,16):NaN},xw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},Dw=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},wc=function(e){e=jf(e,Uw," ");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 i=yc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=xw(i);if(o===0)a=Rw(i);else{if(o===1||o>4){r+=Na,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||In(e,n)!=="%"));){var f=yc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Qe(s,f),n+=2,u++}if(s.length!==o){r+=Na;continue}var l=Dw(s);l===null?r+=Na:a=Cw(l)}}r+=a,n++}return r},Mw=/[!'()~]|%20/g,Fw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Bw=function(e){return Fw[e]},bc=function(e){return jf(_w(e),Mw,Bw)},xa=gw(function(t,r){Af(this,{type:Cf,target:be(t).entries,index:0,kind:r})},rr,function(){var t=Ow(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),Uf=function(e){this.entries=[],this.url=null,e!==void 0&&(Rf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?In(e,0)==="?"?Lf(e,1):e:se(e)))};Uf.prototype={type:rr,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Iw(e),n,a,i,o,s,u,f;if(r)for(n=dc(e,r),a=n.next;!(i=Qr(a,n)).done;){if(o=dc(Sw(i.value)),s=o.next,(u=Qr(s,o)).done||(f=Qr(s,o)).done||!Qr(s,o).done)throw new kw("Expected sequence with length 2");Qe(t,{key:se(u.value),value:se(f.value)})}else for(var l in e)yw(e,l)&&Qe(t,{key:l,value:se(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=gc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=gc(a,"="),Qe(t,{key:wc(jw(i)),value:wc(pc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Qe(t,bc(n.key)+"="+bc(n.value));return pc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ia=function(){_f(this,Ht);var t=arguments.length>0?arguments[0]:void 0,r=Af(this,new Uf(t));Sr||(this.size=r.entries.length)},Ht=ia.prototype;pw(Ht,{append:function(t,r){var n=be(this);Pt(arguments.length,2),Qe(n.entries,{key:se(t),value:se(r)}),Sr||this.length++,n.updateURL()},delete:function(e){for(var t=be(this),r=Pt(arguments.length,1),n=t.entries,a=se(e),i=r<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(mc(n,s,1),o!==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=se(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=se(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Qe(a,r[i].value);return a},has:function(t){for(var r=be(this).entries,n=Pt(arguments.length,1),a=se(t),i=n<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=be(this);Pt(arguments.length,1);for(var a=n.entries,i=!1,o=se(t),s=se(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?mc(a,u--,1):(i=!0,f.value=s));i||Qe(a,{key:o,value:s}),Sr||(this.size=a.length),n.updateURL()},sort:function(){var t=be(this);Pw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=be(this).entries,n=ww(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new xa(this,"keys")},values:function(){return new xa(this,"values")},entries:function(){return new xa(this,"entries")}},{enumerable:!0});kf(Ht,Ew,Ht.entries,{name:"entries"});kf(Ht,"toString",function(){return be(this).serialize()},{enumerable:!0});Sr&&vw(Ht,"size",{get:function(){return be(this).entries.length},configurable:!0,enumerable:!0});mw(ia,rr);Hi({global:!0,constructor:!0,forced:!Of},{URLSearchParams:ia});if(!Of&&La($r)){var zw=Ae(vc.has),Hw=Ae(vc.set),Sc=function(e){if(Rf(e)){var t=e.body,r;if(bw(t)===rr)return r=e.headers?new $r(e.headers):new $r,zw(r,"content-type")||Hw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),$w(e,{body:fc(0,se(t)),headers:fc(0,r)})}return e};if(La(hc)&&Hi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return hc(t,arguments.length>1?Sc(arguments[1]):{})}}),La(An)){var Da=function(t){return _f(this,Ua),new An(t,arguments.length>1?Sc(arguments[1]):{})};Ua.constructor=Da,Da.prototype=Ua,Hi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Da})}}var Kw={URLSearchParams:ia,getState:be},Gw=Pe,oa=K,$c=Ze,Ww=St,Nf=URLSearchParams,sa=Nf.prototype,Vw=oa(sa.append),Ic=oa(sa.delete),Zw=oa(sa.forEach),Jw=oa([].push),Ho=new Nf("a=1&a=2&b=3");Ho.delete("a",1);Ho.delete("b",void 0);Ho+""!="a=2"&&Gw(sa,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Ic(this,e);var n=[];Zw(this,function(c,d){Jw(n,{key:d,value:c})}),Ww(t,1);for(var a=$c(e),i=$c(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,Ic(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Vw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Yw=Pe,xf=K,Xw=Ze,qw=St,Df=URLSearchParams,Ko=Df.prototype,Qw=xf(Ko.getAll),eb=xf(Ko.has),Tc=new Df("a=1");(Tc.has("a",2)||!Tc.has("a",void 0))&&Yw(Ko,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return eb(this,t);var a=Qw(this,t);qw(r,1);for(var i=Xw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var tb=ae,rb=K,nb=ra,Ki=URLSearchParams.prototype,ab=rb(Ki.forEach);tb&&!("size"in Ki)&&nb(Ki,"size",{get:function(){var t=0;return ab(this,function(){t++}),t},configurable:!0,enumerable:!0});var ib=G,Go=ib,ob=Go;ob.URLSearchParams;var Wo=K,sb=Io,cb=Ze,ub=Jn,lb=Wo("".charAt),Pc=Wo("".charCodeAt),fb=Wo("".slice),Ec=function(e){return function(t,r){var n=cb(ub(t)),a=sb(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=Pc(n,a),o<55296||o>56319||a+1===i||(s=Pc(n,a+1))<56320||s>57343?e?lb(n,a):o:e?fb(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},Mf={codeAt:Ec(!1),charAt:Ec(!0)},db=Mf.charAt,hb=Ze,Ff=Qt,vb=Sf,Oc=No,Bf="String Iterator",pb=Ff.set,mb=Ff.getterFor(Bf);vb(String,"String",function(e){pb(this,{type:Bf,string:hb(e),index:0})},function(){var t=mb(this),r=t.string,n=t.index,a;return n>=r.length?Oc(void 0,!0):(a=db(r,n),t.index+=a.length,Oc(a,!1))});var kc=ae,gb=K,yb=ie,wb=re,Ma=ef,bb=jo,Sb=_o,$b=Yn,Ib=Ml,Et=Object.assign,_c=Object.defineProperty,Tb=gb([].concat),Pb=!Et||wb(function(){if(kc&&Et({b:1},Et(_c({},"a",{enumerable:!0,get:function(){_c(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||Ma(Et({},t)).join("")!==n})?function(t,r){for(var n=$b(t),a=arguments.length,i=1,o=bb.f,s=Sb.f;a>i;)for(var u=Ib(arguments[i++]),f=o?Tb(Ma(u),o(u)):Ma(u),l=f.length,c=0,d;l>c;)d=f[c++],(!kc||yb(s,u,d))&&(n[d]=u[d]);return n}:Et,Eb=ie,Rc=je,Ob=$o,zf=function(e,t,r){var n,a;Rc(e);try{if(n=Ob(e,"return"),!n){if(t==="throw")throw r;return r}n=Eb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Rc(n),r},kb=je,_b=zf,Rb=function(e,t,r,n){try{return n?t(kb(r)[0],r[1]):t(r)}catch(a){_b(e,"throw",a)}},Cb=ne,Ab=xr,jb=Cb("iterator"),Lb=Array.prototype,Hf=function(e){return e!==void 0&&(Ab.Array===e||Lb[jb]===e)},Ub=K,Nb=re,Kf=Y,xb=Mr,Db=Te,Mb=Co,Gf=function(){},Wf=Db("Reflect","construct"),Vo=/^\s*(?:class|function)\b/,Fb=Ub(Vo.exec),Bb=!Vo.test(Gf),lr=function(t){if(!Kf(t))return!1;try{return Wf(Gf,[],t),!0}catch{return!1}},Vf=function(t){if(!Kf(t))return!1;switch(xb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Bb||!!Fb(Vo,Mb(t))}catch{return!0}};Vf.sham=!0;var Zf=!Wf||Nb(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?Vf:lr,zb=ae,Hb=De,Kb=wt,Gb=function(e,t,r){zb?Hb.f(e,t,Kb(0,r)):e[t]=r},Wb=tr,Vb=ie,Zb=Yn,Jb=Rb,Yb=Hf,Xb=Zf,qb=To,Cc=Gb,Qb=Fo,eS=na,Ac=Array,tS=function(t){var r=Zb(t),n=Xb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Wb(i,a>2?arguments[2]:void 0));var s=eS(r),u=0,f,l,c,d,h,v;if(s&&!(this===Ac&&Yb(s)))for(l=n?new this:[],d=Qb(r,s),h=d.next;!(c=Vb(h,d)).done;u++)v=o?Jb(d,i,[c.value,u],!0):c.value,Cc(l,u,v);else for(f=qb(r),l=n?new this(f):Ac(f);f>u;u++)v=o?i(r[u],u):r[u],Cc(l,u,v);return l.length=u,l},$t=K,Fa=2147483647,Ir=36,Jf=1,Gi=26,rS=38,nS=700,aS=72,iS=128,oS="-",sS=/[^\0-\u007E]/,Yf=/[.\u3002\uFF0E\uFF61]/g,jc="Overflow: input needs wider integers to process",Ba=Ir-Jf,Lc=RangeError,cS=$t(Yf.exec),Ut=Math.floor,za=String.fromCharCode,Uc=$t("".charCodeAt),Xf=$t([].join),et=$t([].push),uS=$t("".replace),lS=$t("".split),fS=$t("".toLowerCase),dS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Uc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Uc(e,r++);(i&64512)===56320?et(t,((a&1023)<<10)+(i&1023)+65536):(et(t,a),r--)}else et(t,a)}return t},Nc=function(e){return e+22+75*(e<26)},hS=function(e,t,r){var n=0;for(e=r?Ut(e/nS):e>>1,e+=Ut(e/t);e>Ba*Gi>>1;)e=Ut(e/Ba),n+=Ir;return Ut(n+(Ba+1)*e/(e+rS))},vS=function(e){var t=[];e=dS(e);var r=e.length,n=iS,a=0,i=aS,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&et(t,za(s));var u=t.length,f=u;for(u&&et(t,oS);f<r;){var l=Fa;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Ut((Fa-a)/c))throw new Lc(jc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Fa)throw new Lc(jc);if(s===n){for(var d=a,h=Ir;;){var v=h<=i?Jf:h>=i+Gi?Gi:h-i;if(d<v)break;var b=d-v,g=Ir-v;et(t,za(Nc(v+b%g))),d=Ut(b/g),h+=Ir}et(t,za(Nc(d))),i=hS(a,c,f===u),a=0,f++}}a++,n++}return Xf(t,"")},pS=function(e){var t=[],r=lS(uS(fS(e),Yf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],et(t,cS(sS,a)?"xn--"+vS(a):a);return Xf(t,".")},mS=Q,Zo=ae,gS=ta,Jo=G,xc=tr,Ee=K,jn=Pe,ge=ra,yS=Do,Wi=$e,Yo=Pb,Ot=tS,Oe=aa,wS=Mf.codeAt,bS=pS,ze=Ze,SS=er,$S=St,qf=Kw,Qf=Qt,IS=Qf.set,Ln=Qf.getterFor("URL"),TS=qf.URLSearchParams,PS=qf.getState,fr=Jo.URL,Vi=Jo.TypeError,Un=Jo.parseInt,ES=Math.floor,Dc=Math.pow,Se=Ee("".charAt),Ce=Ee(/./.exec),gr=Ee([].join),OS=Ee(1 .toString),kS=Ee([].pop),Ct=Ee([].push),Ha=Ee("".replace),_S=Ee([].shift),RS=Ee("".split),Tr=Ee("".slice),Nn=Ee("".toLowerCase),CS=Ee([].unshift),AS="Invalid authority",Ka="Invalid scheme",at="Invalid host",Mc="Invalid port",ed=/[a-z]/i,jS=/[\d+-.a-z]/i,Zi=/\d/,LS=/^0x/i,US=/^[0-7]+$/,NS=/^\d+$/,td=/^[\da-f]+$/i,xS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,DS=/[\0\t\n\r #/:<>?@[\\\]^|]/,MS=/^[\u0000-\u0020]+/,FS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,BS=/[\t\n\r]/g,ye,zS=function(e){var t=RS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&Se(i,0)==="0"&&(o=Ce(LS,i)?16:8,i=Tr(i,o===8?1:2)),i==="")s=0;else{if(!Ce(o===10?NS:o===8?US:td,i))return e;s=Un(i,o)}Ct(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Dc(256,5-r))return null}else if(s>255)return null;for(u=kS(n),a=0;a<n.length;a++)u+=n[a]*Dc(256,3-a);return u},HS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return Se(e,a)};if(d()===":"){if(Se(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ce(td,d());)i=i*16+Un(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ce(Zi,d()))return;for(;Ce(Zi,d());){if(f=Un(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},KS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},dr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)CS(t,e%256),e=ES(e/256);return gr(t,".")}if(typeof e=="object"){for(t="",n=KS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=OS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Tn={},rd=Yo({},Tn,{" ":1,'"':1,"<":1,">":1,"`":1}),nd=Yo({},rd,{"#":1,"?":1,"{":1,"}":1}),Ga=Yo({},nd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ye=function(e,t){var r=wS(e,0);return r>32&&r<127&&!Wi(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(ed,Se(e,0))&&((r=Se(e,1))===":"||!t&&r==="|")},Fc=function(e){var t;return e.length>1&&yr(Tr(e,0,2))&&(e.length===2||(t=Se(e,2))==="/"||t==="\\"||t==="?"||t==="#")},GS=function(e){return e==="."||Nn(e)==="%2e"},WS=function(e){return e=Nn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Wa={},Bc={},Va={},zc={},Hc={},Za={},Kc={},Gc={},rn={},nn={},Ja={},Ya={},Xa={},qa={},Wc={},Qa={},kt={},Ne={},Vc={},it={},Be={},Xo=function(e,t,r){var n=ze(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Vi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Xo(r,!0)),i=this.parse(n,null,a),i)throw new Vi(i);o=PS(new TS),o.bindURL(this),this.searchParams=o}};Xo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Wa,i=0,o="",s=!1,u=!1,f=!1,l,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=Ha(e,MS,""),e=Ha(e,FS,"$1")),e=Ha(e,BS,""),l=Ot(e);i<=l.length;){switch(c=l[i],a){case Wa:if(c&&Ce(ed,c))o+=Nn(c),a=Bc;else{if(t)return Ka;a=Va;continue}break;case Bc:if(c&&(Ce(jS,c)||c==="+"||c==="-"||c==="."))o+=Nn(c);else if(c===":"){if(t&&(n.isSpecial()!==Wi(tn,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&tn[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=qa:n.isSpecial()&&r&&r.scheme===n.scheme?a=zc:n.isSpecial()?a=Gc:l[i+1]==="/"?(a=Hc,i++):(n.cannotBeABaseURL=!0,Ct(n.path,""),a=Vc)}else{if(t)return Ka;o="",a=Va,i=0;continue}break;case Va:if(!r||r.cannotBeABaseURL&&c!=="#")return Ka;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Oe(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Be;break}a=r.scheme==="file"?qa:Za;continue;case zc:if(c==="/"&&l[i+1]==="/")a=rn,i++;else{a=Za;continue}break;case Hc:if(c==="/"){a=nn;break}else{a=Ne;continue}case Za: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=Oe(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Kc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.query="",a=it;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(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=Oe(r.path),n.path.length--,a=Ne;continue}break;case Kc: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=Ne;continue}break;case Gc:if(a=rn,c!=="/"||Se(o,i+1)!=="/")continue;i++;break;case rn:if(c!=="/"&&c!=="\\"){a=nn;continue}break;case nn:if(c==="@"){s&&(o="%40"+o),s=!0,d=Ot(o);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ye(b,Ga);f?n.password+=g:n.username+=g}o=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return AS;i-=Ot(o).length+1,o="",a=Ja}else o+=c;break;case Ja:case Ya:if(t&&n.scheme==="file"){a=Qa;continue}else if(c===":"&&!u){if(o==="")return at;if(h=n.parseHost(o),h)return h;if(o="",a=Xa,t===Ya)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return at;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=kt,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Xa:if(Ce(Zi,c))o+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=Un(o,10);if(T>65535)return Mc;n.port=n.isSpecial()&&T===tn[n.scheme]?null:T,o=""}if(t)return;a=kt;continue}else return Mc;break;case qa:if(n.scheme="file",c==="/"||c==="\\")a=Wc;else if(r&&r.scheme==="file")switch(c){case ye:n.host=r.host,n.path=Oe(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Oe(r.path),n.query="",a=it;break;case"#":n.host=r.host,n.path=Oe(r.path),n.query=r.query,n.fragment="",a=Be;break;default:Fc(gr(Oe(l,i),""))||(n.host=r.host,n.path=Oe(r.path),n.shortenPath()),a=Ne;continue}else{a=Ne;continue}break;case Wc:if(c==="/"||c==="\\"){a=Qa;break}r&&r.scheme==="file"&&!Fc(gr(Oe(l,i),""))&&(yr(r.path[0],!0)?Ct(n.path,r.path[0]):n.host=r.host),a=Ne;continue;case Qa:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&yr(o))a=Ne;else if(o===""){if(n.host="",t)return;a=kt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=kt}continue}else o+=c;break;case kt:if(n.isSpecial()){if(a=Ne,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=it;else if(!t&&c==="#")n.fragment="",a=Be;else if(c!==ye&&(a=Ne,c!=="/"))continue;break;case Ne:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(WS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,"")):GS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,""):(n.scheme==="file"&&!n.path.length&&yr(o)&&(n.host&&(n.host=""),o=Se(o,0)+":"),Ct(n.path,o)),o="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)_S(n.path);c==="?"?(n.query="",a=it):c==="#"&&(n.fragment="",a=Be)}else o+=Ye(c,nd);break;case Vc:c==="?"?(n.query="",a=it):c==="#"?(n.fragment="",a=Be):c!==ye&&(n.path[0]+=Ye(c,Tn));break;case it:!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,rd));break}i++}},parseHost:function(e){var t,r,n;if(Se(e,0)==="["){if(Se(e,e.length-1)!=="]"||(t=HS(Tr(e,1,-1)),!t))return at;this.host=t}else if(this.isSpecial()){if(e=bS(e),Ce(xS,e)||(t=zS(e),t===null))return at;this.host=t}else{if(Ce(DS,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 Wi(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,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=dr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+gr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Vi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Kt(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)+":",Wa)},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],Ga)}},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],Ga)}},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,Ja)},getHostname:function(){var e=this.host;return e===null?"":dr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ya)},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:(Se(e,0)==="?"&&(e=Tr(e,1)),this.query="",this.parse(e,it)),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}Se(e,0)==="#"&&(e=Tr(e,1)),this.fragment="",this.parse(e,Be)},update:function(){this.query=this.searchParams.serialize()||null}};var Kt=function(t){var r=yS(this,oe),n=$S(arguments.length,1)>1?arguments[1]:void 0,a=IS(r,new Xo(t,!1,n));Zo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},oe=Kt.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}};Zo&&(ge(oe,"href",we("serialize","setHref")),ge(oe,"origin",we("getOrigin")),ge(oe,"protocol",we("getProtocol","setProtocol")),ge(oe,"username",we("getUsername","setUsername")),ge(oe,"password",we("getPassword","setPassword")),ge(oe,"host",we("getHost","setHost")),ge(oe,"hostname",we("getHostname","setHostname")),ge(oe,"port",we("getPort","setPort")),ge(oe,"pathname",we("getPathname","setPathname")),ge(oe,"search",we("getSearch","setSearch")),ge(oe,"searchParams",we("getSearchParams")),ge(oe,"hash",we("getHash","setHash")));jn(oe,"toJSON",function(){return Ln(this).serialize()},{enumerable:!0});jn(oe,"toString",function(){return Ln(this).serialize()},{enumerable:!0});if(fr){var Zc=fr.createObjectURL,Jc=fr.revokeObjectURL;Zc&&jn(Kt,"createObjectURL",xc(Zc,fr)),Jc&&jn(Kt,"revokeObjectURL",xc(Jc,fr))}SS(Kt,"URL");mS({global:!0,constructor:!0,forced:!gS,sham:!Zo},{URL:Kt});var VS=Q,ZS=Te,ad=re,JS=St,Yc=Ze,YS=ta,qo=ZS("URL"),XS=YS&&ad(function(){qo.canParse()}),qS=ad(function(){return qo.canParse.length!==1});VS({target:"URL",stat:!0,forced:!XS||qS},{canParse:function(t){var r=JS(arguments.length,1),n=Yc(t),a=r<2||arguments[1]===void 0?void 0:Yc(arguments[1]);try{return!!new qo(n,a)}catch{return!1}}});var QS=Q,e$=Te,t$=St,Xc=Ze,r$=ta,n$=e$("URL");QS({target:"URL",stat:!0,forced:!r$},{parse:function(t){var r=t$(arguments.length,1),n=Xc(t),a=r<2||arguments[1]===void 0?void 0:Xc(arguments[1]);try{return new n$(n,a)}catch{return null}}});var a$=Q,i$=ie;a$({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i$(URL.prototype.toString,this)}});var o$=Go;o$.URL;var s$={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},c$=Xn,ei=c$("span").classList,qc=ei&&ei.constructor&&ei.constructor.prototype,u$=qc===Object.prototype?void 0:qc,Qc=G,id=s$,l$=u$,wr=gy,eu=bt,f$=er,d$=ne,ti=d$("iterator"),ri=wr.values,od=function(e,t){if(e){if(e[ti]!==ri)try{eu(e,ti,ri)}catch{e[ti]=ri}if(f$(e,t,!0),id[t]){for(var r in wr)if(e[r]!==wr[r])try{eu(e,r,wr[r])}catch{e[r]=wr[r]}}}};for(var ni in id)od(Qc[ni]&&Qc[ni].prototype,ni);od(l$,"DOMTokenList");var h$=Ie,v$=bt,p$=function(e,t){h$(t)&&"cause"in t&&v$(e,"cause",t.cause)},m$=K,sd=Error,g$=m$("".replace),y$=function(e){return String(new sd(e).stack)}("zxcasd"),cd=/\n\s*at [^:]*:[^\n]*/,w$=cd.test(y$),b$=function(e,t){if(w$&&typeof e=="string"&&!sd.prepareStackTrace)for(;t--;)e=g$(e,cd,"");return e},S$=re,$$=wt,I$=!S$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",$$(1,7)),e.stack!==7):!0}),T$=bt,P$=b$,E$=I$,tu=Error.captureStackTrace,O$=function(e,t,r,n){E$&&(tu?tu(e,t):T$(e,"stack",P$(r,n)))},k$=tr,_$=ie,R$=je,C$=Qn,A$=Hf,j$=To,ru=qn,L$=Fo,U$=na,nu=zf,N$=TypeError,Pn=function(e,t){this.stopped=e,this.result=t},au=Pn.prototype,Fr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=k$(t,n),f,l,c,d,h,v,b,g=function(I){return f&&nu(f,"normal",I),new Pn(!0,I)},T=function(I){return a?(R$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=U$(e),!l)throw new N$(C$(e)+" is not iterable");if(A$(l)){for(c=0,d=j$(e);d>c;c++)if(h=T(e[c]),h&&ru(au,h))return h;return new Pn(!1)}f=L$(e,l)}for(v=i?e.next:f.next;!(b=_$(v,f)).done;){try{h=T(b.value)}catch(I){nu(f,"throw",I)}if(typeof h=="object"&&h&&ru(au,h))return h}return new Pn(!1)},x$=Ze,D$=function(e,t){return e===void 0?arguments.length<2?"":t:x$(e)},M$=Q,F$=qn,B$=Lo,xn=Uo,z$=vf,ud=ea,ai=bt,ii=wt,H$=p$,K$=O$,G$=Fr,W$=D$,V$=ne,Z$=V$("toStringTag"),Dn=Error,J$=[].push,Gt=function(t,r){var n=F$(oi,this),a;xn?a=xn(new Dn,n?B$(this):oi):(a=n?this:ud(oi),ai(a,Z$,"Error")),r!==void 0&&ai(a,"message",W$(r)),K$(a,Gt,a.stack,1),arguments.length>2&&H$(a,arguments[2]);var i=[];return G$(t,J$,{that:i}),ai(a,"errors",i),a};xn?xn(Gt,Dn):z$(Gt,Dn,{name:!0});var oi=Gt.prototype=ud(Dn.prototype,{constructor:ii(1,Gt),message:ii(1,""),name:ii(1,"AggregateError")});M$({global:!0,constructor:!0,arity:2},{AggregateError:Gt});var Y$=Mo,X$=Mr,q$=Y$?{}.toString:function(){return"[object "+X$(this)+"]"},Q$=Mo,eI=Pe,tI=q$;Q$||eI(Object.prototype,"toString",tI,{unsafe:!0});var hr=G,rI=Nr,nI=Vn,an=function(e){return rI.slice(0,e.length)===e},ld=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":nI(hr.process)==="process"?"NODE":hr.window&&hr.document?"BROWSER":"REST"}(),aI=ld,Qo=aI==="NODE",iI=Te,oI=ra,sI=ne,cI=ae,iu=sI("species"),uI=function(e){var t=iI(e);cI&&t&&!t[iu]&&oI(t,iu,{configurable:!0,get:function(){return this}})},lI=Zf,fI=Qn,dI=TypeError,hI=function(e){if(lI(e))return e;throw new dI(fI(e)+" is not a constructor")},ou=je,vI=hI,pI=Zn,mI=ne,gI=mI("species"),fd=function(e,t){var r=ou(e).constructor,n;return r===void 0||pI(n=ou(r)[gI])?t:vI(n)},yI=Wn,dd=Function.prototype,su=dd.apply,cu=dd.call,hd=typeof Reflect=="object"&&Reflect.apply||(yI?cu.bind(su):function(){return cu.apply(su,arguments)}),wI=Nr,vd=/(?:ipad|iphone|ipod).*applewebkit/i.test(wI),de=G,bI=hd,SI=tr,uu=Y,$I=$e,pd=re,lu=tf,II=aa,fu=Xn,TI=St,PI=vd,EI=Qo,Ji=de.setImmediate,Yi=de.clearImmediate,OI=de.process,si=de.Dispatch,kI=de.Function,du=de.MessageChannel,_I=de.String,ci=0,Pr={},hu="onreadystatechange",Ar,ot,ui,li;pd(function(){Ar=de.location});var es=function(e){if($I(Pr,e)){var t=Pr[e];delete Pr[e],t()}},fi=function(e){return function(){es(e)}},vu=function(e){es(e.data)},pu=function(e){de.postMessage(_I(e),Ar.protocol+"//"+Ar.host)};(!Ji||!Yi)&&(Ji=function(t){TI(arguments.length,1);var r=uu(t)?t:kI(t),n=II(arguments,1);return Pr[++ci]=function(){bI(r,void 0,n)},ot(ci),ci},Yi=function(t){delete Pr[t]},EI?ot=function(e){OI.nextTick(fi(e))}:si&&si.now?ot=function(e){si.now(fi(e))}:du&&!PI?(ui=new du,li=ui.port2,ui.port1.onmessage=vu,ot=SI(li.postMessage,li)):de.addEventListener&&uu(de.postMessage)&&!de.importScripts&&Ar&&Ar.protocol!=="file:"&&!pd(pu)?(ot=pu,de.addEventListener("message",vu,!1)):hu in fu("script")?ot=function(e){lu.appendChild(fu("script"))[hu]=function(){lu.removeChild(this),es(e)}}:ot=function(e){setTimeout(fi(e),0)});var md={set:Ji,clear:Yi},gd=function(){this.head=null,this.tail=null};gd.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 yd=gd,RI=Nr,CI=/ipad|iphone|ipod/i.test(RI)&&typeof Pebble<"u",AI=Nr,jI=/web0s(?!.*chrome)/i.test(AI),Wt=G,LI=Tf,mu=tr,di=md.set,UI=yd,NI=vd,xI=CI,DI=jI,hi=Qo,gu=Wt.MutationObserver||Wt.WebKitMutationObserver,yu=Wt.document,wu=Wt.process,on=Wt.Promise,Xi=LI("queueMicrotask"),_t,vi,pi,sn,bu;if(!Xi){var cn=new UI,un=function(){var e,t;for(hi&&(e=wu.domain)&&e.exit();t=cn.get();)try{t()}catch(r){throw cn.head&&_t(),r}e&&e.enter()};!NI&&!hi&&!DI&&gu&&yu?(vi=!0,pi=yu.createTextNode(""),new gu(un).observe(pi,{characterData:!0}),_t=function(){pi.data=vi=!vi}):!xI&&on&&on.resolve?(sn=on.resolve(void 0),sn.constructor=on,bu=mu(sn.then,sn),_t=function(){bu(un)}):hi?_t=function(){wu.nextTick(un)}:(di=mu(di,Wt),_t=function(){di(un)}),Xi=function(e){cn.head||_t(),cn.add(e)}}var MI=Xi,FI=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}}},BI=G,Br=BI.Promise,zI=G,Er=Br,HI=Y,KI=pf,GI=Co,WI=ne,Su=ld,mi=Kl;Er&&Er.prototype;var VI=WI("species"),qi=!1,wd=HI(zI.PromiseRejectionEvent),ZI=KI("Promise",function(){var e=GI(Er),t=e!==String(Er);if(!t&&mi===66)return!0;if(!mi||mi<51||!/native code/.test(e)){var r=new Er(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[VI]=n,qi=r.then(function(){})instanceof n,!qi)return!0}return!t&&(Su==="BROWSER"||Su==="DENO")&&!wd}),zr={CONSTRUCTOR:ZI,REJECTION_EVENT:wd,SUBCLASSING:qi},Me={},$u=Le,JI=TypeError,YI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new JI("Bad Promise constructor");t=n,r=a}),this.resolve=$u(t),this.reject=$u(r)};Me.f=function(e){return new YI(e)};var XI=Q,Mn=Qo,nt=G,Vt=ie,Iu=Pe,Tu=Uo,qI=er,QI=uI,e0=Le,En=Y,t0=Ie,r0=Do,n0=fd,bd=md.set,ts=MI,a0=FI,i0=nr,o0=yd,Sd=Qt,Fn=Br,rs=zr,$d=Me,ca="Promise",Id=rs.CONSTRUCTOR,s0=rs.REJECTION_EVENT,c0=rs.SUBCLASSING,gi=Sd.getterFor(ca),u0=Sd.set,At=Fn&&Fn.prototype,ct=Fn,ln=At,Td=nt.TypeError,Qi=nt.document,ns=nt.process,eo=$d.f,l0=eo,f0=!!(Qi&&Qi.createEvent&&nt.dispatchEvent),Pd="unhandledrejection",d0="rejectionhandled",Pu=0,Ed=1,h0=2,as=1,Od=2,fn,Eu,v0,Ou,kd=function(e){var t;return t0(e)&&En(t=e.then)?t:!1},_d=function(e,t){var r=t.value,n=t.state===Ed,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===Od&&m0(t),t.rejection=as),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new Td("Promise-chain cycle")):(f=kd(u))?Vt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Rd=function(e,t){e.notified||(e.notified=!0,ts(function(){for(var r=e.reactions,n;n=r.get();)_d(n,e);e.notified=!1,t&&!e.rejection&&p0(e)}))},Cd=function(e,t,r){var n,a;f0?(n=Qi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),nt.dispatchEvent(n)):n={promise:t,reason:r},!s0&&(a=nt["on"+e])?a(n):e===Pd&&a0("Unhandled promise rejection",r)},p0=function(e){Vt(bd,nt,function(){var t=e.facade,r=e.value,n=ku(e),a;if(n&&(a=i0(function(){Mn?ns.emit("unhandledRejection",r,t):Cd(Pd,t,r)}),e.rejection=Mn||ku(e)?Od:as,a.error))throw a.value})},ku=function(e){return e.rejection!==as&&!e.parent},m0=function(e){Vt(bd,nt,function(){var t=e.facade;Mn?ns.emit("rejectionHandled",t):Cd(d0,t,e.value)})},Nt=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=h0,Rd(e,!0))},to=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new Td("Promise can't be resolved itself");var n=kd(t);n?ts(function(){var a={done:!1};try{Vt(n,t,Nt(to,a,e),Nt(Mt,a,e))}catch(i){Mt(a,i,e)}}):(e.value=t,e.state=Ed,Rd(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(Id&&(ct=function(t){r0(this,ln),e0(t),Vt(fn,this);var r=gi(this);try{t(Nt(to,r),Nt(Mt,r))}catch(n){Mt(r,n)}},ln=ct.prototype,fn=function(t){u0(this,{type:ca,done:!1,notified:!1,parent:!1,reactions:new o0,rejection:!1,state:Pu,value:null})},fn.prototype=Iu(ln,"then",function(t,r){var n=gi(this),a=eo(n0(this,ct));return n.parent=!0,a.ok=En(t)?t:!0,a.fail=En(r)&&r,a.domain=Mn?ns.domain:void 0,n.state===Pu?n.reactions.add(a):ts(function(){_d(a,n)}),a.promise}),Eu=function(){var e=new fn,t=gi(e);this.promise=e,this.resolve=Nt(to,t),this.reject=Nt(Mt,t)},$d.f=eo=function(e){return e===ct||e===v0?new Eu(e):l0(e)},En(Fn)&&At!==Object.prototype)){Ou=At.then,c0||Iu(At,"then",function(t,r){var n=this;return new ct(function(a,i){Vt(Ou,n,a,i)}).then(t,r)},{unsafe:!0});try{delete At.constructor}catch{}Tu&&Tu(At,ln)}XI({global:!0,constructor:!0,wrap:!0,forced:Id},{Promise:ct});qI(ct,ca,!1);QI(ca);var g0=ne,Ad=g0("iterator"),jd=!1;try{var y0=0,_u={next:function(){return{done:!!y0++}},return:function(){jd=!0}};_u[Ad]=function(){return this},Array.from(_u,function(){throw 2})}catch{}var w0=function(e,t){try{if(!t&&!jd)return!1}catch{return!1}var r=!1;try{var n={};n[Ad]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},b0=Br,S0=w0,$0=zr.CONSTRUCTOR,ua=$0||!S0(function(e){b0.all(e).then(void 0,function(){})}),I0=Q,T0=ie,P0=Le,E0=Me,O0=nr,k0=Fr,_0=ua;I0({target:"Promise",stat:!0,forced:_0},{all:function(t){var r=this,n=E0.f(r),a=n.resolve,i=n.reject,o=O0(function(){var s=P0(r.resolve),u=[],f=0,l=1;k0(t,function(c){var d=f++,h=!1;l++,T0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var R0=Q,C0=zr.CONSTRUCTOR,ro=Br,A0=Te,j0=Y,L0=Pe,Ru=ro&&ro.prototype;R0({target:"Promise",proto:!0,forced:C0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(j0(ro)){var Cu=A0("Promise").prototype.catch;Ru.catch!==Cu&&L0(Ru,"catch",Cu,{unsafe:!0})}var U0=Q,N0=ie,x0=Le,D0=Me,M0=nr,F0=Fr,B0=ua;U0({target:"Promise",stat:!0,forced:B0},{race:function(t){var r=this,n=D0.f(r),a=n.reject,i=M0(function(){var o=x0(r.resolve);F0(t,function(s){N0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var z0=Q,H0=Me,K0=zr.CONSTRUCTOR;z0({target:"Promise",stat:!0,forced:K0},{reject:function(t){var r=H0.f(this),n=r.reject;return n(t),r.promise}});var G0=je,W0=Ie,V0=Me,Ld=function(e,t){if(G0(e),W0(t)&&t.constructor===e)return t;var r=V0.f(e),n=r.resolve;return n(t),r.promise},Z0=Q,J0=Te,Y0=zr.CONSTRUCTOR,X0=Ld;J0("Promise");Z0({target:"Promise",stat:!0,forced:Y0},{resolve:function(t){return X0(this,t)}});var q0=Q,Q0=ie,eT=Le,tT=Me,rT=nr,nT=Fr,aT=ua;q0({target:"Promise",stat:!0,forced:aT},{allSettled:function(t){var r=this,n=tT.f(r),a=n.resolve,i=n.reject,o=rT(function(){var s=eT(r.resolve),u=[],f=0,l=1;nT(t,function(c){var d=f++,h=!1;l++,Q0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var iT=Q,oT=ie,sT=Le,cT=Te,uT=Me,lT=nr,fT=Fr,dT=ua,Au="No one promise resolved";iT({target:"Promise",stat:!0,forced:dT},{any:function(t){var r=this,n=cT("AggregateError"),a=uT.f(r),i=a.resolve,o=a.reject,s=lT(function(){var u=sT(r.resolve),f=[],l=0,c=1,d=!1;fT(t,function(h){var v=l++,b=!1;c++,oT(u,r,h).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[v]=g,--c||o(new n(f,Au)))})}),--c||o(new n(f,Au))});return s.error&&o(s.value),a.promise}});var hT=Q,vT=Me;hT({target:"Promise",stat:!0},{withResolvers:function(){var t=vT.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var pT=Q,Bn=Br,mT=re,Ud=Te,Nd=Y,gT=fd,ju=Ld,yT=Pe,no=Bn&&Bn.prototype,wT=!!Bn&&mT(function(){no.finally.call({then:function(){}},function(){})});pT({target:"Promise",proto:!0,real:!0,forced:wT},{finally:function(e){var t=gT(this,Ud("Promise")),r=Nd(e);return this.then(r?function(n){return ju(t,e()).then(function(){return n})}:e,r?function(n){return ju(t,e()).then(function(){throw n})}:e)}});if(Nd(Bn)){var Lu=Ud("Promise").prototype.finally;no.finally!==Lu&&yT(no,"finally",Lu,{unsafe:!0})}var bT=Go;bT.Promise;var ST=Q,$T=G,IT=hd,TT=aa,PT=Me,ET=Le,xd=nr,yi=$T.Promise,Uu=!1,OT=!yi||!yi.try||xd(function(){yi.try(function(e){Uu=e===8},8)}).error||!Uu;ST({target:"Promise",stat:!0,forced:OT},{try:function(e){var t=arguments.length>1?TT(arguments,1):[],r=PT.f(this),n=xd(function(){return IT(ET(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const Dd="sesamy-debug";function kT(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 _T(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 RT(e){kT(Dd,e.toString(),1)}function CT(){return _T(Dd)==="true"}function ce(e){CT()&&console.log(e)}function Ve(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});ce(`Triggering event: ${e}`),dispatchEvent(r)}function xe(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 is(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function os(e,t){return e(t={exports:{}},t.exports),t.exports}var st=os(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});is(st);var AT=is(os(function(e,t){var r=ut&&ut.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{I(h.next(y))}catch(p){b(p)}}function T(y){try{I(h.throw(y))}catch(p){b(p)}}function I(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=ut&&ut.__generator||function(l,c){var d,h,v,b,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function T(I){return function(y){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch(S){p=[6,S],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,y])}}},a=ut;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<l;h++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,v,b,g,T,I,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(b))!==null&&(y=JSON.parse(I)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var b,g,T;return n(this,function(I){switch(I.label){case 0:return[4,st.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(st.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(T)),st.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(st.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var v=!1,b=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,h,v,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,st.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),st.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],b=0;;){var g=h.keySync(b);if(g===null)break;v.push(g),b++}for(var T=!1,I=0;I<v.length;I++){var y=v[I];if(y.includes(i)){var p=h.getItemSync(y);if(p!==null){var S=JSON.parse(p);(S.timeRefreshed===void 0&&S.timeAcquired<d||S.timeRefreshed!==void 0&&S.timeRefreshed<d)&&(h.removeItemSync(y),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const jT={timeoutInSeconds:60},Md={name:"auth0-spa-js",version:"2.1.3"},Fd=()=>Date.now();let fe=class ao extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ao.prototype)}static fromPayload({error:t,error_description:r}){return new ao(t,r)}},LT=class Bd extends fe{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Bd.prototype)}},io=class zd extends fe{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,zd.prototype)}},UT=class Hd extends io{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Hd.prototype)}},NT=class Kd extends fe{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Kd.prototype)}},xT=class Gd extends fe{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Gd.prototype)}},Wd=class Vd extends fe{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Nu(t,["default"])}', scope: '${Nu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Vd.prototype)}};function Nu(e,t=[]){return e&&!t.includes(e)?e:""}const On=()=>window.crypto,wi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(On().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},xu=e=>btoa(e),oo=e=>{var{clientId:t}=e,r=xe(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Du=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),DT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},MT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([DT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},FT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},BT=async(e,t,r,n,a,i,o=1e4)=>a?FT(e,t,r,n,o,a,i):MT(e,n,o);async function zT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=xe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?oo(u):JSON.stringify(u);return await async function(l,c,d,h,v,b,g){let T,I=null;for(let k=0;k<3;k++)try{T=await BT(l,d,h,v,b,g,c),I=null;break}catch(M){I=M}if(I)throw I;const y=T.json,{error:p,error_description:S}=y,O=xe(y,["error","error_description"]),{ok:_}=T;if(!_){const k=S||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new xT(p,k,O.mfa_token):p==="missing_refresh_token"?new Wd(d,h):new fe(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Md))}},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 so{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new so({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new so({scope:r,audience:n,clientId:a})}},HT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Zd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},KT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Fd}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new 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,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new ft({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=ft.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},GT=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",WT=["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"],VT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Du(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],WT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Du(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 i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&vr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var dt=os(function(e,t){var r=ut&&ut.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});is(dt),dt.encode,dt.parse,dt.getAll;var ZT=dt.get,Jd=dt.set,Yd=dt.remove;const jt={get(e){const t=ZT(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),Jd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r)}},JT={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),Jd(`_legacy_${e}`,JSON.stringify(t),n),jt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r),jt.remove(e,t),jt.remove(`_legacy_${e}`,t)}},YT={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 XT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,h=l.length;d<h;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
2
|
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Mu,Fu,Bu,bi,qT=(Mu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Fu=null,Bu=!1,function(e){return bi=bi||XT(Mu,Fu,Bu),new Worker(bi,e)});const Si={};let QT=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 eP={memory:()=>new Zd().enclosedCache,localstorage:()=>new HT},zu=e=>eP[e],Hu=e=>{const{openUrl:t,onRedirect:r}=e,n=xe(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},$i=new AT;let tP=class{constructor(t){let r,n;if(this.userCache=new Zd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await $i.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",!zu(r))throw new Error(`Invalid cache location "${r}"`);n=zu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?jt:JT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:YT;var i;this.scope=dn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new GT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Fd,this.cacheManager=new KT(n,n.allKeys?void 0:new QT(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new qT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Md)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${oo(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return VT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=xu(wi()),i=xu(wi()),o=wi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await On().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,b,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:dn(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new NT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new UT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(le.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new le("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Hu(t),{openUrl:a,fragment:i,appState:o}=n,s=xe(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=xe(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new le("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new LT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new le("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:dn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=Si[o];return s||(s=i().finally(()=>{delete Si[o],s=null}),Si[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=xe(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>$i.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new io;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await $i.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({},jT),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=xe(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${oo(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Hu(t),{openUrl:n}=r,a=xe(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new le("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((v,b,g=60)=>new Promise((T,I)=>{const y=window.document.createElement("iframe");y.setAttribute("width","0"),y.setAttribute("height","0"),y.style.display="none";const p=()=>{window.document.body.contains(y)&&(window.document.body.removeChild(y),window.removeEventListener("message",S,!1))};let S;const O=setTimeout(()=>{I(new io),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(le.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",S,!1),setTimeout(p,2e3)},window.addEventListener("message",S,!1),window.document.body.appendChild(y),y.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new le("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new 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 Wd(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=xe(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:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await zT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function rP(e){const t=new tP(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 nP="sesamy.com",aP="sesamy.dev",iP="https://sesa.my",co="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?aP:nP}`}function uo(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let de,Xd,lo=!1,Ku=!1;const Zt="sesamyAccessToken",Ii="sesamyRefreshToken";async function Hr(){return lo?!0:new Promise((e,t)=>{const r=setTimeout(()=>{lo?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function oP(e){if(!e)return null;const t=localStorage.getItem(Ii);if(!t)return he("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(Ii),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Ii,i.refresh_token),localStorage.setItem(Zt,i.access_token),i.access_token}catch{qd()}}async function ss(){const e=localStorage.getItem(Zt);if(!e)return null;const t=Qd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await oP(t);if(r)return r;localStorage.removeItem(Zt)}return e}function Gu(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 sP(e){if(e.enabled===!1)return;Xd=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Gu(window.location.href)!==Gu(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),de=await rP(t),window.location.search.includes("code="))try{await de.handleRedirectCallback();const r=await de.getUser();if(!r)throw new Error("No user found");Ve(ve.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){alert("There was an error logging in"),console.error(r)}lo=!0,Ve(ve.AUTH_INITIALIZED,{})}async function jr(){return await Hr(),await ss()?!0:de?de.isAuthenticated():!1}async function cP(){return await Hr(),await ss()?(he("Using local user"),{sub:"local",name:"Local User"}):de?de.getUser():null}async function cs(e){if(Ku){he("Login already in progress");return}if(Ku=!0,await Hr(),localStorage.removeItem(Zt),!de)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return de.loginWithRedirect({...e,authorizationParams:{organization:Xd,redirect_uri:window.location.href,ui_locales:uo(),...t}})}async function pr(e=!0){await Hr();const t=await ss();if(t)return t;try{return de?await de.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function qd(e={}){if(await Hr(),localStorage.removeItem(Zt),Ve(ve.LOGOUT,{}),!!de)return de.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Qd(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function eh(e){const t=Qd(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 uP=(e,t)=>t.skipDedupe||t.method!=="GET",lP=(e,t)=>t.method+"@"+e,fP=e=>e.clone(),Wu=({skip:e=uP,key:t=lP,resolver:r=fP}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},dP=(e,t)=>e*t,hP=e=>e&&e.ok,Vu=({delayTimer:e=500,delayRamp:t=dP,maxAttempts:r=10,until:n=hP,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var y,p;g(u((y=I&&I.url)!==null&&y!==void 0?y:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},vP="application/json",th="Content-Type",Rt=Symbol(),rh=Symbol();function Zu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===th.toLowerCase()))===null||t===void 0?void 0:t[1]}function Ju(e){return/^application\/.*json.*/.test(e)}const ht=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=ht(o,i,r):n[a]=i,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 pP(e,t=!1){Jt.options=t?e:ht(Jt.options,e)}function mP(e,t=!1){Jt.polyfills=t?e:ht(Jt.polyfills,e)}function gP(e){Jt.errorType=e}const yP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class nh extends Error{}const wP=e=>{const t=Object.create(null);e=e._addons.reduce((y,p)=>p.beforeRequest&&p.beforeRequest(y,e._options,t)||y,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ht(a.options,n);let c=r;const d=yP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,l),h=new Error,v=d.catch(y=>{throw{[Rt]:y}}).then(y=>{var p;if(!y.ok){const S=new nh;if(S.cause=h,S.stack=S.stack+`
|
|
5
|
-
CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw S;const O=a.errorType==="json"||((p=y.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(k=>{throw S.message=typeof k=="string"?k:y.statusText,k&&(O&&typeof k=="string"?(S.text=k,S.json=JSON.parse(k)):S[a.errorType]=k),S})}return y}),b=y=>y.catch(p=>{const S=Object.prototype.hasOwnProperty.call(p,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(rh);if(k)return k(O,e);throw O}),g=y=>p=>b(y?v.then(S=>S&&S[y]()).then(S=>p?p(S):S):v.then(S=>p?p(S):S)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(y,p){return f.set(y,p),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(Rt,y)}},I=u.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),T);return o.reduce((y,p)=>p(y,e),I)},bP={_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({[th]: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(rh,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Zu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Ju(a));return n=r?o?n.json(r,a):n.body(r):n,wP(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Zu(this._options.headers);return this.content(t||Ju(r)&&r||vP).body(JSON.stringify(e))}};function We(e="",t={}){return{...bP,_url:e,_options:t}}We.default=We;We.options=pP;We.errorType=gP;We.polyfills=mP;We.WretchError=nh;function _e(){sessionStorage.removeItem(co),console.log("Cache cleared"),Ve(ve.CLEAR_CACHE,{})}function fo(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function ah(e,t){if(fo(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function Yu(e){return e.endsWith("/")?e.slice(0,-1):e}function Xu(e,t){if(!fo(e)||!fo(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&Yu(r.pathname)===Yu(n.pathname)}function SP(e,t){const r=new URL(`${Ke("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=ah(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("url",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const ih="sesamySignedURLs";function us(){const e=sessionStorage.getItem(ih);return e?JSON.parse(e):[]}function $P(e){const t=us();t.push(e),he(`Adding signed URL: ${e}`),sessionStorage.setItem(ih,JSON.stringify(t))}function IP(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];n!=null&&(t[r]=n.toString())}),t}const ho="sesamyAttribution";function TP(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 ls(){return TP(ho)||{}}function oh(e){if(e===null)sessionStorage.removeItem(ho);else{const t=ls()??{};sessionStorage.setItem(ho,JSON.stringify({value:{...t,...IP(e)}}))}}function PP(e){const t=Ke("api2",e.environment),r=$=>async(P,C)=>{let W=sessionStorage.getItem(co);W||(W=Date.now().toString(),sessionStorage.setItem(co,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)},i=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Wu(),Vu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),o=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Wu(),Vu({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 i.get(`/entitlements${W}`).json():[];return C&&V.push(...us()),V}async function u($,P=[]){const C=await s();return C==null?void 0:C.find(V=>{const{sku:Je,purchaseOption:It}=ah($);let or="sku"in V&&Je===V.sku;or&&It&&"purchaseOptionId"in V&&(or=It===V.purchaseOptionId);const xh=Xu($,V.url),Dh=P.some(Mh=>Xu(Mh,V.url));return or||xh||Dh})}async function f($){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function l($){return i.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await jr()?await i.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return i.get("/contracts").json()}async function h($){const P=await i.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await i.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function g(){return i.get("/bills").json()}async function T($){const P=await i.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function I(){return i.get("/transactions").json()}async function y($){const P=await i.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await i.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),C}async function S($){const P=await i.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function O($){return(await i.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await i.url("/user-metadata").get().json()}async function k(){return await i.url("/tags").get().json()}async function M($){const P=await i.url(`/tags/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function F($){const P=await i.url("/tags").post(encodeURIComponent($)).res();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),P.ok}async function X($){return(await o.url("/tallies").get().json())[$]}async function L(){return await o.url("/tallies").get().json()}async function x($){const P=await o.url(`/tallies/${$}`).delete().res();return _e(),P.ok}async function H($,P){return await o.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await i.url(`/products/${encodeURIComponent($)}`).get().json()}async function Z(){return await pr(!1)?await i.url("/profile").get().json():null}async function ee($){const P=await i.url("/profile").patch($).res();return _e(),P.ok}async function Fe(){return await i.url("/payment-issues").get().json()}async function m(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await pr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",P),C.searchParams.set("state",$),window.location.href=C.toString()}async function U($){const P=await i.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&_e(),P}async function N($,P=3600){const{shortlink:C}=await We(iP).post({url:$,ttl:P}).json();return C}async function D($){const P=await pr(!1);let C;const W=$.language||uo();switch($.target){case"account":C=new URL(`${Ke("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(`${Ke("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=SP(e,{language:W,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?N(C.href,$.ttl):C.href}async function q($){const P=ls(),C=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(V=>{const Je=P,[It,or]=V.trim().split("=");C.includes(It)&&!Je[It]&&(Je[It]=or)}),(await o.url("/checkouts").post({language:uo(),attribution:{...P,...$.attribution},...$,vendorId:e.clientId})).json()}async function z($,P){return(await o.url(`/checkouts/${$}`).patch(P)).json()}async function J($){return(await o.url(`/checkouts/${$}`).get()).json()}async function B($){return(await o.url(`/paywalls/${$}`).get()).json()}async function pe(){const $=await pr(!1),P=new URL(`${Ke("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:x,deleteUserMetadata:S,generateLink:D,getBill:T,getBills:g,getCheckout:J,getContract:h,getContracts:d,getEntitlement:f,getEntitlementAccess:l,getEntitlements:s,getFulfillments:c,getPaywall:B,getPaymentIssues:Fe,getProfile:Z,getProduct:R,getSubscriptions:b,getTally:X,getTallies:L,getTags:k,getTransaction:y,getTransactions:I,getUserMetadata:O,hasAccess:u,isSpotifyLinked:m,linkSpotify:E,listUserMetadata:_,openHostedAccountPage:pe,pushTally:H,setTag:F,setUserMetadata:p,unlinkSpotify:w,updateCheckout:z,updateProfile:ee}}const sh="@sesamy/sesamy-js",fs="1.19.1";function qu(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",Qu="object",vo=function(){},ch="any",uh="*",mt="__",zn=typeof process<"u"?process:{};zn.env&&zn.env.NODE_ENV;var te=typeof document<"u";zn.versions!=null&&zn.versions.node!=null;typeof Deno<"u"&&Deno.core;te&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function lh(e,t){return t.charAt(0)[e]()+t.slice(1)}var EP=lh.bind(null,"toUpperCase"),OP=lh.bind(null,"toLowerCase");function kP(e){return fh(e)?EP("null"):typeof e=="object"?AP(e):Object.prototype.toString.call(e).slice(8,-1)}function Hn(e,t){t===void 0&&(t=!0);var r=kP(e);return t?OP(r):r}function Kr(e,t){return typeof t===e}var ue=Kr.bind(null,"function"),tt=Kr.bind(null,"string"),xt=Kr.bind(null,"undefined"),_P=Kr.bind(null,"boolean");Kr.bind(null,"symbol");function fh(e){return e===null}function RP(e){return Hn(e)==="number"&&!isNaN(e)}function dh(e){return Hn(e)==="array"}function ce(e){if(!CP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function CP(e){return e&&(typeof e=="object"||e!==null)}function AP(e){return ue(e.constructor)?e.constructor.name:null}function jP(e){return e instanceof Error||tt(e.message)&&e.constructor&&RP(e.constructor.stackTraceLimit)}function hh(e,t){if(typeof t!="object"||fh(t))return!1;if(t instanceof e)return!0;var r=Hn(new e(""));if(jP(t))for(;t;){if(Hn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}hh.bind(null,TypeError);hh.bind(null,SyntaxError);function la(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?LP(e,t):r}function LP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function fa(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}fa(la,"form");fa(la,"button");fa(la,"input");fa(la,"select");function UP(e){return e?dh(e)?e:[e]:[]}function el(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function NP(){if(te){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function xP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function DP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=el(r[1]),o=el(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(MP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return te&&window.location.search.substring(1)}())}function MP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function da(){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 FP(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var Or="global",Yt=mt+"global"+mt,Xt=typeof self===Qu&&self.self===self&&self||typeof global===Qu&&global.global===global&&global||void 0;function gt(e){return Xt[Yt][e]}function yt(e,t){return Xt[Yt][e]=t}function ar(e){delete Xt[Yt][e]}function ir(e,t,r){var n;try{if(ds(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Xt[Yt]||(Xt[Yt]={});var vn={};function ds(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 qe="function",Ge="undefined",BP="@@redux/"+Math.random().toString(36),tl=function(){return typeof Symbol===qe&&Symbol.observable||"@@observable"}(),pn=" != "+qe;function vh(e,t,r){var n;if(typeof t===qe&&typeof r===Ge&&(r=t,t=void 0),typeof r!==Ge){if(typeof r!==qe)throw new Error("enhancer"+pn);return r(vh)(e,t)}if(typeof e!==qe)throw new Error("reducer"+pn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==qe)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(!ce(h))throw new Error("Act != obj");if(typeof h.type===Ge)throw new Error("ActType "+Ge);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==qe)throw new Error("next reducer"+pn);a=h,d({type:"@@redux/INIT"})}})[tl]=function(){var h,v=c;return(h={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:v(g)}}})[tl]=function(){return this},h},n}function zP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ge}function qt(){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 HP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=qt.apply(void 0,i)(o.dispatch)})}}}var rt=mt+"anon_id",vt=mt+"user_id",Ft=mt+"user_traits",Xe="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"],po=["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}}),rl=/^utm_/,nl=/^an_prop_/,al=/^an_trait_/;function KP(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(rt,o.anonymousId),f||t(vt,o.userId),u.traits&&t(Ft,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,h=l.reduce(function(v,b){if(b.match(rl)||b.match(/^(d|g)clid/)){var g=b.replace(rl,"");v.campaign[g==="campaign"?"name":g]=i[b]}return b.match(nl)&&(v.props[b.replace(nl,"")]=i[b]),b.match(al)&&(v.traits[b.replace(al,"")]=i[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:A.campaign,campaign:h.campaign})}}return n(a)}}}}function GP(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 il(e){return{userId:e.getItem(vt),anonymousId:e.getItem(rt),traits:e.getItem(Ft)}}var mo=function(e){return mt+"TEMP"+mt+e};function WP(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([vt,Ft,rt].forEach(function(h){n(h)}),[Xe,Dt,"traits"].forEach(function(h){ar(mo(h))})),s.type===A.identify){a(rt)||r(rt,da());var c=a(vt),d=a(Ft)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(vt,u),f&&r(Ft,j({},d,f))}return o(s)}}}}var br={};function ol(e,t){br[e]&&ue(br[e])&&(br[e](t),delete br[e])}function ph(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return ph(e,t,r-10).then(n,a)})})}function VP(e){return{abort:e}}function mh(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,b=a[h][v];if(b&&ue(b)){var g,T=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[Xe,Dt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=b({payload:T,config:o[h].config,instance:r,abort:VP}))&&ce(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var y=v+":"+h;e.dispatch(j({},T,{type:y,_:{called:y,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var Ti=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Bt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,y,p){var S=y.config,O=y.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Bt)?function(M,F,X,L,x){return function(H,R){var Z=L?L.name:M,ee=R&&Lr(R)?R:X;if(L&&(!(ee=R&&Lr(R)?R:[M]).includes(M)||ee.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(ee)+" input valid");return j({},x,{abort:{reason:H,plugins:ee,caller:F,_:Z}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:ZP(I),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,T){var I=T.pluginName,y=T.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[I].loaded),l.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var y=T.pluginName;return Promise.resolve(g).then(function(p){function S(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[y])return Promise.resolve(t.namespaced[y].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ue(k.method)?(function(H,R){var Z=hl(H);if(Z&&Z.name===R){var ee=hl(Z.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+Z.method+" "+(ee?"or "+ee.method:"")+" in "+R+" plugin insteadof "+H].join(`
|
|
6
|
-
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,x=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:x||L}})}),config:ul(k.pluginName,f,i),plugins:f})).then(function(H){var R=ce(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[y]=_});p[y]=r}();return O&&O.then?O.then(S):S()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,y){try{var p=t.exact.length===y+1,S=I.pluginName,O=i[S];return Promise.resolve(T).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),Ei(k,S))return Pi({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(Ei(_,S))return p&&Pi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty(S)&&b[S]===!0)return s.dispatch({type:"queue",plugin:S,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[S],i[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:ul(S,f,i),plugins:f})).then(function(F){var X=ce(F)?F:{},L=j({},_,X),x=g[S];if(Ei(x,S))Pi({data:x,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(sl)&&!c.match(cl)&&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(T){if(!(c.match(Bt)||c.match(/^registerPlugin/)||c.match(cl)||c.match(sl)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});gh(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Bt=/Start$/,sl=/^bootstrap/,cl=/^ready/;function Pi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function ul(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function ll(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function fl(e,t){var r=e.replace(Bt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Ei(e,t){var r=e.abort;return!!r&&(r===!0||dl(r,t)||r&&dl(r.plugins,t))}function gh(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 dl(e,t){return!(!e||!Lr(e))&&e.includes(t)}function hl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function ZP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ce(e[r])?Object.assign({},e[r]):e[r]),t},{})}function JP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return ol(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],T=o.disabled,I=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return ph(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!po.includes(M)})}),n[O]=!0),b=b.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var S={plugins:b,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return mh(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=ue(S)?S():S,F=p.type,X=F.replace(Bt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(Z=M,(ee=L.plugins)===void 0&&(ee={}),(Fe=p.options)===void 0&&(Fe={}),Object.keys(Z).filter(function(m){var w=Fe.plugins||{};return _P(w[m])?w[m]:w.all!==!1&&(!ee[m]||ee[m].enabled!==!1)}).map(function(m){return Z[m]}));F===A.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var w=L.plugins[m];return p.plugins.includes(m)&&!w.initialized}).map(function(m){return M[m]}));var H=x.map(function(m){return m.name}),R=function(m,w,E){var U=fl(m).map(function(N){return ll(N,w)});return w.reduce(function(N,D){var q=D.name,z=fl(m,q).map(function($){return ll($,w)}),J=z[0],B=z[1],pe=z[2];return J.length&&(N.beforeNS[q]=J),B.length&&(N.duringNS[q]=B),pe.length&&(N.afterNS[q]=pe),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(Ti({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function w(){var N=function(){if(F.match(Bt))return Promise.resolve(Ti({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&&ol(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(gh(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Ti({action:j({},m,{type:X}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var Z,ee,Fe}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(p){return Promise.reject(p)}}}}}function YP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var XP=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return qt.apply(void 0,o)(n)(a)}}}}};function qP(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=vl(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=vl(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,pl(r.plugins,!1,t));case A.enablePlugin:return j({},t,pl(r.plugins,!0,t));default:return t}}}function vl(e,t){return e.substring(t.length+1,e.length)}function pl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function yh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var QP={last:{},history:[]};function eE(e,t){e===void 0&&(e=QP);var r=t.options,n=t.meta;if(t.type===A.track){var a=yh(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 tE={actions:[]};function rE(e,t){e===void 0&&(e=tE);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 wh=/#.*$/;function nE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(wh,""):"")}var bh,Sh,$h,Ih,aE=function(e){if(e===void 0&&(e={}),!te)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(te){for(var v,b=document.getElementsByTagName("link"),g=0;v=b[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(wh,"")}(f),c={title:r,url:l,path:nE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},iE={last:{},history:[]};function oE(e,t){e===void 0&&(e=iE);var r=t.options;if(t.type===A.page){var n=yh(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}bh=function(){if(!te)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Sh=te?document.referrer:null,$h=NP(),Ih=xP();var ml={initialized:!1,sessionId:da(),app:null,version:null,debug:!1,offline:!!te&&!navigator.onLine,os:{name:bh},userAgent:te?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Ih,locale:$h,campaign:{},referrer:Sh};function sE(e,t){e===void 0&&(e=ml);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({},ml,e,{initialized:!0})}}var cE=["plugins","reducers","storage"];function uE(e,t,r){if(te){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function lE(e){var t=uE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Th(){return yt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Xt[Yt].analytics.push(o.action||o),i(o)}})}}}function gl(e){return function(){return qt(qt.apply(null,arguments),Th())}}function Oi(e){return e?dh(e)?e:[e]:[]}function yl(e,t,r){e===void 0&&(e={});var n,a,i=da();return t&&(br[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ue(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function fE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(ue(w))return m.middlewares=m.middlewares.concat(w),m;if(w.NAMESPACE&&(w.name=w.NAMESPACE),!w.name)throw new Error("https://lytics.dev/errors/1");w.config||(w.config={});var E=w.EVENTS?Object.keys(w.EVENTS).map(function(D){return w.EVENTS[D]}):[];m.pluginEnabled[w.name]=!(w.enabled===!1||w.config.enabled===!1),delete w.enabled,w.methods&&(m.methods[w.name]=Object.keys(w.methods).reduce(function(D,q){var 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),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(w),m.plugins[w.name])throw new Error(w.name+"AlreadyLoaded");return m.plugins[w.name]=w,m.plugins[w.name].loaded||(m.plugins[w.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:gt,setItem:yt,removeItem:ar},i=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ce(U)&&U[w]?U[w]:il(m)[w]||gt(mo(w))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!po.includes(m)}).sort(),u=new Set(s.concat(kn).filter(function(m){return!po.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new XP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=DP(),T=il(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=da());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:Oi(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:Oi(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var N=tt(m)?m:null,D=ce(m)?m:w,q=E||{},z=S.user();yt(mo(Xe),N);var J=N||D.userId||i(Xe,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!==N&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var N=ce(m)?m.event:m;if(!N||!tt(N))throw new Error("EventMissing");var D=ce(m)?m:w||{},q=ce(E)?E:{};return Promise.resolve(new Promise(function(z){R.dispatch({type:A.trackStart,event:N,properties:D,options:q,userId:i(Xe,S,w),anonymousId:i(Dt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ce(m)?m:{},N=ce(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:aE(U),options:N,userId:i(Xe,S,U),anonymousId:i(Dt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Xe||m==="id")return i(Xe,S);if(m===Dt||m==="anonId")return i(Dt,S);var w=S.getState("user");return m?qu(w,m):w},reset:function(m){return new Promise(function(w){R.dispatch({type:A.resetStart},w,m)})},ready:function(m){return p&&m({plugins:y,instance:S}),S.on(A.ready,function(w){m(w),p=!0})},on:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(z){return function(J){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:o}),J(B)}}},N=function(z){return function(J){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:o}),J(B)}}};return d(U,mn),d(N,gn),function(){h(U,mn),h(N,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:o,abort:b}),J(B)}}};return d(q,D),function(){return h(q,D)}},once:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=S.on(m,function(U){w({payload:U.payload,instance:S,plugins:o,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?qu(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=yl()),w(E)}}},v(mn),JP(S,l,{all:f,plugins:s}),YP(a),KP(S),WP(S),v(gn)]),_={context:sE,user:GP(a),page:oE,track:eE,plugins:qP(l),queue:rE},k=qt,M=qt;if(te&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Th():ce(typeof arguments[0])?gl():gl().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return cE.includes(E)||(w[E]=m[E]),w},{})}(e),x=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,N=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!N({config:U}),config:U},m},{}),H={context:L,user:I,plugins:x},R=vh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var N=w[U];typeof m[N]===qe&&(E[N]=m[N])}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"})===Ge||typeof B(void 0,{type:BP})===Ge)throw new Error("reducer "+J+" "+Ge)})})(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===Ge){var V=zP(P,J);throw new Error(V)}pe[P]=W,B=B||W!==C}return B?pe:z}}(j({},_,t)),H,M(k(HP.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:yl(m.meta,w,Oi(E))});return X.apply(null,[U])});var Z=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:Z,config:L,params:g,user:I,initialUser:r,persistedUser:T});var ee=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,N=m.name;E&&ue(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:ee,disabled:Fe})}),lE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return mh(m,w,E)},3e3)}(R,l,S),S}var mn="before",gn="after",kr="cookie",lt=Oh(),Ph=ha,dE=ha;function Eh(e){return lt?ha(e,"",-1):ar(e)}function Oh(){if(lt!==void 0)return lt;var e="cookiecookie";try{ha(e,e),lt=document.cookie.indexOf(e)!==-1,Eh(e)}catch{lt=!1}return lt}function ha(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return lt===!1&&(o?yt(e,t):gt(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var _r="localStorage",hE=ds.bind(null,"localStorage");ir("localStorage","getItem",gt);ir("localStorage","setItem",yt);ir("localStorage","removeItem",ar);var Rr="sessionStorage",vE=ds.bind(null,"sessionStorage");ir("sessionStorage","getItem",gt);ir("sessionStorage","setItem",yt);ir("sessionStorage","removeItem",ar);function zt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ce(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var pE=hE(),mE=vE(),gE=Oh();function kh(e,t){if(e){var r=hs(t),n=!gs(r),a=vs(r)?zt(localStorage.getItem(e)):void 0;if(n&&!xt(a))return a;var i=ps(r)?zt(Ph(e)):void 0;if(n&&i)return i;var o=ms(r)?zt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=gt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function yE(e,t,r){if(e&&!xt(t)){var n={},a=hs(r),i=JSON.stringify(t),o=!gs(a);return vs(a)&&(n[_r]=yn(_r,t,zt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[_r]:ps(a)&&(n[kr]=yn(kr,t,zt(Ph(e))),dE(e,i),o)?n[kr]:ms(a)&&(n[Rr]=yn(Rr,t,zt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Rr]:(n[Or]=yn(Or,t,gt(e)),yt(e,t),o?n[Or]:n)}}function wE(e,t){if(e){var r=hs(t),n=kh(e,uh),a={};return!xt(n.localStorage)&&vs(r)&&(localStorage.removeItem(e),a[_r]=n.localStorage),!xt(n.cookie)&&ps(r)&&(Eh(e),a[kr]=n.cookie),!xt(n.sessionStorage)&&ms(r)&&(sessionStorage.removeItem(e),a[Rr]=n.sessionStorage),!xt(n.global)&&va(r,Or)&&(ar(e),a[Or]=n.global),a}}function hs(e){return e?tt(e)?e:e.storage:ch}function vs(e){return pE&&va(e,_r)}function ps(e){return gE&&va(e,kr)}function ms(e){return mE&&va(e,Rr)}function gs(e){return e===uh||e==="all"}function va(e,t){return e===ch||e===t||gs(e)}function yn(e,t,r){return{location:e,current:t,previous:r}}var bE={setItem:yE,getItem:kh,removeItem:wE};function SE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wl(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 bl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wl(Object(r),!0).forEach(function(n){SE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $E(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:bE};return fE(bl(bl({},t),e))}function IE(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function TE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=EE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function PE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function EE(e){return["#","?"].forEach(t=>e=PE(e,t)),e}function OE(){TE(()=>{He.page()})}function kE(e){if(e===void 0&&(e={}),!te)return vo;var t=$l(),r=go(),n=Sl(),a=wn(n,t),i=wn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return vo;var h=d.map(function(b){return Number(b)}),v=FP(function(){var b=$l(),g=function(L,x){return x.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),T=go(),I=Sl(),y=wn(I,b),p=wn(T,b);if(l=y>l?y:l,c=p<c?p:c,!(o.length>=h.length)){var S=f===I,O="up";S?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,H){var R=_[H];return u.includes(x)&&I<=R&&(u=u.filter(function(Z){return Z!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=y?(L.foundFunc=[x],L):(S&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ue(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;ue(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function go(){return te?document.body.scrollTop||document.documentElement.scrollTop:0}function _E(){return te?window.innerHeight||document.documentElement.clientHeight:0}function Sl(){return Math.round(go()+_E())}function $l(){if(!te)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function wn(e,t){return Math.round(e/t*100)}var Il="EventListener";function RE(e){return function(t,r,n,a){var i=n||vo,o=a||!1;if(!te)return i;var s=Kn(r),u=Kn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+Il:"remove"+Il,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?CE(i):i:f[h]||i;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],o)}return l.bind(null,!c)}(e)}}function Kn(e,t){if(tt(e))return t?Kn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=UP(e);return t?i.map(function(o){return tt(o)?Kn(o,!0):o}).flat():i}function CE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var ki=RE("Event");function _h(e,t){return te&&ue(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ue(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}_h.bind(null,"onerror");_h.bind(null,"onload");var Rh=typeof window>"u",Tl="hidden";function AE(e){if(Rh)return!1;var t=jE(),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 jE(){var e=["webkit","moz","ms","o"];return Rh||Tl in document?Tl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var LE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function UE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=AE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(LE.map(function(s){return ki(document,s,r)})).concat(ki(window,"load",r)).concat(ki(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function NE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(mr(d),g),a&&l&&(l=!1,a(mr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(mr(d),g))},s)}var b=UE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:mr(d,c),idle:l?mr(r,c):0}}}}function mr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Pl=5e3;class xE{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),NE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Pl}),kE({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*Pl: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 El="sesamy_session_id";function DE(){let e=sessionStorage.getItem(El);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(El,e)),e}let Ch=!1,yo,Ol,Gn;const Ah=new Map;function ME({clientId:e,enabled:t=!0,environment:r}){if(yo=e,Ol=t,Gn=`${Ke("logs",r)}/events`,!Ol)return;window.addEventListener("beforeunload",()=>{Lh.forEach((a,i)=>{a.bind(i)()}),BE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ah.forEach((a,i)=>{a.bind(i)()})}),OE();const n=new xE({element:document.body,viewCallback:()=>{He.page()},activeDurationCallback:(a,i,o)=>{He.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{He.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{He.track("scroll",{scroll:a.scrollMax})}});zE(document.body,()=>{n.flush()}),HE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const i=a;await He.identify(i.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await He.track("logout",{}),ys.flush(),await He.reset()})}function jh(e){return JSON.stringify(e.map(t=>({...t,clientId:yo,requestId:Math.random().toString(36).slice(2,9),sessionId:DE(),timestamp:new Date().toISOString(),version:fs,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:sh,userAgent:navigator.userAgent,clientId:yo}})))}const ys=IE(async e=>{if(e.length>0){const t=jh(e);Ch?navigator.sendBeacon(Gn,t):(await fetch(Gn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function _i(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Gn,jh([r]))}else ys.push(e)}const He=$E({app:sh,version:fs,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;_i({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;_i({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;_i({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function FE(e,t){He.track(e,t)}function BE(){return Ch=!0,ys.flush()}const Lh=new Map;function zE(e,t){Lh.set(e,t)}function HE(e,t){Ah.set(e,t)}const KE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function GE(){return new Promise(e=>{const t=KE.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function WE(){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 ke={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"}};function VE(e){var t;ke={...ke,...(t=e.content)==null?void 0:t.article}}function ZE(e,t){const{selector:r}=t;return r===ke.article.selector?e:e.querySelector(r)}function JE(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??void 0:e.textContent??void 0}function YE(){const e=document.querySelectorAll(ke.article.selector);return Array.from(e).map(t=>{const r={element:t},n=(a,i,o)=>{const s=ZE(t,i);if(s){const u=JE(s,i);u!==void 0&&(r[a]=o?o(u):u)}};return n("title",ke.title),n("excerpt",ke.excerpt),n("image",ke.image),n("price",ke.price,a=>parseFloat(a)),n("currency",ke.currency),n("url",ke.url),n("id",ke.id),r})}function XE(e){const{autoOnboardProduct:t,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:u,getBills:f,getCheckout:l,getContract:c,getContracts:d,getEntitlement:h,getEntitlementAccess:v,getEntitlements:b,getFulfillments:g,getPaywall:T,getPaymentIssues:I,getProfile:y,getProduct:p,getSubscriptions:S,getTags:O,getTally:_,getTallies:k,getTransaction:M,getTransactions:F,getUserMetadata:X,hasAccess:L,isSpotifyLinked:x,linkSpotify:H,listUserMetadata:R,openHostedAccountPage:Z,pushTally:ee,setTag:Fe,setUserMetadata:m,unlinkSpotify:w,updateCheckout:E,updateProfile:U}=PP(e),N={analytics:{track:FE},attribution:{get:ls,set:oh},auth:{getUser:y,isAuthenticated:jr,loginWithRedirect:cs,logout:qd,setToken:eh},bills:{get:u,list:f},browser:{detectAdblock:GE,isInAppBrowser:WE},checkouts:{create:n,get:l,update:E},clearCache:_e,content:{list:YE},contracts:{cancel:r,get:c,list:d},entitlements:{access:v,get:h,hasAccess:L,list:b,signedLinks:us},fulfillments:{list:g},generateLink:s,getPaymentIssues:I,getVersion:qE,log:he,paywalls:{get:T},products:{autoOnboard:t,get:p,linkSpotify:H},profile:{get:y,isSpotifyLinked:x,openHostedAccountPage:Z,unlinkSpotify:w,update:U},subscriptions:{list:S},tags:{delete:a,list:O,set:Fe},tallies:{delete:i,get:_,list:k,push:ee},transactions:{get:M,list:F},userMetadata:{delete:o,get:X,list:R,set:m}};return e.namespace&&(window[e.namespace]=N),N}function qE(){return fs}function QE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
4
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!zu(r))throw new Error(`Invalid cache location "${r}"`);n=zu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?jt:JT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:YT;var i;this.scope=dn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new GT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Fd,this.cacheManager=new KT(n,n.allKeys?void 0:new QT(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new qT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Md)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${oo(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return VT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=xu(wi()),i=xu(wi()),o=wi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await On().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,b,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:dn(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new NT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new UT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(fe.fromPayload(h.data.response));u(h.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new fe("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Hu(t),{openUrl:a,fragment:i,appState:o}=n,s=xe(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=xe(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new fe("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new LT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new fe("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:dn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=Si[o];return s||(s=i().finally(()=>{delete Si[o],s=null}),Si[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=xe(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>$i.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new io;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await $i.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({},jT),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=xe(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${oo(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Hu(t),{openUrl:n}=r,a=xe(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new 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((T,I)=>{const y=window.document.createElement("iframe");y.setAttribute("width","0"),y.setAttribute("height","0"),y.style.display="none";const p=()=>{window.document.body.contains(y)&&(window.document.body.removeChild(y),window.removeEventListener("message",S,!1))};let S;const O=setTimeout(()=>{I(new io),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(fe.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",S,!1),setTimeout(p,2e3)},window.addEventListener("message",S,!1),window.document.body.appendChild(y),y.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new 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:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new 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 Wd(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=xe(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:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await zT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function rP(e){const t=new tP(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 nP="sesamy.com",aP="sesamy.dev",iP="https://sesa.my",co="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?aP:nP}`}function uo(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let he,Xd,lo=!1,Ku=!1;const Zt="sesamyAccessToken",Ii="sesamyRefreshToken";async function Hr(){return lo?!0:new Promise((e,t)=>{const r=setTimeout(()=>{lo?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function oP(e){if(!e)return null;const t=localStorage.getItem(Ii);if(!t)return ce("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(Ii),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Ii,i.refresh_token),localStorage.setItem(Zt,i.access_token),i.access_token}catch{qd()}}async function ss(){const e=localStorage.getItem(Zt);if(!e)return null;const t=Qd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await oP(t);if(r)return r;localStorage.removeItem(Zt)}return e}function Gu(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 sP(e){if(e.enabled===!1)return;Xd=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Gu(window.location.href)!==Gu(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),he=await rP(t),window.location.search.includes("code="))try{await he.handleRedirectCallback();const r=await he.getUser();if(!r)throw new Error("No user found");Ve(ve.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){alert("There was an error logging in"),console.error(r)}lo=!0,Ve(ve.AUTH_INITIALIZED,{})}async function jr(){return await Hr(),await ss()?!0:he?he.isAuthenticated():!1}async function cP(){return await Hr(),await ss()?(ce("Using local user"),{sub:"local",name:"Local User"}):he?he.getUser():null}async function cs(e){if(Ku){ce("Login already in progress");return}if(Ku=!0,await Hr(),localStorage.removeItem(Zt),!he)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return he.loginWithRedirect({...e,authorizationParams:{organization:Xd,redirect_uri:window.location.href,ui_locales:uo(),...t}})}async function pr(e=!0){await Hr();const t=await ss();if(t)return t;try{return he?await he.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function qd(e={}){if(await Hr(),localStorage.removeItem(Zt),Ve(ve.LOGOUT,{}),!!he)return he.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Qd(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function eh(e){const t=Qd(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 uP=(e,t)=>t.skipDedupe||t.method!=="GET",lP=(e,t)=>t.method+"@"+e,fP=e=>e.clone(),Wu=({skip:e=uP,key:t=lP,resolver:r=fP}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},dP=(e,t)=>e*t,hP=e=>e&&e.ok,Vu=({delayTimer:e=500,delayRamp:t=dP,maxAttempts:r=10,until:n=hP,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var y,p;g(u((y=I&&I.url)!==null&&y!==void 0?y:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},vP="application/json",th="Content-Type",Rt=Symbol(),rh=Symbol();function Zu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===th.toLowerCase()))===null||t===void 0?void 0:t[1]}function Ju(e){return/^application\/.*json.*/.test(e)}const ht=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=ht(o,i,r):n[a]=i,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 pP(e,t=!1){Jt.options=t?e:ht(Jt.options,e)}function mP(e,t=!1){Jt.polyfills=t?e:ht(Jt.polyfills,e)}function gP(e){Jt.errorType=e}const yP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class nh extends Error{}const wP=e=>{const t=Object.create(null);e=e._addons.reduce((y,p)=>p.beforeRequest&&p.beforeRequest(y,e._options,t)||y,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ht(a.options,n);let c=r;const d=yP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,l),h=new Error,v=d.catch(y=>{throw{[Rt]:y}}).then(y=>{var p;if(!y.ok){const S=new nh;if(S.cause=h,S.stack=S.stack+`
|
|
5
|
+
CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw S;const O=a.errorType==="json"||((p=y.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(k=>{throw S.message=typeof k=="string"?k:y.statusText,k&&(O&&typeof k=="string"?(S.text=k,S.json=JSON.parse(k)):S[a.errorType]=k),S})}return y}),b=y=>y.catch(p=>{const S=Object.prototype.hasOwnProperty.call(p,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(rh);if(k)return k(O,e);throw O}),g=y=>p=>b(y?v.then(S=>S&&S[y]()).then(S=>p?p(S):S):v.then(S=>p?p(S):S)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(y,p){return f.set(y,p),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(Rt,y)}},I=u.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),T);return o.reduce((y,p)=>p(y,e),I)},bP={_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({[th]: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(rh,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Zu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Ju(a));return n=r?o?n.json(r,a):n.body(r):n,wP(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Zu(this._options.headers);return this.content(t||Ju(r)&&r||vP).body(JSON.stringify(e))}};function We(e="",t={}){return{...bP,_url:e,_options:t}}We.default=We;We.options=pP;We.errorType=gP;We.polyfills=mP;We.WretchError=nh;function _e(){sessionStorage.removeItem(co),console.log("Cache cleared"),Ve(ve.CLEAR_CACHE,{})}function fo(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function ah(e,t){if(fo(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function Yu(e){return e.endsWith("/")?e.slice(0,-1):e}function Xu(e,t){if(!fo(e)||!fo(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&Yu(r.pathname)===Yu(n.pathname)}function SP(e,t){const r=new URL(`${Ke("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=ah(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("url",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}const ih="sesamySignedURLs";function us(){const e=sessionStorage.getItem(ih);return e?JSON.parse(e):[]}function $P(e){const t=us();t.push(e),ce(`Adding signed URL: ${e}`),sessionStorage.setItem(ih,JSON.stringify(t))}function IP(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];n!=null&&(t[r]=n.toString())}),t}const ho="sesamyAttribution";function TP(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 PP(e){return Object.keys(e).find(t=>t.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function ls(){return TP(ho)||{}}function oh(e){if(e===null)sessionStorage.removeItem(ho);else{ce(`Setting attribution ${JSON.stringify(e)}`);const t=ls()??{},r=IP({...t,...PP(e)});sessionStorage.setItem(ho,JSON.stringify({value:r}))}}function EP(e){const t=Ke("api2",e.environment),r=$=>async(P,C)=>{let W=sessionStorage.getItem(co);W||(W=Date.now().toString(),sessionStorage.setItem(co,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)},i=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Wu(),Vu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),o=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Wu(),Vu({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 i.get(`/entitlements${W}`).json():[];return C&&V.push(...us()),V}async function u($,P=[]){const C=await s();return C==null?void 0:C.find(V=>{const{sku:Je,purchaseOption:It}=ah($);let or="sku"in V&&Je===V.sku;or&&It&&"purchaseOptionId"in V&&(or=It===V.purchaseOptionId);const xh=Xu($,V.url),Dh=P.some(Mh=>Xu(Mh,V.url));return or||xh||Dh})}async function f($){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function l($){return i.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await jr()?await i.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return i.get("/contracts").json()}async function h($){const P=await i.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await i.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function g(){return i.get("/bills").json()}async function T($){const P=await i.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function I(){return i.get("/transactions").json()}async function y($){const P=await i.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await i.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),C}async function S($){const P=await i.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function O($){return(await i.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await i.url("/user-metadata").get().json()}async function k(){return await i.url("/tags").get().json()}async function M($){const P=await i.url(`/tags/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function F($){const P=await i.url("/tags").post(encodeURIComponent($)).res();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),P.ok}async function X($){return(await o.url("/tallies").get().json())[$]}async function L(){return await o.url("/tallies").get().json()}async function x($){const P=await o.url(`/tallies/${$}`).delete().res();return _e(),P.ok}async function H($,P){return await o.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await i.url(`/products/${encodeURIComponent($)}`).get().json()}async function Z(){return await pr(!1)?await i.url("/profile").get().json():null}async function ee($){const P=await i.url("/profile").patch($).res();return _e(),P.ok}async function Fe(){return await i.url("/payment-issues").get().json()}async function m(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await pr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",P),C.searchParams.set("state",$),window.location.href=C.toString()}async function U($){const P=await i.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&_e(),P}async function N($,P=3600){const{shortlink:C}=await We(iP).post({url:$,ttl:P}).json();return C}async function D($){const P=await pr(!1);let C;const W=$.language||uo();switch($.target){case"account":C=new URL(`${Ke("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(`${Ke("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=SP(e,{language:W,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?N(C.href,$.ttl):C.href}async function q($){const P=ls(),C=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(V=>{const Je=P,[It,or]=V.trim().split("=");C.includes(It)&&!Je[It]&&(Je[It]=or)}),(await o.url("/checkouts").post({language:uo(),attribution:{...P,...$.attribution},...$,vendorId:e.clientId})).json()}async function z($,P){return(await o.url(`/checkouts/${$}`).patch(P)).json()}async function J($){return(await o.url(`/checkouts/${$}`).get()).json()}async function B($){return(await o.url(`/paywalls/${$}`).get()).json()}async function pe(){const $=await pr(!1),P=new URL(`${Ke("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:x,deleteUserMetadata:S,generateLink:D,getBill:T,getBills:g,getCheckout:J,getContract:h,getContracts:d,getEntitlement:f,getEntitlementAccess:l,getEntitlements:s,getFulfillments:c,getPaywall:B,getPaymentIssues:Fe,getProfile:Z,getProduct:R,getSubscriptions:b,getTally:X,getTallies:L,getTags:k,getTransaction:y,getTransactions:I,getUserMetadata:O,hasAccess:u,isSpotifyLinked:m,linkSpotify:E,listUserMetadata:_,openHostedAccountPage:pe,pushTally:H,setTag:F,setUserMetadata:p,unlinkSpotify:w,updateCheckout:z,updateProfile:ee}}const sh="@sesamy/sesamy-js",fs="1.19.1";function qu(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",Qu="object",vo=function(){},ch="any",uh="*",mt="__",zn=typeof process<"u"?process:{};zn.env&&zn.env.NODE_ENV;var te=typeof document<"u";zn.versions!=null&&zn.versions.node!=null;typeof Deno<"u"&&Deno.core;te&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function lh(e,t){return t.charAt(0)[e]()+t.slice(1)}var OP=lh.bind(null,"toUpperCase"),kP=lh.bind(null,"toLowerCase");function _P(e){return fh(e)?OP("null"):typeof e=="object"?jP(e):Object.prototype.toString.call(e).slice(8,-1)}function Hn(e,t){t===void 0&&(t=!0);var r=_P(e);return t?kP(r):r}function Kr(e,t){return typeof t===e}var le=Kr.bind(null,"function"),tt=Kr.bind(null,"string"),xt=Kr.bind(null,"undefined"),RP=Kr.bind(null,"boolean");Kr.bind(null,"symbol");function fh(e){return e===null}function CP(e){return Hn(e)==="number"&&!isNaN(e)}function dh(e){return Hn(e)==="array"}function ue(e){if(!AP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function AP(e){return e&&(typeof e=="object"||e!==null)}function jP(e){return le(e.constructor)?e.constructor.name:null}function LP(e){return e instanceof Error||tt(e.message)&&e.constructor&&CP(e.constructor.stackTraceLimit)}function hh(e,t){if(typeof t!="object"||fh(t))return!1;if(t instanceof e)return!0;var r=Hn(new e(""));if(LP(t))for(;t;){if(Hn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}hh.bind(null,TypeError);hh.bind(null,SyntaxError);function la(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?UP(e,t):r}function UP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function fa(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}fa(la,"form");fa(la,"button");fa(la,"input");fa(la,"select");function NP(e){return e?dh(e)?e:[e]:[]}function el(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function xP(){if(te){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function DP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function MP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=el(r[1]),o=el(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(FP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return te&&window.location.search.substring(1)}())}function FP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function da(){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 BP(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var Or="global",Yt=mt+"global"+mt,Xt=typeof self===Qu&&self.self===self&&self||typeof global===Qu&&global.global===global&&global||void 0;function gt(e){return Xt[Yt][e]}function yt(e,t){return Xt[Yt][e]=t}function ar(e){delete Xt[Yt][e]}function ir(e,t,r){var n;try{if(ds(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Xt[Yt]||(Xt[Yt]={});var vn={};function ds(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 qe="function",Ge="undefined",zP="@@redux/"+Math.random().toString(36),tl=function(){return typeof Symbol===qe&&Symbol.observable||"@@observable"}(),pn=" != "+qe;function vh(e,t,r){var n;if(typeof t===qe&&typeof r===Ge&&(r=t,t=void 0),typeof r!==Ge){if(typeof r!==qe)throw new Error("enhancer"+pn);return r(vh)(e,t)}if(typeof e!==qe)throw new Error("reducer"+pn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==qe)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===Ge)throw new Error("ActType "+Ge);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==qe)throw new Error("next reducer"+pn);a=h,d({type:"@@redux/INIT"})}})[tl]=function(){var h,v=c;return(h={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:v(g)}}})[tl]=function(){return this},h},n}function HP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ge}function qt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function KP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=qt.apply(void 0,i)(o.dispatch)})}}}var rt=mt+"anon_id",vt=mt+"user_id",Ft=mt+"user_traits",Xe="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"],po=["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}}),rl=/^utm_/,nl=/^an_prop_/,al=/^an_trait_/;function GP(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(rt,o.anonymousId),f||t(vt,o.userId),u.traits&&t(Ft,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,h=l.reduce(function(v,b){if(b.match(rl)||b.match(/^(d|g)clid/)){var g=b.replace(rl,"");v.campaign[g==="campaign"?"name":g]=i[b]}return b.match(nl)&&(v.props[b.replace(nl,"")]=i[b]),b.match(al)&&(v.traits[b.replace(al,"")]=i[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:A.campaign,campaign:h.campaign})}}return n(a)}}}}function WP(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 il(e){return{userId:e.getItem(vt),anonymousId:e.getItem(rt),traits:e.getItem(Ft)}}var mo=function(e){return mt+"TEMP"+mt+e};function VP(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([vt,Ft,rt].forEach(function(h){n(h)}),[Xe,Dt,"traits"].forEach(function(h){ar(mo(h))})),s.type===A.identify){a(rt)||r(rt,da());var c=a(vt),d=a(Ft)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(vt,u),f&&r(Ft,j({},d,f))}return o(s)}}}}var br={};function ol(e,t){br[e]&&le(br[e])&&(br[e](t),delete br[e])}function ph(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return ph(e,t,r-10).then(n,a)})})}function ZP(e){return{abort:e}}function mh(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,b=a[h][v];if(b&&le(b)){var g,T=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[Xe,Dt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=b({payload:T,config:o[h].config,instance:r,abort:ZP}))&&ue(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var y=v+":"+h;e.dispatch(j({},T,{type:y,_:{called:y,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var Ti=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Bt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,y,p){var S=y.config,O=y.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Bt)?function(M,F,X,L,x){return function(H,R){var Z=L?L.name:M,ee=R&&Lr(R)?R:X;if(L&&(!(ee=R&&Lr(R)?R:[M]).includes(M)||ee.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(ee)+" input valid");return j({},x,{abort:{reason:H,plugins:ee,caller:F,_:Z}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:JP(I),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,T){var I=T.pluginName,y=T.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[I].loaded),l.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var y=T.pluginName;return Promise.resolve(g).then(function(p){function S(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[y])return Promise.resolve(t.namespaced[y].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&le(k.method)?(function(H,R){var Z=hl(H);if(Z&&Z.name===R){var ee=hl(Z.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+Z.method+" "+(ee?"or "+ee.method:"")+" in "+R+" plugin insteadof "+H].join(`
|
|
6
|
+
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,x=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:x||L}})}),config:ul(k.pluginName,f,i),plugins:f})).then(function(H){var R=ue(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[y]=_});p[y]=r}();return O&&O.then?O.then(S):S()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,y){try{var p=t.exact.length===y+1,S=I.pluginName,O=i[S];return Promise.resolve(T).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),Ei(k,S))return Pi({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(Ei(_,S))return p&&Pi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty(S)&&b[S]===!0)return s.dispatch({type:"queue",plugin:S,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[S],i[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:ul(S,f,i),plugins:f})).then(function(F){var X=ue(F)?F:{},L=j({},_,X),x=g[S];if(Ei(x,S))Pi({data:x,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(sl)&&!c.match(cl)&&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(T){if(!(c.match(Bt)||c.match(/^registerPlugin/)||c.match(cl)||c.match(sl)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});gh(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Bt=/Start$/,sl=/^bootstrap/,cl=/^ready/;function Pi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function ul(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function ll(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function fl(e,t){var r=e.replace(Bt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Ei(e,t){var r=e.abort;return!!r&&(r===!0||dl(r,t)||r&&dl(r.plugins,t))}function gh(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 dl(e,t){return!(!e||!Lr(e))&&e.includes(t)}function hl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function JP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ue(e[r])?Object.assign({},e[r]):e[r]),t},{})}function YP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return ol(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],T=o.disabled,I=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return ph(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!po.includes(M)})}),n[O]=!0),b=b.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(I).then(function(p){var S={plugins:b,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return mh(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(),x=(Z=M,(ee=L.plugins)===void 0&&(ee={}),(Fe=p.options)===void 0&&(Fe={}),Object.keys(Z).filter(function(m){var w=Fe.plugins||{};return RP(w[m])?w[m]:w.all!==!1&&(!ee[m]||ee[m].enabled!==!1)}).map(function(m){return Z[m]}));F===A.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var w=L.plugins[m];return p.plugins.includes(m)&&!w.initialized}).map(function(m){return M[m]}));var H=x.map(function(m){return m.name}),R=function(m,w,E){var U=fl(m).map(function(N){return ll(N,w)});return w.reduce(function(N,D){var q=D.name,z=fl(m,q).map(function($){return ll($,w)}),J=z[0],B=z[1],pe=z[2];return J.length&&(N.beforeNS[q]=J),B.length&&(N.duringNS[q]=B),pe.length&&(N.afterNS[q]=pe),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(Ti({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function w(){var N=function(){if(F.match(Bt))return Promise.resolve(Ti({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&&ol(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(gh(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Ti({action:j({},m,{type:X}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var Z,ee,Fe}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(p){return Promise.reject(p)}}}}}function XP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var qP=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return qt.apply(void 0,o)(n)(a)}}}}};function QP(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=vl(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=vl(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,pl(r.plugins,!1,t));case A.enablePlugin:return j({},t,pl(r.plugins,!0,t));default:return t}}}function vl(e,t){return e.substring(t.length+1,e.length)}function pl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function yh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var eE={last:{},history:[]};function tE(e,t){e===void 0&&(e=eE);var r=t.options,n=t.meta;if(t.type===A.track){var a=yh(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 rE={actions:[]};function nE(e,t){e===void 0&&(e=rE);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 wh=/#.*$/;function aE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(wh,""):"")}var bh,Sh,$h,Ih,iE=function(e){if(e===void 0&&(e={}),!te)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var h=function(){if(te){for(var v,b=document.getElementsByTagName("link"),g=0;v=b[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(wh,"")}(f),c={title:r,url:l,path:aE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},oE={last:{},history:[]};function sE(e,t){e===void 0&&(e=oE);var r=t.options;if(t.type===A.page){var n=yh(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}bh=function(){if(!te)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Sh=te?document.referrer:null,$h=xP(),Ih=DP();var ml={initialized:!1,sessionId:da(),app:null,version:null,debug:!1,offline:!!te&&!navigator.onLine,os:{name:bh},userAgent:te?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Ih,locale:$h,campaign:{},referrer:Sh};function cE(e,t){e===void 0&&(e=ml);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({},ml,e,{initialized:!0})}}var uE=["plugins","reducers","storage"];function lE(e,t,r){if(te){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function fE(e){var t=lE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Th(){return yt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Xt[Yt].analytics.push(o.action||o),i(o)}})}}}function gl(e){return function(){return qt(qt.apply(null,arguments),Th())}}function Oi(e){return e?dh(e)?e:[e]:[]}function yl(e,t,r){e===void 0&&(e={});var n,a,i=da();return t&&(br[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(le(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function dE(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),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(w),m.plugins[w.name])throw new Error(w.name+"AlreadyLoaded");return m.plugins[w.name]=w,m.plugins[w.name].loaded||(m.plugins[w.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:gt,setItem:yt,removeItem:ar},i=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ue(U)&&U[w]?U[w]:il(m)[w]||gt(mo(w))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!po.includes(m)}).sort(),u=new Set(s.concat(kn).filter(function(m){return!po.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new qP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=MP(),T=il(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=da());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:Oi(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:Oi(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var N=tt(m)?m:null,D=ue(m)?m:w,q=E||{},z=S.user();yt(mo(Xe),N);var J=N||D.userId||i(Xe,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!==N&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var N=ue(m)?m.event:m;if(!N||!tt(N))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:N,properties:D,options:q,userId:i(Xe,S,w),anonymousId:i(Dt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ue(m)?m:{},N=ue(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:iE(U),options:N,userId:i(Xe,S,U),anonymousId:i(Dt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Xe||m==="id")return i(Xe,S);if(m===Dt||m==="anonId")return i(Dt,S);var w=S.getState("user");return m?qu(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:o}),J(B)}}},N=function(z){return function(J){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:o}),J(B)}}};return d(U,mn),d(N,gn),function(){h(U,mn),h(N,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:o,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:o,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?qu(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=yl()),w(E)}}},v(mn),YP(S,l,{all:f,plugins:s}),XP(a),GP(S),VP(S),v(gn)]),_={context:cE,user:WP(a),page:sE,track:tE,plugins:QP(l),queue:nE},k=qt,M=qt;if(te&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Th():ue(typeof arguments[0])?gl():gl().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return uE.includes(E)||(w[E]=m[E]),w},{})}(e),x=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,N=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!N({config:U}),config:U},m},{}),H={context:L,user:I,plugins:x},R=vh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var N=w[U];typeof m[N]===qe&&(E[N]=m[N])}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"})===Ge||typeof B(void 0,{type:zP})===Ge)throw new Error("reducer "+J+" "+Ge)})})(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===Ge){var V=HP(P,J);throw new Error(V)}pe[P]=W,B=B||W!==C}return B?pe:z}}(j({},_,t)),H,M(k(KP.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:yl(m.meta,w,Oi(E))});return X.apply(null,[U])});var Z=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:Z,config:L,params:g,user:I,initialUser:r,persistedUser:T});var ee=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,N=m.name;E&&le(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:ee,disabled:Fe})}),fE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return mh(m,w,E)},3e3)}(R,l,S),S}var mn="before",gn="after",kr="cookie",lt=Oh(),Ph=ha,hE=ha;function Eh(e){return lt?ha(e,"",-1):ar(e)}function Oh(){if(lt!==void 0)return lt;var e="cookiecookie";try{ha(e,e),lt=document.cookie.indexOf(e)!==-1,Eh(e)}catch{lt=!1}return lt}function ha(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return lt===!1&&(o?yt(e,t):gt(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var _r="localStorage",vE=ds.bind(null,"localStorage");ir("localStorage","getItem",gt);ir("localStorage","setItem",yt);ir("localStorage","removeItem",ar);var Rr="sessionStorage",pE=ds.bind(null,"sessionStorage");ir("sessionStorage","getItem",gt);ir("sessionStorage","setItem",yt);ir("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 mE=vE(),gE=pE(),yE=Oh();function kh(e,t){if(e){var r=hs(t),n=!gs(r),a=vs(r)?zt(localStorage.getItem(e)):void 0;if(n&&!xt(a))return a;var i=ps(r)?zt(Ph(e)):void 0;if(n&&i)return i;var o=ms(r)?zt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=gt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function wE(e,t,r){if(e&&!xt(t)){var n={},a=hs(r),i=JSON.stringify(t),o=!gs(a);return vs(a)&&(n[_r]=yn(_r,t,zt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[_r]:ps(a)&&(n[kr]=yn(kr,t,zt(Ph(e))),hE(e,i),o)?n[kr]:ms(a)&&(n[Rr]=yn(Rr,t,zt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Rr]:(n[Or]=yn(Or,t,gt(e)),yt(e,t),o?n[Or]:n)}}function bE(e,t){if(e){var r=hs(t),n=kh(e,uh),a={};return!xt(n.localStorage)&&vs(r)&&(localStorage.removeItem(e),a[_r]=n.localStorage),!xt(n.cookie)&&ps(r)&&(Eh(e),a[kr]=n.cookie),!xt(n.sessionStorage)&&ms(r)&&(sessionStorage.removeItem(e),a[Rr]=n.sessionStorage),!xt(n.global)&&va(r,Or)&&(ar(e),a[Or]=n.global),a}}function hs(e){return e?tt(e)?e:e.storage:ch}function vs(e){return mE&&va(e,_r)}function ps(e){return yE&&va(e,kr)}function ms(e){return gE&&va(e,Rr)}function gs(e){return e===uh||e==="all"}function va(e,t){return e===ch||e===t||gs(e)}function yn(e,t,r){return{location:e,current:t,previous:r}}var SE={setItem:wE,getItem:kh,removeItem:bE};function $E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wl(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 bl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wl(Object(r),!0).forEach(function(n){$E(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:SE};return dE(bl(bl({},t),e))}function TE(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function PE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=OE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function EE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function OE(e){return["#","?"].forEach(t=>e=EE(e,t)),e}function kE(){PE(()=>{He.page()})}function _E(e){if(e===void 0&&(e={}),!te)return vo;var t=$l(),r=go(),n=Sl(),a=wn(n,t),i=wn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return vo;var h=d.map(function(b){return Number(b)}),v=BP(function(){var b=$l(),g=function(L,x){return x.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),T=go(),I=Sl(),y=wn(I,b),p=wn(T,b);if(l=y>l?y:l,c=p<c?p:c,!(o.length>=h.length)){var S=f===I,O="up";S?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,H){var R=_[H];return u.includes(x)&&I<=R&&(u=u.filter(function(Z){return Z!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=y?(L.foundFunc=[x],L):(S&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){le(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;le(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function go(){return te?document.body.scrollTop||document.documentElement.scrollTop:0}function RE(){return te?window.innerHeight||document.documentElement.clientHeight:0}function Sl(){return Math.round(go()+RE())}function $l(){if(!te)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function wn(e,t){return Math.round(e/t*100)}var Il="EventListener";function CE(e){return function(t,r,n,a){var i=n||vo,o=a||!1;if(!te)return i;var s=Kn(r),u=Kn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+Il:"remove"+Il,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?AE(i):i:f[h]||i;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],o)}return l.bind(null,!c)}(e)}}function Kn(e,t){if(tt(e))return t?Kn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=NP(e);return t?i.map(function(o){return tt(o)?Kn(o,!0):o}).flat():i}function AE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var ki=CE("Event");function _h(e,t){return te&&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}_h.bind(null,"onerror");_h.bind(null,"onload");var Rh=typeof window>"u",Tl="hidden";function jE(e){if(Rh)return!1;var t=LE(),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 LE(){var e=["webkit","moz","ms","o"];return Rh||Tl in document?Tl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var UE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function NE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=jE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(UE.map(function(s){return ki(document,s,r)})).concat(ki(window,"load",r)).concat(ki(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function xE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(mr(d),g),a&&l&&(l=!1,a(mr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(mr(d),g))},s)}var b=NE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:mr(d,c),idle:l?mr(r,c):0}}}}function mr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Pl=5e3;class DE{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),xE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Pl}),_E({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*Pl: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 El="sesamy_session_id";function ME(){let e=sessionStorage.getItem(El);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(El,e)),e}let Ch=!1,yo,Ol,Gn;const Ah=new Map;function FE({clientId:e,enabled:t=!0,environment:r}){if(yo=e,Ol=t,Gn=`${Ke("logs",r)}/events`,!Ol)return;window.addEventListener("beforeunload",()=>{Lh.forEach((a,i)=>{a.bind(i)()}),zE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ah.forEach((a,i)=>{a.bind(i)()})}),kE();const n=new DE({element:document.body,viewCallback:()=>{He.page()},activeDurationCallback:(a,i,o)=>{He.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{He.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{He.track("scroll",{scroll:a.scrollMax})}});HE(document.body,()=>{n.flush()}),KE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const i=a;await He.identify(i.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await He.track("logout",{}),ys.flush(),await He.reset()})}function jh(e){return JSON.stringify(e.map(t=>({...t,clientId:yo,requestId:Math.random().toString(36).slice(2,9),sessionId:ME(),timestamp:new Date().toISOString(),version:fs,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:sh,userAgent:navigator.userAgent,clientId:yo}})))}const ys=TE(async e=>{if(e.length>0){const t=jh(e);Ch?navigator.sendBeacon(Gn,t):(await fetch(Gn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function _i(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Gn,jh([r]))}else ys.push(e)}const He=IE({app:sh,version:fs,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;_i({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;_i({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;_i({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function BE(e,t){He.track(e,t)}function zE(){return Ch=!0,ys.flush()}const Lh=new Map;function HE(e,t){Lh.set(e,t)}function KE(e,t){Ah.set(e,t)}const GE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function WE(){return new Promise(e=>{const t=GE.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function VE(){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 ke={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"}};function ZE(e){var t;ke={...ke,...(t=e.content)==null?void 0:t.article}}function JE(e,t){const{selector:r}=t;return r===ke.article.selector?e:e.querySelector(r)}function YE(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??void 0:e.textContent??void 0}function XE(){const e=document.querySelectorAll(ke.article.selector);return Array.from(e).map(t=>{const r={element:t},n=(a,i,o)=>{const s=JE(t,i);if(s){const u=YE(s,i);u!==void 0&&(r[a]=o?o(u):u)}};return n("title",ke.title),n("excerpt",ke.excerpt),n("image",ke.image),n("price",ke.price,a=>parseFloat(a)),n("currency",ke.currency),n("url",ke.url),n("id",ke.id),r})}function qE(e){const{autoOnboardProduct:t,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:u,getBills:f,getCheckout:l,getContract:c,getContracts:d,getEntitlement:h,getEntitlementAccess:v,getEntitlements:b,getFulfillments:g,getPaywall:T,getPaymentIssues:I,getProfile:y,getProduct:p,getSubscriptions:S,getTags:O,getTally:_,getTallies:k,getTransaction:M,getTransactions:F,getUserMetadata:X,hasAccess:L,isSpotifyLinked:x,linkSpotify:H,listUserMetadata:R,openHostedAccountPage:Z,pushTally:ee,setTag:Fe,setUserMetadata:m,unlinkSpotify:w,updateCheckout:E,updateProfile:U}=EP(e),N={analytics:{track:BE},attribution:{get:ls,set:oh},auth:{getUser:y,isAuthenticated:jr,loginWithRedirect:cs,logout:qd,setToken:eh},bills:{get:u,list:f},browser:{detectAdblock:WE,isInAppBrowser:VE},checkouts:{create:n,get:l,update:E},clearCache:_e,content:{list:XE},contracts:{cancel:r,get:c,list:d},entitlements:{access:v,get:h,hasAccess:L,list:b,signedLinks:us},fulfillments:{list:g},generateLink:s,getPaymentIssues:I,getVersion:QE,log:ce,paywalls:{get:T},products:{autoOnboard:t,get:p,linkSpotify:H},profile:{get:y,isSpotifyLinked:x,openHostedAccountPage:Z,unlinkSpotify:w,update:U},subscriptions:{list:S},tags:{delete:a,list:O,set:Fe},tallies:{delete:i,get:_,list:k,push:ee},transactions:{get:M,list:F},userMetadata:{delete:o,get:X,list:R,set:m}};return e.namespace&&(window[e.namespace]=N),N}function QE(){return fs}function eO(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
7
7
|
${t.selector}::before {
|
|
8
8
|
content: '';
|
|
9
9
|
position: absolute;
|
|
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw
|
|
|
14
14
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
|
-
`,document.head.appendChild(i)}async function Uh(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
|
|
17
|
+
`,document.head.appendChild(i)}async function Uh(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 tO(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 Uh(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 rO(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 Uh(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 nO({enabled:e=!1,rules:t}){if(!e)return;const r=await jr(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await tO(s,a);break;case"replace":await rO(s,a);break;case"remove":o.remove();break;case"gradient":eO(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const kl="access_token";function aO(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(kl);if(t){eh(t);const r=new URL(window.location.href);e.delete(kl),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const _l="sesamy-refresh",Rl="force-refetch-entitlements";function iO(){const e=new URLSearchParams(window.location.search),t=e.get(Rl),r=e.get(_l);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(Rl),e.delete(_l),n.search=e.toString(),_e(),window.history.replaceState(null,"",n)}}function oO(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function sO(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=oO(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};$P(f)}catch(s){ce(`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 Cl="sesamy-user";async function cO(){var a;const t=(a=new URLSearchParams(window.location.search).get(Cl))==null?void 0:a.toLowerCase();if(!t)return;const r=await cP();(r==null?void 0:r.email)!==t?(ce(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),_e(),cs({authorizationParams:{email_hint:t,login_hint:t}})):ce(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(Cl),window.history.replaceState(null,"",n)}const Al="sesamy-purchase";function uO(){const e=new URLSearchParams(window.location.search),t=e.get(Al);if(t!==null){const r=new URL(window.location.href);e.delete(Al),r.search=e.toString(),ce(`Purchase ${t}`),Ve(ve.PURCHASE,{itemSrc:t}),_e(),window.history.replaceState(null,"",r)}}const jl="sesamy-login",lO="sesamy_login";async function fO(){const e=new URLSearchParams(window.location.search);if(!(e.get(jl)||e.get(lO)))return;await jr()||cs();const n=new URL(window.location.href);n.searchParams.delete(jl),window.history.replaceState(null,"",n)}const Ll="sesamy-debug";async function dO(){var n;const t=(n=new URLSearchParams(window.location.search).get(Ll))==null?void 0:n.toLowerCase();if(!t)return;RT(t==="true");const r=new URL(window.location.href);r.searchParams.delete(Ll),window.history.replaceState(null,"",r)}function wo(){return typeof window<"u"}function hO(){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 vO(){if(!wo())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:hO()};oh(t)}async function Ul(e){ce(`Init with config: ${JSON.stringify(e)}`);try{FE({clientId:e.clientId,environment:e.environment,...e.analytics}),await sP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),ZE(e),e.transform&&await nO(e.transform),dO(),vO(),aO(),iO(),sO(),await fO(),await cO(),uO(),Ve(ve.READY,{})}catch(t){ce(`Failed to init ${t.message}`)}}async function Nh(e){var n;ce("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(wo()&&t in window)return ce("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=qE({clientId:e.clientId,environment:e.environment,...e.api});return wo()&&(e.awaitAllServices?await Ul(e):Ul(e)),r}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Nh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Nh;
|