@sesamy/sesamy-js 1.19.4 → 1.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +2797 -2307
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var _l=Object.defineProperty;var Rl=(e,t,r)=>t in e?_l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var oe=(e,t,r)=>Rl(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ne=function(e){try{return!!e()}catch{return!0}},Cl=ne,za=!Cl(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),lc=za,fc=Function.prototype,fa=fc.call,jl=lc&&fc.bind.bind(fa,fa),K=lc?jl:function(e){return function(){return fa.apply(e,arguments)}},dc=K,Al=dc({}.toString),Ll=dc("".slice),Ha=function(e){return Ll(Al(e),8,-1)},Ul=K,xl=ne,Nl=Ha,dn=Object,Dl=Ul("".split),hc=xl(function(){return!dn("z").propertyIsEnumerable(0)})?function(e){return Nl(e)==="String"?Dl(e,""):dn(e)}:dn,Ba=function(e){return e==null},Ml=Ba,Fl=TypeError,Yr=function(e){if(Ml(e))throw new Fl("Can't call method on "+e);return e},zl=hc,Hl=Yr,nr=function(e){return zl(Hl(e))},Lt=function(e){return e&&e.Math===Math&&e},Q=Lt(typeof globalThis=="object"&&globalThis)||Lt(typeof window=="object"&&window)||Lt(typeof self=="object"&&self)||Lt(typeof lr=="object"&&lr)||Lt(typeof lr=="object"&&lr)||function(){return this}()||Function("return this")(),vc={exports:{}},Bl=!1,Li=Q,Kl=Object.defineProperty,Ka=function(e,t){try{Kl(Li,e,{value:t,configurable:!0,writable:!0})}catch{Li[e]=t}return t},Gl=Q,Wl=Ka,Ui="__core-js_shared__",xi=vc.exports=Gl[Ui]||Wl(Ui,{});(xi.versions||(xi.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 Ga=vc.exports,Ni=Ga,pc=function(e,t){return Ni[e]||(Ni[e]=t||{})},Vl=Yr,Zl=Object,Jr=function(e){return Zl(Vl(e))},Yl=K,Jl=Jr,Xl=Yl({}.hasOwnProperty),we=Object.hasOwn||function(t,r){return Xl(Jl(t),r)},ql=K,Ql=0,ef=Math.random(),tf=ql(1 .toString),mc=function(e){return"Symbol("+(e===void 0?"":e)+")_"+tf(++Ql+ef,36)},rf=typeof navigator<"u"&&String(navigator.userAgent)||"",gc=Q,hn=rf,Di=gc.process,Mi=gc.Deno,Fi=Di&&Di.versions||Mi&&Mi.version,zi=Fi&&Fi.v8,me,Nr;zi&&(me=zi.split("."),Nr=me[0]>0&&me[0]<4?1:+(me[0]+me[1]));!Nr&&hn&&(me=hn.match(/Edge\/(\d+)/),(!me||me[1]>=74)&&(me=hn.match(/Chrome\/(\d+)/),me&&(Nr=+me[1])));var nf=Nr,Hi=nf,af=ne,of=Q,sf=of.String,yc=!!Object.getOwnPropertySymbols&&!af(function(){var e=Symbol("symbol detection");return!sf(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Hi&&Hi<41}),cf=yc,wc=cf&&!Symbol.sham&&typeof Symbol.iterator=="symbol",uf=Q,lf=pc,Bi=we,ff=mc,df=yc,hf=wc,vt=uf.Symbol,vn=lf("wks"),vf=hf?vt.for||vt:vt&&vt.withoutSetter||ff,de=function(e){return Bi(vn,e)||(vn[e]=df&&Bi(vt,e)?vt[e]:vf("Symbol."+e)),vn[e]},pn=typeof document=="object"&&document.all,Y=typeof pn>"u"&&pn!==void 0?function(e){return typeof e=="function"||e===pn}:function(e){return typeof e=="function"},pf=Y,je=function(e){return typeof e=="object"?e!==null:pf(e)},mf=je,gf=String,yf=TypeError,He=function(e){if(mf(e))return e;throw new yf(gf(e)+" is not an object")},bc={},wf=ne,J=!wf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),bf=J,Sf=ne,Sc=bf&&Sf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ke={},If=Q,Ki=je,da=If.document,$f=Ki(da)&&Ki(da.createElement),Wa=function(e){return $f?da.createElement(e):{}},kf=J,Pf=ne,Tf=Wa,Ic=!kf&&!Pf(function(){return Object.defineProperty(Tf("div"),"a",{get:function(){return 7}}).a!==7}),Ef=za,fr=Function.prototype.call,Pe=Ef?fr.bind(fr):function(){return fr.apply(fr,arguments)},mn=Q,Of=Y,_f=function(e){return Of(e)?e:void 0},Ot=function(e,t){return arguments.length<2?_f(mn[e]):mn[e]&&mn[e][t]},Rf=K,$c=Rf({}.isPrototypeOf),Cf=Ot,jf=Y,Af=$c,Lf=wc,Uf=Object,kc=Lf?function(e){return typeof e=="symbol"}:function(e){var t=Cf("Symbol");return jf(t)&&Af(t.prototype,Uf(e))},xf=String,Pc=function(e){try{return xf(e)}catch{return"Object"}},Nf=Y,Df=Pc,Mf=TypeError,Xr=function(e){if(Nf(e))return e;throw new Mf(Df(e)+" is not a function")},Ff=Xr,zf=Ba,Va=function(e,t){var r=e[t];return zf(r)?void 0:Ff(r)},gn=Pe,yn=Y,wn=je,Hf=TypeError,Bf=function(e,t){var r,n;if(t==="string"&&yn(r=e.toString)&&!wn(n=gn(r,e))||yn(r=e.valueOf)&&!wn(n=gn(r,e))||t!=="string"&&yn(r=e.toString)&&!wn(n=gn(r,e)))return n;throw new Hf("Can't convert object to primitive value")},Kf=Pe,Gi=je,Wi=kc,Gf=Va,Wf=Bf,Vf=de,Zf=TypeError,Yf=Vf("toPrimitive"),Jf=function(e,t){if(!Gi(e)||Wi(e))return e;var r=Gf(e,Yf),n;if(r){if(t===void 0&&(t="default"),n=Kf(r,e,t),!Gi(n)||Wi(n))return n;throw new Zf("Can't convert object to primitive value")}return t===void 0&&(t="number"),Wf(e,t)},Xf=Jf,qf=kc,Tc=function(e){var t=Xf(e,"string");return qf(t)?t:t+""},Qf=J,ed=Ic,td=Sc,dr=He,Vi=Tc,rd=TypeError,bn=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,Sn="enumerable",In="configurable",$n="writable";ke.f=Qf?td?function(t,r,n){if(dr(t),r=Vi(r),dr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&$n in n&&!n[$n]){var a=nd(t,r);a&&a[$n]&&(t[r]=n.value,n={configurable:In in n?n[In]:a[In],enumerable:Sn in n?n[Sn]:a[Sn],writable:!1})}return bn(t,r,n)}:bn:function(t,r,n){if(dr(t),r=Vi(r),dr(n),ed)try{return bn(t,r,n)}catch{}if("get"in n||"set"in n)throw new rd("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var ad=Math.ceil,id=Math.floor,od=Math.trunc||function(t){var r=+t;return(r>0?id:ad)(r)},sd=od,Za=function(e){var t=+e;return t!==t||t===0?0:sd(t)},cd=Za,ud=Math.max,ld=Math.min,fd=function(e,t){var r=cd(e);return r<0?ud(r+t,0):ld(r,t)},dd=Za,hd=Math.min,vd=function(e){var t=dd(e);return t>0?hd(t,9007199254740991):0},pd=vd,Ec=function(e){return pd(e.length)},md=nr,gd=fd,yd=Ec,Zi=function(e){return function(t,r,n){var a=md(t),i=yd(a);if(i===0)return!e&&-1;var o=gd(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}},wd={includes:Zi(!0),indexOf:Zi(!1)},Ya={},bd=K,kn=we,Sd=nr,Id=wd.indexOf,$d=Ya,Yi=bd([].push),Oc=function(e,t){var r=Sd(e),n=0,a=[],i;for(i in r)!kn($d,i)&&kn(r,i)&&Yi(a,i);for(;t.length>n;)kn(r,i=t[n++])&&(~Id(a,i)||Yi(a,i));return a},Ja=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kd=Oc,Pd=Ja,_c=Object.keys||function(t){return kd(t,Pd)},Td=J,Ed=Sc,Od=ke,_d=He,Rd=nr,Cd=_c;bc.f=Td&&!Ed?Object.defineProperties:function(t,r){_d(t);for(var n=Rd(r),a=Cd(r),i=a.length,o=0,c;i>o;)Od.f(t,c=a[o++],n[c]);return t};var jd=Ot,Ad=jd("document","documentElement"),Ld=pc,Ud=mc,Ji=Ld("keys"),Xa=function(e){return Ji[e]||(Ji[e]=Ud(e))},xd=He,Nd=bc,Xi=Ja,Dd=Ya,Md=Ad,Fd=Wa,zd=Xa,qi=">",Qi="<",ha="prototype",va="script",Rc=zd("IE_PROTO"),Pn=function(){},Cc=function(e){return Qi+va+qi+e+Qi+"/"+va+qi},eo=function(e){e.write(Cc("")),e.close();var t=e.parentWindow.Object;return e=null,t},Hd=function(){var e=Fd("iframe"),t="java"+va+":",r;return e.style.display="none",Md.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Cc("document.F=Object")),r.close(),r.F},hr,Cr=function(){try{hr=new ActiveXObject("htmlfile")}catch{}Cr=typeof document<"u"?document.domain&&hr?eo(hr):Hd():eo(hr);for(var e=Xi.length;e--;)delete Cr[ha][Xi[e]];return Cr()};Dd[Rc]=!0;var qa=Object.create||function(t,r){var n;return t!==null?(Pn[ha]=xd(t),n=new Pn,Pn[ha]=null,n[Rc]=t):n=Cr(),r===void 0?n:Nd.f(n,r)},Bd=de,Kd=qa,Gd=ke.f,pa=Bd("unscopables"),ma=Array.prototype;ma[pa]===void 0&&Gd(ma,pa,{configurable:!0,value:Kd(null)});var Wd=function(e){ma[pa][e]=!0},ar={},Vd=Q,Zd=Y,to=Vd.WeakMap,Yd=Zd(to)&&/native code/.test(String(to)),ir=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Jd=J,Xd=ke,qd=ir,qr=Jd?function(e,t,r){return Xd.f(e,t,qd(1,r))}:function(e,t,r){return e[t]=r,e},Qd=Yd,jc=Q,eh=je,th=qr,Tn=we,En=Ga,rh=Xa,nh=Ya,ro="Object already initialized",ga=jc.TypeError,ah=jc.WeakMap,Dr,tr,Mr,ih=function(e){return Mr(e)?tr(e):Dr(e,{})},oh=function(e){return function(t){var r;if(!eh(t)||(r=tr(t)).type!==e)throw new ga("Incompatible receiver, "+e+" required");return r}};if(Qd||En.state){var be=En.state||(En.state=new ah);be.get=be.get,be.has=be.has,be.set=be.set,Dr=function(e,t){if(be.has(e))throw new ga(ro);return t.facade=e,be.set(e,t),t},tr=function(e){return be.get(e)||{}},Mr=function(e){return be.has(e)}}else{var ot=rh("state");nh[ot]=!0,Dr=function(e,t){if(Tn(e,ot))throw new ga(ro);return t.facade=e,th(e,ot,t),t},tr=function(e){return Tn(e,ot)?e[ot]:{}},Mr=function(e){return Tn(e,ot)}}var or={set:Dr,get:tr,has:Mr,enforce:ih,getterFor:oh},Qa={},ei={},Ac={}.propertyIsEnumerable,Lc=Object.getOwnPropertyDescriptor,sh=Lc&&!Ac.call({1:2},1);ei.f=sh?function(t){var r=Lc(this,t);return!!r&&r.enumerable}:Ac;var ch=J,uh=Pe,lh=ei,fh=ir,dh=nr,hh=Tc,vh=we,ph=Ic,no=Object.getOwnPropertyDescriptor;Qa.f=ch?no:function(t,r){if(t=dh(t),r=hh(r),ph)try{return no(t,r)}catch{}if(vh(t,r))return fh(!uh(lh.f,t,r),t[r])};var Uc={exports:{}},ya=J,mh=we,xc=Function.prototype,gh=ya&&Object.getOwnPropertyDescriptor,ti=mh(xc,"name"),yh=ti&&(function(){}).name==="something",wh=ti&&(!ya||ya&&gh(xc,"name").configurable),Nc={EXISTS:ti,PROPER:yh,CONFIGURABLE:wh},bh=K,Sh=Y,wa=Ga,Ih=bh(Function.toString);Sh(wa.inspectSource)||(wa.inspectSource=function(e){return Ih(e)});var Dc=wa.inspectSource,ri=K,$h=ne,kh=Y,vr=we,ba=J,Ph=Nc.CONFIGURABLE,Th=Dc,Mc=or,Eh=Mc.enforce,Oh=Mc.get,ao=String,jr=Object.defineProperty,_h=ri("".slice),Rh=ri("".replace),Ch=ri([].join),jh=ba&&!$h(function(){return jr(function(){},"length",{value:8}).length!==8}),Ah=String(String).split("String"),Lh=Uc.exports=function(e,t,r){_h(ao(t),0,7)==="Symbol("&&(t="["+Rh(ao(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!vr(e,"name")||Ph&&e.name!==t)&&(ba?jr(e,"name",{value:t,configurable:!0}):e.name=t),jh&&r&&vr(r,"arity")&&e.length!==r.arity&&jr(e,"length",{value:r.arity});try{r&&vr(r,"constructor")&&r.constructor?ba&&jr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Eh(e);return vr(n,"source")||(n.source=Ch(Ah,typeof t=="string"?t:"")),e};Function.prototype.toString=Lh(function(){return kh(this)&&Oh(this).source||Th(this)},"toString");var Fc=Uc.exports,Uh=Y,xh=ke,Nh=Fc,Dh=Ka,Be=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Uh(r)&&Nh(r,i,n),n.global)a?e[t]=r:Dh(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:xh.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},zc={},Mh=Oc,Fh=Ja,zh=Fh.concat("length","prototype");zc.f=Object.getOwnPropertyNames||function(t){return Mh(t,zh)};var ni={};ni.f=Object.getOwnPropertySymbols;var Hh=Ot,Bh=K,Kh=zc,Gh=ni,Wh=He,Vh=Bh([].concat),Zh=Hh("Reflect","ownKeys")||function(t){var r=Kh.f(Wh(t)),n=Gh.f;return n?Vh(r,n(t)):r},io=we,Yh=Zh,Jh=Qa,Xh=ke,qh=function(e,t,r){for(var n=Yh(t),a=Xh.f,i=Jh.f,o=0;o<n.length;o++){var c=n[o];!io(e,c)&&!(r&&io(r,c))&&a(e,c,i(t,c))}},Qh=ne,ev=Y,tv=/#|\.prototype\./,sr=function(e,t){var r=nv[rv(e)];return r===iv?!0:r===av?!1:ev(t)?Qh(t):!!t},rv=sr.normalize=function(e){return String(e).replace(tv,".").toLowerCase()},nv=sr.data={},av=sr.NATIVE="N",iv=sr.POLYFILL="P",ov=sr,pr=Q,sv=Qa.f,cv=qr,uv=Be,lv=Ka,fv=qh,dv=ov,_t=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]||lv(r,{}):o=pr[r]&&pr[r].prototype,o)for(c in t){if(f=t[c],e.dontCallGetSet?(u=sv(o,c),l=u&&u.value):l=o[c],i=dv(n?c:r+(a?".":"#")+c,e.forced),!i&&l!==void 0){if(typeof f==typeof l)continue;fv(f,l)}(e.sham||l&&l.sham)&&cv(f,"sham",!0),uv(o,c,f,e)}},hv=ne,vv=!hv(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),pv=we,mv=Y,gv=Jr,yv=Xa,wv=vv,oo=yv("IE_PROTO"),Sa=Object,bv=Sa.prototype,Hc=wv?Sa.getPrototypeOf:function(e){var t=gv(e);if(pv(t,oo))return t[oo];var r=t.constructor;return mv(r)&&t instanceof r?r.prototype:t instanceof Sa?bv:null},Sv=ne,Iv=Y,$v=je,so=Hc,kv=Be,Pv=de,Ia=Pv("iterator"),Bc=!1,tt,On,_n;[].keys&&(_n=[].keys(),"next"in _n?(On=so(so(_n)),On!==Object.prototype&&(tt=On)):Bc=!0);var Tv=!$v(tt)||Sv(function(){var e={};return tt[Ia].call(e)!==e});Tv&&(tt={});Iv(tt[Ia])||kv(tt,Ia,function(){return this});var Kc={IteratorPrototype:tt,BUGGY_SAFARI_ITERATORS:Bc},Ev=ke.f,Ov=we,_v=de,co=_v("toStringTag"),cr=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Ov(e,co)&&Ev(e,co,{configurable:!0,value:t})},Rv=Kc.IteratorPrototype,Cv=qa,jv=ir,Av=cr,Lv=ar,Uv=function(){return this},Gc=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Cv(Rv,{next:jv(+!n,r)}),Av(e,a,!1),Lv[a]=Uv,e},xv=K,Nv=Xr,Dv=function(e,t,r){try{return xv(Nv(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Mv=je,Fv=function(e){return Mv(e)||e===null},zv=Fv,Hv=String,Bv=TypeError,Kv=function(e){if(zv(e))return e;throw new Bv("Can't set "+Hv(e)+" as a prototype")},Gv=Dv,Wv=je,Vv=Yr,Zv=Kv,Yv=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Gv(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Vv(a),Zv(i),Wv(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Jv=_t,Xv=Pe,Wc=Nc,qv=Y,Qv=Gc,uo=Hc,lo=Yv,ep=cr,tp=qr,Rn=Be,rp=de,np=ar,Vc=Kc,ap=Wc.PROPER,ip=Wc.CONFIGURABLE,fo=Vc.IteratorPrototype,mr=Vc.BUGGY_SAFARI_ITERATORS,Ut=rp("iterator"),ho="keys",xt="values",vo="entries",op=function(){return this},Zc=function(e,t,r,n,a,i,o){Qv(r,t,n);var c=function($){if($===a&&d)return d;if(!mr&&$&&$ in u)return u[$];switch($){case ho:return function(){return new r(this,$)};case xt:return function(){return new r(this,$)};case vo:return function(){return new r(this,$)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,s=u[Ut]||u["@@iterator"]||a&&u[a],d=!mr&&s||c(a),h=t==="Array"&&u.entries||s,m,S,g;if(h&&(m=uo(h.call(new e)),m!==Object.prototype&&m.next&&(uo(m)!==fo&&(lo?lo(m,fo):qv(m[Ut])||Rn(m,Ut,op)),ep(m,l,!0))),ap&&a===xt&&s&&s.name!==xt&&(ip?tp(u,"name",xt):(f=!0,d=function(){return Xv(s,this)})),a)if(S={values:c(xt),keys:i?d:c(ho),entries:c(vo)},o)for(g in S)(mr||f||!(g in u))&&Rn(u,g,S[g]);else Jv({target:t,proto:!0,forced:mr||f},S);return u[Ut]!==d&&Rn(u,Ut,d,{name:a}),np[t]=d,S},ai=function(e,t){return{value:e,done:t}},sp=nr,ii=Wd,po=ar,Yc=or,cp=ke.f,up=Zc,gr=ai,lp=J,Jc="Array Iterator",fp=Yc.set,dp=Yc.getterFor(Jc),hp=up(Array,"Array",function(e,t){fp(this,{type:Jc,target:sp(e),index:0,kind:t})},function(){var e=dp(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,gr(void 0,!0);switch(e.kind){case"keys":return gr(r,!1);case"values":return gr(t[r],!1)}return gr([r,t[r]],!1)},"values"),mo=po.Arguments=po.Array;ii("keys");ii("values");ii("entries");if(lp&&mo.name!=="values")try{cp(mo,"name",{value:"values"})}catch{}var go=Q,vp=J,pp=Object.getOwnPropertyDescriptor,mp=function(e){if(!vp)return go[e];var t=pp(go,e);return t&&t.value},gp=ne,yp=de,wp=J,yo=Bl,bp=yp("iterator"),Qr=!gp(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),yo&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(yo||!wp)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[bp]||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"}),wo=Fc,Sp=ke,oi=function(e,t,r){return r.get&&wo(r.get,t,{getter:!0}),r.set&&wo(r.set,t,{setter:!0}),Sp.f(e,t,r)},Ip=Be,$p=function(e,t,r){for(var n in t)Ip(e,n,t[n],r);return e},kp=$c,Pp=TypeError,Xc=function(e,t){if(kp(t,e))return e;throw new Pp("Incorrect invocation")},Tp=Ha,Ep=K,Op=function(e){if(Tp(e)==="Function")return Ep(e)},bo=Op,_p=Xr,Rp=za,Cp=bo(bo.bind),si=function(e,t){return _p(e),t===void 0?e:Rp?Cp(e,t):function(){return e.apply(t,arguments)}},jp=de,Ap=jp("toStringTag"),qc={};qc[Ap]="z";var Lp=String(qc)==="[object z]",Up=Lp,xp=Y,Ar=Ha,Np=de,Dp=Np("toStringTag"),Mp=Object,Fp=Ar(function(){return arguments}())==="Arguments",zp=function(e,t){try{return e[t]}catch{}},en=Up?Ar:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=zp(t=Mp(e),Dp))=="string"?r:Fp?Ar(t):(n=Ar(t))==="Object"&&xp(t.callee)?"Arguments":n},Hp=en,Bp=String,Ke=function(e){if(Hp(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Bp(e)},Kp=en,So=Va,Gp=Ba,Wp=ar,Vp=de,Zp=Vp("iterator"),ci=function(e){if(!Gp(e))return So(e,Zp)||So(e,"@@iterator")||Wp[Kp(e)]},Yp=Pe,Jp=Xr,Xp=He,qp=Pc,Qp=ci,em=TypeError,Qc=function(e,t){var r=arguments.length<2?Qp(e):t;if(Jp(r))return Xp(Yp(r,e));throw new em(qp(e)+" is not iterable")},tm=TypeError,Rt=function(e,t){if(e<t)throw new tm("Not enough arguments");return e},rm=K,eu=rm([].slice),Io=eu,nm=Math.floor,$a=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=nm(r/2),c=$a(Io(e,0,o),t),l=$a(Io(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},am=$a,ka=_t,tn=Q,ui=mp,yr=Pe,$e=K,Vt=J,tu=Qr,ru=Be,im=oi,om=$p,sm=cr,cm=Gc,li=or,nu=Xc,Cn=Y,um=we,lm=si,fm=en,dm=He,au=je,q=Ke,hm=qa,$o=ir,ko=Qc,vm=ci,wr=ai,st=Rt,pm=de,mm=am,gm=pm("iterator"),Ct="URLSearchParams",iu=Ct+"Iterator",ou=li.set,le=li.getterFor(Ct),ym=li.getterFor(iu),Po=ui("fetch"),Fr=ui("Request"),Zt=ui("Headers"),jn=Fr&&Fr.prototype,To=Zt&&Zt.prototype,wm=tn.RegExp,bm=tn.TypeError,su=tn.decodeURIComponent,Sm=tn.encodeURIComponent,Im=$e("".charAt),Eo=$e([].join),Je=$e([].push),Pa=$e("".replace),$m=$e([].shift),Oo=$e([].splice),_o=$e("".split),km=$e("".slice),Pm=/\+/g,Ro=Array(4),Tm=function(e){return Ro[e-1]||(Ro[e-1]=wm("((?:%[\\da-f]{2}){"+e+"})","gi"))},Em=function(e){try{return su(e)}catch{return e}},Co=function(e){var t=Pa(e,Pm," "),r=4;try{return su(t)}catch{for(;r;)t=Pa(t,Tm(r--),Em);return t}},Om=/[!'()~]|%20/g,_m={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Rm=function(e){return _m[e]},jo=function(e){return Pa(Sm(e),Om,Rm)},An=cm(function(t,r){ou(this,{type:iu,target:le(t).entries,index:0,kind:r})},Ct,function(){var t=ym(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,wr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return wr(a.key,!1);case"values":return wr(a.value,!1)}return wr([a.key,a.value],!1)},!0),cu=function(e){this.entries=[],this.url=null,e!==void 0&&(au(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?Im(e,0)==="?"?km(e,1):e:q(e)))};cu.prototype={type:Ct,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=vm(e),n,a,i,o,c,l,f;if(r)for(n=ko(e,r),a=n.next;!(i=yr(a,n)).done;){if(o=ko(dm(i.value)),c=o.next,(l=yr(c,o)).done||(f=yr(c,o)).done||!yr(c,o).done)throw new bm("Expected sequence with length 2");Je(t,{key:q(l.value),value:q(f.value)})}else for(var u in e)um(e,u)&&Je(t,{key:u,value:q(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=_o(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=_o(a,"="),Je(t,{key:Co($m(i)),value:Co(Eo(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Je(t,jo(n.key)+"="+jo(n.value));return Eo(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var rn=function(){nu(this,St);var t=arguments.length>0?arguments[0]:void 0,r=ou(this,new cu(t));Vt||(this.size=r.entries.length)},St=rn.prototype;om(St,{append:function(t,r){var n=le(this);st(arguments.length,2),Je(n.entries,{key:q(t),value:q(r)}),Vt||this.length++,n.updateURL()},delete:function(e){for(var t=le(this),r=st(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(Oo(n,c,1),o!==void 0)break}else c++}Vt||(this.size=n.length),t.updateURL()},get:function(t){var r=le(this).entries;st(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=le(this).entries;st(arguments.length,1);for(var n=q(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Je(a,r[i].value);return a},has:function(t){for(var r=le(this).entries,n=st(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=le(this);st(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?Oo(a,l--,1):(i=!0,f.value=c));i||Je(a,{key:o,value:c}),Vt||(this.size=a.length),n.updateURL()},sort:function(){var t=le(this);mm(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=le(this).entries,n=lm(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 An(this,"keys")},values:function(){return new An(this,"values")},entries:function(){return new An(this,"entries")}},{enumerable:!0});ru(St,gm,St.entries,{name:"entries"});ru(St,"toString",function(){return le(this).serialize()},{enumerable:!0});Vt&&im(St,"size",{get:function(){return le(this).entries.length},configurable:!0,enumerable:!0});sm(rn,Ct);ka({global:!0,constructor:!0,forced:!tu},{URLSearchParams:rn});if(!tu&&Cn(Zt)){var Cm=$e(To.has),jm=$e(To.set),Ao=function(e){if(au(e)){var t=e.body,r;if(fm(t)===Ct)return r=e.headers?new Zt(e.headers):new Zt,Cm(r,"content-type")||jm(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),hm(e,{body:$o(0,q(t)),headers:$o(0,r)})}return e};if(Cn(Po)&&ka({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Po(t,arguments.length>1?Ao(arguments[1]):{})}}),Cn(Fr)){var Ln=function(t){return nu(this,jn),new Fr(t,arguments.length>1?Ao(arguments[1]):{})};jn.constructor=Ln,Ln.prototype=jn,ka({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ln})}}var Am={URLSearchParams:rn,getState:le},Lm=Be,nn=K,Lo=Ke,Um=Rt,uu=URLSearchParams,an=uu.prototype,xm=nn(an.append),Uo=nn(an.delete),Nm=nn(an.forEach),Dm=nn([].push),fi=new uu("a=1&a=2&b=3");fi.delete("a",1);fi.delete("b",void 0);fi+""!="a=2"&&Lm(an,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Uo(this,e);var n=[];Nm(this,function(s,d){Dm(n,{key:d,value:s})}),Um(t,1);for(var a=Lo(e),i=Lo(r),o=0,c=0,l=!1,f=n.length,u;o<f;)u=n[o++],l||u.key===a?(l=!0,Uo(this,u.key)):c++;for(;c<f;)u=n[c++],u.key===a&&u.value===i||xm(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var Mm=Be,lu=K,Fm=Ke,zm=Rt,fu=URLSearchParams,di=fu.prototype,Hm=lu(di.getAll),Bm=lu(di.has),xo=new fu("a=1");(xo.has("a",2)||!xo.has("a",void 0))&&Mm(di,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Bm(this,t);var a=Hm(this,t);zm(r,1);for(var i=Fm(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Km=J,Gm=K,Wm=oi,Ta=URLSearchParams.prototype,Vm=Gm(Ta.forEach);Km&&!("size"in Ta)&&Wm(Ta,"size",{get:function(){var t=0;return Vm(this,function(){t++}),t},configurable:!0,enumerable:!0});var Zm=Q,du=Zm,Ym=du;Ym.URLSearchParams;var hi=K,Jm=Za,Xm=Ke,qm=Yr,Qm=hi("".charAt),No=hi("".charCodeAt),eg=hi("".slice),Do=function(e){return function(t,r){var n=Xm(qm(t)),a=Jm(r),i=n.length,o,c;return a<0||a>=i?e?"":void 0:(o=No(n,a),o<55296||o>56319||a+1===i||(c=No(n,a+1))<56320||c>57343?e?Qm(n,a):o:e?eg(n,a,a+2):(o-55296<<10)+(c-56320)+65536)}},hu={codeAt:Do(!1),charAt:Do(!0)},tg=hu.charAt,rg=Ke,vu=or,ng=Zc,Mo=ai,pu="String Iterator",ag=vu.set,ig=vu.getterFor(pu);ng(String,"String",function(e){ag(this,{type:pu,string:rg(e),index:0})},function(){var t=ig(this),r=t.string,n=t.index,a;return n>=r.length?Mo(void 0,!0):(a=tg(r,n),t.index+=a.length,Mo(a,!1))});var Fo=J,og=K,sg=Pe,cg=ne,Un=_c,ug=ni,lg=ei,fg=Jr,dg=hc,ct=Object.assign,zo=Object.defineProperty,hg=og([].concat),vg=!ct||cg(function(){if(Fo&&ct({b:1},ct(zo({},"a",{enumerable:!0,get:function(){zo(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}),ct({},e)[r]!==7||Un(ct({},t)).join("")!==n})?function(t,r){for(var n=fg(t),a=arguments.length,i=1,o=ug.f,c=lg.f;a>i;)for(var l=dg(arguments[i++]),f=o?hg(Un(l),o(l)):Un(l),u=f.length,s=0,d;u>s;)d=f[s++],(!Fo||sg(c,l,d))&&(n[d]=l[d]);return n}:ct,pg=Pe,Ho=He,mg=Va,gg=function(e,t,r){var n,a;Ho(e);try{if(n=mg(e,"return"),!n){if(t==="throw")throw r;return r}n=pg(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Ho(n),r},yg=He,wg=gg,bg=function(e,t,r,n){try{return n?t(yg(r)[0],r[1]):t(r)}catch(a){wg(e,"throw",a)}},Sg=de,Ig=ar,$g=Sg("iterator"),kg=Array.prototype,Pg=function(e){return e!==void 0&&(Ig.Array===e||kg[$g]===e)},Tg=K,Eg=ne,mu=Y,Og=en,_g=Ot,Rg=Dc,gu=function(){},yu=_g("Reflect","construct"),vi=/^\s*(?:class|function)\b/,Cg=Tg(vi.exec),jg=!vi.test(gu),Nt=function(t){if(!mu(t))return!1;try{return yu(gu,[],t),!0}catch{return!1}},wu=function(t){if(!mu(t))return!1;switch(Og(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jg||!!Cg(vi,Rg(t))}catch{return!0}};wu.sham=!0;var Ag=!yu||Eg(function(){var e;return Nt(Nt.call)||!Nt(Object)||!Nt(function(){e=!0})||e})?wu:Nt,Lg=J,Ug=ke,xg=ir,Ng=function(e,t,r){Lg?Ug.f(e,t,xg(0,r)):e[t]=r},Dg=si,Mg=Pe,Fg=Jr,zg=bg,Hg=Pg,Bg=Ag,Kg=Ec,Bo=Ng,Gg=Qc,Wg=ci,Ko=Array,Vg=function(t){var r=Fg(t),n=Bg(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Dg(i,a>2?arguments[2]:void 0));var c=Wg(r),l=0,f,u,s,d,h,m;if(c&&!(this===Ko&&Hg(c)))for(u=n?new this:[],d=Gg(r,c),h=d.next;!(s=Mg(h,d)).done;l++)m=o?zg(d,i,[s.value,l],!0):s.value,Bo(u,l,m);else for(f=Kg(r),u=n?new this(f):Ko(f);f>l;l++)m=o?i(r[l],l):r[l],Bo(u,l,m);return u.length=l,u},it=K,xn=2147483647,Yt=36,bu=1,Ea=26,Zg=38,Yg=700,Jg=72,Xg=128,qg="-",Qg=/[^\0-\u007E]/,Su=/[.\u3002\uFF0E\uFF61]/g,Go="Overflow: input needs wider integers to process",Nn=Yt-bu,Wo=RangeError,ey=it(Su.exec),pt=Math.floor,Dn=String.fromCharCode,Vo=it("".charCodeAt),Iu=it([].join),De=it([].push),ty=it("".replace),ry=it("".split),ny=it("".toLowerCase),ay=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Vo(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Vo(e,r++);(i&64512)===56320?De(t,((a&1023)<<10)+(i&1023)+65536):(De(t,a),r--)}else De(t,a)}return t},Zo=function(e){return e+22+75*(e<26)},iy=function(e,t,r){var n=0;for(e=r?pt(e/Yg):e>>1,e+=pt(e/t);e>Nn*Ea>>1;)e=pt(e/Nn),n+=Yt;return pt(n+(Nn+1)*e/(e+Zg))},oy=function(e){var t=[];e=ay(e);var r=e.length,n=Xg,a=0,i=Jg,o,c;for(o=0;o<e.length;o++)c=e[o],c<128&&De(t,Dn(c));var l=t.length,f=l;for(l&&De(t,qg);f<r;){var u=xn;for(o=0;o<e.length;o++)c=e[o],c>=n&&c<u&&(u=c);var s=f+1;if(u-n>pt((xn-a)/s))throw new Wo(Go);for(a+=(u-n)*s,n=u,o=0;o<e.length;o++){if(c=e[o],c<n&&++a>xn)throw new Wo(Go);if(c===n){for(var d=a,h=Yt;;){var m=h<=i?bu:h>=i+Ea?Ea:h-i;if(d<m)break;var S=d-m,g=Yt-m;De(t,Dn(Zo(m+S%g))),d=pt(S/g),h+=Yt}De(t,Dn(Zo(d))),i=iy(a,s,f===l),a=0,f++}}a++,n++}return Iu(t,"")},sy=function(e){var t=[],r=ry(ty(ny(e),Su,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],De(t,ey(Qg,a)?"xn--"+oy(a):a);return Iu(t,".")},cy=_t,pi=J,uy=Qr,mi=Q,Yo=si,he=K,zr=Be,se=oi,ly=Xc,Oa=we,gi=vg,ut=Vg,ve=eu,fy=hu.codeAt,dy=sy,Oe=Ke,hy=cr,vy=Rt,$u=Am,ku=or,py=ku.set,Hr=ku.getterFor("URL"),my=$u.URLSearchParams,gy=$u.getState,Dt=mi.URL,_a=mi.TypeError,Br=mi.parseInt,yy=Math.floor,Jo=Math.pow,fe=he("".charAt),ge=he(/./.exec),Bt=he([].join),wy=he(1 .toString),by=he([].pop),dt=he([].push),Mn=he("".replace),Sy=he([].shift),Iy=he("".split),Jt=he("".slice),Kr=he("".toLowerCase),$y=he([].unshift),ky="Invalid authority",Fn="Invalid scheme",Ge="Invalid host",Xo="Invalid port",Pu=/[a-z]/i,Py=/[\d+-.a-z]/i,Ra=/\d/,Ty=/^0x/i,Ey=/^[0-7]+$/,Oy=/^\d+$/,Tu=/^[\da-f]+$/i,_y=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ry=/[\0\t\n\r #/:<>?@[\\\]^|]/,Cy=/^[\u0000-\u0020]+/,jy=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ay=/[\t\n\r]/g,ce,Ly=function(e){var t=Iy(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=ge(Ty,i)?16:8,i=Jt(i,o===8?1:2)),i==="")c=0;else{if(!ge(o===10?Oy:o===8?Ey:Tu,i))return e;c=Br(i,o)}dt(n,c)}for(a=0;a<r;a++)if(c=n[a],a===r-1){if(c>=Jo(256,5-r))return null}else if(c>255)return null;for(l=by(n),a=0;a<n.length;a++)l+=n[a]*Jo(256,3-a);return l},Uy=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&&ge(Tu,d());)i=i*16+Br(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(!ge(Ra,d()))return;for(;ge(Ra,d());){if(f=Br(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},xy=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},Mt=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)$y(t,e%256),e=yy(e/256);return Bt(t,".")}else if(typeof e=="object"){for(t="",n=xy(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=wy(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Lr={},Eu=gi({},Lr,{" ":1,'"':1,"<":1,">":1,"`":1}),Ou=gi({},Eu,{"#":1,"?":1,"{":1,"}":1}),zn=gi({},Ou,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Le=function(e,t){var r=fy(e,0);return r>32&&r<127&&!Oa(t,e)?e:encodeURIComponent(e)},br={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Kt=function(e,t){var r;return e.length===2&&ge(Pu,fe(e,0))&&((r=fe(e,1))===":"||!t&&r==="|")},qo=function(e){var t;return e.length>1&&Kt(Jt(e,0,2))&&(e.length===2||(t=fe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},Ny=function(e){return e==="."||Kr(e)==="%2e"},Dy=function(e){return e=Kr(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Hn={},Qo={},Bn={},es={},ts={},Kn={},rs={},ns={},Sr={},Ir={},Gn={},Wn={},Vn={},Zn={},as={},Yn={},lt={},Se={},is={},We={},Ee={},yi=function(e,t,r){var n=Oe(e),a,i,o;if(t){if(i=this.parse(n),i)throw new _a(i);this.searchParams=null}else{if(r!==void 0&&(a=new yi(r,!0)),i=this.parse(n,null,a),i)throw new _a(i);o=gy(new my),o.bindURL(this),this.searchParams=o}};yi.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Hn,i=0,o="",c=!1,l=!1,f=!1,u,s,d,h;for(e=Oe(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=Mn(e,Cy,""),e=Mn(e,jy,"$1")),e=Mn(e,Ay,""),u=ut(e);i<=u.length;){switch(s=u[i],a){case Hn:if(s&&ge(Pu,s))o+=Kr(s),a=Qo;else{if(t)return Fn;a=Bn;continue}break;case Qo:if(s&&(ge(Py,s)||s==="+"||s==="-"||s==="."))o+=Kr(s);else if(s===":"){if(t&&(n.isSpecial()!==Oa(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=Zn:n.isSpecial()&&r&&r.scheme===n.scheme?a=es:n.isSpecial()?a=ns:u[i+1]==="/"?(a=ts,i++):(n.cannotBeABaseURL=!0,dt(n.path,""),a=is)}else{if(t)return Fn;o="",a=Bn,i=0;continue}break;case Bn:if(!r||r.cannotBeABaseURL&&s!=="#")return Fn;if(r.cannotBeABaseURL&&s==="#"){n.scheme=r.scheme,n.path=ve(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Ee;break}a=r.scheme==="file"?Zn:Kn;continue;case es:if(s==="/"&&u[i+1]==="/")a=Sr,i++;else{a=Kn;continue}break;case ts:if(s==="/"){a=Ir;break}else{a=Se;continue}case Kn:if(n.scheme=r.scheme,s===ce)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ve(r.path),n.query=r.query;else if(s==="/"||s==="\\"&&n.isSpecial())a=rs;else if(s==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ve(r.path),n.query="",a=We;else if(s==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ve(r.path),n.query=r.query,n.fragment="",a=Ee;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ve(r.path),n.path.length--,a=Se;continue}break;case rs:if(n.isSpecial()&&(s==="/"||s==="\\"))a=Sr;else if(s==="/")a=Ir;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Se;continue}break;case ns:if(a=Sr,s!=="/"||fe(o,i+1)!=="/")continue;i++;break;case Sr:if(s!=="/"&&s!=="\\"){a=Ir;continue}break;case Ir:if(s==="@"){c&&(o="%40"+o),c=!0,d=ut(o);for(var m=0;m<d.length;m++){var S=d[m];if(S===":"&&!f){f=!0;continue}var g=Le(S,zn);f?n.password+=g:n.username+=g}o=""}else if(s===ce||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(c&&o==="")return ky;i-=ut(o).length+1,o="",a=Gn}else o+=s;break;case Gn:case Wn:if(t&&n.scheme==="file"){a=Yn;continue}else if(s===":"&&!l){if(o==="")return Ge;if(h=n.parseHost(o),h)return h;if(o="",a=Vn,t===Wn)return}else if(s===ce||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Ge;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=lt,t)return;continue}else s==="["?l=!0:s==="]"&&(l=!1),o+=s;break;case Vn:if(ge(Ra,s))o+=s;else if(s===ce||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()||t){if(o!==""){var $=Br(o,10);if($>65535)return Xo;n.port=n.isSpecial()&&$===br[n.scheme]?null:$,o=""}if(t)return;a=lt;continue}else return Xo;break;case Zn:if(n.scheme="file",s==="/"||s==="\\")a=as;else if(r&&r.scheme==="file")switch(s){case ce:n.host=r.host,n.path=ve(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ve(r.path),n.query="",a=We;break;case"#":n.host=r.host,n.path=ve(r.path),n.query=r.query,n.fragment="",a=Ee;break;default:qo(Bt(ve(u,i),""))||(n.host=r.host,n.path=ve(r.path),n.shortenPath()),a=Se;continue}else{a=Se;continue}break;case as:if(s==="/"||s==="\\"){a=Yn;break}r&&r.scheme==="file"&&!qo(Bt(ve(u,i),""))&&(Kt(r.path[0],!0)?dt(n.path,r.path[0]):n.host=r.host),a=Se;continue;case Yn:if(s===ce||s==="/"||s==="\\"||s==="?"||s==="#"){if(!t&&Kt(o))a=Se;else if(o===""){if(n.host="",t)return;a=lt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=lt}continue}else o+=s;break;case lt:if(n.isSpecial()){if(a=Se,s!=="/"&&s!=="\\")continue}else if(!t&&s==="?")n.query="",a=We;else if(!t&&s==="#")n.fragment="",a=Ee;else if(s!==ce&&(a=Se,s!=="/"))continue;break;case Se:if(s===ce||s==="/"||s==="\\"&&n.isSpecial()||!t&&(s==="?"||s==="#")){if(Dy(o)?(n.shortenPath(),s!=="/"&&!(s==="\\"&&n.isSpecial())&&dt(n.path,"")):Ny(o)?s!=="/"&&!(s==="\\"&&n.isSpecial())&&dt(n.path,""):(n.scheme==="file"&&!n.path.length&&Kt(o)&&(n.host&&(n.host=""),o=fe(o,0)+":"),dt(n.path,o)),o="",n.scheme==="file"&&(s===ce||s==="?"||s==="#"))for(;n.path.length>1&&n.path[0]==="";)Sy(n.path);s==="?"?(n.query="",a=We):s==="#"&&(n.fragment="",a=Ee)}else o+=Le(s,Ou);break;case is:s==="?"?(n.query="",a=We):s==="#"?(n.fragment="",a=Ee):s!==ce&&(n.path[0]+=Le(s,Lr));break;case We:!t&&s==="#"?(n.fragment="",a=Ee):s!==ce&&(s==="'"&&n.isSpecial()?n.query+="%27":s==="#"?n.query+="%23":n.query+=Le(s,Lr));break;case Ee:s!==ce&&(n.fragment+=Le(s,Eu));break}i++}},parseHost:function(e){var t,r,n;if(fe(e,0)==="["){if(fe(e,e.length-1)!=="]"||(t=Uy(Jt(e,1,-1)),!t))return Ge;this.host=t}else if(this.isSpecial()){if(e=dy(e),ge(_y,e)||(t=Ly(e),t===null))return Ge;this.host=t}else{if(ge(Ry,e))return Ge;for(t="",r=ut(e),n=0;n<r.length;n++)t+=Le(r[n],Lr);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Oa(br,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!Kt(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+=Mt(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+Bt(o,"/"):"",c!==null&&(f+="?"+c),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new _a(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new It(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+Mt(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Oe(e)+":",Hn)},getUsername:function(){return this.username},setUsername:function(e){var t=ut(Oe(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Le(t[r],zn)}},getPassword:function(){return this.password},setPassword:function(e){var t=ut(Oe(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Le(t[r],zn)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?Mt(e):Mt(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Gn)},getHostname:function(){var e=this.host;return e===null?"":Mt(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Wn)},getPort:function(){var e=this.port;return e===null?"":Oe(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Oe(e),e===""?this.port=null:this.parse(e,Vn))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Bt(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,lt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Oe(e),e===""?this.query=null:(fe(e,0)==="?"&&(e=Jt(e,1)),this.query="",this.parse(e,We)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Oe(e),e===""){this.fragment=null;return}fe(e,0)==="#"&&(e=Jt(e,1)),this.fragment="",this.parse(e,Ee)},update:function(){this.query=this.searchParams.serialize()||null}};var It=function(t){var r=ly(this,X),n=vy(arguments.length,1)>1?arguments[1]:void 0,a=py(r,new yi(t,!1,n));pi||(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())},X=It.prototype,ue=function(e,t){return{get:function(){return Hr(this)[e]()},set:t&&function(r){return Hr(this)[t](r)},configurable:!0,enumerable:!0}};pi&&(se(X,"href",ue("serialize","setHref")),se(X,"origin",ue("getOrigin")),se(X,"protocol",ue("getProtocol","setProtocol")),se(X,"username",ue("getUsername","setUsername")),se(X,"password",ue("getPassword","setPassword")),se(X,"host",ue("getHost","setHost")),se(X,"hostname",ue("getHostname","setHostname")),se(X,"port",ue("getPort","setPort")),se(X,"pathname",ue("getPathname","setPathname")),se(X,"search",ue("getSearch","setSearch")),se(X,"searchParams",ue("getSearchParams")),se(X,"hash",ue("getHash","setHash")));zr(X,"toJSON",function(){return Hr(this).serialize()},{enumerable:!0});zr(X,"toString",function(){return Hr(this).serialize()},{enumerable:!0});if(Dt){var os=Dt.createObjectURL,ss=Dt.revokeObjectURL;os&&zr(It,"createObjectURL",Yo(os,Dt)),ss&&zr(It,"revokeObjectURL",Yo(ss,Dt))}hy(It,"URL");cy({global:!0,constructor:!0,forced:!uy,sham:!pi},{URL:It});var My=_t,Fy=Ot,_u=ne,zy=Rt,cs=Ke,Hy=Qr,wi=Fy("URL"),By=Hy&&_u(function(){wi.canParse()}),Ky=_u(function(){return wi.canParse.length!==1});My({target:"URL",stat:!0,forced:!By||Ky},{canParse:function(t){var r=zy(arguments.length,1),n=cs(t),a=r<2||arguments[1]===void 0?void 0:cs(arguments[1]);try{return!!new wi(n,a)}catch{return!1}}});var Gy=_t,Wy=Ot,Vy=Rt,us=Ke,Zy=Qr,Yy=Wy("URL");Gy({target:"URL",stat:!0,forced:!Zy},{parse:function(t){var r=Vy(arguments.length,1),n=us(t),a=r<2||arguments[1]===void 0?void 0:us(arguments[1]);try{return new Yy(n,a)}catch{return null}}});var Jy=_t,Xy=Pe;Jy({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Xy(URL.prototype.toString,this)}});var qy=du;qy.URL;var Qy={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},ew=Wa,Jn=ew("span").classList,ls=Jn&&Jn.constructor&&Jn.constructor.prototype,tw=ls===Object.prototype?void 0:ls,fs=Q,Ru=Qy,rw=tw,Gt=hp,ds=qr,nw=cr,aw=de,Xn=aw("iterator"),qn=Gt.values,Cu=function(e,t){if(e){if(e[Xn]!==qn)try{ds(e,Xn,qn)}catch{e[Xn]=qn}if(nw(e,t,!0),Ru[t]){for(var r in Gt)if(e[r]!==Gt[r])try{ds(e,r,Gt[r])}catch{e[r]=Gt[r]}}}};for(var Qn in Ru)Cu(fs[Qn]&&fs[Qn].prototype,Qn);Cu(rw,"DOMTokenList");function ze(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var Ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Si(e,t){return e(t={exports:{}},t.exports),t.exports}var Ve=Si(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()}});bi(Ve);var iw=bi(Si(function(e,t){var r=Ze&&Ze.__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=Ze&&Ze.__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=Ze;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,Ve.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?(Ve.default().unlock(d),[2]):(($=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(s,JSON.stringify($)),Ve.default().unlock(d),this.refreshLockWhileAcquired(s,d),[2])):(Ve.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,Ve.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),Ve.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 ow={timeoutInSeconds:60},ju={name:"auth0-spa-js",version:"2.1.3"},Au=()=>Date.now();let ae=class Ca extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Ca.prototype)}static fromPayload({error:t,error_description:r}){return new Ca(t,r)}},sw=class Lu extends ae{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Lu.prototype)}},ja=class Uu extends ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Uu.prototype)}},cw=class xu extends ja{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,xu.prototype)}},uw=class Nu extends ae{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Nu.prototype)}},lw=class Du extends ae{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Du.prototype)}},Mu=class Fu extends ae{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${hs(t,["default"])}', scope: '${hs(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Fu.prototype)}};function hs(e,t=[]){return e&&!t.includes(e)?e:""}const Ur=()=>window.crypto,ea=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Ur().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},vs=e=>btoa(e),Aa=e=>{var{clientId:t}=e,r=Ie(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()},ps=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),fw=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},dw=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([fw(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},hw=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},vw=async(e,t,r,n,a,i,o=1e4)=>a?hw(e,t,r,n,o,a,i):dw(e,n,o);async function pw(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:c}=e,l=Ie(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=c?Aa(l):JSON.stringify(l);return await async function(u,s,d,h,m,S,g){let $,P=null;for(let C=0;C<3;C++)try{$=await vw(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=Ie(b,["error","error_description"]),{ok:_}=$;if(!_){const C=I||`HTTP error. Unable to fetch ${u}`;throw v==="mfa_required"?new lw(v,C,O.mfa_token):v==="missing_refresh_token"?new Mu(d,h):new ae(v||"request_error",C)}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||ju))}},t,c)}const $r=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let Xe=class La{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 La({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new La({scope:r,audience:n,clientId:a})}},mw=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@@"))}},zu=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)}}()}},gw=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Au}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 Xe({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 Xe({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=Xe.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]}},yw=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 Ft=e=>typeof e=="number",ww=["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"],bw=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(ps(l)),s={__raw:i},d={};return Object.keys(u).forEach(h=>{s[h]=u[h],ww.includes(h)||(d[h]=u[h])}),{encoded:{header:c,payload:l,signature:f},header:JSON.parse(ps(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&&!Ft(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||!Ft(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ft(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&&Ft(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&&Ft(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 qe=Si(function(e,t){var r=Ze&&Ze.__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}))}});bi(qe),qe.encode,qe.parse,qe.getAll;var Sw=qe.get,Hu=qe.set,Bu=qe.remove;const ht={get(e){const t=Sw(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),Hu(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bu(e,r)}},Iw={get(e){return ht.get(e)||ht.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),Hu(`_legacy_${e}`,JSON.stringify(t),n),ht.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bu(e,r),ht.remove(e,t),ht.remove(`_legacy_${e}`,t)}},$w={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 kw(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
|
-
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),
|
|
1
|
+
"use strict";var ov=Object.defineProperty;var sv=(e,t,r)=>t in e?ov(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>sv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},X=function(e){try{return!!e()}catch{return!0}},cv=X,jn=!cv(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),fl=jn,dl=Function.prototype,yi=dl.call,uv=fl&&dl.bind.bind(yi,yi),H=fl?uv:function(e){return function(){return yi.apply(e,arguments)}},vl=H,lv=vl({}.toString),fv=vl("".slice),Ln=function(e){return fv(lv(e),8,-1)},dv=H,vv=X,hv=Ln,ia=Object,pv=dv("".split),hl=vv(function(){return!ia("z").propertyIsEnumerable(0)})?function(e){return hv(e)==="String"?pv(e,""):ia(e)}:ia,Nn=function(e){return e==null},mv=Nn,gv=TypeError,Un=function(e){if(mv(e))throw new gv("Can't call method on "+e);return e},yv=hl,wv=Un,Er=function(e){return yv(wv(e))},qt=function(e){return e&&e.Math===Math&&e},G=qt(typeof globalThis=="object"&&globalThis)||qt(typeof window=="object"&&window)||qt(typeof self=="object"&&self)||qt(typeof Lr=="object"&&Lr)||qt(typeof Lr=="object"&&Lr)||function(){return this}()||Function("return this")(),pl={exports:{}},bv=!1,ns=G,Sv=Object.defineProperty,no=function(e,t){try{Sv(ns,e,{value:t,configurable:!0,writable:!0})}catch{ns[e]=t}return t},$v=G,Iv=no,as="__core-js_shared__",is=pl.exports=$v[as]||Iv(as,{});(is.versions||(is.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 ao=pl.exports,os=ao,ml=function(e,t){return os[e]||(os[e]=t||{})},Ev=Un,Tv=Object,xn=function(e){return Tv(Ev(e))},Pv=H,Ov=xn,kv=Pv({}.hasOwnProperty),me=Object.hasOwn||function(t,r){return kv(Ov(t),r)},_v=H,Rv=0,Cv=Math.random(),Av=_v(1 .toString),gl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Av(++Rv+Cv,36)},Dn=typeof navigator<"u"&&String(navigator.userAgent)||"",yl=G,oa=Dn,ss=yl.process,cs=yl.Deno,us=ss&&ss.versions||cs&&cs.version,ls=us&&us.v8,$e,mn;ls&&($e=ls.split("."),mn=$e[0]>0&&$e[0]<4?1:+($e[0]+$e[1]));!mn&&oa&&($e=oa.match(/Edge\/(\d+)/),(!$e||$e[1]>=74)&&($e=oa.match(/Chrome\/(\d+)/),$e&&(mn=+$e[1])));var wl=mn,fs=wl,jv=X,Lv=G,Nv=Lv.String,bl=!!Object.getOwnPropertySymbols&&!jv(function(){var e=Symbol("symbol detection");return!Nv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fs&&fs<41}),Uv=bl,Sl=Uv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",xv=G,Dv=ml,ds=me,Mv=gl,Fv=bl,zv=Sl,Ot=xv.Symbol,sa=Dv("wks"),Bv=zv?Ot.for||Ot:Ot&&Ot.withoutSetter||Mv,q=function(e){return ds(sa,e)||(sa[e]=Fv&&ds(Ot,e)?Ot[e]:Bv("Symbol."+e)),sa[e]},ca=typeof document=="object"&&document.all,W=typeof ca>"u"&&ca!==void 0?function(e){return typeof e=="function"||e===ca}:function(e){return typeof e=="function"},Hv=W,ge=function(e){return typeof e=="object"?e!==null:Hv(e)},Kv=ge,Gv=String,Wv=TypeError,Te=function(e){if(Kv(e))return e;throw new Wv(Gv(e)+" is not an object")},$l={},Vv=X,Q=!Vv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Zv=Q,Jv=X,Il=Zv&&Jv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ce={},Yv=G,vs=ge,wi=Yv.document,Xv=vs(wi)&&vs(wi.createElement),Mn=function(e){return Xv?wi.createElement(e):{}},qv=Q,Qv=X,eh=Mn,El=!qv&&!Qv(function(){return Object.defineProperty(eh("div"),"a",{get:function(){return 7}}).a!==7}),th=jn,Nr=Function.prototype.call,te=th?Nr.bind(Nr):function(){return Nr.apply(Nr,arguments)},ua=G,rh=W,nh=function(e){return rh(e)?e:void 0},Pe=function(e,t){return arguments.length<2?nh(ua[e]):ua[e]&&ua[e][t]},ah=H,Fn=ah({}.isPrototypeOf),ih=Pe,oh=W,sh=Fn,ch=Sl,uh=Object,Tl=ch?function(e){return typeof e=="symbol"}:function(e){var t=ih("Symbol");return oh(t)&&sh(t.prototype,uh(e))},lh=String,zn=function(e){try{return lh(e)}catch{return"Object"}},fh=W,dh=zn,vh=TypeError,Ae=function(e){if(fh(e))return e;throw new vh(dh(e)+" is not a function")},hh=Ae,ph=Nn,io=function(e,t){var r=e[t];return ph(r)?void 0:hh(r)},la=te,fa=W,da=ge,mh=TypeError,gh=function(e,t){var r,n;if(t==="string"&&fa(r=e.toString)&&!da(n=la(r,e))||fa(r=e.valueOf)&&!da(n=la(r,e))||t!=="string"&&fa(r=e.toString)&&!da(n=la(r,e)))return n;throw new mh("Can't convert object to primitive value")},yh=te,hs=ge,ps=Tl,wh=io,bh=gh,Sh=q,$h=TypeError,Ih=Sh("toPrimitive"),Eh=function(e,t){if(!hs(e)||ps(e))return e;var r=wh(e,Ih),n;if(r){if(t===void 0&&(t="default"),n=yh(r,e,t),!hs(n)||ps(n))return n;throw new $h("Can't convert object to primitive value")}return t===void 0&&(t="number"),bh(e,t)},Th=Eh,Ph=Tl,Pl=function(e){var t=Th(e,"string");return Ph(t)?t:t+""},Oh=Q,kh=El,_h=Il,Ur=Te,ms=Pl,Rh=TypeError,va=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,ha="enumerable",pa="configurable",ma="writable";Ce.f=Oh?_h?function(t,r,n){if(Ur(t),r=ms(r),Ur(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ma in n&&!n[ma]){var a=Ch(t,r);a&&a[ma]&&(t[r]=n.value,n={configurable:pa in n?n[pa]:a[pa],enumerable:ha in n?n[ha]:a[ha],writable:!1})}return va(t,r,n)}:va:function(t,r,n){if(Ur(t),r=ms(r),Ur(n),kh)try{return va(t,r,n)}catch{}if("get"in n||"set"in n)throw new Rh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Ah=Math.ceil,jh=Math.floor,Lh=Math.trunc||function(t){var r=+t;return(r>0?jh:Ah)(r)},Nh=Lh,oo=function(e){var t=+e;return t!==t||t===0?0:Nh(t)},Uh=oo,xh=Math.max,Dh=Math.min,Mh=function(e,t){var r=Uh(e);return r<0?xh(r+t,0):Dh(r,t)},Fh=oo,zh=Math.min,Bh=function(e){var t=Fh(e);return t>0?zh(t,9007199254740991):0},Hh=Bh,so=function(e){return Hh(e.length)},Kh=Er,Gh=Mh,Wh=so,gs=function(e){return function(t,r,n){var a=Kh(t),i=Wh(a);if(i===0)return!e&&-1;var o=Gh(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},Vh={includes:gs(!0),indexOf:gs(!1)},co={},Zh=H,ga=me,Jh=Er,Yh=Vh.indexOf,Xh=co,ys=Zh([].push),Ol=function(e,t){var r=Jh(e),n=0,a=[],i;for(i in r)!ga(Xh,i)&&ga(r,i)&&ys(a,i);for(;t.length>n;)ga(r,i=t[n++])&&(~Yh(a,i)||ys(a,i));return a},uo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qh=Ol,Qh=uo,kl=Object.keys||function(t){return qh(t,Qh)},ep=Q,tp=Il,rp=Ce,np=Te,ap=Er,ip=kl;$l.f=ep&&!tp?Object.defineProperties:function(t,r){np(t);for(var n=ap(r),a=ip(r),i=a.length,o=0,s;i>o;)rp.f(t,s=a[o++],n[s]);return t};var op=Pe,_l=op("document","documentElement"),sp=ml,cp=gl,ws=sp("keys"),lo=function(e){return ws[e]||(ws[e]=cp(e))},up=Te,lp=$l,bs=uo,fp=co,dp=_l,vp=Mn,hp=lo,Ss=">",$s="<",bi="prototype",Si="script",Rl=hp("IE_PROTO"),ya=function(){},Cl=function(e){return $s+Si+Ss+e+$s+"/"+Si+Ss},Is=function(e){e.write(Cl("")),e.close();var t=e.parentWindow.Object;return e=null,t},pp=function(){var e=vp("iframe"),t="java"+Si+":",r;return e.style.display="none",dp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Cl("document.F=Object")),r.close(),r.F},xr,cn=function(){try{xr=new ActiveXObject("htmlfile")}catch{}cn=typeof document<"u"?document.domain&&xr?Is(xr):pp():Is(xr);for(var e=bs.length;e--;)delete cn[bi][bs[e]];return cn()};fp[Rl]=!0;var Bn=Object.create||function(t,r){var n;return t!==null?(ya[bi]=up(t),n=new ya,ya[bi]=null,n[Rl]=t):n=cn(),r===void 0?n:lp.f(n,r)},mp=q,gp=Bn,yp=Ce.f,$i=mp("unscopables"),Ii=Array.prototype;Ii[$i]===void 0&&yp(Ii,$i,{configurable:!0,value:gp(null)});var wp=function(e){Ii[$i][e]=!0},Tr={},bp=G,Sp=W,Es=bp.WeakMap,$p=Sp(Es)&&/native code/.test(String(Es)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Ip=Q,Ep=Ce,Tp=vt,ht=Ip?function(e,t,r){return Ep.f(e,t,Tp(1,r))}:function(e,t,r){return e[t]=r,e},Pp=$p,Al=G,Op=ge,kp=ht,wa=me,ba=ao,_p=lo,Rp=co,Ts="Object already initialized",Ei=Al.TypeError,Cp=Al.WeakMap,gn,Sr,yn,Ap=function(e){return yn(e)?Sr(e):gn(e,{})},jp=function(e){return function(t){var r;if(!Op(t)||(r=Sr(t)).type!==e)throw new Ei("Incompatible receiver, "+e+" required");return r}};if(Pp||ba.state){var Oe=ba.state||(ba.state=new Cp);Oe.get=Oe.get,Oe.has=Oe.has,Oe.set=Oe.set,gn=function(e,t){if(Oe.has(e))throw new Ei(Ts);return t.facade=e,Oe.set(e,t),t},Sr=function(e){return Oe.get(e)||{}},yn=function(e){return Oe.has(e)}}else{var gt=_p("state");Rp[gt]=!0,gn=function(e,t){if(wa(e,gt))throw new Ei(Ts);return t.facade=e,kp(e,gt,t),t},Sr=function(e){return wa(e,gt)?e[gt]:{}},yn=function(e){return wa(e,gt)}}var Wt={set:gn,get:Sr,has:yn,enforce:Ap,getterFor:jp},fo={},vo={},jl={}.propertyIsEnumerable,Ll=Object.getOwnPropertyDescriptor,Lp=Ll&&!jl.call({1:2},1);vo.f=Lp?function(t){var r=Ll(this,t);return!!r&&r.enumerable}:jl;var Np=Q,Up=te,xp=vo,Dp=vt,Mp=Er,Fp=Pl,zp=me,Bp=El,Ps=Object.getOwnPropertyDescriptor;fo.f=Np?Ps:function(t,r){if(t=Mp(t),r=Fp(r),Bp)try{return Ps(t,r)}catch{}if(zp(t,r))return Dp(!Up(xp.f,t,r),t[r])};var Nl={exports:{}},Ti=Q,Hp=me,Ul=Function.prototype,Kp=Ti&&Object.getOwnPropertyDescriptor,ho=Hp(Ul,"name"),Gp=ho&&(function(){}).name==="something",Wp=ho&&(!Ti||Ti&&Kp(Ul,"name").configurable),xl={EXISTS:ho,PROPER:Gp,CONFIGURABLE:Wp},Vp=H,Zp=W,Pi=ao,Jp=Vp(Function.toString);Zp(Pi.inspectSource)||(Pi.inspectSource=function(e){return Jp(e)});var po=Pi.inspectSource,mo=H,Yp=X,Xp=W,Dr=me,Oi=Q,qp=xl.CONFIGURABLE,Qp=po,Dl=Wt,em=Dl.enforce,tm=Dl.get,Os=String,un=Object.defineProperty,rm=mo("".slice),nm=mo("".replace),am=mo([].join),im=Oi&&!Yp(function(){return un(function(){},"length",{value:8}).length!==8}),om=String(String).split("String"),sm=Nl.exports=function(e,t,r){rm(Os(t),0,7)==="Symbol("&&(t="["+nm(Os(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Dr(e,"name")||qp&&e.name!==t)&&(Oi?un(e,"name",{value:t,configurable:!0}):e.name=t),im&&r&&Dr(r,"arity")&&e.length!==r.arity&&un(e,"length",{value:r.arity});try{r&&Dr(r,"constructor")&&r.constructor?Oi&&un(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=em(e);return Dr(n,"source")||(n.source=am(om,typeof t=="string"?t:"")),e};Function.prototype.toString=sm(function(){return Xp(this)&&tm(this).source||Qp(this)},"toString");var Ml=Nl.exports,cm=W,um=Ce,lm=Ml,fm=no,ye=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(cm(r)&&lm(r,i,n),n.global)a?e[t]=r:fm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:um.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Fl={},dm=Ol,vm=uo,hm=vm.concat("length","prototype");Fl.f=Object.getOwnPropertyNames||function(t){return dm(t,hm)};var go={};go.f=Object.getOwnPropertySymbols;var pm=Pe,mm=H,gm=Fl,ym=go,wm=Te,bm=mm([].concat),Sm=pm("Reflect","ownKeys")||function(t){var r=gm.f(wm(t)),n=ym.f;return n?bm(r,n(t)):r},ks=me,$m=Sm,Im=fo,Em=Ce,zl=function(e,t,r){for(var n=$m(t),a=Em.f,i=Im.f,o=0;o<n.length;o++){var s=n[o];!ks(e,s)&&!(r&&ks(r,s))&&a(e,s,i(t,s))}},Tm=X,Pm=W,Om=/#|\.prototype\./,Pr=function(e,t){var r=_m[km(e)];return r===Cm?!0:r===Rm?!1:Pm(t)?Tm(t):!!t},km=Pr.normalize=function(e){return String(e).replace(Om,".").toLowerCase()},_m=Pr.data={},Rm=Pr.NATIVE="N",Cm=Pr.POLYFILL="P",Bl=Pr,Mr=G,Am=fo.f,jm=ht,Lm=ye,Nm=no,Um=zl,xm=Bl,ee=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Mr:a?o=Mr[r]||Nm(r,{}):o=Mr[r]&&Mr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Am(o,s),u=l&&l.value):u=o[s],i=xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Um(f,u)}(e.sham||u&&u.sham)&&jm(f,"sham",!0),Lm(o,s,f,e)}},Dm=X,Mm=!Dm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Fm=me,zm=W,Bm=xn,Hm=lo,Km=Mm,_s=Hm("IE_PROTO"),ki=Object,Gm=ki.prototype,yo=Km?ki.getPrototypeOf:function(e){var t=Bm(e);if(Fm(t,_s))return t[_s];var r=t.constructor;return zm(r)&&t instanceof r?r.prototype:t instanceof ki?Gm:null},Wm=X,Vm=W,Zm=ge,Rs=yo,Jm=ye,Ym=q,_i=Ym("iterator"),Hl=!1,ut,Sa,$a;[].keys&&($a=[].keys(),"next"in $a?(Sa=Rs(Rs($a)),Sa!==Object.prototype&&(ut=Sa)):Hl=!0);var Xm=!Zm(ut)||Wm(function(){var e={};return ut[_i].call(e)!==e});Xm&&(ut={});Vm(ut[_i])||Jm(ut,_i,function(){return this});var Kl={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Hl},qm=Ce.f,Qm=me,eg=q,Cs=eg("toStringTag"),Vt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Qm(e,Cs)&&qm(e,Cs,{configurable:!0,value:t})},tg=Kl.IteratorPrototype,rg=Bn,ng=vt,ag=Vt,ig=Tr,og=function(){return this},Gl=function(e,t,r,n){var a=t+" Iterator";return e.prototype=rg(tg,{next:ng(+!n,r)}),ag(e,a,!1),ig[a]=og,e},sg=H,cg=Ae,ug=function(e,t,r){try{return sg(cg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},lg=ge,fg=function(e){return lg(e)||e===null},dg=fg,vg=String,hg=TypeError,pg=function(e){if(dg(e))return e;throw new hg("Can't set "+vg(e)+" as a prototype")},mg=ug,gg=ge,yg=Un,wg=pg,wo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=mg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return yg(a),wg(i),gg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),bg=ee,Sg=te,Wl=xl,$g=W,Ig=Gl,As=yo,js=wo,Eg=Vt,Tg=ht,Ia=ye,Pg=q,Og=Tr,Vl=Kl,kg=Wl.PROPER,_g=Wl.CONFIGURABLE,Ls=Vl.IteratorPrototype,Fr=Vl.BUGGY_SAFARI_ITERATORS,Qt=Pg("iterator"),Ns="keys",er="values",Us="entries",Rg=function(){return this},Zl=function(e,t,r,n,a,i,o){Ig(r,t,n);var s=function(E){if(E===a&&d)return d;if(!Fr&&E&&E in l)return l[E];switch(E){case Ns:return function(){return new r(this,E)};case er:return function(){return new r(this,E)};case Us:return function(){return new r(this,E)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[Qt]||l["@@iterator"]||a&&l[a],d=!Fr&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=As(v.call(new e)),p!==Object.prototype&&p.next&&(As(p)!==Ls&&(js?js(p,Ls):$g(p[Qt])||Ia(p,Qt,Rg)),Eg(p,u,!0))),kg&&a===er&&c&&c.name!==er&&(_g?Tg(l,"name",er):(f=!0,d=function(){return Sg(c,this)})),a)if(S={values:s(er),keys:i?d:s(Ns),entries:s(Us)},o)for(g in S)(Fr||f||!(g in l))&&Ia(l,g,S[g]);else bg({target:t,proto:!0,forced:Fr||f},S);return l[Qt]!==d&&Ia(l,Qt,d,{name:a}),Og[t]=d,S},bo=function(e,t){return{value:e,done:t}},Cg=Er,So=wp,xs=Tr,Jl=Wt,Ag=Ce.f,jg=Zl,zr=bo,Lg=Q,Yl="Array Iterator",Ng=Jl.set,Ug=Jl.getterFor(Yl),xg=jg(Array,"Array",function(e,t){Ng(this,{type:Yl,target:Cg(e),index:0,kind:t})},function(){var e=Ug(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,zr(void 0,!0);switch(e.kind){case"keys":return zr(r,!1);case"values":return zr(t[r],!1)}return zr([r,t[r]],!1)},"values"),Ds=xs.Arguments=xs.Array;So("keys");So("values");So("entries");if(Lg&&Ds.name!=="values")try{Ag(Ds,"name",{value:"values"})}catch{}var Ms=G,Dg=Q,Mg=Object.getOwnPropertyDescriptor,Xl=function(e){if(!Dg)return Ms[e];var t=Mg(Ms,e);return t&&t.value},Fg=X,zg=q,Bg=Q,Fs=bv,Hg=zg("iterator"),Hn=!Fg(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),Fs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Fs||!Bg)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Hg]||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"}),zs=Ml,Kg=Ce,Kn=function(e,t,r){return r.get&&zs(r.get,t,{getter:!0}),r.set&&zs(r.set,t,{setter:!0}),Kg.f(e,t,r)},Gg=ye,Wg=function(e,t,r){for(var n in t)Gg(e,n,t[n],r);return e},Vg=Fn,Zg=TypeError,$o=function(e,t){if(Vg(t,e))return e;throw new Zg("Incorrect invocation")},Jg=Ln,Yg=H,Xg=function(e){if(Jg(e)==="Function")return Yg(e)},Bs=Xg,qg=Ae,Qg=jn,ey=Bs(Bs.bind),Zt=function(e,t){return qg(e),t===void 0?e:Qg?ey(e,t):function(){return e.apply(t,arguments)}},ty=q,ry=ty("toStringTag"),ql={};ql[ry]="z";var Io=String(ql)==="[object z]",ny=Io,ay=W,ln=Ln,iy=q,oy=iy("toStringTag"),sy=Object,cy=ln(function(){return arguments}())==="Arguments",uy=function(e,t){try{return e[t]}catch{}},Or=ny?ln:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=uy(t=sy(e),oy))=="string"?r:cy?ln(t):(n=ln(t))==="Object"&&ay(t.callee)?"Arguments":n},ly=Or,fy=String,Me=function(e){if(ly(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fy(e)},dy=Or,Hs=io,vy=Nn,hy=Tr,py=q,my=py("iterator"),Gn=function(e){if(!vy(e))return Hs(e,my)||Hs(e,"@@iterator")||hy[dy(e)]},gy=te,yy=Ae,wy=Te,by=zn,Sy=Gn,$y=TypeError,Eo=function(e,t){var r=arguments.length<2?Sy(e):t;if(yy(r))return wy(gy(r,e));throw new $y(by(e)+" is not iterable")},Iy=TypeError,pt=function(e,t){if(e<t)throw new Iy("Not enough arguments");return e},Ey=H,To=Ey([].slice),Ks=To,Ty=Math.floor,Ri=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=Ty(r/2),s=Ri(Ks(e,0,o),t),u=Ri(Ks(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Py=Ri,Ci=ee,Wn=G,Po=Xl,Br=te,Re=H,fr=Q,Ql=Hn,ef=ye,Oy=Kn,ky=Wg,_y=Vt,Ry=Gl,Oo=Wt,tf=$o,Ea=W,Cy=me,Ay=Zt,jy=Or,Ly=Te,rf=ge,ne=Me,Ny=Bn,Gs=vt,Ws=Eo,Uy=Gn,Hr=bo,yt=pt,xy=q,Dy=Py,My=xy("iterator"),Jt="URLSearchParams",nf=Jt+"Iterator",af=Oo.set,he=Oo.getterFor(Jt),Fy=Oo.getterFor(nf),Vs=Po("fetch"),wn=Po("Request"),dr=Po("Headers"),Ta=wn&&wn.prototype,Zs=dr&&dr.prototype,zy=Wn.RegExp,By=Wn.TypeError,of=Wn.decodeURIComponent,Hy=Wn.encodeURIComponent,Ky=Re("".charAt),Js=Re([].join),at=Re([].push),Ai=Re("".replace),Gy=Re([].shift),Ys=Re([].splice),Xs=Re("".split),Wy=Re("".slice),Vy=/\+/g,qs=Array(4),Zy=function(e){return qs[e-1]||(qs[e-1]=zy("((?:%[\\da-f]{2}){"+e+"})","gi"))},Jy=function(e){try{return of(e)}catch{return e}},Qs=function(e){var t=Ai(e,Vy," "),r=4;try{return of(t)}catch{for(;r;)t=Ai(t,Zy(r--),Jy);return t}},Yy=/[!'()~]|%20/g,Xy={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},qy=function(e){return Xy[e]},ec=function(e){return Ai(Hy(e),Yy,qy)},Pa=Ry(function(t,r){af(this,{type:nf,target:he(t).entries,index:0,kind:r})},Jt,function(){var t=Fy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Hr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Hr(a.key,!1);case"values":return Hr(a.value,!1)}return Hr([a.key,a.value],!1)},!0),sf=function(e){this.entries=[],this.url=null,e!==void 0&&(rf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?Ky(e,0)==="?"?Wy(e,1):e:ne(e)))};sf.prototype={type:Jt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Uy(e),n,a,i,o,s,u,f;if(r)for(n=Ws(e,r),a=n.next;!(i=Br(a,n)).done;){if(o=Ws(Ly(i.value)),s=o.next,(u=Br(s,o)).done||(f=Br(s,o)).done||!Br(s,o).done)throw new By("Expected sequence with length 2");at(t,{key:ne(u.value),value:ne(f.value)})}else for(var l in e)Cy(e,l)&&at(t,{key:l,value:ne(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Xs(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Xs(a,"="),at(t,{key:Qs(Gy(i)),value:Qs(Js(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],at(t,ec(n.key)+"="+ec(n.value));return Js(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Vn=function(){tf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=af(this,new sf(t));fr||(this.size=r.entries.length)},Ut=Vn.prototype;ky(Ut,{append:function(t,r){var n=he(this);yt(arguments.length,2),at(n.entries,{key:ne(t),value:ne(r)}),fr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=yt(arguments.length,1),n=t.entries,a=ne(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(Ys(n,s,1),o!==void 0)break}else s++}fr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=[],i=0;i<r.length;i++)r[i].key===n&&at(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=yt(arguments.length,1),a=ne(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=he(this);yt(arguments.length,1);for(var a=n.entries,i=!1,o=ne(t),s=ne(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?Ys(a,u--,1):(i=!0,f.value=s));i||at(a,{key:o,value:s}),fr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Dy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=Ay(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 Pa(this,"keys")},values:function(){return new Pa(this,"values")},entries:function(){return new Pa(this,"entries")}},{enumerable:!0});ef(Ut,My,Ut.entries,{name:"entries"});ef(Ut,"toString",function(){return he(this).serialize()},{enumerable:!0});fr&&Oy(Ut,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0});_y(Vn,Jt);Ci({global:!0,constructor:!0,forced:!Ql},{URLSearchParams:Vn});if(!Ql&&Ea(dr)){var Qy=Re(Zs.has),ew=Re(Zs.set),tc=function(e){if(rf(e)){var t=e.body,r;if(jy(t)===Jt)return r=e.headers?new dr(e.headers):new dr,Qy(r,"content-type")||ew(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Ny(e,{body:Gs(0,ne(t)),headers:Gs(0,r)})}return e};if(Ea(Vs)&&Ci({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Vs(t,arguments.length>1?tc(arguments[1]):{})}}),Ea(wn)){var Oa=function(t){return tf(this,Ta),new wn(t,arguments.length>1?tc(arguments[1]):{})};Ta.constructor=Oa,Oa.prototype=Ta,Ci({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Oa})}}var tw={URLSearchParams:Vn,getState:he},rw=ye,Zn=H,rc=Me,nw=pt,cf=URLSearchParams,Jn=cf.prototype,aw=Zn(Jn.append),nc=Zn(Jn.delete),iw=Zn(Jn.forEach),ow=Zn([].push),ko=new cf("a=1&a=2&b=3");ko.delete("a",1);ko.delete("b",void 0);ko+""!="a=2"&&rw(Jn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return nc(this,e);var n=[];iw(this,function(c,d){ow(n,{key:d,value:c})}),nw(t,1);for(var a=rc(e),i=rc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,nc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||aw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var sw=ye,uf=H,cw=Me,uw=pt,lf=URLSearchParams,_o=lf.prototype,lw=uf(_o.getAll),fw=uf(_o.has),ac=new lf("a=1");(ac.has("a",2)||!ac.has("a",void 0))&&sw(_o,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return fw(this,t);var a=lw(this,t);uw(r,1);for(var i=cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var dw=Q,vw=H,hw=Kn,ji=URLSearchParams.prototype,pw=vw(ji.forEach);dw&&!("size"in ji)&&hw(ji,"size",{get:function(){var t=0;return pw(this,function(){t++}),t},configurable:!0,enumerable:!0});var mw=G,Ro=mw,gw=Ro;gw.URLSearchParams;var Co=H,yw=oo,ww=Me,bw=Un,Sw=Co("".charAt),ic=Co("".charCodeAt),$w=Co("".slice),oc=function(e){return function(t,r){var n=ww(bw(t)),a=yw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=ic(n,a),o<55296||o>56319||a+1===i||(s=ic(n,a+1))<56320||s>57343?e?Sw(n,a):o:e?$w(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},ff={codeAt:oc(!1),charAt:oc(!0)},Iw=ff.charAt,Ew=Me,df=Wt,Tw=Zl,sc=bo,vf="String Iterator",Pw=df.set,Ow=df.getterFor(vf);Tw(String,"String",function(e){Pw(this,{type:vf,string:Ew(e),index:0})},function(){var t=Ow(this),r=t.string,n=t.index,a;return n>=r.length?sc(void 0,!0):(a=Iw(r,n),t.index+=a.length,sc(a,!1))});var cc=Q,kw=H,_w=te,Rw=X,ka=kl,Cw=go,Aw=vo,jw=xn,Lw=hl,wt=Object.assign,uc=Object.defineProperty,Nw=kw([].concat),Uw=!wt||Rw(function(){if(cc&&wt({b:1},wt(uc({},"a",{enumerable:!0,get:function(){uc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),wt({},e)[r]!==7||ka(wt({},t)).join("")!==n})?function(t,r){for(var n=jw(t),a=arguments.length,i=1,o=Cw.f,s=Aw.f;a>i;)for(var u=Lw(arguments[i++]),f=o?Nw(ka(u),o(u)):ka(u),l=f.length,c=0,d;l>c;)d=f[c++],(!cc||_w(s,u,d))&&(n[d]=u[d]);return n}:wt,xw=te,lc=Te,Dw=io,hf=function(e,t,r){var n,a;lc(e);try{if(n=Dw(e,"return"),!n){if(t==="throw")throw r;return r}n=xw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return lc(n),r},Mw=Te,Fw=hf,zw=function(e,t,r,n){try{return n?t(Mw(r)[0],r[1]):t(r)}catch(a){Fw(e,"throw",a)}},Bw=q,Hw=Tr,Kw=Bw("iterator"),Gw=Array.prototype,pf=function(e){return e!==void 0&&(Hw.Array===e||Gw[Kw]===e)},Ww=H,Vw=X,mf=W,Zw=Or,Jw=Pe,Yw=po,gf=function(){},yf=Jw("Reflect","construct"),Ao=/^\s*(?:class|function)\b/,Xw=Ww(Ao.exec),qw=!Ao.test(gf),tr=function(t){if(!mf(t))return!1;try{return yf(gf,[],t),!0}catch{return!1}},wf=function(t){if(!mf(t))return!1;switch(Zw(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qw||!!Xw(Ao,Yw(t))}catch{return!0}};wf.sham=!0;var bf=!yf||Vw(function(){var e;return tr(tr.call)||!tr(Object)||!tr(function(){e=!0})||e})?wf:tr,Qw=Q,eb=Ce,tb=vt,rb=function(e,t,r){Qw?eb.f(e,t,tb(0,r)):e[t]=r},nb=Zt,ab=te,ib=xn,ob=zw,sb=pf,cb=bf,ub=so,fc=rb,lb=Eo,fb=Gn,dc=Array,db=function(t){var r=ib(t),n=cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=nb(i,a>2?arguments[2]:void 0));var s=fb(r),u=0,f,l,c,d,v,p;if(s&&!(this===dc&&sb(s)))for(l=n?new this:[],d=lb(r,s),v=d.next;!(c=ab(v,d)).done;u++)p=o?ob(d,i,[c.value,u],!0):c.value,fc(l,u,p);else for(f=ub(r),l=n?new this(f):dc(f);f>u;u++)p=o?i(r[u],u):r[u],fc(l,u,p);return l.length=u,l},mt=H,_a=2147483647,vr=36,Sf=1,Li=26,vb=38,hb=700,pb=72,mb=128,gb="-",yb=/[^\0-\u007E]/,$f=/[.\u3002\uFF0E\uFF61]/g,vc="Overflow: input needs wider integers to process",Ra=vr-Sf,hc=RangeError,wb=mt($f.exec),kt=Math.floor,Ca=String.fromCharCode,pc=mt("".charCodeAt),If=mt([].join),We=mt([].push),bb=mt("".replace),Sb=mt("".split),$b=mt("".toLowerCase),Ib=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=pc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=pc(e,r++);(i&64512)===56320?We(t,((a&1023)<<10)+(i&1023)+65536):(We(t,a),r--)}else We(t,a)}return t},mc=function(e){return e+22+75*(e<26)},Eb=function(e,t,r){var n=0;for(e=r?kt(e/hb):e>>1,e+=kt(e/t);e>Ra*Li>>1;)e=kt(e/Ra),n+=vr;return kt(n+(Ra+1)*e/(e+vb))},Tb=function(e){var t=[];e=Ib(e);var r=e.length,n=mb,a=0,i=pb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&We(t,Ca(s));var u=t.length,f=u;for(u&&We(t,gb);f<r;){var l=_a;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((_a-a)/c))throw new hc(vc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>_a)throw new hc(vc);if(s===n){for(var d=a,v=vr;;){var p=v<=i?Sf:v>=i+Li?Li:v-i;if(d<p)break;var S=d-p,g=vr-p;We(t,Ca(mc(p+S%g))),d=kt(S/g),v+=vr}We(t,Ca(mc(d))),i=Eb(a,c,f===u),a=0,f++}}a++,n++}return If(t,"")},Pb=function(e){var t=[],r=Sb(bb($b(e),$f,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],We(t,wb(yb,a)?"xn--"+Tb(a):a);return If(t,".")},Ob=ee,jo=Q,kb=Hn,Lo=G,gc=Zt,we=H,bn=ye,fe=Kn,_b=$o,Ni=me,No=Uw,bt=db,be=To,Rb=ff.codeAt,Cb=Pb,Ne=Me,Ab=Vt,jb=pt,Ef=tw,Tf=Wt,Lb=Tf.set,Sn=Tf.getterFor("URL"),Nb=Ef.URLSearchParams,Ub=Ef.getState,rr=Lo.URL,Ui=Lo.TypeError,$n=Lo.parseInt,xb=Math.floor,yc=Math.pow,pe=we("".charAt),Ie=we(/./.exec),sr=we([].join),Db=we(1 .toString),Mb=we([].pop),Et=we([].push),Aa=we("".replace),Fb=we([].shift),zb=we("".split),hr=we("".slice),In=we("".toLowerCase),Bb=we([].unshift),Hb="Invalid authority",ja="Invalid scheme",Xe="Invalid host",wc="Invalid port",Pf=/[a-z]/i,Kb=/[\d+-.a-z]/i,xi=/\d/,Gb=/^0x/i,Wb=/^[0-7]+$/,Vb=/^\d+$/,Of=/^[\da-f]+$/i,Zb=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Jb=/[\0\t\n\r #/:<>?@[\\\]^|]/,Yb=/^[\u0000-\u0020]+/,Xb=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,qb=/[\t\n\r]/g,de,Qb=function(e){var t=zb(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&pe(i,0)==="0"&&(o=Ie(Gb,i)?16:8,i=hr(i,o===8?1:2)),i==="")s=0;else{if(!Ie(o===10?Vb:o===8?Wb:Of,i))return e;s=$n(i,o)}Et(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=yc(256,5-r))return null}else if(s>255)return null;for(u=Mb(n),a=0;a<n.length;a++)u+=n[a]*yc(256,3-a);return u},eS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return pe(e,a)};if(d()===":"){if(pe(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ie(Of,d());)i=i*16+$n(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ie(xi,d()))return;for(;Ie(xi,d());){if(f=$n(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},tS=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},nr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)Bb(t,e%256),e=xb(e/256);return sr(t,".")}else if(typeof e=="object"){for(t="",n=tS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Db(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},fn={},kf=No({},fn,{" ":1,'"':1,"<":1,">":1,"`":1}),_f=No({},kf,{"#":1,"?":1,"{":1,"}":1}),La=No({},_f,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Be=function(e,t){var r=Rb(e,0);return r>32&&r<127&&!Ni(t,e)?e:encodeURIComponent(e)},Kr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},cr=function(e,t){var r;return e.length===2&&Ie(Pf,pe(e,0))&&((r=pe(e,1))===":"||!t&&r==="|")},bc=function(e){var t;return e.length>1&&cr(hr(e,0,2))&&(e.length===2||(t=pe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},rS=function(e){return e==="."||In(e)==="%2e"},nS=function(e){return e=In(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Na={},Sc={},Ua={},$c={},Ic={},xa={},Ec={},Tc={},Gr={},Wr={},Da={},Ma={},Fa={},za={},Pc={},Ba={},St={},ke={},Oc={},qe={},Le={},Uo=function(e,t,r){var n=Ne(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Ui(i);this.searchParams=null}else{if(r!==void 0&&(a=new Uo(r,!0)),i=this.parse(n,null,a),i)throw new Ui(i);o=Ub(new Nb),o.bindURL(this),this.searchParams=o}};Uo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Na,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ne(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=Aa(e,Yb,""),e=Aa(e,Xb,"$1")),e=Aa(e,qb,""),l=bt(e);i<=l.length;){switch(c=l[i],a){case Na:if(c&&Ie(Pf,c))o+=In(c),a=Sc;else{if(t)return ja;a=Ua;continue}break;case Sc:if(c&&(Ie(Kb,c)||c==="+"||c==="-"||c==="."))o+=In(c);else if(c===":"){if(t&&(n.isSpecial()!==Ni(Kr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Kr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=za:n.isSpecial()&&r&&r.scheme===n.scheme?a=$c:n.isSpecial()?a=Tc:l[i+1]==="/"?(a=Ic,i++):(n.cannotBeABaseURL=!0,Et(n.path,""),a=Oc)}else{if(t)return ja;o="",a=Ua,i=0;continue}break;case Ua:if(!r||r.cannotBeABaseURL&&c!=="#")return ja;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=be(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Le;break}a=r.scheme==="file"?za:xa;continue;case $c:if(c==="/"&&l[i+1]==="/")a=Gr,i++;else{a=xa;continue}break;case Ic:if(c==="/"){a=Wr;break}else{a=ke;continue}case xa:if(n.scheme=r.scheme,c===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Ec;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query="",a=qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query,n.fragment="",a=Le;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.path.length--,a=ke;continue}break;case Ec:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Gr;else if(c==="/")a=Wr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=ke;continue}break;case Tc:if(a=Gr,c!=="/"||pe(o,i+1)!=="/")continue;i++;break;case Gr:if(c!=="/"&&c!=="\\"){a=Wr;continue}break;case Wr:if(c==="@"){s&&(o="%40"+o),s=!0,d=bt(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=Be(S,La);f?n.password+=g:n.username+=g}o=""}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return Hb;i-=bt(o).length+1,o="",a=Da}else o+=c;break;case Da:case Ma:if(t&&n.scheme==="file"){a=Ba;continue}else if(c===":"&&!u){if(o==="")return Xe;if(v=n.parseHost(o),v)return v;if(o="",a=Fa,t===Ma)return}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Xe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=St,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Fa:if(Ie(xi,c))o+=c;else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var E=$n(o,10);if(E>65535)return wc;n.port=n.isSpecial()&&E===Kr[n.scheme]?null:E,o=""}if(t)return;a=St;continue}else return wc;break;case za:if(n.scheme="file",c==="/"||c==="\\")a=Pc;else if(r&&r.scheme==="file")switch(c){case de:n.host=r.host,n.path=be(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=be(r.path),n.query="",a=qe;break;case"#":n.host=r.host,n.path=be(r.path),n.query=r.query,n.fragment="",a=Le;break;default:bc(sr(be(l,i),""))||(n.host=r.host,n.path=be(r.path),n.shortenPath()),a=ke;continue}else{a=ke;continue}break;case Pc:if(c==="/"||c==="\\"){a=Ba;break}r&&r.scheme==="file"&&!bc(sr(be(l,i),""))&&(cr(r.path[0],!0)?Et(n.path,r.path[0]):n.host=r.host),a=ke;continue;case Ba:if(c===de||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&cr(o))a=ke;else if(o===""){if(n.host="",t)return;a=St}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=St}continue}else o+=c;break;case St:if(n.isSpecial()){if(a=ke,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=qe;else if(!t&&c==="#")n.fragment="",a=Le;else if(c!==de&&(a=ke,c!=="/"))continue;break;case ke:if(c===de||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(nS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,"")):rS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,""):(n.scheme==="file"&&!n.path.length&&cr(o)&&(n.host&&(n.host=""),o=pe(o,0)+":"),Et(n.path,o)),o="",n.scheme==="file"&&(c===de||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Fb(n.path);c==="?"?(n.query="",a=qe):c==="#"&&(n.fragment="",a=Le)}else o+=Be(c,_f);break;case Oc:c==="?"?(n.query="",a=qe):c==="#"?(n.fragment="",a=Le):c!==de&&(n.path[0]+=Be(c,fn));break;case qe:!t&&c==="#"?(n.fragment="",a=Le):c!==de&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Be(c,fn));break;case Le:c!==de&&(n.fragment+=Be(c,kf));break}i++}},parseHost:function(e){var t,r,n;if(pe(e,0)==="["){if(pe(e,e.length-1)!=="]"||(t=eS(hr(e,1,-1)),!t))return Xe;this.host=t}else if(this.isSpecial()){if(e=Cb(e),Ie(Zb,e)||(t=Qb(e),t===null))return Xe;this.host=t}else{if(Ie(Jb,e))return Xe;for(t="",r=bt(e),n=0;n<r.length;n++)t+=Be(r[n],fn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Ni(Kr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!cr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=nr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+sr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Ui(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new xt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+nr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ne(e)+":",Na)},getUsername:function(){return this.username},setUsername:function(e){var t=bt(Ne(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Be(t[r],La)}},getPassword:function(){return this.password},setPassword:function(e){var t=bt(Ne(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Be(t[r],La)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?nr(e):nr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Da)},getHostname:function(){var e=this.host;return e===null?"":nr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ma)},getPort:function(){var e=this.port;return e===null?"":Ne(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ne(e),e===""?this.port=null:this.parse(e,Fa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+sr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,St))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ne(e),e===""?this.query=null:(pe(e,0)==="?"&&(e=hr(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ne(e),e===""){this.fragment=null;return}pe(e,0)==="#"&&(e=hr(e,1)),this.fragment="",this.parse(e,Le)},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var r=_b(this,re),n=jb(arguments.length,1)>1?arguments[1]:void 0,a=Lb(r,new Uo(t,!1,n));jo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},re=xt.prototype,ve=function(e,t){return{get:function(){return Sn(this)[e]()},set:t&&function(r){return Sn(this)[t](r)},configurable:!0,enumerable:!0}};jo&&(fe(re,"href",ve("serialize","setHref")),fe(re,"origin",ve("getOrigin")),fe(re,"protocol",ve("getProtocol","setProtocol")),fe(re,"username",ve("getUsername","setUsername")),fe(re,"password",ve("getPassword","setPassword")),fe(re,"host",ve("getHost","setHost")),fe(re,"hostname",ve("getHostname","setHostname")),fe(re,"port",ve("getPort","setPort")),fe(re,"pathname",ve("getPathname","setPathname")),fe(re,"search",ve("getSearch","setSearch")),fe(re,"searchParams",ve("getSearchParams")),fe(re,"hash",ve("getHash","setHash")));bn(re,"toJSON",function(){return Sn(this).serialize()},{enumerable:!0});bn(re,"toString",function(){return Sn(this).serialize()},{enumerable:!0});if(rr){var kc=rr.createObjectURL,_c=rr.revokeObjectURL;kc&&bn(xt,"createObjectURL",gc(kc,rr)),_c&&bn(xt,"revokeObjectURL",gc(_c,rr))}Ab(xt,"URL");Ob({global:!0,constructor:!0,forced:!kb,sham:!jo},{URL:xt});var aS=ee,iS=Pe,Rf=X,oS=pt,Rc=Me,sS=Hn,xo=iS("URL"),cS=sS&&Rf(function(){xo.canParse()}),uS=Rf(function(){return xo.canParse.length!==1});aS({target:"URL",stat:!0,forced:!cS||uS},{canParse:function(t){var r=oS(arguments.length,1),n=Rc(t),a=r<2||arguments[1]===void 0?void 0:Rc(arguments[1]);try{return!!new xo(n,a)}catch{return!1}}});var lS=ee,fS=Pe,dS=pt,Cc=Me,vS=Hn,hS=fS("URL");lS({target:"URL",stat:!0,forced:!vS},{parse:function(t){var r=dS(arguments.length,1),n=Cc(t),a=r<2||arguments[1]===void 0?void 0:Cc(arguments[1]);try{return new hS(n,a)}catch{return null}}});var pS=ee,mS=te;pS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mS(URL.prototype.toString,this)}});var gS=Ro;gS.URL;var yS={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},wS=Mn,Ha=wS("span").classList,Ac=Ha&&Ha.constructor&&Ha.constructor.prototype,bS=Ac===Object.prototype?void 0:Ac,jc=G,Cf=yS,SS=bS,ur=xg,Lc=ht,$S=Vt,IS=q,Ka=IS("iterator"),Ga=ur.values,Af=function(e,t){if(e){if(e[Ka]!==Ga)try{Lc(e,Ka,Ga)}catch{e[Ka]=Ga}if($S(e,t,!0),Cf[t]){for(var r in ur)if(e[r]!==ur[r])try{Lc(e,r,ur[r])}catch{e[r]=ur[r]}}}};for(var Wa in Cf)Af(jc[Wa]&&jc[Wa].prototype,Wa);Af(SS,"DOMTokenList");var ES=ge,TS=ht,PS=function(e,t){ES(t)&&"cause"in t&&TS(e,"cause",t.cause)},OS=H,jf=Error,kS=OS("".replace),_S=function(e){return String(new jf(e).stack)}("zxcasd"),Lf=/\n\s*at [^:]*:[^\n]*/,RS=Lf.test(_S),CS=function(e,t){if(RS&&typeof e=="string"&&!jf.prepareStackTrace)for(;t--;)e=kS(e,Lf,"");return e},AS=X,jS=vt,LS=!AS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",jS(1,7)),e.stack!==7):!0}),NS=ht,US=CS,xS=LS,Nc=Error.captureStackTrace,DS=function(e,t,r,n){xS&&(Nc?Nc(e,t):NS(e,"stack",US(r,n)))},MS=Zt,FS=te,zS=Te,BS=zn,HS=pf,KS=so,Uc=Fn,GS=Eo,WS=Gn,xc=hf,VS=TypeError,dn=function(e,t){this.stopped=e,this.result=t},Dc=dn.prototype,kr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=MS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&xc(f,"normal",I),new dn(!0,I)},E=function(I){return a?(zS(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=WS(e),!l)throw new VS(BS(e)+" is not iterable");if(HS(l)){for(c=0,d=KS(e);d>c;c++)if(v=E(e[c]),v&&Uc(Dc,v))return v;return new dn(!1)}f=GS(e,l)}for(p=i?e.next:f.next;!(S=FS(p,f)).done;){try{v=E(S.value)}catch(I){xc(f,"throw",I)}if(typeof v=="object"&&v&&Uc(Dc,v))return v}return new dn(!1)},ZS=Me,JS=function(e,t){return e===void 0?arguments.length<2?"":t:ZS(e)},YS=ee,XS=Fn,qS=yo,En=wo,QS=zl,Nf=Bn,Va=ht,Za=vt,e$=PS,t$=DS,r$=kr,n$=JS,a$=q,i$=a$("toStringTag"),Tn=Error,o$=[].push,Dt=function(t,r){var n=XS(Ja,this),a;En?a=En(new Tn,n?qS(this):Ja):(a=n?this:Nf(Ja),Va(a,i$,"Error")),r!==void 0&&Va(a,"message",n$(r)),t$(a,Dt,a.stack,1),arguments.length>2&&e$(a,arguments[2]);var i=[];return r$(t,o$,{that:i}),Va(a,"errors",i),a};En?En(Dt,Tn):QS(Dt,Tn,{name:!0});var Ja=Dt.prototype=Nf(Tn.prototype,{constructor:Za(1,Dt),message:Za(1,""),name:Za(1,"AggregateError")});YS({global:!0,constructor:!0,arity:2},{AggregateError:Dt});var s$=Io,c$=Or,u$=s$?{}.toString:function(){return"[object "+c$(this)+"]"},l$=Io,f$=ye,d$=u$;l$||f$(Object.prototype,"toString",d$,{unsafe:!0});var v$=G,h$=Ln,Yn=h$(v$.process)==="process",p$=Pe,m$=Kn,g$=q,y$=Q,Mc=g$("species"),w$=function(e){var t=p$(e);y$&&t&&!t[Mc]&&m$(t,Mc,{configurable:!0,get:function(){return this}})},b$=bf,S$=zn,$$=TypeError,I$=function(e){if(b$(e))return e;throw new $$(S$(e)+" is not a constructor")},Fc=Te,E$=I$,T$=Nn,P$=q,O$=P$("species"),Uf=function(e,t){var r=Fc(e).constructor,n;return r===void 0||T$(n=Fc(r)[O$])?t:E$(n)},k$=jn,xf=Function.prototype,zc=xf.apply,Bc=xf.call,_$=typeof Reflect=="object"&&Reflect.apply||(k$?Bc.bind(zc):function(){return Bc.apply(zc,arguments)}),R$=Dn,Df=/(?:ipad|iphone|ipod).*applewebkit/i.test(R$),ce=G,C$=_$,A$=Zt,Hc=W,j$=me,Mf=X,Kc=_l,L$=To,Gc=Mn,N$=pt,U$=Df,x$=Yn,Di=ce.setImmediate,Mi=ce.clearImmediate,D$=ce.process,Ya=ce.Dispatch,M$=ce.Function,Wc=ce.MessageChannel,F$=ce.String,Xa=0,pr={},Vc="onreadystatechange",$r,Qe,qa,Qa;Mf(function(){$r=ce.location});var Do=function(e){if(j$(pr,e)){var t=pr[e];delete pr[e],t()}},ei=function(e){return function(){Do(e)}},Zc=function(e){Do(e.data)},Jc=function(e){ce.postMessage(F$(e),$r.protocol+"//"+$r.host)};(!Di||!Mi)&&(Di=function(t){N$(arguments.length,1);var r=Hc(t)?t:M$(t),n=L$(arguments,1);return pr[++Xa]=function(){C$(r,void 0,n)},Qe(Xa),Xa},Mi=function(t){delete pr[t]},x$?Qe=function(e){D$.nextTick(ei(e))}:Ya&&Ya.now?Qe=function(e){Ya.now(ei(e))}:Wc&&!U$?(qa=new Wc,Qa=qa.port2,qa.port1.onmessage=Zc,Qe=A$(Qa.postMessage,Qa)):ce.addEventListener&&Hc(ce.postMessage)&&!ce.importScripts&&$r&&$r.protocol!=="file:"&&!Mf(Jc)?(Qe=Jc,ce.addEventListener("message",Zc,!1)):Vc in Gc("script")?Qe=function(e){Kc.appendChild(Gc("script"))[Vc]=function(){Kc.removeChild(this),Do(e)}}:Qe=function(e){setTimeout(ei(e),0)});var Ff={set:Di,clear:Mi},zf=function(){this.head=null,this.tail=null};zf.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var Bf=zf,z$=Dn,B$=/ipad|iphone|ipod/i.test(z$)&&typeof Pebble<"u",H$=Dn,K$=/web0s(?!.*chrome)/i.test(H$),Mt=G,G$=Xl,Yc=Zt,ti=Ff.set,W$=Bf,V$=Df,Z$=B$,J$=K$,ri=Yn,Xc=Mt.MutationObserver||Mt.WebKitMutationObserver,qc=Mt.document,Qc=Mt.process,Vr=Mt.Promise,Fi=G$("queueMicrotask"),$t,ni,ai,Zr,eu;if(!Fi){var Jr=new W$,Yr=function(){var e,t;for(ri&&(e=Qc.domain)&&e.exit();t=Jr.get();)try{t()}catch(r){throw Jr.head&&$t(),r}e&&e.enter()};!V$&&!ri&&!J$&&Xc&&qc?(ni=!0,ai=qc.createTextNode(""),new Xc(Yr).observe(ai,{characterData:!0}),$t=function(){ai.data=ni=!ni}):!Z$&&Vr&&Vr.resolve?(Zr=Vr.resolve(void 0),Zr.constructor=Vr,eu=Yc(Zr.then,Zr),$t=function(){eu(Yr)}):ri?$t=function(){Qc.nextTick(Yr)}:(ti=Yc(ti,Mt),$t=function(){ti(Yr)}),Fi=function(e){Jr.head||$t(),Jr.add(e)}}var Y$=Fi,X$=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},_r=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},q$=G,Rr=q$.Promise,Hf=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",Q$=Hf,eI=Yn,tI=!Q$&&!eI&&typeof window=="object"&&typeof document=="object",rI=G,mr=Rr,nI=W,aI=Bl,iI=po,oI=q,sI=tI,cI=Hf,ii=wl;mr&&mr.prototype;var uI=oI("species"),zi=!1,Kf=nI(rI.PromiseRejectionEvent),lI=aI("Promise",function(){var e=iI(mr),t=e!==String(mr);if(!t&&ii===66)return!0;if(!ii||ii<51||!/native code/.test(e)){var r=new mr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[uI]=n,zi=r.then(function(){})instanceof n,!zi)return!0}return!t&&(sI||cI)&&!Kf}),Cr={CONSTRUCTOR:lI,REJECTION_EVENT:Kf,SUBCLASSING:zi},Fe={},tu=Ae,fI=TypeError,dI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new fI("Bad Promise constructor");t=n,r=a}),this.resolve=tu(t),this.reject=tu(r)};Fe.f=function(e){return new dI(e)};var vI=ee,Pn=Yn,Je=G,Ft=te,ru=ye,nu=wo,hI=Vt,pI=w$,mI=Ae,vn=W,gI=ge,yI=$o,wI=Uf,Gf=Ff.set,Mo=Y$,bI=X$,SI=_r,$I=Bf,Wf=Wt,On=Rr,Fo=Cr,Vf=Fe,Xn="Promise",Zf=Fo.CONSTRUCTOR,II=Fo.REJECTION_EVENT,EI=Fo.SUBCLASSING,oi=Wf.getterFor(Xn),TI=Wf.set,Tt=On&&On.prototype,tt=On,Xr=Tt,Jf=Je.TypeError,Bi=Je.document,zo=Je.process,Hi=Vf.f,PI=Hi,OI=!!(Bi&&Bi.createEvent&&Je.dispatchEvent),Yf="unhandledrejection",kI="rejectionhandled",au=0,Xf=1,_I=2,Bo=1,qf=2,qr,iu,RI,ou,Qf=function(e){var t;return gI(e)&&vn(t=e.then)?t:!1},ed=function(e,t){var r=t.value,n=t.state===Xf,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===qf&&AI(t),t.rejection=Bo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new Jf("Promise-chain cycle")):(f=Qf(u))?Ft(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},td=function(e,t){e.notified||(e.notified=!0,Mo(function(){for(var r=e.reactions,n;n=r.get();)ed(n,e);e.notified=!1,t&&!e.rejection&&CI(e)}))},rd=function(e,t,r){var n,a;OI?(n=Bi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Je.dispatchEvent(n)):n={promise:t,reason:r},!II&&(a=Je["on"+e])?a(n):e===Yf&&bI("Unhandled promise rejection",r)},CI=function(e){Ft(Gf,Je,function(){var t=e.facade,r=e.value,n=su(e),a;if(n&&(a=SI(function(){Pn?zo.emit("unhandledRejection",r,t):rd(Yf,t,r)}),e.rejection=Pn||su(e)?qf:Bo,a.error))throw a.value})},su=function(e){return e.rejection!==Bo&&!e.parent},AI=function(e){Ft(Gf,Je,function(){var t=e.facade;Pn?zo.emit("rejectionHandled",t):rd(kI,t,e.value)})},_t=function(e,t,r){return function(n){e(t,n,r)}},At=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=_I,td(e,!0))},Ki=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new Jf("Promise can't be resolved itself");var n=Qf(t);n?Mo(function(){var a={done:!1};try{Ft(n,t,_t(Ki,a,e),_t(At,a,e))}catch(i){At(a,i,e)}}):(e.value=t,e.state=Xf,td(e,!1))}catch(a){At({done:!1},a,e)}}};if(Zf&&(tt=function(t){yI(this,Xr),mI(t),Ft(qr,this);var r=oi(this);try{t(_t(Ki,r),_t(At,r))}catch(n){At(r,n)}},Xr=tt.prototype,qr=function(t){TI(this,{type:Xn,done:!1,notified:!1,parent:!1,reactions:new $I,rejection:!1,state:au,value:void 0})},qr.prototype=ru(Xr,"then",function(t,r){var n=oi(this),a=Hi(wI(this,tt));return n.parent=!0,a.ok=vn(t)?t:!0,a.fail=vn(r)&&r,a.domain=Pn?zo.domain:void 0,n.state===au?n.reactions.add(a):Mo(function(){ed(a,n)}),a.promise}),iu=function(){var e=new qr,t=oi(e);this.promise=e,this.resolve=_t(Ki,t),this.reject=_t(At,t)},Vf.f=Hi=function(e){return e===tt||e===RI?new iu(e):PI(e)},vn(On)&&Tt!==Object.prototype)){ou=Tt.then,EI||ru(Tt,"then",function(t,r){var n=this;return new tt(function(a,i){Ft(ou,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Tt.constructor}catch{}nu&&nu(Tt,Xr)}vI({global:!0,constructor:!0,wrap:!0,forced:Zf},{Promise:tt});hI(tt,Xn,!1);pI(Xn);var jI=q,nd=jI("iterator"),ad=!1;try{var LI=0,cu={next:function(){return{done:!!LI++}},return:function(){ad=!0}};cu[nd]=function(){return this},Array.from(cu,function(){throw 2})}catch{}var NI=function(e,t){try{if(!t&&!ad)return!1}catch{return!1}var r=!1;try{var n={};n[nd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},UI=Rr,xI=NI,DI=Cr.CONSTRUCTOR,qn=DI||!xI(function(e){UI.all(e).then(void 0,function(){})}),MI=ee,FI=te,zI=Ae,BI=Fe,HI=_r,KI=kr,GI=qn;MI({target:"Promise",stat:!0,forced:GI},{all:function(t){var r=this,n=BI.f(r),a=n.resolve,i=n.reject,o=HI(function(){var s=zI(r.resolve),u=[],f=0,l=1;KI(t,function(c){var d=f++,v=!1;l++,FI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var WI=ee,VI=Cr.CONSTRUCTOR,Gi=Rr,ZI=Pe,JI=W,YI=ye,uu=Gi&&Gi.prototype;WI({target:"Promise",proto:!0,forced:VI,real:!0},{catch:function(e){return this.then(void 0,e)}});if(JI(Gi)){var lu=ZI("Promise").prototype.catch;uu.catch!==lu&&YI(uu,"catch",lu,{unsafe:!0})}var XI=ee,qI=te,QI=Ae,e0=Fe,t0=_r,r0=kr,n0=qn;XI({target:"Promise",stat:!0,forced:n0},{race:function(t){var r=this,n=e0.f(r),a=n.reject,i=t0(function(){var o=QI(r.resolve);r0(t,function(s){qI(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var a0=ee,i0=Fe,o0=Cr.CONSTRUCTOR;a0({target:"Promise",stat:!0,forced:o0},{reject:function(t){var r=i0.f(this),n=r.reject;return n(t),r.promise}});var s0=Te,c0=ge,u0=Fe,id=function(e,t){if(s0(e),c0(t)&&t.constructor===e)return t;var r=u0.f(e),n=r.resolve;return n(t),r.promise},l0=ee,f0=Pe,d0=Cr.CONSTRUCTOR,v0=id;f0("Promise");l0({target:"Promise",stat:!0,forced:d0},{resolve:function(t){return v0(this,t)}});var h0=ee,p0=te,m0=Ae,g0=Fe,y0=_r,w0=kr,b0=qn;h0({target:"Promise",stat:!0,forced:b0},{allSettled:function(t){var r=this,n=g0.f(r),a=n.resolve,i=n.reject,o=y0(function(){var s=m0(r.resolve),u=[],f=0,l=1;w0(t,function(c){var d=f++,v=!1;l++,p0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var S0=ee,$0=te,I0=Ae,E0=Pe,T0=Fe,P0=_r,O0=kr,k0=qn,fu="No one promise resolved";S0({target:"Promise",stat:!0,forced:k0},{any:function(t){var r=this,n=E0("AggregateError"),a=T0.f(r),i=a.resolve,o=a.reject,s=P0(function(){var u=I0(r.resolve),f=[],l=0,c=1,d=!1;O0(t,function(v){var p=l++,S=!1;c++,$0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,fu)))})}),--c||o(new n(f,fu))});return s.error&&o(s.value),a.promise}});var _0=ee,R0=Fe;_0({target:"Promise",stat:!0},{withResolvers:function(){var t=R0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var C0=ee,kn=Rr,A0=X,od=Pe,sd=W,j0=Uf,du=id,L0=ye,Wi=kn&&kn.prototype,N0=!!kn&&A0(function(){Wi.finally.call({then:function(){}},function(){})});C0({target:"Promise",proto:!0,real:!0,forced:N0},{finally:function(e){var t=j0(this,od("Promise")),r=sd(e);return this.then(r?function(n){return du(t,e()).then(function(){return n})}:e,r?function(n){return du(t,e()).then(function(){throw n})}:e)}});if(sd(kn)){var vu=od("Promise").prototype.finally;Wi.finally!==vu&&L0(Wi,"finally",vu,{unsafe:!0})}var U0=Ro;U0.Promise;function Ye(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function _e(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ko(e,t){return e(t={exports:{}},t.exports),t.exports}var et=Ko(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Ho(et);var x0=Ho(Ko(function(e,t){var r=rt&&rt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function E(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,E)}I((v=v.apply(l,c||[])).next())})},n=rt&&rt.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return S={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function E(I){return function(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},a=rt;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,p,S,g,E,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(E=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:E,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,E;return n(this,function(I){switch(I.label){case 0:return[4,et.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(et.default().unlock(d),[2]):((E=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(E)),et.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(et.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var p=!1,S=Date.now(),g=!1;function E(){if(g||(window.removeEventListener("storage",E),l.removeFromWaiting(E),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(null)}}window.addEventListener("storage",E),l.addToWaiting(E);var I=setTimeout(E,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,et.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),et.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var E=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),E=!0)}}}E&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const D0={timeoutInSeconds:60},cd={name:"auth0-spa-js",version:"2.1.3"},ud=()=>Date.now();let se=class Vi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Vi.prototype)}static fromPayload({error:t,error_description:r}){return new Vi(t,r)}},M0=class ld extends se{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,ld.prototype)}},Zi=class fd extends se{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,fd.prototype)}},F0=class dd extends Zi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,dd.prototype)}},z0=class vd extends se{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,vd.prototype)}},B0=class hd extends se{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,hd.prototype)}},pd=class md extends se{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${hu(t,["default"])}', scope: '${hu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,md.prototype)}};function hu(e,t=[]){return e&&!t.includes(e)?e:""}const hn=()=>window.crypto,si=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(hn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},pu=e=>btoa(e),Ji=e=>{var{clientId:t}=e,r=_e(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()},mu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),H0=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},K0=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([H0(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},G0=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},W0=async(e,t,r,n,a,i,o=1e4)=>a?G0(e,t,r,n,o,a,i):K0(e,n,o);async function V0(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=_e(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?Ji(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let E,I=null;for(let C=0;C<3;C++)try{E=await W0(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=E.json,{error:h,error_description:$}=b,k=_e(b,["error","error_description"]),{ok:_}=E;if(!_){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new B0(h,C,k.mfa_token):h==="missing_refresh_token"?new pd(d,v):new se(h||"request_error",C)}return k}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||cd))}},t,s)}const Qr=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class Yi{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 Yi({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Yi({scope:r,audience:n,clientId:a})}},Z0=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@@"))}},gd=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)}}()}},J0=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||ud}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new it({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},Y0=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 ar=e=>typeof e=="number",X0=["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"],q0=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(mu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],X0.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(mu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!ar(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||!ar(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ar(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&&ar(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&&ar(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ot=Ko(function(e,t){var r=rt&&rt.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Ho(ot),ot.encode,ot.parse,ot.getAll;var Q0=ot.get,yd=ot.set,wd=ot.remove;const Pt={get(e){const t=Q0(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),yd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wd(e,r)}},eE={get(e){return Pt.get(e)||Pt.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),yd(`_legacy_${e}`,JSON.stringify(t),n),Pt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wd(e,r),Pt.remove(e,t),Pt.remove(`_legacy_${e}`,t)}},tE={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 rE(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
+
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var gu,yu,wu,ci,nE=(gu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",yu=null,wu=!1,function(e){return ci=ci||rE(gu,yu,wu),new Worker(ci,e)});const ui={};let aE=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 iE={memory:()=>new gd().enclosedCache,localstorage:()=>new Z0},bu=e=>iE[e],Su=e=>{const{openUrl:t,onRedirect:r}=e,n=_e(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},li=new x0;let oE=class{constructor(t){let r,n;if(this.userCache=new gd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await li.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(!hn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(hn().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",!ws(r))throw new Error(`Invalid cache location "${r}"`);n=ws(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?ht:Iw,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:$w;var i;this.scope=$r("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new yw(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Au,this.cacheManager=new gw(n,n.allKeys?void 0:new Tw(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 Pw)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ju)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Aa(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return bw({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=vs(ea()),i=vs(ea()),o=ea(),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 Ur().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:$r(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 uw(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(s),f(new cw(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=bs(t),{openUrl:a,fragment:i,appState:o}=n,c=Ie(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=Ie(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 sw(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:$r(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let c=ra[o];return c||(c=i().finally(()=>{delete ra[o],c=null}),ra[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=Ie(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})(()=>na.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ja;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 na.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:$r(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},ow),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new Xe({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=Ie(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Aa(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=bs(t),{openUrl:n}=r,a=Ie(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 ja),v()},1e3*g);I=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.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 Xe({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 Mu(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=Ie(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 Xe({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 Xe({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 pw(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 _w(e){const t=new Ow(e);return await t.checkSession(),t}var ye=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ye||{});const Rw="sesamy.com",Cw="sesamy.dev",jw="https://sesa.my",Ua="sesamyCacheTimestamp";function xe(e,t){return`https://${e}.${t==="dev"?Cw:Rw}`}let ie,Ku;const $t="sesamyAccessToken",aa="sesamyRefreshToken";async function Aw(e){if(!e)return null;const t=localStorage.getItem(aa);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(aa),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(aa,i.refresh_token),localStorage.setItem($t,i.access_token),i.access_token}catch{Gu()}}async function Ii(){const e=localStorage.getItem($t);if(!e)return null;const t=Wu(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await Aw(t);if(r)return r;localStorage.removeItem($t)}return e}function Ss(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 Lw(e){if(e.enabled===!1)return;Ku=e.organization;const t={domain:xe("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Ss(window.location.href)!==Ss(xe("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ie=await _w(t),window.location.search.includes("code="))try{await ie.handleRedirectCallback();const r=await ie.getUser();ze(ye.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 $i(){return await Ii()?!0:ie?ie.isAuthenticated():!1}async function Uw(){return await Ii()?{sub:"local",name:"Local User"}:ie?ie.getUser():null}function ki(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:Ku,redirect_uri:window.location.href,...t}})}async function zt(e=!0){const t=Ii();if(t)return t;try{return ie?await ie.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Gu(e={}){if(localStorage.removeItem($t),ze(ye.LOGOUT,{}),!!ie)return ie.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Wu(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 Vu(e){const t=Wu(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem($t,e),ze(ye.AUTHENTICATED,t)}const xw=(e,t)=>t.skipDedupe||t.method!=="GET",Nw=(e,t)=>t.method+"@"+e,Dw=e=>e.clone(),Is=({skip:e=xw,key:t=Nw,resolver:r=Dw}={})=>{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)}}},Mw=(e,t)=>e*t,Fw=e=>e&&e.ok,$s=({delayTimer:e=500,delayRamp:t=Mw,maxAttempts:r=10,until:n=Fw,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)})},zw="application/json",Zu="Content-Type",ft=Symbol(),Yu=Symbol();function ks(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Zu.toLowerCase()))===null||t===void 0?void 0:t[1]}function Ps(e){return/^application\/.*json.*/.test(e)}const Qe=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]=Qe(o,i,r):n[a]=i,n},{...e})},kt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function Hw(e,t=!1){kt.options=t?e:Qe(kt.options,e)}function Bw(e,t=!1){kt.polyfills=t?e:Qe(kt.polyfills,e)}function Kw(e){kt.errorType=e}const Gw=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Ju extends Error{}const Ww=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=Qe(a.options,n);let s=r;const d=Gw(c)((b,v)=>(s=b,a.polyfill("fetch")(b,v)))(r,u),h=new Error,m=d.catch(b=>{throw{[ft]:b}}).then(b=>{if(!b.ok){const v=new Ju;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(ft),O=I?v[ft]:v,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||I&&f.has(ft)&&f.get(ft);if(_)return _(O,e);const C=f.get(Yu);if(C)return C(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(ft,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)},Vw={_url:"",_options:{},_config:kt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:Qe(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:Qe(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:Qe(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Zu]: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(Yu,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=ks(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Ps(a));return n=r?o?n.json(r,a):n.body(r):n,Ww(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=ks(this._options.headers);return this.content(t||Ps(r)&&r||zw).body(JSON.stringify(e))}};function Ce(e="",t={}){return{...Vw,_url:e,_options:t}}Ce.default=Ce;Ce.options=Hw;Ce.errorType=Kw;Ce.polyfills=Bw;Ce.WretchError=Ju;function pe(){sessionStorage.removeItem(Ua),ze(ye.CLEAR_CACHE,{})}function Ts(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function Zw(e){const t=xe("api2",e.environment),r=w=>async(k,T)=>{let H=sessionStorage.getItem(Ua);H||(H=Date.now().toString(),sessionStorage.setItem(Ua,H));const ee={...T,headers:{...T.headers,"Cache-Timestamp":H}};return w(k,ee)},n=(w=!0)=>k=>async(T,H)=>{let ee=null;if(ee=await zt(w),!ee){if(w)throw new Error("No access token available");return k(T,H)}const Ae={...H,headers:{...H.headers,...ee?{Authorization:`Bearer ${ee}`}:{}}};return k(T,Ae)},a=w=>(k,T)=>{if(T.headers.Authorization)return w(k,T);const H=localStorage.getItem("__anon_id"),ee=btoa(`${H}:`),Ae={...T,headers:{...T.headers,Authorization:`Basic ${ee}`}};return w(k,Ae)},i=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Is(),$s({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,Is(),$s({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 ze(ye.USER_ATTRIBUTE_CHANGED,{}),pe(),T}async function P(w){const k=await i.url(`/user-metadata/${w}`).delete().res();return pe(),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 pe(),k.ok}async function _(w){const k=await i.url("/tags").post(w).res();return ze(ye.USER_ATTRIBUTE_CHANGED,{}),pe(),k.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const k=await o.url(`/tallies/${w}`).delete().res();return pe(),k.ok}async function G(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 zt(!1)?await i.url("/profile").get().json():null}async function z(w){const k=await i.url("/profile").patch(w).res();return pe(),k.ok}async function R(){return await i.url("/payment-issues").get().json()}async function B(){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 Te(w){const k=await zt(!1);if(!k)throw new Error("No access token available");const T=new URL(`${xe("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&&pe(),k}async function y(w,k=3600){const{shortlink:T}=await Ce(jw).post({url:w,ttl:k}).json();return T}async function E(w){const k=await zt(!1);let T;const H=w.language||Ts();switch(w.target){case"account":T=new URL(`${xe("account",e.environment)}/${H}/subscriptions/${e.clientId}`);break;case"consume":T=new URL(`${xe("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:Ts(),...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 W(){const w=await zt(!1),k=new URL(`${xe("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:C,getTallies:M,deleteTally:F,pushTally:G,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:p,isSpotifyLinked:B,unlinkSpotify:V,linkSpotify:Te,generateLink:E,openHostedAccountPage:W}}const Xu="@sesamy/sesamy-js",Pi="1.19.1";function Es(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 kr="undefined",Os="object",xa=function(){},qu="any",Qu="*",rt="__",Gr=typeof process<"u"?process:{};Gr.env&&Gr.env.NODE_ENV;var Z=typeof document<"u";Gr.versions!=null&&Gr.versions.node!=null;typeof Deno<"u"&&Deno.core;Z&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function el(e,t){return t.charAt(0)[e]()+t.slice(1)}var Yw=el.bind(null,"toUpperCase"),Jw=el.bind(null,"toLowerCase");function Xw(e){return tl(e)?Yw("null"):typeof e=="object"?tb(e):Object.prototype.toString.call(e).slice(8,-1)}function Wr(e,t){t===void 0&&(t=!0);var r=Xw(e);return t?Jw(r):r}function ur(e,t){return typeof t===e}var re=ur.bind(null,"function"),Me=ur.bind(null,"string"),mt=ur.bind(null,"undefined"),qw=ur.bind(null,"boolean");ur.bind(null,"symbol");function tl(e){return e===null}function Qw(e){return Wr(e)==="number"&&!isNaN(e)}function rl(e){return Wr(e)==="array"}function te(e){if(!eb(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function eb(e){return e&&(typeof e=="object"||e!==null)}function tb(e){return re(e.constructor)?e.constructor.name:null}function rb(e){return e instanceof Error||Me(e.message)&&e.constructor&&Qw(e.constructor.stackTraceLimit)}function nl(e,t){if(typeof t!="object"||tl(t))return!1;if(t instanceof e)return!0;var r=Wr(new e(""));if(rb(t))for(;t;){if(Wr(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}nl.bind(null,TypeError);nl.bind(null,SyntaxError);function on(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?nb(e,t):r}function nb(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function sn(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}sn(on,"form");sn(on,"button");sn(on,"input");sn(on,"select");function ab(e){return e?rl(e)?e:[e]:[]}function _s(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function ib(){if(Z){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function ob(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function sb(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=_s(r[1]),o=_s(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&&(cb(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n}(function(t){return Z&&window.location.search.substring(1)}())}function cb(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 cn(){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 ub(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 Xt="global",Pt=rt+"global"+rt,Tt=typeof self===Os&&self.self===self&&self||typeof global===Os&&global.global===global&&global||void 0;function nt(e){return Tt[Pt][e]}function at(e,t){return Tt[Pt][e]=t}function jt(e){delete Tt[Pt][e]}function At(e,t,r){var n;try{if(Ti(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Tt[Pt]||(Tt[Pt]={});var Pr={};function Ti(e){if(typeof Pr[e]!==kr)return Pr[e];try{var t=window[e];t.setItem(kr,kr),t.removeItem(kr)}catch{return Pr[e]=!1}return Pr[e]=!0}function A(){return A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}var Ne="function",Re="undefined",lb="@@redux/"+Math.random().toString(36),Rs=function(){return typeof Symbol===Ne&&Symbol.observable||"@@observable"}(),Tr=" != "+Ne;function al(e,t,r){var n;if(typeof t===Ne&&typeof r===Re&&(r=t,t=void 0),typeof r!==Re){if(typeof r!==Ne)throw new Error("enhancer"+Tr);return r(al)(e,t)}if(typeof e!==Ne)throw new Error("reducer"+Tr);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!==Ne)throw new Error("Listener"+Tr);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(!te(h))throw new Error("Act != obj");if(typeof h.type===Re)throw new Error("ActType "+Re);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!==Ne)throw new Error("next reducer"+Tr);a=h,d({type:"@@redux/INIT"})}})[Rs]=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)}}})[Rs]=function(){return this},h},n}function fb(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Re}function Et(){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 db(){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)}),A({},o,{dispatch:c=Et.apply(void 0,i)(o.dispatch)})}}}var Fe=rt+"anon_id",et=rt+"user_id",yt=rt+"user_traits",Ue="userId",gt="anonymousId",xr=["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"],Na=["name","EVENTS","config","loaded"],j=xr.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Cs=/^utm_/,js=/^an_prop_/,As=/^an_trait_/;function hb(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(Fe,o.anonymousId),f||t(et,o.userId),l.traits&&t(yt,A({},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(Cs)||S.match(/^(d|g)clid/)){var g=S.replace(Cs,"");m.campaign[g==="campaign"?"name":g]=i[S]}return S.match(js)&&(m.props[S.replace(js,"")]=i[S]),S.match(As)&&(m.traits[S.replace(As,"")]=i[S]),m},{campaign:{},props:{},traits:{}});r.dispatch(A({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 vb(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===j.setItemEnd){if(r.key===Fe)return A({},t,{anonymousId:r.value});if(r.key===et)return A({},t,{userId:r.value})}switch(r.type){case j.identify:return Object.assign({},t,{userId:r.userId,traits:A({},t.traits,r.traits)});case j.reset:return[et,Fe,yt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Ls(e){return{userId:e.getItem(et),anonymousId:e.getItem(Fe),traits:e.getItem(yt)}}var Da=function(e){return rt+"TEMP"+rt+e};function pb(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&&([et,yt,Fe].forEach(function(h){n(h)}),[Ue,gt,"traits"].forEach(function(h){jt(Da(h))})),c.type===j.identify){a(Fe)||r(Fe,cn());var s=a(et),d=a(yt)||{};s&&s!==l&&i.dispatch({type:j.userIdChanged,old:{userId:s,traits:d},new:{userId:l,traits:f},options:u}),l&&r(et,l),f&&r(yt,A({},d,f))}return o(c)}}}}var Wt={};function Us(e,t){Wt[e]&&re(Wt[e])&&(Wt[e](t),delete Wt[e])}function il(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(A({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return il(e,t,r-10).then(n,a)})})}function mb(e){return{abort:e}}function ol(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&&re(S)){var g,$=function(v,I){return v===void 0&&(v={}),I===void 0&&(I={}),[Ue,gt].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:mb}))&&te(g)&&g.abort)return void(n[$.meta.rid]=!0);if(!P){var b=m+":"+h;e.dispatch(A({},$,{type:b,_:{called:b,from:"queueDrain"}}))}}});var u=c.actions.filter(function(s,d){return!~f.processIndex.indexOf(d)});c.actions=u}}}var ia=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(wt),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 C=P.type.match(wt)?function(M,F,G,L,N){return function(z,R){var B=L?L.name:M,V=R&&rr(R)?R:G;if(L&&(!(V=R&&rr(R)?R:[M]).includes(M)||V.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(V)+" input valid");return A({},N,{abort:{reason:z,plugins:V,caller:F,_:B}})}}(O,_,$,v,P):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(P,_);return{payload:gb(P),instance:g,config:I||{},abort:C}}}(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(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&re(C.method)?(function(z,R){var B=Hs(z);if(B&&B.name===R){var V=Hs(B.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+B.method+" "+(V?"or "+V.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
-
`))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(G=F,L=b,N=C.pluginName,function(z,R){return A({},G,{abort:{reason:z,plugins:R||[L],caller:s,from:N||L}})}),config:Ds(C.pluginName,f,i),plugins:f})).then(function(z){var R=te(z)?z:{};return Promise.resolve(A({},F,R))})):F;var G,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 C=g[I]?g[I]:{};if(d&&(C=_),sa(C,I))return oa({data:C,method:s,instance:n,pluginName:I,store:c}),Promise.resolve(_);if(sa(_,I))return v&&oa({data:_,method:s,instance:n,store:c}),Promise.resolve(_);if(S.hasOwnProperty(I)&&S[I]===!0)return c.dispatch({type:"queue",plugin:I,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=m(g[I],i[I]);return Promise.resolve(O[s]({abort:M.abort,payload:C,instance:n,config:Ds(I,f,i),plugins:f})).then(function(F){var G=te(F)?F:{},L=A({},_,G),N=g[I];if(sa(N,I))oa({data:N,method:s,instance:n,pluginName:I,store:c});else{var z=s+":"+I;(z.match(/:/g)||[]).length<2&&!s.match(xs)&&!s.match(Ns)&&n.dispatch(A({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function($){if(!(s.match(wt)||s.match(/^registerPlugin/)||s.match(Ns)||s.match(xs)||s.match(/^params/)||s.match(/^userIdChanged/))){if(l.plugins.includes(s),$._&&$._.originalAction===s)return $;var P=A({},$,{_:{originalAction:$.type,called:$.type,from:"engineEnd"}});sl($,t.exact.length)&&!s.match(/End$/)&&(P=A({},P,{type:$.type+"Aborted"})),c.dispatch(P)}return $})})}catch(g){return Promise.reject(g)}},wt=/Start$/,xs=/^bootstrap/,Ns=/^ready/;function oa(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(A({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Ds(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ms(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Fs(e,t){var r=e.replace(wt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function sa(e,t){var r=e.abort;return!!r&&(r===!0||zs(r,t)||r&&zs(r.plugins,t))}function sl(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Me(r))return!0;var n=r.plugins;return rr(r)&&r.length===t||rr(n)&&n.length===t}function rr(e){return Array.isArray(e)}function zs(e,t){return!(!e||!rr(e))&&e.includes(t)}function Hs(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function gb(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=te(e[r])?Object.assign({},e[r]):e[r]),t},{})}function yb(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 Us(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 il(v,function(){return I({config:_})},1e4).then(function(C){return n[O]||(a.dispatch({type:j.pluginReadyType(O),name:O,events:Object.keys(v).filter(function(M){return!Na.includes(M)})}),n[O]=!0),S=S.concat(O),v}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(P).then(function(v){var I={plugins:S,failed:g,disabled:$};setTimeout(function(){h.length===P.length+$.length&&a.dispatch(A({},{type:j.ready},I))},0)})}var b=function(){if(f!==j.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return ol(a,t,e)},0),Promise.resolve(function(v,I,O,_,C){try{var M=re(I)?I():I,F=v.type,G=F.replace(wt,"");if(v._&&v._.called)return Promise.resolve(v);var L=O.getState(),N=(B=M,(V=L.plugins)===void 0&&(V={}),(Te=v.options)===void 0&&(Te={}),Object.keys(B).filter(function(p){var y=Te.plugins||{};return qw(y[p])?y[p]:y.all!==!1&&(!V[p]||V[p].enabled!==!1)}).map(function(p){return B[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=Fs(p).map(function(x){return Ms(x,y)});return y.reduce(function(x,D){var W=D.name,w=Fs(p,W).map(function(ee){return Ms(ee,y)}),k=w[0],T=w[1],H=w[2];return k.length&&(x.beforeNS[W]=k),T.length&&(x.duringNS[W]=T),H.length&&(x.afterNS[W]=H),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(ia({action:v,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:C})).then(function(p){function y(){var x=function(){if(F.match(wt))return Promise.resolve(ia({action:A({},E,{type:G+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Us(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return p}):p}if(sl(p,z.length))return p;var E,U=function(){if(F!==G)return Promise.resolve(ia({action:A({},p,{type:G}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:C})).then(function(x){E=x});E=p}();return U&&U.then?U.then(y):y()})}catch(p){return Promise.reject(p)}var B,V,Te}(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 wb(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 bb=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 Et.apply(void 0,o)(n)(a)}}}}};function Sb(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=Bs(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},A({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=Bs(r.type,j.initialize),f=e()[l];return f&&l?(n[l]=A({},t[l],{initialized:!0,loaded:!!f.loaded({config:f.config})}),A({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=A({},t[r.name],{loaded:!0}),A({},t,n);switch(r.type){case j.disablePlugin:return A({},t,Ks(r.plugins,!1,t));case j.enablePlugin:return A({},t,Ks(r.plugins,!0,t));default:return t}}}function Bs(e,t){return e.substring(t.length+1,e.length)}function Ks(e,t,r){return e.reduce(function(n,a){return n[a]=A({},r[a],{enabled:t}),n},r)}function cl(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var Ib={last:{},history:[]};function $b(e,t){e===void 0&&(e=Ib);var r=t.options,n=t.meta;if(t.type===j.track){var a=cl(A({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return A({},e,{last:a,history:e.history.concat(a)})}return e}var kb={actions:[]};function Pb(e,t){e===void 0&&(e=kb);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),A({},e,{actions:n});case"dequeue":return[];default:return e}}var ul=/#.*$/;function Tb(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(ul,""):"")}var ll,fl,dl,hl,Eb=function(e){if(e===void 0&&(e={}),!Z)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(Z){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(ul,"")}(f),s={title:r,url:u,path:Tb(u),hash:l,search:f,width:o,height:c};return n&&n!==""&&(s.referrer=n),A({},s,e)},Ob={last:{},history:[]};function _b(e,t){e===void 0&&(e=Ob);var r=t.options;if(t.type===j.page){var n=cl(A({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return A({},e,{last:n,history:e.history.concat(n)})}return e}ll=function(){if(!Z)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"}(),fl=Z?document.referrer:null,dl=ib(),hl=ob();var Gs={initialized:!1,sessionId:cn(),app:null,version:null,debug:!1,offline:!!Z&&!navigator.onLine,os:{name:ll},userAgent:Z?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:hl,locale:dl,campaign:{},referrer:fl};function Rb(e,t){e===void 0&&(e=Gs);var r=e.initialized,n=t.campaign;switch(t.type){case j.campaign:return A({},e,{campaign:n});case j.offline:return A({},e,{offline:!0});case j.online:return A({},e,{offline:!1});default:return r?e:A({},Gs,e,{initialized:!0})}}var Cb=["plugins","reducers","storage"];function jb(e,t,r){if(Z){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function Ab(e){var t=jb.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function vl(){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 Tt[Pt].analytics.push(o.action||o),i(o)}})}}}function Ws(e){return function(){return Et(Et.apply(null,arguments),vl())}}function ca(e){return e?rl(e)?e:[e]:[]}function Vs(e,t,r){e===void 0&&(e={});var n,a,i=cn();return t&&(Wt[i]=(n=t,a=function(o){for(var c,l=o||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(re(l[f])){c=l[f];break}return c}(r),function(o){a&&a(o),n(o)})),A({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function Lb(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(p,y){if(re(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,W){var w;return D[W]=(w=y.methods[W],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:jt},i=function(p){return function(y,E,U){return E.getState("user")[y]||(U&&te(U)&&U[y]?U[y]:Ls(p)[y]||nt(Da(y))||null)}}(a),o=n.plugins,c=n.events.filter(function(p){return!Na.includes(p)}).sort(),l=new Set(c.concat(xr).filter(function(p){return!Na.includes(p)})),f=Array.from(l).sort(),u=function(){return o},s=new bb,d=s.addMiddleware,h=s.removeMiddleware,m=s.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=sb(),$=Ls(a),P=A({},$,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});P.anonymousId||(P.anonymousId=cn());var b=A({enable:function(p,y){return new Promise(function(E){R.dispatch({type:j.enablePlugin,plugins:ca(p),_:{originalAction:j.enablePlugin}},E,[y])})},disable:function(p,y){return new Promise(function(E){R.dispatch({type:j.disablePlugin,plugins:ca(p),_:{originalAction:j.disablePlugin}},E,[y])})}},n.methods),v=!1,I={identify:function(p,y,E,U){try{var x=Me(p)?p:null,D=te(p)?p:y,W=E||{},w=I.user();at(Da(Ue),x);var k=x||D.userId||i(Ue,I,D);return Promise.resolve(new Promise(function(T){R.dispatch(A({type:j.identifyStart,userId:k,traits:D||{},options:W,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=te(p)?p.event:p;if(!x||!Me(x))throw new Error("EventMissing");var D=te(p)?p:y||{},W=te(E)?E:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:j.trackStart,event:x,properties:D,options:W,userId:i(Ue,I,y),anonymousId:i(gt,I,y)},w,[y,E,U])}))}catch(w){return Promise.reject(w)}},page:function(p,y,E){try{var U=te(p)?p:{},x=te(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:j.pageStart,properties:Eb(U),options:x,userId:i(Ue,I,U),anonymousId:i(gt,I,U)},D,[p,y,E])}))}catch(D){return Promise.reject(D)}},user:function(p){if(p===Ue||p==="id")return i(Ue,I);if(p===gt||p==="anonId")return i(gt,I);var y=I.getState("user");return p?Es(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||!re(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,Er),d(x,Or),function(){h(U,Er),h(x,Or)}}var D=p.match(E)?Er:Or,W=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(W,D),function(){return h(W,D)}},once:function(p,y){if(!p||!re(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?Es(y,p):Object.assign({},y)},dispatch:function(p){var y=Me(p)?{type:p}:p;if(xr.includes(y.type))throw new Error("reserved action "+y.type);var E=A({},y,{_:A({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(Fe,p,y)},events:{core:xr,plugins:c}},O=n.middlewares.concat([function(p){return function(y){return function(E){return E.meta||(E.meta=Vs()),y(E)}}},m(Er),yb(I,u,{all:f,plugins:c}),wb(a),hb(I),pb(I),m(Or)]),_={context:Rb,user:vb(a),page:_b,track:$b,plugins:Sb(u),queue:Pb},C=Et,M=Et;if(Z&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?vl():te(typeof arguments[0])?Ws():Ws().apply(null,arguments)}}var G,L=function(p){return Object.keys(p).reduce(function(y,E){return Cb.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=al(function(p){for(var y=Object.keys(p),E={},U=0;U<y.length;U++){var x=y[U];typeof p[x]===Ne&&(E[x]=p[x])}var D,W=Object.keys(E);try{(function(w){Object.keys(w).forEach(function(k){var T=w[k];if(typeof T(void 0,{type:"@@redux/INIT"})===Re||typeof T(void 0,{type:lb})===Re)throw new Error("reducer "+k+" "+Re)})})(E)}catch(w){D=w}return function(w,k){if(w===void 0&&(w={}),D)throw D;for(var T=!1,H={},ee=0;ee<W.length;ee++){var Ae=W[ee],Ai=w[Ae],fn=(0,E[Ae])(Ai,k);if(typeof fn===Re){var Ol=fb(Ae,k);throw new Error(Ol)}H[Ae]=fn,T=T||fn!==Ai}return T?H:w}}(A({},_,t)),z,M(C(db.apply(void 0,O))));R.dispatch=(G=R.dispatch,function(p,y,E){var U=A({},p,{meta:Vs(p.meta,y,ca(E))});return G.apply(null,[U])});var B=Object.keys(o);R.dispatch({type:j.bootstrap,plugins:B,config:L,params:g,user:P,initialUser:r,persistedUser:$});var V=B.filter(function(p){return n.pluginEnabled[p]}),Te=B.filter(function(p){return!n.pluginEnabled[p]});return R.dispatch({type:j.registerPlugins,plugins:B,enabled:n.pluginEnabled}),n.pluginsArray.map(function(p,y){var E=p.bootstrap,U=p.config,x=p.name;E&&re(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:Te})}),Ab(function(p){R.dispatch({type:p?j.offline:j.online})}),function(p,y,E){setInterval(function(){return ol(p,y,E)},3e3)}(R,u,I),I}var Er="before",Or="after",qt="cookie",Ye=gl(),pl=un,Ub=un;function ml(e){return Ye?un(e,"",-1):jt(e)}function gl(){if(Ye!==void 0)return Ye;var e="cookiecookie";try{un(e,e),Ye=document.cookie.indexOf(e)!==-1,ml(e)}catch{Ye=!1}return Ye}function un(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ye===!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 Qt="localStorage",xb=Ti.bind(null,"localStorage");At("localStorage","getItem",nt);At("localStorage","setItem",at);At("localStorage","removeItem",jt);var er="sessionStorage",Nb=Ti.bind(null,"sessionStorage");At("sessionStorage","getItem",nt);At("sessionStorage","setItem",at);At("sessionStorage","removeItem",jt);function bt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(te(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var Db=xb(),Mb=Nb(),Fb=gl();function yl(e,t){if(e){var r=Ei(t),n=!Ci(r),a=Oi(r)?bt(localStorage.getItem(e)):void 0;if(n&&!mt(a))return a;var i=_i(r)?bt(pl(e)):void 0;if(n&&i)return i;var o=Ri(r)?bt(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 zb(e,t,r){if(e&&!mt(t)){var n={},a=Ei(r),i=JSON.stringify(t),o=!Ci(a);return Oi(a)&&(n[Qt]=_r(Qt,t,bt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Qt]:_i(a)&&(n[qt]=_r(qt,t,bt(pl(e))),Ub(e,i),o)?n[qt]:Ri(a)&&(n[er]=_r(er,t,bt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[er]:(n[Xt]=_r(Xt,t,nt(e)),at(e,t),o?n[Xt]:n)}}function Hb(e,t){if(e){var r=Ei(t),n=yl(e,Qu),a={};return!mt(n.localStorage)&&Oi(r)&&(localStorage.removeItem(e),a[Qt]=n.localStorage),!mt(n.cookie)&&_i(r)&&(ml(e),a[qt]=n.cookie),!mt(n.sessionStorage)&&Ri(r)&&(sessionStorage.removeItem(e),a[er]=n.sessionStorage),!mt(n.global)&&ln(r,Xt)&&(jt(e),a[Xt]=n.global),a}}function Ei(e){return e?Me(e)?e:e.storage:qu}function Oi(e){return Db&&ln(e,Qt)}function _i(e){return Fb&&ln(e,qt)}function Ri(e){return Mb&&ln(e,er)}function Ci(e){return e===Qu||e==="all"}function ln(e,t){return e===qu||e===t||Ci(e)}function _r(e,t,r){return{location:e,current:t,previous:r}}var Bb={setItem:zb,getItem:yl,removeItem:Hb};function Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zs(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 Ys(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zs(Object(r),!0).forEach(function(n){Kb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zs(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:Bb};return Lb(Ys(Ys({},t),e))}function Wb(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 Vb(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=Yb(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),c.apply(r,l)}})}function Zb(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function Yb(e){return["#","?"].forEach(t=>e=Zb(e,t)),e}function Jb(){Vb(()=>{_e.page()})}function Xb(e){if(e===void 0&&(e={}),!Z)return xa;var t=Xs(),r=Ma(),n=Js(),a=Rr(n,t),i=Rr(r,t),o=[],c=[],l=[],f=n,u=a,s=i,d=Object.keys(e);if(!d.length)return xa;var h=d.map(function(S){return Number(S)}),m=ub(function(){var S=Xs(),g=function(L,N){return N.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),$=Ma(),P=Js(),b=Rr(P,S),v=Rr($,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,C=h;(O==="up"||I)&&(_=g.slice().reverse(),C=h.slice().reverse());var M=C.reduce(function(L,N,z){var R=_[z];return l.includes(N)&&P<=R&&(l=l.filter(function(B){return B!==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){re(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,G=M.direction;re(e[F])&&e[F]({trigger:F,direction:G,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(F)}}},500);return window.addEventListener("scroll",m),function(){return window.removeEventListener("scroll",m)}}function Ma(){return Z?document.body.scrollTop||document.documentElement.scrollTop:0}function qb(){return Z?window.innerHeight||document.documentElement.clientHeight:0}function Js(){return Math.round(Ma()+qb())}function Xs(){if(!Z)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function Rr(e,t){return Math.round(e/t*100)}var qs="EventListener";function Qb(e){return function(t,r,n,a){var i=n||xa,o=a||!1;if(!Z)return i;var c=Vr(r),l=Vr(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"+qs:"remove"+qs,h=0;h<l.length;h++){var m=l[h];f[h]=s?o&&o.once?eS(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 Vr(e,t){if(Me(e))return t?Vr(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=ab(e);return t?i.map(function(o){return Me(o)?Vr(o,!0):o}).flat():i}function eS(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var ua=Qb("Event");function wl(e,t){return Z&&re(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),re(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}wl.bind(null,"onerror");wl.bind(null,"onload");var bl=typeof window>"u",Qs="hidden";function tS(e){if(bl)return!1;var t=rS(),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 rS(){var e=["webkit","moz","ms","o"];return bl||Qs in document?Qs:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var nS=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function aS(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=tS(function(c){c||r({type:"tabVisible"})});return n=[o].concat(nS.map(function(c){return ua(document,c,r)})).concat(ua(window,"load",r)).concat(ua(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function iS(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(Ht(d),g),a&&u&&(u=!1,a(Ht(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(Ht(d),g))},c)}var S=aS(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:Ht(d,s),idle:u?Ht(r,s):0}}}}function Ht(e,t){return t?0:Math.round((new Date-e)/1e3)}const ec=5e3;class oS{constructor(t){oe(this,"element");oe(this,"isInViewport",!1);oe(this,"isAwake",!1);oe(this,"isFlushing");oe(this,"observer");oe(this,"lastEventAt",Date.now());oe(this,"registeredView",!1);oe(this,"viewCallback");oe(this,"activeDurationCallback");oe(this,"idleDurationCallback");oe(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),iS({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:ec}),Xb({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*ec: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 tc="sesamy_session_id";function sS(){let e=sessionStorage.getItem(tc);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(tc,e)),e}let Sl=!1,Fa,rc,Zr;const Il=new Map;function cS({clientId:e,enabled:t=!0,environment:r}){if(Fa=e,rc=t,Zr=`${xe("logs",r)}/events`,!rc)return;window.addEventListener("beforeunload",()=>{kl.forEach((a,i)=>{a.bind(i)()}),lS()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Il.forEach((a,i)=>{a.bind(i)()})}),Jb();const n=new oS({element:document.body,viewCallback:()=>{_e.page()},activeDurationCallback:(a,i,o)=>{_e.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{_e.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{_e.track("scroll",{scroll:a.scrollMax})}});fS(document.body,()=>{n.flush()}),dS(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ye.AUTHENTICATED,async a=>{const i=a;await _e.identify(i.detail.sub)}),window.addEventListener(ye.LOGOUT,async()=>{await _e.track("logout",{}),ji.flush(),await _e.reset()})}function $l(e){return JSON.stringify(e.map(t=>({...t,clientId:Fa,requestId:Math.random().toString(36).slice(2,9),sessionId:sS(),timestamp:new Date().toISOString(),version:Pi,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:Xu,userAgent:navigator.userAgent,clientId:Fa}})))}const ji=Wb(async e=>{if(e.length>0){const t=$l(e);Sl?navigator.sendBeacon(Zr,t):(await fetch(Zr,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function la(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Zr,$l([r]))}else ji.push(e)}const _e=Gb({app:Xu,version:Pi,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;la({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;la({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;la({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function uS(e,t){_e.track(e,t)}function lS(){return Sl=!0,ji.flush()}const kl=new Map;function fS(e,t){kl.set(e,t)}function dS(e,t){Il.set(e,t)}const Pl="sesamySignedURLs";function Tl(){const e=sessionStorage.getItem(Pl);return e?JSON.parse(e):[]}function hS(e){const t=Tl();t.push(e),sessionStorage.setItem(Pl,JSON.stringify(t))}function vS(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:C,pushTally:M,deleteTally:F,getProduct:G,getPaymentIssues:L,isSpotifyLinked:N,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:B,openHostedAccountPage:V,generateLink:Te}=Zw(e),p={auth:{getUser:m,isAuthenticated:$i,loginWithRedirect:ki,logout:Gu,setToken:Vu},checkouts:{get:r,create:t,update:n},profile:{get:m,update:S,openHostedAccountPage:V,isSpotifyLinked:N,unlinkSpotify:z},analytics:{track:uS},tags:{list:g,set:P,delete:$},entitlements:{get:a,list:i,access:o,signedLinks:Tl},contracts:{get:l,list:f},bills:{get:u,list:s},userMetadata:{get:b,list:v,set:I,delete:O},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:c},transactions:{get:d,list:h},products:{get:G,autoOnboard:B,linkSpotify:R},getVersion:pS,getPaymentIssues:L,generateLink:Te,clearCache:pe};return e.namespace&&(window[e.namespace]=p),p}function pS(){return Pi}async function mS({enabled:e=!1,rules:t}){if(!e)return;const r=await $i(),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 nc(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 nc(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 nc(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 gS(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Vu(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const ac="sesamy-refresh",ic="force-refetch-entitlements";function yS(){const e=new URLSearchParams(window.location.search),t=e.get(ic),r=e.get(ac);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ic),e.delete(ac),n.search=e.toString(),pe(),window.history.replaceState(null,"",n)}}function wS(){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;hS({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 oc="sesamy-user";async function bS(){const t=new URLSearchParams(window.location.search).get(oc);if(!t)return;const r=await Uw();(r==null?void 0:r.email)!==t&&(pe(),ki({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(oc),window.history.replaceState(null,"",n)}const sc="sesamy-purchase";function SS(){const e=new URLSearchParams(window.location.search),t=e.get(sc);if(t!==null){const r=new URL(window.location.href);e.delete(sc),r.search=e.toString(),ze(ye.PURCHASE,{itemSrc:t}),pe(),window.history.replaceState(null,"",r)}}const cc="sesamy-login";async function IS(){if(!new URLSearchParams(window.location.search).get(cc))return;await $i()||ki();const n=new URL(window.location.href);n.searchParams.delete(cc),window.history.replaceState(null,"",n)}const $S=typeof window<"u";async function uc(e){cS({clientId:e.clientId,environment:e.environment,...e.analytics}),await Lw({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await mS(e.transform),gS(),yS(),wS(),await IS(),await bS(),SS()}async function El(e){const t=vS({clientId:e.clientId,environment:e.environment,...e.api});return ze(ye.READY,{}),$S&&(e.awaitAllServices?await uc(e):uc(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);El(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=El;
|
|
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",!bu(r))throw new Error(`Invalid cache location "${r}"`);n=bu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Pt:eE,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:tE;var i;this.scope=Qr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Y0(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||ud,this.cacheManager=new J0(n,n.allKeys?void 0:new aE(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new nE)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||cd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Ji(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return q0({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=pu(si()),i=pu(si()),o=si(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await hn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,E)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:Qr(c,d.scope),response_type:"code",response_mode:E||"query",state:v,nonce:p,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new z0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new F0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(se.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new se("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Su(t),{openUrl:a,fragment:i,appState:o}=n,s=_e(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=_e(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new se("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new M0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new se("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:Qr(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=ui[o];return s||(s=i().finally(()=>{delete ui[o],s=null}),ui[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=_e(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})(()=>li.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Zi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await li.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:Qr(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},D0),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=_e(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Ji(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Su(t),{openUrl:n}=r,a=_e(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new se("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((p,S,g=60)=>new Promise((E,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Zi),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.close(),_.data.response.error?I(se.fromPayload(_.data.response)):E(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new se("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new it({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new pd(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=_e(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new it({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new it({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await V0(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 sE(e){const t=new oE(e);return await t.checkSession(),t}var Ee=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Ee||{});const cE="sesamy.com",uE="sesamy.dev",lE="https://sesa.my",Xi="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?uE:cE}`}let ue,bd,Sd=!1;const zt="sesamyAccessToken",fi="sesamyRefreshToken";async function Ar(){return new Promise((r,n)=>{let a=0;const i=()=>{Sd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function fE(e){if(!e)return null;const t=localStorage.getItem(fi);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(fi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(fi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{$d()}}async function Go(){const e=localStorage.getItem(zt);if(!e)return null;const t=Id(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await fE(t);if(r)return r;localStorage.removeItem(zt)}return e}function $u(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function dE(e){if(e.enabled===!1)return;bd=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if($u(window.location.href)!==$u(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await sE(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();Ye(Ee.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)}Sd=!0}async function Wo(){return await Ar(),await Go()?!0:ue?ue.isAuthenticated():!1}async function vE(){return await Ar(),await Go()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Vo(e){if(await Ar(),localStorage.removeItem(zt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:bd,redirect_uri:window.location.href,...t}})}async function ir(e=!0){await Ar();const t=await Go();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function $d(e={}){if(await Ar(),localStorage.removeItem(zt),Ye(Ee.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Id(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 Ed(e){const t=Id(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Ye(Ee.AUTHENTICATED,t)}const hE=(e,t)=>t.skipDedupe||t.method!=="GET",pE=(e,t)=>t.method+"@"+e,mE=e=>e.clone(),Iu=({skip:e=hE,key:t=pE,resolver:r=mE}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([f,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},gE=(e,t)=>e*t,yE=e=>e&&e.ok,Eu=({delayTimer:e=500,delayRamp:t=gE,maxAttempts:r=10,until:n=yE,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const E=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},E)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},wE="application/json",Td="Content-Type",It=Symbol(),Pd=Symbol();function Tu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Td.toLowerCase()))===null||t===void 0?void 0:t[1]}function Pu(e){return/^application\/.*json.*/.test(e)}const st=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=st(o,i,r):n[a]=i,n},{...e})},Bt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function bE(e,t=!1){Bt.options=t?e:st(Bt.options,e)}function SE(e,t=!1){Bt.polyfills=t?e:st(Bt.polyfills,e)}function $E(e){Bt.errorType=e}const IE=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Od extends Error{}const EE=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=IE(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[It]:b}}).then(b=>{if(!b.ok){const h=new Od;if(h.cause=v,h.stack=h.stack+`
|
|
5
|
+
CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(It),k=$?h[It]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(It)&&f.get(It);if(_)return _(k,e);const C=f.get(Pd);if(C)return C(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),E={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(It,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),E);return o.reduce((b,h)=>h(b,e),I)},TE={_url:"",_options:{},_config:Bt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:st(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:st(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Td]: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(Pd,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=Tu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Pu(a));return n=r?o?n.json(r,a):n.body(r):n,EE(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Tu(this._options.headers);return this.content(t||Pu(r)&&r||wE).body(JSON.stringify(e))}};function De(e="",t={}){return{...TE,_url:e,_options:t}}De.default=De;De.options=bE;De.errorType=$E;De.polyfills=SE;De.WretchError=Od;function Se(){sessionStorage.removeItem(Xi),Ye(Ee.CLEAR_CACHE,{})}function Ou(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function PE(e){const t=Ke("api2",e.environment),r=w=>async(T,P)=>{let B=sessionStorage.getItem(Xi);B||(B=Date.now().toString(),sessionStorage.setItem(Xi,B));const ae={...P,headers:{...P.headers,"Cache-Timestamp":B}};return w(T,ae)},n=(w=!0)=>T=>async(P,B)=>{let ae=null;if(ae=await ir(w),!ae){if(w)throw new Error("No access token available");return T(P,B)}const ze={...B,headers:{...B.headers,...ae?{Authorization:`Bearer ${ae}`}:{}}};return T(P,ze)},a=w=>(T,P)=>{if(P.headers.Authorization)return w(T,P);const B=localStorage.getItem("__anon_id"),ae=btoa(`${B}:`),ze={...P,headers:{...P.headers,Authorization:`Basic ${ae}`}};return w(T,ze)},i=De(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Iu(),Eu({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=De(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Iu(),Eu({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const T=await i.get("/entitlements").json();return T==null?void 0:T.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const T=await i.get("/contracts").json();return T==null?void 0:T.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const T=await i.get("/bills").json();return T==null?void 0:T.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const T=await i.get("/transactions").json();return T==null?void 0:T.find(P=>P.id===w)}async function E(w,T){const P=await i.url(`/user-metadata/${w}`).put(T).json();return Ye(Ee.USER_ATTRIBUTE_CHANGED,{}),Se(),P}async function I(w){const T=await i.url(`/user-metadata/${w}`).delete().res();return Se(),T.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const T=await i.url(`/tags/${w}`).delete().res();return Se(),T.ok}async function _(w){const T=await i.url("/tags").post(w).res();return Ye(Ee.USER_ATTRIBUTE_CHANGED,{}),Se(),T.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const T=await o.url(`/tallies/${w}`).delete().res();return Se(),T.ok}async function V(w,T){return await o.url(`/tallies/${w}/push`).post(T).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await ir(!1)?await i.url("/profile").get().json():null}async function z(w){const T=await i.url("/profile").patch(w).res();return Se(),T.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 J(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function je(w){const T=await ir(!1);if(!T)throw new Error("No access token available");const P=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",T),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const T=await i.url(`/products/${w}/auto-onboard`).post().json();return T.length&&Se(),T}async function y(w,T=3600){const{shortlink:P}=await De(lE).post({url:w,ttl:T}).json();return P}async function O(w){const T=await ir(!1);let P;const B=w.language||Ou();switch(w.target){case"account":P=new URL(`${Ke("account",e.environment)}/${B}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ke("consume",e.environment)}/${B}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),T&&(P.hash=`#access_token=${T}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Ou(),...w,vendorId:e.clientId})).json()}async function U(w,T){return(await o.url(`/checkouts/${w}`).patch(T)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await ir(!1),T=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);w&&(T.hash=`#access_token=${w}`),window.location.href=T.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:z,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:E,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:C,getTallies:M,deleteTally:F,pushTally:V,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:K,unlinkSpotify:J,linkSpotify:je,generateLink:O,openHostedAccountPage:Z}}const kd="@sesamy/sesamy-js",Zo="1.19.1";function ku(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 en="undefined",_u="object",qi=function(){},_d="any",Rd="*",lt="__",_n=typeof process<"u"?process:{};_n.env&&_n.env.NODE_ENV;var Y=typeof document<"u";_n.versions!=null&&_n.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 Cd(e,t){return t.charAt(0)[e]()+t.slice(1)}var OE=Cd.bind(null,"toUpperCase"),kE=Cd.bind(null,"toLowerCase");function _E(e){return Ad(e)?OE("null"):typeof e=="object"?jE(e):Object.prototype.toString.call(e).slice(8,-1)}function Rn(e,t){t===void 0&&(t=!0);var r=_E(e);return t?kE(r):r}function jr(e,t){return typeof t===e}var oe=jr.bind(null,"function"),Ve=jr.bind(null,"string"),Rt=jr.bind(null,"undefined"),RE=jr.bind(null,"boolean");jr.bind(null,"symbol");function Ad(e){return e===null}function CE(e){return Rn(e)==="number"&&!isNaN(e)}function jd(e){return Rn(e)==="array"}function ie(e){if(!AE(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function AE(e){return e&&(typeof e=="object"||e!==null)}function jE(e){return oe(e.constructor)?e.constructor.name:null}function LE(e){return e instanceof Error||Ve(e.message)&&e.constructor&&CE(e.constructor.stackTraceLimit)}function Ld(e,t){if(typeof t!="object"||Ad(t))return!1;if(t instanceof e)return!0;var r=Rn(new e(""));if(LE(t))for(;t;){if(Rn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Ld.bind(null,TypeError);Ld.bind(null,SyntaxError);function Qn(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?NE(e,t):r}function NE(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ea(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ea(Qn,"form");ea(Qn,"button");ea(Qn,"input");ea(Qn,"select");function UE(e){return e?jd(e)?e:[e]:[]}function Ru(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function xE(){if(Y){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function DE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ME(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Ru(r[1]),o=Ru(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(FE(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return Y&&window.location.search.substring(1)}())}function FE(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 ta(){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 zE(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var gr="global",Ht=lt+"global"+lt,Kt=typeof self===_u&&self.self===self&&self||typeof global===_u&&global.global===global&&global||void 0;function ft(e){return Kt[Ht][e]}function dt(e,t){return Kt[Ht][e]=t}function Yt(e){delete Kt[Ht][e]}function Xt(e,t,r){var n;try{if(Jo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Ht]||(Kt[Ht]={});var tn={};function Jo(e){if(typeof tn[e]!==en)return tn[e];try{var t=window[e];t.setItem(en,en),t.removeItem(en)}catch{return tn[e]=!1}return tn[e]=!0}function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var Ge="function",xe="undefined",BE="@@redux/"+Math.random().toString(36),Cu=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),rn=" != "+Ge;function Nd(e,t,r){var n;if(typeof t===Ge&&typeof r===xe&&(r=t,t=void 0),typeof r!==xe){if(typeof r!==Ge)throw new Error("enhancer"+rn);return r(Nd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+rn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+rn);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===xe)throw new Error("ActType "+xe);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+rn);a=v,d({type:"@@redux/INIT"})}})[Cu]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Cu]=function(){return this},v},n}function HE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+xe}function Gt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function KE(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=Gt.apply(void 0,i)(o.dispatch)})}}}var Ze=lt+"anon_id",ct=lt+"user_id",jt=lt+"user_traits",He="userId",Ct="anonymousId",pn=["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"],Qi=["name","EVENTS","config","loaded"],A=pn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Au=/^utm_/,ju=/^an_prop_/,Lu=/^an_trait_/;function GE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ze,o.anonymousId),f||t(ct,o.userId),u.traits&&t(jt,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(p,S){if(S.match(Au)||S.match(/^(d|g)clid/)){var g=S.replace(Au,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(ju)&&(p.props[S.replace(ju,"")]=i[S]),S.match(Lu)&&(p.traits[S.replace(Lu,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function WE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ze)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Ze,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Nu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Ze),traits:e.getItem(jt)}}var eo=function(e){return lt+"TEMP"+lt+e};function VE(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([ct,jt,Ze].forEach(function(v){n(v)}),[He,Ct,"traits"].forEach(function(v){Yt(eo(v))})),s.type===A.identify){a(Ze)||r(Ze,ta());var c=a(ct),d=a(jt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(jt,j({},d,f))}return o(s)}}}}var lr={};function Uu(e,t){lr[e]&&oe(lr[e])&&(lr[e](t),delete lr[e])}function Ud(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Ud(e,t,r-10).then(n,a)})})}function ZE(e){return{abort:e}}function xd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&oe(S)){var g,E=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[He,Ct].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[E.meta.rid];if(!I&&(g=S({payload:E,config:o[v].config,instance:r,abort:ZE}))&&ie(g)&&g.abort)return void(n[E.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(j({},E,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var di=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Lt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,E){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var C=I.type.match(Lt)?function(M,F,V,L,x){return function(z,R){var K=L?L.name:M,J=R&&Ir(R)?R:V;if(L&&(!(J=R&&Ir(R)?R:[M]).includes(M)||J.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(J)+" input valid");return j({},x,{abort:{reason:z,plugins:J,caller:F,_:K}})}}(k,_,E,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:JE(I),instance:g,config:$||{},abort:C}}}(n,v),S=t.exact.reduce(function(g,E){var I=E.pluginName,b=E.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,E,I){try{var b=E.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&oe(C.method)?(function(z,R){var K=Hu(z);if(K&&K.name===R){var J=Hu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(J?"or "+J.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
+
`))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(V=F,L=b,x=C.pluginName,function(z,R){return j({},V,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Mu(C.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(j({},F,R))})):F;var V,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(E,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(E).then(function(_){var C=g[$]?g[$]:{};if(d&&(C=_),hi(C,$))return vi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(hi(_,$))return h&&vi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:C,instance:n,config:Mu($,f,i),plugins:f})).then(function(F){var V=ie(F)?F:{},L=j({},_,V),x=g[$];if(hi(x,$))vi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(xu)&&!c.match(Du)&&n.dispatch(j({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(E){if(!(c.match(Lt)||c.match(/^registerPlugin/)||c.match(Du)||c.match(xu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),E._&&E._.originalAction===c)return E;var I=j({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Dd(E,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:E.type+"Aborted"})),s.dispatch(I)}return E})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,xu=/^bootstrap/,Du=/^ready/;function vi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Mu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Fu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function zu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function hi(e,t){var r=e.abort;return!!r&&(r===!0||Bu(r,t)||r&&Bu(r.plugins,t))}function Dd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ve(r))return!0;var n=r.plugins;return Ir(r)&&r.length===t||Ir(n)&&n.length===t}function Ir(e){return Array.isArray(e)}function Bu(e,t){return!(!e||!Ir(e))&&e.includes(t)}function Hu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function JE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function YE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Uu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],E=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return Ud(h,function(){return $({config:_})},1e4).then(function(C){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!Qi.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:E};setTimeout(function(){v.length===I.length+E.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return xd(a,t,e)},0),Promise.resolve(function(h,$,k,_,C){try{var M=oe($)?$():$,F=h.type,V=F.replace(Lt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(K=M,(J=L.plugins)===void 0&&(J={}),(je=h.options)===void 0&&(je={}),Object.keys(K).filter(function(m){var y=je.plugins||{};return RE(y[m])?y[m]:y.all!==!1&&(!J[m]||J[m].enabled!==!1)}).map(function(m){return K[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,y,O){var N=zu(m).map(function(U){return Fu(U,y)});return y.reduce(function(U,D){var Z=D.name,w=zu(m,Z).map(function(ae){return Fu(ae,y)}),T=w[0],P=w[1],B=w[2];return T.length&&(U.beforeNS[Z]=T),P.length&&(U.duringNS[Z]=P),B.length&&(U.afterNS[Z]=B),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(di({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(m){function y(){var U=function(){if(F.match(Lt))return Promise.resolve(di({action:j({},O,{type:V+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Uu(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(Dd(m,z.length))return m;var O,N=function(){if(F!==V)return Promise.resolve(di({action:j({},m,{type:V}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var K,J,je}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function XE(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var qE=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Gt.apply(void 0,o)(n)(a)}}}}};function QE(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=Ku(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Ku(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,Gu(r.plugins,!1,t));case A.enablePlugin:return j({},t,Gu(r.plugins,!0,t));default:return t}}}function Ku(e,t){return e.substring(t.length+1,e.length)}function Gu(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Md(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var eT={last:{},history:[]};function tT(e,t){e===void 0&&(e=eT);var r=t.options,n=t.meta;if(t.type===A.track){var a=Md(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var rT={actions:[]};function nT(e,t){e===void 0&&(e=rT);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Fd=/#.*$/;function aT(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Fd,""):"")}var zd,Bd,Hd,Kd,iT=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,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(Y){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(Fd,"")}(f),c={title:r,url:l,path:aT(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},oT={last:{},history:[]};function sT(e,t){e===void 0&&(e=oT);var r=t.options;if(t.type===A.page){var n=Md(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}zd=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"}(),Bd=Y?document.referrer:null,Hd=xE(),Kd=DE();var Wu={initialized:!1,sessionId:ta(),app:null,version:null,debug:!1,offline:!!Y&&!navigator.onLine,os:{name:zd},userAgent:Y?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Kd,locale:Hd,campaign:{},referrer:Bd};function cT(e,t){e===void 0&&(e=Wu);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},Wu,e,{initialized:!0})}}var uT=["plugins","reducers","storage"];function lT(e,t,r){if(Y){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function fT(e){var t=lT.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Gd(){return dt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Kt[Ht].analytics.push(o.action||o),i(o)}})}}}function Vu(e){return function(){return Gt(Gt.apply(null,arguments),Gd())}}function pi(e){return e?jd(e)?e:[e]:[]}function Zu(e,t,r){e===void 0&&(e={});var n,a,i=ta();return t&&(lr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function dT(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var T=Array.prototype.slice.call(arguments),P=new Array(w.length),B=0;B<T.length;B++)P[B]=T[B];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:Yt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Nu(m)[y]||ft(eo(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!Qi.includes(m)}).sort(),u=new Set(s.concat(pn).filter(function(m){return!Qi.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new qE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=ME(),E=Nu(a),I=j({},E,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=ta());var b=j({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:pi(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:pi(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ve(m)?m:null,D=ie(m)?m:y,Z=O||{},w=$.user();dt(eo(He),U);var T=U||D.userId||i(He,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(j({type:A.identifyStart,userId:T,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ve(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},Z=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:Z,userId:i(He,$,y),anonymousId:i(Ct,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:iT(N),options:U,userId:i(He,$,N),anonymousId:i(Ct,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===He||m==="id")return i(He,$);if(m===Ct||m==="anonId")return i(Ct,$);var y=$.getState("user");return m?ku(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(T){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),T(P)}}},U=function(w){return function(T){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),T(P)}}};return d(N,nn),d(U,an),function(){v(N,nn),v(U,an)}}var D=m.match(O)?nn:an,Z=function(w){return function(T){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),T(P)}}};return d(Z,D),function(){return v(Z,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?ku(y,m):Object.assign({},y)},dispatch:function(m){var y=Ve(m)?{type:m}:m;if(pn.includes(y.type))throw new Error("reserved action "+y.type);var O=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ze,m,y)},events:{core:pn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=Zu()),y(O)}}},p(nn),YE($,l,{all:f,plugins:s}),XE(a),GE($),VE($),p(an)]),_={context:cT,user:WE(a),page:sT,track:tT,plugins:QE(l),queue:nT},C=Gt,M=Gt;if(Y&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Gd():ie(typeof arguments[0])?Vu():Vu().apply(null,arguments)}}var V,L=function(m){return Object.keys(m).reduce(function(y,O){return uT.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),z={context:L,user:I,plugins:x},R=Nd(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Ge&&(O[U]=m[U])}var D,Z=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(T){var P=w[T];if(typeof P(void 0,{type:"@@redux/INIT"})===xe||typeof P(void 0,{type:BE})===xe)throw new Error("reducer "+T+" "+xe)})})(O)}catch(w){D=w}return function(w,T){if(w===void 0&&(w={}),D)throw D;for(var P=!1,B={},ae=0;ae<Z.length;ae++){var ze=Z[ae],rs=w[ze],aa=(0,O[ze])(rs,T);if(typeof aa===xe){var iv=HE(ze,T);throw new Error(iv)}B[ze]=aa,P=P||aa!==rs}return P?B:w}}(j({},_,t)),z,M(C(KE.apply(void 0,k))));R.dispatch=(V=R.dispatch,function(m,y,O){var N=j({},m,{meta:Zu(m.meta,y,pi(O))});return V.apply(null,[N])});var K=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:K,config:L,params:g,user:I,initialUser:r,persistedUser:E});var J=K.filter(function(m){return n.pluginEnabled[m]}),je=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&oe(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:J,disabled:je})}),fT(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return xd(m,y,O)},3e3)}(R,l,$),$}var nn="before",an="after",yr="cookie",nt=Zd(),Wd=ra,vT=ra;function Vd(e){return nt?ra(e,"",-1):Yt(e)}function Zd(){if(nt!==void 0)return nt;var e="cookiecookie";try{ra(e,e),nt=document.cookie.indexOf(e)!==-1,Vd(e)}catch{nt=!1}return nt}function ra(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return nt===!1&&(o?dt(e,t):ft(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var wr="localStorage",hT=Jo.bind(null,"localStorage");Xt("localStorage","getItem",ft);Xt("localStorage","setItem",dt);Xt("localStorage","removeItem",Yt);var br="sessionStorage",pT=Jo.bind(null,"sessionStorage");Xt("sessionStorage","getItem",ft);Xt("sessionStorage","setItem",dt);Xt("sessionStorage","removeItem",Yt);function Nt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var mT=hT(),gT=pT(),yT=Zd();function Jd(e,t){if(e){var r=Yo(t),n=!es(r),a=Xo(r)?Nt(localStorage.getItem(e)):void 0;if(n&&!Rt(a))return a;var i=qo(r)?Nt(Wd(e)):void 0;if(n&&i)return i;var o=Qo(r)?Nt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function wT(e,t,r){if(e&&!Rt(t)){var n={},a=Yo(r),i=JSON.stringify(t),o=!es(a);return Xo(a)&&(n[wr]=on(wr,t,Nt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[wr]:qo(a)&&(n[yr]=on(yr,t,Nt(Wd(e))),vT(e,i),o)?n[yr]:Qo(a)&&(n[br]=on(br,t,Nt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[br]:(n[gr]=on(gr,t,ft(e)),dt(e,t),o?n[gr]:n)}}function bT(e,t){if(e){var r=Yo(t),n=Jd(e,Rd),a={};return!Rt(n.localStorage)&&Xo(r)&&(localStorage.removeItem(e),a[wr]=n.localStorage),!Rt(n.cookie)&&qo(r)&&(Vd(e),a[yr]=n.cookie),!Rt(n.sessionStorage)&&Qo(r)&&(sessionStorage.removeItem(e),a[br]=n.sessionStorage),!Rt(n.global)&&na(r,gr)&&(Yt(e),a[gr]=n.global),a}}function Yo(e){return e?Ve(e)?e:e.storage:_d}function Xo(e){return mT&&na(e,wr)}function qo(e){return yT&&na(e,yr)}function Qo(e){return gT&&na(e,br)}function es(e){return e===Rd||e==="all"}function na(e,t){return e===_d||e===t||es(e)}function on(e,t,r){return{location:e,current:t,previous:r}}var ST={setItem:wT,getItem:Jd,removeItem:bT};function $T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(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 Yu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ju(Object(r),!0).forEach(function(n){$T(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:ST};return dT(Yu(Yu({},t),e))}function ET(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function TT(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=OT(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function PT(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function OT(e){return["#","?"].forEach(t=>e=PT(e,t)),e}function kT(){TT(()=>{Ue.page()})}function _T(e){if(e===void 0&&(e={}),!Y)return qi;var t=qu(),r=to(),n=Xu(),a=sn(n,t),i=sn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return qi;var v=d.map(function(S){return Number(S)}),p=zE(function(){var S=qu(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,v),E=to(),I=Xu(),b=sn(I,S),h=sn(E,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,C=v;(k==="up"||$)&&(_=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(K){return K!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,V=M.direction;oe(e[F])&&e[F]({trigger:F,direction:V,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function to(){return Y?document.body.scrollTop||document.documentElement.scrollTop:0}function RT(){return Y?window.innerHeight||document.documentElement.clientHeight:0}function Xu(){return Math.round(to()+RT())}function qu(){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 sn(e,t){return Math.round(e/t*100)}var Qu="EventListener";function CT(e){return function(t,r,n,a){var i=n||qi,o=a||!1;if(!Y)return i;var s=Cn(r),u=Cn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+Qu:"remove"+Qu,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?AT(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function Cn(e,t){if(Ve(e))return t?Cn(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=UE(e);return t?i.map(function(o){return Ve(o)?Cn(o,!0):o}).flat():i}function AT(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var mi=CT("Event");function Yd(e,t){return Y&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Yd.bind(null,"onerror");Yd.bind(null,"onload");var Xd=typeof window>"u",el="hidden";function jT(e){if(Xd)return!1;var t=LT(),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 LT(){var e=["webkit","moz","ms","o"];return Xd||el in document?el:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var NT=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function UT(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=jT(function(s){s||r({type:"tabVisible"})});return n=[o].concat(NT.map(function(s){return mi(document,s,r)})).concat(mi(window,"load",r)).concat(mi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function xT(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(or(d),g),a&&l&&(l=!1,a(or(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(or(d),g))},s)}var S=UT(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:or(d,c),idle:l?or(r,c):0}}}}function or(e,t){return t?0:Math.round((new Date-e)/1e3)}const tl=5e3;class DT{constructor(t){le(this,"element");le(this,"isInViewport",!1);le(this,"isAwake",!1);le(this,"isFlushing");le(this,"observer");le(this,"lastEventAt",Date.now());le(this,"registeredView",!1);le(this,"viewCallback");le(this,"activeDurationCallback");le(this,"idleDurationCallback");le(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),xT({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:tl}),_T({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*tl:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const rl="sesamy_session_id";function MT(){let e=sessionStorage.getItem(rl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(rl,e)),e}let qd=!1,ro,nl,An;const Qd=new Map;function FT({clientId:e,enabled:t=!0,environment:r}){if(ro=e,nl=t,An=`${Ke("logs",r)}/events`,!nl)return;window.addEventListener("beforeunload",()=>{tv.forEach((a,i)=>{a.bind(i)()}),BT()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Qd.forEach((a,i)=>{a.bind(i)()})}),kT();const n=new DT({element:document.body,viewCallback:()=>{Ue.page()},activeDurationCallback:(a,i,o)=>{Ue.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Ue.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Ue.track("scroll",{scroll:a.scrollMax})}});HT(document.body,()=>{n.flush()}),KT(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Ee.AUTHENTICATED,async a=>{const i=a;await Ue.identify(i.detail.sub)}),window.addEventListener(Ee.LOGOUT,async()=>{await Ue.track("logout",{}),ts.flush(),await Ue.reset()})}function ev(e){return JSON.stringify(e.map(t=>({...t,clientId:ro,requestId:Math.random().toString(36).slice(2,9),sessionId:MT(),timestamp:new Date().toISOString(),version:Zo,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:kd,userAgent:navigator.userAgent,clientId:ro}})))}const ts=ET(async e=>{if(e.length>0){const t=ev(e);qd?navigator.sendBeacon(An,t):(await fetch(An,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function gi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(An,ev([r]))}else ts.push(e)}const Ue=IT({app:kd,version:Zo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;gi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;gi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;gi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function zT(e,t){Ue.track(e,t)}function BT(){return qd=!0,ts.flush()}const tv=new Map;function HT(e,t){tv.set(e,t)}function KT(e,t){Qd.set(e,t)}const rv="sesamySignedURLs";function nv(){const e=sessionStorage.getItem(rv);return e?JSON.parse(e):[]}function GT(e){const t=nv();t.push(e),sessionStorage.setItem(rv,JSON.stringify(t))}function WT(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:E,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:C,pushTally:M,deleteTally:F,getProduct:V,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:K,openHostedAccountPage:J,generateLink:je}=PE(e),m={auth:{getUser:p,isAuthenticated:Wo,loginWithRedirect:Vo,logout:$d,setToken:Ed},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:J,isSpotifyLinked:x,unlinkSpotify:z},analytics:{track:zT},tags:{list:g,set:I,delete:E},entitlements:{get:a,list:i,access:o,signedLinks:nv},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:V,autoOnboard:K,linkSpotify:R},getVersion:VT,getPaymentIssues:L,generateLink:je,clearCache:Se};return e.namespace&&(window[e.namespace]=m),m}function VT(){return Zo}async function ZT({enabled:e=!1,rules:t}){if(!e)return;const r=await Wo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await al(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await al(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function al(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 JT(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Ed(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const il="sesamy-refresh",ol="force-refetch-entitlements";function YT(){const e=new URLSearchParams(window.location.search),t=e.get(ol),r=e.get(il);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ol),e.delete(il),n.search=e.toString(),Se(),window.history.replaceState(null,"",n)}}function XT(){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;GT({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 sl="sesamy-user";async function qT(){const t=new URLSearchParams(window.location.search).get(sl);if(!t)return;const r=await vE();(r==null?void 0:r.email)!==t&&(Se(),Vo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(sl),window.history.replaceState(null,"",n)}const cl="sesamy-purchase";function QT(){const e=new URLSearchParams(window.location.search),t=e.get(cl);if(t!==null){const r=new URL(window.location.href);e.delete(cl),r.search=e.toString(),Ye(Ee.PURCHASE,{itemSrc:t}),Se(),window.history.replaceState(null,"",r)}}const ul="sesamy-login";async function eP(){if(!new URLSearchParams(window.location.search).get(ul))return;await Wo()||Vo();const n=new URL(window.location.href);n.searchParams.delete(ul),window.history.replaceState(null,"",n)}const tP=typeof window<"u";async function ll(e){FT({clientId:e.clientId,environment:e.environment,...e.analytics}),await dE({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await ZT(e.transform),JT(),YT(),XT(),await eP(),await qT(),QT()}async function av(e){const t=WT({clientId:e.clientId,environment:e.environment,...e.api});return Ye(Ee.READY,{}),tP&&(e.awaitAllServices?await ll(e):ll(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);av(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=av;
|