@sesamy/sesamy-js 1.70.0 → 1.72.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 +1 -1
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +4516 -4503
- 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={},ia,mc;function Ae(){return mc||(mc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,gc;function Un(){if(gc)return oa;gc=1;var t=Ae();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,yc;function pe(){if(yc)return sa;yc=1;var t=Un(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return sa=t?n:function(a){return function(){return r.apply(a,arguments)}},sa}var ca,wc;function $n(){if(wc)return ca;wc=1;var t=pe(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,bc;function hh(){if(bc)return ua;bc=1;var t=pe(),e=Ae(),r=$n(),n=Object,a=t("".split);return ua=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ua}var la,Sc;function Ln(){return Sc||(Sc=1,la=function(t){return t==null}),la}var fa,Ic;function qn(){if(Ic)return fa;Ic=1;var t=Ln(),e=TypeError;return fa=function(r){if(t(r))throw new e("Can't call method on "+r);return r},fa}var da,Pc;function Yr(){if(Pc)return da;Pc=1;var t=hh(),e=qn();return da=function(r){return t(e(r))},da}var $r,Ec;function me(){if(Ec)return $r;Ec=1;var t=function(e){return e&&e.Math===Math&&e};return $r=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof vc=="object"&&vc)||t(typeof $r=="object"&&$r)||(function(){return this})()||Function("return this")(),$r}var ha={exports:{}},va,kc;function ut(){return kc||(kc=1,va=!1),va}var pa,_c;function Es(){if(_c)return pa;_c=1;var t=me(),e=Object.defineProperty;return pa=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},pa}var Tc;function ks(){if(Tc)return ha.exports;Tc=1;var t=ut(),e=me(),r=Es(),n="__core-js_shared__",a=ha.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"}),ha.exports}var ma,Rc;function vh(){if(Rc)return ma;Rc=1;var t=ks();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Oc;function jn(){if(Oc)return ga;Oc=1;var t=qn(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,Cc;function Je(){if(Cc)return ya;Cc=1;var t=pe(),e=jn(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Ac;function ph(){if(Ac)return wa;Ac=1;var t=pe(),e=0,r=Math.random(),n=t(1.1.toString);return wa=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},wa}var ba,Uc;function Xr(){if(Uc)return ba;Uc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,$c;function mh(){if($c)return Sa;$c=1;var t=me(),e=Xr(),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]))),Sa=s,Sa}var Ia,Lc;function gh(){if(Lc)return Ia;Lc=1;var t=mh(),e=Ae(),r=me(),n=r.String;return Ia=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Ia}var Pa,qc;function yh(){if(qc)return Pa;qc=1;var t=gh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,jc;function Ue(){if(jc)return Ea;jc=1;var t=me(),e=vh(),r=Je(),n=ph(),a=gh(),i=yh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Ea=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Ea}var ka,Nc;function we(){if(Nc)return ka;Nc=1;var t=typeof document=="object"&&document.all;return ka=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},ka}var _a,xc;function Ze(){if(xc)return _a;xc=1;var t=we();return _a=function(e){return typeof e=="object"?e!==null:t(e)},_a}var Ta,Dc;function rt(){if(Dc)return Ta;Dc=1;var t=Ze(),e=String,r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ta}var Ra={},Oa,Mc;function $e(){if(Mc)return Oa;Mc=1;var t=Ae();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Fc;function wh(){if(Fc)return Ca;Fc=1;var t=$e(),e=Ae();return Ca=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ca}var Aa={},Ua,Kc;function Nn(){if(Kc)return Ua;Kc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Ua=function(a){return n?r.createElement(a):{}},Ua}var $a,zc;function bh(){if(zc)return $a;zc=1;var t=$e(),e=Ae(),r=Nn();return $a=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),$a}var La,Hc;function je(){if(Hc)return La;Hc=1;var t=Un(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var qa,Bc;function Ye(){if(Bc)return qa;Bc=1;var t=me(),e=we(),r=function(n){return e(n)?n:void 0};return qa=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},qa}var ja,Gc;function xn(){if(Gc)return ja;Gc=1;var t=pe();return ja=t({}.isPrototypeOf),ja}var Na,Wc;function Sh(){if(Wc)return Na;Wc=1;var t=Ye(),e=we(),r=xn(),n=yh(),a=Object;return Na=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},Na}var xa,Vc;function Dn(){if(Vc)return xa;Vc=1;var t=String;return xa=function(e){try{return t(e)}catch{return"Object"}},xa}var Da,Jc;function nt(){if(Jc)return Da;Jc=1;var t=we(),e=Dn(),r=TypeError;return Da=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Da}var Ma,Zc;function _s(){if(Zc)return Ma;Zc=1;var t=nt(),e=Ln();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,Yc;function Sp(){if(Yc)return Fa;Yc=1;var t=je(),e=we(),r=Ze(),n=TypeError;return Fa=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")},Fa}var Ka,Xc;function Ip(){if(Xc)return Ka;Xc=1;var t=je(),e=Ze(),r=Sh(),n=_s(),a=Sp(),i=Ue(),o=TypeError,s=i("toPrimitive");return Ka=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)},Ka}var za,Qc;function Ih(){if(Qc)return za;Qc=1;var t=Ip(),e=Sh();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var eu;function yt(){if(eu)return Aa;eu=1;var t=$e(),e=bh(),r=wh(),n=rt(),a=Ih(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Aa.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},Aa}var Ha,tu;function Pp(){if(tu)return Ha;tu=1;var t=Math.ceil,e=Math.floor;return Ha=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ha}var Ba,ru;function Ts(){if(ru)return Ba;ru=1;var t=Pp();return Ba=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ba}var Ga,nu;function Ph(){if(nu)return Ga;nu=1;var t=Ts(),e=Math.max,r=Math.min;return Ga=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ga}var Wa,au;function Ep(){if(au)return Wa;au=1;var t=Ts(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,iu;function Rs(){if(iu)return Va;iu=1;var t=Ep();return Va=function(e){return t(e.length)},Va}var Ja,ou;function kp(){if(ou)return Ja;ou=1;var t=Yr(),e=Ph(),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 Ja={includes:n(!0),indexOf:n(!1)},Ja}var Za,su;function Os(){return su||(su=1,Za={}),Za}var Ya,cu;function Eh(){if(cu)return Ya;cu=1;var t=pe(),e=Je(),r=Yr(),n=kp().indexOf,a=Os(),i=t([].push);return Ya=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},Ya}var Xa,uu;function Cs(){return uu||(uu=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,lu;function kh(){if(lu)return Qa;lu=1;var t=Eh(),e=Cs();return Qa=Object.keys||function(n){return t(n,e)},Qa}var fu;function _p(){if(fu)return Ra;fu=1;var t=$e(),e=wh(),r=yt(),n=rt(),a=Yr(),i=kh();return Ra.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},Ra}var ei,du;function _h(){if(du)return ei;du=1;var t=Ye();return ei=t("document","documentElement"),ei}var ti,hu;function As(){if(hu)return ti;hu=1;var t=vh(),e=ph(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,vu;function Qr(){if(vu)return ri;vu=1;var t=rt(),e=_p(),r=Cs(),n=Os(),a=_h(),i=Nn(),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,ri=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)},ri}var ni,pu;function Tp(){if(pu)return ni;pu=1;var t=Ue(),e=Qr(),r=yt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ni=function(i){a[n][i]=!0},ni}var ai,mu;function en(){return mu||(mu=1,ai={}),ai}var ii,gu;function Rp(){if(gu)return ii;gu=1;var t=me(),e=we(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,yu;function Yt(){return yu||(yu=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,wu;function Xt(){if(wu)return si;wu=1;var t=$e(),e=yt(),r=Yt();return si=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},si}var ci,bu;function Er(){if(bu)return ci;bu=1;var t=Rp(),e=me(),r=Ze(),n=Xt(),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 ci={set:f,get:h,has:d,enforce:v,getterFor:p},ci}var ui={},li={},Su;function Th(){if(Su)return li;Su=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return li.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,li}var Iu;function Rh(){if(Iu)return ui;Iu=1;var t=$e(),e=je(),r=Th(),n=Yt(),a=Yr(),i=Ih(),o=Je(),s=bh(),u=Object.getOwnPropertyDescriptor;return ui.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])},ui}var fi={exports:{}},di,Pu;function Oh(){if(Pu)return di;Pu=1;var t=$e(),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 di={EXISTS:a,PROPER:i,CONFIGURABLE:o},di}var hi,Eu;function Us(){if(Eu)return hi;Eu=1;var t=pe(),e=we(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var ku;function Ch(){if(ku)return fi.exports;ku=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=$e(),i=Oh().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=fi.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"),fi.exports}var vi,_u;function Xe(){if(_u)return vi;_u=1;var t=we(),e=yt(),r=Ch(),n=Es();return vi=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},vi}var pi={},Tu;function Op(){if(Tu)return pi;Tu=1;var t=Eh(),e=Cs(),r=e.concat("length","prototype");return pi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},pi}var mi={},Ru;function Ah(){return Ru||(Ru=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Ou;function Cp(){if(Ou)return gi;Ou=1;var t=Ye(),e=pe(),r=Op(),n=Ah(),a=rt(),i=e([].concat);return gi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},gi}var yi,Cu;function Uh(){if(Cu)return yi;Cu=1;var t=Je(),e=Cp(),r=Rh(),n=yt();return yi=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))}},yi}var wi,Au;function $h(){if(Au)return wi;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 wi=n,wi}var bi,Uu;function Ie(){if(Uu)return bi;Uu=1;var t=me(),e=Rh().f,r=Xt(),n=Xe(),a=Es(),i=Uh(),o=$h();return bi=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)}},bi}var Si,$u;function Ap(){if($u)return Si;$u=1;var t=Ae();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,Lu;function $s(){if(Lu)return Ii;Lu=1;var t=Je(),e=we(),r=jn(),n=As(),a=Ap(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Ii=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},Ii}var Pi,qu;function Lh(){if(qu)return Pi;qu=1;var t=Ae(),e=we(),r=Ze(),n=Qr(),a=$s(),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}),Pi={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Pi}var Ei,ju;function kr(){if(ju)return Ei;ju=1;var t=yt().f,e=Je(),r=Ue(),n=r("toStringTag");return Ei=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Ei}var ki,Nu;function qh(){if(Nu)return ki;Nu=1;var t=Lh().IteratorPrototype,e=Qr(),r=Yt(),n=kr(),a=en(),i=function(){return this};return ki=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},ki}var _i,xu;function Up(){if(xu)return _i;xu=1;var t=pe(),e=nt();return _i=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},_i}var Ti,Du;function $p(){if(Du)return Ti;Du=1;var t=Ze();return Ti=function(e){return t(e)||e===null},Ti}var Ri,Mu;function Lp(){if(Mu)return Ri;Mu=1;var t=$p(),e=String,r=TypeError;return Ri=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ri}var Oi,Fu;function Ls(){if(Fu)return Oi;Fu=1;var t=Up(),e=Ze(),r=qn(),n=Lp();return Oi=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),Oi}var Ci,Ku;function jh(){if(Ku)return Ci;Ku=1;var t=Ie(),e=je(),r=ut(),n=Oh(),a=we(),i=qh(),o=$s(),s=Ls(),u=kr(),l=Xt(),c=Xe(),f=Ue(),h=en(),d=Lh(),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 Ci=function(A,j,z,V,te,L,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:L?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},Ci}var Ai,zu;function qs(){return zu||(zu=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,Hu;function js(){if(Hu)return Ui;Hu=1;var t=Yr(),e=Tp(),r=en(),n=Er(),a=yt().f,i=jh(),o=qs(),s=ut(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ui=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 Ui}var Bu={},Gu;function qp(){if(Gu)return Bu;Gu=1;var t=Ie(),e=pe(),r=Ph(),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 $i,Wu;function Nh(){if(Wu)return $i;Wu=1;var t=me(),e=$e(),r=Object.getOwnPropertyDescriptor;return $i=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},$i}var Li,Vu;function Mn(){if(Vu)return Li;Vu=1;var t=Ae(),e=Ue(),r=$e(),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 qi,Ju;function Fn(){if(Ju)return qi;Ju=1;var t=Ch(),e=yt();return qi=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)},qi}var ji,Zu;function jp(){if(Zu)return ji;Zu=1;var t=Xe();return ji=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},ji}var Ni,Yu;function Ns(){if(Yu)return Ni;Yu=1;var t=xn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var xi,Xu;function Np(){if(Xu)return xi;Xu=1;var t=$n(),e=pe();return xi=function(r){if(t(r)==="Function")return e(r)},xi}var Di,Qu;function _r(){if(Qu)return Di;Qu=1;var t=Np(),e=nt(),r=Un(),n=t(t.bind);return Di=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Di}var Mi,el;function xs(){if(el)return Mi;el=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,tl;function tn(){if(tl)return Fi;tl=1;var t=xs(),e=we(),r=$n(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Fi=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},Fi}var Ki,rl;function wt(){if(rl)return Ki;rl=1;var t=tn(),e=String;return Ki=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ki}var zi,nl;function Kn(){if(nl)return zi;nl=1;var t=tn(),e=_s(),r=Ln(),n=en(),a=Ue(),i=a("iterator");return zi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},zi}var Hi,al;function Ds(){if(al)return Hi;al=1;var t=je(),e=nt(),r=rt(),n=Dn(),a=Kn(),i=TypeError;return Hi=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")},Hi}var Bi,il;function Qt(){if(il)return Bi;il=1;var t=TypeError;return Bi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Bi}var Gi,ol;function zn(){if(ol)return Gi;ol=1;var t=pe();return Gi=t([].slice),Gi}var Wi,sl;function xp(){if(sl)return Wi;sl=1;var t=zn(),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 Wi=r,Wi}var Vi,cl;function xh(){if(cl)return Vi;cl=1,js(),qp();var t=Ie(),e=me(),r=Nh(),n=Ye(),a=je(),i=pe(),o=$e(),s=Mn(),u=Xe(),l=Fn(),c=jp(),f=kr(),h=qh(),d=Er(),v=Ns(),p=we(),g=Je(),P=_r(),w=tn(),y=rt(),m=Ze(),b=wt(),R=Qr(),A=Yt(),j=Ds(),z=Kn(),V=qs(),te=Qt(),L=Ue(),M=xp(),N=L("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,ce=String.fromCharCode,ae=n("String","fromCodePoint"),ke=parseInt,Ne=i("".charAt),De=i([].join),Le=i([].push),Qe=i("".replace),St=i([].shift),It=i([].splice),Rt=i("".split),Ot=i("".slice),Ar=i(/./.exec),er=/\+/g,Ct="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ot(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},At=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,er," ");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=At(se);if(he===0)ie=ce(se);else{if(he===1||he>4){W+=Ct,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;Le(ve,qe),Z+=2,be++}if(ve.length!==he){W+=Ct;continue}var at=K(ve);at===null?W+=Ct:ie=ae(at)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return ue[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)==="?"?Ot(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");Le(G,{key:b(be.value),value:b(qe.value)})}else for(var at in D)g(D,at)&&Le(G,{key:at,value:b(D[at])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Rt(D,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Rt(ie,"="),Le(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++],Le(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),Le(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&&Le(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||Le(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 tr=i(J.has),Ur=i(J.set),rr=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,tr(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?rr(arguments[1]):{})}}),p(x)){var nr=function(G){return v(this,Y),new x(G,arguments.length>1?rr(arguments[1]):{})};Y.constructor=nr,nr.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:nr})}}return Vi={URLSearchParams:Te,getState:F},Vi}var ul;function Dp(){return ul||(ul=1,xh()),pc}var ll={},fl;function Mp(){if(fl)return ll;fl=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),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 Fp(){if(hl)return dl;hl=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),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 Kp(){if(pl)return vl;pl=1;var t=$e(),e=pe(),r=Fn(),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 Ji,ml;function Hn(){if(ml)return Ji;ml=1;var t=me();return Ji=t,Ji}var Zi,gl;function Dh(){if(gl)return Zi;gl=1,Dp(),Mp(),Fp(),Kp();var t=Hn();return Zi=t.URLSearchParams,Zi}var yl={},wl={},bl={},Yi,Sl;function Mh(){if(Sl)return Yi;Sl=1;var t=pe(),e=Ts(),r=wt(),n=qn(),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 Yi={codeAt:s(!1),charAt:s(!0)},Yi}var Il;function Fh(){if(Il)return bl;Il=1;var t=Mh().charAt,e=wt(),r=Er(),n=jh(),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 Xi,Pl;function zp(){if(Pl)return Xi;Pl=1;var t=$e(),e=pe(),r=je(),n=Ae(),a=kh(),i=Ah(),o=Th(),s=jn(),u=hh(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Xi=!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,Xi}var Qi,El;function Kh(){if(El)return Qi;El=1;var t=je(),e=rt(),r=_s();return Qi=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},Qi}var eo,kl;function Hp(){if(kl)return eo;kl=1;var t=rt(),e=Kh();return eo=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},eo}var to,_l;function zh(){if(_l)return to;_l=1;var t=Ue(),e=en(),r=t("iterator"),n=Array.prototype;return to=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},to}var ro,Tl;function Hh(){if(Tl)return ro;Tl=1;var t=pe(),e=Ae(),r=we(),n=tn(),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,ro=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,ro}var no,Rl;function Bp(){if(Rl)return no;Rl=1;var t=$e(),e=yt(),r=Yt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Ol;function Gp(){if(Ol)return ao;Ol=1;var t=_r(),e=je(),r=jn(),n=Hp(),a=zh(),i=Hh(),o=Rs(),s=Bp(),u=Ds(),l=Kn(),c=Array;return ao=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},ao}var io,Cl;function Wp(){if(Cl)return io;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(L){for(var M=[],N=0,S=L.length;N<S;){var O=w(L,N++);if(O>=55296&&O<=56319&&N<S){var q=w(L,N++);(q&64512)===56320?m(M,((O&1023)<<10)+(q&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function(L){return L+22+75*(L<26)},V=function(L,M,N){var S=0;for(L=N?g(L/o):L>>1,L+=g(L/M);L>d*a>>1;)L=g(L/d),S+=r;return g(S+(d+1)*L/(L+i))},te=function(L){var M=[];L=j(L);var N=L.length,S=u,O=0,q=s,F,I;for(F=0;F<L.length;F++)I=L[F],I<128&&m(M,P(I));var _=M.length,x=_;for(_&&m(M,l);x<N;){var H=e;for(F=0;F<L.length;F++)I=L[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<L.length;F++){if(I=L[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 ce=J-ne,ae=r-ne;m(M,P(z(ne+ce%ae))),J=g(ce/ae),fe+=r}m(M,P(z(J))),q=V(O,Y,x===_),O=0,x++}}O++,S++}return y(M,"")};return io=function(L){var M=[],N=R(b(A(L),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,".")},io}var Al;function Vp(){if(Al)return wl;Al=1,Fh();var t=Ie(),e=$e(),r=Mn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Fn(),u=Ns(),l=Je(),c=zp(),f=Gp(),h=zn(),d=Mh().codeAt,v=Wp(),p=wt(),g=kr(),P=Qt(),w=xh(),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,L=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",ce="Invalid host",ae="Invalid port",ke=/[a-z]/i,Ne=/[\d+-.a-z]/i,De=/\d/,Le=/^0x/i,Qe=/^[0-7]+$/,St=/^\d+$/,It=/^[\da-f]+$/i,Rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ot=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,er=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ct=/[\t\n\r]/g,ge,et=function(k){var $=x(k,"."),T,E,C,re,B,ye,Se;if($.length&&$[$.length-1]===""&&$.length--,T=$.length,T>4)return k;for(E=[],C=0;C<T;C++){if(re=$[C],re==="")return k;if(B=10,re.length>1&&M(re,0)==="0"&&(B=N(Le,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>=L(256,5-T))return null}else if(ye>255)return null;for(Se=q(E),C=0;C<E.length;C++)Se+=E[C]*L(256,3-C);return Se},At=function(k){var $=[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++}$[T]=$[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;$[T++]=re}if(E!==null)for(Ve=T-E,T=7;T!==0&&Ve>0;)U=$[T],$[T--]=$[E+Ve-1],$[E+--Ve]=U;else if(T!==8)return;return $},K=function(k){for(var $=null,T=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>T&&($=E,T=C),E=null,C=0):(E===null&&(E=re),++C);return C>T?E:$},X=function(k){var $,T,E,C;if(typeof k=="number"){for($=[],T=0;T<4;T++)J($,k%256),k=te(k/256);return S($,".")}if(typeof k=="object"){for($="",E=K(k),T=0;T<8;T++)C&&k[T]===0||(C&&(C=!1),E===T?($+=T?":":"::",C=!0):($+=O(k[T],16),T<7&&($+=":")));return"["+$+"]"}return k},oe={},ue=c({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},ue,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),_e=function(k,$){var T=d(k,0);return T>32&&T<127&&!l($,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Te=function(k,$){var T;return k.length===2&&N(ke,M(k,0))&&((T=M(k,1))===":"||!$&&T==="|")},Ge=function(k){var $;return k.length>1&&Te(H(k,0,2))&&(k.length===2||($=M(k,2))==="/"||$==="\\"||$==="?"||$==="#")},tr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},rr={},nr={},D={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},at={},ea={},cc={},ta={},ar={},it={},uc={},Ut={},lt={},ra=function(k,$,T){var E=p(k),C,re,B;if($){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(T!==void 0&&(C=new ra(T,!0)),re=this.parse(E,null,C),re)throw new z(re);B=A(new R),B.bindURL(this),this.searchParams=B}};ra.prototype={type:"URL",parse:function(k,$,T){var E=this,C=$||rr,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=p(k),$||(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,er,"$1")),k=I(k,Ct,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case rr:if(U&&N(ke,U))B+=Y(U),C=nr;else{if($)return ne;C=D;continue}break;case nr:if(U&&(N(Ne,U)||U==="+"||U==="-"||U==="."))B+=Y(U);else if(U===":"){if($&&(E.isSpecial()!==l(Me,B)||B==="file"&&(E.includesCredentials()||E.port!==null)||E.scheme==="file"&&!E.host))return;if(E.scheme=B,$){E.isSpecial()&&Me[E.scheme]===E.port&&(E.port=null);return}B="",E.scheme==="file"?C=ea: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($)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"?ea: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=Ut;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 na=0;na<Pe.length;na++){var dc=Pe[na];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($&&E.scheme==="file"){C=ta;continue}else if(U===":"&&!Se){if(B==="")return ce;if(ft=E.parseHost(B),ft)return ft;if(B="",C=at,$===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ce;if($&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=ar,$)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()||$){if(B!==""){var aa=V(B,10);if(aa>65535)return ae;E.port=E.isSpecial()&&aa===Me[E.scheme]?null:aa,B=""}if($)return;C=ar;continue}else return ae;break;case ea: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=Ut;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=ta;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 ta:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&Te(B))C=it;else if(B===""){if(E.host="",$)return;C=ar}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),$)return;B="",C=ar}continue}else B+=U;break;case ar:if(E.isSpecial()){if(C=it,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")E.query="",C=Ut;else if(!$&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=it,U!=="/"))continue;break;case it:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!$&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):tr(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=Ut):U==="#"&&(E.fragment="",C=lt)}else B+=_e(U,de);break;case uc:U==="?"?(E.query="",C=Ut):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=_e(U,oe));break;case Ut:!$&&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,ue));break}re++}},parseHost:function(k){var $,T,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||($=At(H(k,1,-1)),!$))return ce;this.host=$}else if(this.isSpecial()){if(k=v(k),N(Rt,k)||($=et(k),$===null))return ce;this.host=$}else{if(N(Ot,k))return ce;for($="",T=f(k),E=0;E<T.length;E++)$+=_e(T[E],oe);this.host=$}},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,$=k.length;$&&(this.scheme!=="file"||$!==1||!Te(k[0],!0))&&k.length--},serialize:function(){var k=this,$=k.scheme,T=k.username,E=k.password,C=k.host,re=k.port,B=k.path,ye=k.query,Se=k.fragment,Re=$+":";return C!==null?(Re+="//",k.includesCredentials()&&(Re+=T+(E?":"+E:"")+"@"),Re+=X(C),re!==null&&(Re+=":"+re)):$==="file"&&(Re+="//"),Re+=k.cannotBeABaseURL?B[0]:B.length?"/"+S(B,"/"):"",ye!==null&&(Re+="?"+ye),Se!==null&&(Re+="#"+Se),Re},setHref:function(k){var $=this.parse(k);if($)throw new z($);this.searchParams.update()},getOrigin:function(){var k=this.scheme,$=this.port;if(k==="blob")try{return new ir(k.path[0]).origin}catch{return"null"}return k==="file"||!this.isSpecial()?"null":k+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(k){this.parse(p(k)+":",rr)},getUsername:function(){return this.username},setUsername:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var T=0;T<$.length;T++)this.username+=_e($[T],He)}},getPassword:function(){return this.password},setPassword:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var T=0;T<$.length;T++)this.password+=_e($[T],He)}},getHost:function(){var k=this.host,$=this.port;return k===null?"":$===null?X(k):X(k)+":"+$},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,ar))},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,Ut)),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 ir=function($){var T=u(this,xe),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(T,new ra($,!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=ir.prototype,We=function(k,$){return{get:function(){return b(this)[k]()},set:$&&function(T){return b(this)[$](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(ir,"createObjectURL",a(lc,j)),fc&&o(ir,"revokeObjectURL",a(fc,j))}return g(ir,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:ir}),wl}var Ul;function Jp(){return Ul||(Ul=1,Vp()),yl}var $l={},Ll;function Zp(){if(Ll)return $l;Ll=1;var t=Ie(),e=Ye(),r=Ae(),n=Qt(),a=wt(),i=Mn(),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 ql={},jl;function Yp(){if(jl)return ql;jl=1;var t=Ie(),e=Ye(),r=Qt(),n=wt(),a=Mn(),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 Xp(){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 oo,Dl;function Qp(){if(Dl)return oo;Dl=1,Dh(),Jp(),Zp(),Yp(),Xp();var t=Hn();return oo=t.URL,oo}var so,Ml;function em(){if(Ml)return so;Ml=1;var t=Qp();return so=t,so}var co,Fl;function tm(){if(Fl)return co;Fl=1;var t=em();return co=t,co}tm();var Kl={},uo,zl;function rm(){return zl||(zl=1,uo={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}),uo}var lo,Hl;function nm(){if(Hl)return lo;Hl=1;var t=Nn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return lo=r===Object.prototype?void 0:r,lo}var Bl;function Bh(){if(Bl)return Kl;Bl=1;var t=me(),e=rm(),r=nm(),n=js(),a=Xt(),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 fo,Gl;function am(){if(Gl)return fo;Gl=1;var t=Dh();return Bh(),fo=t,fo}var ho,Wl;function im(){if(Wl)return ho;Wl=1;var t=am();return ho=t,ho}im();var Vl={},Jl={},vo,Zl;function om(){if(Zl)return vo;Zl=1;var t=Ze(),e=Xt();return vo=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},vo}var po,Yl;function sm(){if(Yl)return po;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 po=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},po}var mo,Xl;function cm(){if(Xl)return mo;Xl=1;var t=Ae(),e=Yt();return mo=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),mo}var go,Ql;function um(){if(Ql)return go;Ql=1;var t=Xt(),e=sm(),r=cm(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,ef;function rn(){if(ef)return yo;ef=1;var t=_r(),e=je(),r=rt(),n=Dn(),a=zh(),i=Rs(),o=xn(),s=Ds(),u=Kn(),l=Kh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return yo=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,L,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;!(L=e(te,R)).done;){try{V=N(L.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},yo}var wo,tf;function lm(){if(tf)return wo;tf=1;var t=wt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var rf;function fm(){if(rf)return Jl;rf=1;var t=Ie(),e=xn(),r=$s(),n=Ls(),a=Uh(),i=Qr(),o=Xt(),s=Yt(),u=om(),l=um(),c=rn(),f=lm(),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 dm(){return nf||(nf=1,fm()),Vl}var af={},bo,of;function hm(){if(of)return bo;of=1;var t=xs(),e=tn();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var sf;function vm(){if(sf)return af;sf=1;var t=xs(),e=Xe(),r=hm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),af}var cf={},uf={},So,lf;function Gh(){if(lf)return So;lf=1;var t=me(),e=Xr(),r=$n(),n=function(a){return e.slice(0,a.length)===a};return So=(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"})(),So}var Io,ff;function Ms(){if(ff)return Io;ff=1;var t=Gh();return Io=t==="NODE",Io}var Po,df;function pm(){if(df)return Po;df=1;var t=Ye(),e=Fn(),r=Ue(),n=$e(),a=r("species");return Po=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Po}var Eo,hf;function mm(){if(hf)return Eo;hf=1;var t=Hh(),e=Dn(),r=TypeError;return Eo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Eo}var ko,vf;function Wh(){if(vf)return ko;vf=1;var t=rt(),e=mm(),r=Ln(),n=Ue(),a=n("species");return ko=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},ko}var _o,pf;function Vh(){if(pf)return _o;pf=1;var t=Un(),e=Function.prototype,r=e.apply,n=e.call;return _o=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),_o}var To,mf;function Jh(){if(mf)return To;mf=1;var t=Xr();return To=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),To}var Ro,gf;function Zh(){if(gf)return Ro;gf=1;var t=me(),e=Vh(),r=_r(),n=we(),a=Je(),i=Ae(),o=_h(),s=zn(),u=Nn(),l=Qt(),c=Jh(),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)}},L=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=L,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",L,!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)}),Ro={set:h,clear:d},Ro}var Oo,yf;function Yh(){if(yf)return Oo;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}}},Oo=t,Oo}var Co,wf;function gm(){if(wf)return Co;wf=1;var t=Xr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,bf;function ym(){if(bf)return Ao;bf=1;var t=Xr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,Sf;function wm(){if(Sf)return Uo;Sf=1;var t=me(),e=Nh(),r=_r(),n=Zh().set,a=Yh(),i=Jh(),o=gm(),s=ym(),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 Uo=d,Uo}var $o,If;function bm(){return If||(If=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}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 qo,Ef;function Rr(){if(Ef)return qo;Ef=1;var t=me();return qo=t.Promise,qo}var jo,kf;function nn(){if(kf)return jo;kf=1;var t=me(),e=Rr(),r=we(),n=$h(),a=Us(),i=Ue(),o=Gh(),s=ut(),u=mh(),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 jo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},jo}var No={},_f;function bt(){if(_f)return No;_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 No.f=function(n){return new r(n)},No}var Tf;function Sm(){if(Tf)return uf;Tf=1;var t=Ie(),e=ut(),r=Ms(),n=me(),a=Hn(),i=je(),o=Xe(),s=Ls(),u=kr(),l=pm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Wh(),p=Zh().set,g=wm(),P=bm(),w=Tr(),y=Yh(),m=Er(),b=Rr(),R=nn(),A=bt(),j="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,L=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,ce=2,ae=1,ke=2,Ne,De,Le,Qe,St=function(K){var X;return h(K)&&f(X=K.then)?X:!1},It=function(K,X){var oe=X.value,ue=X.state===ne,de=ue?K.ok:K.fail,He=K.resolve,_e=K.reject,Me=K.domain,Te,Ge,tr;try{de?(ue||(X.rejection===ke&&Ct(X),X.rejection=ae),de===!0?Te=oe:(Me&&Me.enter(),Te=de(oe),Me&&(Me.exit(),tr=!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&&!tr&&Me.exit(),_e(Ur)}},Rt=function(K,X){K.notified||(K.notified=!0,g(function(){for(var oe=K.reactions,ue;ue=oe.get();)It(ue,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ot=function(K,X,oe){var ue,de;H?(ue=F.createEvent("Event"),ue.promise=X,ue.reason=oe,ue.initEvent(K,!1,!0),n.dispatchEvent(ue)):ue={promise:X,reason:oe},!V&&(de=n["on"+K])?de(ue):K===Y&&P("Unhandled promise rejection",oe)},Ar=function(K){i(p,n,function(){var X=K.facade,oe=K.value,ue=er(K),de;if(ue&&(de=w(function(){r?I.emit("unhandledRejection",oe,X):Ot(Y,X,oe)}),K.rejection=r||er(K)?ke:ae,de.error))throw de.value})},er=function(K){return K.rejection!==ae&&!K.parent},Ct=function(K){i(p,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ot(J,X,K.value)})},ge=function(K,X,oe){return function(ue){K(X,ue,oe)}},et=function(K,X,oe){K.done||(K.done=!0,oe&&(K=oe),K.value=X,K.state=ce,Rt(K,!0))},At=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 ue=St(X);ue?g(function(){var de={done:!1};try{i(ue,X,ge(At,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Rt(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var oe=L(this);try{X(ge(At,oe),ge(et,oe))}catch(ue){et(oe,ue)}},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 ue=L(this),de=_(v(this,S));return ue.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?I.domain:void 0,ue.state===fe?ue.reactions.add(de):g(function(){It(de,ue)}),de.promise}),De=function(){var K=new Ne,X=L(K);this.promise=K,this.resolve=ge(At,X),this.reject=ge(et,X)},A.f=_=function(K){return K===S||K===Le?new De(K):x(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,oe){var ue=this;return new S(function(de,He){i(Qe,ue,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}),Le=a.Promise,u(S,j,!1,!0),l(j),uf}var Rf={},xo,Of;function Im(){if(Of)return xo;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 xo=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},xo}var Do,Cf;function Bn(){if(Cf)return Do;Cf=1;var t=Rr(),e=Im(),r=nn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Af;function Pm(){if(Af)return Rf;Af=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),o=Bn();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={},$f;function Em(){if($f)return Uf;$f=1;var t=Ie(),e=ut(),r=nn().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 Lf={},qf;function km(){if(qf)return Lf;qf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),o=Bn();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}}),Lf}var jf={},Nf;function _m(){if(Nf)return jf;Nf=1;var t=Ie(),e=bt(),r=nn().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={},Mo,Df;function Xh(){if(Df)return Mo;Df=1;var t=rt(),e=Ze(),r=bt();return Mo=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},Mo}var Mf;function Tm(){if(Mf)return xf;Mf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=nn().CONSTRUCTOR,i=Xh(),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 Rm(){return Ff||(Ff=1,Sm(),Pm(),Em(),km(),_m(),Tm()),cf}var Kf={},zf;function Om(){if(zf)return Kf;zf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),o=Bn();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 Cm(){if(Bf)return Hf;Bf=1;var t=Ie(),e=je(),r=nt(),n=Ye(),a=bt(),i=Tr(),o=rn(),s=Bn(),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 Qh(){if(Wf)return Gf;Wf=1;var t=Ie(),e=me(),r=Vh(),n=zn(),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 ev(){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 Am(){if(Yf)return Zf;Yf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Wh(),s=Xh(),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 Fo,Xf;function Um(){if(Xf)return Fo;Xf=1,dm(),js(),vm(),Rm(),Om(),Cm(),Qh(),ev(),Am(),Fh();var t=Hn();return Fo=t.Promise,Fo}var Ko,Qf;function $m(){if(Qf)return Ko;Qf=1;var t=Um();return Bh(),Ko=t,Ko}var ed={},td;function Lm(){return td||(td=1,Qh()),ed}var rd={},nd;function qm(){return nd||(nd=1,ev()),rd}var zo,ad;function jm(){if(ad)return zo;ad=1;var t=$m();return Lm(),qm(),zo=t,zo}jm();const tv="sesamy-debug";function Nm(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 xm(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 Dm(t){Nm(tv,t.toString(),1)}function Mm(){return xm(tv)==="true"}function le(t){Mm()&&console.log(t)}function Wt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});le(`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 jt=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 Lt=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(Lt);var Fm=Fs(Ks((function(t,e){var r=jt&&jt.__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=jt&&jt.__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=jt;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,Lt.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?(Lt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),Lt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Lt.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,Lt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),Lt.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 Km={timeoutInSeconds:60},rv={name:"auth0-spa-js",version:"2.8.0"},nv=()=>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)}},zm=class av extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,av.prototype)}},Hm=class iv extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,iv.prototype)}},cs=class ov extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,ov.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Bm=class sv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,sv.prototype)}},Gm=class cv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,cv.prototype)}},uv=class lv extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Sn(e,["default"])}', scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,lv.prototype)}},Wm=class fv extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${Sn(e,["default"])}', missing scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,fv.prototype)}},dv=class hv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,hv.prototype)}};function Sn(t,e=[]){return t&&!e.includes(t)?t:""}const In=()=>window.crypto,Lr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(In().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Ho=t=>btoa(t),Vm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Jm=t=>Object.keys(t).reduce(((e,r)=>{const n=Vm.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 In().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))))},Zm=new TextEncoder,Ym=new TextDecoder;function zr(t){return typeof t=="string"?Zm.encode(t):Ym.decode(t)}function cd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Qm(`${t.name} modulusLength must be at least 2048 bits`)}async function Xm(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 Dt})(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 Dt=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)}},Qm=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 eg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Dt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Dt("unsupported CryptoKey algorithm name")}}function vv(t){return t instanceof CryptoKey}function pv(t){return vv(t)&&t.type==="public"}async function tg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!vv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!pv(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 Xm({alg:eg(o),typ:"dpop+jwt",jwk:await mv(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 mv(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 rg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function ng(){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 Dt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function ag(t){return(async function(e){if(!pv(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 mv(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 Dt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function ig({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 tg(t,i,r,n,a)}const og=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},sg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([og(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},cg=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},ug=async(t,e,r,n,a,i,o=1e4,s)=>a?cg(t,e,r,n,o,a,i,s):sg(t,n,o);async function gv(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 ug(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 Gm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new uv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new dv(w);return gv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function lg(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,rg.includes(g));var g;return await gv(`${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(Jm(o||rv)))}},e,s,u,p?l:void 0)}const mn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},cn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),mn(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})}},fg=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@@")))}},yv=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)}})()}},dg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||nv}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)}}}},hg=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",vg=["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"],pg=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],vg.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 Mt=Ks((function(t,e){var r=jt&&jt.__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(Mt),Mt.encode,Mt.parse,Mt.getAll;var mg=Mt.get,wv=Mt.set,bv=Mt.remove;const ur={get(t){const e=mg(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),wv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r)}},gg={get(t){return ur.get(t)||ur.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),wv(`_legacy_${t}`,JSON.stringify(e),n),ur.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r),ur.remove(t,e),ur.remove(`_legacy_${t}`,e)}},yg={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 Nt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Nt||(Nt={}));function wg(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,Bo,bg=(ud="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ld=null,fd=!1,function(t){return Bo=Bo||wg(ud,ld,fd),new Worker(Bo,t)});const Go={};let Sg=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 Ig={memory:()=>new yv().enclosedCache,localstorage:()=>new fg},dd=t=>Ig[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 Pg=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)}},Eg=class{constructor(e){this.storage=new Pg(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 ng(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return ig(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ag(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var lr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(lr||(lr={}));let kg=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=lr.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?lr.DPoP:lr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===lr.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 dv(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)}},_g=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 Sv 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,Sv.prototype)}};const Wo=new Fm;let Tg=class{constructor(e){let r,n;if(this.userCache=new yv().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 Wo.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(!In())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(In().subtle===void 0)throw new Error(`
|
|
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 hh(){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=hh(),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 vh(){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 ph(){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 mh(){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 gh(){if($c)return Sa;$c=1;var t=mh(),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 yh(){if(qc)return Ia;qc=1;var t=gh();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=vh(),r=Je(),n=ph(),a=gh(),i=yh(),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 wh(){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 bh(){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 Sh(){if(Wc)return ja;Wc=1;var t=Ye(),e=we(),r=Nn(),n=yh(),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 Sp(){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 Ip(){if(Xc)return Fa;Xc=1;var t=je(),e=Ze(),r=Sh(),n=_s(),a=Sp(),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 Ih(){if(Qc)return Ka;Qc=1;var t=Ip(),e=Sh();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=bh(),r=wh(),n=rt(),a=Ih(),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 Pp(){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=Pp();return Ha=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ha}var Ba,nu;function Ph(){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 Ep(){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=Ep();return Wa=function(e){return t(e.length)},Wa}var Va,ou;function kp(){if(ou)return Va;ou=1;var t=Zr(),e=Ph(),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 Eh(){if(cu)return Za;cu=1;var t=pe(),e=Je(),r=Zr(),n=kp().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 kh(){if(lu)return Xa;lu=1;var t=Eh(),e=Cs();return Xa=Object.keys||function(n){return t(n,e)},Xa}var fu;function _p(){if(fu)return Ta;fu=1;var t=Le(),e=wh(),r=yt(),n=rt(),a=Zr(),i=kh();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 _h(){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=vh(),e=ph(),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=_p(),r=Cs(),n=Os(),a=_h(),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 Tp(){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 Rp(){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=Rp(),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 Th(){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 Rh(){if(Iu)return ci;Iu=1;var t=Le(),e=je(),r=Th(),n=Xt(),a=Zr(),i=Ih(),o=Je(),s=bh(),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 Oh(){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 Ch(){if(ku)return li.exports;ku=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=Le(),i=Oh().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=Ch(),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 Op(){if(Tu)return vi;Tu=1;var t=Eh(),e=Cs(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var pi={},Ru;function Ah(){return Ru||(Ru=1,pi.f=Object.getOwnPropertySymbols),pi}var mi,Ou;function Cp(){if(Ou)return mi;Ou=1;var t=Ye(),e=pe(),r=Op(),n=Ah(),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 Uh(){if(Cu)return gi;Cu=1;var t=Je(),e=Cp(),r=Rh(),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 Lh(){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=Rh().f,r=Qt(),n=Xe(),a=Es(),i=Uh(),o=Lh();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 Ap(){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=Ap(),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 $h(){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 qh(){if(Nu)return Ei;Nu=1;var t=$h().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 Up(){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 Lp(){if(Du)return _i;Du=1;var t=Ze();return _i=function(e){return t(e)||e===null},_i}var Ti,Mu;function $p(){if(Mu)return Ti;Mu=1;var t=Lp(),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=Up(),e=Ze(),r=$n(),n=$p();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 jh(){if(Ku)return Oi;Ku=1;var t=Ie(),e=je(),r=ut(),n=Oh(),a=we(),i=qh(),o=Ls(),s=$s(),u=kr(),l=Qt(),c=Xe(),f=Ue(),h=Qr(),d=$h(),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=Tp(),r=Qr(),n=Er(),a=yt().f,i=jh(),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 qp(){if(Gu)return Bu;Gu=1;var t=Ie(),e=pe(),r=Ph(),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 Nh(){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=Ch(),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 jp(){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 Np(){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=Np(),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 xp(){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 xh(){if(cl)return Wi;cl=1,js(),qp();var t=Ie(),e=me(),r=Nh(),n=Ye(),a=je(),i=pe(),o=Le(),s=Dn(),u=Xe(),l=Mn(),c=jp(),f=kr(),h=qh(),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=xp(),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 Dp(){return ul||(ul=1,xh()),pc}var ll={},fl;function Mp(){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 Fp(){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 Kp(){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 Dh(){if(gl)return Ji;gl=1,Dp(),Mp(),Fp(),Kp();var t=zn();return Ji=t.URLSearchParams,Ji}var yl={},wl={},bl={},Zi,Sl;function Mh(){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 Fh(){if(Il)return bl;Il=1;var t=Mh().charAt,e=wt(),r=Er(),n=jh(),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 zp(){if(Pl)return Yi;Pl=1;var t=Le(),e=pe(),r=je(),n=Ae(),a=kh(),i=Ah(),o=Th(),s=qn(),u=hh(),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 Kh(){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 Hp(){if(kl)return Qi;kl=1;var t=rt(),e=Kh();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 zh(){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 Hh(){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 Bp(){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 Gp(){if(Ol)return no;Ol=1;var t=_r(),e=je(),r=qn(),n=Hp(),a=zh(),i=Hh(),o=Rs(),s=Bp(),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 Wp(){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 Vp(){if(Al)return wl;Al=1,Fh();var t=Ie(),e=Le(),r=Dn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Mn(),u=Ns(),l=Je(),c=zp(),f=Gp(),h=Kn(),d=Mh().codeAt,v=Wp(),p=wt(),g=kr(),P=er(),w=xh(),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 Jp(){return Ul||(Ul=1,Vp()),yl}var Ll={},$l;function Zp(){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 Yp(){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 Xp(){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 Qp(){if(Dl)return io;Dl=1,Dh(),Jp(),Zp(),Yp(),Xp();var t=zn();return io=t.URL,io}var oo,Ml;function em(){if(Ml)return oo;Ml=1;var t=Qp();return oo=t,oo}var so,Fl;function tm(){if(Fl)return so;Fl=1;var t=em();return so=t,so}tm();var Kl={},co,zl;function rm(){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 nm(){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 Bh(){if(Bl)return Kl;Bl=1;var t=me(),e=rm(),r=nm(),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 am(){if(Gl)return lo;Gl=1;var t=Dh();return Bh(),lo=t,lo}var fo,Wl;function im(){if(Wl)return fo;Wl=1;var t=am();return fo=t,fo}im();var Vl={},Jl={},ho,Zl;function om(){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 sm(){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 cm(){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 um(){if(Ql)return mo;Ql=1;var t=Qt(),e=sm(),r=cm(),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=zh(),i=Rs(),o=Nn(),s=Ds(),u=Fn(),l=Kh(),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 lm(){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 fm(){if(rf)return Jl;rf=1;var t=Ie(),e=Nn(),r=Ls(),n=$s(),a=Uh(),i=Xr(),o=Qt(),s=Xt(),u=om(),l=um(),c=tn(),f=lm(),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 dm(){return nf||(nf=1,fm()),Vl}var af={},wo,of;function hm(){if(of)return wo;of=1;var t=xs(),e=en();return wo=t?{}.toString:function(){return"[object "+e(this)+"]"},wo}var sf;function vm(){if(sf)return af;sf=1;var t=xs(),e=Xe(),r=hm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),af}var cf={},uf={},bo,lf;function Gh(){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=Gh();return So=t==="NODE",So}var Io,df;function pm(){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 mm(){if(hf)return Po;hf=1;var t=Hh(),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 Wh(){if(vf)return Eo;vf=1;var t=rt(),e=mm(),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 Vh(){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 Jh(){if(mf)return _o;mf=1;var t=Yr();return _o=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),_o}var To,gf;function Zh(){if(gf)return To;gf=1;var t=me(),e=Vh(),r=_r(),n=we(),a=Je(),i=Ae(),o=_h(),s=Kn(),u=jn(),l=er(),c=Jh(),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 Yh(){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 gm(){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 ym(){if(bf)return Co;bf=1;var t=Yr();return Co=/web0s(?!.*chrome)/i.test(t),Co}var Ao,Sf;function wm(){if(Sf)return Ao;Sf=1;var t=me(),e=Nh(),r=_r(),n=Zh().set,a=Yh(),i=Jh(),o=gm(),s=ym(),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 bm(){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=Lh(),a=Us(),i=Ue(),o=Gh(),s=ut(),u=mh(),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 Sm(){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=pm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Wh(),p=Zh().set,g=wm(),P=bm(),w=Tr(),y=Yh(),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 Im(){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=Im(),r=rn().CONSTRUCTOR;return xo=r||!e(function(n){t.all(n).then(void 0,function(){})}),xo}var Af;function Pm(){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 Em(){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 km(){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 _m(){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 Xh(){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 Tm(){if(Mf)return xf;Mf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=Xh(),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 Rm(){return Ff||(Ff=1,Sm(),Pm(),Em(),km(),_m(),Tm()),cf}var Kf={},zf;function Om(){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 Cm(){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 Qh(){if(Wf)return Gf;Wf=1;var t=Ie(),e=me(),r=Vh(),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 ev(){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 Am(){if(Yf)return Zf;Yf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Wh(),s=Xh(),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 Um(){if(Xf)return Mo;Xf=1,dm(),js(),vm(),Rm(),Om(),Cm(),Qh(),ev(),Am(),Fh();var t=zn();return Mo=t.Promise,Mo}var Fo,Qf;function Lm(){if(Qf)return Fo;Qf=1;var t=Um();return Bh(),Fo=t,Fo}var ed={},td;function $m(){return td||(td=1,Qh()),ed}var rd={},nd;function qm(){return nd||(nd=1,ev()),rd}var Ko,ad;function jm(){if(ad)return Ko;ad=1;var t=Lm();return $m(),qm(),Ko=t,Ko}jm();const tv="sesamy-debug";function Nm(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 xm(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 Dm(t){Nm(tv,t.toString(),1)}function Mm(){return xm(tv)==="true"}function ce(t){Mm()&&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 Fm=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 Km={timeoutInSeconds:60},rv={name:"auth0-spa-js",version:"2.8.0"},nv=()=>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)}},zm=class av extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,av.prototype)}},Hm=class iv extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,iv.prototype)}},cs=class ov extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,ov.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Bm=class sv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,sv.prototype)}},Gm=class cv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,cv.prototype)}},uv=class lv 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,lv.prototype)}},Wm=class fv 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,fv.prototype)}},dv=class hv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,hv.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),Vm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Jm=t=>Object.keys(t).reduce(((e,r)=>{const n=Vm.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))))},Zm=new TextEncoder,Ym=new TextDecoder;function zr(t){return typeof t=="string"?Zm.encode(t):Ym.decode(t)}function cd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Qm(`${t.name} modulusLength must be at least 2048 bits`)}async function Xm(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)}},Qm=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 eg(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 vv(t){return t instanceof CryptoKey}function pv(t){return vv(t)&&t.type==="public"}async function tg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!vv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!pv(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 Xm({alg:eg(o),typ:"dpop+jwt",jwk:await mv(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 mv(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 rg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function ng(){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 ag(t){return(async function(e){if(!pv(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 mv(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 ig({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 tg(t,i,r,n,a)}const og=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},sg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([og(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},cg=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},ug=async(t,e,r,n,a,i,o=1e4,s)=>a?cg(t,e,r,n,o,a,i,s):sg(t,n,o);async function gv(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 ug(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 Gm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new uv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new dv(w);return gv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function lg(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,rg.includes(g));var g;return await gv(`${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(Jm(o||rv)))}},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})}},fg=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@@")))}},yv=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)}})()}},dg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||nv}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)}}}},hg=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",vg=["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"],pg=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],vg.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 mg=Ft.get,wv=Ft.set,bv=Ft.remove;const lr={get(t){const e=mg(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),wv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r)}},gg={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),wv(`_legacy_${t}`,JSON.stringify(e),n),lr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r),lr.remove(t,e),lr.remove(`_legacy_${t}`,e)}},yg={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 wg(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,bg=(ud="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ld=null,fd=!1,function(t){return Ho=Ho||wg(ud,ld,fd),new Worker(Ho,t)});const Bo={};let Sg=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 Ig={memory:()=>new yv().enclosedCache,localstorage:()=>new fg},dd=t=>Ig[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 Pg=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)}},Eg=class{constructor(e){this.storage=new Pg(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 ng(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return ig(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ag(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 kg=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 dv(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)}},_g=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 Sv 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,Sv.prototype)}};const Go=new Fm;let Tg=class{constructor(e){let r,n;if(this.userCache=new yv().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?ur:gg,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:yg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:mn(l,u,...c)};let f={default:mn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=mn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new hg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||nv,this.cacheManager=new dg(n,n.allKeys?void 0:new Sg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Eg(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 _g(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 bg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||rv)));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 pg({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=Ho(Lr()),o=Ho(Lr()),s=Lr(),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:cn(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 Bm(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:Nt.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===Nt.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 zm(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:Nt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Hm(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:Nt.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:cn(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=Go[s];return u||(u=o().finally((()=>{delete Go[s],u=null})),Go[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})((()=>Wo.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 Wo.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:cn(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({},Km),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 uv(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 Wm(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 lg(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:cn(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 kg(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=Ho(Lr()),u=Lr(),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:Nt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Rg(t){const e=new Tg(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 Og="sesamy.com",Cg="sesamy.dev",Ag="https://sesa.my",md="sesamyCacheTimestamp",gd="sesamyContentReloaded";function Iv(t,e){return`${t}.${e==="dev"?Cg:Og}`}function ot(t,e){return`https://${Iv(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",!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:gg,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:yg;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 hg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||nv,this.cacheManager=new dg(n,n.allKeys?void 0:new Sg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Eg(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 _g(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 bg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||rv)));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 pg({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 Bm(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 zm(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 Hm(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({},Km),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 uv(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 Wm(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 lg(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 kg(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 Rg(t){const e=new Tg(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 Og="sesamy.com",Cg="sesamy.dev",Ag="https://sesa.my",md="sesamyCacheTimestamp",gd="sesamyContentReloaded";function Iv(t,e){return`${t}.${e==="dev"?Cg:Og}`}function ot(t,e){return`https://${Iv(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:()=>Ug,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 Ug=Bs;Hs.A;const $g=Hs.k,gn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(gn);return t===null?void 0:t==="true"}catch{return}}async function Lg(){try{const t=sessionStorage.getItem(gn);if(t!==null)return t==="true";const{isPrivate:e}=await $g();return sessionStorage.setItem(gn,e.toString()),e}catch{try{sessionStorage.setItem(gn,"false")}catch{}return!1}}function Jr(){return typeof window<"u"}function yd(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 qg="function",jg="string",tt="undefined",Ng="boolean",Pn="object",xg="array",Dg="number",Mg="symbol",Fg="null",hs=function(){},Pv="any",Ev="*",Vt="__",Kg="form",zg="input",Hg="button",Bg="select",En=typeof process!==tt?process:{};En.env&&En.env.NODE_ENV;var Ce=typeof document!==tt;En.versions!=null&&En.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 kv(t,e){return e.charAt(0)[t]()+e.slice(1)}var Gg=kv.bind(null,"toUpperCase"),Wg=kv.bind(null,"toLowerCase");function Vg(t){return _v(t)?Gg(Fg):typeof t===Pn?Xg(t):Object.prototype.toString.call(t).slice(8,-1)}function kn(t,e){e===void 0&&(e=!0);var r=Vg(t);return e?Wg(r):r}function an(t,e){return typeof e===t}var ze=an.bind(null,qg),_t=an.bind(null,jg),fr=an.bind(null,tt),Jg=an.bind(null,Ng);an.bind(null,Mg);function _v(t){return t===null}function Zg(t){return kn(t)===Dg&&!isNaN(t)}function Tv(t){return kn(t)===xg}function Ke(t){if(!Yg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Yg(t){return t&&(typeof t===Pn||t!==null)}function Xg(t){return ze(t.constructor)?t.constructor.name:null}function Qg(t){return t instanceof Error||_t(t.message)&&t.constructor&&Zg(t.constructor.stackTraceLimit)}function Rv(t,e){if(typeof e!="object"||_v(e))return!1;if(e instanceof t)return!0;var r=kn(new t(""));if(Qg(e))for(;e;){if(kn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Rv.bind(null,TypeError);Rv.bind(null,SyntaxError);function Gn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?ey(t,e):r}function ey(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Wn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Wn(Gn,Kg);Wn(Gn,Hg);Wn(Gn,zg);Wn(Gn,Bg);function ty(t){return t?Tv(t)?t:[t]:[]}function wd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function ry(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function ny(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ay(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=wd(r[1]),o=wd(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&&(iy(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 iy(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 Vn(){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 oy(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 Ft="global",yr=Vt+Ft+Vt,wr=typeof self===Pn&&self.self===self&&self||typeof global===Pn&&global[Ft]===global&&global||void 0;function Jt(t){return wr[yr][t]}function Zt(t,e){return wr[yr][t]=e}function Or(t){delete wr[yr][t]}function Cr(t,e,r){var n;try{if(Ws(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}wr[yr]||(wr[yr]={});var un={};function Ws(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",vt="undefined",Gr="reducer",Ov="@@redux/",vs=Ov+"INIT",sy=Ov+Math.random().toString(36),bd=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),ln=" != "+Et;function Cv(t,e,r){var n;if(typeof e===Et&&typeof r===vt&&(r=e,e=void 0),typeof r!==vt){if(typeof r!==Et)throw new Error("enhancer"+ln);return r(Cv)(t,e)}if(typeof t!==Et)throw new Error(Gr+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===vt)throw new Error("ActType "+vt);if(u)throw new Error("Dispatch in "+Gr);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:vs}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+Gr+ln);a=d,h({type:vs})}})[bd]=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)}}})[bd]=function(){return this},d},n}function cy(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Gr+" "+t+" returns "+vt}function br(){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 uy(){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=br.apply(void 0,i)(o.dispatch)})}}}var Tt=Vt+"anon_id",Kt=Vt+"user_id",hr=Vt+"user_traits",ps="analytics",Pt="userId",dr="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"],ms=["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}}),Sd=/^utm_/,Id=/^an_prop_/,Pd=/^an_trait_/;function ly(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(Tt,o.anonymousId),l||e(Kt,o.userId),u.traits&&e(hr,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(Sd)||p.match(/^(d|g)clid/)){var g=p.replace(Sd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Id)&&(v.props[p.replace(Id,"")]=i[p]),p.match(Pd)&&(v.traits[p.replace(Pd,"")]=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 fy(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Tt)return ee({},e,{anonymousId:r.value});if(r.key===Kt)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[Kt,Tt,hr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Ed(t){return{userId:t.getItem(Kt),anonymousId:t.getItem(Tt),traits:t.getItem(hr)}}var gs=function(t){return Vt+"TEMP"+Vt+t};function dy(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&&([Kt,hr,Tt].forEach(function(d){n(d)}),[Pt,dr,"traits"].forEach(function(d){Or(gs(d))})),s.type===Q.identify){a(Tt)||r(Tt,Vn());var f=a(Kt),h=a(hr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Kt,u),l&&r(hr,ee({},h,l))}return o(s)}}}}var Fr={};function kd(t,e){Fr[t]&&ze(Fr[t])&&(Fr[t](e),delete Fr[t])}function Av(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 Av(t,e,r-10).then(n,a)})})}function hy(t){return{abort:t}}function Uv(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,dr].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:hy}))&&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 Vo=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(vr),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(vr)?(function(z,V,te,L,M){return function(N,S){var O=L?L.name:z,q=S&&Zr(S)?S:te;if(L&&(!(q=S&&Zr(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:vy(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=Ud(N);if(O&&O.name===S){var q=Ud(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(`
|
|
35
|
-
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:V,instance:n,abort:(te=V,L=y,M=j.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[L],caller:f,from:M||L}})}),config:Rd(j.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,L,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),Zo(j,b))return Jo({data:j,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(Zo(A,b))return m&&Jo({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:Rd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},L=ee({},A,te),M=g[b];if(Zo(M,b))Jo({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(_d)&&!f.match(Td)&&n.dispatch(ee({},h?L:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(vr)||f.match(/^registerPlugin/)||f.match(Td)||f.match(_d)||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"}});$v(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)}},vr=/Start$/,_d=/^bootstrap/,Td=/^ready/;function Jo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Rd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Od(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Cd(t,e){var r=t.replace(vr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Zo(t,e){var r=t.abort;return!!r&&(r===!0||Ad(r,e)||r&&Ad(r.plugins,e))}function $v(t,e){var r=t.abort;if(!r)return!1;if(r===!0||_t(r))return!0;var n=r.plugins;return Zr(r)&&r.length===e||Zr(n)&&n.length===e}function Zr(t){return Array.isArray(t)}function Ad(t,e){return!(!t||!Zr(t))&&t.includes(e)}function Ud(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function vy(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 py(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 kd(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 Av(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!ms.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 Uv(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(vr,"");if(m._&&m._.called)return Promise.resolve(m);var L=R.getState(),M=(O=z,(q=L.plugins)===void 0&&(q={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var _=F.plugins||{};return Jg(_[I])?_[I]:_.all!==!1&&(!q[I]||q[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys(L.plugins).filter(function(I){var _=L.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=Cd(I).map(function(H){return Od(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Cd(I,J).map(function(ke){return Od(ke,_)}),ne=fe[0],ce=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ce.length&&(H.duringNS[J]=ce),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,M);return Promise.resolve(Vo({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(I){function _(){var Y=(function(){if(V.match(vr))return Promise.resolve(Vo({action:ee({},x,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&kd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if($v(I,N.length))return I;var x,H=(function(){if(V!==te)return Promise.resolve(Vo({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:L,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 my(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 gy=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 br.apply(void 0,o)(n)(a)}}}}};function yy(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=$d(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=$d(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,Ld(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Ld(r.plugins,!0,e));default:return e}}}function $d(t,e){return t.substring(e.length+1,t.length)}function Ld(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function Lv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var wy={last:{},history:[]};function by(t,e){t===void 0&&(t=wy);var r=e.options,n=e.meta;if(e.type===Q.track){var a=Lv(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 Sy={actions:[]};function Iy(t,e){t===void 0&&(t=Sy);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 qv=/#.*$/;function Py(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(qv,""):"")}var jv,Nv,xv,Dv,Ey=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(qv,"")})(l),f={title:r,url:c,path:Py(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},ky={last:{},history:[]};function _y(t,e){t===void 0&&(t=ky);var r=e.options;if(e.type===Q.page){var n=Lv(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}jv=(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"})(),Nv=Ce?document.referrer:null,xv=ry(),Dv=ny();var qd={initialized:!1,sessionId:Vn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:jv},userAgent:Ce?navigator.userAgent:"node",library:{name:ps,version:"0.13.1"},timezone:Dv,locale:xv,campaign:{},referrer:Nv};function Ty(t,e){t===void 0&&(t=qd);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({},qd,t,{initialized:!0})}}var Ry=["plugins","reducers","storage"];function Oy(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Cy(t){var e=Oy.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Mv(){return Zt(ps,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return wr[yr][ps].push(o.action||o),i(o)}})}}}function jd(t){return function(){return br(br.apply(null,arguments),Mv())}}function Yo(t){return t?Tv(t)?t:[t]:[]}function Nd(t,e,r){t===void 0&&(t={});var n,a,i=Vn();return e&&(Fr[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 Ay(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 ce=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ce.length;ke++)ae[ke]=ce[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:Jt,setItem:Zt,removeItem:Or},i=(function(I){return function(_,x,H){return x.getState("user")[_]||(H&&Ke(H)&&H[_]?H[_]:Ed(I)[_]||Jt(gs(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ms.includes(I)}).sort(),u=new Set(s.concat(yn).filter(function(I){return!ms.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new gy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=ay(),P=Ed(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Vn());var y=ee({enable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.enablePlugin,plugins:Yo(I),_:{originalAction:Q.enablePlugin}},x,[_])})},disable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.disablePlugin,plugins:Yo(I),_:{originalAction:Q.disablePlugin}},x,[_])})}},n.methods),m=!1,b={identify:function(I,_,x,H){try{var Y=_t(I)?I:null,J=Ke(I)?I:_,fe=x||{},ne=b.user();Zt(gs(Pt),Y);var ce=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ce,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||!_t(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(dr,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:Ey(H),options:Y,userId:i(Pt,b,H),anonymousId:i(dr,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===dr||I==="anonId")return i(dr,b);var _=b.getState("user");return I?yd(_,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(ce){return function(ae){return ae.type.match(x)&&_({payload:ae,instance:b,plugins:o}),ce(ae)}}},Y=function(ne){return function(ce){return function(ae){return ae.type.match(x)||_({payload:ae,instance:b,plugins:o}),ce(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(ce){return function(ae){return ae.type===I&&_({payload:ae,instance:b,plugins:o,abort:p}),ce(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?yd(_,I):Object.assign({},_)},dispatch:function(I){var _=_t(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(Tt,I,_)},events:{core:yn,plugins:s}},R=n.middlewares.concat([function(I){return function(_){return function(x){return x.meta||(x.meta=Nd()),_(x)}}},v(fn),py(b,c,{all:l,plugins:s}),my(a),ly(b),dy(b),v(dn)]),A={context:Ty,user:fy(a),page:_y,track:by,plugins:yy(c),queue:Iy},j=br,z=br;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(j=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Mv():Ke(typeof arguments[0])?jd():jd().apply(null,arguments)}}var te,L=(function(I){return Object.keys(I).reduce(function(_,x){return Ry.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:L,user:w,plugins:M},S=Cv((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(ce){var ae=ne[ce];if(typeof ae(void 0,{type:vs})===vt||typeof ae(void 0,{type:sy})===vt)throw new Error(Gr+" "+ce+" "+vt)})})(x)}catch(ne){J=ne}return function(ne,ce){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,ke={},Ne=0;Ne<fe.length;Ne++){var De=fe[Ne],Le=ne[De],Qe=(0,x[De])(Le,ce);if(typeof Qe===vt){var St=cy(De,ce);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),N,z(j(uy.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:Nd(I.meta,_,Yo(x))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:L,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})}),Cy(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return Uv(I,_,x)},3e3)})(S,c,b),b}var fn="before",dn="after",zt="cookie",xt=zv(),Fv=Jn,Uy=Jn;function Kv(t){return xt?Jn(t,"",-1):Or(t)}function zv(){if(xt!==void 0)return xt;var t=zt+zt;try{Jn(t,t),xt=document.cookie.indexOf(t)!==-1,Kv(t)}catch{xt=!1}return xt}function Jn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return xt===!1&&(o?Zt(t,e):Jt(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",$y=Ws.bind(null,mt);Cr(mt,"getItem",Jt);Cr(mt,"setItem",Zt);Cr(mt,"removeItem",Or);var gt="sessionStorage",Ly=Ws.bind(null,gt);Cr(gt,"getItem",Jt);Cr(gt,"setItem",Zt);Cr(gt,"removeItem",Or);function pr(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 qy=$y(),jy=Ly(),Ny=zv();function Ht(t,e){if(t){var r=Vs(e),n=!Xs(r),a=Js(r)?pr(localStorage.getItem(t)):void 0;if(n&&!fr(a))return a;var i=Zs(r)?pr(Fv(t)):void 0;if(n&&i)return i;var o=Ys(r)?pr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Jt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function _n(t,e,r){if(t&&!fr(e)){var n={},a=Vs(r),i=JSON.stringify(e),o=!Xs(a);return Js(a)&&(n[mt]=hn(mt,e,pr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:Zs(a)&&(n[zt]=hn(zt,e,pr(Fv(t))),Uy(t,i),o)?n[zt]:Ys(a)&&(n[gt]=hn(gt,e,pr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ft]=hn(Ft,e,Jt(t)),Zt(t,e),o?n[Ft]:n)}}function xy(t,e){if(t){var r=Vs(e),n=Ht(t,Ev),a={};return!fr(n.localStorage)&&Js(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!fr(n.cookie)&&Zs(r)&&(Kv(t),a[zt]=n.cookie),!fr(n.sessionStorage)&&Ys(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!fr(n.global)&&Zn(r,Ft)&&(Or(t),a[Ft]=n.global),a}}function Vs(t){return t?_t(t)?t:t.storage:Pv}function Js(t){return qy&&Zn(t,mt)}function Zs(t){return Ny&&Zn(t,zt)}function Ys(t){return jy&&Zn(t,gt)}function Xs(t){return t===Ev||t==="all"}function Zn(t,e){return t===Pv||t===e||Xs(t)}function hn(t,e,r){return{location:t,current:e,previous:r}}var Dy={setItem:_n,getItem:Ht,removeItem:xy};function My(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xd(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 Dd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xd(Object(r),!0).forEach(function(n){My(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Dy};return Ay(Dd(Dd({},e),t))}const Qs="@sesamy/sesamy-js",Yn="1.70.0";function Ky(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=Hy(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function zy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Hy(t){return["#","?"].forEach(e=>t=zy(t,e)),t}function By(){Ky(()=>{dt.page()})}var Xo="up",Qo="down";function Gy(t){if(t===void 0&&(t={}),!Ce)return hs;var e=Fd(),r=ys(),n=Md(),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 hs;var d=h.map(function(p){return Number(p)}),v=oy(function(){var p=Fd(),g=(function(L,M){return M.map(function(N){return N===100?L-5:L*(N/100)})})(p,d),P=ys(),w=Md(),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=Xo;b?R="initial":l<=w&&(R=Qo);var A=g,j=d;(R===Xo||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function(L,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),L.singleFunction=M),R===Qo&&!o.includes(M)&&w>=S&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):R===Xo&&!o.includes(M)&&w<=S&&M<=y?(L.foundFunc=[M],L):(b&&w>=S&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===Qo&&z.callbacks&&z.callbacks.forEach(function(L){ze(t[L])&&(t[L]({trigger:L,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(L))}),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 ys(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function Wy(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Md(){return Math.round(ys()+Wy())}function Fd(){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 ec="Event",Kd=ec+"Listener";function Vy(t){return function(e,r,n,a){var i=n||hs,o=a||!1;if(!Ce)return i;var s=Tn(r),u=Tn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+ec);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Kd:"remove"+Kd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?Jy(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 Tn(t,e){if(_t(t))return e?Tn(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=ty(t);return e?i.map(function(o){return _t(o)?Tn(o,!0):o}).flat():i}function Jy(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var es=Vy(ec);function Hv(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}Hv.bind(null,"onerror");Hv.bind(null,"onload");var Bv=typeof window>"u",zd="hidden";function Zy(t){if(Bv)return!1;var e=Yy(),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 Yy(){var t=["webkit","moz","ms","o"];return Bv||zd in document?zd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Qy(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=Zy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Xy.map(function(s){return es(document,s,r)})).concat(es(window,"load",r)).concat(es(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function ew(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(xr(h),g),a&&c&&(c=!1,a(xr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(xr(h),g))},s)}var p=Qy(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:xr(h,f),idle:c?xr(r,f):0}}}}function xr(t,e){return e?0:Math.round((new Date-t)/1e3)}const Hd=5e3;class tw{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),ew({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Hd}),Gy({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*Hd: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 Gv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function rw(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 Bd="sesamy_session_id";function nw(){let t=sessionStorage.getItem(Bd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Bd,t)),t}function Wv(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 aw(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}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"}},Vv=[],Jv=!1,Bt;function Zv(){const t=window.location.pathname;return Vv.find(e=>e.path?t.includes(e.path):!0)}function iw(t,e){Vv=t.content||[];const r=Zv();r&&r.type==="article"&&(Fe={...Fe,...aw(r.selectors)},Jv=r.enablePaywallSettingsUrlFallback||!1),Bt=e}function ow(t,e){const{selector:r}=e;return r===Fe.article.selector||t.matches(r)?t:t.querySelector(r)}function Yv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Yv(t.parentElement,e):t.textContent??void 0}function mr(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 tc({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||mr(`sesamy:${e}`)||mr(`og:${e}`)||mr(e)||r}function Xv(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(on).filter(e=>e!==null)}function on(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Wv(e)},n=(i,o,s,u)=>{const l=ow(e,o);if(l){const c=Yv(l,o)||tc({publisherContentId:s,key:i});c!==void 0&&(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=>parseFloat(i)),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=Zv();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)),Jv&&!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 sw(t){const e=on(t);if(!e)throw new Error("Could not find article element");if(e.paywallUrl&&((await Bt.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await Bt.auth.isAuthenticated()?{}:null;if(!e.url)throw new Error("Article must have a URL");return await Bt.entitlements.hasAccess(e.url,e.pass?.split(",")||[])||null}async function Qv(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=on(r);if(!n?.url)throw new Error("Could not find content for element");const a=await Bt.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Bt.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Wv(r.parentElement||r);return Bt.proxy.getContent(i.token,n.url,o)}let ep=!1,wn,Rn,ws;function tp(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:ws,requestId:Math.random().toString(36).slice(2,9),sessionId:nw(),timestamp:new Date().toISOString(),version:Yn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:mr("sesamy:item-src"),publisherContentId:mr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Qs,userAgent:navigator.userAgent,clientId:ws}}}))}const rp=rw(async t=>{if(t.length>0){const e=tp(t);ep?navigator.sendBeacon(Rn,e):(await fetch(Rn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function ts(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Rn,tp([e]))}else rp.push(t)}function cw(){return ep=!0,rp.flush()}function uw(t,e,r){wn=e,Rn=`${ot("logs",r)}/events`,ws=t}const lw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ts({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;ts({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n}=t;ts({anonymousId:r,userId:n,properties:e,type:"identify"})}},Gd=["source","medium","campaign","term","content"],kt="utm_",fw=1800*1e3;function np(t){return t?Date.now()-parseInt(t,10)>fw:!0}function Wd(){const t=document.referrer||"";if(!t)return;const e=Ht(`${kt}set_at`);(np(e)||!Ht(`${kt}referrer`))&&_n(`${kt}referrer`,t)}function dw(){const t=()=>{const r={};for(const a of Gd){const i=Ht(`${kt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Ht(`${kt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Wd()},campaign({payload:r}){const n=r?.campaign||{},a=Ht(`${kt}set_at`);if(Object.keys(n).length>0&&np(a)){for(const o of Gd){const s=n[o];s&&_n(`${kt}${o}`,s)}_n(`${kt}set_at`,String(Date.now()))}Wd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const hw=dw(),Vd=new Map,Jd=new Map;function vw({clientId:t,enabled:e=!0,environment:r}){uw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Jd.forEach((n,a)=>{n.bind(a)()}),cw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Vd.forEach((n,a)=>{n.bind(a)()})}),By(),Gv(()=>{const n=new tw({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})}});Jd.set(document.body,()=>{n.flush()}),Vd.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=Fy({app:Qs,version:Yn,plugins:[hw,lw]});function ap(t,e){dt.track(t,e)}function ip(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});ap(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function pw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function mw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gw(){return/android/i.test(navigator.userAgent)}let Oe,op,Wr,bs=!1,bn=!1;Jr()&&window.addEventListener("pageshow",()=>{bn=!1});const Sr="sesamyAccessToken",rs="sesamyRefreshToken",On="sesamySilentAuthThrottle",yw=300*1e3;async function Xn(){return bs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{bs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function ww(t){if(!t)return null;const e=localStorage.getItem(rs);if(!e)return le("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(rs),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(rs,i.refresh_token),localStorage.setItem(Sr,i.access_token),i.access_token}catch{ac()}}async function rc(){const t=localStorage.getItem(Sr);if(!t)return null;const e=ic(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await ww(e);if(r)return r;localStorage.removeItem(Sr)}return t}let pn=null;const bw=64;function Sw(){try{if(pn!==null)return pn;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===bw)return pn=!0,!0}}catch(t){le(`Error checking for existing auth0 tokens: ${t.message}`)}return pn=!1,!1}function Iw(t){if(t.domains&&t.domains.length>0){const e=Ir(window.location.href);if(e){for(const r of t.domains)if(Ir(`https://${r}`)===e)return le(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;le(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return le(`Using fallback domain property: ${t.domain}`),t.domain}function Ir(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 Pw(t){if(t.enabled===!1)return;op=t.organization;const e=Iw(t);Wr=e&&!Sw()?e:Iv("token",t.environment);const r={domain:Wr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",Ir(window.location.href)!==Ir(`https://${Wr}`)&&(r.useRefreshTokens=!0),le(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Rg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)le("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{le("Code found in URL, handling redirect");try{const u=await Oe.handleRedirectCallback();le(`Login result: ${JSON.stringify(u)}`);const l=await Oe.getUser();if(!l)throw le("No user found"),new Error("No user found");le(`User found ${JSON.stringify(l)}`),nc(),Wt(Be.AUTHENTICATED,l),le("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())}bs=!0,Wt(Be.AUTH_INITIALIZED,{})}async function gr(){return await Xn(),await rc()?!0:Oe?Oe.isAuthenticated():!1}async function Ew(){return await Xn(),await rc()?(le("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function sp(t){if(bn)return le("Login already in progress"),null;if(bn=!0,setTimeout(()=>{bn=!1},3e3),localStorage.removeItem(Sr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:op,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gs(),...e}}}async function Qn(t){const e=sp(t);if(e)return Oe.loginWithRedirect(e)}async function cp(t){const e=sp(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),nc(),ip(Be.AUTHENTICATED,await Oe.getUser()).canceled||window.location.reload()}async function kw(t){return Wr&&Ir(window.location.href)!==Ir(`https://${Wr}`)&&(mw()||gw()||Gs())?cp(t):Qn(t)}function _w(){try{const t=sessionStorage.getItem(On);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<yw}catch{return sessionStorage.removeItem(On),!1}}function Tw(){try{const t={timestamp:Date.now()};sessionStorage.setItem(On,JSON.stringify(t))}catch{le("Failed to set silent auth throttle in sessionStorage")}}function nc(){try{sessionStorage.removeItem(On)}catch{}}async function qt(t=!0,e=!1){await Xn();const r=await rc();if(r)return r;if(!e&&_w()){if(le("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return le("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=ic(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),nc(),n}catch(n){const a=n;if(le(`Failed to get token silently: ${a.message}`),Tw(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await ac(),t)throw n;return null}}async function ac(t={}){if(await Xn(),localStorage.removeItem(Sr),Wt(Be.LOGOUT,{}),!!Oe)return le(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function ic(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 Ss(t){const e=ic(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");le("Set token"),localStorage.setItem(Sr,t),Wt(Be.AUTHENTICATED,e)}const Rw=(t,e)=>e.skipDedupe||e.method!=="GET",Ow=(t,e)=>e.method+"@"+t,Cw=t=>t.clone(),Aw=({skip:t=Rw,key:e=Ow,resolver:r=Cw}={})=>{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)}}},Uw=(t,e)=>t*e,$w=t=>t&&t.ok,Lw=({delayTimer:t=500,delayRamp:e=Uw,maxAttempts:r=10,until:n=$w,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)})};class Vr 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,Vr)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}var Cn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Cn||{});const qw="application/json",up="Content-Type",or=Symbol(),lp=Symbol();function Zd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===up.toLowerCase()))===null||e===void 0?void 0:e[1]}function Yd(t){return/^application\/.*json.*/.test(t)}const Gt=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]=Gt(o,i,r):n[a]=i,n},{...t})},Pr={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 jw(t,e=!1){Pr.options=e?t:Gt(Pr.options,t)}function Nw(t,e=!1){Pr.polyfills=e?t:Gt(Pr.polyfills,t)}function xw(t){Pr.errorType=t}const Dw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class fp extends Error{}const Mw=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=Gt(a.options,n);let f=r;const h=Dw(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,v=h.catch(y=>{throw{[or]:y}}).then(y=>{var m;if(!y.ok){const b=new fp;if(b.cause=d,b.stack=b.stack+`
|
|
36
|
-
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,or),R=b?m[or]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(or)&&l.get(or);if(A)return A(R,t);const j=l.get(lp);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(or,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)},Fw={_url:"",_options:{},_config:Pr,_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:Gt(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:Gt(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:Gt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[up]: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(lp,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=Zd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Yd(a));return n=r?o?n.json(r,a):n.body(r):n,Mw(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=Zd(this._options.headers);return this.content(e||Yd(r)&&r||qw).body(JSON.stringify(t))}};function ct(t="",e={}){return{...Fw,_url:t,_options:e}}ct.default=ct;ct.options=jw;ct.errorType=xw;ct.polyfills=Nw;ct.WretchError=fp;const Kw=(t,e)=>e.skipDedupe||e.method!=="GET",zw=(t,e)=>e.method+"@"+t,Hw=t=>t.clone(),Bw=({skip:t=Kw,key:e=zw,resolver:r=Hw}={})=>{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)}}},Gw=(t,e)=>e.skipCache||e.method!=="GET",Ww=(t,e)=>e.method+"@"+t,Vw=()=>!1,Jw=()=>null,Zw=t=>t.ok,Yw=({throttle:t=1e3,skip:e=Gw,key:r=Ww,clear:n=Vw,invalidate:a=Jw,condition:i=Zw,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},Xw=(t,e)=>t*e,Qw=t=>t&&t.ok,eb=({delayTimer:t=500,delayRamp:e=Xw,maxAttempts:r=10,until:n=Qw,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)})},tb="@sesamy/sdk",rb="1.20.0";class nb{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 Kr="sesamyCacheTimestamp",ab=t=>{const{libraryName:e=tb,libraryVersion:r=rb,cache:n}=t,a=n?.storage||new nb,i=[s=>async(u,l)=>{if(n?.mode===Cn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Kr),c||(c=Date.now().toString(),sessionStorage.setItem(Kr,c))):(c=a.get(Kr),c||(c=Date.now().toString(),a.set(Kr,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)},Bw()];n?.mode===Cn.NORMAL&&i.push(Yw({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(eb({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)&&pt(),d.status===204)return null;if(!d.ok){const v=await d.text().catch(()=>"Unknown error");throw new Vr(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Vr)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Vr(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},pt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Kr),"Cache cleared"),Dr={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"})}},ns={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`)},Xd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Qd={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Mr={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"})},as={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"})}},sr={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)})},is={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"})}},cr={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()}},os={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)})},eh={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},th={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},ib={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},ob={list:async t=>t.request("/payment-issues")},sb={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)}},cb={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},rh={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ub=t=>{const e=ab(t);return{profile:{get:r=>Dr.get(e,r),update:(r,n)=>Dr.update(e,r,n),checkSpotifyLink:()=>Dr.checkSpotifyLink(e),unlinkSpotify:()=>Dr.unlinkSpotify(e),delete:()=>Dr.delete(e)},entitlements:{list:r=>ns.list(e,r),get:r=>ns.get(e,r),getAccess:r=>ns.getAccess(e,r)},subscriptions:{list:()=>Xd.list(e),get:r=>Xd.get(e,r)},products:{get:r=>Qd.get(e,r),autoOnboard:r=>Qd.autoOnboard(e,r)},contracts:{list:()=>Mr.list(e),get:r=>Mr.get(e,r),cancel:r=>Mr.cancel(e,r),createAmendment:(r,n)=>Mr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Mr.confirmAmendment(e,r,n)},userMetadata:{get:()=>as.get(e),set:(r,n)=>as.set(e,r,n),delete:r=>as.delete(e,r)},tallies:{list:()=>sr.list(e),get:r=>sr.get(e,r),update:(r,n)=>sr.update(e,r,n),create:r=>sr.create(e,r),delete:r=>sr.delete(e,r),push:(r,n)=>sr.push(e,r,n)},tags:{list:()=>is.list(e),add:r=>is.add(e,r),remove:r=>is.remove(e,r)},checkouts:{generateLink:(r,n)=>cr.generateCheckoutLink(r,n),create:r=>os.create(e,r),get:r=>os.get(e,r),update:(r,n)=>os.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>cr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>cr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>cr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>cr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>cr.generateConsumeLink(r,n)},bills:{list:()=>eh.list(e),get:r=>eh.get(e,r)},fulfillments:{list:()=>th.list(e),create:r=>th.create(e,r)},paywalls:{get:r=>ib.get(e,r)},paymentIssues:{list:()=>ob.list(e)},proxy:{content:(r,n,a,i)=>sb.content(e,r,n,a,i)},transactions:{list:r=>cb.list(e,r)},vendor:{get:()=>rh.get(e),list:()=>rh.list(e)}}};class lb{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 Is(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function dp(t,e){if(Is(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 nh(t){return t.endsWith("/")?t.slice(0,-1):t}function ah(t,e){if(!Is(t)||!Is(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&nh(r.pathname)===nh(n.pathname)}function fb(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=dp(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 hp="sesamySignedURLs";function oc(){const t=sessionStorage.getItem(hp);return t?JSON.parse(t):[]}function db(t){const e=oc();e.push(t),le(`Adding signed URL: ${t}`),sessionStorage.setItem(hp,JSON.stringify(e))}function hb(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ps="sesamyAttribution";function vb(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 pb(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function An(){return vb(Ps)||{}}function vp(t){if(t===null)localStorage.removeItem(Ps);else{le(`Setting attribution ${JSON.stringify(t)}`);const e=An()??{},r=hb({...e,...pb(t)});localStorage.setItem(Ps,JSON.stringify({value:r}))}}const pp="sesamyFlags";async function mp(t){try{localStorage.setItem(pp,JSON.stringify(t))}catch{le("Failed to save flags to localStorage")}}async function gp(t,e){const r=await sn();r[t]=e,await mp(r)}async function yp(t){return(await sn())[t]}async function wp(t){const e=await sn();t in e&&(delete e[t],await mp(e))}async function sn(){try{const t=localStorage.getItem(pp);return t?JSON.parse(t):{}}catch{return{}}}function mb(t){const e=t.endpoint||ot("api2",t.environment),n=ub({baseUrl:e,tokenProvider:async()=>{if(await gr())try{const q=await qt(!1);if(q)return`Bearer ${q}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:Qs,libraryVersion:Yn,vendorId:t.vendorId,cache:{mode:Cn.BROWSER,storage:new lb}}),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 qt(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(),Aw(),Lw({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 gr()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return q&&F.push(...oc()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:_,purchaseOption:x}=dp(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||ah(S,I.url))return!0}return!!O.some(_=>ah(_,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 gr()?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 pt(),O.ok}async function g(S){const O=await o.url("/tags").post(encodeURIComponent(S)).res();return Wt(Be.USER_ATTRIBUTE_CHANGED,{}),pt(),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 qt(!1)?await o.url("/profile").get().json():null}async function R(S){const O=await o.url("/profile").patch(S).res();return pt(),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 qt(!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&&pt(),O}async function te(S,O=3600){const{shortlink:q}=await ct(Ag).post({url:S,ttl:O}).json();return q}async function L(S){const O=await qt(!1,!0);let q;const F=S.language||Br(),I=An();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=fb(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 qt(!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=An(),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:Xv,get:on,getLanguage:Br,unlock:Qv,getPropertyFromHTML:tc},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,flags:{get:yp,set:gp,list:sn,delete:wp},generateLink:L,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}}const gb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function yb(){return new Promise(t=>{const e=gb.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 wb(){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 bb(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:L,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=mb(t),q=()=>A.list(),F={analytics:{track:ap},attribution:{get:An,set:vp},auth:{getUser:f,getTokenSilently:qt,isAuthenticated:gr,loginWithRedirect:Qn,loginWithPopup:cp,login:kw,logout:ac,setToken:Ss},bills:r,browser:{detectAdblock:yb,isInAppBrowser:wb,isIncognito:Gs},checkouts:n,clearCache:pt,content:{list:Xv,get:on,getLanguage:Br,hasAccess:sw,unlock:Qv,getPropertyFromHTML:tc},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:oc},events:{emit:ip,cancel:pw},flags:{get:yp,set:gp,list:sn,delete:wp},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:Sb,isReady:()=>exports.isInitialized,log:le,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:{...L,get:P},userMetadata:S,vendor:O,setToken:Ss};return t.namespace&&(window[t.namespace]=F),F}function Sb(){return Yn}function Ib(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:()=>Ug,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 Ug=Bs;Hs.A;const Lg=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 $g(){try{const t=sessionStorage.getItem(mn);if(t!==null)return t==="true";const{isPrivate:e}=await Lg();return sessionStorage.setItem(mn,e.toString()),e}catch{try{sessionStorage.setItem(mn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function qg(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function jg(){return/android/i.test(navigator.userAgent)}let Oe,Pv,Gr,hs=!1,gn=!1;Vr()&&window.addEventListener("pageshow",()=>{gn=!1});const yr="sesamyAccessToken",Wo="sesamyRefreshToken",In="sesamySilentAuthThrottle",Ng=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 xg(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 xg(e);if(r)return r;localStorage.removeItem(yr)}return t}let cn=null;const Dg=64;function Mg(){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===Dg)return cn=!0,!0}}catch(t){ce(`Error checking for existing auth0 tokens: ${t.message}`)}return cn=!1,!1}function Fg(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 Kg(t){if(t.enabled===!1)return;Pv=t.organization;const e=Fg(t);Gr=e&&!Mg()?e:Iv("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 Rg(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 zg(){return await Bn(),await Ws()?(ce("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function Ev(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:Pv,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gs(),...e}}}async function Gn(t){const e=Ev(t);if(e)return Oe.loginWithRedirect(e)}async function kv(t){const e=Ev(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 Hg(t){return Gr&&wr(window.location.href)!==wr(`https://${Gr}`)&&(qg()||jg()||Gs())?kv(t):Gn(t)}function Bg(){try{const t=sessionStorage.getItem(In);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<Ng}catch{return sessionStorage.removeItem(In),!1}}function Gg(){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&&Bg()){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}`),Gg(),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 Wg=(t,e)=>e.skipDedupe||e.method!=="GET",Vg=(t,e)=>e.method+"@"+t,Jg=t=>t.clone(),Zg=({skip:t=Wg,key:e=Vg,resolver:r=Jg}={})=>{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)}}},Yg=(t,e)=>t*e,Xg=t=>t&&t.ok,Qg=({delayTimer:t=500,delayRamp:e=Yg,maxAttempts:r=10,until:n=Xg,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 _v 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,_v)}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 ey="application/json",Tv="Content-Type",sr=Symbol(),Rv=Symbol();function yd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===Tv.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 ty(t,e=!1){br.options=e?t:zt(br.options,t)}function ry(t,e=!1){br.polyfills=e?t:zt(br.polyfills,t)}function ny(t){br.errorType=t}const ay=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;let Ov=class extends Error{};const iy=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=ay(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 Ov;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(Rv);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)},oy={_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({[Tv]: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(Rv,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,iy(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||ey).body(JSON.stringify(t))}};function ct(t="",e={}){return{...oy,_url:t,_options:e}}ct.default=ct;ct.options=ty;ct.errorType=ny;ct.polyfills=ry;ct.WretchError=Ov;const sy=(t,e)=>e.skipDedupe||e.method!=="GET",cy=(t,e)=>e.method+"@"+t,uy=t=>t.clone(),ly=({skip:t=sy,key:e=cy,resolver:r=uy}={})=>{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)}}},fy=(t,e)=>e.skipCache||e.method!=="GET",dy=(t,e)=>e.method+"@"+t,hy=()=>!1,vy=()=>null,py=t=>t.ok,my=({throttle:t=1e3,skip:e=fy,key:r=dy,clear:n=hy,invalidate:a=vy,condition:i=py,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},gy=(t,e)=>t*e,yy=t=>t&&t.ok,wy=({delayTimer:t=500,delayRamp:e=gy,maxAttempts:r=10,until:n=yy,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)})},by="@sesamy/sdk",Sy="1.20.0";let Iy=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",Py=t=>{const{libraryName:e=by,libraryVersion:r=Sy,cache:n}=t,a=n?.storage||new Iy,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)},ly()];n?.mode===Pn.NORMAL&&i.push(my({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(wy({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"})},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)})},Id={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},Pd={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},Ey={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},ky={list:async t=>t.request("/payment-issues")},_y={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)}},Ty={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},Ed={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},Ry=t=>{const e=Py(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:()=>Dr.list(e),get:r=>Dr.get(e,r),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:()=>Id.list(e),get:r=>Id.get(e,r)},fulfillments:{list:()=>Pd.list(e),create:r=>Pd.create(e,r)},paywalls:{get:r=>Ey.get(e,r)},paymentIssues:{list:()=>ky.list(e)},proxy:{content:(r,n,a,i)=>_y.content(e,r,n,a,i)},transactions:{list:r=>Ty.list(e,r)},vendor:{get:()=>Ed.get(e),list:()=>Ed.list(e)}}};class Oy{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 Cv(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 kd(t){return t.endsWith("/")?t.slice(0,-1):t}function _d(t,e){if(!ps(t)||!ps(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&kd(r.pathname)===kd(n.pathname)}function Cy(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=Cv(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 Av="sesamySignedURLs";function Ys(){const t=sessionStorage.getItem(Av);return t?JSON.parse(t):[]}function Ay(t){const e=Ys();e.push(t),ce(`Adding signed URL: ${t}`),sessionStorage.setItem(Av,JSON.stringify(e))}function Uy(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const ms="sesamyAttribution";function Ly(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 $y(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function En(){return Ly(ms)||{}}function Uv(t){if(t===null)localStorage.removeItem(ms);else{ce(`Setting attribution ${JSON.stringify(t)}`);const e=En()??{},r=Uy({...e,...$y(t)});localStorage.setItem(ms,JSON.stringify({value:r}))}}const Xs="@sesamy/sesamy-js",Wn="1.72.0",Lv="sesamyFlags";async function $v(t){try{localStorage.setItem(Lv,JSON.stringify(t))}catch{ce("Failed to save flags to localStorage")}}async function qv(t,e){const r=await nn();r[t]=e,await $v(r)}async function jv(t){return(await nn())[t]}async function Nv(t){const e=await nn();t in e&&(delete e[t],await $v(e))}async function nn(){try{const t=localStorage.getItem(Lv);return t?JSON.parse(t):{}}catch{return{}}}function xv(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 qy(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}function jy(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"}},Dv=[],Mv=!1,_t;function Fv(){const t=window.location.pathname;return Dv.find(e=>e.path?t.includes(e.path):!0)}function Ny(t,e){Dv=t.content||[];const r=Fv();r&&r.type==="article"&&(Fe={...Fe,...qy(r.selectors)},Mv=r.enablePaywallSettingsUrlFallback||!1),_t=e}function xy(t,e){const{selector:r,attribute:n}=e;return r===Fe.article.selector||n&&t.hasAttribute(n)?t:t.querySelector(r)}function Kv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Kv(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 zv(){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:xv(e)},n=(i,o,s,u)=>{const l=xy(e,o),c=Kv(l,o)||Qs({publisherContentId:s,key:jy(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=Fv();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)),Mv&&!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 Dy(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 Hv(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||xv(r.parentElement||r);return _t.proxy.getContent(i.token,n.url,o)}function My(t){const e=t.endpoint||ot("api2",t.environment),n=Ry({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 Oy}}),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(),Zg(),Qg({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}=Cv(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||_d(S,I.url))return!0}return!!O.some(_=>_d(_,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(Ag).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=Cy(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:zv,get:an,getLanguage:Br,unlock:Hv,getPropertyFromHTML:Qs},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,flags:{get:jv,set:qv,list:nn,delete:Nv},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 Td(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 Fy="function",Ky="string",tt="undefined",zy="boolean",kn="object",Hy="array",By="number",Gy="symbol",Wy="null",gs=function(){},Bv="any",Gv="*",Jt="__",Vy="form",Jy="input",Zy="button",Yy="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 Wv(t,e){return e.charAt(0)[t]()+e.slice(1)}var Xy=Wv.bind(null,"toUpperCase"),Qy=Wv.bind(null,"toLowerCase");function ew(t){return Vv(t)?Xy(Wy):typeof t===kn?aw(t):Object.prototype.toString.call(t).slice(8,-1)}function Tn(t,e){e===void 0&&(e=!0);var r=ew(t);return e?Qy(r):r}function on(t,e){return typeof e===t}var ze=on.bind(null,Fy),Tt=on.bind(null,Ky),dr=on.bind(null,tt),tw=on.bind(null,zy);on.bind(null,Gy);function Vv(t){return t===null}function rw(t){return Tn(t)===By&&!isNaN(t)}function Jv(t){return Tn(t)===Hy}function Ke(t){if(!nw(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function nw(t){return t&&(typeof t===kn||t!==null)}function aw(t){return ze(t.constructor)?t.constructor.name:null}function iw(t){return t instanceof Error||Tt(t.message)&&t.constructor&&rw(t.constructor.stackTraceLimit)}function Zv(t,e){if(typeof e!="object"||Vv(e))return!1;if(e instanceof t)return!0;var r=Tn(new t(""));if(iw(e))for(;e;){if(Tn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Zv.bind(null,TypeError);Zv.bind(null,SyntaxError);function Vn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?ow(t,e):r}function ow(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,Vy);Jn(Vn,Zy);Jn(Vn,Jy);Jn(Vn,Yy);function sw(t){return t?Jv(t)?t:[t]:[]}function Rd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function cw(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function uw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function lw(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Rd(r[1]),o=Rd(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&&(fw(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 fw(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 dw(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",Yv="@@redux/",ys=Yv+"INIT",hw=Yv+Math.random().toString(36),Od=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),ln=" != "+Et;function Xv(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(Xv)(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})}})[Od]=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)}}})[Od]=function(){return this},d},n}function vw(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 pw(){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}}),Cd=/^utm_/,Ad=/^an_prop_/,Ud=/^an_trait_/;function mw(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(Cd)||p.match(/^(d|g)clid/)){var g=p.replace(Cd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Ad)&&(v.props[p.replace(Ad,"")]=i[p]),p.match(Ud)&&(v.traits[p.replace(Ud,"")]=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 gw(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 Ld(t){return{userId:t.getItem(Bt),anonymousId:t.getItem(Rt),traits:t.getItem(pr)}}var Ss=function(t){return Jt+"TEMP"+Jt+t};function yw(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 $d(t,e){Kr[t]&&ze(Kr[t])&&(Kr[t](e),delete Kr[t])}function Qv(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 Qv(t,e,r-10).then(n,a)})})}function ww(t){return{abort:t}}function ep(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:ww}))&&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:bw(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=Fd(N);if(O&&O.name===S){var q=Fd(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:Nd(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:Nd(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(qd)&&!f.match(jd)&&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(jd)||f.match(qd)||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"}});tp(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$/,qd=/^bootstrap/,jd=/^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 Nd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function xd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Dd(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||Md(r,e)||r&&Md(r.plugins,e))}function tp(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 Md(t,e){return!(!t||!Jr(t))&&t.includes(e)}function Fd(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function bw(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 Sw(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 $d(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 Qv(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 ep(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 tw(_[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=Dd(I).map(function(H){return xd(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Dd(I,J).map(function(ke){return xd(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&&$d(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(tp(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 Iw(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 Pw=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 Ew(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=Kd(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=Kd(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,zd(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,zd(r.plugins,!0,e));default:return e}}}function Kd(t,e){return t.substring(e.length+1,t.length)}function zd(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function rp(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var kw={last:{},history:[]};function _w(t,e){t===void 0&&(t=kw);var r=e.options,n=e.meta;if(e.type===Q.track){var a=rp(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 Tw={actions:[]};function Rw(t,e){t===void 0&&(t=Tw);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 np=/#.*$/;function Ow(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(np,""):"")}var ap,ip,op,sp,Cw=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(np,"")})(l),f={title:r,url:c,path:Ow(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},Aw={last:{},history:[]};function Uw(t,e){t===void 0&&(t=Aw);var r=e.options;if(e.type===Q.page){var n=rp(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}ap=(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"})(),ip=Ce?document.referrer:null,op=cw(),sp=uw();var Hd={initialized:!1,sessionId:Zn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:ap},userAgent:Ce?navigator.userAgent:"node",library:{name:ws,version:"0.13.1"},timezone:sp,locale:op,campaign:{},referrer:ip};function Lw(t,e){t===void 0&&(t=Hd);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({},Hd,t,{initialized:!0})}}var $w=["plugins","reducers","storage"];function qw(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function jw(t){var e=qw.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function cp(){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 Bd(t){return function(){return Pr(Pr.apply(null,arguments),cp())}}function rs(t){return t?Jv(t)?t:[t]:[]}function Gd(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 Nw(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[_]:Ld(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 Pw,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=lw(),P=Ld(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:Cw(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?Td(_,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?Td(_,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=Gd()),_(x)}}},v(fn),Sw(b,c,{all:l,plugins:s}),Iw(a),mw(b),yw(b),v(dn)]),A={context:Lw,user:gw(a),page:Uw,track:_w,plugins:Ew(c),queue:Rw},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?cp():Ke(typeof arguments[0])?Bd():Bd().apply(null,arguments)}}var te,$=(function(I){return Object.keys(I).reduce(function(_,x){return $w.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=Xv((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:hw})===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=vw(De,ue);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==$e}return ae?ke:ne}})(ee({},A,e)),N,z(j(pw.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:Gd(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})}),jw(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return ep(I,_,x)},3e3)})(S,c,b),b}var fn="before",dn="after",Gt="cookie",Dt=fp(),up=Yn,xw=Yn;function lp(t){return Dt?Yn(t,"",-1):Or(t)}function fp(){if(Dt!==void 0)return Dt;var t=Gt+Gt;try{Yn(t,t),Dt=document.cookie.indexOf(t)!==-1,lp(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",Dw=ec.bind(null,mt);Cr(mt,"getItem",Zt);Cr(mt,"setItem",Yt);Cr(mt,"removeItem",Or);var gt="sessionStorage",Mw=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 Fw=Dw(),Kw=Mw(),zw=fp();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(up(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(up(t))),xw(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 Hw(t,e){if(t){var r=tc(e),n=Wt(t,Gv),a={};return!dr(n.localStorage)&&rc(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!dr(n.cookie)&&nc(r)&&(lp(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:Bv}function rc(t){return Fw&&Xn(t,mt)}function nc(t){return zw&&Xn(t,Gt)}function ac(t){return Kw&&Xn(t,gt)}function ic(t){return t===Gv||t==="all"}function Xn(t,e){return t===Bv||t===e||ic(t)}function hn(t,e,r){return{location:t,current:e,previous:r}}var Bw={setItem:Rn,getItem:Wt,removeItem:Hw};function Gw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wd(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 Vd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wd(Object(r),!0).forEach(function(n){Gw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ww(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Bw};return Nw(Vd(Vd({},e),t))}function Vw(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=Zw(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function Jw(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Zw(t){return["#","?"].forEach(e=>t=Jw(t,e)),t}function Yw(){Vw(()=>{dt.page()})}var ns="up",as="down";function Xw(t){if(t===void 0&&(t={}),!Ce)return gs;var e=Zd(),r=Is(),n=Jd(),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=dw(function(){var p=Zd(),g=(function($,M){return M.map(function(N){return N===100?$-5:$*(N/100)})})(p,d),P=Is(),w=Jd(),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 Qw(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Jd(){return Math.round(Is()+Qw())}function Zd(){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",Yd=oc+"Listener";function eb(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"+Yd:"remove"+Yd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?tb(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=sw(t);return e?i.map(function(o){return Tt(o)?On(o,!0):o}).flat():i}function tb(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var is=eb(oc);function dp(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}dp.bind(null,"onerror");dp.bind(null,"onload");var hp=typeof window>"u",Xd="hidden";function rb(t){if(hp)return!1;var e=nb(),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 nb(){var t=["webkit","moz","ms","o"];return hp||Xd in document?Xd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var ab=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function ib(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=rb(function(s){s||r({type:"tabVisible"})});return n=[o].concat(ab.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 ob(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=ib(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 Qd=5e3;class sb{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),ob({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Qd}),Xw({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*Qd: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 vp(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function cb(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 eh="sesamy_session_id";function ub(){let t=sessionStorage.getItem(eh);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(eh,t)),t}let pp=!1,wn,Cn,Ps;function mp(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:ub(),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 gp=cb(async t=>{if(t.length>0){const e=mp(t);pp?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,mp([e]))}else gp.push(t)}function lb(){return pp=!0,gp.flush()}function fb(t,e,r){wn=e,Cn=`${ot("logs",r)}/events`,Ps=t}const db={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"})}},th=["source","medium","campaign","term","content"],kt="utm_",hb=1800*1e3;function yp(t){return t?Date.now()-parseInt(t,10)>hb:!0}function rh(){const t=document.referrer||"";if(!t)return;const e=Wt(`${kt}set_at`);(yp(e)||!Wt(`${kt}referrer`))&&Rn(`${kt}referrer`,t)}function vb(){const t=()=>{const r={};for(const a of th){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(){rh()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${kt}set_at`);if(Object.keys(n).length>0&&yp(a)){for(const o of th){const s=n[o];s&&Rn(`${kt}${o}`,s)}Rn(`${kt}set_at`,String(Date.now()))}rh()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const pb=vb(),nh=new Map,ah=new Map;function mb({clientId:t,enabled:e=!0,environment:r}){fb(t,e,r),e&&(window.addEventListener("beforeunload",()=>{ah.forEach((n,a)=>{n.bind(a)()}),lb()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&nh.forEach((n,a)=>{n.bind(a)()})}),Yw(),vp(()=>{const n=new sb({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})}});ah.set(document.body,()=>{n.flush()}),nh.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=Ww({app:Xs,version:Wn,plugins:[pb,db]});function wp(t,e){dt.track(t,e)}const gb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function yb(){return new Promise(t=>{const e=gb.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 wb(){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 bb(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});wp(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function Sb(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function Ib(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}=My(t),q=()=>A.list(),F={analytics:{track:wp},attribution:{get:En,set:Uv},auth:{getUser:f,getTokenSilently:jt,isAuthenticated:vr,loginWithRedirect:Gn,loginWithPopup:kv,login:Hg,logout:Js,setToken:vs},bills:r,browser:{detectAdblock:yb,isInAppBrowser:wb,isIncognito:Gs},checkouts:n,clearCache:vt,content:{list:zv,get:an,getLanguage:Br,hasAccess:Dy,unlock:Hv,getPropertyFromHTML:Qs},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:Ys},events:{emit:bb,cancel:Sb},flags:{get:jv,set:qv,list:nn,delete:Nv},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:Pb,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 Pb(){return Wn}function Eb(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 kb(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 sc(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 kb(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 _b(t,e){const r=e.insertionPoint||"inside",n=await sc(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 Tb(t,e){const r=await sc(e);t.innerHTML=r}async function Rb(t,e){const r=await sc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Ob({enabled:t=!1,rules:e}){t&&vp(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 _b(s,a);break;case"replace":await Tb(s,a);break;case"remove":o.remove();break;case"wrap":await Rb(s,a);break;case"gradient":Eb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const ih="access_token";function Cb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(ih);if(e){vs(e);const r=new URL(window.location.href);t.delete(ih),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const oh="sesamy-refresh",sh="force-refetch-entitlements";function Ab(){const t=new URLSearchParams(window.location.search),e=t.get(sh),r=t.get(oh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(sh),t.delete(oh),n.search=t.toString(),vt(),window.history.replaceState(null,"",n)}}function Ub(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 Lb(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Ub(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()};Ay(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 ch="sesamy-user";async function $b(){const e=new URLSearchParams(window.location.search).get(ch)?.toLowerCase();if(!e)return;const r=await zg();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(ch),window.history.replaceState(null,"",n)}const uh="sesamy-purchase";function qb(){const t=new URLSearchParams(window.location.search),e=t.get(uh);if(e!==null){const r=new URL(window.location.href);t.delete(uh),r.search=t.toString(),ce(`Purchase ${e}`),Vt(Be.PURCHASE,{itemSrc:e}),vt(),window.history.replaceState(null,"",r)}}const lh="sesamy-login",jb="sesamy_login";async function Nb(){const t=new URLSearchParams(window.location.search);if(!(t.get(lh)||t.get(jb)))return;await vr()||Gn();const n=new URL(window.location.href);n.searchParams.delete(lh),window.history.replaceState(null,"",n)}const fh="sesamy-debug";async function xb(){const e=new URLSearchParams(window.location.search).get(fh)?.toLowerCase();if(!e)return;Dm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(fh),window.history.replaceState(null,"",r)}function Db(){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 Mb(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:Db()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),Uv(r)}function Fb(){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(gd)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(gd,"true"),n||(ce("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Kb(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 zb(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 Hb(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 dh(t,e){ce(`Init with config: ${JSON.stringify(t)}`);try{Fb(),mb({clientId:t.clientId,environment:t.environment,...t.analytics}),await Kg({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),Ny(t,e),t.transform&&await Ob(t.transform),$g(),xb(),Mb(e),Cb(),Ab(),Lb(),await Nb(),await $b(),qb(),await zb(e),await Kb(e),await Hb(e),exports.isInitialized=!0,Vt(Be.READY,{})}catch(r){ce(`Failed to init ${r.message}`)}}async function bp(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=Ib({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Vr()?(t.awaitAllServices?await dh(t,r):dh(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);bp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Be;exports.init=bp;
|