@sesamy/sesamy-js 1.19.0 → 1.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var sesamyJs=function(Ee){"use strict";var SS=Object.defineProperty;var IS=(Ee,oe,G)=>oe in Ee?SS(Ee,oe,{enumerable:!0,configurable:!0,writable:!0,value:G}):Ee[oe]=G;var ve=(Ee,oe,G)=>IS(Ee,typeof oe!="symbol"?oe+"":oe,G);var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G=function(e){try{return!!e()}catch{return!0}},Ol=G,dn=!Ol(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Li=dn,Ui=Function.prototype,hn=Ui.call,_l=Li&&Ui.bind.bind(hn,hn),B=Li?_l:function(e){return function(){return hn.apply(e,arguments)}},xi=B,Rl=xi({}.toString),Cl=xi("".slice),vn=function(e){return Cl(Rl(e),8,-1)},jl=B,Al=G,Ll=vn,pn=Object,Ul=jl("".split),Ni=Al(function(){return!pn("z").propertyIsEnumerable(0)})?function(e){return Ll(e)==="String"?Ul(e,""):pn(e)}:pn,mn=function(e){return e==null},xl=mn,Nl=TypeError,dr=function(e){if(xl(e))throw new Nl("Can't call method on "+e);return e},Dl=Ni,Ml=dr,xt=function(e){return Dl(Ml(e))},Nt=function(e){return e&&e.Math===Math&&e},q=Nt(typeof globalThis=="object"&&globalThis)||Nt(typeof window=="object"&&window)||Nt(typeof self=="object"&&self)||Nt(typeof oe=="object"&&oe)||Nt(typeof oe=="object"&&oe)||function(){return this}()||Function("return this")(),Di={exports:{}},Fl=!1,Mi=q,zl=Object.defineProperty,gn=function(e,t){try{zl(Mi,e,{value:t,configurable:!0,writable:!0})}catch{Mi[e]=t}return t},Hl=q,Bl=gn,Fi="__core-js_shared__",zi=Di.exports=Hl[Fi]||Bl(Fi,{});(zi.versions||(zi.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var yn=Di.exports,Hi=yn,Bi=function(e,t){return Hi[e]||(Hi[e]=t||{})},Kl=dr,Gl=Object,hr=function(e){return Gl(Kl(e))},Wl=B,Vl=hr,Zl=Wl({}.hasOwnProperty),pe=Object.hasOwn||function(t,r){return Zl(Vl(t),r)},Yl=B,Jl=0,Xl=Math.random(),ql=Yl(1 .toString),Ki=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ql(++Jl+Xl,36)},Ql=typeof navigator<"u"&&String(navigator.userAgent)||"",Gi=q,wn=Ql,Wi=Gi.process,Vi=Gi.Deno,Zi=Wi&&Wi.versions||Vi&&Vi.version,Yi=Zi&&Zi.v8,me,vr;Yi&&(me=Yi.split("."),vr=me[0]>0&&me[0]<4?1:+(me[0]+me[1])),!vr&&wn&&(me=wn.match(/Edge\/(\d+)/),(!me||me[1]>=74)&&(me=wn.match(/Chrome\/(\d+)/),me&&(vr=+me[1])));var ef=vr,Ji=ef,tf=G,rf=q,nf=rf.String,Xi=!!Object.getOwnPropertySymbols&&!tf(function(){var e=Symbol("symbol detection");return!nf(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ji&&Ji<41}),af=Xi,qi=af&&!Symbol.sham&&typeof Symbol.iterator=="symbol",of=q,sf=Bi,Qi=pe,cf=Ki,uf=Xi,lf=qi,ct=of.Symbol,bn=sf("wks"),ff=lf?ct.for||ct:ct&&ct.withoutSetter||cf,se=function(e){return Qi(bn,e)||(bn[e]=uf&&Qi(ct,e)?ct[e]:ff("Symbol."+e)),bn[e]},Sn=typeof document=="object"&&document.all,J=typeof Sn>"u"&&Sn!==void 0?function(e){return typeof e=="function"||e===Sn}:function(e){return typeof e=="function"},df=J,Oe=function(e){return typeof e=="object"?e!==null:df(e)},hf=Oe,vf=String,pf=TypeError,Le=function(e){if(hf(e))return e;throw new pf(vf(e)+" is not an object")},eo={},mf=G,X=!mf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),gf=X,yf=G,to=gf&&yf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Se={},wf=q,ro=Oe,In=wf.document,bf=ro(In)&&ro(In.createElement),$n=function(e){return bf?In.createElement(e):{}},Sf=X,If=G,$f=$n,no=!Sf&&!If(function(){return Object.defineProperty($f("div"),"a",{get:function(){return 7}}).a!==7}),kf=dn,pr=Function.prototype.call,Ie=kf?pr.bind(pr):function(){return pr.apply(pr,arguments)},kn=q,Pf=J,Tf=function(e){return Pf(e)?e:void 0},ut=function(e,t){return arguments.length<2?Tf(kn[e]):kn[e]&&kn[e][t]},Ef=B,ao=Ef({}.isPrototypeOf),Of=ut,_f=J,Rf=ao,Cf=qi,jf=Object,io=Cf?function(e){return typeof e=="symbol"}:function(e){var t=Of("Symbol");return _f(t)&&Rf(t.prototype,jf(e))},Af=String,oo=function(e){try{return Af(e)}catch{return"Object"}},Lf=J,Uf=oo,xf=TypeError,mr=function(e){if(Lf(e))return e;throw new xf(Uf(e)+" is not a function")},Nf=mr,Df=mn,Pn=function(e,t){var r=e[t];return Df(r)?void 0:Nf(r)},Tn=Ie,En=J,On=Oe,Mf=TypeError,Ff=function(e,t){var r,n;if(t==="string"&&En(r=e.toString)&&!On(n=Tn(r,e))||En(r=e.valueOf)&&!On(n=Tn(r,e))||t!=="string"&&En(r=e.toString)&&!On(n=Tn(r,e)))return n;throw new Mf("Can't convert object to primitive value")},zf=Ie,so=Oe,co=io,Hf=Pn,Bf=Ff,Kf=se,Gf=TypeError,Wf=Kf("toPrimitive"),Vf=function(e,t){if(!so(e)||co(e))return e;var r=Hf(e,Wf),n;if(r){if(t===void 0&&(t="default"),n=zf(r,e,t),!so(n)||co(n))return n;throw new Gf("Can't convert object to primitive value")}return t===void 0&&(t="number"),Bf(e,t)},Zf=Vf,Yf=io,uo=function(e){var t=Zf(e,"string");return Yf(t)?t:t+""},Jf=X,Xf=no,qf=to,gr=Le,lo=uo,Qf=TypeError,_n=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,Rn="enumerable",Cn="configurable",jn="writable";Se.f=Jf?qf?function(t,r,n){if(gr(t),r=lo(r),gr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&jn in n&&!n[jn]){var a=ed(t,r);a&&a[jn]&&(t[r]=n.value,n={configurable:Cn in n?n[Cn]:a[Cn],enumerable:Rn in n?n[Rn]:a[Rn],writable:!1})}return _n(t,r,n)}:_n:function(t,r,n){if(gr(t),r=lo(r),gr(n),Xf)try{return _n(t,r,n)}catch{}if("get"in n||"set"in n)throw new Qf("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var td=Math.ceil,rd=Math.floor,nd=Math.trunc||function(t){var r=+t;return(r>0?rd:td)(r)},ad=nd,An=function(e){var t=+e;return t!==t||t===0?0:ad(t)},id=An,od=Math.max,sd=Math.min,cd=function(e,t){var r=id(e);return r<0?od(r+t,0):sd(r,t)},ud=An,ld=Math.min,fd=function(e){var t=ud(e);return t>0?ld(t,9007199254740991):0},dd=fd,fo=function(e){return dd(e.length)},hd=xt,vd=cd,pd=fo,ho=function(e){return function(t,r,n){var a=hd(t),i=pd(a);if(i===0)return!e&&-1;var o=vd(n,i),c;if(e&&r!==r){for(;i>o;)if(c=a[o++],c!==c)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},md={includes:ho(!0),indexOf:ho(!1)},Ln={},gd=B,Un=pe,yd=xt,wd=md.indexOf,bd=Ln,vo=gd([].push),po=function(e,t){var r=yd(e),n=0,a=[],i;for(i in r)!Un(bd,i)&&Un(r,i)&&vo(a,i);for(;t.length>n;)Un(r,i=t[n++])&&(~wd(a,i)||vo(a,i));return a},xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Sd=po,Id=xn,mo=Object.keys||function(t){return Sd(t,Id)},$d=X,kd=to,Pd=Se,Td=Le,Ed=xt,Od=mo;eo.f=$d&&!kd?Object.defineProperties:function(t,r){Td(t);for(var n=Ed(r),a=Od(r),i=a.length,o=0,c;i>o;)Pd.f(t,c=a[o++],n[c]);return t};var _d=ut,Rd=_d("document","documentElement"),Cd=Bi,jd=Ki,go=Cd("keys"),Nn=function(e){return go[e]||(go[e]=jd(e))},Ad=Le,Ld=eo,yo=xn,Ud=Ln,xd=Rd,Nd=$n,Dd=Nn,wo=">",bo="<",Dn="prototype",Mn="script",So=Dd("IE_PROTO"),Fn=function(){},Io=function(e){return bo+Mn+wo+e+bo+"/"+Mn+wo},$o=function(e){e.write(Io("")),e.close();var t=e.parentWindow.Object;return e=null,t},Md=function(){var e=Nd("iframe"),t="java"+Mn+":",r;return e.style.display="none",xd.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Io("document.F=Object")),r.close(),r.F},yr,wr=function(){try{yr=new ActiveXObject("htmlfile")}catch{}wr=typeof document<"u"?document.domain&&yr?$o(yr):Md():$o(yr);for(var e=yo.length;e--;)delete wr[Dn][yo[e]];return wr()};Ud[So]=!0;var zn=Object.create||function(t,r){var n;return t!==null?(Fn[Dn]=Ad(t),n=new Fn,Fn[Dn]=null,n[So]=t):n=wr(),r===void 0?n:Ld.f(n,r)},Fd=se,zd=zn,Hd=Se.f,Hn=Fd("unscopables"),Bn=Array.prototype;Bn[Hn]===void 0&&Hd(Bn,Hn,{configurable:!0,value:zd(null)});var Bd=function(e){Bn[Hn][e]=!0},Dt={},Kd=q,Gd=J,ko=Kd.WeakMap,Wd=Gd(ko)&&/native code/.test(String(ko)),Mt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Vd=X,Zd=Se,Yd=Mt,br=Vd?function(e,t,r){return Zd.f(e,t,Yd(1,r))}:function(e,t,r){return e[t]=r,e},Jd=Wd,Po=q,Xd=Oe,qd=br,Kn=pe,Gn=yn,Qd=Nn,eh=Ln,To="Object already initialized",Wn=Po.TypeError,th=Po.WeakMap,Sr,Ft,Ir,rh=function(e){return Ir(e)?Ft(e):Sr(e,{})},nh=function(e){return function(t){var r;if(!Xd(t)||(r=Ft(t)).type!==e)throw new Wn("Incompatible receiver, "+e+" required");return r}};if(Jd||Gn.state){var $e=Gn.state||(Gn.state=new th);$e.get=$e.get,$e.has=$e.has,$e.set=$e.set,Sr=function(e,t){if($e.has(e))throw new Wn(To);return t.facade=e,$e.set(e,t),t},Ft=function(e){return $e.get(e)||{}},Ir=function(e){return $e.has(e)}}else{var lt=Qd("state");eh[lt]=!0,Sr=function(e,t){if(Kn(e,lt))throw new Wn(To);return t.facade=e,qd(e,lt,t),t},Ft=function(e){return Kn(e,lt)?e[lt]:{}},Ir=function(e){return Kn(e,lt)}}var zt={set:Sr,get:Ft,has:Ir,enforce:rh,getterFor:nh},Vn={},Zn={},Eo={}.propertyIsEnumerable,Oo=Object.getOwnPropertyDescriptor,ah=Oo&&!Eo.call({1:2},1);Zn.f=ah?function(t){var r=Oo(this,t);return!!r&&r.enumerable}:Eo;var ih=X,oh=Ie,sh=Zn,ch=Mt,uh=xt,lh=uo,fh=pe,dh=no,_o=Object.getOwnPropertyDescriptor;Vn.f=ih?_o:function(t,r){if(t=uh(t),r=lh(r),dh)try{return _o(t,r)}catch{}if(fh(t,r))return ch(!oh(sh.f,t,r),t[r])};var Ro={exports:{}},Yn=X,hh=pe,Co=Function.prototype,vh=Yn&&Object.getOwnPropertyDescriptor,Jn=hh(Co,"name"),ph=Jn&&(function(){}).name==="something",mh=Jn&&(!Yn||Yn&&vh(Co,"name").configurable),jo={EXISTS:Jn,PROPER:ph,CONFIGURABLE:mh},gh=B,yh=J,Xn=yn,wh=gh(Function.toString);yh(Xn.inspectSource)||(Xn.inspectSource=function(e){return wh(e)});var Ao=Xn.inspectSource,qn=B,bh=G,Sh=J,$r=pe,Qn=X,Ih=jo.CONFIGURABLE,$h=Ao,Lo=zt,kh=Lo.enforce,Ph=Lo.get,Uo=String,kr=Object.defineProperty,Th=qn("".slice),Eh=qn("".replace),Oh=qn([].join),_h=Qn&&!bh(function(){return kr(function(){},"length",{value:8}).length!==8}),Rh=String(String).split("String"),Ch=Ro.exports=function(e,t,r){Th(Uo(t),0,7)==="Symbol("&&(t="["+Eh(Uo(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!$r(e,"name")||Ih&&e.name!==t)&&(Qn?kr(e,"name",{value:t,configurable:!0}):e.name=t),_h&&r&&$r(r,"arity")&&e.length!==r.arity&&kr(e,"length",{value:r.arity});try{r&&$r(r,"constructor")&&r.constructor?Qn&&kr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=kh(e);return $r(n,"source")||(n.source=Oh(Rh,typeof t=="string"?t:"")),e};Function.prototype.toString=Ch(function(){return Sh(this)&&Ph(this).source||$h(this)},"toString");var xo=Ro.exports,jh=J,Ah=Se,Lh=xo,Uh=gn,Ue=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(jh(r)&&Lh(r,i,n),n.global)a?e[t]=r:Uh(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Ah.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},No={},xh=po,Nh=xn,Dh=Nh.concat("length","prototype");No.f=Object.getOwnPropertyNames||function(t){return xh(t,Dh)};var ea={};ea.f=Object.getOwnPropertySymbols;var Mh=ut,Fh=B,zh=No,Hh=ea,Bh=Le,Kh=Fh([].concat),Gh=Mh("Reflect","ownKeys")||function(t){var r=zh.f(Bh(t)),n=Hh.f;return n?Kh(r,n(t)):r},Do=pe,Wh=Gh,Vh=Vn,Zh=Se,Yh=function(e,t,r){for(var n=Wh(t),a=Zh.f,i=Vh.f,o=0;o<n.length;o++){var c=n[o];!Do(e,c)&&!(r&&Do(r,c))&&a(e,c,i(t,c))}},Jh=G,Xh=J,qh=/#|\.prototype\./,Ht=function(e,t){var r=ev[Qh(e)];return r===rv?!0:r===tv?!1:Xh(t)?Jh(t):!!t},Qh=Ht.normalize=function(e){return String(e).replace(qh,".").toLowerCase()},ev=Ht.data={},tv=Ht.NATIVE="N",rv=Ht.POLYFILL="P",nv=Ht,Pr=q,av=Vn.f,iv=br,ov=Ue,sv=gn,cv=Yh,uv=nv,ft=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,c,l,f,u;if(n?o=Pr:a?o=Pr[r]||sv(r,{}):o=Pr[r]&&Pr[r].prototype,o)for(c in t){if(f=t[c],e.dontCallGetSet?(u=av(o,c),l=u&&u.value):l=o[c],i=uv(n?c:r+(a?".":"#")+c,e.forced),!i&&l!==void 0){if(typeof f==typeof l)continue;cv(f,l)}(e.sham||l&&l.sham)&&iv(f,"sham",!0),ov(o,c,f,e)}},lv=G,fv=!lv(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),dv=pe,hv=J,vv=hr,pv=Nn,mv=fv,Mo=pv("IE_PROTO"),ta=Object,gv=ta.prototype,Fo=mv?ta.getPrototypeOf:function(e){var t=vv(e);if(dv(t,Mo))return t[Mo];var r=t.constructor;return hv(r)&&t instanceof r?r.prototype:t instanceof ta?gv:null},yv=G,wv=J,bv=Oe,zo=Fo,Sv=Ue,Iv=se,ra=Iv("iterator"),Ho=!1,We,na,aa;[].keys&&(aa=[].keys(),"next"in aa?(na=zo(zo(aa)),na!==Object.prototype&&(We=na)):Ho=!0);var $v=!bv(We)||yv(function(){var e={};return We[ra].call(e)!==e});$v&&(We={}),wv(We[ra])||Sv(We,ra,function(){return this});var Bo={IteratorPrototype:We,BUGGY_SAFARI_ITERATORS:Ho},kv=Se.f,Pv=pe,Tv=se,Ko=Tv("toStringTag"),Bt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Pv(e,Ko)&&kv(e,Ko,{configurable:!0,value:t})},Ev=Bo.IteratorPrototype,Ov=zn,_v=Mt,Rv=Bt,Cv=Dt,jv=function(){return this},Go=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Ov(Ev,{next:_v(+!n,r)}),Rv(e,a,!1),Cv[a]=jv,e},Av=B,Lv=mr,Uv=function(e,t,r){try{return Av(Lv(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},xv=Oe,Nv=function(e){return xv(e)||e===null},Dv=Nv,Mv=String,Fv=TypeError,zv=function(e){if(Dv(e))return e;throw new Fv("Can't set "+Mv(e)+" as a prototype")},Hv=Uv,Bv=Oe,Kv=dr,Gv=zv,Wv=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Hv(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Kv(a),Gv(i),Bv(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Vv=ft,Zv=Ie,Wo=jo,Yv=J,Jv=Go,Vo=Fo,Zo=Wv,Xv=Bt,qv=br,ia=Ue,Qv=se,ep=Dt,Yo=Bo,tp=Wo.PROPER,rp=Wo.CONFIGURABLE,Jo=Yo.IteratorPrototype,Tr=Yo.BUGGY_SAFARI_ITERATORS,Kt=Qv("iterator"),Xo="keys",Gt="values",qo="entries",np=function(){return this},Qo=function(e,t,r,n,a,i,o){Jv(r,t,n);var c=function($){if($===a&&d)return d;if(!Tr&&$&&$ in u)return u[$];switch($){case Xo:return function(){return new r(this,$)};case Gt:return function(){return new r(this,$)};case qo:return function(){return new r(this,$)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,s=u[Kt]||u["@@iterator"]||a&&u[a],d=!Tr&&s||c(a),h=t==="Array"&&u.entries||s,m,S,g;if(h&&(m=Vo(h.call(new e)),m!==Object.prototype&&m.next&&(Vo(m)!==Jo&&(Zo?Zo(m,Jo):Yv(m[Kt])||ia(m,Kt,np)),Xv(m,l,!0))),tp&&a===Gt&&s&&s.name!==Gt&&(rp?qv(u,"name",Gt):(f=!0,d=function(){return Zv(s,this)})),a)if(S={values:c(Gt),keys:i?d:c(Xo),entries:c(qo)},o)for(g in S)(Tr||f||!(g in u))&&ia(u,g,S[g]);else Vv({target:t,proto:!0,forced:Tr||f},S);return u[Kt]!==d&&ia(u,Kt,d,{name:a}),ep[t]=d,S},oa=function(e,t){return{value:e,done:t}},ap=xt,sa=Bd,es=Dt,ts=zt,ip=Se.f,op=Qo,Er=oa,sp=X,rs="Array Iterator",cp=ts.set,up=ts.getterFor(rs),lp=op(Array,"Array",function(e,t){cp(this,{type:rs,target:ap(e),index:0,kind:t})},function(){var e=up(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Er(void 0,!0);switch(e.kind){case"keys":return Er(r,!1);case"values":return Er(t[r],!1)}return Er([r,t[r]],!1)},"values"),ns=es.Arguments=es.Array;if(sa("keys"),sa("values"),sa("entries"),sp&&ns.name!=="values")try{ip(ns,"name",{value:"values"})}catch{}var as=q,fp=X,dp=Object.getOwnPropertyDescriptor,hp=function(e){if(!fp)return as[e];var t=dp(as,e);return t&&t.value},vp=G,pp=se,mp=X,is=Fl,gp=pp("iterator"),Or=!vp(function(){var e=new URL("b?a=1&b=2&c=3","http://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),is&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(is||!mp)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[gp]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("http://x",void 0).host!=="x"}),os=xo,yp=Se,ca=function(e,t,r){return r.get&&os(r.get,t,{getter:!0}),r.set&&os(r.set,t,{setter:!0}),yp.f(e,t,r)},wp=Ue,bp=function(e,t,r){for(var n in t)wp(e,n,t[n],r);return e},Sp=ao,Ip=TypeError,ss=function(e,t){if(Sp(t,e))return e;throw new Ip("Incorrect invocation")},$p=vn,kp=B,Pp=function(e){if($p(e)==="Function")return kp(e)},cs=Pp,Tp=mr,Ep=dn,Op=cs(cs.bind),ua=function(e,t){return Tp(e),t===void 0?e:Ep?Op(e,t):function(){return e.apply(t,arguments)}},_p=se,Rp=_p("toStringTag"),us={};us[Rp]="z";var Cp=String(us)==="[object z]",jp=Cp,Ap=J,_r=vn,Lp=se,Up=Lp("toStringTag"),xp=Object,Np=_r(function(){return arguments}())==="Arguments",Dp=function(e,t){try{return e[t]}catch{}},Rr=jp?_r:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Dp(t=xp(e),Up))=="string"?r:Np?_r(t):(n=_r(t))==="Object"&&Ap(t.callee)?"Arguments":n},Mp=Rr,Fp=String,xe=function(e){if(Mp(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Fp(e)},zp=Rr,ls=Pn,Hp=mn,Bp=Dt,Kp=se,Gp=Kp("iterator"),la=function(e){if(!Hp(e))return ls(e,Gp)||ls(e,"@@iterator")||Bp[zp(e)]},Wp=Ie,Vp=mr,Zp=Le,Yp=oo,Jp=la,Xp=TypeError,fs=function(e,t){var r=arguments.length<2?Jp(e):t;if(Vp(r))return Zp(Wp(r,e));throw new Xp(Yp(e)+" is not iterable")},qp=TypeError,dt=function(e,t){if(e<t)throw new qp("Not enough arguments");return e},Qp=B,ds=Qp([].slice),hs=ds,em=Math.floor,fa=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=em(r/2),c=fa(hs(e,0,o),t),l=fa(hs(e,o),t),f=c.length,u=l.length,s=0,d=0;s<f||d<u;)e[s+d]=s<f&&d<u?t(c[s],l[d])<=0?c[s++]:l[d++]:s<f?c[s++]:l[d++];return e},tm=fa,da=ft,Cr=q,ha=hp,jr=Ie,ke=B,Wt=X,vs=Or,ps=Ue,rm=ca,nm=bp,am=Bt,im=Go,va=zt,ms=ss,pa=J,om=pe,sm=ua,cm=Rr,um=Le,gs=Oe,Q=xe,lm=zn,ys=Mt,ws=fs,fm=la,Ar=oa,ht=dt,dm=se,hm=tm,vm=dm("iterator"),vt="URLSearchParams",bs=vt+"Iterator",Ss=va.set,ce=va.getterFor(vt),pm=va.getterFor(bs),Is=ha("fetch"),Lr=ha("Request"),Vt=ha("Headers"),ma=Lr&&Lr.prototype,$s=Vt&&Vt.prototype,mm=Cr.RegExp,gm=Cr.TypeError,ks=Cr.decodeURIComponent,ym=Cr.encodeURIComponent,wm=ke("".charAt),Ps=ke([].join),Ve=ke([].push),ga=ke("".replace),bm=ke([].shift),Ts=ke([].splice),Es=ke("".split),Sm=ke("".slice),Im=/\+/g,Os=Array(4),$m=function(e){return Os[e-1]||(Os[e-1]=mm("((?:%[\\da-f]{2}){"+e+"})","gi"))},km=function(e){try{return ks(e)}catch{return e}},_s=function(e){var t=ga(e,Im," "),r=4;try{return ks(t)}catch{for(;r;)t=ga(t,$m(r--),km);return t}},Pm=/[!'()~]|%20/g,Tm={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Em=function(e){return Tm[e]},Rs=function(e){return ga(ym(e),Pm,Em)},ya=im(function(t,r){Ss(this,{type:bs,target:ce(t).entries,index:0,kind:r})},vt,function(){var t=pm(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Ar(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Ar(a.key,!1);case"values":return Ar(a.value,!1)}return Ar([a.key,a.value],!1)},!0),Cs=function(e){this.entries=[],this.url=null,e!==void 0&&(gs(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?wm(e,0)==="?"?Sm(e,1):e:Q(e)))};Cs.prototype={type:vt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=fm(e),n,a,i,o,c,l,f;if(r)for(n=ws(e,r),a=n.next;!(i=jr(a,n)).done;){if(o=ws(um(i.value)),c=o.next,(l=jr(c,o)).done||(f=jr(c,o)).done||!jr(c,o).done)throw new gm("Expected sequence with length 2");Ve(t,{key:Q(l.value),value:Q(f.value)})}else for(var u in e)om(e,u)&&Ve(t,{key:u,value:Q(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Es(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Es(a,"="),Ve(t,{key:_s(bm(i)),value:_s(Ps(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ve(t,Rs(n.key)+"="+Rs(n.value));return Ps(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ur=function(){ms(this,pt);var t=arguments.length>0?arguments[0]:void 0,r=Ss(this,new Cs(t));Wt||(this.size=r.entries.length)},pt=Ur.prototype;if(nm(pt,{append:function(t,r){var n=ce(this);ht(arguments.length,2),Ve(n.entries,{key:Q(t),value:Q(r)}),Wt||this.length++,n.updateURL()},delete:function(e){for(var t=ce(this),r=ht(arguments.length,1),n=t.entries,a=Q(e),i=r<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<n.length;){var l=n[c];if(l.key===a&&(o===void 0||l.value===o)){if(Ts(n,c,1),o!==void 0)break}else c++}Wt||(this.size=n.length),t.updateURL()},get:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ve(a,r[i].value);return a},has:function(t){for(var r=ce(this).entries,n=ht(arguments.length,1),a=Q(t),i=n<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<r.length;){var l=r[c++];if(l.key===a&&(o===void 0||l.value===o))return!0}return!1},set:function(t,r){var n=ce(this);ht(arguments.length,1);for(var a=n.entries,i=!1,o=Q(t),c=Q(r),l=0,f;l<a.length;l++)f=a[l],f.key===o&&(i?Ts(a,l--,1):(i=!0,f.value=c));i||Ve(a,{key:o,value:c}),Wt||(this.size=a.length),n.updateURL()},sort:function(){var t=ce(this);hm(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=ce(this).entries,n=sm(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 ya(this,"keys")},values:function(){return new ya(this,"values")},entries:function(){return new ya(this,"entries")}},{enumerable:!0}),ps(pt,vm,pt.entries,{name:"entries"}),ps(pt,"toString",function(){return ce(this).serialize()},{enumerable:!0}),Wt&&rm(pt,"size",{get:function(){return ce(this).entries.length},configurable:!0,enumerable:!0}),am(Ur,vt),da({global:!0,constructor:!0,forced:!vs},{URLSearchParams:Ur}),!vs&&pa(Vt)){var Om=ke($s.has),_m=ke($s.set),js=function(e){if(gs(e)){var t=e.body,r;if(cm(t)===vt)return r=e.headers?new Vt(e.headers):new Vt,Om(r,"content-type")||_m(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),lm(e,{body:ys(0,Q(t)),headers:ys(0,r)})}return e};if(pa(Is)&&da({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Is(t,arguments.length>1?js(arguments[1]):{})}}),pa(Lr)){var wa=function(t){return ms(this,ma),new Lr(t,arguments.length>1?js(arguments[1]):{})};ma.constructor=wa,wa.prototype=ma,da({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:wa})}}var Rm={URLSearchParams:Ur,getState:ce},Cm=Ue,xr=B,As=xe,jm=dt,Ls=URLSearchParams,Nr=Ls.prototype,Am=xr(Nr.append),Us=xr(Nr.delete),Lm=xr(Nr.forEach),Um=xr([].push),ba=new Ls("a=1&a=2&b=3");ba.delete("a",1),ba.delete("b",void 0),ba+""!="a=2"&&Cm(Nr,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Us(this,e);var n=[];Lm(this,function(s,d){Um(n,{key:d,value:s})}),jm(t,1);for(var a=As(e),i=As(r),o=0,c=0,l=!1,f=n.length,u;o<f;)u=n[o++],l||u.key===a?(l=!0,Us(this,u.key)):c++;for(;c<f;)u=n[c++],u.key===a&&u.value===i||Am(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var xm=Ue,xs=B,Nm=xe,Dm=dt,Ns=URLSearchParams,Sa=Ns.prototype,Mm=xs(Sa.getAll),Fm=xs(Sa.has),Ds=new Ns("a=1");(Ds.has("a",2)||!Ds.has("a",void 0))&&xm(Sa,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Fm(this,t);var a=Mm(this,t);Dm(r,1);for(var i=Nm(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var zm=X,Hm=B,Bm=ca,Ia=URLSearchParams.prototype,Km=Hm(Ia.forEach);zm&&!("size"in Ia)&&Bm(Ia,"size",{get:function(){var t=0;return Km(this,function(){t++}),t},configurable:!0,enumerable:!0});var Gm=q,Ms=Gm,Wm=Ms;Wm.URLSearchParams;var $a=B,Vm=An,Zm=xe,Ym=dr,Jm=$a("".charAt),Fs=$a("".charCodeAt),Xm=$a("".slice),zs=function(e){return function(t,r){var n=Zm(Ym(t)),a=Vm(r),i=n.length,o,c;return a<0||a>=i?e?"":void 0:(o=Fs(n,a),o<55296||o>56319||a+1===i||(c=Fs(n,a+1))<56320||c>57343?e?Jm(n,a):o:e?Xm(n,a,a+2):(o-55296<<10)+(c-56320)+65536)}},Hs={codeAt:zs(!1),charAt:zs(!0)},qm=Hs.charAt,Qm=xe,Bs=zt,eg=Qo,Ks=oa,Gs="String Iterator",tg=Bs.set,rg=Bs.getterFor(Gs);eg(String,"String",function(e){tg(this,{type:Gs,string:Qm(e),index:0})},function(){var t=rg(this),r=t.string,n=t.index,a;return n>=r.length?Ks(void 0,!0):(a=qm(r,n),t.index+=a.length,Ks(a,!1))});var Ws=X,ng=B,ag=Ie,ig=G,ka=mo,og=ea,sg=Zn,cg=hr,ug=Ni,mt=Object.assign,Vs=Object.defineProperty,lg=ng([].concat),fg=!mt||ig(function(){if(Ws&&mt({b:1},mt(Vs({},"a",{enumerable:!0,get:function(){Vs(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}),mt({},e)[r]!==7||ka(mt({},t)).join("")!==n})?function(t,r){for(var n=cg(t),a=arguments.length,i=1,o=og.f,c=sg.f;a>i;)for(var l=ug(arguments[i++]),f=o?lg(ka(l),o(l)):ka(l),u=f.length,s=0,d;u>s;)d=f[s++],(!Ws||ag(c,l,d))&&(n[d]=l[d]);return n}:mt,dg=Ie,Zs=Le,hg=Pn,vg=function(e,t,r){var n,a;Zs(e);try{if(n=hg(e,"return"),!n){if(t==="throw")throw r;return r}n=dg(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Zs(n),r},pg=Le,mg=vg,gg=function(e,t,r,n){try{return n?t(pg(r)[0],r[1]):t(r)}catch(a){mg(e,"throw",a)}},yg=se,wg=Dt,bg=yg("iterator"),Sg=Array.prototype,Ig=function(e){return e!==void 0&&(wg.Array===e||Sg[bg]===e)},$g=B,kg=G,Ys=J,Pg=Rr,Tg=ut,Eg=Ao,Js=function(){},Xs=Tg("Reflect","construct"),Pa=/^\s*(?:class|function)\b/,Og=$g(Pa.exec),_g=!Pa.test(Js),Zt=function(t){if(!Ys(t))return!1;try{return Xs(Js,[],t),!0}catch{return!1}},qs=function(t){if(!Ys(t))return!1;switch(Pg(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _g||!!Og(Pa,Eg(t))}catch{return!0}};qs.sham=!0;var Rg=!Xs||kg(function(){var e;return Zt(Zt.call)||!Zt(Object)||!Zt(function(){e=!0})||e})?qs:Zt,Cg=X,jg=Se,Ag=Mt,Lg=function(e,t,r){Cg?jg.f(e,t,Ag(0,r)):e[t]=r},Ug=ua,xg=Ie,Ng=hr,Dg=gg,Mg=Ig,Fg=Rg,zg=fo,Qs=Lg,Hg=fs,Bg=la,ec=Array,Kg=function(t){var r=Ng(t),n=Fg(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Ug(i,a>2?arguments[2]:void 0));var c=Bg(r),l=0,f,u,s,d,h,m;if(c&&!(this===ec&&Mg(c)))for(u=n?new this:[],d=Hg(r,c),h=d.next;!(s=xg(h,d)).done;l++)m=o?Dg(d,i,[s.value,l],!0):s.value,Qs(u,l,m);else for(f=zg(r),u=n?new this(f):ec(f);f>l;l++)m=o?i(r[l],l):r[l],Qs(u,l,m);return u.length=l,u},Ze=B,Ta=2147483647,Yt=36,tc=1,Ea=26,Gg=38,Wg=700,Vg=72,Zg=128,Yg="-",Jg=/[^\0-\u007E]/,rc=/[.\u3002\uFF0E\uFF61]/g,nc="Overflow: input needs wider integers to process",Oa=Yt-tc,ac=RangeError,Xg=Ze(rc.exec),gt=Math.floor,_a=String.fromCharCode,ic=Ze("".charCodeAt),oc=Ze([].join),Ne=Ze([].push),qg=Ze("".replace),Qg=Ze("".split),ey=Ze("".toLowerCase),ty=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=ic(e,r++);if(a>=55296&&a<=56319&&r<n){var i=ic(e,r++);(i&64512)===56320?Ne(t,((a&1023)<<10)+(i&1023)+65536):(Ne(t,a),r--)}else Ne(t,a)}return t},sc=function(e){return e+22+75*(e<26)},ry=function(e,t,r){var n=0;for(e=r?gt(e/Wg):e>>1,e+=gt(e/t);e>Oa*Ea>>1;)e=gt(e/Oa),n+=Yt;return gt(n+(Oa+1)*e/(e+Gg))},ny=function(e){var t=[];e=ty(e);var r=e.length,n=Zg,a=0,i=Vg,o,c;for(o=0;o<e.length;o++)c=e[o],c<128&&Ne(t,_a(c));var l=t.length,f=l;for(l&&Ne(t,Yg);f<r;){var u=Ta;for(o=0;o<e.length;o++)c=e[o],c>=n&&c<u&&(u=c);var s=f+1;if(u-n>gt((Ta-a)/s))throw new ac(nc);for(a+=(u-n)*s,n=u,o=0;o<e.length;o++){if(c=e[o],c<n&&++a>Ta)throw new ac(nc);if(c===n){for(var d=a,h=Yt;;){var m=h<=i?tc:h>=i+Ea?Ea:h-i;if(d<m)break;var S=d-m,g=Yt-m;Ne(t,_a(sc(m+S%g))),d=gt(S/g),h+=Yt}Ne(t,_a(sc(d))),i=ry(a,s,f===l),a=0,f++}}a++,n++}return oc(t,"")},ay=function(e){var t=[],r=Qg(qg(ey(e),rc,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ne(t,Xg(Jg,a)?"xn--"+ny(a):a);return oc(t,".")},iy=ft,Ra=X,oy=Or,Ca=q,cc=ua,ue=B,Dr=Ue,le=ca,sy=ss,ja=pe,Aa=fg,yt=Kg,ge=ds,cy=Hs.codeAt,uy=ay,_e=xe,ly=Bt,fy=dt,uc=Rm,lc=zt,dy=lc.set,Mr=lc.getterFor("URL"),hy=uc.URLSearchParams,vy=uc.getState,Jt=Ca.URL,La=Ca.TypeError,Fr=Ca.parseInt,py=Math.floor,fc=Math.pow,fe=ue("".charAt),ye=ue(/./.exec),Xt=ue([].join),my=ue(1 .toString),gy=ue([].pop),wt=ue([].push),Ua=ue("".replace),yy=ue([].shift),wy=ue("".split),qt=ue("".slice),zr=ue("".toLowerCase),by=ue([].unshift),Sy="Invalid authority",xa="Invalid scheme",Ye="Invalid host",dc="Invalid port",hc=/[a-z]/i,Iy=/[\d+-.a-z]/i,Na=/\d/,$y=/^0x/i,ky=/^[0-7]+$/,Py=/^\d+$/,vc=/^[\da-f]+$/i,Ty=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ey=/[\0\t\n\r #/:<>?@[\\\]^|]/,Oy=/^[\u0000-\u0020]+/,_y=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ry=/[\t\n\r]/g,de,Cy=function(e){var t=wy(e,"."),r,n,a,i,o,c,l;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&fe(i,0)==="0"&&(o=ye($y,i)?16:8,i=qt(i,o===8?1:2)),i==="")c=0;else{if(!ye(o===10?Py:o===8?ky:vc,i))return e;c=Fr(i,o)}wt(n,c)}for(a=0;a<r;a++)if(c=n[a],a===r-1){if(c>=fc(256,5-r))return null}else if(c>255)return null;for(l=gy(n),a=0;a<n.length;a++)l+=n[a]*fc(256,3-a);return l},jy=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,c,l,f,u,s,d=function(){return fe(e,a)};if(d()===":"){if(fe(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&&ye(vc,d());)i=i*16+Fr(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(c=0;d();){if(l=null,c>0)if(d()==="."&&c<4)a++;else return;if(!ye(Na,d()))return;for(;ye(Na,d());){if(f=Fr(d(),10),l===null)l=f;else{if(l===0)return;l=l*10+f}if(l>255)return;a++}t[r]=t[r]*256+l,c++,(c===2||c===4)&&r++}if(c!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)s=t[r],t[r--]=t[n+u-1],t[n+--u]=s;else if(r!==8)return;return t},Ay=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&&(t=n,r=a),t},Qt=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)by(t,e%256),e=py(e/256);return Xt(t,".")}else if(typeof e=="object"){for(t="",n=Ay(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=my(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Hr={},pc=Aa({},Hr,{" ":1,'"':1,"<":1,">":1,"`":1}),mc=Aa({},pc,{"#":1,"?":1,"{":1,"}":1}),Da=Aa({},mc,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),De=function(e,t){var r=cy(e,0);return r>32&&r<127&&!ja(t,e)?e:encodeURIComponent(e)},Br={ftp:21,file:null,http:80,https:443,ws:80,wss:443},er=function(e,t){var r;return e.length===2&&ye(hc,fe(e,0))&&((r=fe(e,1))===":"||!t&&r==="|")},gc=function(e){var t;return e.length>1&&er(qt(e,0,2))&&(e.length===2||(t=fe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},Ly=function(e){return e==="."||zr(e)==="%2e"},Uy=function(e){return e=zr(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ma={},yc={},Fa={},wc={},bc={},za={},Sc={},Ic={},Kr={},Gr={},Ha={},Ba={},Ka={},Ga={},$c={},Wa={},bt={},Pe={},kc={},Je={},Re={},Va=function(e,t,r){var n=_e(e),a,i,o;if(t){if(i=this.parse(n),i)throw new La(i);this.searchParams=null}else{if(r!==void 0&&(a=new Va(r,!0)),i=this.parse(n,null,a),i)throw new La(i);o=vy(new hy),o.bindURL(this),this.searchParams=o}};Va.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ma,i=0,o="",c=!1,l=!1,f=!1,u,s,d,h;for(e=_e(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=Ua(e,Oy,""),e=Ua(e,_y,"$1")),e=Ua(e,Ry,""),u=yt(e);i<=u.length;){switch(s=u[i],a){case Ma:if(s&&ye(hc,s))o+=zr(s),a=yc;else{if(t)return xa;a=Fa;continue}break;case yc:if(s&&(ye(Iy,s)||s==="+"||s==="-"||s==="."))o+=zr(s);else if(s===":"){if(t&&(n.isSpecial()!==ja(Br,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Br[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ga:n.isSpecial()&&r&&r.scheme===n.scheme?a=wc:n.isSpecial()?a=Ic:u[i+1]==="/"?(a=bc,i++):(n.cannotBeABaseURL=!0,wt(n.path,""),a=kc)}else{if(t)return xa;o="",a=Fa,i=0;continue}break;case Fa:if(!r||r.cannotBeABaseURL&&s!=="#")return xa;if(r.cannotBeABaseURL&&s==="#"){n.scheme=r.scheme,n.path=ge(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Re;break}a=r.scheme==="file"?Ga:za;continue;case wc:if(s==="/"&&u[i+1]==="/")a=Kr,i++;else{a=za;continue}break;case bc:if(s==="/"){a=Gr;break}else{a=Pe;continue}case za:if(n.scheme=r.scheme,s===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query;else if(s==="/"||s==="\\"&&n.isSpecial())a=Sc;else if(s==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query="",a=Je;else if(s==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.path.length--,a=Pe;continue}break;case Sc:if(n.isSpecial()&&(s==="/"||s==="\\"))a=Kr;else if(s==="/")a=Gr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Pe;continue}break;case Ic:if(a=Kr,s!=="/"||fe(o,i+1)!=="/")continue;i++;break;case Kr:if(s!=="/"&&s!=="\\"){a=Gr;continue}break;case Gr:if(s==="@"){c&&(o="%40"+o),c=!0,d=yt(o);for(var m=0;m<d.length;m++){var S=d[m];if(S===":"&&!f){f=!0;continue}var g=De(S,Da);f?n.password+=g:n.username+=g}o=""}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(c&&o==="")return Sy;i-=yt(o).length+1,o="",a=Ha}else o+=s;break;case Ha:case Ba:if(t&&n.scheme==="file"){a=Wa;continue}else if(s===":"&&!l){if(o==="")return Ye;if(h=n.parseHost(o),h)return h;if(o="",a=Ka,t===Ba)return}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Ye;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=bt,t)return;continue}else s==="["?l=!0:s==="]"&&(l=!1),o+=s;break;case Ka:if(ye(Na,s))o+=s;else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()||t){if(o!==""){var $=Fr(o,10);if($>65535)return dc;n.port=n.isSpecial()&&$===Br[n.scheme]?null:$,o=""}if(t)return;a=bt;continue}else return dc;break;case Ga:if(n.scheme="file",s==="/"||s==="\\")a=$c;else if(r&&r.scheme==="file")switch(s){case de:n.host=r.host,n.path=ge(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ge(r.path),n.query="",a=Je;break;case"#":n.host=r.host,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;break;default:gc(Xt(ge(u,i),""))||(n.host=r.host,n.path=ge(r.path),n.shortenPath()),a=Pe;continue}else{a=Pe;continue}break;case $c:if(s==="/"||s==="\\"){a=Wa;break}r&&r.scheme==="file"&&!gc(Xt(ge(u,i),""))&&(er(r.path[0],!0)?wt(n.path,r.path[0]):n.host=r.host),a=Pe;continue;case Wa:if(s===de||s==="/"||s==="\\"||s==="?"||s==="#"){if(!t&&er(o))a=Pe;else if(o===""){if(n.host="",t)return;a=bt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=bt}continue}else o+=s;break;case bt:if(n.isSpecial()){if(a=Pe,s!=="/"&&s!=="\\")continue}else if(!t&&s==="?")n.query="",a=Je;else if(!t&&s==="#")n.fragment="",a=Re;else if(s!==de&&(a=Pe,s!=="/"))continue;break;case Pe:if(s===de||s==="/"||s==="\\"&&n.isSpecial()||!t&&(s==="?"||s==="#")){if(Uy(o)?(n.shortenPath(),s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,"")):Ly(o)?s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,""):(n.scheme==="file"&&!n.path.length&&er(o)&&(n.host&&(n.host=""),o=fe(o,0)+":"),wt(n.path,o)),o="",n.scheme==="file"&&(s===de||s==="?"||s==="#"))for(;n.path.length>1&&n.path[0]==="";)yy(n.path);s==="?"?(n.query="",a=Je):s==="#"&&(n.fragment="",a=Re)}else o+=De(s,mc);break;case kc:s==="?"?(n.query="",a=Je):s==="#"?(n.fragment="",a=Re):s!==de&&(n.path[0]+=De(s,Hr));break;case Je:!t&&s==="#"?(n.fragment="",a=Re):s!==de&&(s==="'"&&n.isSpecial()?n.query+="%27":s==="#"?n.query+="%23":n.query+=De(s,Hr));break;case Re:s!==de&&(n.fragment+=De(s,pc));break}i++}},parseHost:function(e){var t,r,n;if(fe(e,0)==="["){if(fe(e,e.length-1)!=="]"||(t=jy(qt(e,1,-1)),!t))return Ye;this.host=t}else if(this.isSpecial()){if(e=uy(e),ye(Ty,e)||(t=Cy(e),t===null))return Ye;this.host=t}else{if(ye(Ey,e))return Ye;for(t="",r=yt(e),n=0;n<r.length;n++)t+=De(r[n],Hr);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return ja(Br,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!er(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,c=e.query,l=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=Qt(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+Xt(o,"/"):"",c!==null&&(f+="?"+c),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new La(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new St(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+Qt(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(_e(e)+":",Ma)},getUsername:function(){return this.username},setUsername:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=De(t[r],Da)}},getPassword:function(){return this.password},setPassword:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=De(t[r],Da)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?Qt(e):Qt(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getHostname:function(){var e=this.host;return e===null?"":Qt(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ba)},getPort:function(){var e=this.port;return e===null?"":_e(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=_e(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Xt(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,bt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=_e(e),e===""?this.query=null:(fe(e,0)==="?"&&(e=qt(e,1)),this.query="",this.parse(e,Je)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=_e(e),e===""){this.fragment=null;return}fe(e,0)==="#"&&(e=qt(e,1)),this.fragment="",this.parse(e,Re)},update:function(){this.query=this.searchParams.serialize()||null}};var St=function(t){var r=sy(this,ee),n=fy(arguments.length,1)>1?arguments[1]:void 0,a=dy(r,new Va(t,!1,n));Ra||(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())},ee=St.prototype,he=function(e,t){return{get:function(){return Mr(this)[e]()},set:t&&function(r){return Mr(this)[t](r)},configurable:!0,enumerable:!0}};if(Ra&&(le(ee,"href",he("serialize","setHref")),le(ee,"origin",he("getOrigin")),le(ee,"protocol",he("getProtocol","setProtocol")),le(ee,"username",he("getUsername","setUsername")),le(ee,"password",he("getPassword","setPassword")),le(ee,"host",he("getHost","setHost")),le(ee,"hostname",he("getHostname","setHostname")),le(ee,"port",he("getPort","setPort")),le(ee,"pathname",he("getPathname","setPathname")),le(ee,"search",he("getSearch","setSearch")),le(ee,"searchParams",he("getSearchParams")),le(ee,"hash",he("getHash","setHash"))),Dr(ee,"toJSON",function(){return Mr(this).serialize()},{enumerable:!0}),Dr(ee,"toString",function(){return Mr(this).serialize()},{enumerable:!0}),Jt){var Pc=Jt.createObjectURL,Tc=Jt.revokeObjectURL;Pc&&Dr(St,"createObjectURL",cc(Pc,Jt)),Tc&&Dr(St,"revokeObjectURL",cc(Tc,Jt))}ly(St,"URL"),iy({global:!0,constructor:!0,forced:!oy,sham:!Ra},{URL:St});var xy=ft,Ny=ut,Ec=G,Dy=dt,Oc=xe,My=Or,Za=Ny("URL"),Fy=My&&Ec(function(){Za.canParse()}),zy=Ec(function(){return Za.canParse.length!==1});xy({target:"URL",stat:!0,forced:!Fy||zy},{canParse:function(t){var r=Dy(arguments.length,1),n=Oc(t),a=r<2||arguments[1]===void 0?void 0:Oc(arguments[1]);try{return!!new Za(n,a)}catch{return!1}}});var Hy=ft,By=ut,Ky=dt,_c=xe,Gy=Or,Wy=By("URL");Hy({target:"URL",stat:!0,forced:!Gy},{parse:function(t){var r=Ky(arguments.length,1),n=_c(t),a=r<2||arguments[1]===void 0?void 0:_c(arguments[1]);try{return new Wy(n,a)}catch{return null}}});var Vy=ft,Zy=Ie;Vy({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Zy(URL.prototype.toString,this)}});var Yy=Ms;Yy.URL;var Jy={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},Xy=$n,Ya=Xy("span").classList,Rc=Ya&&Ya.constructor&&Ya.constructor.prototype,qy=Rc===Object.prototype?void 0:Rc,Cc=q,jc=Jy,Qy=qy,tr=lp,Ac=br,ew=Bt,tw=se,Ja=tw("iterator"),Xa=tr.values,Lc=function(e,t){if(e){if(e[Ja]!==Xa)try{Ac(e,Ja,Xa)}catch{e[Ja]=Xa}if(ew(e,t,!0),jc[t]){for(var r in tr)if(e[r]!==tr[r])try{Ac(e,r,tr[r])}catch{e[r]=tr[r]}}}};for(var qa in jc)Lc(Cc[qa]&&Cc[qa].prototype,qa);Lc(Qy,"DOMTokenList");function Me(e,t){const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Te(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}typeof SuppressedError=="function"&&SuppressedError;var Xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ei(e,t){return e(t={exports:{}},t.exports),t.exports}var qe=ei(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 c=a.locked.get(i);c===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(c.unshift(o),a.locked.set(i,c))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,c){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 c=o.pop();a.locked.set(i,o),c!==void 0&&setTimeout(c,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()}});Qa(qe);var rw=Qa(ei(function(e,t){var r=Xe&&Xe.__awaiter||function(u,s,d,h){return new(d||(d=Promise))(function(m,S){function g(b){try{P(h.next(b))}catch(v){S(v)}}function $(b){try{P(h.throw(b))}catch(v){S(v)}}function P(b){b.done?m(b.value):new d(function(v){v(b.value)}).then(g,$)}P((h=h.apply(u,s||[])).next())})},n=Xe&&Xe.__generator||function(u,s){var d,h,m,S,g={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return S={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function $(P){return function(b){return function(v){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(m=2&v[0]?h.return:v[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,v[1])).done)return m;switch(h=0,m&&(v=[2&v[0],m.value]),v[0]){case 0:case 1:m=v;break;case 4:return g.label++,{value:v[1],done:!1};case 5:g.label++,h=v[1],v=[0];continue;case 7:v=g.ops.pop(),g.trys.pop();continue;default:if(m=g.trys,!((m=m.length>0&&m[m.length-1])||v[0]!==6&&v[0]!==2)){g=0;continue}if(v[0]===3&&(!m||v[1]>m[0]&&v[1]<m[3])){g.label=v[1];break}if(v[0]===6&&g.label<m[1]){g.label=m[1],m=v;break}if(m&&g.label<m[2]){g.label=m[2],g.ops.push(v);break}m[2]&&g.ops.pop(),g.trys.pop();continue}v=s.call(u,g)}catch(I){v=[6,I],h=0}finally{d=m=0}if(5&v[0])throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}([P,b])}}},a=Xe;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},getItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},setItem:function(u,s){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,s){return window.localStorage.setItem(u,s)}};function c(u){return new Promise(function(s){return setTimeout(s,u)})}function l(u){for(var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<u;h++)d+=s[Math.floor(Math.random()*s.length)];return d}var f=function(){function u(s){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=s,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(s,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,m,S,g,$,P,b;return n(this,function(v){switch(v.label){case 0:h=Date.now()+l(4),m=Date.now()+d,S=i+"-"+s,g=this.storageHandler===void 0?o:this.storageHandler,v.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return v.sent(),g.getItemSync(S)!==null?[3,5]:($=this.id+"-"+s+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return v.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:$,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return v.sent(),(P=g.getItemSync(S))!==null&&(b=JSON.parse(P)).id===this.id&&b.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:v.sent(),v.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.prototype.refreshLockWhileAcquired=function(s,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(m){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,$;return n(this,function(P){switch(P.label){case 0:return[4,qe.default().lock(d)];case 1:return P.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(s))===null?(qe.default().unlock(d),[2]):(($=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(s,JSON.stringify($)),qe.default().unlock(d),this.refreshLockWhileAcquired(s,d),[2])):(qe.default().unlock(d),[2])}})})},1e3),[2]})})},u.prototype.waitForSomethingToChange=function(s){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 m=!1,S=Date.now(),g=!1;function $(){if(g||(window.removeEventListener("storage",$),u.removeFromWaiting($),clearTimeout(P),g=!0),!m){m=!0;var b=50-(Date.now()-S);b>0?setTimeout(h,b):h(null)}}window.addEventListener("storage",$),u.addToWaiting($);var P=setTimeout($,Math.max(0,s-Date.now()))})];case 1:return d.sent(),[2]}})})},u.addToWaiting=function(s){this.removeFromWaiting(s),u.waiters!==void 0&&u.waiters.push(s)},u.removeFromWaiting=function(s){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(d){return d!==s}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(s){return s()})},u.prototype.releaseLock=function(s){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(s)];case 1:return[2,d.sent()]}})})},u.prototype.releaseLock__private__=function(s){return r(this,void 0,void 0,function(){var d,h,m,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+s,(m=d.getItemSync(h))===null?[2]:(S=JSON.parse(m)).id!==this.id?[3,2]:[4,qe.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),qe.default().unlock(S.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}})})},u.lockCorrector=function(s){for(var d=Date.now()-5e3,h=s,m=[],S=0;;){var g=h.keySync(S);if(g===null)break;m.push(g),S++}for(var $=!1,P=0;P<m.length;P++){var b=m[P];if(b.includes(i)){var v=h.getItemSync(b);if(v!==null){var I=JSON.parse(v);(I.timeRefreshed===void 0&&I.timeAcquired<d||I.timeRefreshed!==void 0&&I.timeRefreshed<d)&&(h.removeItemSync(b),$=!0)}}}$&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=f}));const nw={timeoutInSeconds:60},Uc={name:"auth0-spa-js",version:"2.1.3"},xc=()=>Date.now();let ae=class ji extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ji.prototype)}static fromPayload({error:t,error_description:r}){return new ji(t,r)}},aw=class Il extends ae{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Il.prototype)}},ti=class $l extends ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,$l.prototype)}},iw=class kl extends ti{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,kl.prototype)}},ow=class Pl extends ae{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Pl.prototype)}},sw=class Tl extends ae{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Tl.prototype)}},Nc=class El extends ae{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Dc(t,["default"])}', scope: '${Dc(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,El.prototype)}};function Dc(e,t=[]){return e&&!t.includes(e)?e:""}const Wr=()=>window.crypto,ri=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Wr().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Mc=e=>btoa(e),ni=e=>{var{clientId:t}=e,r=Te(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()},Fc=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),cw=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},uw=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([cw(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},lw=async(e,t,r,n,a,i,o)=>{return c={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},l=i,new Promise(function(f,u){const s=new MessageChannel;s.port1.onmessage=function(d){d.data.error?u(new Error(d.data.error)):f(d.data),s.port1.close()},l.postMessage(c,[s.port2])});var c,l},fw=async(e,t,r,n,a,i,o=1e4)=>a?lw(e,t,r,n,o,a,i):uw(e,n,o);async function dw(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:c}=e,l=Te(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=c?ni(l):JSON.stringify(l);return await async function(u,s,d,h,m,S,g){let $,P=null;for(let A=0;A<3;A++)try{$=await fw(u,d,h,m,S,g,s),P=null;break}catch(M){P=M}if(P)throw P;const b=$.json,{error:v,error_description:I}=b,O=Te(b,["error","error_description"]),{ok:_}=$;if(!_){const A=I||`HTTP error. Unable to fetch ${u}`;throw v==="mfa_required"?new sw(v,A,O.mfa_token):v==="missing_refresh_token"?new Nc(d,h):new ae(v||"request_error",A)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Uc))}},t,c)}const Vr=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let Qe=class Ai{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 Ai({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Ai({scope:r,audience:n,clientId:a})}},hw=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@@"))}},zc=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)}}()}},vw=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||xc}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 c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(t,c);l&&(a=await this.cache.get(l))}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 Qe({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 Qe({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=Qe.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),c=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],l=i.scope&&c.reduce((f,u)=>f&&o.has(u),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&l})[0]}},pw=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 rr=e=>typeof e=="number",mw=["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"],gw=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[c,l,f]=o;if(o.length!==3||!c||!l||!f)throw new Error("ID token could not be decoded");const u=JSON.parse(Fc(l)),s={__raw:i},d={};return Object.keys(u).forEach(h=>{s[h]=u[h],mw.includes(h)||(d[h]=u[h])}),{encoded:{header:c,payload:l,signature:f},header:JSON.parse(Fc(c)),claims:s,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&&!rr(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||!rr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!rr(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&&rr(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&&rr(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 et=ei(function(e,t){var r=Xe&&Xe.__assign||function(){return r=Object.assign||function(l){for(var f,u=1,s=arguments.length;u<s;u++)for(var d in f=arguments[u])Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l},r.apply(this,arguments)};function n(l,f){if(!f)return"";var u="; "+l;return f===!0?u:u+"="+f}function a(l,f,u){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(s){if(typeof s.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*s.expires),s.expires=d}return n("Expires",s.expires?s.expires.toUTCString():"")+n("Domain",s.domain)+n("Path",s.path)+n("Secure",s.secure)+n("SameSite",s.sameSite)}(u)}function i(l){for(var f={},u=l?l.split("; "):[],s=/(%[\dA-F]{2})+/gi,d=0;d<u.length;d++){var h=u[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{f[h[0].replace(s,decodeURIComponent)]=m.replace(s,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function c(l,f,u){document.cookie=a(l,f,r({path:"/"},u))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(l){return o()[l]},t.set=c,t.remove=function(l,f){c(l,"",r(r({},f),{expires:-1}))}});Qa(et),et.encode,et.parse,et.getAll;var yw=et.get,Hc=et.set,Bc=et.remove;const It={get(e){const t=yw(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),Hc(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r)}},ww={get(e){return It.get(e)||It.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),Hc(`_legacy_${e}`,JSON.stringify(t),n),It.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r),It.remove(e,t),It.remove(`_legacy_${e}`,t)}},bw={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 Sw(e,t,r){var n=t===void 0?null:t,a=function(l,f){var u=atob(l);if(f){for(var s=new Uint8Array(u.length),d=0,h=u.length;d<h;++d)s[d]=u.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(s.buffer))}return u}(e,r!==void 0&&r),i=a.indexOf(`
1
+ var sesamyJs=function(Ee){"use strict";var SS=Object.defineProperty;var IS=(Ee,oe,G)=>oe in Ee?SS(Ee,oe,{enumerable:!0,configurable:!0,writable:!0,value:G}):Ee[oe]=G;var ve=(Ee,oe,G)=>IS(Ee,typeof oe!="symbol"?oe+"":oe,G);var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G=function(e){try{return!!e()}catch{return!0}},Ol=G,dn=!Ol(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Li=dn,Ui=Function.prototype,hn=Ui.call,_l=Li&&Ui.bind.bind(hn,hn),B=Li?_l:function(e){return function(){return hn.apply(e,arguments)}},xi=B,Rl=xi({}.toString),Cl=xi("".slice),vn=function(e){return Cl(Rl(e),8,-1)},jl=B,Al=G,Ll=vn,pn=Object,Ul=jl("".split),Ni=Al(function(){return!pn("z").propertyIsEnumerable(0)})?function(e){return Ll(e)==="String"?Ul(e,""):pn(e)}:pn,mn=function(e){return e==null},xl=mn,Nl=TypeError,dr=function(e){if(xl(e))throw new Nl("Can't call method on "+e);return e},Dl=Ni,Ml=dr,xt=function(e){return Dl(Ml(e))},Nt=function(e){return e&&e.Math===Math&&e},q=Nt(typeof globalThis=="object"&&globalThis)||Nt(typeof window=="object"&&window)||Nt(typeof self=="object"&&self)||Nt(typeof oe=="object"&&oe)||Nt(typeof oe=="object"&&oe)||function(){return this}()||Function("return this")(),Di={exports:{}},Fl=!1,Mi=q,zl=Object.defineProperty,gn=function(e,t){try{zl(Mi,e,{value:t,configurable:!0,writable:!0})}catch{Mi[e]=t}return t},Hl=q,Bl=gn,Fi="__core-js_shared__",zi=Di.exports=Hl[Fi]||Bl(Fi,{});(zi.versions||(zi.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var yn=Di.exports,Hi=yn,Bi=function(e,t){return Hi[e]||(Hi[e]=t||{})},Kl=dr,Gl=Object,hr=function(e){return Gl(Kl(e))},Wl=B,Vl=hr,Zl=Wl({}.hasOwnProperty),pe=Object.hasOwn||function(t,r){return Zl(Vl(t),r)},Yl=B,Jl=0,Xl=Math.random(),ql=Yl(1 .toString),Ki=function(e){return"Symbol("+(e===void 0?"":e)+")_"+ql(++Jl+Xl,36)},Ql=typeof navigator<"u"&&String(navigator.userAgent)||"",Gi=q,wn=Ql,Wi=Gi.process,Vi=Gi.Deno,Zi=Wi&&Wi.versions||Vi&&Vi.version,Yi=Zi&&Zi.v8,me,vr;Yi&&(me=Yi.split("."),vr=me[0]>0&&me[0]<4?1:+(me[0]+me[1])),!vr&&wn&&(me=wn.match(/Edge\/(\d+)/),(!me||me[1]>=74)&&(me=wn.match(/Chrome\/(\d+)/),me&&(vr=+me[1])));var ef=vr,Ji=ef,tf=G,rf=q,nf=rf.String,Xi=!!Object.getOwnPropertySymbols&&!tf(function(){var e=Symbol("symbol detection");return!nf(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ji&&Ji<41}),af=Xi,qi=af&&!Symbol.sham&&typeof Symbol.iterator=="symbol",of=q,sf=Bi,Qi=pe,cf=Ki,uf=Xi,lf=qi,ct=of.Symbol,bn=sf("wks"),ff=lf?ct.for||ct:ct&&ct.withoutSetter||cf,se=function(e){return Qi(bn,e)||(bn[e]=uf&&Qi(ct,e)?ct[e]:ff("Symbol."+e)),bn[e]},Sn=typeof document=="object"&&document.all,J=typeof Sn>"u"&&Sn!==void 0?function(e){return typeof e=="function"||e===Sn}:function(e){return typeof e=="function"},df=J,Oe=function(e){return typeof e=="object"?e!==null:df(e)},hf=Oe,vf=String,pf=TypeError,Ue=function(e){if(hf(e))return e;throw new pf(vf(e)+" is not an object")},eo={},mf=G,X=!mf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),gf=X,yf=G,to=gf&&yf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Se={},wf=q,ro=Oe,In=wf.document,bf=ro(In)&&ro(In.createElement),$n=function(e){return bf?In.createElement(e):{}},Sf=X,If=G,$f=$n,no=!Sf&&!If(function(){return Object.defineProperty($f("div"),"a",{get:function(){return 7}}).a!==7}),kf=dn,pr=Function.prototype.call,Ie=kf?pr.bind(pr):function(){return pr.apply(pr,arguments)},kn=q,Pf=J,Tf=function(e){return Pf(e)?e:void 0},ut=function(e,t){return arguments.length<2?Tf(kn[e]):kn[e]&&kn[e][t]},Ef=B,ao=Ef({}.isPrototypeOf),Of=ut,_f=J,Rf=ao,Cf=qi,jf=Object,io=Cf?function(e){return typeof e=="symbol"}:function(e){var t=Of("Symbol");return _f(t)&&Rf(t.prototype,jf(e))},Af=String,oo=function(e){try{return Af(e)}catch{return"Object"}},Lf=J,Uf=oo,xf=TypeError,mr=function(e){if(Lf(e))return e;throw new xf(Uf(e)+" is not a function")},Nf=mr,Df=mn,Pn=function(e,t){var r=e[t];return Df(r)?void 0:Nf(r)},Tn=Ie,En=J,On=Oe,Mf=TypeError,Ff=function(e,t){var r,n;if(t==="string"&&En(r=e.toString)&&!On(n=Tn(r,e))||En(r=e.valueOf)&&!On(n=Tn(r,e))||t!=="string"&&En(r=e.toString)&&!On(n=Tn(r,e)))return n;throw new Mf("Can't convert object to primitive value")},zf=Ie,so=Oe,co=io,Hf=Pn,Bf=Ff,Kf=se,Gf=TypeError,Wf=Kf("toPrimitive"),Vf=function(e,t){if(!so(e)||co(e))return e;var r=Hf(e,Wf),n;if(r){if(t===void 0&&(t="default"),n=zf(r,e,t),!so(n)||co(n))return n;throw new Gf("Can't convert object to primitive value")}return t===void 0&&(t="number"),Bf(e,t)},Zf=Vf,Yf=io,uo=function(e){var t=Zf(e,"string");return Yf(t)?t:t+""},Jf=X,Xf=no,qf=to,gr=Ue,lo=uo,Qf=TypeError,_n=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,Rn="enumerable",Cn="configurable",jn="writable";Se.f=Jf?qf?function(t,r,n){if(gr(t),r=lo(r),gr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&jn in n&&!n[jn]){var a=ed(t,r);a&&a[jn]&&(t[r]=n.value,n={configurable:Cn in n?n[Cn]:a[Cn],enumerable:Rn in n?n[Rn]:a[Rn],writable:!1})}return _n(t,r,n)}:_n:function(t,r,n){if(gr(t),r=lo(r),gr(n),Xf)try{return _n(t,r,n)}catch{}if("get"in n||"set"in n)throw new Qf("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var td=Math.ceil,rd=Math.floor,nd=Math.trunc||function(t){var r=+t;return(r>0?rd:td)(r)},ad=nd,An=function(e){var t=+e;return t!==t||t===0?0:ad(t)},id=An,od=Math.max,sd=Math.min,cd=function(e,t){var r=id(e);return r<0?od(r+t,0):sd(r,t)},ud=An,ld=Math.min,fd=function(e){var t=ud(e);return t>0?ld(t,9007199254740991):0},dd=fd,fo=function(e){return dd(e.length)},hd=xt,vd=cd,pd=fo,ho=function(e){return function(t,r,n){var a=hd(t),i=pd(a);if(i===0)return!e&&-1;var o=vd(n,i),c;if(e&&r!==r){for(;i>o;)if(c=a[o++],c!==c)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},md={includes:ho(!0),indexOf:ho(!1)},Ln={},gd=B,Un=pe,yd=xt,wd=md.indexOf,bd=Ln,vo=gd([].push),po=function(e,t){var r=yd(e),n=0,a=[],i;for(i in r)!Un(bd,i)&&Un(r,i)&&vo(a,i);for(;t.length>n;)Un(r,i=t[n++])&&(~wd(a,i)||vo(a,i));return a},xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Sd=po,Id=xn,mo=Object.keys||function(t){return Sd(t,Id)},$d=X,kd=to,Pd=Se,Td=Ue,Ed=xt,Od=mo;eo.f=$d&&!kd?Object.defineProperties:function(t,r){Td(t);for(var n=Ed(r),a=Od(r),i=a.length,o=0,c;i>o;)Pd.f(t,c=a[o++],n[c]);return t};var _d=ut,Rd=_d("document","documentElement"),Cd=Bi,jd=Ki,go=Cd("keys"),Nn=function(e){return go[e]||(go[e]=jd(e))},Ad=Ue,Ld=eo,yo=xn,Ud=Ln,xd=Rd,Nd=$n,Dd=Nn,wo=">",bo="<",Dn="prototype",Mn="script",So=Dd("IE_PROTO"),Fn=function(){},Io=function(e){return bo+Mn+wo+e+bo+"/"+Mn+wo},$o=function(e){e.write(Io("")),e.close();var t=e.parentWindow.Object;return e=null,t},Md=function(){var e=Nd("iframe"),t="java"+Mn+":",r;return e.style.display="none",xd.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Io("document.F=Object")),r.close(),r.F},yr,wr=function(){try{yr=new ActiveXObject("htmlfile")}catch{}wr=typeof document<"u"?document.domain&&yr?$o(yr):Md():$o(yr);for(var e=yo.length;e--;)delete wr[Dn][yo[e]];return wr()};Ud[So]=!0;var zn=Object.create||function(t,r){var n;return t!==null?(Fn[Dn]=Ad(t),n=new Fn,Fn[Dn]=null,n[So]=t):n=wr(),r===void 0?n:Ld.f(n,r)},Fd=se,zd=zn,Hd=Se.f,Hn=Fd("unscopables"),Bn=Array.prototype;Bn[Hn]===void 0&&Hd(Bn,Hn,{configurable:!0,value:zd(null)});var Bd=function(e){Bn[Hn][e]=!0},Dt={},Kd=q,Gd=J,ko=Kd.WeakMap,Wd=Gd(ko)&&/native code/.test(String(ko)),Mt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Vd=X,Zd=Se,Yd=Mt,br=Vd?function(e,t,r){return Zd.f(e,t,Yd(1,r))}:function(e,t,r){return e[t]=r,e},Jd=Wd,Po=q,Xd=Oe,qd=br,Kn=pe,Gn=yn,Qd=Nn,eh=Ln,To="Object already initialized",Wn=Po.TypeError,th=Po.WeakMap,Sr,Ft,Ir,rh=function(e){return Ir(e)?Ft(e):Sr(e,{})},nh=function(e){return function(t){var r;if(!Xd(t)||(r=Ft(t)).type!==e)throw new Wn("Incompatible receiver, "+e+" required");return r}};if(Jd||Gn.state){var $e=Gn.state||(Gn.state=new th);$e.get=$e.get,$e.has=$e.has,$e.set=$e.set,Sr=function(e,t){if($e.has(e))throw new Wn(To);return t.facade=e,$e.set(e,t),t},Ft=function(e){return $e.get(e)||{}},Ir=function(e){return $e.has(e)}}else{var lt=Qd("state");eh[lt]=!0,Sr=function(e,t){if(Kn(e,lt))throw new Wn(To);return t.facade=e,qd(e,lt,t),t},Ft=function(e){return Kn(e,lt)?e[lt]:{}},Ir=function(e){return Kn(e,lt)}}var zt={set:Sr,get:Ft,has:Ir,enforce:rh,getterFor:nh},Vn={},Zn={},Eo={}.propertyIsEnumerable,Oo=Object.getOwnPropertyDescriptor,ah=Oo&&!Eo.call({1:2},1);Zn.f=ah?function(t){var r=Oo(this,t);return!!r&&r.enumerable}:Eo;var ih=X,oh=Ie,sh=Zn,ch=Mt,uh=xt,lh=uo,fh=pe,dh=no,_o=Object.getOwnPropertyDescriptor;Vn.f=ih?_o:function(t,r){if(t=uh(t),r=lh(r),dh)try{return _o(t,r)}catch{}if(fh(t,r))return ch(!oh(sh.f,t,r),t[r])};var Ro={exports:{}},Yn=X,hh=pe,Co=Function.prototype,vh=Yn&&Object.getOwnPropertyDescriptor,Jn=hh(Co,"name"),ph=Jn&&(function(){}).name==="something",mh=Jn&&(!Yn||Yn&&vh(Co,"name").configurable),jo={EXISTS:Jn,PROPER:ph,CONFIGURABLE:mh},gh=B,yh=J,Xn=yn,wh=gh(Function.toString);yh(Xn.inspectSource)||(Xn.inspectSource=function(e){return wh(e)});var Ao=Xn.inspectSource,qn=B,bh=G,Sh=J,$r=pe,Qn=X,Ih=jo.CONFIGURABLE,$h=Ao,Lo=zt,kh=Lo.enforce,Ph=Lo.get,Uo=String,kr=Object.defineProperty,Th=qn("".slice),Eh=qn("".replace),Oh=qn([].join),_h=Qn&&!bh(function(){return kr(function(){},"length",{value:8}).length!==8}),Rh=String(String).split("String"),Ch=Ro.exports=function(e,t,r){Th(Uo(t),0,7)==="Symbol("&&(t="["+Eh(Uo(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!$r(e,"name")||Ih&&e.name!==t)&&(Qn?kr(e,"name",{value:t,configurable:!0}):e.name=t),_h&&r&&$r(r,"arity")&&e.length!==r.arity&&kr(e,"length",{value:r.arity});try{r&&$r(r,"constructor")&&r.constructor?Qn&&kr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=kh(e);return $r(n,"source")||(n.source=Oh(Rh,typeof t=="string"?t:"")),e};Function.prototype.toString=Ch(function(){return Sh(this)&&Ph(this).source||$h(this)},"toString");var xo=Ro.exports,jh=J,Ah=Se,Lh=xo,Uh=gn,xe=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(jh(r)&&Lh(r,i,n),n.global)a?e[t]=r:Uh(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Ah.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},No={},xh=po,Nh=xn,Dh=Nh.concat("length","prototype");No.f=Object.getOwnPropertyNames||function(t){return xh(t,Dh)};var ea={};ea.f=Object.getOwnPropertySymbols;var Mh=ut,Fh=B,zh=No,Hh=ea,Bh=Ue,Kh=Fh([].concat),Gh=Mh("Reflect","ownKeys")||function(t){var r=zh.f(Bh(t)),n=Hh.f;return n?Kh(r,n(t)):r},Do=pe,Wh=Gh,Vh=Vn,Zh=Se,Yh=function(e,t,r){for(var n=Wh(t),a=Zh.f,i=Vh.f,o=0;o<n.length;o++){var c=n[o];!Do(e,c)&&!(r&&Do(r,c))&&a(e,c,i(t,c))}},Jh=G,Xh=J,qh=/#|\.prototype\./,Ht=function(e,t){var r=ev[Qh(e)];return r===rv?!0:r===tv?!1:Xh(t)?Jh(t):!!t},Qh=Ht.normalize=function(e){return String(e).replace(qh,".").toLowerCase()},ev=Ht.data={},tv=Ht.NATIVE="N",rv=Ht.POLYFILL="P",nv=Ht,Pr=q,av=Vn.f,iv=br,ov=xe,sv=gn,cv=Yh,uv=nv,ft=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,c,l,f,u;if(n?o=Pr:a?o=Pr[r]||sv(r,{}):o=Pr[r]&&Pr[r].prototype,o)for(c in t){if(f=t[c],e.dontCallGetSet?(u=av(o,c),l=u&&u.value):l=o[c],i=uv(n?c:r+(a?".":"#")+c,e.forced),!i&&l!==void 0){if(typeof f==typeof l)continue;cv(f,l)}(e.sham||l&&l.sham)&&iv(f,"sham",!0),ov(o,c,f,e)}},lv=G,fv=!lv(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),dv=pe,hv=J,vv=hr,pv=Nn,mv=fv,Mo=pv("IE_PROTO"),ta=Object,gv=ta.prototype,Fo=mv?ta.getPrototypeOf:function(e){var t=vv(e);if(dv(t,Mo))return t[Mo];var r=t.constructor;return hv(r)&&t instanceof r?r.prototype:t instanceof ta?gv:null},yv=G,wv=J,bv=Oe,zo=Fo,Sv=xe,Iv=se,ra=Iv("iterator"),Ho=!1,Ve,na,aa;[].keys&&(aa=[].keys(),"next"in aa?(na=zo(zo(aa)),na!==Object.prototype&&(Ve=na)):Ho=!0);var $v=!bv(Ve)||yv(function(){var e={};return Ve[ra].call(e)!==e});$v&&(Ve={}),wv(Ve[ra])||Sv(Ve,ra,function(){return this});var Bo={IteratorPrototype:Ve,BUGGY_SAFARI_ITERATORS:Ho},kv=Se.f,Pv=pe,Tv=se,Ko=Tv("toStringTag"),Bt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Pv(e,Ko)&&kv(e,Ko,{configurable:!0,value:t})},Ev=Bo.IteratorPrototype,Ov=zn,_v=Mt,Rv=Bt,Cv=Dt,jv=function(){return this},Go=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Ov(Ev,{next:_v(+!n,r)}),Rv(e,a,!1),Cv[a]=jv,e},Av=B,Lv=mr,Uv=function(e,t,r){try{return Av(Lv(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},xv=Oe,Nv=function(e){return xv(e)||e===null},Dv=Nv,Mv=String,Fv=TypeError,zv=function(e){if(Dv(e))return e;throw new Fv("Can't set "+Mv(e)+" as a prototype")},Hv=Uv,Bv=Oe,Kv=dr,Gv=zv,Wv=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Hv(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Kv(a),Gv(i),Bv(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Vv=ft,Zv=Ie,Wo=jo,Yv=J,Jv=Go,Vo=Fo,Zo=Wv,Xv=Bt,qv=br,ia=xe,Qv=se,ep=Dt,Yo=Bo,tp=Wo.PROPER,rp=Wo.CONFIGURABLE,Jo=Yo.IteratorPrototype,Tr=Yo.BUGGY_SAFARI_ITERATORS,Kt=Qv("iterator"),Xo="keys",Gt="values",qo="entries",np=function(){return this},Qo=function(e,t,r,n,a,i,o){Jv(r,t,n);var c=function($){if($===a&&d)return d;if(!Tr&&$&&$ in u)return u[$];switch($){case Xo:return function(){return new r(this,$)};case Gt:return function(){return new r(this,$)};case qo:return function(){return new r(this,$)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,s=u[Kt]||u["@@iterator"]||a&&u[a],d=!Tr&&s||c(a),h=t==="Array"&&u.entries||s,m,S,g;if(h&&(m=Vo(h.call(new e)),m!==Object.prototype&&m.next&&(Vo(m)!==Jo&&(Zo?Zo(m,Jo):Yv(m[Kt])||ia(m,Kt,np)),Xv(m,l,!0))),tp&&a===Gt&&s&&s.name!==Gt&&(rp?qv(u,"name",Gt):(f=!0,d=function(){return Zv(s,this)})),a)if(S={values:c(Gt),keys:i?d:c(Xo),entries:c(qo)},o)for(g in S)(Tr||f||!(g in u))&&ia(u,g,S[g]);else Vv({target:t,proto:!0,forced:Tr||f},S);return u[Kt]!==d&&ia(u,Kt,d,{name:a}),ep[t]=d,S},oa=function(e,t){return{value:e,done:t}},ap=xt,sa=Bd,es=Dt,ts=zt,ip=Se.f,op=Qo,Er=oa,sp=X,rs="Array Iterator",cp=ts.set,up=ts.getterFor(rs),lp=op(Array,"Array",function(e,t){cp(this,{type:rs,target:ap(e),index:0,kind:t})},function(){var e=up(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Er(void 0,!0);switch(e.kind){case"keys":return Er(r,!1);case"values":return Er(t[r],!1)}return Er([r,t[r]],!1)},"values"),ns=es.Arguments=es.Array;if(sa("keys"),sa("values"),sa("entries"),sp&&ns.name!=="values")try{ip(ns,"name",{value:"values"})}catch{}var as=q,fp=X,dp=Object.getOwnPropertyDescriptor,hp=function(e){if(!fp)return as[e];var t=dp(as,e);return t&&t.value},vp=G,pp=se,mp=X,is=Fl,gp=pp("iterator"),Or=!vp(function(){var e=new URL("b?a=1&b=2&c=3","http://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),is&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(is||!mp)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[gp]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("http://x",void 0).host!=="x"}),os=xo,yp=Se,ca=function(e,t,r){return r.get&&os(r.get,t,{getter:!0}),r.set&&os(r.set,t,{setter:!0}),yp.f(e,t,r)},wp=xe,bp=function(e,t,r){for(var n in t)wp(e,n,t[n],r);return e},Sp=ao,Ip=TypeError,ss=function(e,t){if(Sp(t,e))return e;throw new Ip("Incorrect invocation")},$p=vn,kp=B,Pp=function(e){if($p(e)==="Function")return kp(e)},cs=Pp,Tp=mr,Ep=dn,Op=cs(cs.bind),ua=function(e,t){return Tp(e),t===void 0?e:Ep?Op(e,t):function(){return e.apply(t,arguments)}},_p=se,Rp=_p("toStringTag"),us={};us[Rp]="z";var Cp=String(us)==="[object z]",jp=Cp,Ap=J,_r=vn,Lp=se,Up=Lp("toStringTag"),xp=Object,Np=_r(function(){return arguments}())==="Arguments",Dp=function(e,t){try{return e[t]}catch{}},Rr=jp?_r:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Dp(t=xp(e),Up))=="string"?r:Np?_r(t):(n=_r(t))==="Object"&&Ap(t.callee)?"Arguments":n},Mp=Rr,Fp=String,Ne=function(e){if(Mp(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Fp(e)},zp=Rr,ls=Pn,Hp=mn,Bp=Dt,Kp=se,Gp=Kp("iterator"),la=function(e){if(!Hp(e))return ls(e,Gp)||ls(e,"@@iterator")||Bp[zp(e)]},Wp=Ie,Vp=mr,Zp=Ue,Yp=oo,Jp=la,Xp=TypeError,fs=function(e,t){var r=arguments.length<2?Jp(e):t;if(Vp(r))return Zp(Wp(r,e));throw new Xp(Yp(e)+" is not iterable")},qp=TypeError,dt=function(e,t){if(e<t)throw new qp("Not enough arguments");return e},Qp=B,ds=Qp([].slice),hs=ds,em=Math.floor,fa=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=em(r/2),c=fa(hs(e,0,o),t),l=fa(hs(e,o),t),f=c.length,u=l.length,s=0,d=0;s<f||d<u;)e[s+d]=s<f&&d<u?t(c[s],l[d])<=0?c[s++]:l[d++]:s<f?c[s++]:l[d++];return e},tm=fa,da=ft,Cr=q,ha=hp,jr=Ie,ke=B,Wt=X,vs=Or,ps=xe,rm=ca,nm=bp,am=Bt,im=Go,va=zt,ms=ss,pa=J,om=pe,sm=ua,cm=Rr,um=Ue,gs=Oe,Q=Ne,lm=zn,ys=Mt,ws=fs,fm=la,Ar=oa,ht=dt,dm=se,hm=tm,vm=dm("iterator"),vt="URLSearchParams",bs=vt+"Iterator",Ss=va.set,ce=va.getterFor(vt),pm=va.getterFor(bs),Is=ha("fetch"),Lr=ha("Request"),Vt=ha("Headers"),ma=Lr&&Lr.prototype,$s=Vt&&Vt.prototype,mm=Cr.RegExp,gm=Cr.TypeError,ks=Cr.decodeURIComponent,ym=Cr.encodeURIComponent,wm=ke("".charAt),Ps=ke([].join),Ze=ke([].push),ga=ke("".replace),bm=ke([].shift),Ts=ke([].splice),Es=ke("".split),Sm=ke("".slice),Im=/\+/g,Os=Array(4),$m=function(e){return Os[e-1]||(Os[e-1]=mm("((?:%[\\da-f]{2}){"+e+"})","gi"))},km=function(e){try{return ks(e)}catch{return e}},_s=function(e){var t=ga(e,Im," "),r=4;try{return ks(t)}catch{for(;r;)t=ga(t,$m(r--),km);return t}},Pm=/[!'()~]|%20/g,Tm={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Em=function(e){return Tm[e]},Rs=function(e){return ga(ym(e),Pm,Em)},ya=im(function(t,r){Ss(this,{type:bs,target:ce(t).entries,index:0,kind:r})},vt,function(){var t=pm(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Ar(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Ar(a.key,!1);case"values":return Ar(a.value,!1)}return Ar([a.key,a.value],!1)},!0),Cs=function(e){this.entries=[],this.url=null,e!==void 0&&(gs(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?wm(e,0)==="?"?Sm(e,1):e:Q(e)))};Cs.prototype={type:vt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=fm(e),n,a,i,o,c,l,f;if(r)for(n=ws(e,r),a=n.next;!(i=jr(a,n)).done;){if(o=ws(um(i.value)),c=o.next,(l=jr(c,o)).done||(f=jr(c,o)).done||!jr(c,o).done)throw new gm("Expected sequence with length 2");Ze(t,{key:Q(l.value),value:Q(f.value)})}else for(var u in e)om(e,u)&&Ze(t,{key:u,value:Q(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Es(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Es(a,"="),Ze(t,{key:_s(bm(i)),value:_s(Ps(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ze(t,Rs(n.key)+"="+Rs(n.value));return Ps(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ur=function(){ms(this,pt);var t=arguments.length>0?arguments[0]:void 0,r=Ss(this,new Cs(t));Wt||(this.size=r.entries.length)},pt=Ur.prototype;if(nm(pt,{append:function(t,r){var n=ce(this);ht(arguments.length,2),Ze(n.entries,{key:Q(t),value:Q(r)}),Wt||this.length++,n.updateURL()},delete:function(e){for(var t=ce(this),r=ht(arguments.length,1),n=t.entries,a=Q(e),i=r<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<n.length;){var l=n[c];if(l.key===a&&(o===void 0||l.value===o)){if(Ts(n,c,1),o!==void 0)break}else c++}Wt||(this.size=n.length),t.updateURL()},get:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ze(a,r[i].value);return a},has:function(t){for(var r=ce(this).entries,n=ht(arguments.length,1),a=Q(t),i=n<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<r.length;){var l=r[c++];if(l.key===a&&(o===void 0||l.value===o))return!0}return!1},set:function(t,r){var n=ce(this);ht(arguments.length,1);for(var a=n.entries,i=!1,o=Q(t),c=Q(r),l=0,f;l<a.length;l++)f=a[l],f.key===o&&(i?Ts(a,l--,1):(i=!0,f.value=c));i||Ze(a,{key:o,value:c}),Wt||(this.size=a.length),n.updateURL()},sort:function(){var t=ce(this);hm(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=ce(this).entries,n=sm(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 ya(this,"keys")},values:function(){return new ya(this,"values")},entries:function(){return new ya(this,"entries")}},{enumerable:!0}),ps(pt,vm,pt.entries,{name:"entries"}),ps(pt,"toString",function(){return ce(this).serialize()},{enumerable:!0}),Wt&&rm(pt,"size",{get:function(){return ce(this).entries.length},configurable:!0,enumerable:!0}),am(Ur,vt),da({global:!0,constructor:!0,forced:!vs},{URLSearchParams:Ur}),!vs&&pa(Vt)){var Om=ke($s.has),_m=ke($s.set),js=function(e){if(gs(e)){var t=e.body,r;if(cm(t)===vt)return r=e.headers?new Vt(e.headers):new Vt,Om(r,"content-type")||_m(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),lm(e,{body:ys(0,Q(t)),headers:ys(0,r)})}return e};if(pa(Is)&&da({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Is(t,arguments.length>1?js(arguments[1]):{})}}),pa(Lr)){var wa=function(t){return ms(this,ma),new Lr(t,arguments.length>1?js(arguments[1]):{})};ma.constructor=wa,wa.prototype=ma,da({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:wa})}}var Rm={URLSearchParams:Ur,getState:ce},Cm=xe,xr=B,As=Ne,jm=dt,Ls=URLSearchParams,Nr=Ls.prototype,Am=xr(Nr.append),Us=xr(Nr.delete),Lm=xr(Nr.forEach),Um=xr([].push),ba=new Ls("a=1&a=2&b=3");ba.delete("a",1),ba.delete("b",void 0),ba+""!="a=2"&&Cm(Nr,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Us(this,e);var n=[];Lm(this,function(s,d){Um(n,{key:d,value:s})}),jm(t,1);for(var a=As(e),i=As(r),o=0,c=0,l=!1,f=n.length,u;o<f;)u=n[o++],l||u.key===a?(l=!0,Us(this,u.key)):c++;for(;c<f;)u=n[c++],u.key===a&&u.value===i||Am(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var xm=xe,xs=B,Nm=Ne,Dm=dt,Ns=URLSearchParams,Sa=Ns.prototype,Mm=xs(Sa.getAll),Fm=xs(Sa.has),Ds=new Ns("a=1");(Ds.has("a",2)||!Ds.has("a",void 0))&&xm(Sa,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Fm(this,t);var a=Mm(this,t);Dm(r,1);for(var i=Nm(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var zm=X,Hm=B,Bm=ca,Ia=URLSearchParams.prototype,Km=Hm(Ia.forEach);zm&&!("size"in Ia)&&Bm(Ia,"size",{get:function(){var t=0;return Km(this,function(){t++}),t},configurable:!0,enumerable:!0});var Gm=q,Ms=Gm,Wm=Ms;Wm.URLSearchParams;var $a=B,Vm=An,Zm=Ne,Ym=dr,Jm=$a("".charAt),Fs=$a("".charCodeAt),Xm=$a("".slice),zs=function(e){return function(t,r){var n=Zm(Ym(t)),a=Vm(r),i=n.length,o,c;return a<0||a>=i?e?"":void 0:(o=Fs(n,a),o<55296||o>56319||a+1===i||(c=Fs(n,a+1))<56320||c>57343?e?Jm(n,a):o:e?Xm(n,a,a+2):(o-55296<<10)+(c-56320)+65536)}},Hs={codeAt:zs(!1),charAt:zs(!0)},qm=Hs.charAt,Qm=Ne,Bs=zt,eg=Qo,Ks=oa,Gs="String Iterator",tg=Bs.set,rg=Bs.getterFor(Gs);eg(String,"String",function(e){tg(this,{type:Gs,string:Qm(e),index:0})},function(){var t=rg(this),r=t.string,n=t.index,a;return n>=r.length?Ks(void 0,!0):(a=qm(r,n),t.index+=a.length,Ks(a,!1))});var Ws=X,ng=B,ag=Ie,ig=G,ka=mo,og=ea,sg=Zn,cg=hr,ug=Ni,mt=Object.assign,Vs=Object.defineProperty,lg=ng([].concat),fg=!mt||ig(function(){if(Ws&&mt({b:1},mt(Vs({},"a",{enumerable:!0,get:function(){Vs(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}),mt({},e)[r]!==7||ka(mt({},t)).join("")!==n})?function(t,r){for(var n=cg(t),a=arguments.length,i=1,o=og.f,c=sg.f;a>i;)for(var l=ug(arguments[i++]),f=o?lg(ka(l),o(l)):ka(l),u=f.length,s=0,d;u>s;)d=f[s++],(!Ws||ag(c,l,d))&&(n[d]=l[d]);return n}:mt,dg=Ie,Zs=Ue,hg=Pn,vg=function(e,t,r){var n,a;Zs(e);try{if(n=hg(e,"return"),!n){if(t==="throw")throw r;return r}n=dg(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Zs(n),r},pg=Ue,mg=vg,gg=function(e,t,r,n){try{return n?t(pg(r)[0],r[1]):t(r)}catch(a){mg(e,"throw",a)}},yg=se,wg=Dt,bg=yg("iterator"),Sg=Array.prototype,Ig=function(e){return e!==void 0&&(wg.Array===e||Sg[bg]===e)},$g=B,kg=G,Ys=J,Pg=Rr,Tg=ut,Eg=Ao,Js=function(){},Xs=Tg("Reflect","construct"),Pa=/^\s*(?:class|function)\b/,Og=$g(Pa.exec),_g=!Pa.test(Js),Zt=function(t){if(!Ys(t))return!1;try{return Xs(Js,[],t),!0}catch{return!1}},qs=function(t){if(!Ys(t))return!1;switch(Pg(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _g||!!Og(Pa,Eg(t))}catch{return!0}};qs.sham=!0;var Rg=!Xs||kg(function(){var e;return Zt(Zt.call)||!Zt(Object)||!Zt(function(){e=!0})||e})?qs:Zt,Cg=X,jg=Se,Ag=Mt,Lg=function(e,t,r){Cg?jg.f(e,t,Ag(0,r)):e[t]=r},Ug=ua,xg=Ie,Ng=hr,Dg=gg,Mg=Ig,Fg=Rg,zg=fo,Qs=Lg,Hg=fs,Bg=la,ec=Array,Kg=function(t){var r=Ng(t),n=Fg(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Ug(i,a>2?arguments[2]:void 0));var c=Bg(r),l=0,f,u,s,d,h,m;if(c&&!(this===ec&&Mg(c)))for(u=n?new this:[],d=Hg(r,c),h=d.next;!(s=xg(h,d)).done;l++)m=o?Dg(d,i,[s.value,l],!0):s.value,Qs(u,l,m);else for(f=zg(r),u=n?new this(f):ec(f);f>l;l++)m=o?i(r[l],l):r[l],Qs(u,l,m);return u.length=l,u},Ye=B,Ta=2147483647,Yt=36,tc=1,Ea=26,Gg=38,Wg=700,Vg=72,Zg=128,Yg="-",Jg=/[^\0-\u007E]/,rc=/[.\u3002\uFF0E\uFF61]/g,nc="Overflow: input needs wider integers to process",Oa=Yt-tc,ac=RangeError,Xg=Ye(rc.exec),gt=Math.floor,_a=String.fromCharCode,ic=Ye("".charCodeAt),oc=Ye([].join),De=Ye([].push),qg=Ye("".replace),Qg=Ye("".split),ey=Ye("".toLowerCase),ty=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=ic(e,r++);if(a>=55296&&a<=56319&&r<n){var i=ic(e,r++);(i&64512)===56320?De(t,((a&1023)<<10)+(i&1023)+65536):(De(t,a),r--)}else De(t,a)}return t},sc=function(e){return e+22+75*(e<26)},ry=function(e,t,r){var n=0;for(e=r?gt(e/Wg):e>>1,e+=gt(e/t);e>Oa*Ea>>1;)e=gt(e/Oa),n+=Yt;return gt(n+(Oa+1)*e/(e+Gg))},ny=function(e){var t=[];e=ty(e);var r=e.length,n=Zg,a=0,i=Vg,o,c;for(o=0;o<e.length;o++)c=e[o],c<128&&De(t,_a(c));var l=t.length,f=l;for(l&&De(t,Yg);f<r;){var u=Ta;for(o=0;o<e.length;o++)c=e[o],c>=n&&c<u&&(u=c);var s=f+1;if(u-n>gt((Ta-a)/s))throw new ac(nc);for(a+=(u-n)*s,n=u,o=0;o<e.length;o++){if(c=e[o],c<n&&++a>Ta)throw new ac(nc);if(c===n){for(var d=a,h=Yt;;){var m=h<=i?tc:h>=i+Ea?Ea:h-i;if(d<m)break;var S=d-m,g=Yt-m;De(t,_a(sc(m+S%g))),d=gt(S/g),h+=Yt}De(t,_a(sc(d))),i=ry(a,s,f===l),a=0,f++}}a++,n++}return oc(t,"")},ay=function(e){var t=[],r=Qg(qg(ey(e),rc,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],De(t,Xg(Jg,a)?"xn--"+ny(a):a);return oc(t,".")},iy=ft,Ra=X,oy=Or,Ca=q,cc=ua,ue=B,Dr=xe,le=ca,sy=ss,ja=pe,Aa=fg,yt=Kg,ge=ds,cy=Hs.codeAt,uy=ay,_e=Ne,ly=Bt,fy=dt,uc=Rm,lc=zt,dy=lc.set,Mr=lc.getterFor("URL"),hy=uc.URLSearchParams,vy=uc.getState,Jt=Ca.URL,La=Ca.TypeError,Fr=Ca.parseInt,py=Math.floor,fc=Math.pow,fe=ue("".charAt),ye=ue(/./.exec),Xt=ue([].join),my=ue(1 .toString),gy=ue([].pop),wt=ue([].push),Ua=ue("".replace),yy=ue([].shift),wy=ue("".split),qt=ue("".slice),zr=ue("".toLowerCase),by=ue([].unshift),Sy="Invalid authority",xa="Invalid scheme",Je="Invalid host",dc="Invalid port",hc=/[a-z]/i,Iy=/[\d+-.a-z]/i,Na=/\d/,$y=/^0x/i,ky=/^[0-7]+$/,Py=/^\d+$/,vc=/^[\da-f]+$/i,Ty=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ey=/[\0\t\n\r #/:<>?@[\\\]^|]/,Oy=/^[\u0000-\u0020]+/,_y=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ry=/[\t\n\r]/g,de,Cy=function(e){var t=wy(e,"."),r,n,a,i,o,c,l;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&fe(i,0)==="0"&&(o=ye($y,i)?16:8,i=qt(i,o===8?1:2)),i==="")c=0;else{if(!ye(o===10?Py:o===8?ky:vc,i))return e;c=Fr(i,o)}wt(n,c)}for(a=0;a<r;a++)if(c=n[a],a===r-1){if(c>=fc(256,5-r))return null}else if(c>255)return null;for(l=gy(n),a=0;a<n.length;a++)l+=n[a]*fc(256,3-a);return l},jy=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,c,l,f,u,s,d=function(){return fe(e,a)};if(d()===":"){if(fe(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&&ye(vc,d());)i=i*16+Fr(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(c=0;d();){if(l=null,c>0)if(d()==="."&&c<4)a++;else return;if(!ye(Na,d()))return;for(;ye(Na,d());){if(f=Fr(d(),10),l===null)l=f;else{if(l===0)return;l=l*10+f}if(l>255)return;a++}t[r]=t[r]*256+l,c++,(c===2||c===4)&&r++}if(c!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)s=t[r],t[r--]=t[n+u-1],t[n+--u]=s;else if(r!==8)return;return t},Ay=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&&(t=n,r=a),t},Qt=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)by(t,e%256),e=py(e/256);return Xt(t,".")}else if(typeof e=="object"){for(t="",n=Ay(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=my(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Hr={},pc=Aa({},Hr,{" ":1,'"':1,"<":1,">":1,"`":1}),mc=Aa({},pc,{"#":1,"?":1,"{":1,"}":1}),Da=Aa({},mc,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Me=function(e,t){var r=cy(e,0);return r>32&&r<127&&!ja(t,e)?e:encodeURIComponent(e)},Br={ftp:21,file:null,http:80,https:443,ws:80,wss:443},er=function(e,t){var r;return e.length===2&&ye(hc,fe(e,0))&&((r=fe(e,1))===":"||!t&&r==="|")},gc=function(e){var t;return e.length>1&&er(qt(e,0,2))&&(e.length===2||(t=fe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},Ly=function(e){return e==="."||zr(e)==="%2e"},Uy=function(e){return e=zr(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ma={},yc={},Fa={},wc={},bc={},za={},Sc={},Ic={},Kr={},Gr={},Ha={},Ba={},Ka={},Ga={},$c={},Wa={},bt={},Pe={},kc={},Xe={},Re={},Va=function(e,t,r){var n=_e(e),a,i,o;if(t){if(i=this.parse(n),i)throw new La(i);this.searchParams=null}else{if(r!==void 0&&(a=new Va(r,!0)),i=this.parse(n,null,a),i)throw new La(i);o=vy(new hy),o.bindURL(this),this.searchParams=o}};Va.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ma,i=0,o="",c=!1,l=!1,f=!1,u,s,d,h;for(e=_e(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=Ua(e,Oy,""),e=Ua(e,_y,"$1")),e=Ua(e,Ry,""),u=yt(e);i<=u.length;){switch(s=u[i],a){case Ma:if(s&&ye(hc,s))o+=zr(s),a=yc;else{if(t)return xa;a=Fa;continue}break;case yc:if(s&&(ye(Iy,s)||s==="+"||s==="-"||s==="."))o+=zr(s);else if(s===":"){if(t&&(n.isSpecial()!==ja(Br,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Br[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ga:n.isSpecial()&&r&&r.scheme===n.scheme?a=wc:n.isSpecial()?a=Ic:u[i+1]==="/"?(a=bc,i++):(n.cannotBeABaseURL=!0,wt(n.path,""),a=kc)}else{if(t)return xa;o="",a=Fa,i=0;continue}break;case Fa:if(!r||r.cannotBeABaseURL&&s!=="#")return xa;if(r.cannotBeABaseURL&&s==="#"){n.scheme=r.scheme,n.path=ge(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Re;break}a=r.scheme==="file"?Ga:za;continue;case wc:if(s==="/"&&u[i+1]==="/")a=Kr,i++;else{a=za;continue}break;case bc:if(s==="/"){a=Gr;break}else{a=Pe;continue}case za:if(n.scheme=r.scheme,s===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query;else if(s==="/"||s==="\\"&&n.isSpecial())a=Sc;else if(s==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query="",a=Xe;else if(s==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.path.length--,a=Pe;continue}break;case Sc:if(n.isSpecial()&&(s==="/"||s==="\\"))a=Kr;else if(s==="/")a=Gr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Pe;continue}break;case Ic:if(a=Kr,s!=="/"||fe(o,i+1)!=="/")continue;i++;break;case Kr:if(s!=="/"&&s!=="\\"){a=Gr;continue}break;case Gr:if(s==="@"){c&&(o="%40"+o),c=!0,d=yt(o);for(var m=0;m<d.length;m++){var S=d[m];if(S===":"&&!f){f=!0;continue}var g=Me(S,Da);f?n.password+=g:n.username+=g}o=""}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(c&&o==="")return Sy;i-=yt(o).length+1,o="",a=Ha}else o+=s;break;case Ha:case Ba:if(t&&n.scheme==="file"){a=Wa;continue}else if(s===":"&&!l){if(o==="")return Je;if(h=n.parseHost(o),h)return h;if(o="",a=Ka,t===Ba)return}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Je;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=bt,t)return;continue}else s==="["?l=!0:s==="]"&&(l=!1),o+=s;break;case Ka:if(ye(Na,s))o+=s;else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()||t){if(o!==""){var $=Fr(o,10);if($>65535)return dc;n.port=n.isSpecial()&&$===Br[n.scheme]?null:$,o=""}if(t)return;a=bt;continue}else return dc;break;case Ga:if(n.scheme="file",s==="/"||s==="\\")a=$c;else if(r&&r.scheme==="file")switch(s){case de:n.host=r.host,n.path=ge(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ge(r.path),n.query="",a=Xe;break;case"#":n.host=r.host,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;break;default:gc(Xt(ge(u,i),""))||(n.host=r.host,n.path=ge(r.path),n.shortenPath()),a=Pe;continue}else{a=Pe;continue}break;case $c:if(s==="/"||s==="\\"){a=Wa;break}r&&r.scheme==="file"&&!gc(Xt(ge(u,i),""))&&(er(r.path[0],!0)?wt(n.path,r.path[0]):n.host=r.host),a=Pe;continue;case Wa:if(s===de||s==="/"||s==="\\"||s==="?"||s==="#"){if(!t&&er(o))a=Pe;else if(o===""){if(n.host="",t)return;a=bt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=bt}continue}else o+=s;break;case bt:if(n.isSpecial()){if(a=Pe,s!=="/"&&s!=="\\")continue}else if(!t&&s==="?")n.query="",a=Xe;else if(!t&&s==="#")n.fragment="",a=Re;else if(s!==de&&(a=Pe,s!=="/"))continue;break;case Pe:if(s===de||s==="/"||s==="\\"&&n.isSpecial()||!t&&(s==="?"||s==="#")){if(Uy(o)?(n.shortenPath(),s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,"")):Ly(o)?s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,""):(n.scheme==="file"&&!n.path.length&&er(o)&&(n.host&&(n.host=""),o=fe(o,0)+":"),wt(n.path,o)),o="",n.scheme==="file"&&(s===de||s==="?"||s==="#"))for(;n.path.length>1&&n.path[0]==="";)yy(n.path);s==="?"?(n.query="",a=Xe):s==="#"&&(n.fragment="",a=Re)}else o+=Me(s,mc);break;case kc:s==="?"?(n.query="",a=Xe):s==="#"?(n.fragment="",a=Re):s!==de&&(n.path[0]+=Me(s,Hr));break;case Xe:!t&&s==="#"?(n.fragment="",a=Re):s!==de&&(s==="'"&&n.isSpecial()?n.query+="%27":s==="#"?n.query+="%23":n.query+=Me(s,Hr));break;case Re:s!==de&&(n.fragment+=Me(s,pc));break}i++}},parseHost:function(e){var t,r,n;if(fe(e,0)==="["){if(fe(e,e.length-1)!=="]"||(t=jy(qt(e,1,-1)),!t))return Je;this.host=t}else if(this.isSpecial()){if(e=uy(e),ye(Ty,e)||(t=Cy(e),t===null))return Je;this.host=t}else{if(ye(Ey,e))return Je;for(t="",r=yt(e),n=0;n<r.length;n++)t+=Me(r[n],Hr);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return ja(Br,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!er(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,c=e.query,l=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=Qt(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+Xt(o,"/"):"",c!==null&&(f+="?"+c),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new La(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new St(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+Qt(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(_e(e)+":",Ma)},getUsername:function(){return this.username},setUsername:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Me(t[r],Da)}},getPassword:function(){return this.password},setPassword:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Me(t[r],Da)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?Qt(e):Qt(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getHostname:function(){var e=this.host;return e===null?"":Qt(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ba)},getPort:function(){var e=this.port;return e===null?"":_e(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=_e(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Xt(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,bt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=_e(e),e===""?this.query=null:(fe(e,0)==="?"&&(e=qt(e,1)),this.query="",this.parse(e,Xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=_e(e),e===""){this.fragment=null;return}fe(e,0)==="#"&&(e=qt(e,1)),this.fragment="",this.parse(e,Re)},update:function(){this.query=this.searchParams.serialize()||null}};var St=function(t){var r=sy(this,ee),n=fy(arguments.length,1)>1?arguments[1]:void 0,a=dy(r,new Va(t,!1,n));Ra||(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())},ee=St.prototype,he=function(e,t){return{get:function(){return Mr(this)[e]()},set:t&&function(r){return Mr(this)[t](r)},configurable:!0,enumerable:!0}};if(Ra&&(le(ee,"href",he("serialize","setHref")),le(ee,"origin",he("getOrigin")),le(ee,"protocol",he("getProtocol","setProtocol")),le(ee,"username",he("getUsername","setUsername")),le(ee,"password",he("getPassword","setPassword")),le(ee,"host",he("getHost","setHost")),le(ee,"hostname",he("getHostname","setHostname")),le(ee,"port",he("getPort","setPort")),le(ee,"pathname",he("getPathname","setPathname")),le(ee,"search",he("getSearch","setSearch")),le(ee,"searchParams",he("getSearchParams")),le(ee,"hash",he("getHash","setHash"))),Dr(ee,"toJSON",function(){return Mr(this).serialize()},{enumerable:!0}),Dr(ee,"toString",function(){return Mr(this).serialize()},{enumerable:!0}),Jt){var Pc=Jt.createObjectURL,Tc=Jt.revokeObjectURL;Pc&&Dr(St,"createObjectURL",cc(Pc,Jt)),Tc&&Dr(St,"revokeObjectURL",cc(Tc,Jt))}ly(St,"URL"),iy({global:!0,constructor:!0,forced:!oy,sham:!Ra},{URL:St});var xy=ft,Ny=ut,Ec=G,Dy=dt,Oc=Ne,My=Or,Za=Ny("URL"),Fy=My&&Ec(function(){Za.canParse()}),zy=Ec(function(){return Za.canParse.length!==1});xy({target:"URL",stat:!0,forced:!Fy||zy},{canParse:function(t){var r=Dy(arguments.length,1),n=Oc(t),a=r<2||arguments[1]===void 0?void 0:Oc(arguments[1]);try{return!!new Za(n,a)}catch{return!1}}});var Hy=ft,By=ut,Ky=dt,_c=Ne,Gy=Or,Wy=By("URL");Hy({target:"URL",stat:!0,forced:!Gy},{parse:function(t){var r=Ky(arguments.length,1),n=_c(t),a=r<2||arguments[1]===void 0?void 0:_c(arguments[1]);try{return new Wy(n,a)}catch{return null}}});var Vy=ft,Zy=Ie;Vy({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Zy(URL.prototype.toString,this)}});var Yy=Ms;Yy.URL;var Jy={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},Xy=$n,Ya=Xy("span").classList,Rc=Ya&&Ya.constructor&&Ya.constructor.prototype,qy=Rc===Object.prototype?void 0:Rc,Cc=q,jc=Jy,Qy=qy,tr=lp,Ac=br,ew=Bt,tw=se,Ja=tw("iterator"),Xa=tr.values,Lc=function(e,t){if(e){if(e[Ja]!==Xa)try{Ac(e,Ja,Xa)}catch{e[Ja]=Xa}if(ew(e,t,!0),jc[t]){for(var r in tr)if(e[r]!==tr[r])try{Ac(e,r,tr[r])}catch{e[r]=tr[r]}}}};for(var qa in jc)Lc(Cc[qa]&&Cc[qa].prototype,qa);Lc(Qy,"DOMTokenList");function Fe(e,t){const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Te(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}typeof SuppressedError=="function"&&SuppressedError;var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ei(e,t){return e(t={exports:{}},t.exports),t.exports}var Qe=ei(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 c=a.locked.get(i);c===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(c.unshift(o),a.locked.set(i,c))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,c){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 c=o.pop();a.locked.set(i,o),c!==void 0&&setTimeout(c,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()}});Qa(Qe);var rw=Qa(ei(function(e,t){var r=qe&&qe.__awaiter||function(u,s,d,h){return new(d||(d=Promise))(function(m,S){function g(b){try{P(h.next(b))}catch(v){S(v)}}function $(b){try{P(h.throw(b))}catch(v){S(v)}}function P(b){b.done?m(b.value):new d(function(v){v(b.value)}).then(g,$)}P((h=h.apply(u,s||[])).next())})},n=qe&&qe.__generator||function(u,s){var d,h,m,S,g={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return S={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function $(P){return function(b){return function(v){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(m=2&v[0]?h.return:v[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,v[1])).done)return m;switch(h=0,m&&(v=[2&v[0],m.value]),v[0]){case 0:case 1:m=v;break;case 4:return g.label++,{value:v[1],done:!1};case 5:g.label++,h=v[1],v=[0];continue;case 7:v=g.ops.pop(),g.trys.pop();continue;default:if(m=g.trys,!((m=m.length>0&&m[m.length-1])||v[0]!==6&&v[0]!==2)){g=0;continue}if(v[0]===3&&(!m||v[1]>m[0]&&v[1]<m[3])){g.label=v[1];break}if(v[0]===6&&g.label<m[1]){g.label=m[1],m=v;break}if(m&&g.label<m[2]){g.label=m[2],g.ops.push(v);break}m[2]&&g.ops.pop(),g.trys.pop();continue}v=s.call(u,g)}catch(I){v=[6,I],h=0}finally{d=m=0}if(5&v[0])throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}([P,b])}}},a=qe;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},getItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},setItem:function(u,s){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,s){return window.localStorage.setItem(u,s)}};function c(u){return new Promise(function(s){return setTimeout(s,u)})}function l(u){for(var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<u;h++)d+=s[Math.floor(Math.random()*s.length)];return d}var f=function(){function u(s){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=s,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(s,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,m,S,g,$,P,b;return n(this,function(v){switch(v.label){case 0:h=Date.now()+l(4),m=Date.now()+d,S=i+"-"+s,g=this.storageHandler===void 0?o:this.storageHandler,v.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return v.sent(),g.getItemSync(S)!==null?[3,5]:($=this.id+"-"+s+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return v.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:$,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return v.sent(),(P=g.getItemSync(S))!==null&&(b=JSON.parse(P)).id===this.id&&b.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:v.sent(),v.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.prototype.refreshLockWhileAcquired=function(s,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(m){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,$;return n(this,function(P){switch(P.label){case 0:return[4,Qe.default().lock(d)];case 1:return P.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(s))===null?(Qe.default().unlock(d),[2]):(($=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(s,JSON.stringify($)),Qe.default().unlock(d),this.refreshLockWhileAcquired(s,d),[2])):(Qe.default().unlock(d),[2])}})})},1e3),[2]})})},u.prototype.waitForSomethingToChange=function(s){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 m=!1,S=Date.now(),g=!1;function $(){if(g||(window.removeEventListener("storage",$),u.removeFromWaiting($),clearTimeout(P),g=!0),!m){m=!0;var b=50-(Date.now()-S);b>0?setTimeout(h,b):h(null)}}window.addEventListener("storage",$),u.addToWaiting($);var P=setTimeout($,Math.max(0,s-Date.now()))})];case 1:return d.sent(),[2]}})})},u.addToWaiting=function(s){this.removeFromWaiting(s),u.waiters!==void 0&&u.waiters.push(s)},u.removeFromWaiting=function(s){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(d){return d!==s}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(s){return s()})},u.prototype.releaseLock=function(s){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(s)];case 1:return[2,d.sent()]}})})},u.prototype.releaseLock__private__=function(s){return r(this,void 0,void 0,function(){var d,h,m,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+s,(m=d.getItemSync(h))===null?[2]:(S=JSON.parse(m)).id!==this.id?[3,2]:[4,Qe.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),Qe.default().unlock(S.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}})})},u.lockCorrector=function(s){for(var d=Date.now()-5e3,h=s,m=[],S=0;;){var g=h.keySync(S);if(g===null)break;m.push(g),S++}for(var $=!1,P=0;P<m.length;P++){var b=m[P];if(b.includes(i)){var v=h.getItemSync(b);if(v!==null){var I=JSON.parse(v);(I.timeRefreshed===void 0&&I.timeAcquired<d||I.timeRefreshed!==void 0&&I.timeRefreshed<d)&&(h.removeItemSync(b),$=!0)}}}$&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=f}));const nw={timeoutInSeconds:60},Uc={name:"auth0-spa-js",version:"2.1.3"},xc=()=>Date.now();let ae=class ji extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ji.prototype)}static fromPayload({error:t,error_description:r}){return new ji(t,r)}},aw=class Il extends ae{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Il.prototype)}},ti=class $l extends ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,$l.prototype)}},iw=class kl extends ti{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,kl.prototype)}},ow=class Pl extends ae{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Pl.prototype)}},sw=class Tl extends ae{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Tl.prototype)}},Nc=class El extends ae{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Dc(t,["default"])}', scope: '${Dc(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,El.prototype)}};function Dc(e,t=[]){return e&&!t.includes(e)?e:""}const Wr=()=>window.crypto,ri=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Wr().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Mc=e=>btoa(e),ni=e=>{var{clientId:t}=e,r=Te(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()},Fc=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),cw=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},uw=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([cw(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},lw=async(e,t,r,n,a,i,o)=>{return c={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},l=i,new Promise(function(f,u){const s=new MessageChannel;s.port1.onmessage=function(d){d.data.error?u(new Error(d.data.error)):f(d.data),s.port1.close()},l.postMessage(c,[s.port2])});var c,l},fw=async(e,t,r,n,a,i,o=1e4)=>a?lw(e,t,r,n,o,a,i):uw(e,n,o);async function dw(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:c}=e,l=Te(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=c?ni(l):JSON.stringify(l);return await async function(u,s,d,h,m,S,g){let $,P=null;for(let A=0;A<3;A++)try{$=await fw(u,d,h,m,S,g,s),P=null;break}catch(M){P=M}if(P)throw P;const b=$.json,{error:v,error_description:I}=b,O=Te(b,["error","error_description"]),{ok:_}=$;if(!_){const A=I||`HTTP error. Unable to fetch ${u}`;throw v==="mfa_required"?new sw(v,A,O.mfa_token):v==="missing_refresh_token"?new Nc(d,h):new ae(v||"request_error",A)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Uc))}},t,c)}const Vr=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let et=class Ai{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 Ai({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Ai({scope:r,audience:n,clientId:a})}},hw=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@@"))}},zc=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)}}()}},vw=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||xc}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 c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(t,c);l&&(a=await this.cache.get(l))}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 et({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 et({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=et.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),c=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],l=i.scope&&c.reduce((f,u)=>f&&o.has(u),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&l})[0]}},pw=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 rr=e=>typeof e=="number",mw=["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"],gw=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[c,l,f]=o;if(o.length!==3||!c||!l||!f)throw new Error("ID token could not be decoded");const u=JSON.parse(Fc(l)),s={__raw:i},d={};return Object.keys(u).forEach(h=>{s[h]=u[h],mw.includes(h)||(d[h]=u[h])}),{encoded:{header:c,payload:l,signature:f},header:JSON.parse(Fc(c)),claims:s,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&&!rr(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||!rr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!rr(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&&rr(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&&rr(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 tt=ei(function(e,t){var r=qe&&qe.__assign||function(){return r=Object.assign||function(l){for(var f,u=1,s=arguments.length;u<s;u++)for(var d in f=arguments[u])Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l},r.apply(this,arguments)};function n(l,f){if(!f)return"";var u="; "+l;return f===!0?u:u+"="+f}function a(l,f,u){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(s){if(typeof s.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*s.expires),s.expires=d}return n("Expires",s.expires?s.expires.toUTCString():"")+n("Domain",s.domain)+n("Path",s.path)+n("Secure",s.secure)+n("SameSite",s.sameSite)}(u)}function i(l){for(var f={},u=l?l.split("; "):[],s=/(%[\dA-F]{2})+/gi,d=0;d<u.length;d++){var h=u[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{f[h[0].replace(s,decodeURIComponent)]=m.replace(s,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function c(l,f,u){document.cookie=a(l,f,r({path:"/"},u))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(l){return o()[l]},t.set=c,t.remove=function(l,f){c(l,"",r(r({},f),{expires:-1}))}});Qa(tt),tt.encode,tt.parse,tt.getAll;var yw=tt.get,Hc=tt.set,Bc=tt.remove;const It={get(e){const t=yw(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),Hc(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r)}},ww={get(e){return It.get(e)||It.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),Hc(`_legacy_${e}`,JSON.stringify(t),n),It.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r),It.remove(e,t),It.remove(`_legacy_${e}`,t)}},bw={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 Sw(e,t,r){var n=t===void 0?null:t,a=function(l,f){var u=atob(l);if(f){for(var s=new Uint8Array(u.length),d=0,h=u.length;d<h;++d)s[d]=u.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(s.buffer))}return u}(e,r!==void 0&&r),i=a.indexOf(`
2
2
  `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),c=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(c)}var Kc,Gc,Wc,ai,Iw=(Kc="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Gc=null,Wc=!1,function(e){return ai=ai||Sw(Kc,Gc,Wc),new Worker(ai,e)});const ii={};let $w=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 kw={memory:()=>new zc().enclosedCache,localstorage:()=>new hw},Vc=e=>kw[e],Zc=e=>{const{openUrl:t,onRedirect:r}=e,n=Te(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},oi=new rw;let Pw=class{constructor(t){let r,n;if(this.userCache=new zc().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await oi.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(!Wr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Wr().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",!Vc(r))throw new Error(`Invalid cache location "${r}"`);n=Vc(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?It:ww,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:bw;var i;this.scope=Vr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new pw(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||xc,this.cacheManager=new vw(n,n.allKeys?void 0:new $w(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,c)=>o?o.startsWith("https://")?o:`https://${o}/`:`${c}/`)(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 Iw)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Uc)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ni(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return gw({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=Mc(ri()),i=Mc(ri()),o=ri(),c=(u=>{const s=new Uint8Array(u);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(s))))})(await(async u=>await Wr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(o)),l=((u,s,d,h,m,S,g,$)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),d),{scope:Vr(s,d.scope),response_type:"code",response_mode:$||"query",state:h,nonce:m,redirect_uri:g||u.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(l);return{nonce:i,code_verifier:o,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(c=>new Promise((l,f)=>{let u;const s=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(s),clearTimeout(d),window.removeEventListener("message",u,!1),f(new ow(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(s),f(new iw(c.popup)),window.removeEventListener("message",u,!1)},1e3*(c.timeoutInSeconds||60));u=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(s),window.removeEventListener("message",u,!1),c.popup.close(),h.data.response.error)return f(ae.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ae("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=Zc(t),{openUrl:a,fragment:i,appState:o}=n,c=Te(n,["openUrl","fragment","appState"]),l=((r=c.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:u}=f,s=Te(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},s),{appState:o}),l&&{organization:l}));const d=i?`${u}#${i}`:u;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(s=>{s.indexOf("#")>-1&&(s=s.substring(0,s.indexOf("#")));const d=new URLSearchParams(s);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("")),c=this.transactionManager.get();if(!c)throw new ae("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new aw(i,o||i,n,c.appState);if(!c.code_verifier||c.state&&c.state!==n)throw new ae("state_mismatch","Invalid state");const l=c.organization,f=c.nonce,u=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:a},u?{redirect_uri:u}:{}),{nonceIn:f,organization:l}),{appState:c.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:Vr(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let c=ii[o];return c||(c=i().finally(()=>{delete ii[o],c=null}),ii[o]=c),c})(()=>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=Te(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})(()=>oi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ti;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:c,expires_in:l}=a;return Object.assign(Object.assign({id_token:i,access_token:o},c?{scope:c}:null),{expires_in:l})}finally{await oi.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:Vr(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},nw),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new Qe({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=Te(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ni(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Zc(t),{openUrl:n}=r,a=Te(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:c,redirect_uri:l,scope:f,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ae("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const s=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,S,g=60)=>new Promise(($,P)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const v=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",I,!1))};let I;const O=setTimeout(()=>{P(new ti),v()},1e3*g);I=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const A=_.source;A&&A.close(),_.data.response.error?P(ae.fromPayload(_.data.response)):$(_.data.response),clearTimeout(O),window.removeEventListener("message",I,!1),setTimeout(v,2e3)},window.addEventListener("message",I,!1),window.document.body.appendChild(b),b.setAttribute("src",m)}))(a,this.domainUrl,s);if(i!==d.state)throw new ae("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:u})}catch(s){throw s.error==="login_required"&&this.logout({openUrl:!1}),s}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new Qe({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 Nc(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=Te(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 Qe({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 Qe({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:c}=a,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},o?{scope:o}:null),{expires_in:c})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await dw(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 Tw(e){const t=new Pw(e);return await t.checkSession(),t}var we=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(we||{});const Ew="sesamy.com",Ow="sesamy.dev",_w="https://sesa.my",si="sesamyCacheTimestamp";function Fe(e,t){return`https://${e}.${t==="dev"?Ow:Ew}`}let ie,Yc;const $t="sesamyAccessToken",ci="sesamyRefreshToken";async function Rw(e){if(!e)return null;const t=localStorage.getItem(ci);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(ci),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(ci,i.refresh_token),localStorage.setItem($t,i.access_token),i.access_token}catch{Xc()}}async function ui(){const e=localStorage.getItem($t);if(!e)return null;const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await Rw(t);if(r)return r;localStorage.removeItem($t)}return e}function Jc(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 Cw(e){if(e.enabled===!1)return;Yc=e.organization;const t={domain:Fe("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Jc(window.location.href)!==Jc(Fe("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ie=await Tw(t),window.location.search.includes("code="))try{await ie.handleRedirectCallback();const r=await ie.getUser();Me(we.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}}async function li(){return await ui()?!0:ie?ie.isAuthenticated():!1}async function jw(){return await ui()?{sub:"local",name:"Local User"}:ie?ie.getUser():null}function fi(e){if(localStorage.removeItem($t),!ie)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ie.loginWithRedirect({...e,authorizationParams:{organization:Yc,redirect_uri:window.location.href,...t}})}async function nr(e=!0){const t=ui();if(t)return t;try{return ie?await ie.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Xc(e={}){if(localStorage.removeItem($t),Me(we.LOGOUT,{}),!!ie)return ie.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function qc(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 Qc(e){const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem($t,e),Me(we.AUTHENTICATED,t)}const Aw=(e,t)=>t.skipDedupe||t.method!=="GET",Lw=(e,t)=>t.method+"@"+e,Uw=e=>e.clone(),eu=({skip:e=Aw,key:t=Lw,resolver:r=Uw}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const c=t(i,o);if(!n.has(c))n.set(c,[]);else return new Promise((l,f)=>{n.get(c).push([l,f])});try{return a(i,o).then(l=>(n.get(c).forEach(([f])=>f(r(l))),n.delete(c),l)).catch(l=>{throw n.get(c).forEach(([f,u])=>u(l)),n.delete(c),l})}catch(l){return n.delete(c),Promise.reject(l)}}},xw=(e,t)=>e*t,Nw=e=>e&&e.ok,tu=({delayTimer:e=500,delayRamp:t=xw,maxAttempts:r=10,until:n=Nw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:c}={})=>l=>(f,u)=>{let s=0;if(c&&c(f,u))return l(f,u);const d=(h,m)=>Promise.resolve(n(h,m)).then(S=>S?h&&o?h:m?Promise.reject(m):h:(s++,!r||s<=r?new Promise(g=>{const $=t(e,s);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:m,url:f,options:u})).then((P={})=>{var b,v;g(l((b=P&&P.url)!==null&&b!==void 0?b:f,(v=P&&P.options)!==null&&v!==void 0?v:u))}):g(l(f,u))},$)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(m||new Error("Number of attempts exceeded."))));return l(f,u).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},Dw="application/json",ru="Content-Type",kt=Symbol(),nu=Symbol();function au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===ru.toLowerCase()))===null||t===void 0?void 0:t[1]}function iu(e){return/^application\/.*json.*/.test(e)}const tt=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]=tt(o,i,r):n[a]=i,n},{...e})},Pt={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 Mw(e,t=!1){Pt.options=t?e:tt(Pt.options,e)}function Fw(e,t=!1){Pt.polyfills=t?e:tt(Pt.polyfills,e)}function zw(e){Pt.errorType=e}const Hw=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class ou extends Error{}const Bw=e=>{const t=Object.create(null);e=e._addons.reduce((b,v)=>v.beforeRequest&&v.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:c,_addons:l}=e,f=new Map(i),u=tt(a.options,n);let s=r;const d=Hw(c)((b,v)=>(s=b,a.polyfill("fetch")(b,v)))(r,u),h=new Error,m=d.catch(b=>{throw{[kt]:b}}).then(b=>{if(!b.ok){const v=new ou;if(v.cause=h,v.stack=v.stack+`
5
- CAUSE: `+h.stack,v.response=b,v.url=s,b.type==="opaque")throw v;return b.text().then(I=>{var O;if(v.message=I,a.errorType==="json"||((O=b.headers.get("Content-Type"))===null||O===void 0?void 0:O.split(";")[0])==="application/json")try{v.json=JSON.parse(I)}catch{}throw v.text=I,v.status=b.status,v})}return b}),S=b=>b.catch(v=>{const I=v.hasOwnProperty(kt),O=I?v[kt]:v,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||I&&f.has(kt)&&f.get(kt);if(_)return _(O,e);const A=f.get(nu);if(A)return A(O,e);throw O}),g=b=>v=>S(b?m.then(I=>I&&I[b]()).then(I=>v?v(I):I):m.then(I=>v?v(I):I)),$={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,v){return f.set(b,v),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(kt,b)}},P=l.reduce((b,v)=>({...b,...typeof v.resolver=="function"?v.resolver(b):v.resolver}),$);return o.reduce((b,v)=>v(b,e),P)},Kw={_url:"",_options:{},_config:Pt,_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:tt(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:tt(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:tt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[ru]: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(nu,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||iu(a));return n=r?o?n.json(r,a):n.body(r):n,Bw(n._deferred.reduce((c,l)=>l(c,c._url,c._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=au(this._options.headers);return this.content(t||iu(r)&&r||Dw).body(JSON.stringify(e))}};function Ce(e="",t={}){return{...Kw,_url:e,_options:t}}Ce.default=Ce,Ce.options=Mw,Ce.errorType=zw,Ce.polyfills=Fw,Ce.WretchError=ou;function be(){sessionStorage.removeItem(si),Me(we.CLEAR_CACHE,{})}function su(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function Gw(e){const t=Fe("api2",e.environment),r=w=>async(k,T)=>{let H=sessionStorage.getItem(si);H||(H=Date.now().toString(),sessionStorage.setItem(si,H));const ne={...T,headers:{...T.headers,"Cache-Timestamp":H}};return w(k,ne)},n=(w=!0)=>k=>async(T,H)=>{let ne=null;if(ne=await nr(w),!ne){if(w)throw new Error("No access token available");return k(T,H)}const Ge={...H,headers:{...H.headers,...ne?{Authorization:`Bearer ${ne}`}:{}}};return k(T,Ge)},a=w=>(k,T)=>{if(T.headers.Authorization)return w(k,T);const H=localStorage.getItem("__anon_id"),ne=btoa(`${H}:`),Ge={...T,headers:{...T.headers,Authorization:`Basic ${ne}`}};return w(k,Ge)},i=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function c(){return i.get("/entitlements").json()}async function l(w){const k=await i.get("/entitlements").json();return k==null?void 0:k.find(T=>T.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function u(){return i.get("/contracts").json()}async function s(w){const k=await i.get("/contracts").json();return k==null?void 0:k.find(T=>T.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function h(){return i.get("/bills").json()}async function m(w){const k=await i.get("/bills").json();return k==null?void 0:k.find(T=>T.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const k=await i.get("/transactions").json();return k==null?void 0:k.find(T=>T.id===w)}async function $(w,k){const T=await i.url(`/user-metadata/${w}`).put(k).json();return Me(we.USER_ATTRIBUTE_CHANGED,{}),be(),T}async function P(w){const k=await i.url(`/user-metadata/${w}`).delete().res();return be(),k.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function v(){return await i.url("/user-metadata").get().json()}async function I(){return await i.url("/tags").get().json()}async function O(w){const k=await i.url(`/tags/${w}`).delete().res();return be(),k.ok}async function _(w){const k=await i.url("/tags").post(w).res();return Me(we.USER_ATTRIBUTE_CHANGED,{}),be(),k.ok}async function A(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const k=await o.url(`/tallies/${w}`).delete().res();return be(),k.ok}async function W(w,k){return await o.url(`/tallies/${w}/push`).post(k).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function N(){return await nr(!1)?await i.url("/profile").get().json():null}async function z(w){const k=await i.url("/profile").patch(w).res();return be(),k.ok}async function R(){return await i.url("/payment-issues").get().json()}async function K(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function V(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function st(w){const k=await nr(!1);if(!k)throw new Error("No access token available");const T=new URL(`${Fe("spotify-oas",e.environment)}/sesamy-callback`);T.searchParams.set("access_token",k),T.searchParams.set("state",w),window.location.href=T.toString()}async function p(w){const k=await i.url(`/products/${w}/auto-onboard`).post().json();return k.length&&be(),k}async function y(w,k=3600){const{shortlink:T}=await Ce(_w).post({url:w,ttl:k}).json();return T}async function E(w){const k=await nr(!1);let T;const H=w.language||su();switch(w.target){case"account":T=new URL(`${Fe("account",e.environment)}/${H}/subscriptions/${e.clientId}`);break;case"consume":T=new URL(`${Fe("consume",e.environment)}/${H}/@${e.clientId}/${w.sku}`),w.episodeId?T.href+=`/${w.episodeId}`:T.href+="/listen";break;default:throw new Error("Invalid target")}return T.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),k&&(T.hash=`#access_token=${k}`),w.shorten?y(T.href,w.ttl):T.href}async function U(w){return(await o.url("/checkouts").post({language:su(),...w,vendorId:e.clientId})).json()}async function x(w,k){return(await o.url(`/checkouts/${w}`).patch(k)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await nr(!1),k=new URL(`${Fe("account",e.environment)}/subscriptions/${e.clientId}`);w&&(k.hash=`#access_token=${w}`),window.location.href=k.toString()}return{createCheckout:U,updateCheckout:x,getCheckout:D,getEntitlements:c,getEntitlement:l,getEntitlementAccess:f,getContracts:u,getContract:s,getProfile:N,updateProfile:z,getSubscriptions:d,getBills:h,getBill:m,setUserMetadata:$,deleteUserMetadata:P,getUserMetadata:b,listUserMetadata:v,getTags:I,deleteTag:O,setTag:_,getTally:A,getTallies:M,deleteTally:F,pushTally:W,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:p,isSpotifyLinked:K,unlinkSpotify:V,linkSpotify:st,generateLink:E,openHostedAccountPage:Z}}const cu="@sesamy/sesamy-js",di="1.13.2";function uu(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 Zr="undefined",lu="object",hi=function(){},fu="any",du="*",rt="__",Yr=typeof process<"u"?process:{};Yr.env&&Yr.env.NODE_ENV;var Y=typeof document<"u";Yr.versions!=null&&Yr.versions.node!=null,typeof Deno<"u"&&Deno.core,Y&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function hu(e,t){return t.charAt(0)[e]()+t.slice(1)}var Ww=hu.bind(null,"toUpperCase"),Vw=hu.bind(null,"toLowerCase");function Zw(e){return vu(e)?Ww("null"):typeof e=="object"?qw(e):Object.prototype.toString.call(e).slice(8,-1)}function Jr(e,t){t===void 0&&(t=!0);var r=Zw(e);return t?Vw(r):r}function ar(e,t){return typeof t===e}var te=ar.bind(null,"function"),ze=ar.bind(null,"string"),Tt=ar.bind(null,"undefined"),Yw=ar.bind(null,"boolean");ar.bind(null,"symbol");function vu(e){return e===null}function Jw(e){return Jr(e)==="number"&&!isNaN(e)}function pu(e){return Jr(e)==="array"}function re(e){if(!Xw(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xw(e){return e&&(typeof e=="object"||e!==null)}function qw(e){return te(e.constructor)?e.constructor.name:null}function Qw(e){return e instanceof Error||ze(e.message)&&e.constructor&&Jw(e.constructor.stackTraceLimit)}function mu(e,t){if(typeof t!="object"||vu(t))return!1;if(t instanceof e)return!0;var r=Jr(new e(""));if(Qw(t))for(;t;){if(Jr(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}mu.bind(null,TypeError),mu.bind(null,SyntaxError);function Xr(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?eb(e,t):r}function eb(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function qr(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}qr(Xr,"form"),qr(Xr,"button"),qr(Xr,"input"),qr(Xr,"select");function tb(e){return e?pu(e)?e:[e]:[]}function gu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function rb(){if(Y){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function nb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ab(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=gu(r[1]),o=gu(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 c in n){var l=c.split("[");l.length>1&&(ib(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n}(function(t){return Y&&window.location.search.substring(1)}())}function ib(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 Qr(){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 ob(e,t){var r,n,a,i=null,o=0,c=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var l=new Date;o||(o=l);var f=t-(l-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=l,a=e.apply(r,n)):i||(i=setTimeout(c,f)),a}}var ir="global",Et=rt+"global"+rt,Ot=typeof self===lu&&self.self===self&&self||typeof global===lu&&global.global===global&&global||void 0;function nt(e){return Ot[Et][e]}function at(e,t){return Ot[Et][e]=t}function _t(e){delete Ot[Et][e]}function Rt(e,t,r){var n;try{if(vi(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Ot[Et]||(Ot[Et]={});var en={};function vi(e){if(typeof en[e]!==Zr)return en[e];try{var t=window[e];t.setItem(Zr,Zr),t.removeItem(Zr)}catch{return en[e]=!1}return en[e]=!0}function C(){return C=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},C.apply(this,arguments)}var He="function",je="undefined",sb="@@redux/"+Math.random().toString(36),yu=function(){return typeof Symbol===He&&Symbol.observable||"@@observable"}(),tn=" != "+He;function wu(e,t,r){var n;if(typeof t===He&&typeof r===je&&(r=t,t=void 0),typeof r!==je){if(typeof r!==He)throw new Error("enhancer"+tn);return r(wu)(e,t)}if(typeof e!==He)throw new Error("reducer"+tn);var a=e,i=t,o=[],c=o,l=!1;function f(){c===o&&(c=o.slice())}function u(){return i}function s(h){if(typeof h!==He)throw new Error("Listener"+tn);var m=!0;return f(),c.push(h),function(){if(m){m=!1,f();var S=c.indexOf(h);c.splice(S,1)}}}function d(h){if(!re(h))throw new Error("Act != obj");if(typeof h.type===je)throw new Error("ActType "+je);if(l)throw new Error("Dispatch in reducer");try{l=!0,i=a(i,h)}finally{l=!1}for(var m=o=c,S=0;S<m.length;S++)(0,m[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:s,getState:u,replaceReducer:function(h){if(typeof h!==He)throw new Error("next reducer"+tn);a=h,d({type:"@@redux/INIT"})}})[yu]=function(){var h,m=s;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(u())}return g(),{unsubscribe:m(g)}}})[yu]=function(){return this},h},n}function cb(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+je}function Ct(){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 ub(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),c=o.dispatch,l={getState:o.getState,dispatch:function(f){return c(f)}};return i=[].slice.call(e).map(function(f){return f(l)}),C({},o,{dispatch:c=Ct.apply(void 0,i)(o.dispatch)})}}}var Be=rt+"anon_id",it=rt+"user_id",jt=rt+"user_traits",Ke="userId",At="anonymousId",rn=["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"],pi=["name","EVENTS","config","loaded"],j=rn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),bu=/^utm_/,Su=/^an_prop_/,Iu=/^an_trait_/;function lb(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===j.bootstrap){var i=a.params,o=a.user,c=a.persistedUser,l=a.initialUser,f=c.userId===o.userId;c.anonymousId!==o.anonymousId&&t(Be,o.anonymousId),f||t(it,o.userId),l.traits&&t(jt,C({},f&&c.traits?c.traits:{},l.traits));var u=Object.keys(a.params);if(u.length){var s=i.an_uid,d=i.an_event,h=u.reduce(function(m,S){if(S.match(bu)||S.match(/^(d|g)clid/)){var g=S.replace(bu,"");m.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Su)&&(m.props[S.replace(Su,"")]=i[S]),S.match(Iu)&&(m.traits[S.replace(Iu,"")]=i[S]),m},{campaign:{},props:{},traits:{}});r.dispatch(C({type:j.params,raw:i},h,s?{userId:s}:{})),s&&setTimeout(function(){return e.identify(s,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:j.campaign,campaign:h.campaign})}}return n(a)}}}}function fb(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===j.setItemEnd){if(r.key===Be)return C({},t,{anonymousId:r.value});if(r.key===it)return C({},t,{userId:r.value})}switch(r.type){case j.identify:return Object.assign({},t,{userId:r.userId,traits:C({},t.traits,r.traits)});case j.reset:return[it,Be,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function $u(e){return{userId:e.getItem(it),anonymousId:e.getItem(Be),traits:e.getItem(jt)}}var mi=function(e){return rt+"TEMP"+rt+e};function db(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(c){var l=c.userId,f=c.traits,u=c.options;if(c.type===j.reset&&([it,jt,Be].forEach(function(h){n(h)}),[Ke,At,"traits"].forEach(function(h){_t(mi(h))})),c.type===j.identify){a(Be)||r(Be,Qr());var s=a(it),d=a(jt)||{};s&&s!==l&&i.dispatch({type:j.userIdChanged,old:{userId:s,traits:d},new:{userId:l,traits:f},options:u}),l&&r(it,l),f&&r(jt,C({},d,f))}return o(c)}}}}var or={};function ku(e,t){or[e]&&te(or[e])&&(or[e](t),delete or[e])}function Pu(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(C({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Pu(e,t,r-10).then(n,a)})})}function hb(e){return{abort:e}}function Tu(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,c=i.queue,l=i.user;if(!i.context.offline&&c&&c.actions&&c.actions.length){var f=c.actions.reduce(function(s,d,h){return o[d.plugin].loaded?(s.process.push(d),s.processIndex.push(h)):(s.requeue.push(d),s.requeueIndex.push(h)),s},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(s){var d=c.actions[s],h=d.plugin,m=d.payload.type,S=a[h][m];if(S&&te(S)){var g,$=function(v,I){return v===void 0&&(v={}),I===void 0&&(I={}),[Ke,At].reduce(function(O,_){return v.hasOwnProperty(_)&&I[_]&&I[_]!==v[_]&&(O[_]=I[_]),O},v)}(d.payload,l),P=n[$.meta.rid];if(!P&&(g=S({payload:$,config:o[h].config,instance:r,abort:hb}))&&re(g)&&g.abort)return void(n[$.meta.rid]=!0);if(!P){var b=m+":"+h;e.dispatch(C({},$,{type:b,_:{called:b,from:"queueDrain"}}))}}});var u=c.actions.filter(function(s,d){return!~f.processIndex.indexOf(d)});c.actions=u}}}var gi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,c=e.store,l=e.EVENTS;try{var f=a.plugins,u=a.context,s=r.type,d=s.match(Lt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var m=function(g,$){return function(P,b,v){var I=b.config,O=b.name,_=O+"."+P.type;v&&(_=v.event);var A=P.type.match(Lt)?function(M,F,W,L,N){return function(z,R){var K=L?L.name:M,V=R&&sr(R)?R:W;if(L&&(!(V=R&&sr(R)?R:[M]).includes(M)||V.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(V)+" input valid");return C({},N,{abort:{reason:z,plugins:V,caller:F,_:K}})}}(O,_,$,v,P):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(P,_);return{payload:vb(P),instance:g,config:I||{},abort:A}}}(n,h),S=t.exact.reduce(function(g,$){var P=$.pluginName,b=$.methodName,v=!1;return b.match(/^initialize/)||b.match(/^reset/)||(v=!f[P].loaded),u.offline&&b.match(/^(page|track|identify)/)&&(v=!0),g[""+P]=v,g},{});return Promise.resolve(t.exact.reduce(function(g,$,P){try{var b=$.pluginName;return Promise.resolve(g).then(function(v){function I(){return Promise.resolve(v)}var O=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,A,M){try{return Promise.resolve(_).then(function(F){return A.method&&te(A.method)?(function(z,R){var K=Lu(z);if(K&&K.name===R){var V=Lu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(V?"or "+V.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
- `))}}(A.methodName,A.pluginName),Promise.resolve(A.method({payload:F,instance:n,abort:(W=F,L=b,N=A.pluginName,function(z,R){return C({},W,{abort:{reason:z,plugins:R||[L],caller:s,from:N||L}})}),config:_u(A.pluginName,f,i),plugins:f})).then(function(z){var R=re(z)?z:{};return Promise.resolve(C({},F,R))})):F;var W,L,N})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){v[b]=_});v[b]=r}();return O&&O.then?O.then(I):I()})}catch(v){return Promise.reject(v)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function($,P,b){try{var v=t.exact.length===b+1,I=P.pluginName,O=i[I];return Promise.resolve($).then(function(_){var A=g[I]?g[I]:{};if(d&&(A=_),wi(A,I))return yi({data:A,method:s,instance:n,pluginName:I,store:c}),Promise.resolve(_);if(wi(_,I))return v&&yi({data:_,method:s,instance:n,store:c}),Promise.resolve(_);if(S.hasOwnProperty(I)&&S[I]===!0)return c.dispatch({type:"queue",plugin:I,payload:A,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=m(g[I],i[I]);return Promise.resolve(O[s]({abort:M.abort,payload:A,instance:n,config:_u(I,f,i),plugins:f})).then(function(F){var W=re(F)?F:{},L=C({},_,W),N=g[I];if(wi(N,I))yi({data:N,method:s,instance:n,pluginName:I,store:c});else{var z=s+":"+I;(z.match(/:/g)||[]).length<2&&!s.match(Eu)&&!s.match(Ou)&&n.dispatch(C({},d?L:A,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function($){if(!(s.match(Lt)||s.match(/^registerPlugin/)||s.match(Ou)||s.match(Eu)||s.match(/^params/)||s.match(/^userIdChanged/))){if(l.plugins.includes(s),$._&&$._.originalAction===s)return $;var P=C({},$,{_:{originalAction:$.type,called:$.type,from:"engineEnd"}});ju($,t.exact.length)&&!s.match(/End$/)&&(P=C({},P,{type:$.type+"Aborted"})),c.dispatch(P)}return $})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Eu=/^bootstrap/,Ou=/^ready/;function yi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(C({},e.data,{type:r,_:{called:r,from:"abort"}}))}function _u(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ru(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Cu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function wi(e,t){var r=e.abort;return!!r&&(r===!0||Au(r,t)||r&&Au(r.plugins,t))}function ju(e,t){var r=e.abort;if(!r)return!1;if(r===!0||ze(r))return!0;var n=r.plugins;return sr(r)&&r.length===t||sr(n)&&n.length===t}function sr(e){return Array.isArray(e)}function Au(e,t){return!(!e||!sr(e))&&e.includes(t)}function Lu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function vb(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=re(e[r])?Object.assign({},e[r]):e[r]),t},{})}function pb(e,t,r){var n={};return function(a){return function(i){return function(o){try{var c,l=function(v){return c?v:i(s)},f=o.type,u=o.plugins,s=o;if(o.abort)return Promise.resolve(i(o));if(f===j.enablePlugin&&a.dispatch({type:j.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),f===j.disablePlugin&&setTimeout(function(){return ku(o.meta.rid,{payload:o})},0),f===j.initializeEnd){var d=t(),h=Object.keys(d),m=h.filter(function(v){return u.includes(v)}).map(function(v){return d[v]}),S=[],g=[],$=o.disabled,P=m.map(function(v){var I=v.loaded,O=v.name,_=v.config;return Pu(v,function(){return I({config:_})},1e4).then(function(A){return n[O]||(a.dispatch({type:j.pluginReadyType(O),name:O,events:Object.keys(v).filter(function(M){return!pi.includes(M)})}),n[O]=!0),S=S.concat(O),v}).catch(function(A){if(A instanceof Error)throw new Error(A);return g=g.concat(A.name),A})});Promise.all(P).then(function(v){var I={plugins:S,failed:g,disabled:$};setTimeout(function(){h.length===P.length+$.length&&a.dispatch(C({},{type:j.ready},I))},0)})}var b=function(){if(f!==j.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Tu(a,t,e)},0),Promise.resolve(function(v,I,O,_,A){try{var M=te(I)?I():I,F=v.type,W=F.replace(Lt,"");if(v._&&v._.called)return Promise.resolve(v);var L=O.getState(),N=(K=M,(V=L.plugins)===void 0&&(V={}),(st=v.options)===void 0&&(st={}),Object.keys(K).filter(function(p){var y=st.plugins||{};return Yw(y[p])?y[p]:y.all!==!1&&(!V[p]||V[p].enabled!==!1)}).map(function(p){return K[p]}));F===j.initializeStart&&v.fromEnable&&(N=Object.keys(L.plugins).filter(function(p){var y=L.plugins[p];return v.plugins.includes(p)&&!y.initialized}).map(function(p){return M[p]}));var z=N.map(function(p){return p.name}),R=function(p,y,E){var U=Cu(p).map(function(x){return Ru(x,y)});return y.reduce(function(x,D){var Z=D.name,w=Cu(p,Z).map(function(ne){return Ru(ne,y)}),k=w[0],T=w[1],H=w[2];return k.length&&(x.beforeNS[Z]=k),T.length&&(x.duringNS[Z]=T),H.length&&(x.afterNS[Z]=H),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(gi({action:v,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(p){function y(){var x=function(){if(F.match(Lt))return Promise.resolve(gi({action:C({},E,{type:W+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(D){D.meta&&D.meta.hasCallback&&ku(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return p}):p}if(ju(p,z.length))return p;var E,U=function(){if(F!==W)return Promise.resolve(gi({action:C({},p,{type:W}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(x){E=x});E=p}();return U&&U.then?U.then(y):y()})}catch(p){return Promise.reject(p)}var K,V,st}(o,t,e,a,r)).then(function(v){return c=1,i(v)})}();return Promise.resolve(b&&b.then?b.then(l):l(b))}catch(v){return Promise.reject(v)}}}}}function mb(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,c=n.options;if(a===j.setItem||a===j.removeItem){if(n.abort)return r(n);a===j.setItem?e.setItem(i,o,c):e.removeItem(i,c)}return r(n)}}}}var gb=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(c){return r.dispatch(c)}},o=e[t].map(function(c){return c(i)});return Ct.apply(void 0,o)(n)(a)}}}}};function yb(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=Uu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,c=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:c}),config:c},C({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=Uu(r.type,j.initialize),f=e()[l];return f&&l?(n[l]=C({},t[l],{initialized:!0,loaded:!!f.loaded({config:f.config})}),C({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=C({},t[r.name],{loaded:!0}),C({},t,n);switch(r.type){case j.disablePlugin:return C({},t,xu(r.plugins,!1,t));case j.enablePlugin:return C({},t,xu(r.plugins,!0,t));default:return t}}}function Uu(e,t){return e.substring(t.length+1,e.length)}function xu(e,t,r){return e.reduce(function(n,a){return n[a]=C({},r[a],{enabled:t}),n},r)}function Nu(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var wb={last:{},history:[]};function bb(e,t){e===void 0&&(e=wb);var r=t.options,n=t.meta;if(t.type===j.track){var a=Nu(C({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return C({},e,{last:a,history:e.history.concat(a)})}return e}var Sb={actions:[]};function Ib(e,t){e===void 0&&(e=Sb);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===j.identify?[t].concat(e.actions):e.actions.concat(t),C({},e,{actions:n});case"dequeue":return[];default:return e}}var Du=/#.*$/;function $b(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Du,""):"")}var Mu,Fu,zu,Hu,kb=function(e){if(e===void 0&&(e={}),!Y)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,c=a.innerHeight,l=i.hash,f=i.search,u=function(d){var h=function(){if(Y){for(var m,S=document.getElementsByTagName("link"),g=0;m=S[g];g++)if(m.getAttribute("rel")==="canonical")return m.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(Du,"")}(f),s={title:r,url:u,path:$b(u),hash:l,search:f,width:o,height:c};return n&&n!==""&&(s.referrer=n),C({},s,e)},Pb={last:{},history:[]};function Tb(e,t){e===void 0&&(e=Pb);var r=t.options;if(t.type===j.page){var n=Nu(C({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return C({},e,{last:n,history:e.history.concat(n)})}return e}Mu=function(){if(!Y)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"}(),Fu=Y?document.referrer:null,zu=rb(),Hu=nb();var Bu={initialized:!1,sessionId:Qr(),app:null,version:null,debug:!1,offline:!!Y&&!navigator.onLine,os:{name:Mu},userAgent:Y?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Hu,locale:zu,campaign:{},referrer:Fu};function Eb(e,t){e===void 0&&(e=Bu);var r=e.initialized,n=t.campaign;switch(t.type){case j.campaign:return C({},e,{campaign:n});case j.offline:return C({},e,{offline:!0});case j.online:return C({},e,{offline:!1});default:return r?e:C({},Bu,e,{initialized:!0})}}var Ob=["plugins","reducers","storage"];function _b(e,t,r){if(Y){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function Rb(e){var t=_b.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Ku(){return at("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 Ot[Et].analytics.push(o.action||o),i(o)}})}}}function Gu(e){return function(){return Ct(Ct.apply(null,arguments),Ku())}}function bi(e){return e?pu(e)?e:[e]:[]}function Wu(e,t,r){e===void 0&&(e={});var n,a,i=Qr();return t&&(or[i]=(n=t,a=function(o){for(var c,l=o||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(te(l[f])){c=l[f];break}return c}(r),function(o){a&&a(o),n(o)})),C({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function Cb(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(p,y){if(te(y))return p.middlewares=p.middlewares.concat(y),p;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var E=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];p.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(p.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var k=Array.prototype.slice.call(arguments),T=new Array(w.length),H=0;H<k.length;H++)T[H]=k[H];return T[T.length]=I,w.apply({instance:I},T)}),D},{}),delete y.methods);var U=Object.keys(y).concat(E),x=new Set(p.events.concat(U));if(p.events=Array.from(x),p.pluginsArray=p.pluginsArray.concat(y),p.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return p.plugins[y.name]=y,p.plugins[y.name].loaded||(p.plugins[y.name].loaded=function(){return!0}),p},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:nt,setItem:at,removeItem:_t},i=function(p){return function(y,E,U){return E.getState("user")[y]||(U&&re(U)&&U[y]?U[y]:$u(p)[y]||nt(mi(y))||null)}}(a),o=n.plugins,c=n.events.filter(function(p){return!pi.includes(p)}).sort(),l=new Set(c.concat(rn).filter(function(p){return!pi.includes(p)})),f=Array.from(l).sort(),u=function(){return o},s=new gb,d=s.addMiddleware,h=s.removeMiddleware,m=s.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=ab(),$=$u(a),P=C({},$,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});P.anonymousId||(P.anonymousId=Qr());var b=C({enable:function(p,y){return new Promise(function(E){R.dispatch({type:j.enablePlugin,plugins:bi(p),_:{originalAction:j.enablePlugin}},E,[y])})},disable:function(p,y){return new Promise(function(E){R.dispatch({type:j.disablePlugin,plugins:bi(p),_:{originalAction:j.disablePlugin}},E,[y])})}},n.methods),v=!1,I={identify:function(p,y,E,U){try{var x=ze(p)?p:null,D=re(p)?p:y,Z=E||{},w=I.user();at(mi(Ke),x);var k=x||D.userId||i(Ke,I,D);return Promise.resolve(new Promise(function(T){R.dispatch(C({type:j.identifyStart,userId:k,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==x&&{previousId:w.id}),T,[y,E,U])}))}catch(T){return Promise.reject(T)}},track:function(p,y,E,U){try{var x=re(p)?p.event:p;if(!x||!ze(x))throw new Error("EventMissing");var D=re(p)?p:y||{},Z=re(E)?E:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:j.trackStart,event:x,properties:D,options:Z,userId:i(Ke,I,y),anonymousId:i(At,I,y)},w,[y,E,U])}))}catch(w){return Promise.reject(w)}},page:function(p,y,E){try{var U=re(p)?p:{},x=re(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:j.pageStart,properties:kb(U),options:x,userId:i(Ke,I,U),anonymousId:i(At,I,U)},D,[p,y,E])}))}catch(D){return Promise.reject(D)}},user:function(p){if(p===Ke||p==="id")return i(Ke,I);if(p===At||p==="anonId")return i(At,I);var y=I.getState("user");return p?uu(y,p):y},reset:function(p){return new Promise(function(y){R.dispatch({type:j.resetStart},y,p)})},ready:function(p){return v&&p({plugins:b,instance:I}),I.on(j.ready,function(y){p(y),v=!0})},on:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".on disabled for "+p);var E=/Start$|Start:/;if(p==="*"){var U=function(w){return function(k){return function(T){return T.type.match(E)&&y({payload:T,instance:I,plugins:o}),k(T)}}},x=function(w){return function(k){return function(T){return T.type.match(E)||y({payload:T,instance:I,plugins:o}),k(T)}}};return d(U,nn),d(x,an),function(){h(U,nn),h(x,an)}}var D=p.match(E)?nn:an,Z=function(w){return function(k){return function(T){return T.type===p&&y({payload:T,instance:I,plugins:o,abort:S}),k(T)}}};return d(Z,D),function(){return h(Z,D)}},once:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".once disabled for "+p);var E=I.on(p,function(U){y({payload:U.payload,instance:I,plugins:o,abort:S}),E()});return E},getState:function(p){var y=R.getState();return p?uu(y,p):Object.assign({},y)},dispatch:function(p){var y=ze(p)?{type:p}:p;if(rn.includes(y.type))throw new Error("reserved action "+y.type);var E=C({},y,{_:C({originalAction:y.type},p._||{})});R.dispatch(E)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(p,y,E){R.dispatch({type:j.setItemStart,key:p,value:y,options:E})},removeItem:function(p,y){R.dispatch({type:j.removeItemStart,key:p,options:y})}},setAnonymousId:function(p,y){I.storage.setItem(Be,p,y)},events:{core:rn,plugins:c}},O=n.middlewares.concat([function(p){return function(y){return function(E){return E.meta||(E.meta=Wu()),y(E)}}},m(nn),pb(I,u,{all:f,plugins:c}),mb(a),lb(I),db(I),m(an)]),_={context:Eb,user:fb(a),page:Tb,track:bb,plugins:yb(u),queue:Ib},A=Ct,M=Ct;if(Y&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(A=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Ku():re(typeof arguments[0])?Gu():Gu().apply(null,arguments)}}var W,L=function(p){return Object.keys(p).reduce(function(y,E){return Ob.includes(E)||(y[E]=p[E]),y},{})}(e),N=n.pluginsArray.reduce(function(p,y){var E=y.name,U=y.config,x=y.loaded,D=n.pluginEnabled[E];return p[E]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!x({config:U}),config:U},p},{}),z={context:L,user:P,plugins:N},R=wu(function(p){for(var y=Object.keys(p),E={},U=0;U<y.length;U++){var x=y[U];typeof p[x]===He&&(E[x]=p[x])}var D,Z=Object.keys(E);try{(function(w){Object.keys(w).forEach(function(k){var T=w[k];if(typeof T(void 0,{type:"@@redux/INIT"})===je||typeof T(void 0,{type:sb})===je)throw new Error("reducer "+k+" "+je)})})(E)}catch(w){D=w}return function(w,k){if(w===void 0&&(w={}),D)throw D;for(var T=!1,H={},ne=0;ne<Z.length;ne++){var Ge=Z[ne],Sl=w[Ge],Ci=(0,E[Ge])(Sl,k);if(typeof Ci===je){var bS=cb(Ge,k);throw new Error(bS)}H[Ge]=Ci,T=T||Ci!==Sl}return T?H:w}}(C({},_,t)),z,M(A(ub.apply(void 0,O))));R.dispatch=(W=R.dispatch,function(p,y,E){var U=C({},p,{meta:Wu(p.meta,y,bi(E))});return W.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:j.bootstrap,plugins:K,config:L,params:g,user:P,initialUser:r,persistedUser:$});var V=K.filter(function(p){return n.pluginEnabled[p]}),st=K.filter(function(p){return!n.pluginEnabled[p]});return R.dispatch({type:j.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(p,y){var E=p.bootstrap,U=p.config,x=p.name;E&&te(E)&&E({instance:I,config:U,payload:p}),R.dispatch({type:j.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:p}),n.pluginsArray.length===y+1&&R.dispatch({type:j.initializeStart,plugins:V,disabled:st})}),Rb(function(p){R.dispatch({type:p?j.offline:j.online})}),function(p,y,E){setInterval(function(){return Tu(p,y,E)},3e3)}(R,u,I),I}var nn="before",an="after",cr="cookie",ot=Yu(),Vu=on,jb=on;function Zu(e){return ot?on(e,"",-1):_t(e)}function Yu(){if(ot!==void 0)return ot;var e="cookiecookie";try{on(e,e),ot=document.cookie.indexOf(e)!==-1,Zu(e)}catch{ot=!1}return ot}function on(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return ot===!1&&(o?at(e,t):nt(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 ur="localStorage",Ab=vi.bind(null,"localStorage");Rt("localStorage","getItem",nt),Rt("localStorage","setItem",at),Rt("localStorage","removeItem",_t);var lr="sessionStorage",Lb=vi.bind(null,"sessionStorage");Rt("sessionStorage","getItem",nt),Rt("sessionStorage","setItem",at),Rt("sessionStorage","removeItem",_t);function Ut(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(re(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var Ub=Ab(),xb=Lb(),Nb=Yu();function Ju(e,t){if(e){var r=Si(t),n=!Pi(r),a=Ii(r)?Ut(localStorage.getItem(e)):void 0;if(n&&!Tt(a))return a;var i=$i(r)?Ut(Vu(e)):void 0;if(n&&i)return i;var o=ki(r)?Ut(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var c=nt(e);return n?c:{localStorage:a,sessionStorage:o,cookie:i,global:c}}}function Db(e,t,r){if(e&&!Tt(t)){var n={},a=Si(r),i=JSON.stringify(t),o=!Pi(a);return Ii(a)&&(n[ur]=cn(ur,t,Ut(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[ur]:$i(a)&&(n[cr]=cn(cr,t,Ut(Vu(e))),jb(e,i),o)?n[cr]:ki(a)&&(n[lr]=cn(lr,t,Ut(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[lr]:(n[ir]=cn(ir,t,nt(e)),at(e,t),o?n[ir]:n)}}function Mb(e,t){if(e){var r=Si(t),n=Ju(e,du),a={};return!Tt(n.localStorage)&&Ii(r)&&(localStorage.removeItem(e),a[ur]=n.localStorage),!Tt(n.cookie)&&$i(r)&&(Zu(e),a[cr]=n.cookie),!Tt(n.sessionStorage)&&ki(r)&&(sessionStorage.removeItem(e),a[lr]=n.sessionStorage),!Tt(n.global)&&sn(r,ir)&&(_t(e),a[ir]=n.global),a}}function Si(e){return e?ze(e)?e:e.storage:fu}function Ii(e){return Ub&&sn(e,ur)}function $i(e){return Nb&&sn(e,cr)}function ki(e){return xb&&sn(e,lr)}function Pi(e){return e===du||e==="all"}function sn(e,t){return e===fu||e===t||Pi(e)}function cn(e,t,r){return{location:e,current:t,previous:r}}var Fb={setItem:Db,getItem:Ju,removeItem:Mb};function zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xu(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 qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(r),!0).forEach(function(n){zb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:Fb};return Cb(qu(qu({},t),e))}function Bb(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),c()}function c(){r=setInterval(o,t.interval||1e4)}return c(),{flush:o,push:function(l){return n=a.push(l),n>=i&&o(),n},size:function(){return a.length},end:function(l){l&&o(),clearInterval(r)}}}function Kb(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 c=r[o];r[o]=function(...l){var s;const f=((s=l[2])==null?void 0:s.toString())||"",u=Wb(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),c.apply(r,l)}})}function Gb(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function Wb(e){return["#","?"].forEach(t=>e=Gb(e,t)),e}function Vb(){Kb(()=>{Ae.page()})}function Zb(e){if(e===void 0&&(e={}),!Y)return hi;var t=el(),r=Ti(),n=Qu(),a=un(n,t),i=un(r,t),o=[],c=[],l=[],f=n,u=a,s=i,d=Object.keys(e);if(!d.length)return hi;var h=d.map(function(S){return Number(S)}),m=ob(function(){var S=el(),g=function(L,N){return N.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),$=Ti(),P=Qu(),b=un(P,S),v=un($,S);if(u=b>u?b:u,s=v<s?v:s,!(o.length>=h.length)){var I=f===P,O="up";I?O="initial":f<=P&&(O="down");var _=g,A=h;(O==="up"||I)&&(_=g.slice().reverse(),A=h.slice().reverse());var M=A.reduce(function(L,N,z){var R=_[z];return l.includes(N)&&P<=R&&(l=l.filter(function(K){return K!==N}),L.singleFunction=N),O==="down"&&!o.includes(N)&&P>=R&&N>i?(c.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!o.includes(N)&&P<=R&&N<=b?(L.foundFunc=[N],L):(I&&P>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!c.includes(N)&&P>=R&&(c.push(N),L.singleFunction?l.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=P,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){te(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,W=M.direction;te(e[F])&&e[F]({trigger:F,direction:W,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(F)}}},500);return window.addEventListener("scroll",m),function(){return window.removeEventListener("scroll",m)}}function Ti(){return Y?document.body.scrollTop||document.documentElement.scrollTop:0}function Yb(){return Y?window.innerHeight||document.documentElement.clientHeight:0}function Qu(){return Math.round(Ti()+Yb())}function el(){if(!Y)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function un(e,t){return Math.round(e/t*100)}var tl="EventListener";function Jb(e){return function(t,r,n,a){var i=n||hi,o=a||!1;if(!Y)return i;var c=ln(r),l=ln(t,!0);if(!l.length)throw new Error("noElements");if(!c.length)throw new Error("noEvent");var f=[];return function u(s){s&&(f=[]);for(var d=s?"add"+tl:"remove"+tl,h=0;h<l.length;h++){var m=l[h];f[h]=s?o&&o.once?Xb(i):i:f[h]||i;for(var S=0;S<c.length;S++)m[d]?m["on"+c[S]]=s?f[h]:null:m[d](c[S],f[h],o)}return u.bind(null,!s)}(e)}}function ln(e,t){if(ze(e))return t?ln(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=tb(e);return t?i.map(function(o){return ze(o)?ln(o,!0):o}).flat():i}function Xb(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ei=Jb("Event");function rl(e,t){return Y&&te(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),te(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}rl.bind(null,"onerror"),rl.bind(null,"onload");var nl=typeof window>"u",al="hidden";function qb(e){if(nl)return!1;var t=Qb(),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 Qb(){var e=["webkit","moz","ms","o"];return nl||al in document?al:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var eS=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function tS(e,t){t===void 0&&(t={});var r=function(o,c){var l=this,f=!1;return function(u){f||(o.call(l,u),f=!0,setTimeout(function(){return f=!1},c))}}(e,t.throttle||1e4),n=[];function a(){var o=qb(function(c){c||r({type:"tabVisible"})});return n=[o].concat(eS.map(function(c){return Ei(document,c,r)})).concat(Ei(window,"load",r)).concat(Ei(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function rS(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,c=o===void 0?1e4:o,l=e.throttle,f=l===void 0?2e3:l,u=!1,s=!1,d=new Date,h=function(){return clearTimeout(t)};function m(g){h(),i&&!u&&i(fr(d),g),a&&u&&(u=!1,a(fr(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(fr(d),g))},c)}var S=tS(m,{throttle:f});return{disable:function(){s=!0,u=!1,h();var g=S();return function(){return s=!1,d=new Date,m({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:s,active:u?0:fr(d,s),idle:u?fr(r,s):0}}}}function fr(e,t){return t?0:Math.round((new Date-e)/1e3)}const il=5e3;class nS{constructor(t){ve(this,"element");ve(this,"isInViewport",!1);ve(this,"isAwake",!1);ve(this,"isFlushing");ve(this,"observer");ve(this,"lastEventAt",Date.now());ve(this,"registeredView",!1);ve(this,"viewCallback");ve(this,"activeDurationCallback");ve(this,"idleDurationCallback");ve(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),rS({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:il}),Zb({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*il: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 ol="sesamy_session_id";function aS(){let e=sessionStorage.getItem(ol);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ol,e)),e}let sl=!1,Oi,cl,fn;function iS({clientId:e,enabled:t=!0,environment:r}){if(Oi=e,cl=t,fn=`${Fe("logs",r)}/events`,!cl)return;Vb();const n=new nS({element:document.body,viewCallback:()=>{Ae.page()},activeDurationCallback:(a,i,o)=>{Ae.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Ae.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Ae.track("scroll",{scroll:a.scrollMax})}});cS(document.body,()=>{n.flush()}),uS(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(we.AUTHENTICATED,async a=>{const i=a;await Ae.identify(i.detail.sub)}),window.addEventListener(we.LOGOUT,async()=>{await Ae.track("logout",{}),_i.flush(),await Ae.reset()})}function ul(e){return JSON.stringify(e.map(t=>({...t,clientId:Oi,requestId:Math.random().toString(36).slice(2,9),sessionId:aS(),timestamp:new Date().toISOString(),version:di,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:cu,userAgent:navigator.userAgent,clientId:Oi}})))}const _i=Bb(async e=>{if(e.length>0){const t=ul(e);sl?navigator.sendBeacon(fn,t):(await fetch(fn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ri(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(fn,ul([r]))}else _i.push(e)}const Ae=Hb({app:cu,version:di,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ri({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function oS(e,t){Ae.track(e,t)}function sS(){return sl=!0,_i.flush()}const ll=new Map;function cS(e,t){ll.set(e,t)}window.addEventListener("beforeunload",()=>{ll.forEach((e,t)=>{e.bind(t)()}),sS()});const fl=new Map;function uS(e,t){fl.set(e,t)}window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&fl.forEach((e,t)=>{e.bind(t)()})});const dl="sesamySignedURLs";function hl(){const e=sessionStorage.getItem(dl);return e?JSON.parse(e):[]}function lS(e){const t=hl();t.push(e),sessionStorage.setItem(dl,JSON.stringify(t))}function fS(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:c,getContract:l,getContracts:f,getBill:u,getBills:s,getProfile:d,updateProfile:h,getTags:m,deleteTag:S,setTag:g,getUserMetadata:$,listUserMetadata:P,setUserMetadata:b,deleteUserMetadata:v,getTally:I,getTallies:O,pushTally:_,deleteTally:A,getProduct:M,getPaymentIssues:F,isSpotifyLinked:W,unlinkSpotify:L,linkSpotify:N,autoOnboardProduct:z,openHostedAccountPage:R,generateLink:K}=Gw(e),V={auth:{getUser:d,isAuthenticated:li,loginWithRedirect:fi,logout:Xc,setToken:Qc},checkouts:{get:r,create:t,update:n},profile:{get:d,update:h,openHostedAccountPage:R,isSpotifyLinked:W,unlinkSpotify:L},analytics:{track:oS},tags:{list:m,set:g,delete:S},entitlements:{get:a,list:i,access:o,signedLinks:hl},contracts:{get:l,list:f},bills:{get:u,list:s},userMetadata:{get:$,list:P,set:b,delete:v},tallies:{get:I,list:O,push:_,delete:A},subscriptions:{list:c},products:{get:M,autoOnboard:z,linkSpotify:N},getVersion:dS,getPaymentIssues:F,generateLink:K,clearCache:be};return e.namespace&&(window[e.namespace]=V),V}function dS(){return di}async function hS({enabled:e=!1,rules:t}){if(!e)return;const r=await li(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML+=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML+=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function vl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function vS(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Qc(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const pl="sesamy-refresh",ml="force-refetch-entitlements";function pS(){const e=new URLSearchParams(window.location.search),t=e.get(ml),r=e.get(pl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ml),e.delete(pl),n.search=e.toString(),be(),window.history.replaceState(null,"",n)}}function mS(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;lS({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const gl="sesamy-user";async function gS(){const t=new URLSearchParams(window.location.search).get(gl);if(!t)return;const r=await jw();(r==null?void 0:r.email)!==t&&(be(),fi({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(gl),window.history.replaceState(null,"",n)}const yl="sesamy-purchase";function yS(){const e=new URLSearchParams(window.location.search),t=e.get(yl);if(t!==null){const r=new URL(window.location.href);e.delete(yl),r.search=e.toString(),Me(we.PURCHASE,{itemSrc:t}),be(),window.history.replaceState(null,"",r)}}const wl="sesamy-login";async function wS(){if(!new URLSearchParams(window.location.search).get(wl))return;await li()||fi();const n=new URL(window.location.href);n.searchParams.delete(wl),window.history.replaceState(null,"",n)}async function bl(e){iS({clientId:e.clientId,environment:e.environment,...e.analytics}),await Cw({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await hS(e.transform);const t=fS({clientId:e.clientId,environment:e.environment,...e.api});return Me(we.READY,{}),vS(),pS(),mS(),await wS(),await gS(),yS(),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);bl(t)}catch(t){console.error("Failed to parse config",t)}}return Ee.init=bl,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"}),Ee}({});
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",!Vc(r))throw new Error(`Invalid cache location "${r}"`);n=Vc(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?It:ww,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:bw;var i;this.scope=Vr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new pw(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||xc,this.cacheManager=new vw(n,n.allKeys?void 0:new $w(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,c)=>o?o.startsWith("https://")?o:`https://${o}/`:`${c}/`)(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 Iw)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Uc)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ni(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return gw({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=Mc(ri()),i=Mc(ri()),o=ri(),c=(u=>{const s=new Uint8Array(u);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(s))))})(await(async u=>await Wr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(o)),l=((u,s,d,h,m,S,g,$)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),d),{scope:Vr(s,d.scope),response_type:"code",response_mode:$||"query",state:h,nonce:m,redirect_uri:g||u.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(l);return{nonce:i,code_verifier:o,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(c=>new Promise((l,f)=>{let u;const s=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(s),clearTimeout(d),window.removeEventListener("message",u,!1),f(new ow(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(s),f(new iw(c.popup)),window.removeEventListener("message",u,!1)},1e3*(c.timeoutInSeconds||60));u=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(s),window.removeEventListener("message",u,!1),c.popup.close(),h.data.response.error)return f(ae.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ae("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=Zc(t),{openUrl:a,fragment:i,appState:o}=n,c=Te(n,["openUrl","fragment","appState"]),l=((r=c.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:u}=f,s=Te(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},s),{appState:o}),l&&{organization:l}));const d=i?`${u}#${i}`:u;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(s=>{s.indexOf("#")>-1&&(s=s.substring(0,s.indexOf("#")));const d=new URLSearchParams(s);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("")),c=this.transactionManager.get();if(!c)throw new ae("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new aw(i,o||i,n,c.appState);if(!c.code_verifier||c.state&&c.state!==n)throw new ae("state_mismatch","Invalid state");const l=c.organization,f=c.nonce,u=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:a},u?{redirect_uri:u}:{}),{nonceIn:f,organization:l}),{appState:c.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:Vr(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let c=ii[o];return c||(c=i().finally(()=>{delete ii[o],c=null}),ii[o]=c),c})(()=>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=Te(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})(()=>oi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ti;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:c,expires_in:l}=a;return Object.assign(Object.assign({id_token:i,access_token:o},c?{scope:c}:null),{expires_in:l})}finally{await oi.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:Vr(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},nw),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new et({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=Te(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ni(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Zc(t),{openUrl:n}=r,a=Te(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:c,redirect_uri:l,scope:f,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ae("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const s=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,S,g=60)=>new Promise(($,P)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const v=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",I,!1))};let I;const O=setTimeout(()=>{P(new ti),v()},1e3*g);I=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const A=_.source;A&&A.close(),_.data.response.error?P(ae.fromPayload(_.data.response)):$(_.data.response),clearTimeout(O),window.removeEventListener("message",I,!1),setTimeout(v,2e3)},window.addEventListener("message",I,!1),window.document.body.appendChild(b),b.setAttribute("src",m)}))(a,this.domainUrl,s);if(i!==d.state)throw new ae("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:u})}catch(s){throw s.error==="login_required"&&this.logout({openUrl:!1}),s}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new et({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 Nc(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=Te(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 et({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 et({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:c}=a,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},o?{scope:o}:null),{expires_in:c})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await dw(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 Tw(e){const t=new Pw(e);return await t.checkSession(),t}var we=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(we||{});const Ew="sesamy.com",Ow="sesamy.dev",_w="https://sesa.my",si="sesamyCacheTimestamp";function ze(e,t){return`https://${e}.${t==="dev"?Ow:Ew}`}let ie,Yc;const $t="sesamyAccessToken",ci="sesamyRefreshToken";async function Rw(e){if(!e)return null;const t=localStorage.getItem(ci);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(ci),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(ci,i.refresh_token),localStorage.setItem($t,i.access_token),i.access_token}catch{Xc()}}async function ui(){const e=localStorage.getItem($t);if(!e)return null;const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await Rw(t);if(r)return r;localStorage.removeItem($t)}return e}function Jc(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 Cw(e){if(e.enabled===!1)return;Yc=e.organization;const t={domain:ze("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Jc(window.location.href)!==Jc(ze("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ie=await Tw(t),window.location.search.includes("code="))try{await ie.handleRedirectCallback();const r=await ie.getUser();Fe(we.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}}async function li(){return await ui()?!0:ie?ie.isAuthenticated():!1}async function jw(){return await ui()?{sub:"local",name:"Local User"}:ie?ie.getUser():null}function fi(e){if(localStorage.removeItem($t),!ie)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ie.loginWithRedirect({...e,authorizationParams:{organization:Yc,redirect_uri:window.location.href,...t}})}async function nr(e=!0){const t=ui();if(t)return t;try{return ie?await ie.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Xc(e={}){if(localStorage.removeItem($t),Fe(we.LOGOUT,{}),!!ie)return ie.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function qc(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 Qc(e){const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem($t,e),Fe(we.AUTHENTICATED,t)}const Aw=(e,t)=>t.skipDedupe||t.method!=="GET",Lw=(e,t)=>t.method+"@"+e,Uw=e=>e.clone(),eu=({skip:e=Aw,key:t=Lw,resolver:r=Uw}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const c=t(i,o);if(!n.has(c))n.set(c,[]);else return new Promise((l,f)=>{n.get(c).push([l,f])});try{return a(i,o).then(l=>(n.get(c).forEach(([f])=>f(r(l))),n.delete(c),l)).catch(l=>{throw n.get(c).forEach(([f,u])=>u(l)),n.delete(c),l})}catch(l){return n.delete(c),Promise.reject(l)}}},xw=(e,t)=>e*t,Nw=e=>e&&e.ok,tu=({delayTimer:e=500,delayRamp:t=xw,maxAttempts:r=10,until:n=Nw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:c}={})=>l=>(f,u)=>{let s=0;if(c&&c(f,u))return l(f,u);const d=(h,m)=>Promise.resolve(n(h,m)).then(S=>S?h&&o?h:m?Promise.reject(m):h:(s++,!r||s<=r?new Promise(g=>{const $=t(e,s);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:m,url:f,options:u})).then((P={})=>{var b,v;g(l((b=P&&P.url)!==null&&b!==void 0?b:f,(v=P&&P.options)!==null&&v!==void 0?v:u))}):g(l(f,u))},$)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(m||new Error("Number of attempts exceeded."))));return l(f,u).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},Dw="application/json",ru="Content-Type",kt=Symbol(),nu=Symbol();function au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===ru.toLowerCase()))===null||t===void 0?void 0:t[1]}function iu(e){return/^application\/.*json.*/.test(e)}const rt=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]=rt(o,i,r):n[a]=i,n},{...e})},Pt={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 Mw(e,t=!1){Pt.options=t?e:rt(Pt.options,e)}function Fw(e,t=!1){Pt.polyfills=t?e:rt(Pt.polyfills,e)}function zw(e){Pt.errorType=e}const Hw=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class ou extends Error{}const Bw=e=>{const t=Object.create(null);e=e._addons.reduce((b,v)=>v.beforeRequest&&v.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:c,_addons:l}=e,f=new Map(i),u=rt(a.options,n);let s=r;const d=Hw(c)((b,v)=>(s=b,a.polyfill("fetch")(b,v)))(r,u),h=new Error,m=d.catch(b=>{throw{[kt]:b}}).then(b=>{if(!b.ok){const v=new ou;if(v.cause=h,v.stack=v.stack+`
5
+ CAUSE: `+h.stack,v.response=b,v.url=s,b.type==="opaque")throw v;return b.text().then(I=>{var O;if(v.message=I,a.errorType==="json"||((O=b.headers.get("Content-Type"))===null||O===void 0?void 0:O.split(";")[0])==="application/json")try{v.json=JSON.parse(I)}catch{}throw v.text=I,v.status=b.status,v})}return b}),S=b=>b.catch(v=>{const I=v.hasOwnProperty(kt),O=I?v[kt]:v,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||I&&f.has(kt)&&f.get(kt);if(_)return _(O,e);const A=f.get(nu);if(A)return A(O,e);throw O}),g=b=>v=>S(b?m.then(I=>I&&I[b]()).then(I=>v?v(I):I):m.then(I=>v?v(I):I)),$={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,v){return f.set(b,v),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(kt,b)}},P=l.reduce((b,v)=>({...b,...typeof v.resolver=="function"?v.resolver(b):v.resolver}),$);return o.reduce((b,v)=>v(b,e),P)},Kw={_url:"",_options:{},_config:Pt,_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:rt(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:rt(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:rt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[ru]: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(nu,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||iu(a));return n=r?o?n.json(r,a):n.body(r):n,Bw(n._deferred.reduce((c,l)=>l(c,c._url,c._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=au(this._options.headers);return this.content(t||iu(r)&&r||Dw).body(JSON.stringify(e))}};function Ce(e="",t={}){return{...Kw,_url:e,_options:t}}Ce.default=Ce,Ce.options=Mw,Ce.errorType=zw,Ce.polyfills=Fw,Ce.WretchError=ou;function be(){sessionStorage.removeItem(si),Fe(we.CLEAR_CACHE,{})}function su(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function Gw(e){const t=ze("api2",e.environment),r=w=>async(k,T)=>{let H=sessionStorage.getItem(si);H||(H=Date.now().toString(),sessionStorage.setItem(si,H));const ne={...T,headers:{...T.headers,"Cache-Timestamp":H}};return w(k,ne)},n=(w=!0)=>k=>async(T,H)=>{let ne=null;if(ne=await nr(w),!ne){if(w)throw new Error("No access token available");return k(T,H)}const We={...H,headers:{...H.headers,...ne?{Authorization:`Bearer ${ne}`}:{}}};return k(T,We)},a=w=>(k,T)=>{if(T.headers.Authorization)return w(k,T);const H=localStorage.getItem("__anon_id"),ne=btoa(`${H}:`),We={...T,headers:{...T.headers,Authorization:`Basic ${ne}`}};return w(k,We)},i=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function c(){return i.get("/entitlements").json()}async function l(w){const k=await i.get("/entitlements").json();return k==null?void 0:k.find(T=>T.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function u(){return i.get("/contracts").json()}async function s(w){const k=await i.get("/contracts").json();return k==null?void 0:k.find(T=>T.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function h(){return i.get("/bills").json()}async function m(w){const k=await i.get("/bills").json();return k==null?void 0:k.find(T=>T.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const k=await i.get("/transactions").json();return k==null?void 0:k.find(T=>T.id===w)}async function $(w,k){const T=await i.url(`/user-metadata/${w}`).put(k).json();return Fe(we.USER_ATTRIBUTE_CHANGED,{}),be(),T}async function P(w){const k=await i.url(`/user-metadata/${w}`).delete().res();return be(),k.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function v(){return await i.url("/user-metadata").get().json()}async function I(){return await i.url("/tags").get().json()}async function O(w){const k=await i.url(`/tags/${w}`).delete().res();return be(),k.ok}async function _(w){const k=await i.url("/tags").post(w).res();return Fe(we.USER_ATTRIBUTE_CHANGED,{}),be(),k.ok}async function A(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const k=await o.url(`/tallies/${w}`).delete().res();return be(),k.ok}async function W(w,k){return await o.url(`/tallies/${w}/push`).post(k).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function N(){return await nr(!1)?await i.url("/profile").get().json():null}async function z(w){const k=await i.url("/profile").patch(w).res();return be(),k.ok}async function R(){return await i.url("/payment-issues").get().json()}async function K(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function Z(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Le(w){const k=await nr(!1);if(!k)throw new Error("No access token available");const T=new URL(`${ze("spotify-oas",e.environment)}/sesamy-callback`);T.searchParams.set("access_token",k),T.searchParams.set("state",w),window.location.href=T.toString()}async function p(w){const k=await i.url(`/products/${w}/auto-onboard`).post().json();return k.length&&be(),k}async function y(w,k=3600){const{shortlink:T}=await Ce(_w).post({url:w,ttl:k}).json();return T}async function E(w){const k=await nr(!1);let T;const H=w.language||su();switch(w.target){case"account":T=new URL(`${ze("account",e.environment)}/${H}/subscriptions/${e.clientId}`);break;case"consume":T=new URL(`${ze("consume",e.environment)}/${H}/@${e.clientId}/${w.sku}`),w.episodeId?T.href+=`/${w.episodeId}`:T.href+="/listen";break;default:throw new Error("Invalid target")}return T.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),k&&(T.hash=`#access_token=${k}`),w.shorten?y(T.href,w.ttl):T.href}async function U(w){return(await o.url("/checkouts").post({language:su(),...w,vendorId:e.clientId})).json()}async function x(w,k){return(await o.url(`/checkouts/${w}`).patch(k)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function V(){const w=await nr(!1),k=new URL(`${ze("account",e.environment)}/subscriptions/${e.clientId}`);w&&(k.hash=`#access_token=${w}`),window.location.href=k.toString()}return{createCheckout:U,updateCheckout:x,getCheckout:D,getEntitlements:c,getEntitlement:l,getEntitlementAccess:f,getContracts:u,getContract:s,getProfile:N,updateProfile:z,getSubscriptions:d,getBills:h,getBill:m,setUserMetadata:$,deleteUserMetadata:P,getUserMetadata:b,listUserMetadata:v,getTags:I,deleteTag:O,setTag:_,getTally:A,getTallies:M,deleteTally:F,pushTally:W,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:p,isSpotifyLinked:K,unlinkSpotify:Z,linkSpotify:Le,generateLink:E,openHostedAccountPage:V}}const cu="@sesamy/sesamy-js",di="1.19.1";function uu(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 Zr="undefined",lu="object",hi=function(){},fu="any",du="*",nt="__",Yr=typeof process<"u"?process:{};Yr.env&&Yr.env.NODE_ENV;var Y=typeof document<"u";Yr.versions!=null&&Yr.versions.node!=null,typeof Deno<"u"&&Deno.core,Y&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function hu(e,t){return t.charAt(0)[e]()+t.slice(1)}var Ww=hu.bind(null,"toUpperCase"),Vw=hu.bind(null,"toLowerCase");function Zw(e){return vu(e)?Ww("null"):typeof e=="object"?qw(e):Object.prototype.toString.call(e).slice(8,-1)}function Jr(e,t){t===void 0&&(t=!0);var r=Zw(e);return t?Vw(r):r}function ar(e,t){return typeof t===e}var te=ar.bind(null,"function"),He=ar.bind(null,"string"),Tt=ar.bind(null,"undefined"),Yw=ar.bind(null,"boolean");ar.bind(null,"symbol");function vu(e){return e===null}function Jw(e){return Jr(e)==="number"&&!isNaN(e)}function pu(e){return Jr(e)==="array"}function re(e){if(!Xw(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Xw(e){return e&&(typeof e=="object"||e!==null)}function qw(e){return te(e.constructor)?e.constructor.name:null}function Qw(e){return e instanceof Error||He(e.message)&&e.constructor&&Jw(e.constructor.stackTraceLimit)}function mu(e,t){if(typeof t!="object"||vu(t))return!1;if(t instanceof e)return!0;var r=Jr(new e(""));if(Qw(t))for(;t;){if(Jr(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}mu.bind(null,TypeError),mu.bind(null,SyntaxError);function Xr(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?eb(e,t):r}function eb(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function qr(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}qr(Xr,"form"),qr(Xr,"button"),qr(Xr,"input"),qr(Xr,"select");function tb(e){return e?pu(e)?e:[e]:[]}function gu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function rb(){if(Y){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function nb(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ab(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=gu(r[1]),o=gu(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 c in n){var l=c.split("[");l.length>1&&(ib(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n}(function(t){return Y&&window.location.search.substring(1)}())}function ib(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 Qr(){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 ob(e,t){var r,n,a,i=null,o=0,c=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var l=new Date;o||(o=l);var f=t-(l-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=l,a=e.apply(r,n)):i||(i=setTimeout(c,f)),a}}var ir="global",Et=nt+"global"+nt,Ot=typeof self===lu&&self.self===self&&self||typeof global===lu&&global.global===global&&global||void 0;function at(e){return Ot[Et][e]}function it(e,t){return Ot[Et][e]=t}function _t(e){delete Ot[Et][e]}function Rt(e,t,r){var n;try{if(vi(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Ot[Et]||(Ot[Et]={});var en={};function vi(e){if(typeof en[e]!==Zr)return en[e];try{var t=window[e];t.setItem(Zr,Zr),t.removeItem(Zr)}catch{return en[e]=!1}return en[e]=!0}function C(){return C=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},C.apply(this,arguments)}var Be="function",je="undefined",sb="@@redux/"+Math.random().toString(36),yu=function(){return typeof Symbol===Be&&Symbol.observable||"@@observable"}(),tn=" != "+Be;function wu(e,t,r){var n;if(typeof t===Be&&typeof r===je&&(r=t,t=void 0),typeof r!==je){if(typeof r!==Be)throw new Error("enhancer"+tn);return r(wu)(e,t)}if(typeof e!==Be)throw new Error("reducer"+tn);var a=e,i=t,o=[],c=o,l=!1;function f(){c===o&&(c=o.slice())}function u(){return i}function s(h){if(typeof h!==Be)throw new Error("Listener"+tn);var m=!0;return f(),c.push(h),function(){if(m){m=!1,f();var S=c.indexOf(h);c.splice(S,1)}}}function d(h){if(!re(h))throw new Error("Act != obj");if(typeof h.type===je)throw new Error("ActType "+je);if(l)throw new Error("Dispatch in reducer");try{l=!0,i=a(i,h)}finally{l=!1}for(var m=o=c,S=0;S<m.length;S++)(0,m[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:s,getState:u,replaceReducer:function(h){if(typeof h!==Be)throw new Error("next reducer"+tn);a=h,d({type:"@@redux/INIT"})}})[yu]=function(){var h,m=s;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(u())}return g(),{unsubscribe:m(g)}}})[yu]=function(){return this},h},n}function cb(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+je}function Ct(){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 ub(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),c=o.dispatch,l={getState:o.getState,dispatch:function(f){return c(f)}};return i=[].slice.call(e).map(function(f){return f(l)}),C({},o,{dispatch:c=Ct.apply(void 0,i)(o.dispatch)})}}}var Ke=nt+"anon_id",ot=nt+"user_id",jt=nt+"user_traits",Ge="userId",At="anonymousId",rn=["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"],pi=["name","EVENTS","config","loaded"],j=rn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),bu=/^utm_/,Su=/^an_prop_/,Iu=/^an_trait_/;function lb(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===j.bootstrap){var i=a.params,o=a.user,c=a.persistedUser,l=a.initialUser,f=c.userId===o.userId;c.anonymousId!==o.anonymousId&&t(Ke,o.anonymousId),f||t(ot,o.userId),l.traits&&t(jt,C({},f&&c.traits?c.traits:{},l.traits));var u=Object.keys(a.params);if(u.length){var s=i.an_uid,d=i.an_event,h=u.reduce(function(m,S){if(S.match(bu)||S.match(/^(d|g)clid/)){var g=S.replace(bu,"");m.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Su)&&(m.props[S.replace(Su,"")]=i[S]),S.match(Iu)&&(m.traits[S.replace(Iu,"")]=i[S]),m},{campaign:{},props:{},traits:{}});r.dispatch(C({type:j.params,raw:i},h,s?{userId:s}:{})),s&&setTimeout(function(){return e.identify(s,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:j.campaign,campaign:h.campaign})}}return n(a)}}}}function fb(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===j.setItemEnd){if(r.key===Ke)return C({},t,{anonymousId:r.value});if(r.key===ot)return C({},t,{userId:r.value})}switch(r.type){case j.identify:return Object.assign({},t,{userId:r.userId,traits:C({},t.traits,r.traits)});case j.reset:return[ot,Ke,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function $u(e){return{userId:e.getItem(ot),anonymousId:e.getItem(Ke),traits:e.getItem(jt)}}var mi=function(e){return nt+"TEMP"+nt+e};function db(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(c){var l=c.userId,f=c.traits,u=c.options;if(c.type===j.reset&&([ot,jt,Ke].forEach(function(h){n(h)}),[Ge,At,"traits"].forEach(function(h){_t(mi(h))})),c.type===j.identify){a(Ke)||r(Ke,Qr());var s=a(ot),d=a(jt)||{};s&&s!==l&&i.dispatch({type:j.userIdChanged,old:{userId:s,traits:d},new:{userId:l,traits:f},options:u}),l&&r(ot,l),f&&r(jt,C({},d,f))}return o(c)}}}}var or={};function ku(e,t){or[e]&&te(or[e])&&(or[e](t),delete or[e])}function Pu(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(C({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Pu(e,t,r-10).then(n,a)})})}function hb(e){return{abort:e}}function Tu(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,c=i.queue,l=i.user;if(!i.context.offline&&c&&c.actions&&c.actions.length){var f=c.actions.reduce(function(s,d,h){return o[d.plugin].loaded?(s.process.push(d),s.processIndex.push(h)):(s.requeue.push(d),s.requeueIndex.push(h)),s},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(s){var d=c.actions[s],h=d.plugin,m=d.payload.type,S=a[h][m];if(S&&te(S)){var g,$=function(v,I){return v===void 0&&(v={}),I===void 0&&(I={}),[Ge,At].reduce(function(O,_){return v.hasOwnProperty(_)&&I[_]&&I[_]!==v[_]&&(O[_]=I[_]),O},v)}(d.payload,l),P=n[$.meta.rid];if(!P&&(g=S({payload:$,config:o[h].config,instance:r,abort:hb}))&&re(g)&&g.abort)return void(n[$.meta.rid]=!0);if(!P){var b=m+":"+h;e.dispatch(C({},$,{type:b,_:{called:b,from:"queueDrain"}}))}}});var u=c.actions.filter(function(s,d){return!~f.processIndex.indexOf(d)});c.actions=u}}}var gi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,c=e.store,l=e.EVENTS;try{var f=a.plugins,u=a.context,s=r.type,d=s.match(Lt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var m=function(g,$){return function(P,b,v){var I=b.config,O=b.name,_=O+"."+P.type;v&&(_=v.event);var A=P.type.match(Lt)?function(M,F,W,L,N){return function(z,R){var K=L?L.name:M,Z=R&&sr(R)?R:W;if(L&&(!(Z=R&&sr(R)?R:[M]).includes(M)||Z.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(Z)+" input valid");return C({},N,{abort:{reason:z,plugins:Z,caller:F,_:K}})}}(O,_,$,v,P):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(P,_);return{payload:vb(P),instance:g,config:I||{},abort:A}}}(n,h),S=t.exact.reduce(function(g,$){var P=$.pluginName,b=$.methodName,v=!1;return b.match(/^initialize/)||b.match(/^reset/)||(v=!f[P].loaded),u.offline&&b.match(/^(page|track|identify)/)&&(v=!0),g[""+P]=v,g},{});return Promise.resolve(t.exact.reduce(function(g,$,P){try{var b=$.pluginName;return Promise.resolve(g).then(function(v){function I(){return Promise.resolve(v)}var O=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,A,M){try{return Promise.resolve(_).then(function(F){return A.method&&te(A.method)?(function(z,R){var K=Lu(z);if(K&&K.name===R){var Z=Lu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(Z?"or "+Z.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
+ `))}}(A.methodName,A.pluginName),Promise.resolve(A.method({payload:F,instance:n,abort:(W=F,L=b,N=A.pluginName,function(z,R){return C({},W,{abort:{reason:z,plugins:R||[L],caller:s,from:N||L}})}),config:_u(A.pluginName,f,i),plugins:f})).then(function(z){var R=re(z)?z:{};return Promise.resolve(C({},F,R))})):F;var W,L,N})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){v[b]=_});v[b]=r}();return O&&O.then?O.then(I):I()})}catch(v){return Promise.reject(v)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function($,P,b){try{var v=t.exact.length===b+1,I=P.pluginName,O=i[I];return Promise.resolve($).then(function(_){var A=g[I]?g[I]:{};if(d&&(A=_),wi(A,I))return yi({data:A,method:s,instance:n,pluginName:I,store:c}),Promise.resolve(_);if(wi(_,I))return v&&yi({data:_,method:s,instance:n,store:c}),Promise.resolve(_);if(S.hasOwnProperty(I)&&S[I]===!0)return c.dispatch({type:"queue",plugin:I,payload:A,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=m(g[I],i[I]);return Promise.resolve(O[s]({abort:M.abort,payload:A,instance:n,config:_u(I,f,i),plugins:f})).then(function(F){var W=re(F)?F:{},L=C({},_,W),N=g[I];if(wi(N,I))yi({data:N,method:s,instance:n,pluginName:I,store:c});else{var z=s+":"+I;(z.match(/:/g)||[]).length<2&&!s.match(Eu)&&!s.match(Ou)&&n.dispatch(C({},d?L:A,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function($){if(!(s.match(Lt)||s.match(/^registerPlugin/)||s.match(Ou)||s.match(Eu)||s.match(/^params/)||s.match(/^userIdChanged/))){if(l.plugins.includes(s),$._&&$._.originalAction===s)return $;var P=C({},$,{_:{originalAction:$.type,called:$.type,from:"engineEnd"}});ju($,t.exact.length)&&!s.match(/End$/)&&(P=C({},P,{type:$.type+"Aborted"})),c.dispatch(P)}return $})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Eu=/^bootstrap/,Ou=/^ready/;function yi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(C({},e.data,{type:r,_:{called:r,from:"abort"}}))}function _u(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ru(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Cu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function wi(e,t){var r=e.abort;return!!r&&(r===!0||Au(r,t)||r&&Au(r.plugins,t))}function ju(e,t){var r=e.abort;if(!r)return!1;if(r===!0||He(r))return!0;var n=r.plugins;return sr(r)&&r.length===t||sr(n)&&n.length===t}function sr(e){return Array.isArray(e)}function Au(e,t){return!(!e||!sr(e))&&e.includes(t)}function Lu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function vb(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=re(e[r])?Object.assign({},e[r]):e[r]),t},{})}function pb(e,t,r){var n={};return function(a){return function(i){return function(o){try{var c,l=function(v){return c?v:i(s)},f=o.type,u=o.plugins,s=o;if(o.abort)return Promise.resolve(i(o));if(f===j.enablePlugin&&a.dispatch({type:j.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),f===j.disablePlugin&&setTimeout(function(){return ku(o.meta.rid,{payload:o})},0),f===j.initializeEnd){var d=t(),h=Object.keys(d),m=h.filter(function(v){return u.includes(v)}).map(function(v){return d[v]}),S=[],g=[],$=o.disabled,P=m.map(function(v){var I=v.loaded,O=v.name,_=v.config;return Pu(v,function(){return I({config:_})},1e4).then(function(A){return n[O]||(a.dispatch({type:j.pluginReadyType(O),name:O,events:Object.keys(v).filter(function(M){return!pi.includes(M)})}),n[O]=!0),S=S.concat(O),v}).catch(function(A){if(A instanceof Error)throw new Error(A);return g=g.concat(A.name),A})});Promise.all(P).then(function(v){var I={plugins:S,failed:g,disabled:$};setTimeout(function(){h.length===P.length+$.length&&a.dispatch(C({},{type:j.ready},I))},0)})}var b=function(){if(f!==j.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Tu(a,t,e)},0),Promise.resolve(function(v,I,O,_,A){try{var M=te(I)?I():I,F=v.type,W=F.replace(Lt,"");if(v._&&v._.called)return Promise.resolve(v);var L=O.getState(),N=(K=M,(Z=L.plugins)===void 0&&(Z={}),(Le=v.options)===void 0&&(Le={}),Object.keys(K).filter(function(p){var y=Le.plugins||{};return Yw(y[p])?y[p]:y.all!==!1&&(!Z[p]||Z[p].enabled!==!1)}).map(function(p){return K[p]}));F===j.initializeStart&&v.fromEnable&&(N=Object.keys(L.plugins).filter(function(p){var y=L.plugins[p];return v.plugins.includes(p)&&!y.initialized}).map(function(p){return M[p]}));var z=N.map(function(p){return p.name}),R=function(p,y,E){var U=Cu(p).map(function(x){return Ru(x,y)});return y.reduce(function(x,D){var V=D.name,w=Cu(p,V).map(function(ne){return Ru(ne,y)}),k=w[0],T=w[1],H=w[2];return k.length&&(x.beforeNS[V]=k),T.length&&(x.duringNS[V]=T),H.length&&(x.afterNS[V]=H),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(gi({action:v,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(p){function y(){var x=function(){if(F.match(Lt))return Promise.resolve(gi({action:C({},E,{type:W+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(D){D.meta&&D.meta.hasCallback&&ku(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return p}):p}if(ju(p,z.length))return p;var E,U=function(){if(F!==W)return Promise.resolve(gi({action:C({},p,{type:W}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(x){E=x});E=p}();return U&&U.then?U.then(y):y()})}catch(p){return Promise.reject(p)}var K,Z,Le}(o,t,e,a,r)).then(function(v){return c=1,i(v)})}();return Promise.resolve(b&&b.then?b.then(l):l(b))}catch(v){return Promise.reject(v)}}}}}function mb(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,c=n.options;if(a===j.setItem||a===j.removeItem){if(n.abort)return r(n);a===j.setItem?e.setItem(i,o,c):e.removeItem(i,c)}return r(n)}}}}var gb=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(c){return r.dispatch(c)}},o=e[t].map(function(c){return c(i)});return Ct.apply(void 0,o)(n)(a)}}}}};function yb(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=Uu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,c=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:c}),config:c},C({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=Uu(r.type,j.initialize),f=e()[l];return f&&l?(n[l]=C({},t[l],{initialized:!0,loaded:!!f.loaded({config:f.config})}),C({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=C({},t[r.name],{loaded:!0}),C({},t,n);switch(r.type){case j.disablePlugin:return C({},t,xu(r.plugins,!1,t));case j.enablePlugin:return C({},t,xu(r.plugins,!0,t));default:return t}}}function Uu(e,t){return e.substring(t.length+1,e.length)}function xu(e,t,r){return e.reduce(function(n,a){return n[a]=C({},r[a],{enabled:t}),n},r)}function Nu(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var wb={last:{},history:[]};function bb(e,t){e===void 0&&(e=wb);var r=t.options,n=t.meta;if(t.type===j.track){var a=Nu(C({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return C({},e,{last:a,history:e.history.concat(a)})}return e}var Sb={actions:[]};function Ib(e,t){e===void 0&&(e=Sb);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===j.identify?[t].concat(e.actions):e.actions.concat(t),C({},e,{actions:n});case"dequeue":return[];default:return e}}var Du=/#.*$/;function $b(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Du,""):"")}var Mu,Fu,zu,Hu,kb=function(e){if(e===void 0&&(e={}),!Y)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,c=a.innerHeight,l=i.hash,f=i.search,u=function(d){var h=function(){if(Y){for(var m,S=document.getElementsByTagName("link"),g=0;m=S[g];g++)if(m.getAttribute("rel")==="canonical")return m.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(Du,"")}(f),s={title:r,url:u,path:$b(u),hash:l,search:f,width:o,height:c};return n&&n!==""&&(s.referrer=n),C({},s,e)},Pb={last:{},history:[]};function Tb(e,t){e===void 0&&(e=Pb);var r=t.options;if(t.type===j.page){var n=Nu(C({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return C({},e,{last:n,history:e.history.concat(n)})}return e}Mu=function(){if(!Y)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"}(),Fu=Y?document.referrer:null,zu=rb(),Hu=nb();var Bu={initialized:!1,sessionId:Qr(),app:null,version:null,debug:!1,offline:!!Y&&!navigator.onLine,os:{name:Mu},userAgent:Y?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Hu,locale:zu,campaign:{},referrer:Fu};function Eb(e,t){e===void 0&&(e=Bu);var r=e.initialized,n=t.campaign;switch(t.type){case j.campaign:return C({},e,{campaign:n});case j.offline:return C({},e,{offline:!0});case j.online:return C({},e,{offline:!1});default:return r?e:C({},Bu,e,{initialized:!0})}}var Ob=["plugins","reducers","storage"];function _b(e,t,r){if(Y){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function Rb(e){var t=_b.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Ku(){return it("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 Ot[Et].analytics.push(o.action||o),i(o)}})}}}function Gu(e){return function(){return Ct(Ct.apply(null,arguments),Ku())}}function bi(e){return e?pu(e)?e:[e]:[]}function Wu(e,t,r){e===void 0&&(e={});var n,a,i=Qr();return t&&(or[i]=(n=t,a=function(o){for(var c,l=o||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(te(l[f])){c=l[f];break}return c}(r),function(o){a&&a(o),n(o)})),C({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function Cb(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(p,y){if(te(y))return p.middlewares=p.middlewares.concat(y),p;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var E=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];p.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(p.methods[y.name]=Object.keys(y.methods).reduce(function(D,V){var w;return D[V]=(w=y.methods[V],function(){for(var k=Array.prototype.slice.call(arguments),T=new Array(w.length),H=0;H<k.length;H++)T[H]=k[H];return T[T.length]=I,w.apply({instance:I},T)}),D},{}),delete y.methods);var U=Object.keys(y).concat(E),x=new Set(p.events.concat(U));if(p.events=Array.from(x),p.pluginsArray=p.pluginsArray.concat(y),p.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return p.plugins[y.name]=y,p.plugins[y.name].loaded||(p.plugins[y.name].loaded=function(){return!0}),p},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:at,setItem:it,removeItem:_t},i=function(p){return function(y,E,U){return E.getState("user")[y]||(U&&re(U)&&U[y]?U[y]:$u(p)[y]||at(mi(y))||null)}}(a),o=n.plugins,c=n.events.filter(function(p){return!pi.includes(p)}).sort(),l=new Set(c.concat(rn).filter(function(p){return!pi.includes(p)})),f=Array.from(l).sort(),u=function(){return o},s=new gb,d=s.addMiddleware,h=s.removeMiddleware,m=s.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=ab(),$=$u(a),P=C({},$,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});P.anonymousId||(P.anonymousId=Qr());var b=C({enable:function(p,y){return new Promise(function(E){R.dispatch({type:j.enablePlugin,plugins:bi(p),_:{originalAction:j.enablePlugin}},E,[y])})},disable:function(p,y){return new Promise(function(E){R.dispatch({type:j.disablePlugin,plugins:bi(p),_:{originalAction:j.disablePlugin}},E,[y])})}},n.methods),v=!1,I={identify:function(p,y,E,U){try{var x=He(p)?p:null,D=re(p)?p:y,V=E||{},w=I.user();it(mi(Ge),x);var k=x||D.userId||i(Ge,I,D);return Promise.resolve(new Promise(function(T){R.dispatch(C({type:j.identifyStart,userId:k,traits:D||{},options:V,anonymousId:w.anonymousId},w.id&&w.id!==x&&{previousId:w.id}),T,[y,E,U])}))}catch(T){return Promise.reject(T)}},track:function(p,y,E,U){try{var x=re(p)?p.event:p;if(!x||!He(x))throw new Error("EventMissing");var D=re(p)?p:y||{},V=re(E)?E:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:j.trackStart,event:x,properties:D,options:V,userId:i(Ge,I,y),anonymousId:i(At,I,y)},w,[y,E,U])}))}catch(w){return Promise.reject(w)}},page:function(p,y,E){try{var U=re(p)?p:{},x=re(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:j.pageStart,properties:kb(U),options:x,userId:i(Ge,I,U),anonymousId:i(At,I,U)},D,[p,y,E])}))}catch(D){return Promise.reject(D)}},user:function(p){if(p===Ge||p==="id")return i(Ge,I);if(p===At||p==="anonId")return i(At,I);var y=I.getState("user");return p?uu(y,p):y},reset:function(p){return new Promise(function(y){R.dispatch({type:j.resetStart},y,p)})},ready:function(p){return v&&p({plugins:b,instance:I}),I.on(j.ready,function(y){p(y),v=!0})},on:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".on disabled for "+p);var E=/Start$|Start:/;if(p==="*"){var U=function(w){return function(k){return function(T){return T.type.match(E)&&y({payload:T,instance:I,plugins:o}),k(T)}}},x=function(w){return function(k){return function(T){return T.type.match(E)||y({payload:T,instance:I,plugins:o}),k(T)}}};return d(U,nn),d(x,an),function(){h(U,nn),h(x,an)}}var D=p.match(E)?nn:an,V=function(w){return function(k){return function(T){return T.type===p&&y({payload:T,instance:I,plugins:o,abort:S}),k(T)}}};return d(V,D),function(){return h(V,D)}},once:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".once disabled for "+p);var E=I.on(p,function(U){y({payload:U.payload,instance:I,plugins:o,abort:S}),E()});return E},getState:function(p){var y=R.getState();return p?uu(y,p):Object.assign({},y)},dispatch:function(p){var y=He(p)?{type:p}:p;if(rn.includes(y.type))throw new Error("reserved action "+y.type);var E=C({},y,{_:C({originalAction:y.type},p._||{})});R.dispatch(E)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(p,y,E){R.dispatch({type:j.setItemStart,key:p,value:y,options:E})},removeItem:function(p,y){R.dispatch({type:j.removeItemStart,key:p,options:y})}},setAnonymousId:function(p,y){I.storage.setItem(Ke,p,y)},events:{core:rn,plugins:c}},O=n.middlewares.concat([function(p){return function(y){return function(E){return E.meta||(E.meta=Wu()),y(E)}}},m(nn),pb(I,u,{all:f,plugins:c}),mb(a),lb(I),db(I),m(an)]),_={context:Eb,user:fb(a),page:Tb,track:bb,plugins:yb(u),queue:Ib},A=Ct,M=Ct;if(Y&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(A=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Ku():re(typeof arguments[0])?Gu():Gu().apply(null,arguments)}}var W,L=function(p){return Object.keys(p).reduce(function(y,E){return Ob.includes(E)||(y[E]=p[E]),y},{})}(e),N=n.pluginsArray.reduce(function(p,y){var E=y.name,U=y.config,x=y.loaded,D=n.pluginEnabled[E];return p[E]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!x({config:U}),config:U},p},{}),z={context:L,user:P,plugins:N},R=wu(function(p){for(var y=Object.keys(p),E={},U=0;U<y.length;U++){var x=y[U];typeof p[x]===Be&&(E[x]=p[x])}var D,V=Object.keys(E);try{(function(w){Object.keys(w).forEach(function(k){var T=w[k];if(typeof T(void 0,{type:"@@redux/INIT"})===je||typeof T(void 0,{type:sb})===je)throw new Error("reducer "+k+" "+je)})})(E)}catch(w){D=w}return function(w,k){if(w===void 0&&(w={}),D)throw D;for(var T=!1,H={},ne=0;ne<V.length;ne++){var We=V[ne],Sl=w[We],Ci=(0,E[We])(Sl,k);if(typeof Ci===je){var bS=cb(We,k);throw new Error(bS)}H[We]=Ci,T=T||Ci!==Sl}return T?H:w}}(C({},_,t)),z,M(A(ub.apply(void 0,O))));R.dispatch=(W=R.dispatch,function(p,y,E){var U=C({},p,{meta:Wu(p.meta,y,bi(E))});return W.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:j.bootstrap,plugins:K,config:L,params:g,user:P,initialUser:r,persistedUser:$});var Z=K.filter(function(p){return n.pluginEnabled[p]}),Le=K.filter(function(p){return!n.pluginEnabled[p]});return R.dispatch({type:j.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(p,y){var E=p.bootstrap,U=p.config,x=p.name;E&&te(E)&&E({instance:I,config:U,payload:p}),R.dispatch({type:j.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:p}),n.pluginsArray.length===y+1&&R.dispatch({type:j.initializeStart,plugins:Z,disabled:Le})}),Rb(function(p){R.dispatch({type:p?j.offline:j.online})}),function(p,y,E){setInterval(function(){return Tu(p,y,E)},3e3)}(R,u,I),I}var nn="before",an="after",cr="cookie",st=Yu(),Vu=on,jb=on;function Zu(e){return st?on(e,"",-1):_t(e)}function Yu(){if(st!==void 0)return st;var e="cookiecookie";try{on(e,e),st=document.cookie.indexOf(e)!==-1,Zu(e)}catch{st=!1}return st}function on(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return st===!1&&(o?it(e,t):at(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 ur="localStorage",Ab=vi.bind(null,"localStorage");Rt("localStorage","getItem",at),Rt("localStorage","setItem",it),Rt("localStorage","removeItem",_t);var lr="sessionStorage",Lb=vi.bind(null,"sessionStorage");Rt("sessionStorage","getItem",at),Rt("sessionStorage","setItem",it),Rt("sessionStorage","removeItem",_t);function Ut(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(re(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var Ub=Ab(),xb=Lb(),Nb=Yu();function Ju(e,t){if(e){var r=Si(t),n=!Pi(r),a=Ii(r)?Ut(localStorage.getItem(e)):void 0;if(n&&!Tt(a))return a;var i=$i(r)?Ut(Vu(e)):void 0;if(n&&i)return i;var o=ki(r)?Ut(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var c=at(e);return n?c:{localStorage:a,sessionStorage:o,cookie:i,global:c}}}function Db(e,t,r){if(e&&!Tt(t)){var n={},a=Si(r),i=JSON.stringify(t),o=!Pi(a);return Ii(a)&&(n[ur]=cn(ur,t,Ut(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[ur]:$i(a)&&(n[cr]=cn(cr,t,Ut(Vu(e))),jb(e,i),o)?n[cr]:ki(a)&&(n[lr]=cn(lr,t,Ut(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[lr]:(n[ir]=cn(ir,t,at(e)),it(e,t),o?n[ir]:n)}}function Mb(e,t){if(e){var r=Si(t),n=Ju(e,du),a={};return!Tt(n.localStorage)&&Ii(r)&&(localStorage.removeItem(e),a[ur]=n.localStorage),!Tt(n.cookie)&&$i(r)&&(Zu(e),a[cr]=n.cookie),!Tt(n.sessionStorage)&&ki(r)&&(sessionStorage.removeItem(e),a[lr]=n.sessionStorage),!Tt(n.global)&&sn(r,ir)&&(_t(e),a[ir]=n.global),a}}function Si(e){return e?He(e)?e:e.storage:fu}function Ii(e){return Ub&&sn(e,ur)}function $i(e){return Nb&&sn(e,cr)}function ki(e){return xb&&sn(e,lr)}function Pi(e){return e===du||e==="all"}function sn(e,t){return e===fu||e===t||Pi(e)}function cn(e,t,r){return{location:e,current:t,previous:r}}var Fb={setItem:Db,getItem:Ju,removeItem:Mb};function zb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xu(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 qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(r),!0).forEach(function(n){zb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:Fb};return Cb(qu(qu({},t),e))}function Bb(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),c()}function c(){r=setInterval(o,t.interval||1e4)}return c(),{flush:o,push:function(l){return n=a.push(l),n>=i&&o(),n},size:function(){return a.length},end:function(l){l&&o(),clearInterval(r)}}}function Kb(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 c=r[o];r[o]=function(...l){var s;const f=((s=l[2])==null?void 0:s.toString())||"",u=Wb(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),c.apply(r,l)}})}function Gb(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function Wb(e){return["#","?"].forEach(t=>e=Gb(e,t)),e}function Vb(){Kb(()=>{Ae.page()})}function Zb(e){if(e===void 0&&(e={}),!Y)return hi;var t=el(),r=Ti(),n=Qu(),a=un(n,t),i=un(r,t),o=[],c=[],l=[],f=n,u=a,s=i,d=Object.keys(e);if(!d.length)return hi;var h=d.map(function(S){return Number(S)}),m=ob(function(){var S=el(),g=function(L,N){return N.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),$=Ti(),P=Qu(),b=un(P,S),v=un($,S);if(u=b>u?b:u,s=v<s?v:s,!(o.length>=h.length)){var I=f===P,O="up";I?O="initial":f<=P&&(O="down");var _=g,A=h;(O==="up"||I)&&(_=g.slice().reverse(),A=h.slice().reverse());var M=A.reduce(function(L,N,z){var R=_[z];return l.includes(N)&&P<=R&&(l=l.filter(function(K){return K!==N}),L.singleFunction=N),O==="down"&&!o.includes(N)&&P>=R&&N>i?(c.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!o.includes(N)&&P<=R&&N<=b?(L.foundFunc=[N],L):(I&&P>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!c.includes(N)&&P>=R&&(c.push(N),L.singleFunction?l.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=P,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){te(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,W=M.direction;te(e[F])&&e[F]({trigger:F,direction:W,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(F)}}},500);return window.addEventListener("scroll",m),function(){return window.removeEventListener("scroll",m)}}function Ti(){return Y?document.body.scrollTop||document.documentElement.scrollTop:0}function Yb(){return Y?window.innerHeight||document.documentElement.clientHeight:0}function Qu(){return Math.round(Ti()+Yb())}function el(){if(!Y)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function un(e,t){return Math.round(e/t*100)}var tl="EventListener";function Jb(e){return function(t,r,n,a){var i=n||hi,o=a||!1;if(!Y)return i;var c=ln(r),l=ln(t,!0);if(!l.length)throw new Error("noElements");if(!c.length)throw new Error("noEvent");var f=[];return function u(s){s&&(f=[]);for(var d=s?"add"+tl:"remove"+tl,h=0;h<l.length;h++){var m=l[h];f[h]=s?o&&o.once?Xb(i):i:f[h]||i;for(var S=0;S<c.length;S++)m[d]?m["on"+c[S]]=s?f[h]:null:m[d](c[S],f[h],o)}return u.bind(null,!s)}(e)}}function ln(e,t){if(He(e))return t?ln(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=tb(e);return t?i.map(function(o){return He(o)?ln(o,!0):o}).flat():i}function Xb(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ei=Jb("Event");function rl(e,t){return Y&&te(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),te(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}rl.bind(null,"onerror"),rl.bind(null,"onload");var nl=typeof window>"u",al="hidden";function qb(e){if(nl)return!1;var t=Qb(),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 Qb(){var e=["webkit","moz","ms","o"];return nl||al in document?al:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var eS=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function tS(e,t){t===void 0&&(t={});var r=function(o,c){var l=this,f=!1;return function(u){f||(o.call(l,u),f=!0,setTimeout(function(){return f=!1},c))}}(e,t.throttle||1e4),n=[];function a(){var o=qb(function(c){c||r({type:"tabVisible"})});return n=[o].concat(eS.map(function(c){return Ei(document,c,r)})).concat(Ei(window,"load",r)).concat(Ei(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function rS(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,c=o===void 0?1e4:o,l=e.throttle,f=l===void 0?2e3:l,u=!1,s=!1,d=new Date,h=function(){return clearTimeout(t)};function m(g){h(),i&&!u&&i(fr(d),g),a&&u&&(u=!1,a(fr(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(fr(d),g))},c)}var S=tS(m,{throttle:f});return{disable:function(){s=!0,u=!1,h();var g=S();return function(){return s=!1,d=new Date,m({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:s,active:u?0:fr(d,s),idle:u?fr(r,s):0}}}}function fr(e,t){return t?0:Math.round((new Date-e)/1e3)}const il=5e3;class nS{constructor(t){ve(this,"element");ve(this,"isInViewport",!1);ve(this,"isAwake",!1);ve(this,"isFlushing");ve(this,"observer");ve(this,"lastEventAt",Date.now());ve(this,"registeredView",!1);ve(this,"viewCallback");ve(this,"activeDurationCallback");ve(this,"idleDurationCallback");ve(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),rS({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:il}),Zb({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*il: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 ol="sesamy_session_id";function aS(){let e=sessionStorage.getItem(ol);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ol,e)),e}let sl=!1,Oi,cl,fn;function iS({clientId:e,enabled:t=!0,environment:r}){if(Oi=e,cl=t,fn=`${ze("logs",r)}/events`,!cl)return;Vb();const n=new nS({element:document.body,viewCallback:()=>{Ae.page()},activeDurationCallback:(a,i,o)=>{Ae.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Ae.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Ae.track("scroll",{scroll:a.scrollMax})}});cS(document.body,()=>{n.flush()}),uS(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(we.AUTHENTICATED,async a=>{const i=a;await Ae.identify(i.detail.sub)}),window.addEventListener(we.LOGOUT,async()=>{await Ae.track("logout",{}),_i.flush(),await Ae.reset()})}function ul(e){return JSON.stringify(e.map(t=>({...t,clientId:Oi,requestId:Math.random().toString(36).slice(2,9),sessionId:aS(),timestamp:new Date().toISOString(),version:di,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:cu,userAgent:navigator.userAgent,clientId:Oi}})))}const _i=Bb(async e=>{if(e.length>0){const t=ul(e);sl?navigator.sendBeacon(fn,t):(await fetch(fn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ri(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(fn,ul([r]))}else _i.push(e)}const Ae=Hb({app:cu,version:di,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ri({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function oS(e,t){Ae.track(e,t)}function sS(){return sl=!0,_i.flush()}const ll=new Map;function cS(e,t){ll.set(e,t)}window.addEventListener("beforeunload",()=>{ll.forEach((e,t)=>{e.bind(t)()}),sS()});const fl=new Map;function uS(e,t){fl.set(e,t)}window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&fl.forEach((e,t)=>{e.bind(t)()})});const dl="sesamySignedURLs";function hl(){const e=sessionStorage.getItem(dl);return e?JSON.parse(e):[]}function lS(e){const t=hl();t.push(e),sessionStorage.setItem(dl,JSON.stringify(t))}function fS(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:c,getContract:l,getContracts:f,getBill:u,getBills:s,getTransaction:d,getTransactions:h,getProfile:m,updateProfile:S,getTags:g,deleteTag:$,setTag:P,getUserMetadata:b,listUserMetadata:v,setUserMetadata:I,deleteUserMetadata:O,getTally:_,getTallies:A,pushTally:M,deleteTally:F,getProduct:W,getPaymentIssues:L,isSpotifyLinked:N,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:K,openHostedAccountPage:Z,generateLink:Le}=Gw(e),p={auth:{getUser:m,isAuthenticated:li,loginWithRedirect:fi,logout:Xc,setToken:Qc},checkouts:{get:r,create:t,update:n},profile:{get:m,update:S,openHostedAccountPage:Z,isSpotifyLinked:N,unlinkSpotify:z},analytics:{track:oS},tags:{list:g,set:P,delete:$},entitlements:{get:a,list:i,access:o,signedLinks:hl},contracts:{get:l,list:f},bills:{get:u,list:s},userMetadata:{get:b,list:v,set:I,delete:O},tallies:{get:_,list:A,push:M,delete:F},subscriptions:{list:c},transactions:{get:d,list:h},products:{get:W,autoOnboard:K,linkSpotify:R},getVersion:dS,getPaymentIssues:L,generateLink:Le,clearCache:be};return e.namespace&&(window[e.namespace]=p),p}function dS(){return di}async function hS({enabled:e=!1,rules:t}){if(!e)return;const r=await li(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML+=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML+=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function vl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function vS(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Qc(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const pl="sesamy-refresh",ml="force-refetch-entitlements";function pS(){const e=new URLSearchParams(window.location.search),t=e.get(ml),r=e.get(pl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ml),e.delete(pl),n.search=e.toString(),be(),window.history.replaceState(null,"",n)}}function mS(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;lS({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const gl="sesamy-user";async function gS(){const t=new URLSearchParams(window.location.search).get(gl);if(!t)return;const r=await jw();(r==null?void 0:r.email)!==t&&(be(),fi({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(gl),window.history.replaceState(null,"",n)}const yl="sesamy-purchase";function yS(){const e=new URLSearchParams(window.location.search),t=e.get(yl);if(t!==null){const r=new URL(window.location.href);e.delete(yl),r.search=e.toString(),Fe(we.PURCHASE,{itemSrc:t}),be(),window.history.replaceState(null,"",r)}}const wl="sesamy-login";async function wS(){if(!new URLSearchParams(window.location.search).get(wl))return;await li()||fi();const n=new URL(window.location.href);n.searchParams.delete(wl),window.history.replaceState(null,"",n)}async function bl(e){iS({clientId:e.clientId,environment:e.environment,...e.analytics}),await Cw({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await hS(e.transform);const t=fS({clientId:e.clientId,environment:e.environment,...e.api});return Fe(we.READY,{}),vS(),pS(),mS(),await wS(),await gS(),yS(),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);bl(t)}catch(t){console.error("Failed to parse config",t)}}return Ee.init=bl,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"}),Ee}({});