@sesamy/sesamy-js 1.72.2 → 1.74.0
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 +7 -7
- package/dist/sesamy-js.d.ts +17 -1
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +1114 -1110
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var vc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pc={},aa,mc;function Ae(){return mc||(mc=1,aa=function(t){try{return!!t()}catch{return!0}}),aa}var ia,gc;function An(){if(gc)return ia;gc=1;var t=Ae();return ia=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ia}var oa,yc;function pe(){if(yc)return oa;yc=1;var t=An(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return oa=t?n:function(a){return function(){return r.apply(a,arguments)}},oa}var sa,wc;function Un(){if(wc)return sa;wc=1;var t=pe(),e=t({}.toString),r=t("".slice);return sa=function(n){return r(e(n),8,-1)},sa}var ca,bc;function vh(){if(bc)return ca;bc=1;var t=pe(),e=Ae(),r=Un(),n=Object,a=t("".split);return ca=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ca}var ua,Sc;function Ln(){return Sc||(Sc=1,ua=function(t){return t==null}),ua}var la,Ic;function $n(){if(Ic)return la;Ic=1;var t=Ln(),e=TypeError;return la=function(r){if(t(r))throw new e("Can't call method on "+r);return r},la}var fa,Pc;function Zr(){if(Pc)return fa;Pc=1;var t=vh(),e=$n();return fa=function(r){return t(e(r))},fa}var Lr,Ec;function me(){if(Ec)return Lr;Ec=1;var t=function(e){return e&&e.Math===Math&&e};return Lr=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof vc=="object"&&vc)||t(typeof Lr=="object"&&Lr)||(function(){return this})()||Function("return this")(),Lr}var da={exports:{}},ha,kc;function ut(){return kc||(kc=1,ha=!1),ha}var va,_c;function Es(){if(_c)return va;_c=1;var t=me(),e=Object.defineProperty;return va=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},va}var Tc;function ks(){if(Tc)return da.exports;Tc=1;var t=ut(),e=me(),r=Es(),n="__core-js_shared__",a=da.exports=e[n]||r(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),da.exports}var pa,Rc;function ph(){if(Rc)return pa;Rc=1;var t=ks();return pa=function(e,r){return t[e]||(t[e]=r||{})},pa}var ma,Oc;function qn(){if(Oc)return ma;Oc=1;var t=$n(),e=Object;return ma=function(r){return e(t(r))},ma}var ga,Cc;function Je(){if(Cc)return ga;Cc=1;var t=pe(),e=qn(),r=t({}.hasOwnProperty);return ga=Object.hasOwn||function(a,i){return r(e(a),i)},ga}var ya,Ac;function mh(){if(Ac)return ya;Ac=1;var t=pe(),e=0,r=Math.random(),n=t(1.1.toString);return ya=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},ya}var wa,Uc;function Yr(){if(Uc)return wa;Uc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return wa=r?String(r):"",wa}var ba,Lc;function gh(){if(Lc)return ba;Lc=1;var t=me(),e=Yr(),r=t.process,n=t.Deno,a=r&&r.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&e&&(o=e.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=e.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ba=s,ba}var Sa,$c;function yh(){if($c)return Sa;$c=1;var t=gh(),e=Ae(),r=me(),n=r.String;return Sa=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Sa}var Ia,qc;function wh(){if(qc)return Ia;qc=1;var t=yh();return Ia=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ia}var Pa,jc;function Ue(){if(jc)return Pa;jc=1;var t=me(),e=ph(),r=Je(),n=mh(),a=yh(),i=wh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Pa=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Pa}var Ea,Nc;function we(){if(Nc)return Ea;Nc=1;var t=typeof document=="object"&&document.all;return Ea=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Ea}var ka,xc;function Ze(){if(xc)return ka;xc=1;var t=we();return ka=function(e){return typeof e=="object"?e!==null:t(e)},ka}var _a,Dc;function rt(){if(Dc)return _a;Dc=1;var t=Ze(),e=String,r=TypeError;return _a=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},_a}var Ta={},Ra,Mc;function Le(){if(Mc)return Ra;Mc=1;var t=Ae();return Ra=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ra}var Oa,Fc;function bh(){if(Fc)return Oa;Fc=1;var t=Le(),e=Ae();return Oa=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Oa}var Ca={},Aa,Kc;function jn(){if(Kc)return Aa;Kc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Aa=function(a){return n?r.createElement(a):{}},Aa}var Ua,zc;function Sh(){if(zc)return Ua;zc=1;var t=Le(),e=Ae(),r=jn();return Ua=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Ua}var La,Hc;function je(){if(Hc)return La;Hc=1;var t=An(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var $a,Bc;function Ye(){if(Bc)return $a;Bc=1;var t=me(),e=we(),r=function(n){return e(n)?n:void 0};return $a=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},$a}var qa,Gc;function Nn(){if(Gc)return qa;Gc=1;var t=pe();return qa=t({}.isPrototypeOf),qa}var ja,Wc;function Ih(){if(Wc)return ja;Wc=1;var t=Ye(),e=we(),r=Nn(),n=wh(),a=Object;return ja=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},ja}var Na,Vc;function xn(){if(Vc)return Na;Vc=1;var t=String;return Na=function(e){try{return t(e)}catch{return"Object"}},Na}var xa,Jc;function nt(){if(Jc)return xa;Jc=1;var t=we(),e=xn(),r=TypeError;return xa=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},xa}var Da,Zc;function _s(){if(Zc)return Da;Zc=1;var t=nt(),e=Ln();return Da=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Da}var Ma,Yc;function Ip(){if(Yc)return Ma;Yc=1;var t=je(),e=we(),r=Ze(),n=TypeError;return Ma=function(a,i){var o,s;if(i==="string"&&e(o=a.toString)&&!r(s=t(o,a))||e(o=a.valueOf)&&!r(s=t(o,a))||i!=="string"&&e(o=a.toString)&&!r(s=t(o,a)))return s;throw new n("Can't convert object to primitive value")},Ma}var Fa,Xc;function Pp(){if(Xc)return Fa;Xc=1;var t=je(),e=Ze(),r=Ih(),n=_s(),a=Ip(),i=Ue(),o=TypeError,s=i("toPrimitive");return Fa=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Fa}var Ka,Qc;function Ph(){if(Qc)return Ka;Qc=1;var t=Pp(),e=Ih();return Ka=function(r){var n=t(r,"string");return e(n)?n:n+""},Ka}var eu;function yt(){if(eu)return Ca;eu=1;var t=Le(),e=Sh(),r=bh(),n=rt(),a=Ph(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Ca.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},Ca}var za,tu;function Ep(){if(tu)return za;tu=1;var t=Math.ceil,e=Math.floor;return za=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},za}var Ha,ru;function Ts(){if(ru)return Ha;ru=1;var t=Ep();return Ha=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ha}var Ba,nu;function Eh(){if(nu)return Ba;nu=1;var t=Ts(),e=Math.max,r=Math.min;return Ba=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ba}var Ga,au;function kp(){if(au)return Ga;au=1;var t=Ts(),e=Math.min;return Ga=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Ga}var Wa,iu;function Rs(){if(iu)return Wa;iu=1;var t=kp();return Wa=function(e){return t(e.length)},Wa}var Va,ou;function _p(){if(ou)return Va;ou=1;var t=Zr(),e=Eh(),r=Rs(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return Va={includes:n(!0),indexOf:n(!1)},Va}var Ja,su;function Os(){return su||(su=1,Ja={}),Ja}var Za,cu;function kh(){if(cu)return Za;cu=1;var t=pe(),e=Je(),r=Zr(),n=_p().indexOf,a=Os(),i=t([].push);return Za=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Za}var Ya,uu;function Cs(){return uu||(uu=1,Ya=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ya}var Xa,lu;function _h(){if(lu)return Xa;lu=1;var t=kh(),e=Cs();return Xa=Object.keys||function(n){return t(n,e)},Xa}var fu;function Tp(){if(fu)return Ta;fu=1;var t=Le(),e=bh(),r=yt(),n=rt(),a=Zr(),i=_h();return Ta.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},Ta}var Qa,du;function Th(){if(du)return Qa;du=1;var t=Ye();return Qa=t("document","documentElement"),Qa}var ei,hu;function As(){if(hu)return ei;hu=1;var t=ph(),e=mh(),r=t("keys");return ei=function(n){return r[n]||(r[n]=e(n))},ei}var ti,vu;function Xr(){if(vu)return ti;vu=1;var t=rt(),e=Tp(),r=Cs(),n=Os(),a=Th(),i=jn(),o=As(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+c+":",m;return w.style.display="none",a.appendChild(w),w.src=String(y),m=w.contentWindow.document,m.open(),m.write(d("document.F=Object")),m.close(),m.F},g,P=function(){try{g=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&g?v(g):p():v(g);for(var w=r.length;w--;)delete P[l][r[w]];return P()};return n[f]=!0,ti=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=P(),m===void 0?b:e.f(b,m)},ti}var ri,pu;function Rp(){if(pu)return ri;pu=1;var t=Ue(),e=Xr(),r=yt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ri=function(i){a[n][i]=!0},ri}var ni,mu;function Qr(){return mu||(mu=1,ni={}),ni}var ai,gu;function Op(){if(gu)return ai;gu=1;var t=me(),e=we(),r=t.WeakMap;return ai=e(r)&&/native code/.test(String(r)),ai}var ii,yu;function Xt(){return yu||(yu=1,ii=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),ii}var oi,wu;function Qt(){if(wu)return oi;wu=1;var t=Le(),e=yt(),r=Xt();return oi=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},oi}var si,bu;function Er(){if(bu)return si;bu=1;var t=Op(),e=me(),r=Ze(),n=Qt(),a=Je(),i=ks(),o=As(),s=Os(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(w){return d(w)?h(w):f(w,{})},p=function(w){return function(y){var m;if(!r(y)||(m=h(y)).type!==w)throw new l("Incompatible receiver, "+w+" required");return m}};if(t||i.state){var g=i.state||(i.state=new c);g.get=g.get,g.has=g.has,g.set=g.set,f=function(w,y){if(g.has(w))throw new l(u);return y.facade=w,g.set(w,y),y},h=function(w){return g.get(w)||{}},d=function(w){return g.has(w)}}else{var P=o("state");s[P]=!0,f=function(w,y){if(a(w,P))throw new l(u);return y.facade=w,n(w,P,y),y},h=function(w){return a(w,P)?w[P]:{}},d=function(w){return a(w,P)}}return si={set:f,get:h,has:d,enforce:v,getterFor:p},si}var ci={},ui={},Su;function Rh(){if(Su)return ui;Su=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ui.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,ui}var Iu;function Oh(){if(Iu)return ci;Iu=1;var t=Le(),e=je(),r=Rh(),n=Xt(),a=Zr(),i=Ph(),o=Je(),s=Sh(),u=Object.getOwnPropertyDescriptor;return ci.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},ci}var li={exports:{}},fi,Pu;function Ch(){if(Pu)return fi;Pu=1;var t=Le(),e=Je(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,a=e(r,"name"),i=a&&(function(){}).name==="something",o=a&&(!t||t&&n(r,"name").configurable);return fi={EXISTS:a,PROPER:i,CONFIGURABLE:o},fi}var di,Eu;function Us(){if(Eu)return di;Eu=1;var t=pe(),e=we(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),di=r.inspectSource,di}var ku;function Ah(){if(ku)return li.exports;ku=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=Le(),i=Ch().CONFIGURABLE,o=Us(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),g=String(String).split("String"),P=li.exports=function(w,y,m){h(c(y),0,7)==="Symbol("&&(y="["+d(c(y),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),m&&m.getter&&(y="get "+y),m&&m.setter&&(y="set "+y),(!n(w,"name")||i&&w.name!==y)&&(a?f(w,"name",{value:y,configurable:!0}):w.name=y),p&&m&&n(m,"arity")&&w.length!==m.arity&&f(w,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(w,"prototype",{writable:!1}):w.prototype&&(w.prototype=void 0)}catch{}var b=u(w);return n(b,"source")||(b.source=v(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),li.exports}var hi,_u;function Xe(){if(_u)return hi;_u=1;var t=we(),e=yt(),r=Ah(),n=Es();return hi=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},hi}var vi={},Tu;function Cp(){if(Tu)return vi;Tu=1;var t=kh(),e=Cs(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var pi={},Ru;function Uh(){return Ru||(Ru=1,pi.f=Object.getOwnPropertySymbols),pi}var mi,Ou;function Ap(){if(Ou)return mi;Ou=1;var t=Ye(),e=pe(),r=Cp(),n=Uh(),a=rt(),i=e([].concat);return mi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},mi}var gi,Cu;function Lh(){if(Cu)return gi;Cu=1;var t=Je(),e=Ap(),r=Oh(),n=yt();return gi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},gi}var yi,Au;function $h(){if(Au)return yi;Au=1;var t=Ae(),e=we(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return yi=n,yi}var wi,Uu;function Ie(){if(Uu)return wi;Uu=1;var t=me(),e=Oh().f,r=Qt(),n=Xe(),a=Es(),i=Lh(),o=$h();return wi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(g=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof g==typeof p)continue;i(g,p)}(s.sham||p&&p.sham)&&r(g,"sham",!0),n(d,v,g,s)}},wi}var bi,Lu;function Up(){if(Lu)return bi;Lu=1;var t=Ae();return bi=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bi}var Si,$u;function Ls(){if($u)return Si;$u=1;var t=Je(),e=we(),r=qn(),n=As(),a=Up(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Si=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},Si}var Ii,qu;function qh(){if(qu)return Ii;qu=1;var t=Ae(),e=we(),r=Ze(),n=Xr(),a=Ls(),i=Xe(),o=Ue(),s=ut(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var v={};return c[u].call(v)!==v});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),Ii={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Ii}var Pi,ju;function kr(){if(ju)return Pi;ju=1;var t=yt().f,e=Je(),r=Ue(),n=r("toStringTag");return Pi=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Pi}var Ei,Nu;function jh(){if(Nu)return Ei;Nu=1;var t=qh().IteratorPrototype,e=Xr(),r=Xt(),n=kr(),a=Qr(),i=function(){return this};return Ei=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},Ei}var ki,xu;function Lp(){if(xu)return ki;xu=1;var t=pe(),e=nt();return ki=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},ki}var _i,Du;function $p(){if(Du)return _i;Du=1;var t=Ze();return _i=function(e){return t(e)||e===null},_i}var Ti,Mu;function qp(){if(Mu)return Ti;Mu=1;var t=$p(),e=String,r=TypeError;return Ti=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ti}var Ri,Fu;function $s(){if(Fu)return Ri;Fu=1;var t=Lp(),e=Ze(),r=$n(),n=qp();return Ri=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),Ri}var Oi,Ku;function Nh(){if(Ku)return Oi;Ku=1;var t=Ie(),e=je(),r=ut(),n=Ch(),a=we(),i=jh(),o=Ls(),s=$s(),u=kr(),l=Qt(),c=Xe(),f=Ue(),h=Qr(),d=qh(),v=n.PROPER,p=n.CONFIGURABLE,g=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",R=function(){return this};return Oi=function(A,j,z,V,te,$,M){i(z,j,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in q)return q[J];switch(J){case y:return function(){return new z(this,J)};case m:return function(){return new z(this,J)};case b:return function(){return new z(this,J)}}return function(){return new z(this)}},S=j+" Iterator",O=!1,q=A.prototype,F=q[w]||q["@@iterator"]||te&&q[te],I=!P&&F||N(te),_=j==="Array"&&q.entries||F,x,H,Y;if(_&&(x=o(_.call(new A)),x!==Object.prototype&&x.next&&(!r&&o(x)!==g&&(s?s(x,g):a(x[w])||c(x,w,R)),u(x,S,!0,!0),r&&(h[S]=R))),v&&te===m&&F&&F.name!==m&&(!r&&p?l(q,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(H={values:N(m),keys:$?I:N(y),entries:N(b)},M)for(Y in H)(P||O||!(Y in q))&&c(q,Y,H[Y]);else t({target:j,proto:!0,forced:P||O},H);return(!r||M)&&q[w]!==I&&c(q,w,I,{name:te}),h[j]=I,H},Oi}var Ci,zu;function qs(){return zu||(zu=1,Ci=function(t,e){return{value:t,done:e}}),Ci}var Ai,Hu;function js(){if(Hu)return Ai;Hu=1;var t=Zr(),e=Rp(),r=Qr(),n=Er(),a=yt().f,i=Nh(),o=qs(),s=ut(),u=Le(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ai=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ai}var Bu={},Gu;function jp(){if(Gu)return Bu;Gu=1;var t=Ie(),e=pe(),r=Eh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Bu}var Ui,Wu;function xh(){if(Wu)return Ui;Wu=1;var t=me(),e=Le(),r=Object.getOwnPropertyDescriptor;return Ui=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Ui}var Li,Vu;function Dn(){if(Vu)return Li;Vu=1;var t=Ae(),e=Ue(),r=Le(),n=ut(),a=e("iterator");return Li=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Li}var $i,Ju;function Mn(){if(Ju)return $i;Ju=1;var t=Ah(),e=yt();return $i=function(r,n,a){return a.get&&t(a.get,n,{getter:!0}),a.set&&t(a.set,n,{setter:!0}),e.f(r,n,a)},$i}var qi,Zu;function Np(){if(Zu)return qi;Zu=1;var t=Xe();return qi=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},qi}var ji,Yu;function Ns(){if(Yu)return ji;Yu=1;var t=Nn(),e=TypeError;return ji=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},ji}var Ni,Xu;function xp(){if(Xu)return Ni;Xu=1;var t=Un(),e=pe();return Ni=function(r){if(t(r)==="Function")return e(r)},Ni}var xi,Qu;function _r(){if(Qu)return xi;Qu=1;var t=xp(),e=nt(),r=An(),n=t(t.bind);return xi=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},xi}var Di,el;function xs(){if(el)return Di;el=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Di=String(r)==="[object z]",Di}var Mi,tl;function en(){if(tl)return Mi;tl=1;var t=xs(),e=we(),r=Un(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Mi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Mi}var Fi,rl;function wt(){if(rl)return Fi;rl=1;var t=en(),e=String;return Fi=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Fi}var Ki,nl;function Fn(){if(nl)return Ki;nl=1;var t=en(),e=_s(),r=Ln(),n=Qr(),a=Ue(),i=a("iterator");return Ki=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Ki}var zi,al;function Ds(){if(al)return zi;al=1;var t=je(),e=nt(),r=rt(),n=xn(),a=Fn(),i=TypeError;return zi=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},zi}var Hi,il;function er(){if(il)return Hi;il=1;var t=TypeError;return Hi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Hi}var Bi,ol;function Kn(){if(ol)return Bi;ol=1;var t=pe();return Bi=t([].slice),Bi}var Gi,sl;function Dp(){if(sl)return Gi;sl=1;var t=Kn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Gi=r,Gi}var Wi,cl;function Dh(){if(cl)return Wi;cl=1,js(),jp();var t=Ie(),e=me(),r=xh(),n=Ye(),a=je(),i=pe(),o=Le(),s=Dn(),u=Xe(),l=Mn(),c=Np(),f=kr(),h=jh(),d=Er(),v=Ns(),p=we(),g=Je(),P=_r(),w=en(),y=rt(),m=Ze(),b=wt(),R=Xr(),A=Xt(),j=Ds(),z=Fn(),V=qs(),te=er(),$=Ue(),M=Dp(),N=$("iterator"),S="URLSearchParams",O=S+"Iterator",q=d.set,F=d.getterFor(S),I=d.getterFor(O),_=r("fetch"),x=r("Request"),H=r("Headers"),Y=x&&x.prototype,J=H&&H.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),ke=parseInt,Ne=i("".charAt),De=i([].join),$e=i([].push),Qe=i("".replace),St=i([].shift),It=i([].splice),Ot=i("".split),Ct=i("".slice),Ar=i(/./.exec),tr=/\+/g,At="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ct(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},Ut=function(D){for(var G=0,W=128;W>0&&(D&W)!==0;W>>=1)G++;return G},K=function(D){var G=null;switch(D.length){case 1:G=D[0];break;case 2:G=(D[0]&31)<<6|D[1]&63;break;case 3:G=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:G=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return G>1114111?null:G},X=function(D){D=Qe(D,tr," ");for(var G=D.length,W="",Z=0;Z<G;){var ie=Ne(D,Z);if(ie==="%"){if(Ne(D,Z+1)==="%"||Z+3>G){W+="%",Z++;continue}var se=et(D,Z+1);if(se!==se){W+=ie,Z++;continue}Z+=2;var he=Ut(se);if(he===0)ie=ue(se);else{if(he===1||he>4){W+=At,Z++;continue}for(var ve=[se],be=1;be<he&&(Z++,!(Z+3>G||Ne(D,Z)!=="%"));){var qe=et(D,Z+1);if(qe!==qe){Z+=3;break}if(qe>191||qe<128)break;$e(ve,qe),Z+=2,be++}if(ve.length!==he){W+=At;continue}var at=K(ve);at===null?W+=At:ie=ae(at)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return le[D]},He=function(D){return Qe(ne(D),oe,de)},_e=h(function(G,W){q(this,{type:O,target:F(G).entries,index:0,kind:W})},S,function(){var G=I(this),W=G.target,Z=G.index++;if(!W||Z>=W.length)return G.target=null,V(void 0,!0);var ie=W[Z];switch(G.kind){case"keys":return V(ie.key,!1);case"values":return V(ie.value,!1)}return V([ie.key,ie.value],!1)},!0),Me=function(D){this.entries=[],this.url=null,D!==void 0&&(m(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?Ne(D,0)==="?"?Ct(D,1):D:b(D)))};Me.prototype={type:S,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var G=this.entries,W=z(D),Z,ie,se,he,ve,be,qe;if(W)for(Z=j(D,W),ie=Z.next;!(se=a(ie,Z)).done;){if(he=j(y(se.value)),ve=he.next,(be=a(ve,he)).done||(qe=a(ve,he)).done||!a(ve,he).done)throw new fe("Expected sequence with length 2");$e(G,{key:b(be.value),value:b(qe.value)})}else for(var at in D)g(D,at)&&$e(G,{key:at,value:b(D[at])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Ot(D,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Ot(ie,"="),$e(G,{key:X(St(se)),value:X(De(se,"="))}))},serialize:function(){for(var D=this.entries,G=[],W=0,Z;W<D.length;)Z=D[W++],$e(G,He(Z.key)+"="+He(Z.value));return De(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Te=function(){v(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=q(this,new Me(G));o||(this.size=W.entries.length)},Ge=Te.prototype;if(c(Ge,{append:function(G,W){var Z=F(this);te(arguments.length,2),$e(Z.entries,{key:b(G),value:b(W)}),o||this.length++,Z.updateURL()},delete:function(D){for(var G=F(this),W=te(arguments.length,1),Z=G.entries,ie=b(D),se=W<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<Z.length;){var be=Z[ve];if(be.key===ie&&(he===void 0||be.value===he)){if(It(Z,ve,1),he!==void 0)break}else ve++}o||(this.size=Z.length),G.updateURL()},get:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=0;ie<W.length;ie++)if(W[ie].key===Z)return W[ie].value;return null},getAll:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=[],se=0;se<W.length;se++)W[se].key===Z&&$e(ie,W[se].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),se=Z<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<W.length;){var be=W[ve++];if(be.key===ie&&(he===void 0||be.value===he))return!0}return!1},set:function(G,W){var Z=F(this);te(arguments.length,1);for(var ie=Z.entries,se=!1,he=b(G),ve=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(se?It(ie,be--,1):(se=!0,qe.value=ve));se||$e(ie,{key:he,value:ve}),o||(this.size=ie.length),Z.updateURL()},sort:function(){var G=F(this);M(G.entries,function(W,Z){return W.key>Z.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=F(this).entries,Z=P(G,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<W.length;)se=W[ie++],Z(se.value,se.key,this)},keys:function(){return new _e(this,"keys")},values:function(){return new _e(this,"values")},entries:function(){return new _e(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&l(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Te,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Te}),!s&&p(H)){var rr=i(J.has),Ur=i(J.set),nr=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,rr(W,"content-type")||Ur(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(D,{body:A(0,b(G)),headers:A(0,W)})}return D};if(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?nr(arguments[1]):{})}}),p(x)){var ar=function(G){return v(this,Y),new x(G,arguments.length>1?nr(arguments[1]):{})};Y.constructor=ar,ar.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ar})}}return Wi={URLSearchParams:Te,getState:F},Wi}var ul;function Mp(){return ul||(ul=1,Dh()),pc}var ll={},fl;function Fp(){if(fl)return ll;fl=1;var t=Xe(),e=pe(),r=wt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(R,A){l(v,{key:A,value:R})}),n(h,1);for(var p=r(f),g=r(d),P=0,w=0,y=!1,m=v.length,b;P<m;)b=v[P++],y||b.key===p?(y=!0,s(this,b.key)):w++;for(;w<m;)b=v[w++],b.key===p&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),ll}var dl={},hl;function Kp(){if(hl)return dl;hl=1;var t=Xe(),e=pe(),r=wt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),dl}var vl={},pl;function zp(){if(pl)return vl;pl=1;var t=Le(),e=pe(),r=Mn(),n=URLSearchParams.prototype,a=e(n.forEach);return t&&!("size"in n)&&r(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),vl}var Vi,ml;function zn(){if(ml)return Vi;ml=1;var t=me();return Vi=t,Vi}var Ji,gl;function Mh(){if(gl)return Ji;gl=1,Mp(),Fp(),Kp(),zp();var t=zn();return Ji=t.URLSearchParams,Ji}var yl={},wl={},bl={},Zi,Sl;function Fh(){if(Sl)return Zi;Sl=1;var t=pe(),e=Ts(),r=wt(),n=$n(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Zi={codeAt:s(!1),charAt:s(!0)},Zi}var Il;function Kh(){if(Il)return bl;Il=1;var t=Fh().charAt,e=wt(),r=Er(),n=Nh(),a=qs(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),bl}var Yi,Pl;function Hp(){if(Pl)return Yi;Pl=1;var t=Le(),e=pe(),r=je(),n=Ae(),a=_h(),i=Uh(),o=Rh(),s=qn(),u=vh(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Yi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(g){d[g]=g}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),g=arguments.length,P=1,w=i.f,y=o.f;g>P;)for(var m=u(arguments[P++]),b=w?f(a(m),w(m)):a(m),R=b.length,A=0,j;R>A;)j=b[A++],(!t||r(y,m,j))&&(p[j]=m[j]);return p}:l,Yi}var Xi,El;function zh(){if(El)return Xi;El=1;var t=je(),e=rt(),r=_s();return Xi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Xi}var Qi,kl;function Bp(){if(kl)return Qi;kl=1;var t=rt(),e=zh();return Qi=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Qi}var eo,_l;function Hh(){if(_l)return eo;_l=1;var t=Ue(),e=Qr(),r=t("iterator"),n=Array.prototype;return eo=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},eo}var to,Tl;function Bh(){if(Tl)return to;Tl=1;var t=pe(),e=Ae(),r=we(),n=en(),a=Ye(),i=Us(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,to=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,to}var ro,Rl;function Gp(){if(Rl)return ro;Rl=1;var t=Le(),e=yt(),r=Xt();return ro=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},ro}var no,Ol;function Wp(){if(Ol)return no;Ol=1;var t=_r(),e=je(),r=qn(),n=Bp(),a=Hh(),i=Bh(),o=Rs(),s=Gp(),u=Ds(),l=Fn(),c=Array;return no=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,j,z;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),j=A.next;!(R=e(j,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=v?new this(m):c(m);m>y;y++)z=P?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},no}var ao,Cl;function Vp(){if(Cl)return ao;Cl=1;var t=pe(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),j=function($){for(var M=[],N=0,S=$.length;N<S;){var O=w($,N++);if(O>=55296&&O<=56319&&N<S){var q=w($,N++);(q&64512)===56320?m(M,((O&1023)<<10)+(q&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function($){return $+22+75*($<26)},V=function($,M,N){var S=0;for($=N?g($/o):$>>1,$+=g($/M);$>d*a>>1;)$=g($/d),S+=r;return g(S+(d+1)*$/($+i))},te=function($){var M=[];$=j($);var N=$.length,S=u,O=0,q=s,F,I;for(F=0;F<$.length;F++)I=$[F],I<128&&m(M,P(I));var _=M.length,x=_;for(_&&m(M,l);x<N;){var H=e;for(F=0;F<$.length;F++)I=$[F],I>=S&&I<H&&(H=I);var Y=x+1;if(H-S>g((e-O)/Y))throw new v(h);for(O+=(H-S)*Y,S=H,F=0;F<$.length;F++){if(I=$[F],I<S&&++O>e)throw new v(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=q?n:fe>=q+a?a:fe-q;if(J<ne)break;var ue=J-ne,ae=r-ne;m(M,P(z(ne+ue%ae))),J=g(ue/ae),fe+=r}m(M,P(z(J))),q=V(O,Y,x===_),O=0,x++}}O++,S++}return y(M,"")};return ao=function($){var M=[],N=R(b(A($),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,p(c,O)?"xn--"+te(O):O);return y(M,".")},ao}var Al;function Jp(){if(Al)return wl;Al=1,Kh();var t=Ie(),e=Le(),r=Dn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Mn(),u=Ns(),l=Je(),c=Hp(),f=Wp(),h=Kn(),d=Fh().codeAt,v=Vp(),p=wt(),g=kr(),P=er(),w=Dh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,j=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,$=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),q=i([].pop),F=i([].push),I=i("".replace),_=i([].shift),x=i("".split),H=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",ke=/[a-z]/i,Ne=/[\d+-.a-z]/i,De=/\d/,$e=/^0x/i,Qe=/^[0-7]+$/,St=/^\d+$/,It=/^[\da-f]+$/i,Ot=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ct=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,tr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,At=/[\t\n\r]/g,ge,et=function(k){var L=x(k,"."),T,E,C,re,B,ye,Se;if(L.length&&L[L.length-1]===""&&L.length--,T=L.length,T>4)return k;for(E=[],C=0;C<T;C++){if(re=L[C],re==="")return k;if(B=10,re.length>1&&M(re,0)==="0"&&(B=N($e,re)?16:8,re=H(re,B===8?1:2)),re==="")ye=0;else{if(!N(B===10?St:B===8?Qe:It,re))return k;ye=V(re,B)}F(E,ye)}for(C=0;C<T;C++)if(ye=E[C],C===T-1){if(ye>=$(256,5-T))return null}else if(ye>255)return null;for(Se=q(E),C=0;C<E.length;C++)Se+=E[C]*$(256,3-C);return Se},Ut=function(k){var L=[0,0,0,0,0,0,0,0],T=0,E=null,C=0,re,B,ye,Se,Re,Ve,U,Pe=function(){return M(k,C)};if(Pe()===":"){if(M(k,1)!==":")return;C+=2,T++,E=T}for(;Pe();){if(T===8)return;if(Pe()===":"){if(E!==null)return;C++,T++,E=T;continue}for(re=B=0;B<4&&N(It,Pe());)re=re*16+V(Pe(),16),C++,B++;if(Pe()==="."){if(B===0||(C-=B,T>6))return;for(ye=0;Pe();){if(Se=null,ye>0)if(Pe()==="."&&ye<4)C++;else return;if(!N(De,Pe()))return;for(;N(De,Pe());){if(Re=V(Pe(),10),Se===null)Se=Re;else{if(Se===0)return;Se=Se*10+Re}if(Se>255)return;C++}L[T]=L[T]*256+Se,ye++,(ye===2||ye===4)&&T++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;L[T++]=re}if(E!==null)for(Ve=T-E,T=7;T!==0&&Ve>0;)U=L[T],L[T--]=L[E+Ve-1],L[E+--Ve]=U;else if(T!==8)return;return L},K=function(k){for(var L=null,T=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>T&&(L=E,T=C),E=null,C=0):(E===null&&(E=re),++C);return C>T?E:L},X=function(k){var L,T,E,C;if(typeof k=="number"){for(L=[],T=0;T<4;T++)J(L,k%256),k=te(k/256);return S(L,".")}if(typeof k=="object"){for(L="",E=K(k),T=0;T<8;T++)C&&k[T]===0||(C&&(C=!1),E===T?(L+=T?":":"::",C=!0):(L+=O(k[T],16),T<7&&(L+=":")));return"["+L+"]"}return k},oe={},le=c({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},le,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),_e=function(k,L){var T=d(k,0);return T>32&&T<127&&!l(L,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Te=function(k,L){var T;return k.length===2&&N(ke,M(k,0))&&((T=M(k,1))===":"||!L&&T==="|")},Ge=function(k){var L;return k.length>1&&Te(H(k,0,2))&&(k.length===2||(L=M(k,2))==="/"||L==="\\"||L==="?"||L==="#")},rr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},nr={},ar={},D={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},at={},Qn={},cc={},ea={},ir={},it={},uc={},Lt={},lt={},ta=function(k,L,T){var E=p(k),C,re,B;if(L){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(T!==void 0&&(C=new ta(T,!0)),re=this.parse(E,null,C),re)throw new z(re);B=A(new R),B.bindURL(this),this.searchParams=B}};ta.prototype={type:"URL",parse:function(k,L,T){var E=this,C=L||nr,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=p(k),L||(E.scheme="",E.username="",E.password="",E.host=null,E.port=null,E.path=[],E.query=null,E.fragment=null,E.cannotBeABaseURL=!1,k=I(k,Ar,""),k=I(k,tr,"$1")),k=I(k,At,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case nr:if(U&&N(ke,U))B+=Y(U),C=ar;else{if(L)return ne;C=D;continue}break;case ar:if(U&&(N(Ne,U)||U==="+"||U==="-"||U==="."))B+=Y(U);else if(U===":"){if(L&&(E.isSpecial()!==l(Me,B)||B==="file"&&(E.includesCredentials()||E.port!==null)||E.scheme==="file"&&!E.host))return;if(E.scheme=B,L){E.isSpecial()&&Me[E.scheme]===E.port&&(E.port=null);return}B="",E.scheme==="file"?C=Qn:E.isSpecial()&&T&&T.scheme===E.scheme?C=G:E.isSpecial()?C=se:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=uc)}else{if(L)return ne;B="",C=D,re=0;continue}break;case D:if(!T||T.cannotBeABaseURL&&U!=="#")return ne;if(T.cannotBeABaseURL&&U==="#"){E.scheme=T.scheme,E.path=h(T.path),E.query=T.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=T.scheme==="file"?Qn:Z;continue;case G:if(U==="/"&&Ve[re+1]==="/")C=he,re++;else{C=Z;continue}break;case W:if(U==="/"){C=ve;break}else{C=it;continue}case Z:if(E.scheme=T.scheme,U===ge)E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query="",C=Lt;else if(U==="#")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.path.length--,C=it;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=ve;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,C=it;continue}break;case se:if(C=he,U!=="/"||M(B,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=ve;continue}break;case ve:if(U==="@"){ye&&(B="%40"+B),ye=!0,Pe=f(B);for(var ra=0;ra<Pe.length;ra++){var dc=Pe[ra];if(dc===":"&&!Re){Re=!0;continue}var hc=_e(dc,He);Re?E.password+=hc:E.username+=hc}B=""}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(ye&&B==="")return fe;re-=f(B).length+1,B="",C=be}else B+=U;break;case be:case qe:if(L&&E.scheme==="file"){C=ea;continue}else if(U===":"&&!Se){if(B==="")return ue;if(ft=E.parseHost(B),ft)return ft;if(B="",C=at,L===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ue;if(L&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=ir,L)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case at:if(N(De,U))B+=U;else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()||L){if(B!==""){var na=V(B,10);if(na>65535)return ae;E.port=E.isSpecial()&&na===Me[E.scheme]?null:na,B=""}if(L)return;C=ir;continue}else return ae;break;case Qn:if(E.scheme="file",U==="/"||U==="\\")C=cc;else if(T&&T.scheme==="file")switch(U){case ge:E.host=T.host,E.path=h(T.path),E.query=T.query;break;case"?":E.host=T.host,E.path=h(T.path),E.query="",C=Lt;break;case"#":E.host=T.host,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=T.host,E.path=h(T.path),E.shortenPath()),C=it;continue}else{C=it;continue}break;case cc:if(U==="/"||U==="\\"){C=ea;break}T&&T.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(Te(T.path[0],!0)?F(E.path,T.path[0]):E.host=T.host),C=it;continue;case ea:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!L&&Te(B))C=it;else if(B===""){if(E.host="",L)return;C=ir}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),L)return;B="",C=ir}continue}else B+=U;break;case ir:if(E.isSpecial()){if(C=it,U!=="/"&&U!=="\\")continue}else if(!L&&U==="?")E.query="",C=Lt;else if(!L&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=it,U!=="/"))continue;break;case it:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!L&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):rr(B)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&Te(B)&&(E.host&&(E.host=""),B=M(B,0)+":"),F(E.path,B)),B="",E.scheme==="file"&&(U===ge||U==="?"||U==="#"))for(;E.path.length>1&&E.path[0]==="";)_(E.path);U==="?"?(E.query="",C=Lt):U==="#"&&(E.fragment="",C=lt)}else B+=_e(U,de);break;case uc:U==="?"?(E.query="",C=Lt):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=_e(U,oe));break;case Lt:!L&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=_e(U,oe));break;case lt:U!==ge&&(E.fragment+=_e(U,le));break}re++}},parseHost:function(k){var L,T,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||(L=Ut(H(k,1,-1)),!L))return ue;this.host=L}else if(this.isSpecial()){if(k=v(k),N(Ot,k)||(L=et(k),L===null))return ue;this.host=L}else{if(N(Ct,k))return ue;for(L="",T=f(k),E=0;E<T.length;E++)L+=_e(T[E],oe);this.host=L}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Me,this.scheme)},shortenPath:function(){var k=this.path,L=k.length;L&&(this.scheme!=="file"||L!==1||!Te(k[0],!0))&&k.length--},serialize:function(){var k=this,L=k.scheme,T=k.username,E=k.password,C=k.host,re=k.port,B=k.path,ye=k.query,Se=k.fragment,Re=L+":";return C!==null?(Re+="//",k.includesCredentials()&&(Re+=T+(E?":"+E:"")+"@"),Re+=X(C),re!==null&&(Re+=":"+re)):L==="file"&&(Re+="//"),Re+=k.cannotBeABaseURL?B[0]:B.length?"/"+S(B,"/"):"",ye!==null&&(Re+="?"+ye),Se!==null&&(Re+="#"+Se),Re},setHref:function(k){var L=this.parse(k);if(L)throw new z(L);this.searchParams.update()},getOrigin:function(){var k=this.scheme,L=this.port;if(k==="blob")try{return new or(k.path[0]).origin}catch{return"null"}return k==="file"||!this.isSpecial()?"null":k+"://"+X(this.host)+(L!==null?":"+L:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(k){this.parse(p(k)+":",nr)},getUsername:function(){return this.username},setUsername:function(k){var L=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var T=0;T<L.length;T++)this.username+=_e(L[T],He)}},getPassword:function(){return this.password},setPassword:function(k){var L=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var T=0;T<L.length;T++)this.password+=_e(L[T],He)}},getHost:function(){var k=this.host,L=this.port;return k===null?"":L===null?X(k):X(k)+":"+L},setHost:function(k){this.cannotBeABaseURL||this.parse(k,be)},getHostname:function(){var k=this.host;return k===null?"":X(k)},setHostname:function(k){this.cannotBeABaseURL||this.parse(k,qe)},getPort:function(){var k=this.port;return k===null?"":p(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=p(k),k===""?this.port=null:this.parse(k,at))},getPathname:function(){var k=this.path;return this.cannotBeABaseURL?k[0]:k.length?"/"+S(k,"/"):""},setPathname:function(k){this.cannotBeABaseURL||(this.path=[],this.parse(k,ir))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=p(k),k===""?this.query=null:(M(k,0)==="?"&&(k=H(k,1)),this.query="",this.parse(k,Lt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=p(k),k===""){this.fragment=null;return}M(k,0)==="#"&&(k=H(k,1)),this.fragment="",this.parse(k,lt)},update:function(){this.query=this.searchParams.serialize()||null}};var or=function(L){var T=u(this,xe),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(T,new ta(L,!1,E));e||(T.href=C.serialize(),T.origin=C.getOrigin(),T.protocol=C.getProtocol(),T.username=C.getUsername(),T.password=C.getPassword(),T.host=C.getHost(),T.hostname=C.getHostname(),T.port=C.getPort(),T.pathname=C.getPathname(),T.search=C.getSearch(),T.searchParams=C.getSearchParams(),T.hash=C.getHash())},xe=or.prototype,We=function(k,L){return{get:function(){return b(this)[k]()},set:L&&function(T){return b(this)[L](T)},configurable:!0,enumerable:!0}};if(e&&(s(xe,"href",We("serialize","setHref")),s(xe,"origin",We("getOrigin")),s(xe,"protocol",We("getProtocol","setProtocol")),s(xe,"username",We("getUsername","setUsername")),s(xe,"password",We("getPassword","setPassword")),s(xe,"host",We("getHost","setHost")),s(xe,"hostname",We("getHostname","setHostname")),s(xe,"port",We("getPort","setPort")),s(xe,"pathname",We("getPathname","setPathname")),s(xe,"search",We("getSearch","setSearch")),s(xe,"searchParams",We("getSearchParams")),s(xe,"hash",We("getHash","setHash"))),o(xe,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(xe,"toString",function(){return b(this).serialize()},{enumerable:!0}),j){var lc=j.createObjectURL,fc=j.revokeObjectURL;lc&&o(or,"createObjectURL",a(lc,j)),fc&&o(or,"revokeObjectURL",a(fc,j))}return g(or,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:or}),wl}var Ul;function Zp(){return Ul||(Ul=1,Jp()),yl}var Ll={},$l;function Yp(){if($l)return Ll;$l=1;var t=Ie(),e=Ye(),r=Ae(),n=er(),a=wt(),i=Dn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),Ll}var ql={},jl;function Xp(){if(jl)return ql;jl=1;var t=Ie(),e=Ye(),r=er(),n=wt(),a=Dn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),ql}var Nl={},xl;function Qp(){if(xl)return Nl;xl=1;var t=Ie(),e=je();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Nl}var io,Dl;function em(){if(Dl)return io;Dl=1,Mh(),Zp(),Yp(),Xp(),Qp();var t=zn();return io=t.URL,io}var oo,Ml;function tm(){if(Ml)return oo;Ml=1;var t=em();return oo=t,oo}var so,Fl;function rm(){if(Fl)return so;Fl=1;var t=tm();return so=t,so}rm();var Kl={},co,zl;function nm(){return zl||(zl=1,co={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}),co}var uo,Hl;function am(){if(Hl)return uo;Hl=1;var t=jn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return uo=r===Object.prototype?void 0:r,uo}var Bl;function Gh(){if(Bl)return Kl;Bl=1;var t=me(),e=nm(),r=am(),n=js(),a=Qt(),i=kr(),o=Ue(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),Kl}var lo,Gl;function im(){if(Gl)return lo;Gl=1;var t=Mh();return Gh(),lo=t,lo}var fo,Wl;function om(){if(Wl)return fo;Wl=1;var t=im();return fo=t,fo}om();var Vl={},Jl={},ho,Zl;function sm(){if(Zl)return ho;Zl=1;var t=Ze(),e=Qt();return ho=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},ho}var vo,Yl;function cm(){if(Yl)return vo;Yl=1;var t=pe(),e=Error,r=t("".replace),n=(function(o){return String(new e(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return vo=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},vo}var po,Xl;function um(){if(Xl)return po;Xl=1;var t=Ae(),e=Xt();return po=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),po}var mo,Ql;function lm(){if(Ql)return mo;Ql=1;var t=Qt(),e=cm(),r=um(),n=Error.captureStackTrace;return mo=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},mo}var go,ef;function tn(){if(ef)return go;ef=1;var t=_r(),e=je(),r=rt(),n=xn(),a=Hh(),i=Rs(),o=Nn(),s=Ds(),u=Fn(),l=zh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return go=function(d,v,p){var g=p&&p.that,P=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),R,A,j,z,V,te,$,M=function(S){return R&&l(R,"normal"),new f(!0,S)},N=function(S){return P?(r(S),m?b(S[0],S[1],M):b(S[0],S[1])):m?b(S,M):b(S)};if(w)R=d.iterator;else if(y)R=d;else{if(A=u(d),!A)throw new c(n(d)+" is not iterable");if(a(A)){for(j=0,z=i(d);z>j;j++)if(V=N(d[j]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!($=e(te,R)).done;){try{V=N($.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},go}var yo,tf;function fm(){if(tf)return yo;tf=1;var t=wt();return yo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},yo}var rf;function dm(){if(rf)return Jl;rf=1;var t=Ie(),e=Nn(),r=Ls(),n=$s(),a=Lh(),i=Xr(),o=Qt(),s=Xt(),u=sm(),l=lm(),c=tn(),f=fm(),h=Ue(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new v,b?r(this):P):(R=b?this:i(P),o(R,d,"Error")),m!==void 0&&o(R,"message",f(m)),l(R,g,R.stack,1),arguments.length>2&&u(R,arguments[2]);var A=[];return c(y,p,{that:A}),o(R,"errors",A),R};n?n(g,v):a(g,v,{name:!0});var P=g.prototype=i(v.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Jl}var nf;function hm(){return nf||(nf=1,dm()),Vl}var af={},wo,of;function vm(){if(of)return wo;of=1;var t=xs(),e=en();return wo=t?{}.toString:function(){return"[object "+e(this)+"]"},wo}var sf;function pm(){if(sf)return af;sf=1;var t=xs(),e=Xe(),r=vm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),af}var cf={},uf={},bo,lf;function Wh(){if(lf)return bo;lf=1;var t=me(),e=Yr(),r=Un(),n=function(a){return e.slice(0,a.length)===a};return bo=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),bo}var So,ff;function Ms(){if(ff)return So;ff=1;var t=Wh();return So=t==="NODE",So}var Io,df;function mm(){if(df)return Io;df=1;var t=Ye(),e=Mn(),r=Ue(),n=Le(),a=r("species");return Io=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Io}var Po,hf;function gm(){if(hf)return Po;hf=1;var t=Bh(),e=xn(),r=TypeError;return Po=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Po}var Eo,vf;function Vh(){if(vf)return Eo;vf=1;var t=rt(),e=gm(),r=Ln(),n=Ue(),a=n("species");return Eo=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},Eo}var ko,pf;function Jh(){if(pf)return ko;pf=1;var t=An(),e=Function.prototype,r=e.apply,n=e.call;return ko=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),ko}var _o,mf;function Zh(){if(mf)return _o;mf=1;var t=Yr();return _o=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),_o}var To,gf;function Yh(){if(gf)return To;gf=1;var t=me(),e=Jh(),r=_r(),n=we(),a=Je(),i=Ae(),o=Th(),s=Kn(),u=jn(),l=er(),c=Zh(),f=Ms(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,j,z;i(function(){R=t.location});var V=function(N){if(a(m,N)){var S=m[N];delete m[N],S()}},te=function(N){return function(){V(N)}},$=function(N){V(N.data)},M=function(N){t.postMessage(w(N),R.protocol+"//"+R.host)};return(!h||!d)&&(h=function(S){l(arguments.length,1);var O=n(S)?S:g(S),q=s(arguments,1);return m[++y]=function(){e(O,void 0,q)},A(y),y},d=function(S){delete m[S]},f?A=function(N){v.nextTick(te(N))}:p&&p.now?A=function(N){p.now(te(N))}:P&&!c?(j=new P,z=j.port2,j.port1.onmessage=$,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",$,!1)):b in u("script")?A=function(N){o.appendChild(u("script"))[b]=function(){o.removeChild(this),V(N)}}:A=function(N){setTimeout(te(N),0)}),To={set:h,clear:d},To}var Ro,yf;function Xh(){if(yf)return Ro;yf=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(e){var r={item:e,next:null},n=this.tail;n?n.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},Ro=t,Ro}var Oo,wf;function ym(){if(wf)return Oo;wf=1;var t=Yr();return Oo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Oo}var Co,bf;function wm(){if(bf)return Co;bf=1;var t=Yr();return Co=/web0s(?!.*chrome)/i.test(t),Co}var Ao,Sf;function bm(){if(Sf)return Ao;Sf=1;var t=me(),e=xh(),r=_r(),n=Yh().set,a=Xh(),i=Zh(),o=ym(),s=wm(),u=Ms(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,g,P,w;if(!d){var y=new a,m=function(){var b,R;for(u&&(b=f.domain)&&b.exit();R=y.get();)try{R()}catch(A){throw y.head&&v(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(p=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),v=function(){g.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),v=function(){w(m)}):u?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(b){y.head||v(),y.add(b)}}return Ao=d,Ao}var Uo,If;function Sm(){return If||(If=1,Uo=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),Uo}var Lo,Pf;function Tr(){return Pf||(Pf=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var $o,Ef;function Rr(){if(Ef)return $o;Ef=1;var t=me();return $o=t.Promise,$o}var qo,kf;function rn(){if(kf)return qo;kf=1;var t=me(),e=Rr(),r=we(),n=$h(),a=Us(),i=Ue(),o=Wh(),s=ut(),u=gh(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var g=new e(function(y){y(1)}),P=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=P,f=g.then(function(){})instanceof P,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return qo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},qo}var jo={},_f;function bt(){if(_f)return jo;_f=1;var t=nt(),e=TypeError,r=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new e("Bad Promise constructor");a=o,i=s}),this.resolve=t(a),this.reject=t(i)};return jo.f=function(n){return new r(n)},jo}var Tf;function Im(){if(Tf)return uf;Tf=1;var t=Ie(),e=ut(),r=Ms(),n=me(),a=zn(),i=je(),o=Xe(),s=$s(),u=kr(),l=mm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Vh(),p=Yh().set,g=bm(),P=Sm(),w=Tr(),y=Xh(),m=Er(),b=Rr(),R=rn(),A=bt(),j="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,$=m.getterFor(j),M=m.set,N=b&&b.prototype,S=b,O=N,q=n.TypeError,F=n.document,I=n.process,_=A.f,x=_,H=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ue=2,ae=1,ke=2,Ne,De,$e,Qe,St=function(K){var X;return h(K)&&f(X=K.then)?X:!1},It=function(K,X){var oe=X.value,le=X.state===ne,de=le?K.ok:K.fail,He=K.resolve,_e=K.reject,Me=K.domain,Te,Ge,rr;try{de?(le||(X.rejection===ke&&At(X),X.rejection=ae),de===!0?Te=oe:(Me&&Me.enter(),Te=de(oe),Me&&(Me.exit(),rr=!0)),Te===K.promise?_e(new q("Promise-chain cycle")):(Ge=St(Te))?i(Ge,Te,He,_e):He(Te)):_e(oe)}catch(Ur){Me&&!rr&&Me.exit(),_e(Ur)}},Ot=function(K,X){K.notified||(K.notified=!0,g(function(){for(var oe=K.reactions,le;le=oe.get();)It(le,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ct=function(K,X,oe){var le,de;H?(le=F.createEvent("Event"),le.promise=X,le.reason=oe,le.initEvent(K,!1,!0),n.dispatchEvent(le)):le={promise:X,reason:oe},!V&&(de=n["on"+K])?de(le):K===Y&&P("Unhandled promise rejection",oe)},Ar=function(K){i(p,n,function(){var X=K.facade,oe=K.value,le=tr(K),de;if(le&&(de=w(function(){r?I.emit("unhandledRejection",oe,X):Ct(Y,X,oe)}),K.rejection=r||tr(K)?ke:ae,de.error))throw de.value})},tr=function(K){return K.rejection!==ae&&!K.parent},At=function(K){i(p,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ct(J,X,K.value)})},ge=function(K,X,oe){return function(le){K(X,le,oe)}},et=function(K,X,oe){K.done||(K.done=!0,oe&&(K=oe),K.value=X,K.state=ue,Ot(K,!0))},Ut=function(K,X,oe){if(!K.done){K.done=!0,oe&&(K=oe);try{if(K.facade===X)throw new q("Promise can't be resolved itself");var le=St(X);le?g(function(){var de={done:!1};try{i(le,X,ge(Ut,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Ot(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var oe=$(this);try{X(ge(Ut,oe),ge(et,oe))}catch(le){et(oe,le)}},O=S.prototype,Ne=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,oe){var le=$(this),de=_(v(this,S));return le.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?I.domain:void 0,le.state===fe?le.reactions.add(de):g(function(){It(de,le)}),de.promise}),De=function(){var K=new Ne,X=$(K);this.promise=K,this.resolve=ge(Ut,X),this.reject=ge(et,X)},A.f=_=function(K){return K===S||K===$e?new De(K):x(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,oe){var le=this;return new S(function(de,He){i(Qe,le,de,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,O)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:S}),$e=a.Promise,u(S,j,!1,!0),l(j),uf}var Rf={},No,Of;function Pm(){if(Of)return No;Of=1;var t=Ue(),e=t("iterator"),r=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){r=!0}};a[e]=function(){return this},Array.from(a,function(){throw 2})}catch{}return No=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},No}var xo,Cf;function Hn(){if(Cf)return xo;Cf=1;var t=Rr(),e=Pm(),r=rn().CONSTRUCTOR;return xo=r||!e(function(n){t.all(n).then(void 0,function(){})}),xo}var Af;function Em(){if(Af)return Rf;Af=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Rf}var Uf={},Lf;function km(){if(Lf)return Uf;Lf=1;var t=Ie(),e=ut(),r=rn().CONSTRUCTOR,n=Rr(),a=Ye(),i=we(),o=Xe(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return Uf}var $f={},qf;function _m(){if(qf)return $f;qf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),$f}var jf={},Nf;function Tm(){if(Nf)return jf;Nf=1;var t=Ie(),e=bt(),r=rn().CONSTRUCTOR;return t({target:"Promise",stat:!0,forced:r},{reject:function(a){var i=e.f(this),o=i.reject;return o(a),i.promise}}),jf}var xf={},Do,Df;function Qh(){if(Df)return Do;Df=1;var t=rt(),e=Ze(),r=bt();return Do=function(n,a){if(t(n),e(a)&&a.constructor===n)return a;var i=r.f(n),o=i.resolve;return o(a),i.promise},Do}var Mf;function Rm(){if(Mf)return xf;Mf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=Qh(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),xf}var Ff;function Om(){return Ff||(Ff=1,Im(),Em(),km(),_m(),Tm(),Rm()),cf}var Kf={},zf;function Cm(){if(zf)return Kf;zf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--P||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Kf}var Hf={},Bf;function Am(){if(Bf)return Hf;Bf=1;var t=Ie(),e=je(),r=nt(),n=Ye(),a=bt(),i=Tr(),o=tn(),s=Hn(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,j=!1;m++,e(P,f,R).then(function(z){j||b||(b=!0,v(z))},function(z){j||b||(j=!0,w[A]=z,--m||p(new h(w,u)))})}),--m||p(new h(w,u))});return g.error&&p(g.value),d.promise}}),Hf}var Gf={},Wf;function ev(){if(Wf)return Gf;Wf=1;var t=Ie(),e=me(),r=Jh(),n=Kn(),a=bt(),i=nt(),o=Tr(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Gf}var Vf={},Jf;function tv(){if(Jf)return Vf;Jf=1;var t=Ie(),e=bt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Vf}var Zf={},Yf;function Um(){if(Yf)return Zf;Yf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Vh(),s=Qh(),u=Xe(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Zf}var Mo,Xf;function Lm(){if(Xf)return Mo;Xf=1,hm(),js(),pm(),Om(),Cm(),Am(),ev(),tv(),Um(),Kh();var t=zn();return Mo=t.Promise,Mo}var Fo,Qf;function $m(){if(Qf)return Fo;Qf=1;var t=Lm();return Gh(),Fo=t,Fo}var ed={},td;function qm(){return td||(td=1,ev()),ed}var rd={},nd;function jm(){return nd||(nd=1,tv()),rd}var Ko,ad;function Nm(){if(ad)return Ko;ad=1;var t=$m();return qm(),jm(),Ko=t,Ko}Nm();const rv="sesamy-debug";function xm(t,e,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${t}=${e}; ${a}; path=/`}function Dm(t){if(typeof document>"u")return null;const e=t+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null}function Mm(t){xm(rv,t.toString(),1)}function Fm(){return Dm(rv)==="true"}function ce(t){Fm()&&console.log(t)}function Vt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});ce(`Triggering event: ${t}`),dispatchEvent(r)}function st(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r}var Nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ks(t,e){return t(e={exports:{}},e.exports),e.exports}var qt=Ks((function(t,e){Object.defineProperty(e,"__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})();e.default=function(){return r.getInstance()}}));Fs(qt);var Km=Fs(Ks((function(t,e){var r=Nt&&Nt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function g(y){try{w(d.next(y))}catch(m){p(m)}}function P(y){try{w(d.throw(y))}catch(m){p(m)}}function w(y){y.done?v(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=Nt&&Nt.__generator||function(c,f){var h,d,v,p,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function P(w){return function(y){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;g;)try{if(h=1,d&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return g.label++,{value:m[1],done:!1};case 5:g.label++,d=m[1],m=[0];continue;case 7:m=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){g.label=m[1];break}if(m[0]===6&&g.label<v[1]){g.label=v[1],v=m;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(m);break}v[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=Nt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){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=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,p,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(p))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,qt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(g=p.getItemSync(f))===null?(qt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),qt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(qt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var w=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,p;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,qt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),qt.default().unlock(p.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var g=d.keySync(p);if(g===null)break;v.push(g),p++}for(var P=!1,w=0;w<v.length;w++){var y=v[w];if(y.includes(i)){var m=d.getItemSync(y);if(m!==null){var b=JSON.parse(m);(b.timeRefreshed===void 0&&b.timeAcquired<h||b.timeRefreshed!==void 0&&b.timeRefreshed<h)&&(d.removeItemSync(y),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const zm={timeoutInSeconds:60},nv={name:"auth0-spa-js",version:"2.8.0"},av=()=>Date.now();let Ee=class ss extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,ss.prototype)}static fromPayload({error:e,error_description:r}){return new ss(e,r)}},Hm=class iv extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,iv.prototype)}},Bm=class ov extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,ov.prototype)}},cs=class sv extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,sv.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Gm=class cv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,cv.prototype)}},Wm=class uv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,uv.prototype)}},lv=class fv extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${bn(e,["default"])}', scope: '${bn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,fv.prototype)}},Vm=class dv extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${bn(e,["default"])}', missing scope: '${bn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,dv.prototype)}},hv=class vv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,vv.prototype)}};function bn(t,e=[]){return t&&!e.includes(t)?t:""}const Sn=()=>window.crypto,$r=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(Sn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},zo=t=>btoa(t),Jm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Zm=t=>Object.keys(t).reduce(((e,r)=>{const n=Jm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),us=t=>{var{clientId:e}=t,r=st(t,["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:e},r))).toString()},id=async t=>await Sn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),od=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),sd=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Ym=new TextEncoder,Xm=new TextDecoder;function zr(t){return typeof t=="string"?Ym.encode(t):Xm.decode(t)}function cd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new eg(`${t.name} modulusLength must be at least 2048 bits`)}async function Qm(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${Hr(zr(JSON.stringify(t)))}.${Hr(zr(JSON.stringify(e)))}`;return`${n}.${Hr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return cd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return cd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Mt})(r),r,zr(n)))}`}let ls;Uint8Array.prototype.toBase64?ls=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):ls=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Hr(t){return ls(t)}let Mt=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},eg=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function tg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Mt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Mt("unsupported CryptoKey algorithm name")}}function pv(t){return t instanceof CryptoKey}function mv(t){return pv(t)&&t.type==="public"}async function rg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!pv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!mv(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Qm({alg:tg(o),typ:"dpop+jwt",jwk:await gv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Hr(await crypto.subtle.digest("SHA-256",zr(a))):void 0}),o)}async function gv(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const ng=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function ag(){return(async function(t,e){var r;let n;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new Mt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function ig(t){return(async function(e){if(!mv(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await gv(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Mt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function og({keyPair:t,url:e,method:r,nonce:n,accessToken:a}){const i=(function(o){const s=new URL(o);return s.search="",s.hash="",s.href})(e);return rg(t,i,r,n,a)}const sg=async(t,e)=>{const r=await fetch(t,e);return{ok:r.ok,json:await r.json(),headers:(n=r.headers,[...n].reduce(((a,[i,o])=>(a[i]=o,a)),{}))};var n},cg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([sg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ug=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},lg=async(t,e,r,n,a,i,o=1e4,s)=>a?ug(t,e,r,n,o,a,i,s):cg(t,n,o);async function yv(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await lg(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=c.json,{error:d,error_description:v}=h,p=st(h,["error","error_description"]),{headers:g,ok:P}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!P){const y=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Wm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new lv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new hv(w);return yv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function fg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=st(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?us(d):JSON.stringify(d),p=(g=c.grant_type,ng.includes(g));var g;return await yv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Zm(o||nv)))}},e,s,u,p?l:void 0)}const pn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},sn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),pn(n,e)};let ht=class fs{constructor(e,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[r,n,a,i]=e.split("::");return new fs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new fs({scope:r,audience:n,clientId:a})}},dg=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},wv=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},hg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||av}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);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(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);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(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new ht({clientId:e.client_id,scope:e.scope,audience:e.audience}),a=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async remove(e,r,n){const a=new ht({clientId:e,scope:n,audience:r});await this.cache.remove(a.toKey())}async clear(e){var r;const n=await this.getCacheKeys();n&&(await n.filter((a=>!e||a.includes(e))).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(e){const r=await this.nowProvider();return{body:e,expiresAt:Math.floor(r/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new ht({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=ht.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=ht.fromKey(a);if(i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId){const o=await this.cache.get(a);if(!((n=o?.body)===null||n===void 0)&&n.refresh_token)return this.modifiedCachedEntry(o,e)}}}async updateEntry(e,r){var n;const a=await this.getCacheKeys();if(a)for(const i of a){const o=await this.cache.get(i);if(((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e){const s=Object.assign(Object.assign({},o.body),{refresh_token:r});await this.set(s)}}}},vg=class{constructor(e,r,n){this.storage=e,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const qr=t=>typeof t=="number",pg=["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"],mg=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(od(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],pg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(od(s)),claims:f,user:h}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.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(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!qr(e.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(e.claims.exp==null||!qr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!qr(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=t.leeway||60,n=new Date(t.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(e.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(e.claims.nbf!=null&&qr(e.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(e.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(e.claims.auth_time!=null&&qr(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.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(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const o=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_id}"`)}else{const o=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_name}"`)}}return e};var Ft=Ks((function(t,e){var r=Nt&&Nt.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Fs(Ft),Ft.encode,Ft.parse,Ft.getAll;var gg=Ft.get,bv=Ft.set,Sv=Ft.remove;const lr={get(t){const e=gg(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),bv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r)}},yg={get(t){return lr.get(t)||lr.get(`_legacy_${t}`)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),bv(`_legacy_${t}`,JSON.stringify(e),n),lr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r),lr.remove(t,e),lr.remove(`_legacy_${t}`,e)}},wg={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var xt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(xt||(xt={}));function bg(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,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 ud,ld,fd,Ho,Sg=(ud="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ld=null,fd=!1,function(t){return Ho=Ho||bg(ud,ld,fd),new Worker(Ho,t)});const Bo={};let Ig=class{constructor(e,r){this.cache=e,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(e),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(e){return`@@auth0spajs@@::${e}`}};const Pg={memory:()=>new wv().enclosedCache,localstorage:()=>new dg},dd=t=>Pg[t],hd=t=>{const{openUrl:e,onRedirect:r}=t,n=st(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},vd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},$t={NONCE:"nonce",KEYPAIR:"keypair"};let Eg=class{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise(((r,n)=>{e.onupgradeneeded=()=>Object.values($t).forEach((a=>e.result.createObjectStore(a))),e.onerror=()=>n(e.error),e.onsuccess=()=>r(e.result)}))}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,r,n){const a=n((await this.getDbHandle()).transaction(e,r).objectStore(e));return new Promise(((i,o)=>{a.onsuccess=()=>i(a.result),a.onerror=()=>o(a.error)}))}buildKey(e){const r=e?`_${e}`:"auth0";return`${this.clientId}::${r}`}setNonce(e,r){return this.save($t.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save($t.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find($t.NONCE,this.buildKey(e))}findKeyPair(){return this.find($t.KEYPAIR,this.buildKey())}find(e,r){return this.executeDbRequest(e,"readonly",(n=>n.get(r)))}async deleteBy(e,r){const n=await this.executeDbRequest(e,"readonly",(a=>a.getAllKeys()));n?.filter(r).map((a=>this.executeDbRequest(e,"readwrite",(i=>i.delete(a)))))}deleteByClientId(e,r){return this.deleteBy(e,(n=>typeof n=="string"&&n.startsWith(`${r}::`)))}clearNonces(){return this.deleteByClientId($t.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId($t.KEYPAIR,this.clientId)}},kg=class{constructor(e){this.storage=new Eg(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,r){return this.storage.setNonce(e,r)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await ag(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return og(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ig(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var fr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(fr||(fr={}));let _g=class{constructor(e,r){this.hooks=r,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,r){if(r){if(this.isAbsoluteUrl(r))return r;if(e)return`${e.replace(/\/?\/$/,"")}/${r.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,r){if(!this.config.baseUrl)return new Request(e,r);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),a=e instanceof Request?new Request(n,e):n;return new Request(a,r)}setAuthorizationHeader(e,r,n=fr.Bearer){e.headers.set("authorization",`${n} ${r}`)}async setDpopProofHeader(e,r){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),a=await this.hooks.generateDpopProof({accessToken:r,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",a)}async prepareRequest(e,r){const n=await this.getAccessToken(r);let a,i;typeof n=="string"?(a=this.config.dpopNonceId?fr.DPoP:fr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===fr.DPoP&&await this.setDpopProofHeader(e,i)}getHeader(e,r){return Array.isArray(e)?new Headers(e).get(r)||"":typeof e.get=="function"?e.get(r)||"":e[r]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const r=this.getHeader(e.headers,"www-authenticate");return r.includes("invalid_dpop_nonce")||r.includes("use_dpop_nonce")}async handleResponse(e,r){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!r.onUseDpopNonceError)throw new hv(n);return r.onUseDpopNonceError()}async internalFetchWithAuth(e,r,n,a){const i=this.buildBaseRequest(e,r);await this.prepareRequest(i,a);const o=await this.config.fetch(i);return this.handleResponse(o,n)}fetchWithAuth(e,r,n){const a={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,r,Object.assign(Object.assign({},a),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,r,a,n)}},Tg=class{constructor(e,r){this.myAccountFetcher=e,this.apiBase=r}async connectAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async completeAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async _handleResponse(e){let r;try{r=await e.text(),r=JSON.parse(r)}catch(n){throw new pd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new pd(r)}},pd=class Iv extends Error{constructor({type:e,status:r,title:n,detail:a,validation_errors:i}){super(a),this.name="MyAccountApiError",this.type=e,this.status=r,this.title=n,this.detail=a,this.validation_errors=i,Object.setPrototypeOf(this,Iv.prototype)}};const Go=new Km;let Rg=class{constructor(e){let r,n;if(this.userCache=new wv().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await Go.releaseLock(l);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!Sn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Sn().subtle===void 0)throw new Error(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},mc={},aa,gc;function Ae(){return gc||(gc=1,aa=function(t){try{return!!t()}catch{return!0}}),aa}var ia,yc;function An(){if(yc)return ia;yc=1;var t=Ae();return ia=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ia}var oa,wc;function pe(){if(wc)return oa;wc=1;var t=An(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return oa=t?n:function(a){return function(){return r.apply(a,arguments)}},oa}var sa,bc;function Un(){if(bc)return sa;bc=1;var t=pe(),e=t({}.toString),r=t("".slice);return sa=function(n){return r(e(n),8,-1)},sa}var ca,Sc;function ph(){if(Sc)return ca;Sc=1;var t=pe(),e=Ae(),r=Un(),n=Object,a=t("".split);return ca=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ca}var ua,Ic;function Ln(){return Ic||(Ic=1,ua=function(t){return t==null}),ua}var la,Pc;function $n(){if(Pc)return la;Pc=1;var t=Ln(),e=TypeError;return la=function(r){if(t(r))throw new e("Can't call method on "+r);return r},la}var fa,Ec;function Zr(){if(Ec)return fa;Ec=1;var t=ph(),e=$n();return fa=function(r){return t(e(r))},fa}var Lr,kc;function me(){if(kc)return Lr;kc=1;var t=function(e){return e&&e.Math===Math&&e};return Lr=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof pc=="object"&&pc)||t(typeof Lr=="object"&&Lr)||(function(){return this})()||Function("return this")(),Lr}var da={exports:{}},ha,_c;function ut(){return _c||(_c=1,ha=!1),ha}var va,Tc;function Es(){if(Tc)return va;Tc=1;var t=me(),e=Object.defineProperty;return va=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},va}var Rc;function ks(){if(Rc)return da.exports;Rc=1;var t=ut(),e=me(),r=Es(),n="__core-js_shared__",a=da.exports=e[n]||r(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),da.exports}var pa,Oc;function mh(){if(Oc)return pa;Oc=1;var t=ks();return pa=function(e,r){return t[e]||(t[e]=r||{})},pa}var ma,Cc;function qn(){if(Cc)return ma;Cc=1;var t=$n(),e=Object;return ma=function(r){return e(t(r))},ma}var ga,Ac;function Je(){if(Ac)return ga;Ac=1;var t=pe(),e=qn(),r=t({}.hasOwnProperty);return ga=Object.hasOwn||function(a,i){return r(e(a),i)},ga}var ya,Uc;function gh(){if(Uc)return ya;Uc=1;var t=pe(),e=0,r=Math.random(),n=t(1.1.toString);return ya=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},ya}var wa,Lc;function Yr(){if(Lc)return wa;Lc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return wa=r?String(r):"",wa}var ba,$c;function yh(){if($c)return ba;$c=1;var t=me(),e=Yr(),r=t.process,n=t.Deno,a=r&&r.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&e&&(o=e.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=e.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ba=s,ba}var Sa,qc;function wh(){if(qc)return Sa;qc=1;var t=yh(),e=Ae(),r=me(),n=r.String;return Sa=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Sa}var Ia,jc;function bh(){if(jc)return Ia;jc=1;var t=wh();return Ia=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ia}var Pa,Nc;function Ue(){if(Nc)return Pa;Nc=1;var t=me(),e=mh(),r=Je(),n=gh(),a=wh(),i=bh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Pa=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Pa}var Ea,xc;function we(){if(xc)return Ea;xc=1;var t=typeof document=="object"&&document.all;return Ea=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Ea}var ka,Dc;function Ze(){if(Dc)return ka;Dc=1;var t=we();return ka=function(e){return typeof e=="object"?e!==null:t(e)},ka}var _a,Mc;function rt(){if(Mc)return _a;Mc=1;var t=Ze(),e=String,r=TypeError;return _a=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},_a}var Ta={},Ra,Fc;function Le(){if(Fc)return Ra;Fc=1;var t=Ae();return Ra=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ra}var Oa,Kc;function Sh(){if(Kc)return Oa;Kc=1;var t=Le(),e=Ae();return Oa=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Oa}var Ca={},Aa,zc;function jn(){if(zc)return Aa;zc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Aa=function(a){return n?r.createElement(a):{}},Aa}var Ua,Hc;function Ih(){if(Hc)return Ua;Hc=1;var t=Le(),e=Ae(),r=jn();return Ua=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Ua}var La,Bc;function je(){if(Bc)return La;Bc=1;var t=An(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var $a,Gc;function Ye(){if(Gc)return $a;Gc=1;var t=me(),e=we(),r=function(n){return e(n)?n:void 0};return $a=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},$a}var qa,Wc;function Nn(){if(Wc)return qa;Wc=1;var t=pe();return qa=t({}.isPrototypeOf),qa}var ja,Vc;function Ph(){if(Vc)return ja;Vc=1;var t=Ye(),e=we(),r=Nn(),n=bh(),a=Object;return ja=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},ja}var Na,Jc;function xn(){if(Jc)return Na;Jc=1;var t=String;return Na=function(e){try{return t(e)}catch{return"Object"}},Na}var xa,Zc;function nt(){if(Zc)return xa;Zc=1;var t=we(),e=xn(),r=TypeError;return xa=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},xa}var Da,Yc;function _s(){if(Yc)return Da;Yc=1;var t=nt(),e=Ln();return Da=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Da}var Ma,Xc;function Ip(){if(Xc)return Ma;Xc=1;var t=je(),e=we(),r=Ze(),n=TypeError;return Ma=function(a,i){var o,s;if(i==="string"&&e(o=a.toString)&&!r(s=t(o,a))||e(o=a.valueOf)&&!r(s=t(o,a))||i!=="string"&&e(o=a.toString)&&!r(s=t(o,a)))return s;throw new n("Can't convert object to primitive value")},Ma}var Fa,Qc;function Pp(){if(Qc)return Fa;Qc=1;var t=je(),e=Ze(),r=Ph(),n=_s(),a=Ip(),i=Ue(),o=TypeError,s=i("toPrimitive");return Fa=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Fa}var Ka,eu;function Eh(){if(eu)return Ka;eu=1;var t=Pp(),e=Ph();return Ka=function(r){var n=t(r,"string");return e(n)?n:n+""},Ka}var tu;function yt(){if(tu)return Ca;tu=1;var t=Le(),e=Ih(),r=Sh(),n=rt(),a=Eh(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Ca.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},Ca}var za,ru;function Ep(){if(ru)return za;ru=1;var t=Math.ceil,e=Math.floor;return za=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},za}var Ha,nu;function Ts(){if(nu)return Ha;nu=1;var t=Ep();return Ha=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ha}var Ba,au;function kh(){if(au)return Ba;au=1;var t=Ts(),e=Math.max,r=Math.min;return Ba=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ba}var Ga,iu;function kp(){if(iu)return Ga;iu=1;var t=Ts(),e=Math.min;return Ga=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Ga}var Wa,ou;function Rs(){if(ou)return Wa;ou=1;var t=kp();return Wa=function(e){return t(e.length)},Wa}var Va,su;function _p(){if(su)return Va;su=1;var t=Zr(),e=kh(),r=Rs(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return Va={includes:n(!0),indexOf:n(!1)},Va}var Ja,cu;function Os(){return cu||(cu=1,Ja={}),Ja}var Za,uu;function _h(){if(uu)return Za;uu=1;var t=pe(),e=Je(),r=Zr(),n=_p().indexOf,a=Os(),i=t([].push);return Za=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Za}var Ya,lu;function Cs(){return lu||(lu=1,Ya=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ya}var Xa,fu;function Th(){if(fu)return Xa;fu=1;var t=_h(),e=Cs();return Xa=Object.keys||function(n){return t(n,e)},Xa}var du;function Tp(){if(du)return Ta;du=1;var t=Le(),e=Sh(),r=yt(),n=rt(),a=Zr(),i=Th();return Ta.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},Ta}var Qa,hu;function Rh(){if(hu)return Qa;hu=1;var t=Ye();return Qa=t("document","documentElement"),Qa}var ei,vu;function As(){if(vu)return ei;vu=1;var t=mh(),e=gh(),r=t("keys");return ei=function(n){return r[n]||(r[n]=e(n))},ei}var ti,pu;function Xr(){if(pu)return ti;pu=1;var t=rt(),e=Tp(),r=Cs(),n=Os(),a=Rh(),i=jn(),o=As(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+c+":",m;return w.style.display="none",a.appendChild(w),w.src=String(y),m=w.contentWindow.document,m.open(),m.write(d("document.F=Object")),m.close(),m.F},g,P=function(){try{g=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&g?v(g):p():v(g);for(var w=r.length;w--;)delete P[l][r[w]];return P()};return n[f]=!0,ti=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=P(),m===void 0?b:e.f(b,m)},ti}var ri,mu;function Rp(){if(mu)return ri;mu=1;var t=Ue(),e=Xr(),r=yt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ri=function(i){a[n][i]=!0},ri}var ni,gu;function Qr(){return gu||(gu=1,ni={}),ni}var ai,yu;function Op(){if(yu)return ai;yu=1;var t=me(),e=we(),r=t.WeakMap;return ai=e(r)&&/native code/.test(String(r)),ai}var ii,wu;function Xt(){return wu||(wu=1,ii=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),ii}var oi,bu;function Qt(){if(bu)return oi;bu=1;var t=Le(),e=yt(),r=Xt();return oi=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},oi}var si,Su;function Er(){if(Su)return si;Su=1;var t=Op(),e=me(),r=Ze(),n=Qt(),a=Je(),i=ks(),o=As(),s=Os(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(w){return d(w)?h(w):f(w,{})},p=function(w){return function(y){var m;if(!r(y)||(m=h(y)).type!==w)throw new l("Incompatible receiver, "+w+" required");return m}};if(t||i.state){var g=i.state||(i.state=new c);g.get=g.get,g.has=g.has,g.set=g.set,f=function(w,y){if(g.has(w))throw new l(u);return y.facade=w,g.set(w,y),y},h=function(w){return g.get(w)||{}},d=function(w){return g.has(w)}}else{var P=o("state");s[P]=!0,f=function(w,y){if(a(w,P))throw new l(u);return y.facade=w,n(w,P,y),y},h=function(w){return a(w,P)?w[P]:{}},d=function(w){return a(w,P)}}return si={set:f,get:h,has:d,enforce:v,getterFor:p},si}var ci={},ui={},Iu;function Oh(){if(Iu)return ui;Iu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ui.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,ui}var Pu;function Ch(){if(Pu)return ci;Pu=1;var t=Le(),e=je(),r=Oh(),n=Xt(),a=Zr(),i=Eh(),o=Je(),s=Ih(),u=Object.getOwnPropertyDescriptor;return ci.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},ci}var li={exports:{}},fi,Eu;function Ah(){if(Eu)return fi;Eu=1;var t=Le(),e=Je(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,a=e(r,"name"),i=a&&(function(){}).name==="something",o=a&&(!t||t&&n(r,"name").configurable);return fi={EXISTS:a,PROPER:i,CONFIGURABLE:o},fi}var di,ku;function Us(){if(ku)return di;ku=1;var t=pe(),e=we(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),di=r.inspectSource,di}var _u;function Uh(){if(_u)return li.exports;_u=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=Le(),i=Ah().CONFIGURABLE,o=Us(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),g=String(String).split("String"),P=li.exports=function(w,y,m){h(c(y),0,7)==="Symbol("&&(y="["+d(c(y),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),m&&m.getter&&(y="get "+y),m&&m.setter&&(y="set "+y),(!n(w,"name")||i&&w.name!==y)&&(a?f(w,"name",{value:y,configurable:!0}):w.name=y),p&&m&&n(m,"arity")&&w.length!==m.arity&&f(w,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(w,"prototype",{writable:!1}):w.prototype&&(w.prototype=void 0)}catch{}var b=u(w);return n(b,"source")||(b.source=v(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),li.exports}var hi,Tu;function Xe(){if(Tu)return hi;Tu=1;var t=we(),e=yt(),r=Uh(),n=Es();return hi=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},hi}var vi={},Ru;function Cp(){if(Ru)return vi;Ru=1;var t=_h(),e=Cs(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var pi={},Ou;function Lh(){return Ou||(Ou=1,pi.f=Object.getOwnPropertySymbols),pi}var mi,Cu;function Ap(){if(Cu)return mi;Cu=1;var t=Ye(),e=pe(),r=Cp(),n=Lh(),a=rt(),i=e([].concat);return mi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},mi}var gi,Au;function $h(){if(Au)return gi;Au=1;var t=Je(),e=Ap(),r=Ch(),n=yt();return gi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},gi}var yi,Uu;function qh(){if(Uu)return yi;Uu=1;var t=Ae(),e=we(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return yi=n,yi}var wi,Lu;function Ie(){if(Lu)return wi;Lu=1;var t=me(),e=Ch().f,r=Qt(),n=Xe(),a=Es(),i=$h(),o=qh();return wi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(g=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof g==typeof p)continue;i(g,p)}(s.sham||p&&p.sham)&&r(g,"sham",!0),n(d,v,g,s)}},wi}var bi,$u;function Up(){if($u)return bi;$u=1;var t=Ae();return bi=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bi}var Si,qu;function Ls(){if(qu)return Si;qu=1;var t=Je(),e=we(),r=qn(),n=As(),a=Up(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Si=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},Si}var Ii,ju;function jh(){if(ju)return Ii;ju=1;var t=Ae(),e=we(),r=Ze(),n=Xr(),a=Ls(),i=Xe(),o=Ue(),s=ut(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var v={};return c[u].call(v)!==v});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),Ii={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Ii}var Pi,Nu;function kr(){if(Nu)return Pi;Nu=1;var t=yt().f,e=Je(),r=Ue(),n=r("toStringTag");return Pi=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Pi}var Ei,xu;function Nh(){if(xu)return Ei;xu=1;var t=jh().IteratorPrototype,e=Xr(),r=Xt(),n=kr(),a=Qr(),i=function(){return this};return Ei=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},Ei}var ki,Du;function Lp(){if(Du)return ki;Du=1;var t=pe(),e=nt();return ki=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},ki}var _i,Mu;function $p(){if(Mu)return _i;Mu=1;var t=Ze();return _i=function(e){return t(e)||e===null},_i}var Ti,Fu;function qp(){if(Fu)return Ti;Fu=1;var t=$p(),e=String,r=TypeError;return Ti=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ti}var Ri,Ku;function $s(){if(Ku)return Ri;Ku=1;var t=Lp(),e=Ze(),r=$n(),n=qp();return Ri=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),Ri}var Oi,zu;function xh(){if(zu)return Oi;zu=1;var t=Ie(),e=je(),r=ut(),n=Ah(),a=we(),i=Nh(),o=Ls(),s=$s(),u=kr(),l=Qt(),c=Xe(),f=Ue(),h=Qr(),d=jh(),v=n.PROPER,p=n.CONFIGURABLE,g=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",R=function(){return this};return Oi=function(A,j,z,V,te,$,M){i(z,j,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in q)return q[J];switch(J){case y:return function(){return new z(this,J)};case m:return function(){return new z(this,J)};case b:return function(){return new z(this,J)}}return function(){return new z(this)}},S=j+" Iterator",O=!1,q=A.prototype,F=q[w]||q["@@iterator"]||te&&q[te],I=!P&&F||N(te),_=j==="Array"&&q.entries||F,x,H,Y;if(_&&(x=o(_.call(new A)),x!==Object.prototype&&x.next&&(!r&&o(x)!==g&&(s?s(x,g):a(x[w])||c(x,w,R)),u(x,S,!0,!0),r&&(h[S]=R))),v&&te===m&&F&&F.name!==m&&(!r&&p?l(q,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(H={values:N(m),keys:$?I:N(y),entries:N(b)},M)for(Y in H)(P||O||!(Y in q))&&c(q,Y,H[Y]);else t({target:j,proto:!0,forced:P||O},H);return(!r||M)&&q[w]!==I&&c(q,w,I,{name:te}),h[j]=I,H},Oi}var Ci,Hu;function qs(){return Hu||(Hu=1,Ci=function(t,e){return{value:t,done:e}}),Ci}var Ai,Bu;function js(){if(Bu)return Ai;Bu=1;var t=Zr(),e=Rp(),r=Qr(),n=Er(),a=yt().f,i=xh(),o=qs(),s=ut(),u=Le(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ai=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ai}var Gu={},Wu;function jp(){if(Wu)return Gu;Wu=1;var t=Ie(),e=pe(),r=kh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Gu}var Ui,Vu;function Dh(){if(Vu)return Ui;Vu=1;var t=me(),e=Le(),r=Object.getOwnPropertyDescriptor;return Ui=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Ui}var Li,Ju;function Dn(){if(Ju)return Li;Ju=1;var t=Ae(),e=Ue(),r=Le(),n=ut(),a=e("iterator");return Li=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Li}var $i,Zu;function Mn(){if(Zu)return $i;Zu=1;var t=Uh(),e=yt();return $i=function(r,n,a){return a.get&&t(a.get,n,{getter:!0}),a.set&&t(a.set,n,{setter:!0}),e.f(r,n,a)},$i}var qi,Yu;function Np(){if(Yu)return qi;Yu=1;var t=Xe();return qi=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},qi}var ji,Xu;function Ns(){if(Xu)return ji;Xu=1;var t=Nn(),e=TypeError;return ji=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},ji}var Ni,Qu;function xp(){if(Qu)return Ni;Qu=1;var t=Un(),e=pe();return Ni=function(r){if(t(r)==="Function")return e(r)},Ni}var xi,el;function _r(){if(el)return xi;el=1;var t=xp(),e=nt(),r=An(),n=t(t.bind);return xi=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},xi}var Di,tl;function xs(){if(tl)return Di;tl=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Di=String(r)==="[object z]",Di}var Mi,rl;function en(){if(rl)return Mi;rl=1;var t=xs(),e=we(),r=Un(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Mi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Mi}var Fi,nl;function wt(){if(nl)return Fi;nl=1;var t=en(),e=String;return Fi=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Fi}var Ki,al;function Fn(){if(al)return Ki;al=1;var t=en(),e=_s(),r=Ln(),n=Qr(),a=Ue(),i=a("iterator");return Ki=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Ki}var zi,il;function Ds(){if(il)return zi;il=1;var t=je(),e=nt(),r=rt(),n=xn(),a=Fn(),i=TypeError;return zi=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},zi}var Hi,ol;function er(){if(ol)return Hi;ol=1;var t=TypeError;return Hi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Hi}var Bi,sl;function Kn(){if(sl)return Bi;sl=1;var t=pe();return Bi=t([].slice),Bi}var Gi,cl;function Dp(){if(cl)return Gi;cl=1;var t=Kn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Gi=r,Gi}var Wi,ul;function Mh(){if(ul)return Wi;ul=1,js(),jp();var t=Ie(),e=me(),r=Dh(),n=Ye(),a=je(),i=pe(),o=Le(),s=Dn(),u=Xe(),l=Mn(),c=Np(),f=kr(),h=Nh(),d=Er(),v=Ns(),p=we(),g=Je(),P=_r(),w=en(),y=rt(),m=Ze(),b=wt(),R=Xr(),A=Xt(),j=Ds(),z=Fn(),V=qs(),te=er(),$=Ue(),M=Dp(),N=$("iterator"),S="URLSearchParams",O=S+"Iterator",q=d.set,F=d.getterFor(S),I=d.getterFor(O),_=r("fetch"),x=r("Request"),H=r("Headers"),Y=x&&x.prototype,J=H&&H.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),ke=parseInt,Ne=i("".charAt),De=i([].join),$e=i([].push),Qe=i("".replace),St=i([].shift),It=i([].splice),Ot=i("".split),Ct=i("".slice),Ar=i(/./.exec),tr=/\+/g,At="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ct(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},Ut=function(D){for(var G=0,W=128;W>0&&(D&W)!==0;W>>=1)G++;return G},K=function(D){var G=null;switch(D.length){case 1:G=D[0];break;case 2:G=(D[0]&31)<<6|D[1]&63;break;case 3:G=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:G=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return G>1114111?null:G},X=function(D){D=Qe(D,tr," ");for(var G=D.length,W="",Z=0;Z<G;){var ie=Ne(D,Z);if(ie==="%"){if(Ne(D,Z+1)==="%"||Z+3>G){W+="%",Z++;continue}var se=et(D,Z+1);if(se!==se){W+=ie,Z++;continue}Z+=2;var he=Ut(se);if(he===0)ie=ue(se);else{if(he===1||he>4){W+=At,Z++;continue}for(var ve=[se],be=1;be<he&&(Z++,!(Z+3>G||Ne(D,Z)!=="%"));){var qe=et(D,Z+1);if(qe!==qe){Z+=3;break}if(qe>191||qe<128)break;$e(ve,qe),Z+=2,be++}if(ve.length!==he){W+=At;continue}var at=K(ve);at===null?W+=At:ie=ae(at)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return le[D]},He=function(D){return Qe(ne(D),oe,de)},_e=h(function(G,W){q(this,{type:O,target:F(G).entries,index:0,kind:W})},S,function(){var G=I(this),W=G.target,Z=G.index++;if(!W||Z>=W.length)return G.target=null,V(void 0,!0);var ie=W[Z];switch(G.kind){case"keys":return V(ie.key,!1);case"values":return V(ie.value,!1)}return V([ie.key,ie.value],!1)},!0),Me=function(D){this.entries=[],this.url=null,D!==void 0&&(m(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?Ne(D,0)==="?"?Ct(D,1):D:b(D)))};Me.prototype={type:S,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var G=this.entries,W=z(D),Z,ie,se,he,ve,be,qe;if(W)for(Z=j(D,W),ie=Z.next;!(se=a(ie,Z)).done;){if(he=j(y(se.value)),ve=he.next,(be=a(ve,he)).done||(qe=a(ve,he)).done||!a(ve,he).done)throw new fe("Expected sequence with length 2");$e(G,{key:b(be.value),value:b(qe.value)})}else for(var at in D)g(D,at)&&$e(G,{key:at,value:b(D[at])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Ot(D,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Ot(ie,"="),$e(G,{key:X(St(se)),value:X(De(se,"="))}))},serialize:function(){for(var D=this.entries,G=[],W=0,Z;W<D.length;)Z=D[W++],$e(G,He(Z.key)+"="+He(Z.value));return De(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Te=function(){v(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=q(this,new Me(G));o||(this.size=W.entries.length)},Ge=Te.prototype;if(c(Ge,{append:function(G,W){var Z=F(this);te(arguments.length,2),$e(Z.entries,{key:b(G),value:b(W)}),o||this.length++,Z.updateURL()},delete:function(D){for(var G=F(this),W=te(arguments.length,1),Z=G.entries,ie=b(D),se=W<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<Z.length;){var be=Z[ve];if(be.key===ie&&(he===void 0||be.value===he)){if(It(Z,ve,1),he!==void 0)break}else ve++}o||(this.size=Z.length),G.updateURL()},get:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=0;ie<W.length;ie++)if(W[ie].key===Z)return W[ie].value;return null},getAll:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=[],se=0;se<W.length;se++)W[se].key===Z&&$e(ie,W[se].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),se=Z<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<W.length;){var be=W[ve++];if(be.key===ie&&(he===void 0||be.value===he))return!0}return!1},set:function(G,W){var Z=F(this);te(arguments.length,1);for(var ie=Z.entries,se=!1,he=b(G),ve=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(se?It(ie,be--,1):(se=!0,qe.value=ve));se||$e(ie,{key:he,value:ve}),o||(this.size=ie.length),Z.updateURL()},sort:function(){var G=F(this);M(G.entries,function(W,Z){return W.key>Z.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=F(this).entries,Z=P(G,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<W.length;)se=W[ie++],Z(se.value,se.key,this)},keys:function(){return new _e(this,"keys")},values:function(){return new _e(this,"values")},entries:function(){return new _e(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&l(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Te,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Te}),!s&&p(H)){var rr=i(J.has),Ur=i(J.set),nr=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,rr(W,"content-type")||Ur(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(D,{body:A(0,b(G)),headers:A(0,W)})}return D};if(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?nr(arguments[1]):{})}}),p(x)){var ar=function(G){return v(this,Y),new x(G,arguments.length>1?nr(arguments[1]):{})};Y.constructor=ar,ar.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ar})}}return Wi={URLSearchParams:Te,getState:F},Wi}var ll;function Mp(){return ll||(ll=1,Mh()),mc}var fl={},dl;function Fp(){if(dl)return fl;dl=1;var t=Xe(),e=pe(),r=wt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(R,A){l(v,{key:A,value:R})}),n(h,1);for(var p=r(f),g=r(d),P=0,w=0,y=!1,m=v.length,b;P<m;)b=v[P++],y||b.key===p?(y=!0,s(this,b.key)):w++;for(;w<m;)b=v[w++],b.key===p&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),fl}var hl={},vl;function Kp(){if(vl)return hl;vl=1;var t=Xe(),e=pe(),r=wt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),hl}var pl={},ml;function zp(){if(ml)return pl;ml=1;var t=Le(),e=pe(),r=Mn(),n=URLSearchParams.prototype,a=e(n.forEach);return t&&!("size"in n)&&r(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),pl}var Vi,gl;function zn(){if(gl)return Vi;gl=1;var t=me();return Vi=t,Vi}var Ji,yl;function Fh(){if(yl)return Ji;yl=1,Mp(),Fp(),Kp(),zp();var t=zn();return Ji=t.URLSearchParams,Ji}var wl={},bl={},Sl={},Zi,Il;function Kh(){if(Il)return Zi;Il=1;var t=pe(),e=Ts(),r=wt(),n=$n(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Zi={codeAt:s(!1),charAt:s(!0)},Zi}var Pl;function zh(){if(Pl)return Sl;Pl=1;var t=Kh().charAt,e=wt(),r=Er(),n=xh(),a=qs(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),Sl}var Yi,El;function Hp(){if(El)return Yi;El=1;var t=Le(),e=pe(),r=je(),n=Ae(),a=Th(),i=Lh(),o=Oh(),s=qn(),u=ph(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Yi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(g){d[g]=g}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),g=arguments.length,P=1,w=i.f,y=o.f;g>P;)for(var m=u(arguments[P++]),b=w?f(a(m),w(m)):a(m),R=b.length,A=0,j;R>A;)j=b[A++],(!t||r(y,m,j))&&(p[j]=m[j]);return p}:l,Yi}var Xi,kl;function Hh(){if(kl)return Xi;kl=1;var t=je(),e=rt(),r=_s();return Xi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Xi}var Qi,_l;function Bp(){if(_l)return Qi;_l=1;var t=rt(),e=Hh();return Qi=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Qi}var eo,Tl;function Bh(){if(Tl)return eo;Tl=1;var t=Ue(),e=Qr(),r=t("iterator"),n=Array.prototype;return eo=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},eo}var to,Rl;function Gh(){if(Rl)return to;Rl=1;var t=pe(),e=Ae(),r=we(),n=en(),a=Ye(),i=Us(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,to=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,to}var ro,Ol;function Gp(){if(Ol)return ro;Ol=1;var t=Le(),e=yt(),r=Xt();return ro=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},ro}var no,Cl;function Wp(){if(Cl)return no;Cl=1;var t=_r(),e=je(),r=qn(),n=Bp(),a=Bh(),i=Gh(),o=Rs(),s=Gp(),u=Ds(),l=Fn(),c=Array;return no=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,j,z;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),j=A.next;!(R=e(j,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=v?new this(m):c(m);m>y;y++)z=P?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},no}var ao,Al;function Vp(){if(Al)return ao;Al=1;var t=pe(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),j=function($){for(var M=[],N=0,S=$.length;N<S;){var O=w($,N++);if(O>=55296&&O<=56319&&N<S){var q=w($,N++);(q&64512)===56320?m(M,((O&1023)<<10)+(q&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function($){return $+22+75*($<26)},V=function($,M,N){var S=0;for($=N?g($/o):$>>1,$+=g($/M);$>d*a>>1;)$=g($/d),S+=r;return g(S+(d+1)*$/($+i))},te=function($){var M=[];$=j($);var N=$.length,S=u,O=0,q=s,F,I;for(F=0;F<$.length;F++)I=$[F],I<128&&m(M,P(I));var _=M.length,x=_;for(_&&m(M,l);x<N;){var H=e;for(F=0;F<$.length;F++)I=$[F],I>=S&&I<H&&(H=I);var Y=x+1;if(H-S>g((e-O)/Y))throw new v(h);for(O+=(H-S)*Y,S=H,F=0;F<$.length;F++){if(I=$[F],I<S&&++O>e)throw new v(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=q?n:fe>=q+a?a:fe-q;if(J<ne)break;var ue=J-ne,ae=r-ne;m(M,P(z(ne+ue%ae))),J=g(ue/ae),fe+=r}m(M,P(z(J))),q=V(O,Y,x===_),O=0,x++}}O++,S++}return y(M,"")};return ao=function($){var M=[],N=R(b(A($),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,p(c,O)?"xn--"+te(O):O);return y(M,".")},ao}var Ul;function Jp(){if(Ul)return bl;Ul=1,zh();var t=Ie(),e=Le(),r=Dn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Mn(),u=Ns(),l=Je(),c=Hp(),f=Wp(),h=Kn(),d=Kh().codeAt,v=Vp(),p=wt(),g=kr(),P=er(),w=Mh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,j=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,$=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),q=i([].pop),F=i([].push),I=i("".replace),_=i([].shift),x=i("".split),H=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",ke=/[a-z]/i,Ne=/[\d+-.a-z]/i,De=/\d/,$e=/^0x/i,Qe=/^[0-7]+$/,St=/^\d+$/,It=/^[\da-f]+$/i,Ot=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ct=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,tr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,At=/[\t\n\r]/g,ge,et=function(k){var L=x(k,"."),T,E,C,re,B,ye,Se;if(L.length&&L[L.length-1]===""&&L.length--,T=L.length,T>4)return k;for(E=[],C=0;C<T;C++){if(re=L[C],re==="")return k;if(B=10,re.length>1&&M(re,0)==="0"&&(B=N($e,re)?16:8,re=H(re,B===8?1:2)),re==="")ye=0;else{if(!N(B===10?St:B===8?Qe:It,re))return k;ye=V(re,B)}F(E,ye)}for(C=0;C<T;C++)if(ye=E[C],C===T-1){if(ye>=$(256,5-T))return null}else if(ye>255)return null;for(Se=q(E),C=0;C<E.length;C++)Se+=E[C]*$(256,3-C);return Se},Ut=function(k){var L=[0,0,0,0,0,0,0,0],T=0,E=null,C=0,re,B,ye,Se,Re,Ve,U,Pe=function(){return M(k,C)};if(Pe()===":"){if(M(k,1)!==":")return;C+=2,T++,E=T}for(;Pe();){if(T===8)return;if(Pe()===":"){if(E!==null)return;C++,T++,E=T;continue}for(re=B=0;B<4&&N(It,Pe());)re=re*16+V(Pe(),16),C++,B++;if(Pe()==="."){if(B===0||(C-=B,T>6))return;for(ye=0;Pe();){if(Se=null,ye>0)if(Pe()==="."&&ye<4)C++;else return;if(!N(De,Pe()))return;for(;N(De,Pe());){if(Re=V(Pe(),10),Se===null)Se=Re;else{if(Se===0)return;Se=Se*10+Re}if(Se>255)return;C++}L[T]=L[T]*256+Se,ye++,(ye===2||ye===4)&&T++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;L[T++]=re}if(E!==null)for(Ve=T-E,T=7;T!==0&&Ve>0;)U=L[T],L[T--]=L[E+Ve-1],L[E+--Ve]=U;else if(T!==8)return;return L},K=function(k){for(var L=null,T=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>T&&(L=E,T=C),E=null,C=0):(E===null&&(E=re),++C);return C>T?E:L},X=function(k){var L,T,E,C;if(typeof k=="number"){for(L=[],T=0;T<4;T++)J(L,k%256),k=te(k/256);return S(L,".")}if(typeof k=="object"){for(L="",E=K(k),T=0;T<8;T++)C&&k[T]===0||(C&&(C=!1),E===T?(L+=T?":":"::",C=!0):(L+=O(k[T],16),T<7&&(L+=":")));return"["+L+"]"}return k},oe={},le=c({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},le,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),_e=function(k,L){var T=d(k,0);return T>32&&T<127&&!l(L,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Te=function(k,L){var T;return k.length===2&&N(ke,M(k,0))&&((T=M(k,1))===":"||!L&&T==="|")},Ge=function(k){var L;return k.length>1&&Te(H(k,0,2))&&(k.length===2||(L=M(k,2))==="/"||L==="\\"||L==="?"||L==="#")},rr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},nr={},ar={},D={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},at={},Qn={},uc={},ea={},ir={},it={},lc={},Lt={},lt={},ta=function(k,L,T){var E=p(k),C,re,B;if(L){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(T!==void 0&&(C=new ta(T,!0)),re=this.parse(E,null,C),re)throw new z(re);B=A(new R),B.bindURL(this),this.searchParams=B}};ta.prototype={type:"URL",parse:function(k,L,T){var E=this,C=L||nr,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=p(k),L||(E.scheme="",E.username="",E.password="",E.host=null,E.port=null,E.path=[],E.query=null,E.fragment=null,E.cannotBeABaseURL=!1,k=I(k,Ar,""),k=I(k,tr,"$1")),k=I(k,At,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case nr:if(U&&N(ke,U))B+=Y(U),C=ar;else{if(L)return ne;C=D;continue}break;case ar:if(U&&(N(Ne,U)||U==="+"||U==="-"||U==="."))B+=Y(U);else if(U===":"){if(L&&(E.isSpecial()!==l(Me,B)||B==="file"&&(E.includesCredentials()||E.port!==null)||E.scheme==="file"&&!E.host))return;if(E.scheme=B,L){E.isSpecial()&&Me[E.scheme]===E.port&&(E.port=null);return}B="",E.scheme==="file"?C=Qn:E.isSpecial()&&T&&T.scheme===E.scheme?C=G:E.isSpecial()?C=se:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=lc)}else{if(L)return ne;B="",C=D,re=0;continue}break;case D:if(!T||T.cannotBeABaseURL&&U!=="#")return ne;if(T.cannotBeABaseURL&&U==="#"){E.scheme=T.scheme,E.path=h(T.path),E.query=T.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=T.scheme==="file"?Qn:Z;continue;case G:if(U==="/"&&Ve[re+1]==="/")C=he,re++;else{C=Z;continue}break;case W:if(U==="/"){C=ve;break}else{C=it;continue}case Z:if(E.scheme=T.scheme,U===ge)E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query="",C=Lt;else if(U==="#")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.path.length--,C=it;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=ve;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,C=it;continue}break;case se:if(C=he,U!=="/"||M(B,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=ve;continue}break;case ve:if(U==="@"){ye&&(B="%40"+B),ye=!0,Pe=f(B);for(var ra=0;ra<Pe.length;ra++){var hc=Pe[ra];if(hc===":"&&!Re){Re=!0;continue}var vc=_e(hc,He);Re?E.password+=vc:E.username+=vc}B=""}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(ye&&B==="")return fe;re-=f(B).length+1,B="",C=be}else B+=U;break;case be:case qe:if(L&&E.scheme==="file"){C=ea;continue}else if(U===":"&&!Se){if(B==="")return ue;if(ft=E.parseHost(B),ft)return ft;if(B="",C=at,L===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ue;if(L&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=ir,L)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case at:if(N(De,U))B+=U;else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()||L){if(B!==""){var na=V(B,10);if(na>65535)return ae;E.port=E.isSpecial()&&na===Me[E.scheme]?null:na,B=""}if(L)return;C=ir;continue}else return ae;break;case Qn:if(E.scheme="file",U==="/"||U==="\\")C=uc;else if(T&&T.scheme==="file")switch(U){case ge:E.host=T.host,E.path=h(T.path),E.query=T.query;break;case"?":E.host=T.host,E.path=h(T.path),E.query="",C=Lt;break;case"#":E.host=T.host,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=T.host,E.path=h(T.path),E.shortenPath()),C=it;continue}else{C=it;continue}break;case uc:if(U==="/"||U==="\\"){C=ea;break}T&&T.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(Te(T.path[0],!0)?F(E.path,T.path[0]):E.host=T.host),C=it;continue;case ea:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!L&&Te(B))C=it;else if(B===""){if(E.host="",L)return;C=ir}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),L)return;B="",C=ir}continue}else B+=U;break;case ir:if(E.isSpecial()){if(C=it,U!=="/"&&U!=="\\")continue}else if(!L&&U==="?")E.query="",C=Lt;else if(!L&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=it,U!=="/"))continue;break;case it:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!L&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):rr(B)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&Te(B)&&(E.host&&(E.host=""),B=M(B,0)+":"),F(E.path,B)),B="",E.scheme==="file"&&(U===ge||U==="?"||U==="#"))for(;E.path.length>1&&E.path[0]==="";)_(E.path);U==="?"?(E.query="",C=Lt):U==="#"&&(E.fragment="",C=lt)}else B+=_e(U,de);break;case lc:U==="?"?(E.query="",C=Lt):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=_e(U,oe));break;case Lt:!L&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=_e(U,oe));break;case lt:U!==ge&&(E.fragment+=_e(U,le));break}re++}},parseHost:function(k){var L,T,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||(L=Ut(H(k,1,-1)),!L))return ue;this.host=L}else if(this.isSpecial()){if(k=v(k),N(Ot,k)||(L=et(k),L===null))return ue;this.host=L}else{if(N(Ct,k))return ue;for(L="",T=f(k),E=0;E<T.length;E++)L+=_e(T[E],oe);this.host=L}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Me,this.scheme)},shortenPath:function(){var k=this.path,L=k.length;L&&(this.scheme!=="file"||L!==1||!Te(k[0],!0))&&k.length--},serialize:function(){var k=this,L=k.scheme,T=k.username,E=k.password,C=k.host,re=k.port,B=k.path,ye=k.query,Se=k.fragment,Re=L+":";return C!==null?(Re+="//",k.includesCredentials()&&(Re+=T+(E?":"+E:"")+"@"),Re+=X(C),re!==null&&(Re+=":"+re)):L==="file"&&(Re+="//"),Re+=k.cannotBeABaseURL?B[0]:B.length?"/"+S(B,"/"):"",ye!==null&&(Re+="?"+ye),Se!==null&&(Re+="#"+Se),Re},setHref:function(k){var L=this.parse(k);if(L)throw new z(L);this.searchParams.update()},getOrigin:function(){var k=this.scheme,L=this.port;if(k==="blob")try{return new or(k.path[0]).origin}catch{return"null"}return k==="file"||!this.isSpecial()?"null":k+"://"+X(this.host)+(L!==null?":"+L:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(k){this.parse(p(k)+":",nr)},getUsername:function(){return this.username},setUsername:function(k){var L=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var T=0;T<L.length;T++)this.username+=_e(L[T],He)}},getPassword:function(){return this.password},setPassword:function(k){var L=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var T=0;T<L.length;T++)this.password+=_e(L[T],He)}},getHost:function(){var k=this.host,L=this.port;return k===null?"":L===null?X(k):X(k)+":"+L},setHost:function(k){this.cannotBeABaseURL||this.parse(k,be)},getHostname:function(){var k=this.host;return k===null?"":X(k)},setHostname:function(k){this.cannotBeABaseURL||this.parse(k,qe)},getPort:function(){var k=this.port;return k===null?"":p(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=p(k),k===""?this.port=null:this.parse(k,at))},getPathname:function(){var k=this.path;return this.cannotBeABaseURL?k[0]:k.length?"/"+S(k,"/"):""},setPathname:function(k){this.cannotBeABaseURL||(this.path=[],this.parse(k,ir))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=p(k),k===""?this.query=null:(M(k,0)==="?"&&(k=H(k,1)),this.query="",this.parse(k,Lt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=p(k),k===""){this.fragment=null;return}M(k,0)==="#"&&(k=H(k,1)),this.fragment="",this.parse(k,lt)},update:function(){this.query=this.searchParams.serialize()||null}};var or=function(L){var T=u(this,xe),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(T,new ta(L,!1,E));e||(T.href=C.serialize(),T.origin=C.getOrigin(),T.protocol=C.getProtocol(),T.username=C.getUsername(),T.password=C.getPassword(),T.host=C.getHost(),T.hostname=C.getHostname(),T.port=C.getPort(),T.pathname=C.getPathname(),T.search=C.getSearch(),T.searchParams=C.getSearchParams(),T.hash=C.getHash())},xe=or.prototype,We=function(k,L){return{get:function(){return b(this)[k]()},set:L&&function(T){return b(this)[L](T)},configurable:!0,enumerable:!0}};if(e&&(s(xe,"href",We("serialize","setHref")),s(xe,"origin",We("getOrigin")),s(xe,"protocol",We("getProtocol","setProtocol")),s(xe,"username",We("getUsername","setUsername")),s(xe,"password",We("getPassword","setPassword")),s(xe,"host",We("getHost","setHost")),s(xe,"hostname",We("getHostname","setHostname")),s(xe,"port",We("getPort","setPort")),s(xe,"pathname",We("getPathname","setPathname")),s(xe,"search",We("getSearch","setSearch")),s(xe,"searchParams",We("getSearchParams")),s(xe,"hash",We("getHash","setHash"))),o(xe,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(xe,"toString",function(){return b(this).serialize()},{enumerable:!0}),j){var fc=j.createObjectURL,dc=j.revokeObjectURL;fc&&o(or,"createObjectURL",a(fc,j)),dc&&o(or,"revokeObjectURL",a(dc,j))}return g(or,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:or}),bl}var Ll;function Zp(){return Ll||(Ll=1,Jp()),wl}var $l={},ql;function Yp(){if(ql)return $l;ql=1;var t=Ie(),e=Ye(),r=Ae(),n=er(),a=wt(),i=Dn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),$l}var jl={},Nl;function Xp(){if(Nl)return jl;Nl=1;var t=Ie(),e=Ye(),r=er(),n=wt(),a=Dn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),jl}var xl={},Dl;function Qp(){if(Dl)return xl;Dl=1;var t=Ie(),e=je();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),xl}var io,Ml;function em(){if(Ml)return io;Ml=1,Fh(),Zp(),Yp(),Xp(),Qp();var t=zn();return io=t.URL,io}var oo,Fl;function tm(){if(Fl)return oo;Fl=1;var t=em();return oo=t,oo}var so,Kl;function rm(){if(Kl)return so;Kl=1;var t=tm();return so=t,so}rm();var zl={},co,Hl;function nm(){return Hl||(Hl=1,co={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}),co}var uo,Bl;function am(){if(Bl)return uo;Bl=1;var t=jn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return uo=r===Object.prototype?void 0:r,uo}var Gl;function Wh(){if(Gl)return zl;Gl=1;var t=me(),e=nm(),r=am(),n=js(),a=Qt(),i=kr(),o=Ue(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),zl}var lo,Wl;function im(){if(Wl)return lo;Wl=1;var t=Fh();return Wh(),lo=t,lo}var fo,Vl;function om(){if(Vl)return fo;Vl=1;var t=im();return fo=t,fo}om();var Jl={},Zl={},ho,Yl;function sm(){if(Yl)return ho;Yl=1;var t=Ze(),e=Qt();return ho=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},ho}var vo,Xl;function cm(){if(Xl)return vo;Xl=1;var t=pe(),e=Error,r=t("".replace),n=(function(o){return String(new e(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return vo=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},vo}var po,Ql;function um(){if(Ql)return po;Ql=1;var t=Ae(),e=Xt();return po=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),po}var mo,ef;function lm(){if(ef)return mo;ef=1;var t=Qt(),e=cm(),r=um(),n=Error.captureStackTrace;return mo=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},mo}var go,tf;function tn(){if(tf)return go;tf=1;var t=_r(),e=je(),r=rt(),n=xn(),a=Bh(),i=Rs(),o=Nn(),s=Ds(),u=Fn(),l=Hh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return go=function(d,v,p){var g=p&&p.that,P=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),R,A,j,z,V,te,$,M=function(S){return R&&l(R,"normal"),new f(!0,S)},N=function(S){return P?(r(S),m?b(S[0],S[1],M):b(S[0],S[1])):m?b(S,M):b(S)};if(w)R=d.iterator;else if(y)R=d;else{if(A=u(d),!A)throw new c(n(d)+" is not iterable");if(a(A)){for(j=0,z=i(d);z>j;j++)if(V=N(d[j]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!($=e(te,R)).done;){try{V=N($.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},go}var yo,rf;function fm(){if(rf)return yo;rf=1;var t=wt();return yo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},yo}var nf;function dm(){if(nf)return Zl;nf=1;var t=Ie(),e=Nn(),r=Ls(),n=$s(),a=$h(),i=Xr(),o=Qt(),s=Xt(),u=sm(),l=lm(),c=tn(),f=fm(),h=Ue(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new v,b?r(this):P):(R=b?this:i(P),o(R,d,"Error")),m!==void 0&&o(R,"message",f(m)),l(R,g,R.stack,1),arguments.length>2&&u(R,arguments[2]);var A=[];return c(y,p,{that:A}),o(R,"errors",A),R};n?n(g,v):a(g,v,{name:!0});var P=g.prototype=i(v.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Zl}var af;function hm(){return af||(af=1,dm()),Jl}var of={},wo,sf;function vm(){if(sf)return wo;sf=1;var t=xs(),e=en();return wo=t?{}.toString:function(){return"[object "+e(this)+"]"},wo}var cf;function pm(){if(cf)return of;cf=1;var t=xs(),e=Xe(),r=vm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),of}var uf={},lf={},bo,ff;function Vh(){if(ff)return bo;ff=1;var t=me(),e=Yr(),r=Un(),n=function(a){return e.slice(0,a.length)===a};return bo=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),bo}var So,df;function Ms(){if(df)return So;df=1;var t=Vh();return So=t==="NODE",So}var Io,hf;function mm(){if(hf)return Io;hf=1;var t=Ye(),e=Mn(),r=Ue(),n=Le(),a=r("species");return Io=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Io}var Po,vf;function gm(){if(vf)return Po;vf=1;var t=Gh(),e=xn(),r=TypeError;return Po=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Po}var Eo,pf;function Jh(){if(pf)return Eo;pf=1;var t=rt(),e=gm(),r=Ln(),n=Ue(),a=n("species");return Eo=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},Eo}var ko,mf;function Zh(){if(mf)return ko;mf=1;var t=An(),e=Function.prototype,r=e.apply,n=e.call;return ko=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),ko}var _o,gf;function Yh(){if(gf)return _o;gf=1;var t=Yr();return _o=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),_o}var To,yf;function Xh(){if(yf)return To;yf=1;var t=me(),e=Zh(),r=_r(),n=we(),a=Je(),i=Ae(),o=Rh(),s=Kn(),u=jn(),l=er(),c=Yh(),f=Ms(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,j,z;i(function(){R=t.location});var V=function(N){if(a(m,N)){var S=m[N];delete m[N],S()}},te=function(N){return function(){V(N)}},$=function(N){V(N.data)},M=function(N){t.postMessage(w(N),R.protocol+"//"+R.host)};return(!h||!d)&&(h=function(S){l(arguments.length,1);var O=n(S)?S:g(S),q=s(arguments,1);return m[++y]=function(){e(O,void 0,q)},A(y),y},d=function(S){delete m[S]},f?A=function(N){v.nextTick(te(N))}:p&&p.now?A=function(N){p.now(te(N))}:P&&!c?(j=new P,z=j.port2,j.port1.onmessage=$,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",$,!1)):b in u("script")?A=function(N){o.appendChild(u("script"))[b]=function(){o.removeChild(this),V(N)}}:A=function(N){setTimeout(te(N),0)}),To={set:h,clear:d},To}var Ro,wf;function Qh(){if(wf)return Ro;wf=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(e){var r={item:e,next:null},n=this.tail;n?n.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},Ro=t,Ro}var Oo,bf;function ym(){if(bf)return Oo;bf=1;var t=Yr();return Oo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Oo}var Co,Sf;function wm(){if(Sf)return Co;Sf=1;var t=Yr();return Co=/web0s(?!.*chrome)/i.test(t),Co}var Ao,If;function bm(){if(If)return Ao;If=1;var t=me(),e=Dh(),r=_r(),n=Xh().set,a=Qh(),i=Yh(),o=ym(),s=wm(),u=Ms(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,g,P,w;if(!d){var y=new a,m=function(){var b,R;for(u&&(b=f.domain)&&b.exit();R=y.get();)try{R()}catch(A){throw y.head&&v(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(p=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),v=function(){g.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),v=function(){w(m)}):u?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(b){y.head||v(),y.add(b)}}return Ao=d,Ao}var Uo,Pf;function Sm(){return Pf||(Pf=1,Uo=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),Uo}var Lo,Ef;function Tr(){return Ef||(Ef=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var $o,kf;function Rr(){if(kf)return $o;kf=1;var t=me();return $o=t.Promise,$o}var qo,_f;function rn(){if(_f)return qo;_f=1;var t=me(),e=Rr(),r=we(),n=qh(),a=Us(),i=Ue(),o=Vh(),s=ut(),u=yh(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var g=new e(function(y){y(1)}),P=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=P,f=g.then(function(){})instanceof P,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return qo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},qo}var jo={},Tf;function bt(){if(Tf)return jo;Tf=1;var t=nt(),e=TypeError,r=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new e("Bad Promise constructor");a=o,i=s}),this.resolve=t(a),this.reject=t(i)};return jo.f=function(n){return new r(n)},jo}var Rf;function Im(){if(Rf)return lf;Rf=1;var t=Ie(),e=ut(),r=Ms(),n=me(),a=zn(),i=je(),o=Xe(),s=$s(),u=kr(),l=mm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Jh(),p=Xh().set,g=bm(),P=Sm(),w=Tr(),y=Qh(),m=Er(),b=Rr(),R=rn(),A=bt(),j="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,$=m.getterFor(j),M=m.set,N=b&&b.prototype,S=b,O=N,q=n.TypeError,F=n.document,I=n.process,_=A.f,x=_,H=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ue=2,ae=1,ke=2,Ne,De,$e,Qe,St=function(K){var X;return h(K)&&f(X=K.then)?X:!1},It=function(K,X){var oe=X.value,le=X.state===ne,de=le?K.ok:K.fail,He=K.resolve,_e=K.reject,Me=K.domain,Te,Ge,rr;try{de?(le||(X.rejection===ke&&At(X),X.rejection=ae),de===!0?Te=oe:(Me&&Me.enter(),Te=de(oe),Me&&(Me.exit(),rr=!0)),Te===K.promise?_e(new q("Promise-chain cycle")):(Ge=St(Te))?i(Ge,Te,He,_e):He(Te)):_e(oe)}catch(Ur){Me&&!rr&&Me.exit(),_e(Ur)}},Ot=function(K,X){K.notified||(K.notified=!0,g(function(){for(var oe=K.reactions,le;le=oe.get();)It(le,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ct=function(K,X,oe){var le,de;H?(le=F.createEvent("Event"),le.promise=X,le.reason=oe,le.initEvent(K,!1,!0),n.dispatchEvent(le)):le={promise:X,reason:oe},!V&&(de=n["on"+K])?de(le):K===Y&&P("Unhandled promise rejection",oe)},Ar=function(K){i(p,n,function(){var X=K.facade,oe=K.value,le=tr(K),de;if(le&&(de=w(function(){r?I.emit("unhandledRejection",oe,X):Ct(Y,X,oe)}),K.rejection=r||tr(K)?ke:ae,de.error))throw de.value})},tr=function(K){return K.rejection!==ae&&!K.parent},At=function(K){i(p,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ct(J,X,K.value)})},ge=function(K,X,oe){return function(le){K(X,le,oe)}},et=function(K,X,oe){K.done||(K.done=!0,oe&&(K=oe),K.value=X,K.state=ue,Ot(K,!0))},Ut=function(K,X,oe){if(!K.done){K.done=!0,oe&&(K=oe);try{if(K.facade===X)throw new q("Promise can't be resolved itself");var le=St(X);le?g(function(){var de={done:!1};try{i(le,X,ge(Ut,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Ot(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var oe=$(this);try{X(ge(Ut,oe),ge(et,oe))}catch(le){et(oe,le)}},O=S.prototype,Ne=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,oe){var le=$(this),de=_(v(this,S));return le.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?I.domain:void 0,le.state===fe?le.reactions.add(de):g(function(){It(de,le)}),de.promise}),De=function(){var K=new Ne,X=$(K);this.promise=K,this.resolve=ge(Ut,X),this.reject=ge(et,X)},A.f=_=function(K){return K===S||K===$e?new De(K):x(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,oe){var le=this;return new S(function(de,He){i(Qe,le,de,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,O)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:S}),$e=a.Promise,u(S,j,!1,!0),l(j),lf}var Of={},No,Cf;function Pm(){if(Cf)return No;Cf=1;var t=Ue(),e=t("iterator"),r=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){r=!0}};a[e]=function(){return this},Array.from(a,function(){throw 2})}catch{}return No=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},No}var xo,Af;function Hn(){if(Af)return xo;Af=1;var t=Rr(),e=Pm(),r=rn().CONSTRUCTOR;return xo=r||!e(function(n){t.all(n).then(void 0,function(){})}),xo}var Uf;function Em(){if(Uf)return Of;Uf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Of}var Lf={},$f;function km(){if($f)return Lf;$f=1;var t=Ie(),e=ut(),r=rn().CONSTRUCTOR,n=Rr(),a=Ye(),i=we(),o=Xe(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return Lf}var qf={},jf;function _m(){if(jf)return qf;jf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),qf}var Nf={},xf;function Tm(){if(xf)return Nf;xf=1;var t=Ie(),e=bt(),r=rn().CONSTRUCTOR;return t({target:"Promise",stat:!0,forced:r},{reject:function(a){var i=e.f(this),o=i.reject;return o(a),i.promise}}),Nf}var Df={},Do,Mf;function ev(){if(Mf)return Do;Mf=1;var t=rt(),e=Ze(),r=bt();return Do=function(n,a){if(t(n),e(a)&&a.constructor===n)return a;var i=r.f(n),o=i.resolve;return o(a),i.promise},Do}var Ff;function Rm(){if(Ff)return Df;Ff=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=ev(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),Df}var Kf;function Om(){return Kf||(Kf=1,Im(),Em(),km(),_m(),Tm(),Rm()),uf}var zf={},Hf;function Cm(){if(Hf)return zf;Hf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--P||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),zf}var Bf={},Gf;function Am(){if(Gf)return Bf;Gf=1;var t=Ie(),e=je(),r=nt(),n=Ye(),a=bt(),i=Tr(),o=tn(),s=Hn(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,j=!1;m++,e(P,f,R).then(function(z){j||b||(b=!0,v(z))},function(z){j||b||(j=!0,w[A]=z,--m||p(new h(w,u)))})}),--m||p(new h(w,u))});return g.error&&p(g.value),d.promise}}),Bf}var Wf={},Vf;function tv(){if(Vf)return Wf;Vf=1;var t=Ie(),e=me(),r=Zh(),n=Kn(),a=bt(),i=nt(),o=Tr(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Wf}var Jf={},Zf;function rv(){if(Zf)return Jf;Zf=1;var t=Ie(),e=bt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Jf}var Yf={},Xf;function Um(){if(Xf)return Yf;Xf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Jh(),s=ev(),u=Xe(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Yf}var Mo,Qf;function Lm(){if(Qf)return Mo;Qf=1,hm(),js(),pm(),Om(),Cm(),Am(),tv(),rv(),Um(),zh();var t=zn();return Mo=t.Promise,Mo}var Fo,ed;function $m(){if(ed)return Fo;ed=1;var t=Lm();return Wh(),Fo=t,Fo}var td={},rd;function qm(){return rd||(rd=1,tv()),td}var nd={},ad;function jm(){return ad||(ad=1,rv()),nd}var Ko,id;function Nm(){if(id)return Ko;id=1;var t=$m();return qm(),jm(),Ko=t,Ko}Nm();const nv="sesamy-debug";function xm(t,e,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${t}=${e}; ${a}; path=/`}function Dm(t){if(typeof document>"u")return null;const e=t+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null}function Mm(t){xm(nv,t.toString(),1)}function Fm(){return Dm(nv)==="true"}function ce(t){Fm()&&console.log(t)}function Vt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});ce(`Triggering event: ${t}`),dispatchEvent(r)}function st(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r}var Nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ks(t,e){return t(e={exports:{}},e.exports),e.exports}var qt=Ks((function(t,e){Object.defineProperty(e,"__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})();e.default=function(){return r.getInstance()}}));Fs(qt);var Km=Fs(Ks((function(t,e){var r=Nt&&Nt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function g(y){try{w(d.next(y))}catch(m){p(m)}}function P(y){try{w(d.throw(y))}catch(m){p(m)}}function w(y){y.done?v(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=Nt&&Nt.__generator||function(c,f){var h,d,v,p,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function P(w){return function(y){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;g;)try{if(h=1,d&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return g.label++,{value:m[1],done:!1};case 5:g.label++,d=m[1],m=[0];continue;case 7:m=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){g.label=m[1];break}if(m[0]===6&&g.label<v[1]){g.label=v[1],v=m;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(m);break}v[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=Nt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){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=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,p,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(p))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,qt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(g=p.getItemSync(f))===null?(qt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),qt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(qt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var w=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,p;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,qt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),qt.default().unlock(p.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var g=d.keySync(p);if(g===null)break;v.push(g),p++}for(var P=!1,w=0;w<v.length;w++){var y=v[w];if(y.includes(i)){var m=d.getItemSync(y);if(m!==null){var b=JSON.parse(m);(b.timeRefreshed===void 0&&b.timeAcquired<h||b.timeRefreshed!==void 0&&b.timeRefreshed<h)&&(d.removeItemSync(y),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const zm={timeoutInSeconds:60},av={name:"auth0-spa-js",version:"2.8.0"},iv=()=>Date.now();let Ee=class ss extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,ss.prototype)}static fromPayload({error:e,error_description:r}){return new ss(e,r)}},Hm=class ov extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,ov.prototype)}},Bm=class sv extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,sv.prototype)}},cs=class cv extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,cv.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Gm=class uv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,uv.prototype)}},Wm=class lv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,lv.prototype)}},fv=class dv extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${bn(e,["default"])}', scope: '${bn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,dv.prototype)}},Vm=class hv extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${bn(e,["default"])}', missing scope: '${bn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,hv.prototype)}},vv=class pv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,pv.prototype)}};function bn(t,e=[]){return t&&!e.includes(t)?t:""}const Sn=()=>window.crypto,$r=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(Sn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},zo=t=>btoa(t),Jm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Zm=t=>Object.keys(t).reduce(((e,r)=>{const n=Jm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),us=t=>{var{clientId:e}=t,r=st(t,["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:e},r))).toString()},od=async t=>await Sn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),sd=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),cd=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Ym=new TextEncoder,Xm=new TextDecoder;function zr(t){return typeof t=="string"?Ym.encode(t):Xm.decode(t)}function ud(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new eg(`${t.name} modulusLength must be at least 2048 bits`)}async function Qm(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${Hr(zr(JSON.stringify(t)))}.${Hr(zr(JSON.stringify(e)))}`;return`${n}.${Hr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return ud(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return ud(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Mt})(r),r,zr(n)))}`}let ls;Uint8Array.prototype.toBase64?ls=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):ls=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Hr(t){return ls(t)}let Mt=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},eg=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function tg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Mt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Mt("unsupported CryptoKey algorithm name")}}function mv(t){return t instanceof CryptoKey}function gv(t){return mv(t)&&t.type==="public"}async function rg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!mv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!gv(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Qm({alg:tg(o),typ:"dpop+jwt",jwk:await yv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Hr(await crypto.subtle.digest("SHA-256",zr(a))):void 0}),o)}async function yv(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const ng=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function ag(){return(async function(t,e){var r;let n;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new Mt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function ig(t){return(async function(e){if(!gv(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await yv(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Mt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function og({keyPair:t,url:e,method:r,nonce:n,accessToken:a}){const i=(function(o){const s=new URL(o);return s.search="",s.hash="",s.href})(e);return rg(t,i,r,n,a)}const sg=async(t,e)=>{const r=await fetch(t,e);return{ok:r.ok,json:await r.json(),headers:(n=r.headers,[...n].reduce(((a,[i,o])=>(a[i]=o,a)),{}))};var n},cg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([sg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ug=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},lg=async(t,e,r,n,a,i,o=1e4,s)=>a?ug(t,e,r,n,o,a,i,s):cg(t,n,o);async function wv(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await lg(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=c.json,{error:d,error_description:v}=h,p=st(h,["error","error_description"]),{headers:g,ok:P}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!P){const y=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Wm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new fv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new vv(w);return wv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function fg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=st(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?us(d):JSON.stringify(d),p=(g=c.grant_type,ng.includes(g));var g;return await wv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Zm(o||av)))}},e,s,u,p?l:void 0)}const pn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},sn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),pn(n,e)};let ht=class fs{constructor(e,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[r,n,a,i]=e.split("::");return new fs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new fs({scope:r,audience:n,clientId:a})}},dg=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},bv=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},hg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||iv}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);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(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);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(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new ht({clientId:e.client_id,scope:e.scope,audience:e.audience}),a=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async remove(e,r,n){const a=new ht({clientId:e,scope:n,audience:r});await this.cache.remove(a.toKey())}async clear(e){var r;const n=await this.getCacheKeys();n&&(await n.filter((a=>!e||a.includes(e))).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(e){const r=await this.nowProvider();return{body:e,expiresAt:Math.floor(r/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new ht({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=ht.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=ht.fromKey(a);if(i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId){const o=await this.cache.get(a);if(!((n=o?.body)===null||n===void 0)&&n.refresh_token)return this.modifiedCachedEntry(o,e)}}}async updateEntry(e,r){var n;const a=await this.getCacheKeys();if(a)for(const i of a){const o=await this.cache.get(i);if(((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e){const s=Object.assign(Object.assign({},o.body),{refresh_token:r});await this.set(s)}}}},vg=class{constructor(e,r,n){this.storage=e,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const qr=t=>typeof t=="number",pg=["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"],mg=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(sd(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],pg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(sd(s)),claims:f,user:h}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.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(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!qr(e.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(e.claims.exp==null||!qr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!qr(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=t.leeway||60,n=new Date(t.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(e.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(e.claims.nbf!=null&&qr(e.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(e.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(e.claims.auth_time!=null&&qr(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.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(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const o=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_id}"`)}else{const o=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_name}"`)}}return e};var Ft=Ks((function(t,e){var r=Nt&&Nt.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Fs(Ft),Ft.encode,Ft.parse,Ft.getAll;var gg=Ft.get,Sv=Ft.set,Iv=Ft.remove;const lr={get(t){const e=gg(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Sv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Iv(t,r)}},yg={get(t){return lr.get(t)||lr.get(`_legacy_${t}`)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Sv(`_legacy_${t}`,JSON.stringify(e),n),lr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Iv(t,r),lr.remove(t,e),lr.remove(`_legacy_${t}`,e)}},wg={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var xt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(xt||(xt={}));function bg(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,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 ld,fd,dd,Ho,Sg=(ld="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",fd=null,dd=!1,function(t){return Ho=Ho||bg(ld,fd,dd),new Worker(Ho,t)});const Bo={};let Ig=class{constructor(e,r){this.cache=e,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(e),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(e){return`@@auth0spajs@@::${e}`}};const Pg={memory:()=>new bv().enclosedCache,localstorage:()=>new dg},hd=t=>Pg[t],vd=t=>{const{openUrl:e,onRedirect:r}=t,n=st(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},pd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},$t={NONCE:"nonce",KEYPAIR:"keypair"};let Eg=class{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise(((r,n)=>{e.onupgradeneeded=()=>Object.values($t).forEach((a=>e.result.createObjectStore(a))),e.onerror=()=>n(e.error),e.onsuccess=()=>r(e.result)}))}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,r,n){const a=n((await this.getDbHandle()).transaction(e,r).objectStore(e));return new Promise(((i,o)=>{a.onsuccess=()=>i(a.result),a.onerror=()=>o(a.error)}))}buildKey(e){const r=e?`_${e}`:"auth0";return`${this.clientId}::${r}`}setNonce(e,r){return this.save($t.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save($t.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find($t.NONCE,this.buildKey(e))}findKeyPair(){return this.find($t.KEYPAIR,this.buildKey())}find(e,r){return this.executeDbRequest(e,"readonly",(n=>n.get(r)))}async deleteBy(e,r){const n=await this.executeDbRequest(e,"readonly",(a=>a.getAllKeys()));n?.filter(r).map((a=>this.executeDbRequest(e,"readwrite",(i=>i.delete(a)))))}deleteByClientId(e,r){return this.deleteBy(e,(n=>typeof n=="string"&&n.startsWith(`${r}::`)))}clearNonces(){return this.deleteByClientId($t.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId($t.KEYPAIR,this.clientId)}},kg=class{constructor(e){this.storage=new Eg(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,r){return this.storage.setNonce(e,r)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await ag(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return og(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ig(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var fr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(fr||(fr={}));let _g=class{constructor(e,r){this.hooks=r,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,r){if(r){if(this.isAbsoluteUrl(r))return r;if(e)return`${e.replace(/\/?\/$/,"")}/${r.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,r){if(!this.config.baseUrl)return new Request(e,r);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),a=e instanceof Request?new Request(n,e):n;return new Request(a,r)}setAuthorizationHeader(e,r,n=fr.Bearer){e.headers.set("authorization",`${n} ${r}`)}async setDpopProofHeader(e,r){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),a=await this.hooks.generateDpopProof({accessToken:r,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",a)}async prepareRequest(e,r){const n=await this.getAccessToken(r);let a,i;typeof n=="string"?(a=this.config.dpopNonceId?fr.DPoP:fr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===fr.DPoP&&await this.setDpopProofHeader(e,i)}getHeader(e,r){return Array.isArray(e)?new Headers(e).get(r)||"":typeof e.get=="function"?e.get(r)||"":e[r]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const r=this.getHeader(e.headers,"www-authenticate");return r.includes("invalid_dpop_nonce")||r.includes("use_dpop_nonce")}async handleResponse(e,r){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!r.onUseDpopNonceError)throw new vv(n);return r.onUseDpopNonceError()}async internalFetchWithAuth(e,r,n,a){const i=this.buildBaseRequest(e,r);await this.prepareRequest(i,a);const o=await this.config.fetch(i);return this.handleResponse(o,n)}fetchWithAuth(e,r,n){const a={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,r,Object.assign(Object.assign({},a),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,r,a,n)}},Tg=class{constructor(e,r){this.myAccountFetcher=e,this.apiBase=r}async connectAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async completeAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async _handleResponse(e){let r;try{r=await e.text(),r=JSON.parse(r)}catch(n){throw new md({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new md(r)}},md=class Pv extends Error{constructor({type:e,status:r,title:n,detail:a,validation_errors:i}){super(a),this.name="MyAccountApiError",this.type=e,this.status=r,this.title=n,this.detail=a,this.validation_errors=i,Object.setPrototypeOf(this,Pv.prototype)}};const Go=new Km;let Rg=class{constructor(e){let r,n;if(this.userCache=new bv().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await Go.releaseLock(l);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!Sn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Sn().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
|
-
`)})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(r=e.cacheLocation||"memory",!dd(r))throw new Error(`Invalid cache location "${r}"`);n=dd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?lr:yg,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:wg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:pn(l,u,...c)};let f={default:pn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=pn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new vg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||av,this.cacheManager=new hg(n,n.allKeys?void 0:new Ig(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new kg(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Tg(s,o),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Sg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||nv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${us(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return mg({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,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(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,r,n){var a;const i=zo($r()),o=zo($r()),s=$r(),u=await id(s),l=sd(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:sn(v,p.scope,p.audience),response_type:"code",response_mode:m||"query",state:g,nonce:P,redirect_uri:y||d.authorizationParams.redirect_uri,code_challenge:w,code_challenge_method:"S256",dpop_jkt:b}))(this.options,this.scope,e,i,o,l,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,r?.response_mode,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},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(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new Gm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new zs(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ee.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ee("state_mismatch","Invalid state");const o=((n=e.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 e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(e={}){var r;const n=hd(e),{openUrl:a,fragment:i,appState:o}=n,s=st(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=st(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:xt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ee("missing_transaction","Invalid state");this.transactionManager.remove();const a=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const o=new URLSearchParams(i);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(r.join(""));return n.response_type===xt.ConnectCode?this._handleConnectAccountRedirectCallback(a,n):this._handleLoginRedirectCallback(a,n)}async _handleLoginRedirectCallback(e,r){const{code:n,state:a,error:i,error_description:o}=e;if(i)throw new Hm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ee("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:xt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Bm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ee("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ee("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:r.auth_session,connect_code:n,redirect_uri:r.redirect_uri,code_verifier:r.code_verifier});return Object.assign(Object.assign({},s),{appState:r.appState,response_type:xt.ConnectCode})}async checkSession(e){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(e)}catch{}}async getTokenSilently(e={}){var r,n;const a=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:sn(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Bo[s];return u||(u=o().finally((()=>{delete Bo[s],u=null})),Bo[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=st(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>Go.acquireLock(a,5e3)),10))throw new cs;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await Go.releaseLock(a),this.activeLockKeys.delete(a),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},r={}){var n,a;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:sn(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((a=e.authorizationParams)===null||a===void 0?void 0:a.audience)||this.options.authorizationParams.audience)})});return r=Object.assign(Object.assign({},zm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new ht({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const r=e.logoutParams||{},{federated:n}=r,a=st(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${us(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=hd(e),{openUrl:a}=n,i=st(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.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@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.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:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ee("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch{h=this.domainUrl}const d=await((p,g,P=60)=>new Promise(((w,y)=>{const m=window.document.createElement("iframe");m.setAttribute("width","0"),m.setAttribute("height","0"),m.style.display="none";const b=()=>{window.document.body.contains(m)&&(window.document.body.removeChild(m),window.removeEventListener("message",R,!1))};let R;const A=setTimeout((()=>{y(new cs),b()}),1e3*P);R=function(j){if(j.origin!=g||!j.data||j.data.type!=="authorization_response")return;const z=j.source;z&&z.close(),j.data.response.error?y(Ee.fromPayload(j.data.response)):w(j.data.response),clearTimeout(A),window.removeEventListener("message",R,!1),setTimeout(b,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(m),m.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new ht({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new lv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=g.every((w=>p.includes(w)));return p.length>=g.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!vd(l,s))&&!vd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((g=>p.indexOf(g)==-1)).join(",")})(i,c.scope);throw new Vm(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=st(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",r=this.scope[e],n=await this.cacheManager.getIdToken(new ht({clientId:this.options.clientId,audience:e,scope:r})),a=this.userCache.get("@@user@@");return n&&n.id_token===a?.id_token?a:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:r,clientId:n,cacheMode:a}){const i=await this.cacheManager.get(new ht({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await fg(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:i||e.scope}),this.worker),s=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:s,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||s.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:s})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:sn(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,r){return this._assertDpop(this.dpop),this.dpop.setNonce(e,r)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new _g(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:r=>{var n;return this.getTokenSilently({authorizationParams:{scope:(n=r?.scope)===null||n===void 0?void 0:n.join(" "),audience:r?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:r=>this.setDpopNonce(r,e.dpopNonceId),generateDpopProof:r=>this.generateDpopProof(r)})}async connectAccountWithRedirect(e){const{openUrl:r,appState:n,connection:a,authorization_params:i,redirectUri:o=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!a)throw new Error("connection is required");const s=zo($r()),u=$r(),l=await id(u),c=sd(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:xt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Og(t){const e=new Rg(t);return await e.checkSession(),e}var Be=(t=>(t.AUTH_INITIALIZED="sesamyJsAuthInitialized",t.READY="sesamyJsReady",t.AUTHENTICATED="sesamyJsAuthenticated",t.LOGOUT="sesamyJsLogout",t.CLEAR_CACHE="sesamyJsClearCache",t.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",t.PURCHASE="sesamyJsPurchase",t))(Be||{});const Cg="sesamy.com",Ag="sesamy.dev",Ug="https://sesa.my",md="sesamyCacheTimestamp",gd="sesamyContentReloaded";function Pv(t,e){return`${t}.${e==="dev"?Ag:Cg}`}function ot(t,e){return`https://${Pv(t,e)}`}function Br(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
|
|
4
|
+
`)})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(r=e.cacheLocation||"memory",!hd(r))throw new Error(`Invalid cache location "${r}"`);n=hd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?lr:yg,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:wg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:pn(l,u,...c)};let f={default:pn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=pn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new vg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||iv,this.cacheManager=new hg(n,n.allKeys?void 0:new Ig(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new kg(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Tg(s,o),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Sg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||av)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${us(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return mg({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,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(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,r,n){var a;const i=zo($r()),o=zo($r()),s=$r(),u=await od(s),l=cd(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:sn(v,p.scope,p.audience),response_type:"code",response_mode:m||"query",state:g,nonce:P,redirect_uri:y||d.authorizationParams.redirect_uri,code_challenge:w,code_challenge_method:"S256",dpop_jkt:b}))(this.options,this.scope,e,i,o,l,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,r?.response_mode,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},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(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new Gm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new zs(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ee.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ee("state_mismatch","Invalid state");const o=((n=e.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 e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(e={}){var r;const n=vd(e),{openUrl:a,fragment:i,appState:o}=n,s=st(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=st(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:xt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ee("missing_transaction","Invalid state");this.transactionManager.remove();const a=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const o=new URLSearchParams(i);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(r.join(""));return n.response_type===xt.ConnectCode?this._handleConnectAccountRedirectCallback(a,n):this._handleLoginRedirectCallback(a,n)}async _handleLoginRedirectCallback(e,r){const{code:n,state:a,error:i,error_description:o}=e;if(i)throw new Hm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ee("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:xt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Bm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ee("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ee("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:r.auth_session,connect_code:n,redirect_uri:r.redirect_uri,code_verifier:r.code_verifier});return Object.assign(Object.assign({},s),{appState:r.appState,response_type:xt.ConnectCode})}async checkSession(e){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(e)}catch{}}async getTokenSilently(e={}){var r,n;const a=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:sn(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Bo[s];return u||(u=o().finally((()=>{delete Bo[s],u=null})),Bo[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=st(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>Go.acquireLock(a,5e3)),10))throw new cs;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await Go.releaseLock(a),this.activeLockKeys.delete(a),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},r={}){var n,a;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:sn(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((a=e.authorizationParams)===null||a===void 0?void 0:a.audience)||this.options.authorizationParams.audience)})});return r=Object.assign(Object.assign({},zm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new ht({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const r=e.logoutParams||{},{federated:n}=r,a=st(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${us(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=vd(e),{openUrl:a}=n,i=st(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.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@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.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:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ee("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch{h=this.domainUrl}const d=await((p,g,P=60)=>new Promise(((w,y)=>{const m=window.document.createElement("iframe");m.setAttribute("width","0"),m.setAttribute("height","0"),m.style.display="none";const b=()=>{window.document.body.contains(m)&&(window.document.body.removeChild(m),window.removeEventListener("message",R,!1))};let R;const A=setTimeout((()=>{y(new cs),b()}),1e3*P);R=function(j){if(j.origin!=g||!j.data||j.data.type!=="authorization_response")return;const z=j.source;z&&z.close(),j.data.response.error?y(Ee.fromPayload(j.data.response)):w(j.data.response),clearTimeout(A),window.removeEventListener("message",R,!1),setTimeout(b,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(m),m.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new ht({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new fv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=g.every((w=>p.includes(w)));return p.length>=g.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!pd(l,s))&&!pd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((g=>p.indexOf(g)==-1)).join(",")})(i,c.scope);throw new Vm(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=st(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",r=this.scope[e],n=await this.cacheManager.getIdToken(new ht({clientId:this.options.clientId,audience:e,scope:r})),a=this.userCache.get("@@user@@");return n&&n.id_token===a?.id_token?a:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:r,clientId:n,cacheMode:a}){const i=await this.cacheManager.get(new ht({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await fg(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:i||e.scope}),this.worker),s=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:s,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||s.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:s})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:sn(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,r){return this._assertDpop(this.dpop),this.dpop.setNonce(e,r)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new _g(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:r=>{var n;return this.getTokenSilently({authorizationParams:{scope:(n=r?.scope)===null||n===void 0?void 0:n.join(" "),audience:r?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:r=>this.setDpopNonce(r,e.dpopNonceId),generateDpopProof:r=>this.generateDpopProof(r)})}async connectAccountWithRedirect(e){const{openUrl:r,appState:n,connection:a,authorization_params:i,redirectUri:o=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!a)throw new Error("connection is required");const s=zo($r()),u=$r(),l=await od(u),c=cd(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:xt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Og(t){const e=new Rg(t);return await e.checkSession(),e}var Be=(t=>(t.AUTH_INITIALIZED="sesamyJsAuthInitialized",t.READY="sesamyJsReady",t.AUTHENTICATED="sesamyJsAuthenticated",t.LOGOUT="sesamyJsLogout",t.CLEAR_CACHE="sesamyJsClearCache",t.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",t.PURCHASE="sesamyJsPurchase",t))(Be||{});const Cg="sesamy.com",Ag="sesamy.dev",Ug="https://sesa.my",gd="sesamyCacheTimestamp",yd="sesamyContentReloaded";function Ev(t,e){return`${t}.${e==="dev"?Ag:Cg}`}function ot(t,e){return`https://${Ev(t,e)}`}function Br(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
|
|
5
5
|
*
|
|
6
6
|
* detectIncognito v1.6.2
|
|
7
7
|
*
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Please keep this comment intact in order to properly abide by the MIT License.
|
|
33
33
|
*
|
|
34
|
-
**/var ds={d:(t,e)=>{for(var r in e)ds.o(e,r)&&!ds.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Hs={};ds.d(Hs,{A:()=>Lg,k:()=>Bs});var jr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Nr=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Bs(){return jr(this,void 0,Promise,function(){return Nr(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",a=!1;function i(h){a||(a=!0,e({isPrivate:h,browserName:n}))}function o(){var h=0,d=parseInt("-1");try{d.toFixed(d)}catch(v){h=v.message.length}return h}function s(){return jr(this,void 0,void 0,function(){var h,d;return Nr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return jr(this,void 0,Promise,function(){return Nr(this,function(d){switch(d.label){case 0:return typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var v=String(Math.random());try{var p=indexedDB.open(v,1);p.onupgradeneeded=function(g){var P=g.target.result,w=function(y){i(y)};try{P.createObjectStore("t",{autoIncrement:!0}).put(new Blob),w(!1)}catch(y){(y instanceof Error&&typeof y.message=="string"?y.message:String(y)).includes("are not yet supported")?w(!0):w(!1)}finally{P.close(),indexedDB.deleteDatabase(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var g,P,w,y=window;return(w=(P=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&w!==void 0?w:1073741824})()/1048576);i(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return jr(this,void 0,Promise,function(){var d,v,p;return Nr(this,function(g){switch(g.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return g.sent(),i(!1),[3,4];case 3:return d=g.sent(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return jr(this,void 0,Promise,function(){return Nr(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bs);const Lg=Bs;Hs.A;const $g=Hs.k,mn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(mn);return t===null?void 0:t==="true"}catch{return}}async function qg(){try{const t=sessionStorage.getItem(mn);if(t!==null)return t==="true";const{isPrivate:e}=await $g();return sessionStorage.setItem(mn,e.toString()),e}catch{try{sessionStorage.setItem(mn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function jg(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ng(){return/android/i.test(navigator.userAgent)}let Oe,Ev,Gr,hs=!1,gn=!1;Vr()&&window.addEventListener("pageshow",()=>{gn=!1});const yr="sesamyAccessToken",Wo="sesamyRefreshToken",In="sesamySilentAuthThrottle",xg=300*1e3;async function Bn(){return hs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{hs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Dg(t){if(!t)return null;const e=localStorage.getItem(Wo);if(!e)return ce("No refresh token found in localstorage"),null;const r=new URLSearchParams;r.set("client_id",t.iss),r.set("refresh_token",e),r.set("grant_type","refresh_token");const n=new URL(t.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",t.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(Wo),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Wo,i.refresh_token),localStorage.setItem(yr,i.access_token),i.access_token}catch{Js()}}async function Ws(){const t=localStorage.getItem(yr);if(!t)return null;const e=Zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Dg(e);if(r)return r;localStorage.removeItem(yr)}return t}let cn=null;const Mg=64;function Fg(){try{if(cn!==null)return cn;const e=Object.keys(localStorage).filter(r=>r.startsWith("@@auth0spajs@@"));for(const r of e){const n=JSON.parse(localStorage.getItem(r)||"{}");let a;if(typeof n=="object"&&(n.body&&typeof n.body=="object"&&"refresh_token"in n.body?a=n.body.refresh_token:"refresh_token"in n&&(a=n.refresh_token)),a&&typeof a=="string"&&a.length===Mg)return cn=!0,!0}}catch(t){ce(`Error checking for existing auth0 tokens: ${t.message}`)}return cn=!1,!1}function Kg(t){if(t.domains&&t.domains.length>0){const e=wr(window.location.href);if(e){for(const r of t.domains)if(wr(`https://${r}`)===e)return ce(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;ce(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return ce(`Using fallback domain property: ${t.domain}`),t.domain}function wr(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function zg(t){if(t.enabled===!1)return;Ev=t.organization;const e=Kg(t);Gr=e&&!Fg()?e:Pv("token",t.environment);const r={domain:Gr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",wr(window.location.href)!==wr(`https://${Gr}`)&&(r.useRefreshTokens=!0),ce(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Og(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)ce("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{ce("Code found in URL, handling redirect");try{const u=await Oe.handleRedirectCallback();ce(`Login result: ${JSON.stringify(u)}`);const l=await Oe.getUser();if(!l)throw ce("No user found"),new Error("No user found");ce(`User found ${JSON.stringify(l)}`),Vs(),Vt(Be.AUTHENTICATED,{...l,appState:u.appState}),ce("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}hs=!0,Vt(Be.AUTH_INITIALIZED,{})}async function vr(){return await Bn(),await Ws()?!0:Oe?Oe.isAuthenticated():!1}async function Hg(){return await Bn(),await Ws()?(ce("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function kv(t){if(gn)return ce("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(yr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:Ev,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gs(),...e}}}async function Gn(t){const e=kv(t);if(e)return Oe.loginWithRedirect(e)}async function _v(t){const e=kv(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),Vs();const r=await Oe.getUser();if(!r)throw ce("No user found after popup login"),new Error("No user found");const n=new CustomEvent(Be.AUTHENTICATED,{detail:{...r,appState:t?.appState},composed:!0,bubbles:!0});window.dispatchEvent(n)&&window.location.reload()}async function Bg(t){return Gr&&wr(window.location.href)!==wr(`https://${Gr}`)&&(jg()||Ng()||Gs())?_v(t):Gn(t)}function Gg(){try{const t=sessionStorage.getItem(In);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<xg}catch{return sessionStorage.removeItem(In),!1}}function Wg(){try{const t={timestamp:Date.now()};sessionStorage.setItem(In,JSON.stringify(t))}catch{ce("Failed to set silent auth throttle in sessionStorage")}}function Vs(){try{sessionStorage.removeItem(In)}catch{}}async function jt(t=!0,e=!1){await Bn();const r=await Ws();if(r)return r;if(!e&&Gg()){if(ce("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return ce("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=Zs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),Vs(),n}catch(n){const a=n;if(ce(`Failed to get token silently: ${a.message}`),Wg(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Js(),t)throw n;return null}}async function Js(t={}){if(await Bn(),localStorage.removeItem(yr),Vt(Be.LOGOUT,{}),!!Oe)return ce(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function Zs(t){const e=t.split(".");if(e.length!==3)return null;const n=e[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 vs(t){const e=Zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");ce("Set token"),localStorage.setItem(yr,t),Vt(Be.AUTHENTICATED,{...e,appState:void 0})}const Vg=(t,e)=>e.skipDedupe||e.method!=="GET",Jg=(t,e)=>e.method+"@"+t,Zg=t=>t.clone(),Yg=({skip:t=Vg,key:e=Jg,resolver:r=Zg}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Xg=(t,e)=>t*e,Qg=t=>t&&t.ok,ey=({delayTimer:t=500,delayRamp:e=Xg,maxAttempts:r=10,until:n=Qg,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};let Vo=class Tv extends Error{status;statusText;url;body;constructor(e,r,n,a,i){super(a),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Tv)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var Pn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Pn||{});const ty="application/json",Rv="Content-Type",sr=Symbol(),Ov=Symbol();function yd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===Rv.toLowerCase()))===null||e===void 0?void 0:e[1]}function wd(t){return/^application\/.*json.*/.test(t)}const zt=function(t,e,r=!1){return Object.entries(e).reduce((n,[a,i])=>{const o=t[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=zt(o,i,r):n[a]=i,n},{...t})},br={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function ry(t,e=!1){br.options=e?t:zt(br.options,t)}function ny(t,e=!1){br.polyfills=e?t:zt(br.polyfills,t)}function ay(t){br.errorType=t}const iy=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;let Cv=class extends Error{};const oy=t=>{const e=Object.create(null);t=t._addons.reduce((y,m)=>m.beforeRequest&&m.beforeRequest(y,t._options,e)||y,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=t,l=new Map(i),c=zt(a.options,n);let f=r;const h=iy(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,v=h.catch(y=>{throw{[sr]:y}}).then(y=>{var m;if(!y.ok){const b=new Cv;if(b.cause=d,b.stack=b.stack+`
|
|
35
|
-
CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const R=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(R&&typeof A=="string"){b.text=A;try{b.json=JSON.parse(A)}catch{}}else b[a.errorType]=A;throw b})}return y}),p=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,sr),R=b?m[sr]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(sr)&&l.get(sr);if(A)return A(R,t);const j=l.get(Ov);if(j)return j(R,t);throw R}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.then(b=>m?m(b):b)),P={_wretchReq:t,_fetchReq:h,_sharedState:e,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(y,m){return l.set(y,m),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(sr,y)}},w=u.reduce((y,m)=>({...y,...typeof m.resolver=="function"?m.resolver(y):m.resolver}),P);return o.reduce((y,m)=>m(y,t),w)},sy={_url:"",_options:{},_config:br,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:zt(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+t+"?"+r[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:zt(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:zt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[Rv]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const r=new Map(this._catchers);return r.set(t,e),{...this,_catchers:r}},catcherFallback(t){return this.catcher(Ov,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",r=null){let n=this.url(e).options({method:t});const a=yd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||wd(a));return n=r?o?n.json(r,a):n.body(r):n,oy(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const r=yd(this._options.headers);return this.content(e||wd(r)&&r||ty).body(JSON.stringify(t))}};function ct(t="",e={}){return{...sy,_url:t,_options:e}}ct.default=ct;ct.options=ry;ct.errorType=ay;ct.polyfills=ny;ct.WretchError=Cv;const cy=(t,e)=>e.skipDedupe||e.method!=="GET",uy=(t,e)=>e.method+"@"+t,ly=t=>t.clone(),fy=({skip:t=cy,key:e=uy,resolver:r=ly}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},dy=(t,e)=>e.skipCache||e.method!=="GET",hy=(t,e)=>e.method+"@"+t,vy=()=>!1,py=()=>null,my=t=>t.ok,gy=({throttle:t=1e3,skip:e=dy,key:r=hy,clear:n=vy,invalidate:a=py,condition:i=my,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,l=new Set,c=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,v)=>{const p=r(d,v);let g=a(d,v);if(g&&(g instanceof Array||(g=[g]),g.forEach(P=>{typeof P=="string"?s.delete(P):P instanceof RegExp&&s.forEach((w,y)=>{P.test(y)&&s.delete(y)})})),n(d,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(p)){if(s.has(p)){const P=s.get(p).clone();return o&&Object.defineProperty(P,o,{value:p,enumerable:!1}),Promise.resolve(P)}else if(u.has(p))return new Promise((P,w)=>{u.get(p).push([P,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(P=>(i(P.clone())&&s.set(p,P.clone()),u.get(p).forEach(([w])=>w(P.clone())),u.delete(p),P)).catch(P=>{throw u.get(p).forEach(([,w])=>w(P)),u.delete(p),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},yy=(t,e)=>t*e,wy=t=>t&&t.ok,by=({delayTimer:t=500,delayRamp:e=yy,maxAttempts:r=10,until:n=wy,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},Sy="@sesamy/sdk",Iy="1.22.0";let Py=class{cache=new Map;get(e){return this.cache.get(e)||null}set(e,r){this.cache.set(e,r)}remove(e){this.cache.delete(e)}clear(){this.cache.clear()}};const Fr="sesamyCacheTimestamp",Ey=t=>{const{libraryName:e=Sy,libraryVersion:r=Iy,cache:n}=t,a=n?.storage||new Py,i=[s=>async(u,l)=>{if(n?.mode===Pn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Fr),c||(c=Date.now().toString(),sessionStorage.setItem(Fr,c))):(c=a.get(Fr),c||(c=Date.now().toString(),a.set(Fr,c)));const f={...l,headers:{...l.headers,"Cache-Timestamp":c}};return s(u,f)}return s(u,l)},s=>async(u,l)=>{const c=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:c}};return s(u,f)},fy()];n?.mode===Pn.NORMAL&&i.push(gy({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(by({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ct(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.headers}).middlewares(i);return{async request(s,u={}){try{const l=/^https?:\/\//.test(s);let c=o.url(s,l);u.headers&&(c=c.headers(u.headers));const f=(u.method||"GET").toLowerCase();let h;switch(f){case"get":h=c.get();break;case"post":h=c.post(u.body);break;case"put":h=c.put(u.body);break;case"patch":h=c.patch(u.body);break;case"delete":h=c.delete();break;default:h=c.get()}const d=await h.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&vt(),d.status===204)return null;if(!d.ok){const v=await d.text().catch(()=>"Unknown error");throw new Vo(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Vo)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Vo(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},vt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Fr),"Cache cleared"),xr={get:async(t,e)=>t.request(`/profile/${e}`),update:async(t,e,r)=>t.request(`/profile/${e}`,{method:"PATCH",body:JSON.stringify(r)}),checkSpotifyLink:async t=>t.request("/profile/spotify-link"),unlinkSpotify:async t=>t.request("/profile/unlink-spotify",{method:"POST"}),delete:async t=>{await t.request("/profile",{method:"DELETE"})}},Jo={list:async(t,e)=>{const r=new URLSearchParams;e?.type&&r.append("type",e.type),e?.sku&&r.append("sku",e.sku),e?.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),e?.waitForEntitlementAfter&&r.append("wait-for-entitlement-after",e.waitForEntitlementAfter);const n=r.toString(),a=n?`/entitlements?${n}`:"/entitlements";return t.request(a)},get:async(t,e)=>t.request(`/entitlements/${e}`),getAccess:async(t,e)=>t.request(`/entitlements/${e}/access`)},bd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Sd={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},ky=(t,e)=>{if(!t||!e)return t;const r=new URL(t);return r.hash=`access_token=${e}`,r.toString()},Id=(t,e)=>!t.manageUrl||!e?t:{...t,manageUrl:ky(t.manageUrl,e)},Dr={list:async t=>t.request("/contracts"),get:async(t,e)=>t.request(`/contracts/${e}`),cancel:async(t,e)=>t.request(`/contracts/${e}/cancel`,{method:"POST"}),createAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments`,{method:"POST",body:JSON.stringify(r)}),confirmAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments/${r}/confirm`,{method:"POST"})},Zo={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:r})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},cr={list:async t=>t.request("/tallies"),get:async(t,e)=>t.request(`/tallies/${e}`),update:async(t,e,r)=>t.request(`/tallies/${e}`,{method:"PUT",body:JSON.stringify(r)}),create:async(t,e)=>t.request("/tallies",{method:"POST",body:JSON.stringify(e)}),delete:async(t,e)=>{try{return await t.request(`/tallies/${e}`,{method:"DELETE"}),!0}catch{return!1}},push:async(t,e,r)=>t.request(`/tallies/${e}/push`,{method:"POST",body:JSON.stringify(r)})},Yo={list:async t=>t.request("/tags"),add:async(t,e)=>{await t.request("/tags",{method:"POST",body:JSON.stringify({tag:e})})},remove:async(t,e)=>{await t.request(`/tags/${e}`,{method:"DELETE"})}},ur={generateCheckoutLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},generateAccountLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}${e.contractId?`/${encodeURIComponent(e.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePlanLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateConsumeLink:(t,e)=>{const r=e.language||"en";let n=new URL(`${t.baseUrl}/consume/${encodeURIComponent(r)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.sku)}`);return e.episodeId?n.href+=`/${encodeURIComponent(e.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()}},Xo={generateLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkouts",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkouts/${e}`),update:async(t,e,r)=>t.request(`/checkouts/${e}`,{method:"PATCH",body:JSON.stringify(r)})},Pd={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},Ed={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},_y={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},Ty={list:async t=>t.request("/payment-issues")},Ry={content:async(t,e,r,n,a)=>{const i=new URLSearchParams({url:e});return r&&i.append("selector",r),n&&i.append("cache",n),t.request(`/proxy?${i.toString()}`,a)}},Oy={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},kd={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},Cy=t=>{const e=Ey(t);return{profile:{get:r=>xr.get(e,r),update:(r,n)=>xr.update(e,r,n),checkSpotifyLink:()=>xr.checkSpotifyLink(e),unlinkSpotify:()=>xr.unlinkSpotify(e),delete:()=>xr.delete(e)},entitlements:{list:r=>Jo.list(e,r),get:r=>Jo.get(e,r),getAccess:r=>Jo.getAccess(e,r)},subscriptions:{list:()=>bd.list(e),get:r=>bd.get(e,r)},products:{get:r=>Sd.get(e,r),autoOnboard:r=>Sd.autoOnboard(e,r)},contracts:{list:async()=>{const r=await Dr.list(e),n=await t.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return r;const a=n.substring(7);return r.map(i=>Id(i,a))},get:async r=>{const n=await Dr.get(e,r),a=await t.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Id(n,i)},cancel:r=>Dr.cancel(e,r),createAmendment:(r,n)=>Dr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Dr.confirmAmendment(e,r,n)},userMetadata:{get:()=>Zo.get(e),set:(r,n)=>Zo.set(e,r,n),delete:r=>Zo.delete(e,r)},tallies:{list:()=>cr.list(e),get:r=>cr.get(e,r),update:(r,n)=>cr.update(e,r,n),create:r=>cr.create(e,r),delete:r=>cr.delete(e,r),push:(r,n)=>cr.push(e,r,n)},tags:{list:()=>Yo.list(e),add:r=>Yo.add(e,r),remove:r=>Yo.remove(e,r)},checkouts:{generateLink:(r,n)=>ur.generateCheckoutLink(r,n),create:r=>Xo.create(e,r),get:r=>Xo.get(e,r),update:(r,n)=>Xo.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>ur.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>ur.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>ur.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>ur.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>ur.generateConsumeLink(r,n)},bills:{list:()=>Pd.list(e),get:r=>Pd.get(e,r)},fulfillments:{list:()=>Ed.list(e),create:r=>Ed.create(e,r)},paywalls:{get:r=>_y.get(e,r)},paymentIssues:{list:()=>Ty.list(e)},proxy:{content:(r,n,a,i)=>Ry.content(e,r,n,a,i)},transactions:{list:r=>Oy.list(e,r)},vendor:{get:()=>kd.get(e),list:()=>kd.list(e)}}};class Ay{get(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}set(e,r){typeof sessionStorage<"u"&&sessionStorage.setItem(e,r)}remove(e){typeof sessionStorage<"u"&&sessionStorage.removeItem(e)}clear(){}}function ps(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Av(t,e){if(ps(t))return{itemSrc:t};const r=t.split(":");if(r.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${r.length}`);const[n,a,i]=r;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:e||i}}function _d(t){return t.endsWith("/")?t.slice(0,-1):t}function Td(t,e){if(!ps(t)||!ps(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&_d(r.pathname)===_d(n.pathname)}function Uy(t,e,r){const n=new URL(`${ot("checkout3",t.environment)}`);e.language&&n.searchParams.set("lang",e.language);let a=e.sku,i=e.purchaseOptionId,o=e.itemSrc;if(e.itemSrc){const c=Av(e.itemSrc,e.purchaseOptionId);a=c.sku||a,i=c.purchaseOption||i,o=c.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),e.email&&n.searchParams.set("email",e.email),e.business&&n.searchParams.set("business","true"),e.currency&&n.searchParams.set("currency",e.currency),e.price&&n.searchParams.set("price",e.price.toString()),e.discountCode&&n.searchParams.set("discount-code",e.discountCode),e.attributionItemSrc?n.searchParams.set("itemSrc",e.attributionItemSrc):r.itemSrc&&n.searchParams.set("itemSrc",r.itemSrc),e.attributionPublisherContentId?n.searchParams.set("publisherContentId",e.attributionPublisherContentId):r.publisherContentId&&n.searchParams.set("publisherContentId",r.publisherContentId),e.utmSource?n.searchParams.set("utm_source",e.utmSource):r.utmSource&&n.searchParams.set("utm_source",r.utmSource),e.utmMedium?n.searchParams.set("utm_medium",e.utmMedium):r.utmMedium&&n.searchParams.set("utm_medium",r.utmMedium),e.utmCampaign?n.searchParams.set("utm_campaign",e.utmCampaign):r.utmCampaign&&n.searchParams.set("utm_campaign",r.utmCampaign),e.utmTerm?n.searchParams.set("utm_term",e.utmTerm):r.utmTerm&&n.searchParams.set("utm_term",r.utmTerm),e.utmContent?n.searchParams.set("utm_content",e.utmContent):r.utmContent&&n.searchParams.set("utm_content",r.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(c=>{const[f,h]=c.trim().split("=");return{key:f,value:h}}).filter(c=>s.some(f=>f===c.key)).forEach(c=>{n.searchParams.append(c.key,c.value)});let l=new URL(window.location.href);if(e.redirectUrl)try{l=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return l.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&l.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",l.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:c,methods:f})=>f?f.map(h=>`${c}|${h}`):c).join(",")),e.requireAddress&&n.searchParams.set("require-address","true"),e.giftMode&&n.searchParams.set("gift-mode","true"),e.payerEmail&&n.searchParams.set("payer-email",e.payerEmail),e.metadata&&Object.entries(e.metadata).forEach(([c,f])=>{n.searchParams.set(`metadata.${c}`,String(f))}),n}const Uv="sesamySignedURLs";function Ys(){const t=sessionStorage.getItem(Uv);return t?JSON.parse(t):[]}function Ly(t){const e=Ys();e.push(t),ce(`Adding signed URL: ${t}`),sessionStorage.setItem(Uv,JSON.stringify(e))}function $y(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const ms="sesamyAttribution";function qy(t){const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e).value}catch{return console.error(`Failed to parse ${t}`),null}}function jy(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function En(){return qy(ms)||{}}function Lv(t){if(t===null)localStorage.removeItem(ms);else{ce(`Setting attribution ${JSON.stringify(t)}`);const e=En()??{},r=$y({...e,...jy(t)});localStorage.setItem(ms,JSON.stringify({value:r}))}}const Xs="@sesamy/sesamy-js",Wn="1.72.2",$v="sesamyFlags";async function qv(t){try{localStorage.setItem($v,JSON.stringify(t))}catch{ce("Failed to save flags to localStorage")}}async function jv(t,e){const r=await nn();r[t]=e,await qv(r)}async function Nv(t){return(await nn())[t]}async function xv(t){const e=await nn();t in e&&(delete e[t],await qv(e))}async function nn(){try{const t=localStorage.getItem($v);return t?JSON.parse(t):{}}catch{return{}}}function Dv(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}function Ny(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}function xy(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}let Fe={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Mv=[],Fv=!1,_t;function Kv(){const t=window.location.pathname;return Mv.find(e=>e.path?t.includes(e.path):!0)}function Dy(t,e){Mv=t.content||[];const r=Kv();r&&r.type==="article"&&(Fe={...Fe,...Ny(r.selectors)},Fv=r.enablePaywallSettingsUrlFallback||!1),_t=e}function My(t,e){const{selector:r,attribute:n}=e;return r===Fe.article.selector||n&&t.hasAttribute(n)?t:t.querySelector(r)}function zv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??zv(t.parentElement,e):t.textContent??void 0}function Kt(t){const e=document.head.querySelectorAll(`[property~='${t}'][content]`);for(let n=0;n<e.length;n+=1)if(e[n].content)return e[n].content;const r=document.head.querySelectorAll(`[name~='${t}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content}function Qs({publisherContentId:t,key:e,defaultValue:r=""}){const n=t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null,a=e.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(e)||Kt(`sesamy:${e}`)||Kt(`sesamy:${a}`)||Kt(`og:${e}`)||Kt(e)||r}function Hv(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(an).filter(e=>e!==null)}function an(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Dv(e)},n=(i,o,s,u)=>{const l=My(e,o),c=zv(l,o)||Qs({publisherContentId:s,key:xy(String(i))})||void 0;c&&(r[i]=u?u(c):c)};n("id",Fe.id),n("title",Fe.title,r.id),n("excerpt",Fe.excerpt,r.id),n("image",Fe.image,r.id),n("price",Fe.price,r.id,i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,i=>i||"entitlement");const a=Kv();if(a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency),a.paywallUrl&&!r.paywallUrl&&(r.paywallUrl=a.paywallUrl)),Fv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r.url||(r.url=window.location.href),r}async function Fy(t){const e=an(t);if(!e)throw new Error("Could not find article element");if(e.accessLevel==="public")return!0;if(e.accessLevel==="logged-in"&&!e.paywallUrl)return await _t.auth.isAuthenticated()?!0:null;if(e.paywallUrl&&((await _t.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await _t.auth.isAuthenticated()?!0:null;if(!e.url)throw new Error("Article must have a URL");return await _t.entitlements.hasAccess(e.url,e.pass?.split(",")||[])||null}async function Bv(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=an(r);if(!n?.url)throw new Error("Could not find content for element");const a=await _t.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await _t.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Dv(r.parentElement||r);return _t.proxy.getContent(i.token,n.url,o)}function Ky(t){const e=t.endpoint||ot("api2",t.environment),n=Cy({baseUrl:e,tokenProvider:async()=>{if(await vr())try{const q=await jt(!1);if(q)return`Bearer ${q}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:Xs,libraryVersion:Wn,vendorId:t.vendorId,cache:{mode:Pn.BROWSER,storage:new Ay}}),a=S=>async(O,q)=>{let F=sessionStorage.getItem(md);F||(F=Date.now().toString(),sessionStorage.setItem(md,F));const I={...q,headers:{...q.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(q,F)=>{let I=null;if(I=await jt(S),!I){if(S)throw new Error("No access token available");return O(q,F)}const _={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(q,_)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Yg(),ey({delayTimer:1e3,delayRamp:(S,O)=>S*O,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(S={}){const{waitForEntitlementAfter:O,includeSignedLinks:q=!0}=S,F=await vr()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return q&&F.push(...Ys()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:_,purchaseOption:x}=Av(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||Td(S,I.url))return!0}return!!O.some(_=>Td(_,I.url))})}async function l(S,O,q){const F=new URL(ot("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),q&&F.searchParams.set("selector",q),ct(F.toString()).headers({Authorization:`Bearer ${S}`}).get().text()}async function c(S){if(!S)throw new Error("SKU is required to get fulfillments");return await vr()?await o.get(`/fulfillments?sku=${encodeURIComponent(S)}`).json():[]}async function f(S,O){if(!S||!O)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:S},`/fulfillments/${encodeURIComponent(O)}/request-delivery?`).res()).ok}async function h(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(S){return(await n.transactions.list())?.find(q=>q.id===S)}async function v(){return await o.url("/tags").get().json()}async function p(S){const O=await o.url(`/tags/${encodeURIComponent(S)}`).delete().res();return vt(),O.ok}async function g(S){const O=await o.url("/tags").post(encodeURIComponent(S)).res();return Vt(Be.USER_ATTRIBUTE_CHANGED,{}),vt(),O.ok}async function P(S){return(await n.tallies.get(S)).value}async function w(){const S=await n.tallies.list(),O={};for(const q of S)O[q.id]=q.value;return O}async function y(S){return await n.tallies.delete(S)}async function m(S,O){return await n.tallies.push(S,O)}async function b(){return await jt(!1)?await o.url("/profile").get().json():null}async function R(S){const O=await o.url("/profile").patch(S).res();return vt(),O.ok}async function A(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await jt(!1);if(!O)throw new Error("No access token available");const q=new URL(`${ot("access-sync",t.environment)}/spotify/sesamy-callback`);q.searchParams.set("access_token",O),q.searchParams.set("state",S),window.location.href=q.toString()}async function V(S){const O=await o.url(`/products/${encodeURIComponent(S)}/auto-onboard`).post().json();return O.length&&vt(),O}async function te(S,O=3600){const{shortlink:q}=await ct(Ug).post({url:S,ttl:O}).json();return q}async function $(S){const O=await jt(!1,!0);let q;const F=S.language||Br(),I=En();switch(S.target){case"account":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":q=new URL(`${ot("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?q.href+=`/${S.episodeId}`:q.href+="/listen",q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":q=Uy(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(q.hash=`#access_token=${O}`),S.shorten?te(q.href,S.ttl):q.href}async function M(){const S=await jt(!1),O=new URL(`${ot("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=En(),q=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,_]=F.trim().split("=");q.includes(I)&&!O[I]&&(O[I]=_)}),n.checkouts.create({language:Br(),...S,attribution:{...O,...S.attribution}})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Hv,get:an,getLanguage:Br,unlock:Bv,getPropertyFromHTML:Qs},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,flags:{get:Nv,set:jv,list:nn,delete:xv},generateLink:$,getProxyContent:l,getEntitlements:s,getFulfillments:c,requestDelivery:f,hasAccess:u,isSpotifyLinked:A,linkSpotify:z,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:b,products:n.products,getSubscriptions:h,getTally:P,getTallies:w,getTags:v,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:j,updateProfile:R,vendor:n.vendor}}function Rd(t,e,r,n,a){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)t=t?t[e[n]]:a;return t===a?r:t}var zy="function",Hy="string",tt="undefined",By="boolean",kn="object",Gy="array",Wy="number",Vy="symbol",Jy="null",gs=function(){},Gv="any",Wv="*",Jt="__",Zy="form",Yy="input",Xy="button",Qy="select",_n=typeof process!==tt?process:{};_n.env&&_n.env.NODE_ENV;var Ce=typeof document!==tt;_n.versions!=null&&_n.versions.node!=null;typeof Deno!==tt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==tt&&typeof navigator.userAgent!==tt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Vv(t,e){return e.charAt(0)[t]()+e.slice(1)}var ew=Vv.bind(null,"toUpperCase"),tw=Vv.bind(null,"toLowerCase");function rw(t){return Jv(t)?ew(Jy):typeof t===kn?ow(t):Object.prototype.toString.call(t).slice(8,-1)}function Tn(t,e){e===void 0&&(e=!0);var r=rw(t);return e?tw(r):r}function on(t,e){return typeof e===t}var ze=on.bind(null,zy),Tt=on.bind(null,Hy),dr=on.bind(null,tt),nw=on.bind(null,By);on.bind(null,Vy);function Jv(t){return t===null}function aw(t){return Tn(t)===Wy&&!isNaN(t)}function Zv(t){return Tn(t)===Gy}function Ke(t){if(!iw(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function iw(t){return t&&(typeof t===kn||t!==null)}function ow(t){return ze(t.constructor)?t.constructor.name:null}function sw(t){return t instanceof Error||Tt(t.message)&&t.constructor&&aw(t.constructor.stackTraceLimit)}function Yv(t,e){if(typeof e!="object"||Jv(e))return!1;if(e instanceof t)return!0;var r=Tn(new t(""));if(sw(e))for(;e;){if(Tn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Yv.bind(null,TypeError);Yv.bind(null,SyntaxError);function Vn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?cw(t,e):r}function cw(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Jn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Jn(Vn,Zy);Jn(Vn,Xy);Jn(Vn,Yy);Jn(Vn,Qy);function uw(t){return t?Zv(t)?t:[t]:[]}function Od(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function lw(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function fw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function dw(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Od(r[1]),o=Od(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(hw(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return Ce&&window.location.search.substring(1)})())}function hw(t,e,r){for(var n=e.length-1,a=0;a<n;++a){var i=e[a];if(i==="__proto__"||i==="constructor")break;i in t||(t[i]={}),t=t[i]}t[e[n]]=r}function Zn(){for(var t="",e=0,r=4294967295*Math.random()|0;e++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],a=15&r;t+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=e%8==0?4294967295*Math.random()|0:r>>4}return t}function vw(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var Ht="global",Sr=Jt+Ht+Jt,Ir=typeof self===kn&&self.self===self&&self||typeof global===kn&&global[Ht]===global&&global||void 0;function Zt(t){return Ir[Sr][t]}function Yt(t,e){return Ir[Sr][t]=e}function Or(t){delete Ir[Sr][t]}function Cr(t,e,r){var n;try{if(ec(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}Ir[Sr]||(Ir[Sr]={});var un={};function ec(t){if(typeof un[t]!==tt)return un[t];try{var e=window[t];e.setItem(tt,tt),e.removeItem(tt)}catch{return un[t]=!1}return un[t]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ee.apply(null,arguments)}var Et="function",pt="undefined",Wr="reducer",Xv="@@redux/",ys=Xv+"INIT",pw=Xv+Math.random().toString(36),Cd=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),ln=" != "+Et;function Qv(t,e,r){var n;if(typeof e===Et&&typeof r===pt&&(r=e,e=void 0),typeof r!==pt){if(typeof r!==Et)throw new Error("enhancer"+ln);return r(Qv)(t,e)}if(typeof t!==Et)throw new Error(Wr+ln);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==Et)throw new Error("Listener"+ln);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===pt)throw new Error("ActType "+pt);if(u)throw new Error("Dispatch in "+Wr);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:ys}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+Wr+ln);a=d,h({type:ys})}})[Cd]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function g(){p.next&&p.next(c())}return g(),{unsubscribe:v(g)}}})[Cd]=function(){return this},d},n}function mw(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Wr+" "+t+" returns "+pt}function Pr(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function gw(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ee({},o,{dispatch:s=Pr.apply(void 0,i)(o.dispatch)})}}}var Rt=Jt+"anon_id",Bt=Jt+"user_id",pr=Jt+"user_traits",ws="analytics",Pt="userId",hr="anonymousId",yn=["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"],bs=["name","EVENTS","config","loaded"],Q=yn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Ad=/^utm_/,Ud=/^an_prop_/,Ld=/^an_trait_/;function yw(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===Q.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Rt,o.anonymousId),l||e(Bt,o.userId),u.traits&&e(pr,ee({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(v,p){if(p.match(Ad)||p.match(/^(d|g)clid/)){var g=p.replace(Ad,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Ud)&&(v.props[p.replace(Ud,"")]=i[p]),p.match(Ld)&&(v.traits[p.replace(Ld,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(ee({type:Q.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return t.identify(f,d.traits)},0),h&&setTimeout(function(){return t.track(h,d.props)},0),Object.keys(d.campaign).length&&r.dispatch({type:Q.campaign,campaign:d.campaign})}}return n(a)}}}}function ww(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Rt)return ee({},e,{anonymousId:r.value});if(r.key===Bt)return ee({},e,{userId:r.value})}switch(r.type){case Q.identify:return Object.assign({},e,{userId:r.userId,traits:ee({},e.traits,r.traits)});case Q.reset:return[Bt,Rt,pr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function $d(t){return{userId:t.getItem(Bt),anonymousId:t.getItem(Rt),traits:t.getItem(pr)}}var Ss=function(t){return Jt+"TEMP"+Jt+t};function bw(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===Q.reset&&([Bt,pr,Rt].forEach(function(d){n(d)}),[Pt,hr,"traits"].forEach(function(d){Or(Ss(d))})),s.type===Q.identify){a(Rt)||r(Rt,Zn());var f=a(Bt),h=a(pr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Bt,u),l&&r(pr,ee({},h,l))}return o(s)}}}}var Kr={};function qd(t,e){Kr[t]&&ze(Kr[t])&&(Kr[t](e),delete Kr[t])}function ep(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ee({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return ep(t,e,r-10).then(n,a)})})}function Sw(t){return{abort:t}}function tp(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&ze(p)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Pt,hr].reduce(function(R,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(R[A]=b[A]),R},m)})(h.payload,u),w=n[P.meta.rid];if(!w&&(g=p({payload:P,config:o[d].config,instance:r,abort:Sw}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=v+":"+d;t.dispatch(ee({},P,{type:y,_:{called:y,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var Qo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(mr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var j=w.type.match(mr)?(function(z,V,te,$,M){return function(N,S){var O=$?$.name:z,q=S&&Jr(S)?S:te;if($&&(!(q=S&&Jr(S)?S:[z]).includes(z)||q.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(q)+" input valid");return ee({},M,{abort:{reason:N,plugins:q,caller:V,_:O}})}})(R,A,P,m,w):(function(z,V){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+V)}})(w,A);return{payload:Iw(w),instance:g,config:b||{},abort:j}}})(n,d),p=e.exact.reduce(function(g,P){var w=P.pluginName,y=P.methodName,m=!1;return y.match(/^initialize/)||y.match(/^reset/)||(m=!l[w].loaded),c.offline&&y.match(/^(page|track|identify)/)&&(m=!0),g[""+w]=m,g},{});return Promise.resolve(e.exact.reduce(function(g,P,w){var y=P.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var R=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,j,z){return Promise.resolve(A).then(function(V){return j.method&&ze(j.method)?((function(N,S){var O=Kd(N);if(O&&O.name===S){var q=Kd(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(q?"or "+q.method:"")+" in "+S+" plugin insteadof "+N].join(`
|
|
36
|
-
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:V,instance:n,abort:(te=V,$=y,M=j.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[$],caller:f,from:M||$}})}),config:xd(j.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,$,M})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return R&&R.then?R.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(P,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,R=i[b];return Promise.resolve(P).then(function(A){var j=g[b]?g[b]:{};if(h&&(j=A),ts(j,b))return es({data:j,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(ts(A,b))return m&&es({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(p.hasOwnProperty(b)&&p[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:j,instance:n,config:xd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},$=ee({},A,te),M=g[b];if(ts(M,b))es({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(jd)&&!f.match(Nd)&&n.dispatch(ee({},h?$:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve($)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(mr)||f.match(/^registerPlugin/)||f.match(Nd)||f.match(jd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var w=ee({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});rp(P,e.exact.length)&&!f.match(/End$/)&&(w=ee({},w,{type:P.type+"Aborted"})),s.dispatch(w)}return P})})}catch(g){return Promise.reject(g)}},mr=/Start$/,jd=/^bootstrap/,Nd=/^ready/;function es(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function xd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Dd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Md(t,e){var r=t.replace(mr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function ts(t,e){var r=t.abort;return!!r&&(r===!0||Fd(r,e)||r&&Fd(r.plugins,e))}function rp(t,e){var r=t.abort;if(!r)return!1;if(r===!0||Tt(r))return!0;var n=r.plugins;return Jr(r)&&r.length===e||Jr(n)&&n.length===e}function Jr(t){return Array.isArray(t)}function Fd(t,e){return!(!t||!Jr(t))&&t.includes(e)}function Kd(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Iw(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ke(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Pw(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(m){return s?m:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===Q.enablePlugin&&a.dispatch({type:Q.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===Q.disablePlugin&&setTimeout(function(){return qd(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),p=[],g=[],P=o.disabled,w=v.map(function(m){var b=m.loaded,R=m.name,A=m.config;return ep(m,function(){return b({config:A})},1e4).then(function(j){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!bs.includes(z)})}),n[R]=!0),p=p.concat(R),m}).catch(function(j){if(j instanceof Error)throw new Error(j);return g=g.concat(j.name),j})});Promise.all(w).then(function(m){var b={plugins:p,failed:g,disabled:P};setTimeout(function(){d.length===w.length+P.length&&a.dispatch(ee({},{type:Q.ready},b))},0)})}var y=(function(){if(l!==Q.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return tp(a,e,t)},0),Promise.resolve((function(m,b,R,A,j){try{var z=ze(b)?b():b,V=m.type,te=V.replace(mr,"");if(m._&&m._.called)return Promise.resolve(m);var $=R.getState(),M=(O=z,(q=$.plugins)===void 0&&(q={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var _=F.plugins||{};return nw(_[I])?_[I]:_.all!==!1&&(!q[I]||q[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys($.plugins).filter(function(I){var _=$.plugins[I];return m.plugins.includes(I)&&!_.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,_){var x=Md(I).map(function(H){return Dd(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Md(I,J).map(function(ke){return Dd(ke,_)}),ne=fe[0],ue=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,M);return Promise.resolve(Qo({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(I){function _(){var Y=(function(){if(V.match(mr))return Promise.resolve(Qo({action:ee({},x,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&qd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(rp(I,N.length))return I;var x,H=(function(){if(V!==te)return Promise.resolve(Qo({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(Y){x=Y});x=I})();return H&&H.then?H.then(_):_()})}catch(I){return Promise.reject(I)}var O,q,F})(o,e,t,a,r)).then(function(m){var b=i(m);return s=1,b})})();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(m){return Promise.reject(m)}}}}}function Ew(t){return function(e){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Q.setItem||a===Q.removeItem){if(n.abort)return r(n);a===Q.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var kw=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return Pr.apply(void 0,o)(n)(a)}}}}};function _w(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=zd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=zd(r.type,Q.initialize),l=t()[u];return l&&u?(n[u]=ee({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ee({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ee({},e[r.name],{loaded:!0}),ee({},e,n);switch(r.type){case Q.disablePlugin:return ee({},e,Hd(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Hd(r.plugins,!0,e));default:return e}}}function zd(t,e){return t.substring(e.length+1,t.length)}function Hd(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function np(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Tw={last:{},history:[]};function Rw(t,e){t===void 0&&(t=Tw);var r=e.options,n=e.meta;if(e.type===Q.track){var a=np(ee({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ee({},t,{last:a,history:t.history.concat(a)})}return t}var Ow={actions:[]};function Cw(t,e){t===void 0&&(t=Ow);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===Q.identify?[e].concat(t.actions):t.actions.concat(e),ee({},t,{actions:n});case"dequeue":return[];default:return t}}var ap=/#.*$/;function Aw(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(ap,""):"")}var ip,op,sp,cp,Uw=function(t){if(t===void 0&&(t={}),!Ce)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(Ce){for(var v,p=document.getElementsByTagName("link"),g=0;v=p[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(ap,"")})(l),f={title:r,url:c,path:Aw(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},Lw={last:{},history:[]};function $w(t,e){t===void 0&&(t=Lw);var r=e.options;if(e.type===Q.page){var n=np(ee({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ee({},t,{last:n,history:t.history.concat(n)})}return t}ip=(function(){if(!Ce)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"})(),op=Ce?document.referrer:null,sp=lw(),cp=fw();var Bd={initialized:!1,sessionId:Zn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:ip},userAgent:Ce?navigator.userAgent:"node",library:{name:ws,version:"0.13.1"},timezone:cp,locale:sp,campaign:{},referrer:op};function qw(t,e){t===void 0&&(t=Bd);var r=t.initialized,n=e.campaign;switch(e.type){case Q.campaign:return ee({},t,{campaign:n});case Q.offline:return ee({},t,{offline:!0});case Q.online:return ee({},t,{offline:!1});default:return r?t:ee({},Bd,t,{initialized:!0})}}var jw=["plugins","reducers","storage"];function Nw(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function xw(t){var e=Nw.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function up(){return Yt(ws,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Ir[Sr][ws].push(o.action||o),i(o)}})}}}function Gd(t){return function(){return Pr(Pr.apply(null,arguments),up())}}function rs(t){return t?Zv(t)?t:[t]:[]}function Wd(t,e,r){t===void 0&&(t={});var n,a,i=Zn();return e&&(Kr[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(ze(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ee({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Dw(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,_){if(ze(_))return I.middlewares=I.middlewares.concat(_),I;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var x=_.EVENTS?Object.keys(_.EVENTS).map(function(J){return _.EVENTS[J]}):[];I.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(I.methods[_.name]=Object.keys(_.methods).reduce(function(J,fe){var ne;return J[fe]=(ne=_.methods[fe],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ue.length;ke++)ae[ke]=ue[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete _.methods);var H=Object.keys(_).concat(x),Y=new Set(I.events.concat(H));if(I.events=Array.from(Y),I.pluginsArray=I.pluginsArray.concat(_),I.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return I.plugins[_.name]=_,I.plugins[_.name].loaded||(I.plugins[_.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Zt,setItem:Yt,removeItem:Or},i=(function(I){return function(_,x,H){return x.getState("user")[_]||(H&&Ke(H)&&H[_]?H[_]:$d(I)[_]||Zt(Ss(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!bs.includes(I)}).sort(),u=new Set(s.concat(yn).filter(function(I){return!bs.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new kw,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=dw(),P=$d(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Zn());var y=ee({enable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.enablePlugin,plugins:rs(I),_:{originalAction:Q.enablePlugin}},x,[_])})},disable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.disablePlugin,plugins:rs(I),_:{originalAction:Q.disablePlugin}},x,[_])})}},n.methods),m=!1,b={identify:function(I,_,x,H){try{var Y=Tt(I)?I:null,J=Ke(I)?I:_,fe=x||{},ne=b.user();Yt(Ss(Pt),Y);var ue=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ue,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[_,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(I,_,x,H){try{var Y=Ke(I)?I.event:I;if(!Y||!Tt(Y))throw new Error("EventMissing");var J=Ke(I)?I:_||{},fe=Ke(x)?x:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Pt,b,_),anonymousId:i(hr,b,_)},ne,[_,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(I,_,x){try{var H=Ke(I)?I:{},Y=Ke(_)?_:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:Uw(H),options:Y,userId:i(Pt,b,H),anonymousId:i(hr,b,H)},J,[I,_,x])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Pt||I==="id")return i(Pt,b);if(I===hr||I==="anonId")return i(hr,b);var _=b.getState("user");return I?Rd(_,I):_},reset:function(I){return new Promise(function(_){S.dispatch({type:Q.resetStart},_,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(_){I&&I(_),m=!0})},on:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var x=/Start$|Start:/;if(I==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(x)&&_({payload:ae,instance:b,plugins:o}),ue(ae)}}},Y=function(ne){return function(ue){return function(ae){return ae.type.match(x)||_({payload:ae,instance:b,plugins:o}),ue(ae)}}};return h(H,fn),h(Y,dn),function(){d(H,fn),d(Y,dn)}}var J=I.match(x)?fn:dn,fe=function(ne){return function(ue){return function(ae){return ae.type===I&&_({payload:ae,instance:b,plugins:o,abort:p}),ue(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var x=b.on(I,function(H){_({payload:H.payload,instance:b,plugins:o,abort:p}),x()});return x},getState:function(I){var _=S.getState();return I?Rd(_,I):Object.assign({},_)},dispatch:function(I){var _=Tt(I)?{type:I}:I;if(yn.includes(_.type))throw new Error("reserved action "+_.type);var x=ee({},_,{_:ee({originalAction:_.type},I._||{})});S.dispatch(x)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,_,x){S.dispatch({type:Q.setItemStart,key:I,value:_,options:x})},removeItem:function(I,_){S.dispatch({type:Q.removeItemStart,key:I,options:_})}},setAnonymousId:function(I,_){b.storage.setItem(Rt,I,_)},events:{core:yn,plugins:s}},R=n.middlewares.concat([function(I){return function(_){return function(x){return x.meta||(x.meta=Wd()),_(x)}}},v(fn),Pw(b,c,{all:l,plugins:s}),Ew(a),yw(b),bw(b),v(dn)]),A={context:qw,user:ww(a),page:$w,track:Rw,plugins:_w(c),queue:Cw},j=Pr,z=Pr;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(j=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?up():Ke(typeof arguments[0])?Gd():Gd().apply(null,arguments)}}var te,$=(function(I){return Object.keys(I).reduce(function(_,x){return jw.includes(x)||(_[x]=I[x]),_},{})})(t),M=n.pluginsArray.reduce(function(I,_){var x=_.name,H=_.config,Y=_.loaded,J=n.pluginEnabled[x];return I[x]={enabled:J,initialized:!!J&&!_.initialize,loaded:!!Y({config:H}),config:H},I},{}),N={context:$,user:w,plugins:M},S=Qv((function(I){for(var _=Object.keys(I),x={},H=0;H<_.length;H++){var Y=_[H];typeof I[Y]===Et&&(x[Y]=I[Y])}var J,fe=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:ys})===pt||typeof ae(void 0,{type:pw})===pt)throw new Error(Wr+" "+ue+" "+pt)})})(x)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,ke={},Ne=0;Ne<fe.length;Ne++){var De=fe[Ne],$e=ne[De],Qe=(0,x[De])($e,ue);if(typeof Qe===pt){var St=mw(De,ue);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==$e}return ae?ke:ne}})(ee({},A,e)),N,z(j(gw.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:Wd(I.meta,_,rs(x))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:$,params:g,user:w,initialUser:r,persistedUser:P});var q=O.filter(function(I){return n.pluginEnabled[I]}),F=O.filter(function(I){return!n.pluginEnabled[I]});return S.dispatch({type:Q.registerPlugins,plugins:O,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,_){var x=I.bootstrap,H=I.config,Y=I.name;x&&ze(x)&&x({instance:b,config:H,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===_+1&&S.dispatch({type:Q.initializeStart,plugins:q,disabled:F})}),xw(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return tp(I,_,x)},3e3)})(S,c,b),b}var fn="before",dn="after",Gt="cookie",Dt=dp(),lp=Yn,Mw=Yn;function fp(t){return Dt?Yn(t,"",-1):Or(t)}function dp(){if(Dt!==void 0)return Dt;var t=Gt+Gt;try{Yn(t,t),Dt=document.cookie.indexOf(t)!==-1,fp(t)}catch{Dt=!1}return Dt}function Yn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Dt===!1&&(o?Yt(t,e):Zt(t)),o?document.cookie=t+"="+encodeURIComponent(e)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}}var mt="localStorage",Fw=ec.bind(null,mt);Cr(mt,"getItem",Zt);Cr(mt,"setItem",Yt);Cr(mt,"removeItem",Or);var gt="sessionStorage",Kw=ec.bind(null,gt);Cr(gt,"getItem",Zt);Cr(gt,"setItem",Yt);Cr(gt,"removeItem",Or);function gr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ke(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var zw=Fw(),Hw=Kw(),Bw=dp();function Wt(t,e){if(t){var r=tc(e),n=!ic(r),a=rc(r)?gr(localStorage.getItem(t)):void 0;if(n&&!dr(a))return a;var i=nc(r)?gr(lp(t)):void 0;if(n&&i)return i;var o=ac(r)?gr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Zt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function Rn(t,e,r){if(t&&!dr(e)){var n={},a=tc(r),i=JSON.stringify(e),o=!ic(a);return rc(a)&&(n[mt]=hn(mt,e,gr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:nc(a)&&(n[Gt]=hn(Gt,e,gr(lp(t))),Mw(t,i),o)?n[Gt]:ac(a)&&(n[gt]=hn(gt,e,gr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ht]=hn(Ht,e,Zt(t)),Yt(t,e),o?n[Ht]:n)}}function Gw(t,e){if(t){var r=tc(e),n=Wt(t,Wv),a={};return!dr(n.localStorage)&&rc(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!dr(n.cookie)&&nc(r)&&(fp(t),a[Gt]=n.cookie),!dr(n.sessionStorage)&&ac(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!dr(n.global)&&Xn(r,Ht)&&(Or(t),a[Ht]=n.global),a}}function tc(t){return t?Tt(t)?t:t.storage:Gv}function rc(t){return zw&&Xn(t,mt)}function nc(t){return Bw&&Xn(t,Gt)}function ac(t){return Hw&&Xn(t,gt)}function ic(t){return t===Wv||t==="all"}function Xn(t,e){return t===Gv||t===e||ic(t)}function hn(t,e,r){return{location:t,current:e,previous:r}}var Ww={setItem:Rn,getItem:Wt,removeItem:Gw};function Vw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Jd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vd(Object(r),!0).forEach(function(n){Vw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Jw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Ww};return Dw(Jd(Jd({},e),t))}function Zw(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=Xw(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function Yw(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Xw(t){return["#","?"].forEach(e=>t=Yw(t,e)),t}function Qw(){Zw(()=>{dt.page()})}var ns="up",as="down";function eb(t){if(t===void 0&&(t={}),!Ce)return gs;var e=Yd(),r=Is(),n=Zd(),a=vn(n,e),i=vn(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return gs;var d=h.map(function(p){return Number(p)}),v=vw(function(){var p=Yd(),g=(function($,M){return M.map(function(N){return N===100?$-5:$*(N/100)})})(p,d),P=Is(),w=Zd(),y=vn(w,p),m=vn(P,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=ns;b?R="initial":l<=w&&(R=as);var A=g,j=d;(R===ns||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function($,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),$.singleFunction=M),R===as&&!o.includes(M)&&w>=S&&M>i?(s.push(M),$.callbacks=$.callbacks.concat(M),$):R===ns&&!o.includes(M)&&w<=S&&M<=y?($.foundFunc=[M],$):(b&&w>=S&&$.foundFunc.length===0&&($.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),$.singleFunction?u.push(M):$.singleFunction=M),$)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===as&&z.callbacks&&z.callbacks.forEach(function($){ze(t[$])&&(t[$]({trigger:$,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push($))}),z.singleFunction){var V=z.singleFunction,te=z.direction;ze(t[V])&&t[V]({trigger:V,direction:te,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(V)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function Is(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function tb(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Zd(){return Math.round(Is()+tb())}function Yd(){if(!Ce)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function vn(t,e){return Math.round(t/e*100)}var oc="Event",Xd=oc+"Listener";function rb(t){return function(e,r,n,a){var i=n||gs,o=a||!1;if(!Ce)return i;var s=On(r),u=On(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+oc);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Xd:"remove"+Xd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?nb(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function On(t,e){if(Tt(t))return e?On(document.querySelectorAll(t)):(r=t).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(t)){for(var n=[],a=t.length>>>0;a--;)n[a]=t[a];return n}var i=uw(t);return e?i.map(function(o){return Tt(o)?On(o,!0):o}).flat():i}function nb(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var is=rb(oc);function hp(t,e){return Ce&&ze(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),ze(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}hp.bind(null,"onerror");hp.bind(null,"onload");var vp=typeof window>"u",Qd="hidden";function ab(t){if(vp)return!1;var e=ib(),r="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return t(!!document[e])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function ib(){var t=["webkit","moz","ms","o"];return vp||Qd in document?Qd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var ob=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function sb(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=ab(function(s){s||r({type:"tabVisible"})});return n=[o].concat(ob.map(function(s){return is(document,s,r)})).concat(is(window,"load",r)).concat(is(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function cb(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(g){d(),i&&!c&&i(Mr(h),g),a&&c&&(c=!1,a(Mr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Mr(h),g))},s)}var p=sb(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=p();return function(){return f=!1,h=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Mr(h,f),idle:c?Mr(r,f):0}}}}function Mr(t,e){return e?0:Math.round((new Date-t)/1e3)}const eh=5e3;class ub{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(e){this.element=e.element,this.viewCallback=e.viewCallback,this.activeDurationCallback=e.activeDurationCallback,this.idleDurationCallback=e.idleDurationCallback,this.scrollCallback=e.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),cb({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:eh}),eb({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(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*eh:Date.now(),this.isInViewport&&this.trackAwake(e,r)}handleScroll(e){this.scrollCallback&&this.scrollCallback(e)}handleVisibilityChange(){this.isAwake=!1;const e=Math.round((Date.now()-this.lastEventAt)/1e3);e>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,e))}trackAwake(e,r){!e&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),e&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function pp(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function lb(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.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)}}}const th="sesamy_session_id";function fb(){let t=sessionStorage.getItem(th);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(th,t)),t}let mp=!1,wn,Cn,Ps;function gp(t){return JSON.stringify(t.map(e=>{const{campaign:r,...n}=e.properties||{};return{anonymousId:e.anonymousId,userId:e.userId,type:e.type,properties:n,clientId:Ps,requestId:Math.random().toString(36).slice(2,9),sessionId:fb(),timestamp:new Date().toISOString(),version:Wn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:Kt("sesamy:item-src"),publisherContentId:Kt("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Xs,userAgent:navigator.userAgent,clientId:Ps}}}))}const yp=lb(async t=>{if(t.length>0){const e=gp(t);mp?navigator.sendBeacon(Cn,e):(await fetch(Cn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function os(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Cn,gp([e]))}else yp.push(t)}function db(){return mp=!0,yp.flush()}function hb(t,e,r){wn=e,Cn=`${ot("logs",r)}/events`,Ps=t}const vb={name:"custom-analytics-plugin",page:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;os({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;os({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n}=t;os({anonymousId:r,userId:n,properties:e,type:"identify"})}},rh=["source","medium","campaign","term","content"],kt="utm_",pb=1800*1e3;function wp(t){return t?Date.now()-parseInt(t,10)>pb:!0}function nh(){const t=document.referrer||"";if(!t)return;const e=Wt(`${kt}set_at`);(wp(e)||!Wt(`${kt}referrer`))&&Rn(`${kt}referrer`,t)}function mb(){const t=()=>{const r={};for(const a of rh){const i=Wt(`${kt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Wt(`${kt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){nh()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${kt}set_at`);if(Object.keys(n).length>0&&wp(a)){for(const o of rh){const s=n[o];s&&Rn(`${kt}${o}`,s)}Rn(`${kt}set_at`,String(Date.now()))}nh()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const gb=mb(),ah=new Map,ih=new Map;function yb({clientId:t,enabled:e=!0,environment:r}){hb(t,e,r),e&&(window.addEventListener("beforeunload",()=>{ih.forEach((n,a)=>{n.bind(a)()}),db()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&ah.forEach((n,a)=>{n.bind(a)()})}),Qw(),pp(()=>{const n=new ub({element:document.body,viewCallback:()=>{dt.page()},activeDurationCallback:(a,i,o)=>{dt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{dt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{dt.track("scroll",{scroll:a.scrollMax})}});ih.set(document.body,()=>{n.flush()}),ah.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Be.AUTHENTICATED,async n=>{const a=n;await dt.identify(a.detail.sub)}),window.addEventListener(Be.LOGOUT,async()=>{await dt.track("logout",{}),await dt.reset()}))}const dt=Jw({app:Xs,version:Wn,plugins:[gb,vb]});function bp(t,e){dt.track(t,e)}const wb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function bb(){return new Promise(t=>{const e=wb.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function Sb(){const t=navigator.userAgent.toLowerCase(),e=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of e)if(r.regex.test(t))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(t)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function Ib(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});bp(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function Pb(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function Eb(t){const{autoOnboardProduct:e,bills:r,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:l,getFulfillments:c,getProfile:f,getProxyContent:h,getSubscriptions:d,getTags:v,getTally:p,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:j,pushTally:z,requestDelivery:V,setTag:te,transactions:$,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=Ky(t),q=()=>A.list(),F={analytics:{track:bp},attribution:{get:En,set:Lv},auth:{getUser:f,getTokenSilently:jt,isAuthenticated:vr,loginWithRedirect:Gn,loginWithPopup:_v,login:Bg,logout:Js,setToken:vs},bills:r,browser:{detectAdblock:bb,isInAppBrowser:Sb,isIncognito:Gs},checkouts:n,clearCache:vt,content:{list:Hv,get:an,getLanguage:Br,hasAccess:Fy,unlock:Bv,getPropertyFromHTML:Qs},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:Ys},events:{emit:Ib,cancel:Pb},flags:{get:Nv,set:jv,list:nn,delete:xv},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:kb,isReady:()=>exports.isInitialized,log:ce,paywalls:R,paymentIssues:A,products:{...j,autoOnboard:e,linkSpotify:m},profile:{get:f,isSpotifyLinked:y,openHostedAccountPage:b,unlinkSpotify:M,update:N},proxy:{getContent:h},subscriptions:{list:d},tags:{delete:i,list:v,set:te},tallies:{delete:o,get:p,list:g,push:z},transactions:{...$,get:P},userMetadata:S,vendor:O,setToken:vs};return t.namespace&&(window[t.namespace]=F),F}function kb(){return Wn}function _b(t,e){t.style.position="relative",t.style.height="200px",t.style.overflow="hidden";let n=0;const a=Array.from(t.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
34
|
+
**/var ds={d:(t,e)=>{for(var r in e)ds.o(e,r)&&!ds.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Hs={};ds.d(Hs,{A:()=>Lg,k:()=>Bs});var jr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Nr=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Bs(){return jr(this,void 0,Promise,function(){return Nr(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",a=!1;function i(h){a||(a=!0,e({isPrivate:h,browserName:n}))}function o(){var h=0,d=parseInt("-1");try{d.toFixed(d)}catch(v){h=v.message.length}return h}function s(){return jr(this,void 0,void 0,function(){var h,d;return Nr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return jr(this,void 0,Promise,function(){return Nr(this,function(d){switch(d.label){case 0:return typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var v=String(Math.random());try{var p=indexedDB.open(v,1);p.onupgradeneeded=function(g){var P=g.target.result,w=function(y){i(y)};try{P.createObjectStore("t",{autoIncrement:!0}).put(new Blob),w(!1)}catch(y){(y instanceof Error&&typeof y.message=="string"?y.message:String(y)).includes("are not yet supported")?w(!0):w(!1)}finally{P.close(),indexedDB.deleteDatabase(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var g,P,w,y=window;return(w=(P=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&w!==void 0?w:1073741824})()/1048576);i(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return jr(this,void 0,Promise,function(){var d,v,p;return Nr(this,function(g){switch(g.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return g.sent(),i(!1),[3,4];case 3:return d=g.sent(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return jr(this,void 0,Promise,function(){return Nr(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bs);const Lg=Bs;Hs.A;const $g=Hs.k,mn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(mn);return t===null?void 0:t==="true"}catch{return}}async function qg(){try{const t=sessionStorage.getItem(mn);if(t!==null)return t==="true";const{isPrivate:e}=await $g();return sessionStorage.setItem(mn,e.toString()),e}catch{try{sessionStorage.setItem(mn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function jg(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ng(){return/android/i.test(navigator.userAgent)}let Oe,kv,Gr,hs=!1,gn=!1;Vr()&&window.addEventListener("pageshow",()=>{gn=!1});const yr="sesamyAccessToken",Wo="sesamyRefreshToken",In="sesamySilentAuthThrottle",xg=300*1e3;async function Bn(){return hs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{hs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Dg(t){if(!t)return null;const e=localStorage.getItem(Wo);if(!e)return ce("No refresh token found in localstorage"),null;const r=new URLSearchParams;r.set("client_id",t.iss),r.set("refresh_token",e),r.set("grant_type","refresh_token");const n=new URL(t.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",t.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(Wo),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Wo,i.refresh_token),localStorage.setItem(yr,i.access_token),i.access_token}catch{Js()}}async function Ws(){const t=localStorage.getItem(yr);if(!t)return null;const e=Zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Dg(e);if(r)return r;localStorage.removeItem(yr)}return t}let cn=null;const Mg=64;function Fg(){try{if(cn!==null)return cn;const e=Object.keys(localStorage).filter(r=>r.startsWith("@@auth0spajs@@"));for(const r of e){const n=JSON.parse(localStorage.getItem(r)||"{}");let a;if(typeof n=="object"&&(n.body&&typeof n.body=="object"&&"refresh_token"in n.body?a=n.body.refresh_token:"refresh_token"in n&&(a=n.refresh_token)),a&&typeof a=="string"&&a.length===Mg)return cn=!0,!0}}catch(t){ce(`Error checking for existing auth0 tokens: ${t.message}`)}return cn=!1,!1}function Kg(t){if(t.domains&&t.domains.length>0){const e=wr(window.location.href);if(e){for(const r of t.domains)if(wr(`https://${r}`)===e)return ce(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;ce(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return ce(`Using fallback domain property: ${t.domain}`),t.domain}function wr(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function zg(t){if(t.enabled===!1)return;kv=t.organization;const e=Kg(t);Gr=e&&!Fg()?e:Ev("token",t.environment);const r={domain:Gr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",wr(window.location.href)!==wr(`https://${Gr}`)&&(r.useRefreshTokens=!0),ce(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Og(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)ce("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{ce("Code found in URL, handling redirect");try{const u=await Oe.handleRedirectCallback();ce(`Login result: ${JSON.stringify(u)}`);const l=await Oe.getUser();if(!l)throw ce("No user found"),new Error("No user found");ce(`User found ${JSON.stringify(l)}`),Vs(),ce(`Triggering AUTHENTICATED event with appState: ${JSON.stringify(u.appState)}`),Vt(Be.AUTHENTICATED,{...l,appState:u.appState}),ce("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}hs=!0,Vt(Be.AUTH_INITIALIZED,{})}async function vr(){return await Bn(),await Ws()?!0:Oe?Oe.isAuthenticated():!1}async function Hg(){return await Bn(),await Ws()?(ce("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function _v(t){if(gn)return ce("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(yr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:kv,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gs(),...e}}}async function Gn(t){const e=_v(t);if(e)return Oe.loginWithRedirect(e)}async function Tv(t){const e=_v(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),Vs();const r=await Oe.getUser();if(!r)throw ce("No user found after popup login"),new Error("No user found");const n=new CustomEvent(Be.AUTHENTICATED,{detail:{...r,appState:t?.appState},composed:!0,bubbles:!0});window.dispatchEvent(n)&&window.location.reload()}async function Bg(t){return Gr&&wr(window.location.href)!==wr(`https://${Gr}`)&&(jg()||Ng()||Gs())?Tv(t):Gn(t)}function Gg(){try{const t=sessionStorage.getItem(In);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<xg}catch{return sessionStorage.removeItem(In),!1}}function Wg(){try{const t={timestamp:Date.now()};sessionStorage.setItem(In,JSON.stringify(t))}catch{ce("Failed to set silent auth throttle in sessionStorage")}}function Vs(){try{sessionStorage.removeItem(In)}catch{}}async function jt(t=!0,e=!1){await Bn();const r=await Ws();if(r)return r;if(!e&&Gg()){if(ce("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return ce("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=Zs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),Vs(),n}catch(n){const a=n;if(ce(`Failed to get token silently: ${a.message}`),Wg(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Js(),t)throw n;return null}}async function Js(t={}){if(await Bn(),localStorage.removeItem(yr),Vt(Be.LOGOUT,{}),!!Oe)return ce(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function Zs(t){const e=t.split(".");if(e.length!==3)return null;const n=e[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 vs(t){const e=Zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");ce("Set token"),localStorage.setItem(yr,t),Vt(Be.AUTHENTICATED,{...e,appState:void 0})}const Vg=(t,e)=>e.skipDedupe||e.method!=="GET",Jg=(t,e)=>e.method+"@"+t,Zg=t=>t.clone(),Yg=({skip:t=Vg,key:e=Jg,resolver:r=Zg}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Xg=(t,e)=>t*e,Qg=t=>t&&t.ok,ey=({delayTimer:t=500,delayRamp:e=Xg,maxAttempts:r=10,until:n=Qg,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};let Vo=class Rv extends Error{status;statusText;url;body;constructor(e,r,n,a,i){super(a),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Rv)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var Pn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Pn||{});const ty="application/json",Ov="Content-Type",sr=Symbol(),Cv=Symbol();function wd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===Ov.toLowerCase()))===null||e===void 0?void 0:e[1]}function bd(t){return/^application\/.*json.*/.test(t)}const zt=function(t,e,r=!1){return Object.entries(e).reduce((n,[a,i])=>{const o=t[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=zt(o,i,r):n[a]=i,n},{...t})},br={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function ry(t,e=!1){br.options=e?t:zt(br.options,t)}function ny(t,e=!1){br.polyfills=e?t:zt(br.polyfills,t)}function ay(t){br.errorType=t}const iy=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;let Av=class extends Error{};const oy=t=>{const e=Object.create(null);t=t._addons.reduce((y,m)=>m.beforeRequest&&m.beforeRequest(y,t._options,e)||y,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=t,l=new Map(i),c=zt(a.options,n);let f=r;const h=iy(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,v=h.catch(y=>{throw{[sr]:y}}).then(y=>{var m;if(!y.ok){const b=new Av;if(b.cause=d,b.stack=b.stack+`
|
|
35
|
+
CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const R=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(R&&typeof A=="string"){b.text=A;try{b.json=JSON.parse(A)}catch{}}else b[a.errorType]=A;throw b})}return y}),p=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,sr),R=b?m[sr]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(sr)&&l.get(sr);if(A)return A(R,t);const j=l.get(Cv);if(j)return j(R,t);throw R}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.then(b=>m?m(b):b)),P={_wretchReq:t,_fetchReq:h,_sharedState:e,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(y,m){return l.set(y,m),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(sr,y)}},w=u.reduce((y,m)=>({...y,...typeof m.resolver=="function"?m.resolver(y):m.resolver}),P);return o.reduce((y,m)=>m(y,t),w)},sy={_url:"",_options:{},_config:br,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:zt(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+t+"?"+r[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:zt(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:zt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[Ov]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const r=new Map(this._catchers);return r.set(t,e),{...this,_catchers:r}},catcherFallback(t){return this.catcher(Cv,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",r=null){let n=this.url(e).options({method:t});const a=wd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||bd(a));return n=r?o?n.json(r,a):n.body(r):n,oy(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const r=wd(this._options.headers);return this.content(e||bd(r)&&r||ty).body(JSON.stringify(t))}};function ct(t="",e={}){return{...sy,_url:t,_options:e}}ct.default=ct;ct.options=ry;ct.errorType=ay;ct.polyfills=ny;ct.WretchError=Av;const cy=(t,e)=>e.skipDedupe||e.method!=="GET",uy=(t,e)=>e.method+"@"+t,ly=t=>t.clone(),fy=({skip:t=cy,key:e=uy,resolver:r=ly}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},dy=(t,e)=>e.skipCache||e.method!=="GET",hy=(t,e)=>e.method+"@"+t,vy=()=>!1,py=()=>null,my=t=>t.ok,gy=({throttle:t=1e3,skip:e=dy,key:r=hy,clear:n=vy,invalidate:a=py,condition:i=my,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,l=new Set,c=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,v)=>{const p=r(d,v);let g=a(d,v);if(g&&(g instanceof Array||(g=[g]),g.forEach(P=>{typeof P=="string"?s.delete(P):P instanceof RegExp&&s.forEach((w,y)=>{P.test(y)&&s.delete(y)})})),n(d,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(p)){if(s.has(p)){const P=s.get(p).clone();return o&&Object.defineProperty(P,o,{value:p,enumerable:!1}),Promise.resolve(P)}else if(u.has(p))return new Promise((P,w)=>{u.get(p).push([P,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(P=>(i(P.clone())&&s.set(p,P.clone()),u.get(p).forEach(([w])=>w(P.clone())),u.delete(p),P)).catch(P=>{throw u.get(p).forEach(([,w])=>w(P)),u.delete(p),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},yy=(t,e)=>t*e,wy=t=>t&&t.ok,by=({delayTimer:t=500,delayRamp:e=yy,maxAttempts:r=10,until:n=wy,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},Sy="@sesamy/sdk",Iy="1.22.0";let Py=class{cache=new Map;get(e){return this.cache.get(e)||null}set(e,r){this.cache.set(e,r)}remove(e){this.cache.delete(e)}clear(){this.cache.clear()}};const Fr="sesamyCacheTimestamp",Ey=t=>{const{libraryName:e=Sy,libraryVersion:r=Iy,cache:n}=t,a=n?.storage||new Py,i=[s=>async(u,l)=>{if(n?.mode===Pn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Fr),c||(c=Date.now().toString(),sessionStorage.setItem(Fr,c))):(c=a.get(Fr),c||(c=Date.now().toString(),a.set(Fr,c)));const f={...l,headers:{...l.headers,"Cache-Timestamp":c}};return s(u,f)}return s(u,l)},s=>async(u,l)=>{const c=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:c}};return s(u,f)},fy()];n?.mode===Pn.NORMAL&&i.push(gy({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(by({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ct(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.headers}).middlewares(i);return{async request(s,u={}){try{const l=/^https?:\/\//.test(s);let c=o.url(s,l);u.headers&&(c=c.headers(u.headers));const f=(u.method||"GET").toLowerCase();let h;switch(f){case"get":h=c.get();break;case"post":h=c.post(u.body);break;case"put":h=c.put(u.body);break;case"patch":h=c.patch(u.body);break;case"delete":h=c.delete();break;default:h=c.get()}const d=await h.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&vt(),d.status===204)return null;if(!d.ok){const v=await d.text().catch(()=>"Unknown error");throw new Vo(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Vo)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Vo(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},vt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Fr),"Cache cleared"),xr={get:async(t,e)=>t.request(`/profile/${e}`),update:async(t,e,r)=>t.request(`/profile/${e}`,{method:"PATCH",body:JSON.stringify(r)}),checkSpotifyLink:async t=>t.request("/profile/spotify-link"),unlinkSpotify:async t=>t.request("/profile/unlink-spotify",{method:"POST"}),delete:async t=>{await t.request("/profile",{method:"DELETE"})}},Jo={list:async(t,e)=>{const r=new URLSearchParams;e?.type&&r.append("type",e.type),e?.sku&&r.append("sku",e.sku),e?.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),e?.waitForEntitlementAfter&&r.append("wait-for-entitlement-after",e.waitForEntitlementAfter);const n=r.toString(),a=n?`/entitlements?${n}`:"/entitlements";return t.request(a)},get:async(t,e)=>t.request(`/entitlements/${e}`),getAccess:async(t,e)=>t.request(`/entitlements/${e}/access`)},Sd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Id={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},ky=(t,e)=>{if(!t||!e)return t;const r=new URL(t);return r.hash=`access_token=${e}`,r.toString()},Pd=(t,e)=>!t.manageUrl||!e?t:{...t,manageUrl:ky(t.manageUrl,e)},Dr={list:async t=>t.request("/contracts"),get:async(t,e)=>t.request(`/contracts/${e}`),cancel:async(t,e)=>t.request(`/contracts/${e}/cancel`,{method:"POST"}),createAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments`,{method:"POST",body:JSON.stringify(r)}),confirmAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments/${r}/confirm`,{method:"POST"})},Zo={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:r})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},cr={list:async t=>t.request("/tallies"),get:async(t,e)=>t.request(`/tallies/${e}`),update:async(t,e,r)=>t.request(`/tallies/${e}`,{method:"PUT",body:JSON.stringify(r)}),create:async(t,e)=>t.request("/tallies",{method:"POST",body:JSON.stringify(e)}),delete:async(t,e)=>{try{return await t.request(`/tallies/${e}`,{method:"DELETE"}),!0}catch{return!1}},push:async(t,e,r)=>t.request(`/tallies/${e}/push`,{method:"POST",body:JSON.stringify(r)})},Yo={list:async t=>t.request("/tags"),add:async(t,e)=>{await t.request("/tags",{method:"POST",body:JSON.stringify({tag:e})})},remove:async(t,e)=>{await t.request(`/tags/${e}`,{method:"DELETE"})}},ur={generateCheckoutLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},generateAccountLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}${e.contractId?`/${encodeURIComponent(e.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePlanLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateConsumeLink:(t,e)=>{const r=e.language||"en";let n=new URL(`${t.baseUrl}/consume/${encodeURIComponent(r)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.sku)}`);return e.episodeId?n.href+=`/${encodeURIComponent(e.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()}},Xo={generateLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkouts",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkouts/${e}`),update:async(t,e,r)=>t.request(`/checkouts/${e}`,{method:"PATCH",body:JSON.stringify(r)})},Ed={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},kd={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},_y={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},Ty={list:async t=>t.request("/payment-issues")},Ry={content:async(t,e,r,n,a)=>{const i=new URLSearchParams({url:e});return r&&i.append("selector",r),n&&i.append("cache",n),t.request(`/proxy?${i.toString()}`,a)}},Oy={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},_d={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},Cy=t=>{const e=Ey(t);return{profile:{get:r=>xr.get(e,r),update:(r,n)=>xr.update(e,r,n),checkSpotifyLink:()=>xr.checkSpotifyLink(e),unlinkSpotify:()=>xr.unlinkSpotify(e),delete:()=>xr.delete(e)},entitlements:{list:r=>Jo.list(e,r),get:r=>Jo.get(e,r),getAccess:r=>Jo.getAccess(e,r)},subscriptions:{list:()=>Sd.list(e),get:r=>Sd.get(e,r)},products:{get:r=>Id.get(e,r),autoOnboard:r=>Id.autoOnboard(e,r)},contracts:{list:async()=>{const r=await Dr.list(e),n=await t.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return r;const a=n.substring(7);return r.map(i=>Pd(i,a))},get:async r=>{const n=await Dr.get(e,r),a=await t.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Pd(n,i)},cancel:r=>Dr.cancel(e,r),createAmendment:(r,n)=>Dr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Dr.confirmAmendment(e,r,n)},userMetadata:{get:()=>Zo.get(e),set:(r,n)=>Zo.set(e,r,n),delete:r=>Zo.delete(e,r)},tallies:{list:()=>cr.list(e),get:r=>cr.get(e,r),update:(r,n)=>cr.update(e,r,n),create:r=>cr.create(e,r),delete:r=>cr.delete(e,r),push:(r,n)=>cr.push(e,r,n)},tags:{list:()=>Yo.list(e),add:r=>Yo.add(e,r),remove:r=>Yo.remove(e,r)},checkouts:{generateLink:(r,n)=>ur.generateCheckoutLink(r,n),create:r=>Xo.create(e,r),get:r=>Xo.get(e,r),update:(r,n)=>Xo.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>ur.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>ur.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>ur.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>ur.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>ur.generateConsumeLink(r,n)},bills:{list:()=>Ed.list(e),get:r=>Ed.get(e,r)},fulfillments:{list:()=>kd.list(e),create:r=>kd.create(e,r)},paywalls:{get:r=>_y.get(e,r)},paymentIssues:{list:()=>Ty.list(e)},proxy:{content:(r,n,a,i)=>Ry.content(e,r,n,a,i)},transactions:{list:r=>Oy.list(e,r)},vendor:{get:()=>_d.get(e),list:()=>_d.list(e)}}};class Ay{get(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}set(e,r){typeof sessionStorage<"u"&&sessionStorage.setItem(e,r)}remove(e){typeof sessionStorage<"u"&&sessionStorage.removeItem(e)}clear(){}}function ps(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Uv(t,e){if(ps(t))return{itemSrc:t};const r=t.split(":");if(r.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${r.length}`);const[n,a,i]=r;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:e||i}}function Td(t){return t.endsWith("/")?t.slice(0,-1):t}function Rd(t,e){if(!ps(t)||!ps(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&Td(r.pathname)===Td(n.pathname)}function Uy(t,e,r){const n=new URL(`${ot("checkout3",t.environment)}`);e.language&&n.searchParams.set("lang",e.language);let a=e.sku,i=e.purchaseOptionId,o=e.itemSrc;if(e.itemSrc){const c=Uv(e.itemSrc,e.purchaseOptionId);a=c.sku||a,i=c.purchaseOption||i,o=c.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),e.email&&n.searchParams.set("email",e.email),e.business&&n.searchParams.set("business","true"),e.currency&&n.searchParams.set("currency",e.currency),e.price&&n.searchParams.set("price",e.price.toString()),e.discountCode&&n.searchParams.set("discount-code",e.discountCode),e.attributionItemSrc?n.searchParams.set("itemSrc",e.attributionItemSrc):r.itemSrc&&n.searchParams.set("itemSrc",r.itemSrc),e.attributionPublisherContentId?n.searchParams.set("publisherContentId",e.attributionPublisherContentId):r.publisherContentId&&n.searchParams.set("publisherContentId",r.publisherContentId),e.utmSource?n.searchParams.set("utm_source",e.utmSource):r.utmSource&&n.searchParams.set("utm_source",r.utmSource),e.utmMedium?n.searchParams.set("utm_medium",e.utmMedium):r.utmMedium&&n.searchParams.set("utm_medium",r.utmMedium),e.utmCampaign?n.searchParams.set("utm_campaign",e.utmCampaign):r.utmCampaign&&n.searchParams.set("utm_campaign",r.utmCampaign),e.utmTerm?n.searchParams.set("utm_term",e.utmTerm):r.utmTerm&&n.searchParams.set("utm_term",r.utmTerm),e.utmContent?n.searchParams.set("utm_content",e.utmContent):r.utmContent&&n.searchParams.set("utm_content",r.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(c=>{const[f,h]=c.trim().split("=");return{key:f,value:h}}).filter(c=>s.some(f=>f===c.key)).forEach(c=>{n.searchParams.append(c.key,c.value)});let l=new URL(window.location.href);if(e.redirectUrl)try{l=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return l.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&l.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",l.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:c,methods:f})=>f?f.map(h=>`${c}|${h}`):c).join(",")),e.requireAddress&&n.searchParams.set("require-address","true"),e.giftMode&&n.searchParams.set("gift-mode","true"),e.payerEmail&&n.searchParams.set("payer-email",e.payerEmail),e.metadata&&Object.entries(e.metadata).forEach(([c,f])=>{n.searchParams.set(`metadata.${c}`,String(f))}),n}const Lv="sesamySignedURLs";function Ys(){const t=sessionStorage.getItem(Lv);return t?JSON.parse(t):[]}function Ly(t){const e=Ys();e.push(t),ce(`Adding signed URL: ${t}`),sessionStorage.setItem(Lv,JSON.stringify(e))}function $y(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const ms="sesamyAttribution";function qy(t){const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e).value}catch{return console.error(`Failed to parse ${t}`),null}}function jy(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function En(){return qy(ms)||{}}function $v(t){if(t===null)localStorage.removeItem(ms);else{ce(`Setting attribution ${JSON.stringify(t)}`);const e=En()??{},r=$y({...e,...jy(t)});localStorage.setItem(ms,JSON.stringify({value:r}))}}const Xs="@sesamy/sesamy-js",Wn="1.74.0",qv="sesamyFlags";async function jv(t){try{localStorage.setItem(qv,JSON.stringify(t))}catch{ce("Failed to save flags to localStorage")}}async function Nv(t,e){const r=await nn();r[t]=e,await jv(r)}async function xv(t){return(await nn())[t]}async function Dv(t){const e=await nn();t in e&&(delete e[t],await jv(e))}async function nn(){try{const t=localStorage.getItem(qv);return t?JSON.parse(t):{}}catch{return{}}}function Mv(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}function Ny(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}function xy(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}let Fe={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Fv=[],Kv=!1,_t;function Qs(){const t=window.location.pathname,e=new URLSearchParams(window.location.search),r=navigator.userAgent;return Fv.find(n=>!(n.path&&!t.includes(n.path)||n.queryParam&&e.get(n.queryParam.key)!==n.queryParam.value||n.userAgentContains&&!r.includes(n.userAgentContains)))}function Dy(){return Qs()}function My(t,e){Fv=t.content||[];const r=Qs();r&&r.type==="article"&&(Fe={...Fe,...Ny(r.selectors)},Kv=r.enablePaywallSettingsUrlFallback||!1),_t=e}function Fy(t,e){const{selector:r,attribute:n}=e;return r===Fe.article.selector||n&&t.hasAttribute(n)?t:t.querySelector(r)}function zv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??zv(t.parentElement,e):t.textContent??void 0}function Kt(t){const e=document.head.querySelectorAll(`[property~='${t}'][content]`);for(let n=0;n<e.length;n+=1)if(e[n].content)return e[n].content;const r=document.head.querySelectorAll(`[name~='${t}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content}function ec({publisherContentId:t,key:e,defaultValue:r=""}){const n=t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null,a=e.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(e)||Kt(`sesamy:${e}`)||Kt(`sesamy:${a}`)||Kt(`og:${e}`)||Kt(e)||r}function Hv(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(an).filter(e=>e!==null)}function an(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Mv(e)},n=(i,o,s,u)=>{const l=Fy(e,o),c=zv(l,o)||ec({publisherContentId:s,key:xy(String(i))})||void 0;c&&(r[i]=u?u(c):c)};n("id",Fe.id),n("title",Fe.title,r.id),n("excerpt",Fe.excerpt,r.id),n("image",Fe.image,r.id),n("price",Fe.price,r.id,i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,i=>i||"entitlement");const a=Qs();if(a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency),a.paywallUrl&&!r.paywallUrl&&(r.paywallUrl=a.paywallUrl)),Kv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r.url||(r.url=window.location.href),r}async function Ky(t){const e=an(t);if(!e)throw new Error("Could not find article element");if(e.accessLevel==="public")return!0;if(e.accessLevel==="logged-in"&&!e.paywallUrl)return await _t.auth.isAuthenticated()?!0:null;if(e.paywallUrl&&((await _t.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await _t.auth.isAuthenticated()?!0:null;if(!e.url)throw new Error("Article must have a URL");return await _t.entitlements.hasAccess(e.url,e.pass?.split(",")||[])||null}async function Bv(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=an(r);if(!n?.url)throw new Error("Could not find content for element");const a=await _t.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await _t.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Mv(r.parentElement||r);return _t.proxy.getContent(i.token,n.url,o)}function zy(t){const e=t.endpoint||ot("api2",t.environment),n=Cy({baseUrl:e,tokenProvider:async()=>{if(await vr())try{const q=await jt(!1);if(q)return`Bearer ${q}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:Xs,libraryVersion:Wn,vendorId:t.vendorId,cache:{mode:Pn.BROWSER,storage:new Ay}}),a=S=>async(O,q)=>{let F=sessionStorage.getItem(gd);F||(F=Date.now().toString(),sessionStorage.setItem(gd,F));const I={...q,headers:{...q.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(q,F)=>{let I=null;if(I=await jt(S),!I){if(S)throw new Error("No access token available");return O(q,F)}const _={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(q,_)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Yg(),ey({delayTimer:1e3,delayRamp:(S,O)=>S*O,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(S={}){const{waitForEntitlementAfter:O,includeSignedLinks:q=!0}=S,F=await vr()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return q&&F.push(...Ys()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:_,purchaseOption:x}=Uv(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||Rd(S,I.url))return!0}return!!O.some(_=>Rd(_,I.url))})}async function l(S,O,q){const F=new URL(ot("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),q&&F.searchParams.set("selector",q),ct(F.toString()).headers({Authorization:`Bearer ${S}`}).get().text()}async function c(S){if(!S)throw new Error("SKU is required to get fulfillments");return await vr()?await o.get(`/fulfillments?sku=${encodeURIComponent(S)}`).json():[]}async function f(S,O){if(!S||!O)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:S},`/fulfillments/${encodeURIComponent(O)}/request-delivery?`).res()).ok}async function h(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(S){return(await n.transactions.list())?.find(q=>q.id===S)}async function v(){return await o.url("/tags").get().json()}async function p(S){const O=await o.url(`/tags/${encodeURIComponent(S)}`).delete().res();return vt(),O.ok}async function g(S){const O=await o.url("/tags").post(encodeURIComponent(S)).res();return Vt(Be.USER_ATTRIBUTE_CHANGED,{}),vt(),O.ok}async function P(S){return(await n.tallies.get(S)).value}async function w(){const S=await n.tallies.list(),O={};for(const q of S)O[q.id]=q.value;return O}async function y(S){return await n.tallies.delete(S)}async function m(S,O){return await n.tallies.push(S,O)}async function b(){return await jt(!1)?await o.url("/profile").get().json():null}async function R(S){const O=await o.url("/profile").patch(S).res();return vt(),O.ok}async function A(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await jt(!1);if(!O)throw new Error("No access token available");const q=new URL(`${ot("access-sync",t.environment)}/spotify/sesamy-callback`);q.searchParams.set("access_token",O),q.searchParams.set("state",S),window.location.href=q.toString()}async function V(S){const O=await o.url(`/products/${encodeURIComponent(S)}/auto-onboard`).post().json();return O.length&&vt(),O}async function te(S,O=3600){const{shortlink:q}=await ct(Ug).post({url:S,ttl:O}).json();return q}async function $(S){const O=await jt(!1,!0);let q;const F=S.language||Br(),I=En();switch(S.target){case"account":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":q=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":q=new URL(`${ot("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?q.href+=`/${S.episodeId}`:q.href+="/listen",q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":q=Uy(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(q.hash=`#access_token=${O}`),S.shorten?te(q.href,S.ttl):q.href}async function M(){const S=await jt(!1),O=new URL(`${ot("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=En(),q=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,_]=F.trim().split("=");q.includes(I)&&!O[I]&&(O[I]=_)}),n.checkouts.create({language:Br(),...S,attribution:{...O,...S.attribution}})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Hv,get:an,getLanguage:Br,unlock:Bv,getPropertyFromHTML:ec},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,flags:{get:xv,set:Nv,list:nn,delete:Dv},generateLink:$,getProxyContent:l,getEntitlements:s,getFulfillments:c,requestDelivery:f,hasAccess:u,isSpotifyLinked:A,linkSpotify:z,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:b,products:n.products,getSubscriptions:h,getTally:P,getTallies:w,getTags:v,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:j,updateProfile:R,vendor:n.vendor}}function Od(t,e,r,n,a){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)t=t?t[e[n]]:a;return t===a?r:t}var Hy="function",By="string",tt="undefined",Gy="boolean",kn="object",Wy="array",Vy="number",Jy="symbol",Zy="null",gs=function(){},Gv="any",Wv="*",Jt="__",Yy="form",Xy="input",Qy="button",ew="select",_n=typeof process!==tt?process:{};_n.env&&_n.env.NODE_ENV;var Ce=typeof document!==tt;_n.versions!=null&&_n.versions.node!=null;typeof Deno!==tt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==tt&&typeof navigator.userAgent!==tt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Vv(t,e){return e.charAt(0)[t]()+e.slice(1)}var tw=Vv.bind(null,"toUpperCase"),rw=Vv.bind(null,"toLowerCase");function nw(t){return Jv(t)?tw(Zy):typeof t===kn?sw(t):Object.prototype.toString.call(t).slice(8,-1)}function Tn(t,e){e===void 0&&(e=!0);var r=nw(t);return e?rw(r):r}function on(t,e){return typeof e===t}var ze=on.bind(null,Hy),Tt=on.bind(null,By),dr=on.bind(null,tt),aw=on.bind(null,Gy);on.bind(null,Jy);function Jv(t){return t===null}function iw(t){return Tn(t)===Vy&&!isNaN(t)}function Zv(t){return Tn(t)===Wy}function Ke(t){if(!ow(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ow(t){return t&&(typeof t===kn||t!==null)}function sw(t){return ze(t.constructor)?t.constructor.name:null}function cw(t){return t instanceof Error||Tt(t.message)&&t.constructor&&iw(t.constructor.stackTraceLimit)}function Yv(t,e){if(typeof e!="object"||Jv(e))return!1;if(e instanceof t)return!0;var r=Tn(new t(""));if(cw(e))for(;e;){if(Tn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Yv.bind(null,TypeError);Yv.bind(null,SyntaxError);function Vn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?uw(t,e):r}function uw(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Jn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Jn(Vn,Yy);Jn(Vn,Qy);Jn(Vn,Xy);Jn(Vn,ew);function lw(t){return t?Zv(t)?t:[t]:[]}function Cd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function fw(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function dw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function hw(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Cd(r[1]),o=Cd(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(vw(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return Ce&&window.location.search.substring(1)})())}function vw(t,e,r){for(var n=e.length-1,a=0;a<n;++a){var i=e[a];if(i==="__proto__"||i==="constructor")break;i in t||(t[i]={}),t=t[i]}t[e[n]]=r}function Zn(){for(var t="",e=0,r=4294967295*Math.random()|0;e++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],a=15&r;t+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=e%8==0?4294967295*Math.random()|0:r>>4}return t}function pw(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var Ht="global",Sr=Jt+Ht+Jt,Ir=typeof self===kn&&self.self===self&&self||typeof global===kn&&global[Ht]===global&&global||void 0;function Zt(t){return Ir[Sr][t]}function Yt(t,e){return Ir[Sr][t]=e}function Or(t){delete Ir[Sr][t]}function Cr(t,e,r){var n;try{if(tc(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}Ir[Sr]||(Ir[Sr]={});var un={};function tc(t){if(typeof un[t]!==tt)return un[t];try{var e=window[t];e.setItem(tt,tt),e.removeItem(tt)}catch{return un[t]=!1}return un[t]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ee.apply(null,arguments)}var Et="function",pt="undefined",Wr="reducer",Xv="@@redux/",ys=Xv+"INIT",mw=Xv+Math.random().toString(36),Ad=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),ln=" != "+Et;function Qv(t,e,r){var n;if(typeof e===Et&&typeof r===pt&&(r=e,e=void 0),typeof r!==pt){if(typeof r!==Et)throw new Error("enhancer"+ln);return r(Qv)(t,e)}if(typeof t!==Et)throw new Error(Wr+ln);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==Et)throw new Error("Listener"+ln);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===pt)throw new Error("ActType "+pt);if(u)throw new Error("Dispatch in "+Wr);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:ys}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+Wr+ln);a=d,h({type:ys})}})[Ad]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function g(){p.next&&p.next(c())}return g(),{unsubscribe:v(g)}}})[Ad]=function(){return this},d},n}function gw(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Wr+" "+t+" returns "+pt}function Pr(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function yw(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ee({},o,{dispatch:s=Pr.apply(void 0,i)(o.dispatch)})}}}var Rt=Jt+"anon_id",Bt=Jt+"user_id",pr=Jt+"user_traits",ws="analytics",Pt="userId",hr="anonymousId",yn=["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"],bs=["name","EVENTS","config","loaded"],Q=yn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Ud=/^utm_/,Ld=/^an_prop_/,$d=/^an_trait_/;function ww(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===Q.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Rt,o.anonymousId),l||e(Bt,o.userId),u.traits&&e(pr,ee({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(v,p){if(p.match(Ud)||p.match(/^(d|g)clid/)){var g=p.replace(Ud,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Ld)&&(v.props[p.replace(Ld,"")]=i[p]),p.match($d)&&(v.traits[p.replace($d,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(ee({type:Q.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return t.identify(f,d.traits)},0),h&&setTimeout(function(){return t.track(h,d.props)},0),Object.keys(d.campaign).length&&r.dispatch({type:Q.campaign,campaign:d.campaign})}}return n(a)}}}}function bw(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Rt)return ee({},e,{anonymousId:r.value});if(r.key===Bt)return ee({},e,{userId:r.value})}switch(r.type){case Q.identify:return Object.assign({},e,{userId:r.userId,traits:ee({},e.traits,r.traits)});case Q.reset:return[Bt,Rt,pr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function qd(t){return{userId:t.getItem(Bt),anonymousId:t.getItem(Rt),traits:t.getItem(pr)}}var Ss=function(t){return Jt+"TEMP"+Jt+t};function Sw(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===Q.reset&&([Bt,pr,Rt].forEach(function(d){n(d)}),[Pt,hr,"traits"].forEach(function(d){Or(Ss(d))})),s.type===Q.identify){a(Rt)||r(Rt,Zn());var f=a(Bt),h=a(pr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Bt,u),l&&r(pr,ee({},h,l))}return o(s)}}}}var Kr={};function jd(t,e){Kr[t]&&ze(Kr[t])&&(Kr[t](e),delete Kr[t])}function ep(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ee({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return ep(t,e,r-10).then(n,a)})})}function Iw(t){return{abort:t}}function tp(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&ze(p)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Pt,hr].reduce(function(R,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(R[A]=b[A]),R},m)})(h.payload,u),w=n[P.meta.rid];if(!w&&(g=p({payload:P,config:o[d].config,instance:r,abort:Iw}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=v+":"+d;t.dispatch(ee({},P,{type:y,_:{called:y,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var Qo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(mr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var j=w.type.match(mr)?(function(z,V,te,$,M){return function(N,S){var O=$?$.name:z,q=S&&Jr(S)?S:te;if($&&(!(q=S&&Jr(S)?S:[z]).includes(z)||q.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(q)+" input valid");return ee({},M,{abort:{reason:N,plugins:q,caller:V,_:O}})}})(R,A,P,m,w):(function(z,V){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+V)}})(w,A);return{payload:Pw(w),instance:g,config:b||{},abort:j}}})(n,d),p=e.exact.reduce(function(g,P){var w=P.pluginName,y=P.methodName,m=!1;return y.match(/^initialize/)||y.match(/^reset/)||(m=!l[w].loaded),c.offline&&y.match(/^(page|track|identify)/)&&(m=!0),g[""+w]=m,g},{});return Promise.resolve(e.exact.reduce(function(g,P,w){var y=P.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var R=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,j,z){return Promise.resolve(A).then(function(V){return j.method&&ze(j.method)?((function(N,S){var O=zd(N);if(O&&O.name===S){var q=zd(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(q?"or "+q.method:"")+" in "+S+" plugin insteadof "+N].join(`
|
|
36
|
+
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:V,instance:n,abort:(te=V,$=y,M=j.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[$],caller:f,from:M||$}})}),config:Dd(j.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,$,M})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return R&&R.then?R.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(P,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,R=i[b];return Promise.resolve(P).then(function(A){var j=g[b]?g[b]:{};if(h&&(j=A),ts(j,b))return es({data:j,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(ts(A,b))return m&&es({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(p.hasOwnProperty(b)&&p[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:j,instance:n,config:Dd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},$=ee({},A,te),M=g[b];if(ts(M,b))es({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(Nd)&&!f.match(xd)&&n.dispatch(ee({},h?$:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve($)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(mr)||f.match(/^registerPlugin/)||f.match(xd)||f.match(Nd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var w=ee({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});rp(P,e.exact.length)&&!f.match(/End$/)&&(w=ee({},w,{type:P.type+"Aborted"})),s.dispatch(w)}return P})})}catch(g){return Promise.reject(g)}},mr=/Start$/,Nd=/^bootstrap/,xd=/^ready/;function es(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Dd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Md(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Fd(t,e){var r=t.replace(mr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function ts(t,e){var r=t.abort;return!!r&&(r===!0||Kd(r,e)||r&&Kd(r.plugins,e))}function rp(t,e){var r=t.abort;if(!r)return!1;if(r===!0||Tt(r))return!0;var n=r.plugins;return Jr(r)&&r.length===e||Jr(n)&&n.length===e}function Jr(t){return Array.isArray(t)}function Kd(t,e){return!(!t||!Jr(t))&&t.includes(e)}function zd(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Pw(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ke(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Ew(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(m){return s?m:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===Q.enablePlugin&&a.dispatch({type:Q.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===Q.disablePlugin&&setTimeout(function(){return jd(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),p=[],g=[],P=o.disabled,w=v.map(function(m){var b=m.loaded,R=m.name,A=m.config;return ep(m,function(){return b({config:A})},1e4).then(function(j){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!bs.includes(z)})}),n[R]=!0),p=p.concat(R),m}).catch(function(j){if(j instanceof Error)throw new Error(j);return g=g.concat(j.name),j})});Promise.all(w).then(function(m){var b={plugins:p,failed:g,disabled:P};setTimeout(function(){d.length===w.length+P.length&&a.dispatch(ee({},{type:Q.ready},b))},0)})}var y=(function(){if(l!==Q.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return tp(a,e,t)},0),Promise.resolve((function(m,b,R,A,j){try{var z=ze(b)?b():b,V=m.type,te=V.replace(mr,"");if(m._&&m._.called)return Promise.resolve(m);var $=R.getState(),M=(O=z,(q=$.plugins)===void 0&&(q={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var _=F.plugins||{};return aw(_[I])?_[I]:_.all!==!1&&(!q[I]||q[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys($.plugins).filter(function(I){var _=$.plugins[I];return m.plugins.includes(I)&&!_.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,_){var x=Fd(I).map(function(H){return Md(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Fd(I,J).map(function(ke){return Md(ke,_)}),ne=fe[0],ue=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,M);return Promise.resolve(Qo({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(I){function _(){var Y=(function(){if(V.match(mr))return Promise.resolve(Qo({action:ee({},x,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&jd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(rp(I,N.length))return I;var x,H=(function(){if(V!==te)return Promise.resolve(Qo({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:$,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(Y){x=Y});x=I})();return H&&H.then?H.then(_):_()})}catch(I){return Promise.reject(I)}var O,q,F})(o,e,t,a,r)).then(function(m){var b=i(m);return s=1,b})})();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(m){return Promise.reject(m)}}}}}function kw(t){return function(e){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Q.setItem||a===Q.removeItem){if(n.abort)return r(n);a===Q.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var _w=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return Pr.apply(void 0,o)(n)(a)}}}}};function Tw(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Hd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Hd(r.type,Q.initialize),l=t()[u];return l&&u?(n[u]=ee({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ee({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ee({},e[r.name],{loaded:!0}),ee({},e,n);switch(r.type){case Q.disablePlugin:return ee({},e,Bd(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Bd(r.plugins,!0,e));default:return e}}}function Hd(t,e){return t.substring(e.length+1,t.length)}function Bd(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function np(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Rw={last:{},history:[]};function Ow(t,e){t===void 0&&(t=Rw);var r=e.options,n=e.meta;if(e.type===Q.track){var a=np(ee({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ee({},t,{last:a,history:t.history.concat(a)})}return t}var Cw={actions:[]};function Aw(t,e){t===void 0&&(t=Cw);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===Q.identify?[e].concat(t.actions):t.actions.concat(e),ee({},t,{actions:n});case"dequeue":return[];default:return t}}var ap=/#.*$/;function Uw(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(ap,""):"")}var ip,op,sp,cp,Lw=function(t){if(t===void 0&&(t={}),!Ce)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(Ce){for(var v,p=document.getElementsByTagName("link"),g=0;v=p[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(ap,"")})(l),f={title:r,url:c,path:Uw(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},$w={last:{},history:[]};function qw(t,e){t===void 0&&(t=$w);var r=e.options;if(e.type===Q.page){var n=np(ee({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ee({},t,{last:n,history:t.history.concat(n)})}return t}ip=(function(){if(!Ce)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"})(),op=Ce?document.referrer:null,sp=fw(),cp=dw();var Gd={initialized:!1,sessionId:Zn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:ip},userAgent:Ce?navigator.userAgent:"node",library:{name:ws,version:"0.13.1"},timezone:cp,locale:sp,campaign:{},referrer:op};function jw(t,e){t===void 0&&(t=Gd);var r=t.initialized,n=e.campaign;switch(e.type){case Q.campaign:return ee({},t,{campaign:n});case Q.offline:return ee({},t,{offline:!0});case Q.online:return ee({},t,{offline:!1});default:return r?t:ee({},Gd,t,{initialized:!0})}}var Nw=["plugins","reducers","storage"];function xw(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Dw(t){var e=xw.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function up(){return Yt(ws,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Ir[Sr][ws].push(o.action||o),i(o)}})}}}function Wd(t){return function(){return Pr(Pr.apply(null,arguments),up())}}function rs(t){return t?Zv(t)?t:[t]:[]}function Vd(t,e,r){t===void 0&&(t={});var n,a,i=Zn();return e&&(Kr[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(ze(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ee({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Mw(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,_){if(ze(_))return I.middlewares=I.middlewares.concat(_),I;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var x=_.EVENTS?Object.keys(_.EVENTS).map(function(J){return _.EVENTS[J]}):[];I.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(I.methods[_.name]=Object.keys(_.methods).reduce(function(J,fe){var ne;return J[fe]=(ne=_.methods[fe],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ue.length;ke++)ae[ke]=ue[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete _.methods);var H=Object.keys(_).concat(x),Y=new Set(I.events.concat(H));if(I.events=Array.from(Y),I.pluginsArray=I.pluginsArray.concat(_),I.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return I.plugins[_.name]=_,I.plugins[_.name].loaded||(I.plugins[_.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Zt,setItem:Yt,removeItem:Or},i=(function(I){return function(_,x,H){return x.getState("user")[_]||(H&&Ke(H)&&H[_]?H[_]:qd(I)[_]||Zt(Ss(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!bs.includes(I)}).sort(),u=new Set(s.concat(yn).filter(function(I){return!bs.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new _w,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=hw(),P=qd(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Zn());var y=ee({enable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.enablePlugin,plugins:rs(I),_:{originalAction:Q.enablePlugin}},x,[_])})},disable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.disablePlugin,plugins:rs(I),_:{originalAction:Q.disablePlugin}},x,[_])})}},n.methods),m=!1,b={identify:function(I,_,x,H){try{var Y=Tt(I)?I:null,J=Ke(I)?I:_,fe=x||{},ne=b.user();Yt(Ss(Pt),Y);var ue=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ue,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[_,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(I,_,x,H){try{var Y=Ke(I)?I.event:I;if(!Y||!Tt(Y))throw new Error("EventMissing");var J=Ke(I)?I:_||{},fe=Ke(x)?x:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Pt,b,_),anonymousId:i(hr,b,_)},ne,[_,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(I,_,x){try{var H=Ke(I)?I:{},Y=Ke(_)?_:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:Lw(H),options:Y,userId:i(Pt,b,H),anonymousId:i(hr,b,H)},J,[I,_,x])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Pt||I==="id")return i(Pt,b);if(I===hr||I==="anonId")return i(hr,b);var _=b.getState("user");return I?Od(_,I):_},reset:function(I){return new Promise(function(_){S.dispatch({type:Q.resetStart},_,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(_){I&&I(_),m=!0})},on:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var x=/Start$|Start:/;if(I==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(x)&&_({payload:ae,instance:b,plugins:o}),ue(ae)}}},Y=function(ne){return function(ue){return function(ae){return ae.type.match(x)||_({payload:ae,instance:b,plugins:o}),ue(ae)}}};return h(H,fn),h(Y,dn),function(){d(H,fn),d(Y,dn)}}var J=I.match(x)?fn:dn,fe=function(ne){return function(ue){return function(ae){return ae.type===I&&_({payload:ae,instance:b,plugins:o,abort:p}),ue(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var x=b.on(I,function(H){_({payload:H.payload,instance:b,plugins:o,abort:p}),x()});return x},getState:function(I){var _=S.getState();return I?Od(_,I):Object.assign({},_)},dispatch:function(I){var _=Tt(I)?{type:I}:I;if(yn.includes(_.type))throw new Error("reserved action "+_.type);var x=ee({},_,{_:ee({originalAction:_.type},I._||{})});S.dispatch(x)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,_,x){S.dispatch({type:Q.setItemStart,key:I,value:_,options:x})},removeItem:function(I,_){S.dispatch({type:Q.removeItemStart,key:I,options:_})}},setAnonymousId:function(I,_){b.storage.setItem(Rt,I,_)},events:{core:yn,plugins:s}},R=n.middlewares.concat([function(I){return function(_){return function(x){return x.meta||(x.meta=Vd()),_(x)}}},v(fn),Ew(b,c,{all:l,plugins:s}),kw(a),ww(b),Sw(b),v(dn)]),A={context:jw,user:bw(a),page:qw,track:Ow,plugins:Tw(c),queue:Aw},j=Pr,z=Pr;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(j=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?up():Ke(typeof arguments[0])?Wd():Wd().apply(null,arguments)}}var te,$=(function(I){return Object.keys(I).reduce(function(_,x){return Nw.includes(x)||(_[x]=I[x]),_},{})})(t),M=n.pluginsArray.reduce(function(I,_){var x=_.name,H=_.config,Y=_.loaded,J=n.pluginEnabled[x];return I[x]={enabled:J,initialized:!!J&&!_.initialize,loaded:!!Y({config:H}),config:H},I},{}),N={context:$,user:w,plugins:M},S=Qv((function(I){for(var _=Object.keys(I),x={},H=0;H<_.length;H++){var Y=_[H];typeof I[Y]===Et&&(x[Y]=I[Y])}var J,fe=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:ys})===pt||typeof ae(void 0,{type:mw})===pt)throw new Error(Wr+" "+ue+" "+pt)})})(x)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,ke={},Ne=0;Ne<fe.length;Ne++){var De=fe[Ne],$e=ne[De],Qe=(0,x[De])($e,ue);if(typeof Qe===pt){var St=gw(De,ue);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==$e}return ae?ke:ne}})(ee({},A,e)),N,z(j(yw.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:Vd(I.meta,_,rs(x))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:$,params:g,user:w,initialUser:r,persistedUser:P});var q=O.filter(function(I){return n.pluginEnabled[I]}),F=O.filter(function(I){return!n.pluginEnabled[I]});return S.dispatch({type:Q.registerPlugins,plugins:O,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,_){var x=I.bootstrap,H=I.config,Y=I.name;x&&ze(x)&&x({instance:b,config:H,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===_+1&&S.dispatch({type:Q.initializeStart,plugins:q,disabled:F})}),Dw(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return tp(I,_,x)},3e3)})(S,c,b),b}var fn="before",dn="after",Gt="cookie",Dt=dp(),lp=Yn,Fw=Yn;function fp(t){return Dt?Yn(t,"",-1):Or(t)}function dp(){if(Dt!==void 0)return Dt;var t=Gt+Gt;try{Yn(t,t),Dt=document.cookie.indexOf(t)!==-1,fp(t)}catch{Dt=!1}return Dt}function Yn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Dt===!1&&(o?Yt(t,e):Zt(t)),o?document.cookie=t+"="+encodeURIComponent(e)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}}var mt="localStorage",Kw=tc.bind(null,mt);Cr(mt,"getItem",Zt);Cr(mt,"setItem",Yt);Cr(mt,"removeItem",Or);var gt="sessionStorage",zw=tc.bind(null,gt);Cr(gt,"getItem",Zt);Cr(gt,"setItem",Yt);Cr(gt,"removeItem",Or);function gr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ke(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var Hw=Kw(),Bw=zw(),Gw=dp();function Wt(t,e){if(t){var r=rc(e),n=!oc(r),a=nc(r)?gr(localStorage.getItem(t)):void 0;if(n&&!dr(a))return a;var i=ac(r)?gr(lp(t)):void 0;if(n&&i)return i;var o=ic(r)?gr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Zt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function Rn(t,e,r){if(t&&!dr(e)){var n={},a=rc(r),i=JSON.stringify(e),o=!oc(a);return nc(a)&&(n[mt]=hn(mt,e,gr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:ac(a)&&(n[Gt]=hn(Gt,e,gr(lp(t))),Fw(t,i),o)?n[Gt]:ic(a)&&(n[gt]=hn(gt,e,gr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ht]=hn(Ht,e,Zt(t)),Yt(t,e),o?n[Ht]:n)}}function Ww(t,e){if(t){var r=rc(e),n=Wt(t,Wv),a={};return!dr(n.localStorage)&&nc(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!dr(n.cookie)&&ac(r)&&(fp(t),a[Gt]=n.cookie),!dr(n.sessionStorage)&&ic(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!dr(n.global)&&Xn(r,Ht)&&(Or(t),a[Ht]=n.global),a}}function rc(t){return t?Tt(t)?t:t.storage:Gv}function nc(t){return Hw&&Xn(t,mt)}function ac(t){return Gw&&Xn(t,Gt)}function ic(t){return Bw&&Xn(t,gt)}function oc(t){return t===Wv||t==="all"}function Xn(t,e){return t===Gv||t===e||oc(t)}function hn(t,e,r){return{location:t,current:e,previous:r}}var Vw={setItem:Rn,getItem:Wt,removeItem:Ww};function Jw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Zd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jd(Object(r),!0).forEach(function(n){Jw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Vw};return Mw(Zd(Zd({},e),t))}function Yw(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=Qw(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function Xw(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Qw(t){return["#","?"].forEach(e=>t=Xw(t,e)),t}function eb(){Yw(()=>{dt.page()})}var ns="up",as="down";function tb(t){if(t===void 0&&(t={}),!Ce)return gs;var e=Xd(),r=Is(),n=Yd(),a=vn(n,e),i=vn(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return gs;var d=h.map(function(p){return Number(p)}),v=pw(function(){var p=Xd(),g=(function($,M){return M.map(function(N){return N===100?$-5:$*(N/100)})})(p,d),P=Is(),w=Yd(),y=vn(w,p),m=vn(P,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=ns;b?R="initial":l<=w&&(R=as);var A=g,j=d;(R===ns||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function($,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),$.singleFunction=M),R===as&&!o.includes(M)&&w>=S&&M>i?(s.push(M),$.callbacks=$.callbacks.concat(M),$):R===ns&&!o.includes(M)&&w<=S&&M<=y?($.foundFunc=[M],$):(b&&w>=S&&$.foundFunc.length===0&&($.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),$.singleFunction?u.push(M):$.singleFunction=M),$)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===as&&z.callbacks&&z.callbacks.forEach(function($){ze(t[$])&&(t[$]({trigger:$,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push($))}),z.singleFunction){var V=z.singleFunction,te=z.direction;ze(t[V])&&t[V]({trigger:V,direction:te,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(V)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function Is(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function rb(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Yd(){return Math.round(Is()+rb())}function Xd(){if(!Ce)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function vn(t,e){return Math.round(t/e*100)}var sc="Event",Qd=sc+"Listener";function nb(t){return function(e,r,n,a){var i=n||gs,o=a||!1;if(!Ce)return i;var s=On(r),u=On(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+sc);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Qd:"remove"+Qd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?ab(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function On(t,e){if(Tt(t))return e?On(document.querySelectorAll(t)):(r=t).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(t)){for(var n=[],a=t.length>>>0;a--;)n[a]=t[a];return n}var i=lw(t);return e?i.map(function(o){return Tt(o)?On(o,!0):o}).flat():i}function ab(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var is=nb(sc);function hp(t,e){return Ce&&ze(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),ze(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}hp.bind(null,"onerror");hp.bind(null,"onload");var vp=typeof window>"u",eh="hidden";function ib(t){if(vp)return!1;var e=ob(),r="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return t(!!document[e])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function ob(){var t=["webkit","moz","ms","o"];return vp||eh in document?eh:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var sb=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function cb(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=ib(function(s){s||r({type:"tabVisible"})});return n=[o].concat(sb.map(function(s){return is(document,s,r)})).concat(is(window,"load",r)).concat(is(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function ub(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(g){d(),i&&!c&&i(Mr(h),g),a&&c&&(c=!1,a(Mr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Mr(h),g))},s)}var p=cb(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=p();return function(){return f=!1,h=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Mr(h,f),idle:c?Mr(r,f):0}}}}function Mr(t,e){return e?0:Math.round((new Date-t)/1e3)}const th=5e3;class lb{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(e){this.element=e.element,this.viewCallback=e.viewCallback,this.activeDurationCallback=e.activeDurationCallback,this.idleDurationCallback=e.idleDurationCallback,this.scrollCallback=e.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),ub({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:th}),tb({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(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*th:Date.now(),this.isInViewport&&this.trackAwake(e,r)}handleScroll(e){this.scrollCallback&&this.scrollCallback(e)}handleVisibilityChange(){this.isAwake=!1;const e=Math.round((Date.now()-this.lastEventAt)/1e3);e>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,e))}trackAwake(e,r){!e&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),e&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function pp(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function fb(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.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)}}}const rh="sesamy_session_id";function db(){let t=sessionStorage.getItem(rh);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(rh,t)),t}let mp=!1,wn,Cn,Ps;function gp(t){return JSON.stringify(t.map(e=>{const{campaign:r,...n}=e.properties||{};return{anonymousId:e.anonymousId,userId:e.userId,type:e.type,properties:n,clientId:Ps,requestId:Math.random().toString(36).slice(2,9),sessionId:db(),timestamp:new Date().toISOString(),version:Wn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:Kt("sesamy:item-src"),publisherContentId:Kt("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Xs,userAgent:navigator.userAgent,clientId:Ps}}}))}const yp=fb(async t=>{if(t.length>0){const e=gp(t);mp?navigator.sendBeacon(Cn,e):(await fetch(Cn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function os(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Cn,gp([e]))}else yp.push(t)}function hb(){return mp=!0,yp.flush()}function vb(t,e,r){wn=e,Cn=`${ot("logs",r)}/events`,Ps=t}const pb={name:"custom-analytics-plugin",page:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;os({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;os({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n}=t;os({anonymousId:r,userId:n,properties:e,type:"identify"})}},nh=["source","medium","campaign","term","content"],kt="utm_",mb=1800*1e3;function wp(t){return t?Date.now()-parseInt(t,10)>mb:!0}function ah(){const t=document.referrer||"";if(!t)return;const e=Wt(`${kt}set_at`);(wp(e)||!Wt(`${kt}referrer`))&&Rn(`${kt}referrer`,t)}function gb(){const t=()=>{const r={};for(const a of nh){const i=Wt(`${kt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Wt(`${kt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){ah()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${kt}set_at`);if(Object.keys(n).length>0&&wp(a)){for(const o of nh){const s=n[o];s&&Rn(`${kt}${o}`,s)}Rn(`${kt}set_at`,String(Date.now()))}ah()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const yb=gb(),ih=new Map,oh=new Map;function wb({clientId:t,enabled:e=!0,environment:r}){vb(t,e,r),e&&(window.addEventListener("beforeunload",()=>{oh.forEach((n,a)=>{n.bind(a)()}),hb()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&ih.forEach((n,a)=>{n.bind(a)()})}),eb(),pp(()=>{const n=new lb({element:document.body,viewCallback:()=>{dt.page()},activeDurationCallback:(a,i,o)=>{dt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{dt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{dt.track("scroll",{scroll:a.scrollMax})}});oh.set(document.body,()=>{n.flush()}),ih.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Be.AUTHENTICATED,async n=>{const a=n;await dt.identify(a.detail.sub)}),window.addEventListener(Be.LOGOUT,async()=>{await dt.track("logout",{}),await dt.reset()}))}const dt=Zw({app:Xs,version:Wn,plugins:[yb,pb]});function bp(t,e){dt.track(t,e)}const bb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function Sb(){return new Promise(t=>{const e=bb.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function Ib(){const t=navigator.userAgent.toLowerCase(),e=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of e)if(r.regex.test(t))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(t)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function Pb(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});bp(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function Eb(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function kb(t){const{autoOnboardProduct:e,bills:r,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:l,getFulfillments:c,getProfile:f,getProxyContent:h,getSubscriptions:d,getTags:v,getTally:p,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:j,pushTally:z,requestDelivery:V,setTag:te,transactions:$,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=zy(t),q=()=>A.list(),F={analytics:{track:bp},attribution:{get:En,set:$v},auth:{getUser:f,getTokenSilently:jt,isAuthenticated:vr,loginWithRedirect:Gn,loginWithPopup:Tv,login:Bg,logout:Js,setToken:vs},bills:r,browser:{detectAdblock:Sb,isInAppBrowser:Ib,isIncognito:Gs},checkouts:n,clearCache:vt,content:{list:Hv,get:an,getLanguage:Br,hasAccess:Ky,unlock:Bv,getPropertyFromHTML:ec},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:Ys},events:{emit:Pb,cancel:Eb},flags:{get:xv,set:Nv,list:nn,delete:Dv},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:_b,isReady:()=>exports.isInitialized,log:ce,paywalls:R,paymentIssues:A,products:{...j,autoOnboard:e,linkSpotify:m},profile:{get:f,isSpotifyLinked:y,openHostedAccountPage:b,unlinkSpotify:M,update:N},proxy:{getContent:h},subscriptions:{list:d},tags:{delete:i,list:v,set:te},tallies:{delete:o,get:p,list:g,push:z},transactions:{...$,get:P},userMetadata:S,vendor:O,setToken:vs};return t.namespace&&(window[t.namespace]=F),F}function _b(){return Wn}function Tb(t,e){t.style.position="relative",t.style.height="200px",t.style.overflow="hidden";let n=0;const a=Array.from(t.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
37
37
|
${e.selector}::before {
|
|
38
38
|
content: '';
|
|
39
39
|
position: absolute;
|
|
@@ -44,4 +44,4 @@ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw
|
|
|
44
44
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
45
45
|
pointer-events: none;
|
|
46
46
|
}
|
|
47
|
-
`,document.head.appendChild(i)}async function
|
|
47
|
+
`,document.head.appendChild(i)}async function Rb(t){try{const e=await fetch(t);return e.ok?await e.text():(console.error(`Failed to fetch content from ${t}: ${e.statusText}`),null)}catch(e){return console.error(`Error fetching content from ${t}:`,e),null}}async function cc(t){if(t.contentType==="selector"&&t.content){const e=document.querySelector(t.content);if(e)return e.innerHTML;console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const e=await Rb(t.content);if(e)return e;console.warn(`Failed to fetch content from URL '${t.content}'`)}else if(t.content)return t.content;return""}async function Ob(t,e){const r=e.insertionPoint||"inside",n=await cc(e);switch(r){case"before":t.insertAdjacentHTML("beforebegin",n);break;case"after":t.insertAdjacentHTML("afterend",n);break;case"inside":default:t.innerHTML+=n;break}}async function Cb(t,e){const r=await cc(e);t.innerHTML=r}async function Ab(t,e){const r=await cc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Ub({enabled:t=!1,rules:e}){t&&pp(async()=>{const r=await vr(),n=window.location.href;for(const a of e){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await Ob(s,a);break;case"replace":await Cb(s,a);break;case"remove":o.remove();break;case"wrap":await Ab(s,a);break;case"gradient":Tb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const sh="access_token";function Lb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(sh);if(e){vs(e);const r=new URL(window.location.href);t.delete(sh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const ch="sesamy-refresh",uh="force-refetch-entitlements";function $b(){const t=new URLSearchParams(window.location.search),e=t.get(uh),r=t.get(ch);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(uh),t.delete(ch),n.search=t.toString(),vt(),window.history.replaceState(null,"",n)}}function qb(t){if(!t||typeof t!="string")throw new Error("Invalid token: token must be a non-empty string");const e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT format: token must have exactly 3 parts separated by dots");const[,r]=e;if(!r)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(r)}catch{throw new Error("Invalid JWT format: payload is not valid base64")}try{return JSON.parse(n)}catch{throw new Error("Invalid JWT format: payload is not valid JSON")}}function jb(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=qb(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOption:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",hasAccess:!0,expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};Ly(i)}catch(n){ce(`Failed to extract signed link ${n}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const lh="sesamy-user";async function Nb(){const e=new URLSearchParams(window.location.search).get(lh)?.toLowerCase();if(!e)return;const r=await Hg();r?.email!==e?(ce(`Current user does not match sesamy user: ${r?.email} !== ${e}`),vt(),Gn({authorizationParams:{login_hint:e}})):ce(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(lh),window.history.replaceState(null,"",n)}const fh="sesamy-purchase";function xb(){const t=new URLSearchParams(window.location.search),e=t.get(fh);if(e!==null){const r=new URL(window.location.href);t.delete(fh),r.search=t.toString(),ce(`Purchase ${e}`),Vt(Be.PURCHASE,{itemSrc:e}),vt(),window.history.replaceState(null,"",r)}}const dh="sesamy-login",Db="sesamy_login";async function Mb(){const t=new URLSearchParams(window.location.search);if(!(t.get(dh)||t.get(Db)))return;await vr()||Gn();const n=new URL(window.location.href);n.searchParams.delete(dh),window.history.replaceState(null,"",n)}const hh="sesamy-debug";async function Fb(){const e=new URLSearchParams(window.location.search).get(hh)?.toLowerCase();if(!e)return;Mm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(hh),window.history.replaceState(null,"",r)}function Kb(){if(!document.referrer.length)return;const t=new URL(document.referrer);if(!(t.hostname===window.location.hostname||t.hostname.includes("sesamy")))return document.referrer}async function zb(t){if(!Vr())return;const e=new URLSearchParams(window.location.search),r={utmSource:e.get("utm_source")??void 0,utmMedium:e.get("utm_medium")??void 0,utmCampaign:e.get("utm_campaign")??void 0,utmTerm:e.get("utm_term")??void 0,utmContent:e.get("utm_content")??void 0,ref:e.get("ref")??void 0,referrer:Kb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),$v(r)}function Hb(){const t=new URLSearchParams(window.location.search);let e=!1;try{e=!!window.opener&&window.opener.location.origin===window.location.origin}catch{e=!1}const r=sessionStorage.getItem(yd)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(yd,"true"),n||(ce("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Bb(t){const e=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},r=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",e(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};r('[sesamy-link="login"]',()=>t.auth.loginWithRedirect()),r('[sesamy-link="logout"]',()=>t.auth.logout());const n=await t.generateLink({target:"account"});n&&r('[sesamy-link="account"]',()=>{window.location.href=n})}async function Gb(t){const e=await t.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${e?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${e?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(r){console.error("Error handling visibility:",r)}}async function Wb(t){const e=Kt("sesamy:locked-content-redirect-url");if(!e)return;const[r]=t.content.list();if(!r)return;await t.entitlements.hasAccess(r.url||"",r.pass?.split(",")||[])||(location.href=e)}exports.isInitialized=!1;async function vh(t,e){ce(`Init with config: ${JSON.stringify(t)}`);try{Hb(),wb({clientId:t.clientId,environment:t.environment,...t.analytics}),await zg({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),My(t,e),t.transform&&await Ub(t.transform),qg(),Fb(),zb(e),Lb(),$b(),jb(),await Mb(),await Nb(),xb(),await Gb(e),await Bb(e),await Wb(e),exports.isInitialized=!0,Vt(Be.READY,{})}catch(r){ce(`Failed to init ${r.message}`)}}async function Sp(t){ce("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Vr()&&e in window)return ce("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=kb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Vr()?(t.awaitAllServices?await vh(t,r):vh(t,r),r):(exports.isInitialized=!0,r)}if(Vr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);Sp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Be;exports.getContentConfig=Dy;exports.init=Sp;
|