@sesamy/sesamy-js 1.58.0 → 1.59.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.
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vc={},ia,pc;function xe(){return pc||(pc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,mc;function Cn(){if(mc)return oa;mc=1;var t=xe();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,gc;function be(){if(gc)return sa;gc=1;var t=Cn(),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,yc;function An(){if(yc)return ca;yc=1;var t=be(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,wc;function vh(){if(wc)return ua;wc=1;var t=be(),e=xe(),r=An(),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,bc;function Un(){return bc||(bc=1,la=function(t){return t==null}),la}var fa,Sc;function $n(){if(Sc)return fa;Sc=1;var t=Un(),e=TypeError;return fa=function(r){if(t(r))throw new e("Can't call method on "+r);return r},fa}var da,Ic;function Jr(){if(Ic)return da;Ic=1;var t=vh(),e=$n();return da=function(r){return t(e(r))},da}var Ar,Pc;function Se(){if(Pc)return Ar;Pc=1;var t=function(e){return e&&e.Math===Math&&e};return Ar=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof hc=="object"&&hc)||t(typeof Ar=="object"&&Ar)||(function(){return this})()||Function("return this")(),Ar}var ha={exports:{}},va,Ec;function mt(){return Ec||(Ec=1,va=!1),va}var pa,kc;function Es(){if(kc)return pa;kc=1;var t=Se(),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 _c;function ks(){if(_c)return ha.exports;_c=1;var t=mt(),e=Se(),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 ph(){if(Rc)return ma;Rc=1;var t=ks();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Tc;function Ln(){if(Tc)return ga;Tc=1;var t=$n(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,Oc;function rt(){if(Oc)return ya;Oc=1;var t=be(),e=Ln(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Cc;function mh(){if(Cc)return wa;Cc=1;var t=be(),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,Ac;function Zr(){if(Ac)return ba;Ac=1;var t=Se(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,Uc;function gh(){if(Uc)return Sa;Uc=1;var t=Se(),e=Zr(),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,$c;function yh(){if($c)return Ia;$c=1;var t=gh(),e=xe(),r=Se(),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,Lc;function wh(){if(Lc)return Pa;Lc=1;var t=yh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,jc;function De(){if(jc)return Ea;jc=1;var t=Se(),e=ph(),r=rt(),n=mh(),a=yh(),i=wh(),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,qc;function Pe(){if(qc)return ka;qc=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,Nc;function nt(){if(Nc)return _a;Nc=1;var t=Pe();return _a=function(e){return typeof e=="object"?e!==null:t(e)},_a}var Ra,xc;function ct(){if(xc)return Ra;xc=1;var t=nt(),e=String,r=TypeError;return Ra=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ra}var Ta={},Oa,Dc;function Me(){if(Dc)return Oa;Dc=1;var t=xe();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Mc;function bh(){if(Mc)return Ca;Mc=1;var t=Me(),e=xe();return Ca=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ca}var Aa={},Ua,Fc;function jn(){if(Fc)return Ua;Fc=1;var t=Se(),e=nt(),r=t.document,n=e(r)&&e(r.createElement);return Ua=function(a){return n?r.createElement(a):{}},Ua}var $a,Kc;function Sh(){if(Kc)return $a;Kc=1;var t=Me(),e=xe(),r=jn();return $a=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),$a}var La,zc;function ze(){if(zc)return La;zc=1;var t=Cn(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var ja,Hc;function at(){if(Hc)return ja;Hc=1;var t=Se(),e=Pe(),r=function(n){return e(n)?n:void 0};return ja=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},ja}var qa,Bc;function qn(){if(Bc)return qa;Bc=1;var t=be();return qa=t({}.isPrototypeOf),qa}var Na,Gc;function Ih(){if(Gc)return Na;Gc=1;var t=at(),e=Pe(),r=qn(),n=wh(),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,Wc;function Nn(){if(Wc)return xa;Wc=1;var t=String;return xa=function(e){try{return t(e)}catch{return"Object"}},xa}var Da,Vc;function ut(){if(Vc)return Da;Vc=1;var t=Pe(),e=Nn(),r=TypeError;return Da=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Da}var Ma,Jc;function _s(){if(Jc)return Ma;Jc=1;var t=ut(),e=Un();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,Zc;function yp(){if(Zc)return Fa;Zc=1;var t=ze(),e=Pe(),r=nt(),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,Yc;function wp(){if(Yc)return Ka;Yc=1;var t=ze(),e=nt(),r=Ih(),n=_s(),a=yp(),i=De(),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,Xc;function Ph(){if(Xc)return za;Xc=1;var t=wp(),e=Ih();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var Qc;function _t(){if(Qc)return Aa;Qc=1;var t=Me(),e=Sh(),r=bh(),n=ct(),a=Ph(),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,eu;function bp(){if(eu)return Ha;eu=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,tu;function Rs(){if(tu)return Ba;tu=1;var t=bp();return Ba=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ba}var Ga,ru;function Eh(){if(ru)return Ga;ru=1;var t=Rs(),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,nu;function Sp(){if(nu)return Wa;nu=1;var t=Rs(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,au;function Ts(){if(au)return Va;au=1;var t=Sp();return Va=function(e){return t(e.length)},Va}var Ja,iu;function Ip(){if(iu)return Ja;iu=1;var t=Jr(),e=Eh(),r=Ts(),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,ou;function Os(){return ou||(ou=1,Za={}),Za}var Ya,su;function kh(){if(su)return Ya;su=1;var t=be(),e=rt(),r=Jr(),n=Ip().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,cu;function Cs(){return cu||(cu=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,uu;function _h(){if(uu)return Qa;uu=1;var t=kh(),e=Cs();return Qa=Object.keys||function(n){return t(n,e)},Qa}var lu;function Pp(){if(lu)return Ta;lu=1;var t=Me(),e=bh(),r=_t(),n=ct(),a=Jr(),i=_h();return Ta.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},Ta}var ei,fu;function Rh(){if(fu)return ei;fu=1;var t=at();return ei=t("document","documentElement"),ei}var ti,du;function As(){if(du)return ti;du=1;var t=ph(),e=mh(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,hu;function Yr(){if(hu)return ri;hu=1;var t=ct(),e=Pp(),r=Cs(),n=Os(),a=Rh(),i=jn(),o=As(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+c+":",m;return w.style.display="none",a.appendChild(w),w.src=String(y),m=w.contentWindow.document,m.open(),m.write(d("document.F=Object")),m.close(),m.F},g,S=function(){try{g=new ActiveXObject("htmlfile")}catch{}S=typeof document<"u"?document.domain&&g?v(g):p():v(g);for(var w=r.length;w--;)delete S[l][r[w]];return S()};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=S(),m===void 0?b:e.f(b,m)},ri}var ni,vu;function Ep(){if(vu)return ni;vu=1;var t=De(),e=Yr(),r=_t().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,pu;function Xr(){return pu||(pu=1,ai={}),ai}var ii,mu;function kp(){if(mu)return ii;mu=1;var t=Se(),e=Pe(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,gu;function Qt(){return gu||(gu=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,yu;function er(){if(yu)return si;yu=1;var t=Me(),e=_t(),r=Qt();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,wu;function Pr(){if(wu)return ci;wu=1;var t=kp(),e=Se(),r=nt(),n=er(),a=rt(),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 S=o("state");s[S]=!0,f=function(w,y){if(a(w,S))throw new l(u);return y.facade=w,n(w,S,y),y},h=function(w){return a(w,S)?w[S]:{}},d=function(w){return a(w,S)}}return ci={set:f,get:h,has:d,enforce:v,getterFor:p},ci}var ui={},li={},bu;function Th(){if(bu)return li;bu=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 Su;function Oh(){if(Su)return ui;Su=1;var t=Me(),e=ze(),r=Th(),n=Qt(),a=Jr(),i=Ph(),o=rt(),s=Sh(),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,Iu;function Ch(){if(Iu)return di;Iu=1;var t=Me(),e=rt(),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,Pu;function Us(){if(Pu)return hi;Pu=1;var t=be(),e=Pe(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var Eu;function Ah(){if(Eu)return fi.exports;Eu=1;var t=be(),e=xe(),r=Pe(),n=rt(),a=Me(),i=Ch().CONFIGURABLE,o=Us(),s=Pr(),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"),S=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=S(function(){return r(this)&&l(this).source||o(this)},"toString"),fi.exports}var vi,ku;function it(){if(ku)return vi;ku=1;var t=Pe(),e=_t(),r=Ah(),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={},_u;function _p(){if(_u)return pi;_u=1;var t=kh(),e=Cs(),r=e.concat("length","prototype");return pi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},pi}var mi={},Ru;function Uh(){return Ru||(Ru=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Tu;function Rp(){if(Tu)return gi;Tu=1;var t=at(),e=be(),r=_p(),n=Uh(),a=ct(),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,Ou;function $h(){if(Ou)return yi;Ou=1;var t=rt(),e=Rp(),r=Oh(),n=_t();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,Cu;function Lh(){if(Cu)return wi;Cu=1;var t=xe(),e=Pe(),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,Au;function Re(){if(Au)return bi;Au=1;var t=Se(),e=Oh().f,r=er(),n=it(),a=Es(),i=$h(),o=Lh();return bi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,S;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?(S=e(d,v),p=S&&S.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,Uu;function Tp(){if(Uu)return Si;Uu=1;var t=xe();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,$u;function $s(){if($u)return Ii;$u=1;var t=rt(),e=Pe(),r=Ln(),n=As(),a=Tp(),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,Lu;function jh(){if(Lu)return Pi;Lu=1;var t=xe(),e=Pe(),r=nt(),n=Yr(),a=$s(),i=it(),o=De(),s=mt(),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 Er(){if(ju)return Ei;ju=1;var t=_t().f,e=rt(),r=De(),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,qu;function qh(){if(qu)return ki;qu=1;var t=jh().IteratorPrototype,e=Yr(),r=Qt(),n=Er(),a=Xr(),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,Nu;function Op(){if(Nu)return _i;Nu=1;var t=be(),e=ut();return _i=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},_i}var Ri,xu;function Cp(){if(xu)return Ri;xu=1;var t=nt();return Ri=function(e){return t(e)||e===null},Ri}var Ti,Du;function Ap(){if(Du)return Ti;Du=1;var t=Cp(),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 Oi,Mu;function Ls(){if(Mu)return Oi;Mu=1;var t=Op(),e=nt(),r=$n(),n=Ap();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,Fu;function Nh(){if(Fu)return Ci;Fu=1;var t=Re(),e=ze(),r=mt(),n=Ch(),a=Pe(),i=qh(),o=$s(),s=Ls(),u=Er(),l=er(),c=it(),f=De(),h=Xr(),d=jh(),v=n.PROPER,p=n.CONFIGURABLE,g=d.IteratorPrototype,S=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",O=function(){return this};return Ci=function(A,j,z,B,ie,L,D){i(z,j,B);var q=function(V){if(V===ie&&I)return I;if(!S&&V&&V in te)return te[V];switch(V){case y:return function(){return new z(this,V)};case m:return function(){return new z(this,V)};case b:return function(){return new z(this,V)}}return function(){return new z(this)}},T=j+" Iterator",Y=!1,te=A.prototype,Q=te[w]||te["@@iterator"]||ie&&te[ie],I=!S&&Q||q(ie),_=j==="Array"&&te.entries||Q,N,F,Z;if(_&&(N=o(_.call(new A)),N!==Object.prototype&&N.next&&(!r&&o(N)!==g&&(s?s(N,g):a(N[w])||c(N,w,O)),u(N,T,!0,!0),r&&(h[T]=O))),v&&ie===m&&Q&&Q.name!==m&&(!r&&p?l(te,"name",m):(Y=!0,I=function(){return e(Q,this)})),ie)if(F={values:q(m),keys:L?I:q(y),entries:q(b)},D)for(Z in F)(S||Y||!(Z in te))&&c(te,Z,F[Z]);else t({target:j,proto:!0,forced:S||Y},F);return(!r||D)&&te[w]!==I&&c(te,w,I,{name:ie}),h[j]=I,F},Ci}var Ai,Ku;function js(){return Ku||(Ku=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,zu;function qs(){if(zu)return Ui;zu=1;var t=Jr(),e=Ep(),r=Xr(),n=Pr(),a=_t().f,i=Nh(),o=js(),s=mt(),u=Me(),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 Hu={},Bu;function Up(){if(Bu)return Hu;Bu=1;var t=Re(),e=be(),r=Eh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Hu}var $i,Gu;function xh(){if(Gu)return $i;Gu=1;var t=Se(),e=Me(),r=Object.getOwnPropertyDescriptor;return $i=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},$i}var Li,Wu;function xn(){if(Wu)return Li;Wu=1;var t=xe(),e=De(),r=Me(),n=mt(),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 ji,Vu;function Dn(){if(Vu)return ji;Vu=1;var t=Ah(),e=_t();return ji=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)},ji}var qi,Ju;function $p(){if(Ju)return qi;Ju=1;var t=it();return qi=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},qi}var Ni,Zu;function Ns(){if(Zu)return Ni;Zu=1;var t=qn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var xi,Yu;function Lp(){if(Yu)return xi;Yu=1;var t=An(),e=be();return xi=function(r){if(t(r)==="Function")return e(r)},xi}var Di,Xu;function kr(){if(Xu)return Di;Xu=1;var t=Lp(),e=ut(),r=Cn(),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,Qu;function xs(){if(Qu)return Mi;Qu=1;var t=De(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,el;function Qr(){if(el)return Fi;el=1;var t=xs(),e=Pe(),r=An(),n=De(),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,tl;function Rt(){if(tl)return Ki;tl=1;var t=Qr(),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,rl;function Mn(){if(rl)return zi;rl=1;var t=Qr(),e=_s(),r=Un(),n=Xr(),a=De(),i=a("iterator");return zi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},zi}var Hi,nl;function Ds(){if(nl)return Hi;nl=1;var t=ze(),e=ut(),r=ct(),n=Nn(),a=Mn(),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,al;function tr(){if(al)return Bi;al=1;var t=TypeError;return Bi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Bi}var Gi,il;function Fn(){if(il)return Gi;il=1;var t=be();return Gi=t([].slice),Gi}var Wi,ol;function jp(){if(ol)return Wi;ol=1;var t=Fn(),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,sl;function Dh(){if(sl)return Vi;sl=1,qs(),Up();var t=Re(),e=Se(),r=xh(),n=at(),a=ze(),i=be(),o=Me(),s=xn(),u=it(),l=Dn(),c=$p(),f=Er(),h=qh(),d=Pr(),v=Ns(),p=Pe(),g=rt(),S=kr(),w=Qr(),y=ct(),m=nt(),b=Rt(),O=Yr(),A=Qt(),j=Ds(),z=Mn(),B=js(),ie=tr(),L=De(),D=jp(),q=L("iterator"),T="URLSearchParams",Y=T+"Iterator",te=d.set,Q=d.getterFor(T),I=d.getterFor(Y),_=r("fetch"),N=r("Request"),F=r("Headers"),Z=N&&N.prototype,V=F&&F.prototype,he=e.TypeError,oe=e.encodeURIComponent,le=String.fromCharCode,se=n("String","fromCodePoint"),ke=parseInt,Ue=i("".charAt),Fe=i([].join),Te=i([].push),Ze=i("".replace),lt=i([].shift),ft=i([].splice),gt=i("".split),yt=i("".slice),R=i(/./.exec),K=/\+/g,J="�",re=/^[0-9a-f]+$/i,me=function(x,G){var W=yt(x,G,G+2);return R(re,W)?ke(W,16):NaN},Oe=function(x){for(var G=0,W=128;W>0&&(x&W)!==0;W>>=1)G++;return G},M=function(x){var G=null;switch(x.length){case 1:G=x[0];break;case 2:G=(x[0]&31)<<6|x[1]&63;break;case 3:G=(x[0]&15)<<12|(x[1]&63)<<6|x[2]&63;break;case 4:G=(x[0]&7)<<18|(x[1]&63)<<12|(x[2]&63)<<6|x[3]&63;break}return G>1114111?null:G},ee=function(x){x=Ze(x,K," ");for(var G=x.length,W="",X=0;X<G;){var ue=Ue(x,X);if(ue==="%"){if(Ue(x,X+1)==="%"||X+3>G){W+="%",X++;continue}var de=me(x,X+1);if(de!==de){W+=ue,X++;continue}X+=2;var ye=Oe(de);if(ye===0)ue=le(de);else{if(ye===1||ye>4){W+=J,X++;continue}for(var we=[de],Ee=1;Ee<ye&&(X++,!(X+3>G||Ue(x,X)!=="%"));){var Ke=me(x,X+1);if(Ke!==Ke){X+=3;break}if(Ke>191||Ke<128)break;Te(we,Ke),X+=2,Ee++}if(we.length!==ye){W+=J;continue}var dt=M(we);dt===null?W+=J:ue=se(dt)}}W+=ue,X++}return W},fe=/[!'()~]|%20/g,ve={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ge=function(x){return ve[x]},Ye=function(x){return Ze(oe(x),fe,ge)},$e=h(function(G,W){te(this,{type:Y,target:Q(G).entries,index:0,kind:W})},T,function(){var G=I(this),W=G.target,X=G.index++;if(!W||X>=W.length)return G.target=null,B(void 0,!0);var ue=W[X];switch(G.kind){case"keys":return B(ue.key,!1);case"values":return B(ue.value,!1)}return B([ue.key,ue.value],!1)},!0),Be=function(x){this.entries=[],this.url=null,x!==void 0&&(m(x)?this.parseObject(x):this.parseQuery(typeof x=="string"?Ue(x,0)==="?"?yt(x,1):x:b(x)))};Be.prototype={type:T,bindURL:function(x){this.url=x,this.update()},parseObject:function(x){var G=this.entries,W=z(x),X,ue,de,ye,we,Ee,Ke;if(W)for(X=j(x,W),ue=X.next;!(de=a(ue,X)).done;){if(ye=j(y(de.value)),we=ye.next,(Ee=a(we,ye)).done||(Ke=a(we,ye)).done||!a(we,ye).done)throw new he("Expected sequence with length 2");Te(G,{key:b(Ee.value),value:b(Ke.value)})}else for(var dt in x)g(x,dt)&&Te(G,{key:dt,value:b(x[dt])})},parseQuery:function(x){if(x)for(var G=this.entries,W=gt(x,"&"),X=0,ue,de;X<W.length;)ue=W[X++],ue.length&&(de=gt(ue,"="),Te(G,{key:ee(lt(de)),value:ee(Fe(de,"="))}))},serialize:function(){for(var x=this.entries,G=[],W=0,X;W<x.length;)X=x[W++],Te(G,Ye(X.key)+"="+Ye(X.value));return Fe(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Le=function(){v(this,Xe);var G=arguments.length>0?arguments[0]:void 0,W=te(this,new Be(G));o||(this.size=W.entries.length)},Xe=Le.prototype;if(c(Xe,{append:function(G,W){var X=Q(this);ie(arguments.length,2),Te(X.entries,{key:b(G),value:b(W)}),o||this.length++,X.updateURL()},delete:function(x){for(var G=Q(this),W=ie(arguments.length,1),X=G.entries,ue=b(x),de=W<2?void 0:arguments[1],ye=de===void 0?de:b(de),we=0;we<X.length;){var Ee=X[we];if(Ee.key===ue&&(ye===void 0||Ee.value===ye)){if(ft(X,we,1),ye!==void 0)break}else we++}o||(this.size=X.length),G.updateURL()},get:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=b(G),ue=0;ue<W.length;ue++)if(W[ue].key===X)return W[ue].value;return null},getAll:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=b(G),ue=[],de=0;de<W.length;de++)W[de].key===X&&Te(ue,W[de].value);return ue},has:function(G){for(var W=Q(this).entries,X=ie(arguments.length,1),ue=b(G),de=X<2?void 0:arguments[1],ye=de===void 0?de:b(de),we=0;we<W.length;){var Ee=W[we++];if(Ee.key===ue&&(ye===void 0||Ee.value===ye))return!0}return!1},set:function(G,W){var X=Q(this);ie(arguments.length,1);for(var ue=X.entries,de=!1,ye=b(G),we=b(W),Ee=0,Ke;Ee<ue.length;Ee++)Ke=ue[Ee],Ke.key===ye&&(de?ft(ue,Ee--,1):(de=!0,Ke.value=we));de||Te(ue,{key:ye,value:we}),o||(this.size=ue.length),X.updateURL()},sort:function(){var G=Q(this);D(G.entries,function(W,X){return W.key>X.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=Q(this).entries,X=S(G,arguments.length>1?arguments[1]:void 0),ue=0,de;ue<W.length;)de=W[ue++],X(de.value,de.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(Xe,q,Xe.entries,{name:"entries"}),u(Xe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Xe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Le,T),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Le}),!s&&p(F)){var rr=i(V.has),Cr=i(V.set),nr=function(x){if(m(x)){var G=x.body,W;if(w(G)===T)return W=x.headers?new F(x.headers):new F,rr(W,"content-type")||Cr(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),O(x,{body:A(0,b(G)),headers:A(0,W)})}return x};if(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?nr(arguments[1]):{})}}),p(N)){var ar=function(G){return v(this,Z),new N(G,arguments.length>1?nr(arguments[1]):{})};Z.constructor=ar,ar.prototype=Z,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ar})}}return Vi={URLSearchParams:Le,getState:Q},Vi}var cl;function qp(){return cl||(cl=1,Dh()),vc}var ul={},ll;function Np(){if(ll)return ul;ll=1;var t=it(),e=be(),r=Rt(),n=tr(),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(O,A){l(v,{key:A,value:O})}),n(h,1);for(var p=r(f),g=r(d),S=0,w=0,y=!1,m=v.length,b;S<m;)b=v[S++],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}),ul}var fl={},dl;function xp(){if(dl)return fl;dl=1;var t=it(),e=be(),r=Rt(),n=tr(),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}),fl}var hl={},vl;function Dp(){if(vl)return hl;vl=1;var t=Me(),e=be(),r=Dn(),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}),hl}var Ji,pl;function Kn(){if(pl)return Ji;pl=1;var t=Se();return Ji=t,Ji}var Zi,ml;function Mh(){if(ml)return Zi;ml=1,qp(),Np(),xp(),Dp();var t=Kn();return Zi=t.URLSearchParams,Zi}var gl={},yl={},wl={},Yi,bl;function Fh(){if(bl)return Yi;bl=1;var t=be(),e=Rs(),r=Rt(),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 Yi={codeAt:s(!1),charAt:s(!0)},Yi}var Sl;function Kh(){if(Sl)return wl;Sl=1;var t=Fh().charAt,e=Rt(),r=Pr(),n=Nh(),a=js(),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))}),wl}var Xi,Il;function Mp(){if(Il)return Xi;Il=1;var t=Me(),e=be(),r=ze(),n=xe(),a=_h(),i=Uh(),o=Th(),s=Ln(),u=vh(),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,S=1,w=i.f,y=o.f;g>S;)for(var m=u(arguments[S++]),b=w?f(a(m),w(m)):a(m),O=b.length,A=0,j;O>A;)j=b[A++],(!t||r(y,m,j))&&(p[j]=m[j]);return p}:l,Xi}var Qi,Pl;function zh(){if(Pl)return Qi;Pl=1;var t=ze(),e=ct(),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,El;function Fp(){if(El)return eo;El=1;var t=ct(),e=zh();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,kl;function Hh(){if(kl)return to;kl=1;var t=De(),e=Xr(),r=t("iterator"),n=Array.prototype;return to=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},to}var ro,_l;function Bh(){if(_l)return ro;_l=1;var t=be(),e=xe(),r=Pe(),n=Qr(),a=at(),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 Kp(){if(Rl)return no;Rl=1;var t=Me(),e=_t(),r=Qt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Tl;function zp(){if(Tl)return ao;Tl=1;var t=kr(),e=ze(),r=Ln(),n=Fp(),a=Hh(),i=Bh(),o=Ts(),s=Kp(),u=Ds(),l=Mn(),c=Array;return ao=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,S=g!==void 0;S&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,O,A,j,z;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),j=A.next;!(O=e(j,A)).done;y++)z=S?n(A,g,[O.value,y],!0):O.value,s(b,y,z);else for(m=o(d),b=v?new this(m):c(m);m>y;y++)z=S?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},ao}var io,Ol;function Hp(){if(Ol)return io;Ol=1;var t=be(),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,S=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),O=t("".split),A=t("".toLowerCase),j=function(L){for(var D=[],q=0,T=L.length;q<T;){var Y=w(L,q++);if(Y>=55296&&Y<=56319&&q<T){var te=w(L,q++);(te&64512)===56320?m(D,((Y&1023)<<10)+(te&1023)+65536):(m(D,Y),q--)}else m(D,Y)}return D},z=function(L){return L+22+75*(L<26)},B=function(L,D,q){var T=0;for(L=q?g(L/o):L>>1,L+=g(L/D);L>d*a>>1;)L=g(L/d),T+=r;return g(T+(d+1)*L/(L+i))},ie=function(L){var D=[];L=j(L);var q=L.length,T=u,Y=0,te=s,Q,I;for(Q=0;Q<L.length;Q++)I=L[Q],I<128&&m(D,S(I));var _=D.length,N=_;for(_&&m(D,l);N<q;){var F=e;for(Q=0;Q<L.length;Q++)I=L[Q],I>=T&&I<F&&(F=I);var Z=N+1;if(F-T>g((e-Y)/Z))throw new v(h);for(Y+=(F-T)*Z,T=F,Q=0;Q<L.length;Q++){if(I=L[Q],I<T&&++Y>e)throw new v(h);if(I===T){for(var V=Y,he=r;;){var oe=he<=te?n:he>=te+a?a:he-te;if(V<oe)break;var le=V-oe,se=r-oe;m(D,S(z(oe+le%se))),V=g(le/se),he+=r}m(D,S(z(V))),te=B(Y,Z,N===_),Y=0,N++}}Y++,T++}return y(D,"")};return io=function(L){var D=[],q=O(b(A(L),f,"."),"."),T,Y;for(T=0;T<q.length;T++)Y=q[T],m(D,p(c,Y)?"xn--"+ie(Y):Y);return y(D,".")},io}var Cl;function Bp(){if(Cl)return yl;Cl=1,Kh();var t=Re(),e=Me(),r=xn(),n=Se(),a=kr(),i=be(),o=it(),s=Dn(),u=Ns(),l=rt(),c=Mp(),f=zp(),h=Fn(),d=Fh().codeAt,v=Hp(),p=Rt(),g=Er(),S=tr(),w=Dh(),y=Pr(),m=y.set,b=y.getterFor("URL"),O=w.URLSearchParams,A=w.getState,j=n.URL,z=n.TypeError,B=n.parseInt,ie=Math.floor,L=Math.pow,D=i("".charAt),q=i(/./.exec),T=i([].join),Y=i(1.1.toString),te=i([].pop),Q=i([].push),I=i("".replace),_=i([].shift),N=i("".split),F=i("".slice),Z=i("".toLowerCase),V=i([].unshift),he="Invalid authority",oe="Invalid scheme",le="Invalid host",se="Invalid port",ke=/[a-z]/i,Ue=/[\d+-.a-z]/i,Fe=/\d/,Te=/^0x/i,Ze=/^[0-7]+$/,lt=/^\d+$/,ft=/^[\da-f]+$/i,gt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yt=/[\0\t\n\r #/:<>?@[\\\]^|]/,R=/^[\u0000-\u0020]+/,K=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,J=/[\t\n\r]/g,re,me=function(E){var $=N(E,"."),k,P,C,ce,H,Ie,_e;if($.length&&$[$.length-1]===""&&$.length--,k=$.length,k>4)return E;for(P=[],C=0;C<k;C++){if(ce=$[C],ce==="")return E;if(H=10,ce.length>1&&D(ce,0)==="0"&&(H=q(Te,ce)?16:8,ce=F(ce,H===8?1:2)),ce==="")Ie=0;else{if(!q(H===10?lt:H===8?Ze:ft,ce))return E;Ie=B(ce,H)}Q(P,Ie)}for(C=0;C<k;C++)if(Ie=P[C],C===k-1){if(Ie>=L(256,5-k))return null}else if(Ie>255)return null;for(_e=te(P),C=0;C<P.length;C++)_e+=P[C]*L(256,3-C);return _e},Oe=function(E){var $=[0,0,0,0,0,0,0,0],k=0,P=null,C=0,ce,H,Ie,_e,je,et,U,Ce=function(){return D(E,C)};if(Ce()===":"){if(D(E,1)!==":")return;C+=2,k++,P=k}for(;Ce();){if(k===8)return;if(Ce()===":"){if(P!==null)return;C++,k++,P=k;continue}for(ce=H=0;H<4&&q(ft,Ce());)ce=ce*16+B(Ce(),16),C++,H++;if(Ce()==="."){if(H===0||(C-=H,k>6))return;for(Ie=0;Ce();){if(_e=null,Ie>0)if(Ce()==="."&&Ie<4)C++;else return;if(!q(Fe,Ce()))return;for(;q(Fe,Ce());){if(je=B(Ce(),10),_e===null)_e=je;else{if(_e===0)return;_e=_e*10+je}if(_e>255)return;C++}$[k]=$[k]*256+_e,Ie++,(Ie===2||Ie===4)&&k++}if(Ie!==4)return;break}else if(Ce()===":"){if(C++,!Ce())return}else if(Ce())return;$[k++]=ce}if(P!==null)for(et=k-P,k=7;k!==0&&et>0;)U=$[k],$[k--]=$[P+et-1],$[P+--et]=U;else if(k!==8)return;return $},M=function(E){for(var $=null,k=1,P=null,C=0,ce=0;ce<8;ce++)E[ce]!==0?(C>k&&($=P,k=C),P=null,C=0):(P===null&&(P=ce),++C);return C>k?P:$},ee=function(E){var $,k,P,C;if(typeof E=="number"){for($=[],k=0;k<4;k++)V($,E%256),E=ie(E/256);return T($,".")}if(typeof E=="object"){for($="",P=M(E),k=0;k<8;k++)C&&E[k]===0||(C&&(C=!1),P===k?($+=k?":":"::",C=!0):($+=Y(E[k],16),k<7&&($+=":")));return"["+$+"]"}return E},fe={},ve=c({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),ge=c({},ve,{"#":1,"?":1,"{":1,"}":1}),Ye=c({},ge,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$e=function(E,$){var k=d(E,0);return k>32&&k<127&&!l($,E)?E:encodeURIComponent(E)},Be={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Le=function(E,$){var k;return E.length===2&&q(ke,D(E,0))&&((k=D(E,1))===":"||!$&&k==="|")},Xe=function(E){var $;return E.length>1&&Le(F(E,0,2))&&(E.length===2||($=D(E,2))==="/"||$==="\\"||$==="?"||$==="#")},rr=function(E){return E==="."||Z(E)==="%2e"},Cr=function(E){return E=Z(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},nr={},ar={},x={},G={},W={},X={},ue={},de={},ye={},we={},Ee={},Ke={},dt={},ea={},sc={},ta={},ir={},ht={},cc={},jt={},wt={},ra=function(E,$,k){var P=p(E),C,ce,H;if($){if(ce=this.parse(P),ce)throw new z(ce);this.searchParams=null}else{if(k!==void 0&&(C=new ra(k,!0)),ce=this.parse(P,null,C),ce)throw new z(ce);H=A(new O),H.bindURL(this),this.searchParams=H}};ra.prototype={type:"URL",parse:function(E,$,k){var P=this,C=$||nr,ce=0,H="",Ie=!1,_e=!1,je=!1,et,U,Ce,bt;for(E=p(E),$||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=I(E,R,""),E=I(E,K,"$1")),E=I(E,J,""),et=f(E);ce<=et.length;){switch(U=et[ce],C){case nr:if(U&&q(ke,U))H+=Z(U),C=ar;else{if($)return oe;C=x;continue}break;case ar:if(U&&(q(Ue,U)||U==="+"||U==="-"||U==="."))H+=Z(U);else if(U===":"){if($&&(P.isSpecial()!==l(Be,H)||H==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=H,$){P.isSpecial()&&Be[P.scheme]===P.port&&(P.port=null);return}H="",P.scheme==="file"?C=ea:P.isSpecial()&&k&&k.scheme===P.scheme?C=G:P.isSpecial()?C=de:et[ce+1]==="/"?(C=W,ce++):(P.cannotBeABaseURL=!0,Q(P.path,""),C=cc)}else{if($)return oe;H="",C=x,ce=0;continue}break;case x:if(!k||k.cannotBeABaseURL&&U!=="#")return oe;if(k.cannotBeABaseURL&&U==="#"){P.scheme=k.scheme,P.path=h(k.path),P.query=k.query,P.fragment="",P.cannotBeABaseURL=!0,C=wt;break}C=k.scheme==="file"?ea:X;continue;case G:if(U==="/"&&et[ce+1]==="/")C=ye,ce++;else{C=X;continue}break;case W:if(U==="/"){C=we;break}else{C=ht;continue}case X:if(P.scheme=k.scheme,U===re)P.username=k.username,P.password=k.password,P.host=k.host,P.port=k.port,P.path=h(k.path),P.query=k.query;else if(U==="/"||U==="\\"&&P.isSpecial())C=ue;else if(U==="?")P.username=k.username,P.password=k.password,P.host=k.host,P.port=k.port,P.path=h(k.path),P.query="",C=jt;else if(U==="#")P.username=k.username,P.password=k.password,P.host=k.host,P.port=k.port,P.path=h(k.path),P.query=k.query,P.fragment="",C=wt;else{P.username=k.username,P.password=k.password,P.host=k.host,P.port=k.port,P.path=h(k.path),P.path.length--,C=ht;continue}break;case ue:if(P.isSpecial()&&(U==="/"||U==="\\"))C=ye;else if(U==="/")C=we;else{P.username=k.username,P.password=k.password,P.host=k.host,P.port=k.port,C=ht;continue}break;case de:if(C=ye,U!=="/"||D(H,ce+1)!=="/")continue;ce++;break;case ye:if(U!=="/"&&U!=="\\"){C=we;continue}break;case we:if(U==="@"){Ie&&(H="%40"+H),Ie=!0,Ce=f(H);for(var na=0;na<Ce.length;na++){var fc=Ce[na];if(fc===":"&&!je){je=!0;continue}var dc=$e(fc,Ye);je?P.password+=dc:P.username+=dc}H=""}else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(Ie&&H==="")return he;ce-=f(H).length+1,H="",C=Ee}else H+=U;break;case Ee:case Ke:if($&&P.scheme==="file"){C=ta;continue}else if(U===":"&&!_e){if(H==="")return le;if(bt=P.parseHost(H),bt)return bt;if(H="",C=dt,$===Ke)return}else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(P.isSpecial()&&H==="")return le;if($&&H===""&&(P.includesCredentials()||P.port!==null))return;if(bt=P.parseHost(H),bt)return bt;if(H="",C=ir,$)return;continue}else U==="["?_e=!0:U==="]"&&(_e=!1),H+=U;break;case dt:if(q(Fe,U))H+=U;else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()||$){if(H!==""){var aa=B(H,10);if(aa>65535)return se;P.port=P.isSpecial()&&aa===Be[P.scheme]?null:aa,H=""}if($)return;C=ir;continue}else return se;break;case ea:if(P.scheme="file",U==="/"||U==="\\")C=sc;else if(k&&k.scheme==="file")switch(U){case re:P.host=k.host,P.path=h(k.path),P.query=k.query;break;case"?":P.host=k.host,P.path=h(k.path),P.query="",C=jt;break;case"#":P.host=k.host,P.path=h(k.path),P.query=k.query,P.fragment="",C=wt;break;default:Xe(T(h(et,ce),""))||(P.host=k.host,P.path=h(k.path),P.shortenPath()),C=ht;continue}else{C=ht;continue}break;case sc:if(U==="/"||U==="\\"){C=ta;break}k&&k.scheme==="file"&&!Xe(T(h(et,ce),""))&&(Le(k.path[0],!0)?Q(P.path,k.path[0]):P.host=k.host),C=ht;continue;case ta:if(U===re||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&Le(H))C=ht;else if(H===""){if(P.host="",$)return;C=ir}else{if(bt=P.parseHost(H),bt)return bt;if(P.host==="localhost"&&(P.host=""),$)return;H="",C=ir}continue}else H+=U;break;case ir:if(P.isSpecial()){if(C=ht,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")P.query="",C=jt;else if(!$&&U==="#")P.fragment="",C=wt;else if(U!==re&&(C=ht,U!=="/"))continue;break;case ht:if(U===re||U==="/"||U==="\\"&&P.isSpecial()||!$&&(U==="?"||U==="#")){if(Cr(H)?(P.shortenPath(),U!=="/"&&!(U==="\\"&&P.isSpecial())&&Q(P.path,"")):rr(H)?U!=="/"&&!(U==="\\"&&P.isSpecial())&&Q(P.path,""):(P.scheme==="file"&&!P.path.length&&Le(H)&&(P.host&&(P.host=""),H=D(H,0)+":"),Q(P.path,H)),H="",P.scheme==="file"&&(U===re||U==="?"||U==="#"))for(;P.path.length>1&&P.path[0]==="";)_(P.path);U==="?"?(P.query="",C=jt):U==="#"&&(P.fragment="",C=wt)}else H+=$e(U,ge);break;case cc:U==="?"?(P.query="",C=jt):U==="#"?(P.fragment="",C=wt):U!==re&&(P.path[0]+=$e(U,fe));break;case jt:!$&&U==="#"?(P.fragment="",C=wt):U!==re&&(U==="'"&&P.isSpecial()?P.query+="%27":U==="#"?P.query+="%23":P.query+=$e(U,fe));break;case wt:U!==re&&(P.fragment+=$e(U,ve));break}ce++}},parseHost:function(E){var $,k,P;if(D(E,0)==="["){if(D(E,E.length-1)!=="]"||($=Oe(F(E,1,-1)),!$))return le;this.host=$}else if(this.isSpecial()){if(E=v(E),q(gt,E)||($=me(E),$===null))return le;this.host=$}else{if(q(yt,E))return le;for($="",k=f(E),P=0;P<k.length;P++)$+=$e(k[P],fe);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Be,this.scheme)},shortenPath:function(){var E=this.path,$=E.length;$&&(this.scheme!=="file"||$!==1||!Le(E[0],!0))&&E.length--},serialize:function(){var E=this,$=E.scheme,k=E.username,P=E.password,C=E.host,ce=E.port,H=E.path,Ie=E.query,_e=E.fragment,je=$+":";return C!==null?(je+="//",E.includesCredentials()&&(je+=k+(P?":"+P:"")+"@"),je+=ee(C),ce!==null&&(je+=":"+ce)):$==="file"&&(je+="//"),je+=E.cannotBeABaseURL?H[0]:H.length?"/"+T(H,"/"):"",Ie!==null&&(je+="?"+Ie),_e!==null&&(je+="#"+_e),je},setHref:function(E){var $=this.parse(E);if($)throw new z($);this.searchParams.update()},getOrigin:function(){var E=this.scheme,$=this.port;if(E==="blob")try{return new or(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+ee(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",nr)},getUsername:function(){return this.username},setUsername:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var k=0;k<$.length;k++)this.username+=$e($[k],Ye)}},getPassword:function(){return this.password},setPassword:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var k=0;k<$.length;k++)this.password+=$e($[k],Ye)}},getHost:function(){var E=this.host,$=this.port;return E===null?"":$===null?ee(E):ee(E)+":"+$},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Ee)},getHostname:function(){var E=this.host;return E===null?"":ee(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ke)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,dt))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+T(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,ir))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(D(E,0)==="?"&&(E=F(E,1)),this.query="",this.parse(E,jt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}D(E,0)==="#"&&(E=F(E,1)),this.fragment="",this.parse(E,wt)},update:function(){this.query=this.searchParams.serialize()||null}};var or=function($){var k=u(this,He),P=S(arguments.length,1)>1?arguments[1]:void 0,C=m(k,new ra($,!1,P));e||(k.href=C.serialize(),k.origin=C.getOrigin(),k.protocol=C.getProtocol(),k.username=C.getUsername(),k.password=C.getPassword(),k.host=C.getHost(),k.hostname=C.getHostname(),k.port=C.getPort(),k.pathname=C.getPathname(),k.search=C.getSearch(),k.searchParams=C.getSearchParams(),k.hash=C.getHash())},He=or.prototype,Qe=function(E,$){return{get:function(){return b(this)[E]()},set:$&&function(k){return b(this)[$](k)},configurable:!0,enumerable:!0}};if(e&&(s(He,"href",Qe("serialize","setHref")),s(He,"origin",Qe("getOrigin")),s(He,"protocol",Qe("getProtocol","setProtocol")),s(He,"username",Qe("getUsername","setUsername")),s(He,"password",Qe("getPassword","setPassword")),s(He,"host",Qe("getHost","setHost")),s(He,"hostname",Qe("getHostname","setHostname")),s(He,"port",Qe("getPort","setPort")),s(He,"pathname",Qe("getPathname","setPathname")),s(He,"search",Qe("getSearch","setSearch")),s(He,"searchParams",Qe("getSearchParams")),s(He,"hash",Qe("getHash","setHash"))),o(He,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(He,"toString",function(){return b(this).serialize()},{enumerable:!0}),j){var uc=j.createObjectURL,lc=j.revokeObjectURL;uc&&o(or,"createObjectURL",a(uc,j)),lc&&o(or,"revokeObjectURL",a(lc,j))}return g(or,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:or}),yl}var Al;function Gp(){return Al||(Al=1,Bp()),gl}var Ul={},$l;function Wp(){if($l)return Ul;$l=1;var t=Re(),e=at(),r=xe(),n=tr(),a=Rt(),i=xn(),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}}}),Ul}var Ll={},jl;function Vp(){if(jl)return Ll;jl=1;var t=Re(),e=at(),r=tr(),n=Rt(),a=xn(),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}}}),Ll}var ql={},Nl;function Jp(){if(Nl)return ql;Nl=1;var t=Re(),e=ze();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),ql}var oo,xl;function Zp(){if(xl)return oo;xl=1,Mh(),Gp(),Wp(),Vp(),Jp();var t=Kn();return oo=t.URL,oo}var so,Dl;function Yp(){if(Dl)return so;Dl=1;var t=Zp();return so=t,so}var co,Ml;function Xp(){if(Ml)return co;Ml=1;var t=Yp();return co=t,co}Xp();var Fl={},uo,Kl;function Qp(){return Kl||(Kl=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,zl;function em(){if(zl)return lo;zl=1;var t=jn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return lo=r===Object.prototype?void 0:r,lo}var Hl;function Gh(){if(Hl)return Fl;Hl=1;var t=Se(),e=Qp(),r=em(),n=qs(),a=er(),i=Er(),o=De(),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"),Fl}var fo,Bl;function tm(){if(Bl)return fo;Bl=1;var t=Mh();return Gh(),fo=t,fo}var ho,Gl;function rm(){if(Gl)return ho;Gl=1;var t=tm();return ho=t,ho}rm();var Wl={},Vl={},vo,Jl;function nm(){if(Jl)return vo;Jl=1;var t=nt(),e=er();return vo=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},vo}var po,Zl;function am(){if(Zl)return po;Zl=1;var t=be(),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,Yl;function im(){if(Yl)return mo;Yl=1;var t=xe(),e=Qt();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,Xl;function om(){if(Xl)return go;Xl=1;var t=er(),e=am(),r=im(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,Ql;function en(){if(Ql)return yo;Ql=1;var t=kr(),e=ze(),r=ct(),n=Nn(),a=Hh(),i=Ts(),o=qn(),s=Ds(),u=Mn(),l=zh(),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,S=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),O,A,j,z,B,ie,L,D=function(T){return O&&l(O,"normal"),new f(!0,T)},q=function(T){return S?(r(T),m?b(T[0],T[1],D):b(T[0],T[1])):m?b(T,D):b(T)};if(w)O=d.iterator;else if(y)O=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(B=q(d[j]),B&&o(h,B))return B;return new f(!1)}O=s(d,A)}for(ie=w?d.next:O.next;!(L=e(ie,O)).done;){try{B=q(L.value)}catch(T){l(O,"throw",T)}if(typeof B=="object"&&B&&o(h,B))return B}return new f(!1)},yo}var wo,ef;function sm(){if(ef)return wo;ef=1;var t=Rt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var tf;function cm(){if(tf)return Vl;tf=1;var t=Re(),e=qn(),r=$s(),n=Ls(),a=$h(),i=Yr(),o=er(),s=Qt(),u=nm(),l=om(),c=en(),f=sm(),h=De(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(S,this),O;n?O=n(new v,b?r(this):S):(O=b?this:i(S),o(O,d,"Error")),m!==void 0&&o(O,"message",f(m)),l(O,g,O.stack,1),arguments.length>2&&u(O,arguments[2]);var A=[];return c(y,p,{that:A}),o(O,"errors",A),O};n?n(g,v):a(g,v,{name:!0});var S=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}),Vl}var rf;function um(){return rf||(rf=1,cm()),Wl}var nf={},bo,af;function lm(){if(af)return bo;af=1;var t=xs(),e=Qr();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var of;function fm(){if(of)return nf;of=1;var t=xs(),e=it(),r=lm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),nf}var sf={},cf={},So,uf;function Wh(){if(uf)return So;uf=1;var t=Se(),e=Zr(),r=An(),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,lf;function Ms(){if(lf)return Io;lf=1;var t=Wh();return Io=t==="NODE",Io}var Po,ff;function dm(){if(ff)return Po;ff=1;var t=at(),e=Dn(),r=De(),n=Me(),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,df;function hm(){if(df)return Eo;df=1;var t=Bh(),e=Nn(),r=TypeError;return Eo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Eo}var ko,hf;function Vh(){if(hf)return ko;hf=1;var t=ct(),e=hm(),r=Un(),n=De(),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,vf;function Jh(){if(vf)return _o;vf=1;var t=Cn(),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 Ro,pf;function Zh(){if(pf)return Ro;pf=1;var t=Zr();return Ro=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),Ro}var To,mf;function Yh(){if(mf)return To;mf=1;var t=Se(),e=Jh(),r=kr(),n=Pe(),a=rt(),i=xe(),o=Rh(),s=Fn(),u=jn(),l=tr(),c=Zh(),f=Ms(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,S=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",O,A,j,z;i(function(){O=t.location});var B=function(q){if(a(m,q)){var T=m[q];delete m[q],T()}},ie=function(q){return function(){B(q)}},L=function(q){B(q.data)},D=function(q){t.postMessage(w(q),O.protocol+"//"+O.host)};return(!h||!d)&&(h=function(T){l(arguments.length,1);var Y=n(T)?T:g(T),te=s(arguments,1);return m[++y]=function(){e(Y,void 0,te)},A(y),y},d=function(T){delete m[T]},f?A=function(q){v.nextTick(ie(q))}:p&&p.now?A=function(q){p.now(ie(q))}:S&&!c?(j=new S,z=j.port2,j.port1.onmessage=L,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&O&&O.protocol!=="file:"&&!i(D)?(A=D,t.addEventListener("message",L,!1)):b in u("script")?A=function(q){o.appendChild(u("script"))[b]=function(){o.removeChild(this),B(q)}}:A=function(q){setTimeout(ie(q),0)}),To={set:h,clear:d},To}var Oo,gf;function Xh(){if(gf)return Oo;gf=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,yf;function vm(){if(yf)return Co;yf=1;var t=Zr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,wf;function pm(){if(wf)return Ao;wf=1;var t=Zr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,bf;function mm(){if(bf)return Uo;bf=1;var t=Se(),e=xh(),r=kr(),n=Yh().set,a=Xh(),i=Zh(),o=vm(),s=pm(),u=Ms(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,g,S,w;if(!d){var y=new a,m=function(){var b,O;for(u&&(b=f.domain)&&b.exit();O=y.get();)try{O()}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?(S=h.resolve(void 0),S.constructor=h,w=r(S.then,S),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,Sf;function gm(){return Sf||(Sf=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}var Lo,If;function _r(){return If||(If=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var jo,Pf;function Rr(){if(Pf)return jo;Pf=1;var t=Se();return jo=t.Promise,jo}var qo,Ef;function tn(){if(Ef)return qo;Ef=1;var t=Se(),e=Rr(),r=Pe(),n=Lh(),a=Us(),i=De(),o=Wh(),s=mt(),u=gh(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var g=new e(function(y){y(1)}),S=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=S,f=g.then(function(){})instanceof S,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return qo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},qo}var No={},kf;function Tt(){if(kf)return No;kf=1;var t=ut(),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 _f;function ym(){if(_f)return cf;_f=1;var t=Re(),e=mt(),r=Ms(),n=Se(),a=Kn(),i=ze(),o=it(),s=Ls(),u=Er(),l=dm(),c=ut(),f=Pe(),h=nt(),d=Ns(),v=Vh(),p=Yh().set,g=mm(),S=gm(),w=_r(),y=Xh(),m=Pr(),b=Rr(),O=tn(),A=Tt(),j="Promise",z=O.CONSTRUCTOR,B=O.REJECTION_EVENT,ie=O.SUBCLASSING,L=m.getterFor(j),D=m.set,q=b&&b.prototype,T=b,Y=q,te=n.TypeError,Q=n.document,I=n.process,_=A.f,N=_,F=!!(Q&&Q.createEvent&&n.dispatchEvent),Z="unhandledrejection",V="rejectionhandled",he=0,oe=1,le=2,se=1,ke=2,Ue,Fe,Te,Ze,lt=function(M){var ee;return h(M)&&f(ee=M.then)?ee:!1},ft=function(M,ee){var fe=ee.value,ve=ee.state===oe,ge=ve?M.ok:M.fail,Ye=M.resolve,$e=M.reject,Be=M.domain,Le,Xe,rr;try{ge?(ve||(ee.rejection===ke&&J(ee),ee.rejection=se),ge===!0?Le=fe:(Be&&Be.enter(),Le=ge(fe),Be&&(Be.exit(),rr=!0)),Le===M.promise?$e(new te("Promise-chain cycle")):(Xe=lt(Le))?i(Xe,Le,Ye,$e):Ye(Le)):$e(fe)}catch(Cr){Be&&!rr&&Be.exit(),$e(Cr)}},gt=function(M,ee){M.notified||(M.notified=!0,g(function(){for(var fe=M.reactions,ve;ve=fe.get();)ft(ve,M);M.notified=!1,ee&&!M.rejection&&R(M)}))},yt=function(M,ee,fe){var ve,ge;F?(ve=Q.createEvent("Event"),ve.promise=ee,ve.reason=fe,ve.initEvent(M,!1,!0),n.dispatchEvent(ve)):ve={promise:ee,reason:fe},!B&&(ge=n["on"+M])?ge(ve):M===Z&&S("Unhandled promise rejection",fe)},R=function(M){i(p,n,function(){var ee=M.facade,fe=M.value,ve=K(M),ge;if(ve&&(ge=w(function(){r?I.emit("unhandledRejection",fe,ee):yt(Z,ee,fe)}),M.rejection=r||K(M)?ke:se,ge.error))throw ge.value})},K=function(M){return M.rejection!==se&&!M.parent},J=function(M){i(p,n,function(){var ee=M.facade;r?I.emit("rejectionHandled",ee):yt(V,ee,M.value)})},re=function(M,ee,fe){return function(ve){M(ee,ve,fe)}},me=function(M,ee,fe){M.done||(M.done=!0,fe&&(M=fe),M.value=ee,M.state=le,gt(M,!0))},Oe=function(M,ee,fe){if(!M.done){M.done=!0,fe&&(M=fe);try{if(M.facade===ee)throw new te("Promise can't be resolved itself");var ve=lt(ee);ve?g(function(){var ge={done:!1};try{i(ve,ee,re(Oe,ge,M),re(me,ge,M))}catch(Ye){me(ge,Ye,M)}}):(M.value=ee,M.state=oe,gt(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(z&&(T=function(ee){d(this,Y),c(ee),i(Ue,this);var fe=L(this);try{ee(re(Oe,fe),re(me,fe))}catch(ve){me(fe,ve)}},Y=T.prototype,Ue=function(ee){D(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:he,value:null})},Ue.prototype=o(Y,"then",function(ee,fe){var ve=L(this),ge=_(v(this,T));return ve.parent=!0,ge.ok=f(ee)?ee:!0,ge.fail=f(fe)&&fe,ge.domain=r?I.domain:void 0,ve.state===he?ve.reactions.add(ge):g(function(){ft(ge,ve)}),ge.promise}),Fe=function(){var M=new Ue,ee=L(M);this.promise=M,this.resolve=re(Oe,ee),this.reject=re(me,ee)},A.f=_=function(M){return M===T||M===Te?new Fe(M):N(M)},!e&&f(b)&&q!==Object.prototype)){Ze=q.then,ie||o(q,"then",function(ee,fe){var ve=this;return new T(function(ge,Ye){i(Ze,ve,ge,Ye)}).then(ee,fe)},{unsafe:!0});try{delete q.constructor}catch{}s&&s(q,Y)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:T}),Te=a.Promise,u(T,j,!1,!0),l(j),cf}var Rf={},xo,Tf;function wm(){if(Tf)return xo;Tf=1;var t=De(),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,Of;function zn(){if(Of)return Do;Of=1;var t=Rr(),e=wm(),r=tn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Cf;function bm(){if(Cf)return Rf;Cf=1;var t=Re(),e=ze(),r=ut(),n=Tt(),a=_r(),i=en(),o=zn();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,S=1;i(u,function(w){var y=g++,m=!1;S++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--S||f(p))},h)}),--S||f(p)});return d.error&&h(d.value),c.promise}}),Rf}var Af={},Uf;function Sm(){if(Uf)return Af;Uf=1;var t=Re(),e=mt(),r=tn().CONSTRUCTOR,n=Rr(),a=at(),i=Pe(),o=it(),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 Af}var $f={},Lf;function Im(){if(Lf)return $f;Lf=1;var t=Re(),e=ze(),r=ut(),n=Tt(),a=_r(),i=en(),o=zn();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={},qf;function Pm(){if(qf)return jf;qf=1;var t=Re(),e=Tt(),r=tn().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 Nf={},Mo,xf;function Qh(){if(xf)return Mo;xf=1;var t=ct(),e=nt(),r=Tt();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 Df;function Em(){if(Df)return Nf;Df=1;var t=Re(),e=at(),r=mt(),n=Rr(),a=tn().CONSTRUCTOR,i=Qh(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),Nf}var Mf;function km(){return Mf||(Mf=1,ym(),bm(),Sm(),Im(),Pm(),Em()),sf}var Ff={},Kf;function _m(){if(Kf)return Ff;Kf=1;var t=Re(),e=ze(),r=ut(),n=Tt(),a=_r(),i=en(),o=zn();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,S=1;i(u,function(w){var y=g++,m=!1;S++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--S||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--S||f(p))})}),--S||f(p)});return d.error&&h(d.value),c.promise}}),Ff}var zf={},Hf;function Rm(){if(Hf)return zf;Hf=1;var t=Re(),e=ze(),r=ut(),n=at(),a=Tt(),i=_r(),o=en(),s=zn(),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 S=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(O){var A=y++,j=!1;m++,e(S,f,O).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}}),zf}var Bf={},Gf;function ev(){if(Gf)return Bf;Gf=1;var t=Re(),e=Se(),r=Jh(),n=Fn(),a=Tt(),i=ut(),o=_r(),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}}),Bf}var Wf={},Vf;function tv(){if(Vf)return Wf;Vf=1;var t=Re(),e=Tt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Wf}var Jf={},Zf;function Tm(){if(Zf)return Jf;Zf=1;var t=Re(),e=mt(),r=Rr(),n=xe(),a=at(),i=Pe(),o=Vh(),s=Qh(),u=it(),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 Jf}var Fo,Yf;function Om(){if(Yf)return Fo;Yf=1,um(),qs(),fm(),km(),_m(),Rm(),ev(),tv(),Tm(),Kh();var t=Kn();return Fo=t.Promise,Fo}var Ko,Xf;function Cm(){if(Xf)return Ko;Xf=1;var t=Om();return Gh(),Ko=t,Ko}var Qf={},ed;function Am(){return ed||(ed=1,ev()),Qf}var td={},rd;function Um(){return rd||(rd=1,tv()),td}var zo,nd;function $m(){if(nd)return zo;nd=1;var t=Cm();return Am(),Um(),zo=t,zo}$m();const rv="sesamy-debug";function Lm(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 jm(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 qm(t){Lm(rv,t.toString(),1)}function Nm(){return jm(rv)==="true"}function pe(t){Nm()&&console.log(t)}function Lt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});pe(`Triggering event: ${t}`),dispatchEvent(r)}function pt(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 Dt=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 Nt=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(Nt);var xm=Fs(Ks((function(t,e){var r=Dt&&Dt.__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 S(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,S)}w((d=d.apply(c,f||[])).next())}))},n=Dt&&Dt.__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:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function S(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=Dt;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,S,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]:(S=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:S,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,S;return n(this,(function(w){switch(w.label){case 0:return[4,Nt.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?(Nt.default().unlock(h),[2]):((S=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(S)),Nt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Nt.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 S(){if(g||(window.removeEventListener("storage",S),c.removeFromWaiting(S),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",S),c.addToWaiting(S);var w=setTimeout(S,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,Nt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),Nt.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 S=!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),S=!0)}}}S&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const Dm={timeoutInSeconds:60},nv={name:"auth0-spa-js",version:"2.8.0"},av=()=>Date.now();let Ae=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)}},Mm=class iv extends Ae{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,iv.prototype)}},Fm=class ov extends Ae{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,ov.prototype)}},cs=class sv extends Ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,sv.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Km=class cv extends Ae{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,cv.prototype)}},zm=class uv extends Ae{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,uv.prototype)}},lv=class fv extends Ae{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${yn(e,["default"])}', scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,fv.prototype)}},Hm=class dv extends Ae{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${yn(e,["default"])}', missing scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,dv.prototype)}},hv=class vv extends Ae{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,vv.prototype)}};function yn(t,e=[]){return t&&!e.includes(t)?t:""}const wn=()=>window.crypto,Ur=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Ho=t=>btoa(t),Bm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Gm=t=>Object.keys(t).reduce(((e,r)=>{const n=Bm.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=pt(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()},ad=async t=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),id=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),od=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Wm=new TextEncoder,Vm=new TextDecoder;function Fr(t){return typeof t=="string"?Wm.encode(t):Vm.decode(t)}function sd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Zm(`${t.name} modulusLength must be at least 2048 bits`)}async function Jm(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=`${Kr(Fr(JSON.stringify(t)))}.${Kr(Fr(JSON.stringify(e)))}`;return`${n}.${Kr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return sd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return sd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Kt})(r),r,Fr(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 Kr(t){return ls(t)}let Kt=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)}},Zm=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 Ym(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Kt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Kt("unsupported CryptoKey algorithm name")}}function pv(t){return t instanceof CryptoKey}function mv(t){return pv(t)&&t.type==="public"}async function Xm(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!pv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!mv(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Jm({alg:Ym(o),typ:"dpop+jwt",jwk:await gv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Kr(await crypto.subtle.digest("SHA-256",Fr(a))):void 0}),o)}async function gv(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const Qm=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function eg(){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 Kt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function tg(t){return(async function(e){if(!mv(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await gv(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Kt("unsupported JWK kty")}return Kr(await crypto.subtle.digest({name:"SHA-256"},Fr(JSON.stringify(n))))})(t.publicKey)}function rg({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 Xm(t,i,r,n,a)}const ng=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},ag=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([ng(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ig=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},og=async(t,e,r,n,a,i,o=1e4,s)=>a?ig(t,e,r,n,o,a,i,s):ag(t,n,o);async function yv(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await og(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=pt(h,["error","error_description"]),{headers:g,ok:S}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!S){const y=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new zm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new lv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new hv(w);return yv(t,e,r,n,a,i,o,s,u,!0)}throw new Ae(d||"request_error",y)}return p}async function sg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=pt(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,Qm.includes(g));var g;return await yv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Gm(o||nv)))}},e,s,u,p?l:void 0)}const hn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},nn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),hn(n,e)};let It=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})}},cg=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},wv=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},ug=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||av}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new It({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 It({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 It({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=It.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=It.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)}}}},lg=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 $r=t=>typeof t=="number",fg=["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"],dg=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(id(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],fg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(id(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&&!$r(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||!$r(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!$r(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&&$r(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&&$r(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 zt=Ks((function(t,e){var r=Dt&&Dt.__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(zt),zt.encode,zt.parse,zt.getAll;var hg=zt.get,bv=zt.set,Sv=zt.remove;const ur={get(t){const e=hg(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),bv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r)}},vg={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),bv(`_legacy_${t}`,JSON.stringify(e),n),ur.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r),ur.remove(t,e),ur.remove(`_legacy_${t}`,e)}},pg={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 Mt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Mt||(Mt={}));function mg(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 cd,ud,ld,Bo,gg=(cd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ud=null,ld=!1,function(t){return Bo=Bo||mg(cd,ud,ld),new Worker(Bo,t)});const Go={};let yg=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 wg={memory:()=>new wv().enclosedCache,localstorage:()=>new cg},fd=t=>wg[t],dd=t=>{const{openUrl:e,onRedirect:r}=t,n=pt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},hd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},qt={NONCE:"nonce",KEYPAIR:"keypair"};let bg=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(qt).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(qt.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save(qt.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find(qt.NONCE,this.buildKey(e))}findKeyPair(){return this.find(qt.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(qt.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(qt.KEYPAIR,this.clientId)}},Sg=class{constructor(e){this.storage=new bg(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 eg(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return rg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return tg(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 Ig=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 hv(n);return r.onUseDpopNonceError()}async internalFetchWithAuth(e,r,n,a){const i=this.buildBaseRequest(e,r);await this.prepareRequest(i,a);const o=await this.config.fetch(i);return this.handleResponse(o,n)}fetchWithAuth(e,r,n){const a={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,r,Object.assign(Object.assign({},a),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,r,a,n)}},Pg=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 vd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new vd(r)}},vd=class Iv extends Error{constructor({type:e,status:r,title:n,detail:a,validation_errors:i}){super(a),this.name="MyAccountApiError",this.type=e,this.status=r,this.title=n,this.detail=a,this.validation_errors=i,Object.setPrototypeOf(this,Iv.prototype)}};const Wo=new xm;let Eg=class{constructor(e){let r,n;if(this.userCache=new wv().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await 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(!wn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wn().subtle===void 0)throw new Error(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vc={},na,pc;function Ae(){return pc||(pc=1,na=function(t){try{return!!t()}catch{return!0}}),na}var aa,mc;function Tn(){if(mc)return aa;mc=1;var t=Ae();return aa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),aa}var ia,gc;function pe(){if(gc)return ia;gc=1;var t=Tn(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return ia=t?n:function(a){return function(){return r.apply(a,arguments)}},ia}var oa,yc;function On(){if(yc)return oa;yc=1;var t=pe(),e=t({}.toString),r=t("".slice);return oa=function(n){return r(e(n),8,-1)},oa}var sa,wc;function vh(){if(wc)return sa;wc=1;var t=pe(),e=Ae(),r=On(),n=Object,a=t("".split);return sa=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,sa}var ca,bc;function Cn(){return bc||(bc=1,ca=function(t){return t==null}),ca}var ua,Sc;function An(){if(Sc)return ua;Sc=1;var t=Cn(),e=TypeError;return ua=function(r){if(t(r))throw new e("Can't call method on "+r);return r},ua}var la,Ic;function Jr(){if(Ic)return la;Ic=1;var t=vh(),e=An();return la=function(r){return t(e(r))},la}var Ar,Pc;function me(){if(Pc)return Ar;Pc=1;var t=function(e){return e&&e.Math===Math&&e};return Ar=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof hc=="object"&&hc)||t(typeof Ar=="object"&&Ar)||(function(){return this})()||Function("return this")(),Ar}var fa={exports:{}},da,Ec;function lt(){return Ec||(Ec=1,da=!1),da}var ha,kc;function Is(){if(kc)return ha;kc=1;var t=me(),e=Object.defineProperty;return ha=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},ha}var _c;function Ps(){if(_c)return fa.exports;_c=1;var t=lt(),e=me(),r=Is(),n="__core-js_shared__",a=fa.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"}),fa.exports}var va,Rc;function ph(){if(Rc)return va;Rc=1;var t=Ps();return va=function(e,r){return t[e]||(t[e]=r||{})},va}var pa,Tc;function Un(){if(Tc)return pa;Tc=1;var t=An(),e=Object;return pa=function(r){return e(t(r))},pa}var ma,Oc;function Je(){if(Oc)return ma;Oc=1;var t=pe(),e=Un(),r=t({}.hasOwnProperty);return ma=Object.hasOwn||function(a,i){return r(e(a),i)},ma}var ga,Cc;function mh(){if(Cc)return ga;Cc=1;var t=pe(),e=0,r=Math.random(),n=t(1.1.toString);return ga=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},ga}var ya,Ac;function Zr(){if(Ac)return ya;Ac=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ya=r?String(r):"",ya}var wa,Uc;function gh(){if(Uc)return wa;Uc=1;var t=me(),e=Zr(),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]))),wa=s,wa}var ba,$c;function yh(){if($c)return ba;$c=1;var t=gh(),e=Ae(),r=me(),n=r.String;return ba=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),ba}var Sa,Lc;function wh(){if(Lc)return Sa;Lc=1;var t=yh();return Sa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Sa}var Ia,qc;function Ue(){if(qc)return Ia;qc=1;var t=me(),e=ph(),r=Je(),n=mh(),a=yh(),i=wh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Ia=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Ia}var Pa,jc;function we(){if(jc)return Pa;jc=1;var t=typeof document=="object"&&document.all;return Pa=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Pa}var Ea,Nc;function Ze(){if(Nc)return Ea;Nc=1;var t=we();return Ea=function(e){return typeof e=="object"?e!==null:t(e)},Ea}var ka,xc;function nt(){if(xc)return ka;xc=1;var t=Ze(),e=String,r=TypeError;return ka=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},ka}var _a={},Ra,Dc;function $e(){if(Dc)return Ra;Dc=1;var t=Ae();return Ra=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ra}var Ta,Mc;function bh(){if(Mc)return Ta;Mc=1;var t=$e(),e=Ae();return Ta=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ta}var Oa={},Ca,Fc;function $n(){if(Fc)return Ca;Fc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Ca=function(a){return n?r.createElement(a):{}},Ca}var Aa,Kc;function Sh(){if(Kc)return Aa;Kc=1;var t=$e(),e=Ae(),r=$n();return Aa=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Aa}var Ua,zc;function je(){if(zc)return Ua;zc=1;var t=Tn(),e=Function.prototype.call;return Ua=t?e.bind(e):function(){return e.apply(e,arguments)},Ua}var $a,Hc;function Ye(){if(Hc)return $a;Hc=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 La,Bc;function Ln(){if(Bc)return La;Bc=1;var t=pe();return La=t({}.isPrototypeOf),La}var qa,Gc;function Ih(){if(Gc)return qa;Gc=1;var t=Ye(),e=we(),r=Ln(),n=wh(),a=Object;return qa=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},qa}var ja,Wc;function qn(){if(Wc)return ja;Wc=1;var t=String;return ja=function(e){try{return t(e)}catch{return"Object"}},ja}var Na,Vc;function at(){if(Vc)return Na;Vc=1;var t=we(),e=qn(),r=TypeError;return Na=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Na}var xa,Jc;function Es(){if(Jc)return xa;Jc=1;var t=at(),e=Cn();return xa=function(r,n){var a=r[n];return e(a)?void 0:t(a)},xa}var Da,Zc;function yp(){if(Zc)return Da;Zc=1;var t=je(),e=we(),r=Ze(),n=TypeError;return Da=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")},Da}var Ma,Yc;function wp(){if(Yc)return Ma;Yc=1;var t=je(),e=Ze(),r=Ih(),n=Es(),a=yp(),i=Ue(),o=TypeError,s=i("toPrimitive");return Ma=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)},Ma}var Fa,Xc;function Ph(){if(Xc)return Fa;Xc=1;var t=wp(),e=Ih();return Fa=function(r){var n=t(r,"string");return e(n)?n:n+""},Fa}var Qc;function yt(){if(Qc)return Oa;Qc=1;var t=$e(),e=Sh(),r=bh(),n=nt(),a=Ph(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Oa.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},Oa}var Ka,eu;function bp(){if(eu)return Ka;eu=1;var t=Math.ceil,e=Math.floor;return Ka=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ka}var za,tu;function ks(){if(tu)return za;tu=1;var t=bp();return za=function(e){var r=+e;return r!==r||r===0?0:t(r)},za}var Ha,ru;function Eh(){if(ru)return Ha;ru=1;var t=ks(),e=Math.max,r=Math.min;return Ha=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ha}var Ba,nu;function Sp(){if(nu)return Ba;nu=1;var t=ks(),e=Math.min;return Ba=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Ba}var Ga,au;function _s(){if(au)return Ga;au=1;var t=Sp();return Ga=function(e){return t(e.length)},Ga}var Wa,iu;function Ip(){if(iu)return Wa;iu=1;var t=Jr(),e=Eh(),r=_s(),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 Wa={includes:n(!0),indexOf:n(!1)},Wa}var Va,ou;function Rs(){return ou||(ou=1,Va={}),Va}var Ja,su;function kh(){if(su)return Ja;su=1;var t=pe(),e=Je(),r=Jr(),n=Ip().indexOf,a=Rs(),i=t([].push);return Ja=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},Ja}var Za,cu;function Ts(){return cu||(cu=1,Za=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Za}var Ya,uu;function _h(){if(uu)return Ya;uu=1;var t=kh(),e=Ts();return Ya=Object.keys||function(n){return t(n,e)},Ya}var lu;function Pp(){if(lu)return _a;lu=1;var t=$e(),e=bh(),r=yt(),n=nt(),a=Jr(),i=_h();return _a.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},_a}var Xa,fu;function Rh(){if(fu)return Xa;fu=1;var t=Ye();return Xa=t("document","documentElement"),Xa}var Qa,du;function Os(){if(du)return Qa;du=1;var t=ph(),e=mh(),r=t("keys");return Qa=function(n){return r[n]||(r[n]=e(n))},Qa}var ei,hu;function Yr(){if(hu)return ei;hu=1;var t=nt(),e=Pp(),r=Ts(),n=Rs(),a=Rh(),i=$n(),o=Os(),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,I=function(){try{g=new ActiveXObject("htmlfile")}catch{}I=typeof document<"u"?document.domain&&g?v(g):p():v(g);for(var w=r.length;w--;)delete I[l][r[w]];return I()};return n[f]=!0,ei=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=I(),m===void 0?b:e.f(b,m)},ei}var ti,vu;function Ep(){if(vu)return ti;vu=1;var t=Ue(),e=Yr(),r=yt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ti=function(i){a[n][i]=!0},ti}var ri,pu;function Xr(){return pu||(pu=1,ri={}),ri}var ni,mu;function kp(){if(mu)return ni;mu=1;var t=me(),e=we(),r=t.WeakMap;return ni=e(r)&&/native code/.test(String(r)),ni}var ai,gu;function Yt(){return gu||(gu=1,ai=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),ai}var ii,yu;function Xt(){if(yu)return ii;yu=1;var t=$e(),e=yt(),r=Yt();return ii=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},ii}var oi,wu;function Ir(){if(wu)return oi;wu=1;var t=kp(),e=me(),r=Ze(),n=Xt(),a=Je(),i=Ps(),o=Os(),s=Rs(),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 I=o("state");s[I]=!0,f=function(w,y){if(a(w,I))throw new l(u);return y.facade=w,n(w,I,y),y},h=function(w){return a(w,I)?w[I]:{}},d=function(w){return a(w,I)}}return oi={set:f,get:h,has:d,enforce:v,getterFor:p},oi}var si={},ci={},bu;function Th(){if(bu)return ci;bu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ci.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,ci}var Su;function Oh(){if(Su)return si;Su=1;var t=$e(),e=je(),r=Th(),n=Yt(),a=Jr(),i=Ph(),o=Je(),s=Sh(),u=Object.getOwnPropertyDescriptor;return si.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])},si}var ui={exports:{}},li,Iu;function Ch(){if(Iu)return li;Iu=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 li={EXISTS:a,PROPER:i,CONFIGURABLE:o},li}var fi,Pu;function Cs(){if(Pu)return fi;Pu=1;var t=pe(),e=we(),r=Ps(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),fi=r.inspectSource,fi}var Eu;function Ah(){if(Eu)return ui.exports;Eu=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=$e(),i=Ch().CONFIGURABLE,o=Cs(),s=Ir(),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"),I=ui.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=I(function(){return r(this)&&l(this).source||o(this)},"toString"),ui.exports}var di,ku;function Xe(){if(ku)return di;ku=1;var t=we(),e=yt(),r=Ah(),n=Is();return di=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},di}var hi={},_u;function _p(){if(_u)return hi;_u=1;var t=kh(),e=Ts(),r=e.concat("length","prototype");return hi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},hi}var vi={},Ru;function Uh(){return Ru||(Ru=1,vi.f=Object.getOwnPropertySymbols),vi}var pi,Tu;function Rp(){if(Tu)return pi;Tu=1;var t=Ye(),e=pe(),r=_p(),n=Uh(),a=nt(),i=e([].concat);return pi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},pi}var mi,Ou;function $h(){if(Ou)return mi;Ou=1;var t=Je(),e=Rp(),r=Oh(),n=yt();return mi=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))}},mi}var gi,Cu;function Lh(){if(Cu)return gi;Cu=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 gi=n,gi}var yi,Au;function Ie(){if(Au)return yi;Au=1;var t=me(),e=Oh().f,r=Xt(),n=Xe(),a=Is(),i=$h(),o=Lh();return yi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,I;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?(I=e(d,v),p=I&&I.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)}},yi}var wi,Uu;function Tp(){if(Uu)return wi;Uu=1;var t=Ae();return wi=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),wi}var bi,$u;function As(){if($u)return bi;$u=1;var t=Je(),e=we(),r=Un(),n=Os(),a=Tp(),i=n("IE_PROTO"),o=Object,s=o.prototype;return bi=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},bi}var Si,Lu;function qh(){if(Lu)return Si;Lu=1;var t=Ae(),e=we(),r=Ze(),n=Yr(),a=As(),i=Xe(),o=Ue(),s=lt(),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}),Si={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Si}var Ii,qu;function Pr(){if(qu)return Ii;qu=1;var t=yt().f,e=Je(),r=Ue(),n=r("toStringTag");return Ii=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Ii}var Pi,ju;function jh(){if(ju)return Pi;ju=1;var t=qh().IteratorPrototype,e=Yr(),r=Yt(),n=Pr(),a=Xr(),i=function(){return this};return Pi=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},Pi}var Ei,Nu;function Op(){if(Nu)return Ei;Nu=1;var t=pe(),e=at();return Ei=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},Ei}var ki,xu;function Cp(){if(xu)return ki;xu=1;var t=Ze();return ki=function(e){return t(e)||e===null},ki}var _i,Du;function Ap(){if(Du)return _i;Du=1;var t=Cp(),e=String,r=TypeError;return _i=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},_i}var Ri,Mu;function Us(){if(Mu)return Ri;Mu=1;var t=Op(),e=Ze(),r=An(),n=Ap();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 Ti,Fu;function Nh(){if(Fu)return Ti;Fu=1;var t=Ie(),e=je(),r=lt(),n=Ch(),a=we(),i=jh(),o=As(),s=Us(),u=Pr(),l=Xt(),c=Xe(),f=Ue(),h=Xr(),d=qh(),v=n.PROPER,p=n.CONFIGURABLE,g=d.IteratorPrototype,I=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",O=function(){return this};return Ti=function(A,N,H,V,te,j,F){i(H,N,V);var D=function(J){if(J===te&&S)return S;if(!I&&J&&J in $)return $[J];switch(J){case y:return function(){return new H(this,J)};case m:return function(){return new H(this,J)};case b:return function(){return new H(this,J)}}return function(){return new H(this)}},T=N+" Iterator",_=!1,$=A.prototype,q=$[w]||$["@@iterator"]||te&&$[te],S=!I&&q||D(te),k=N==="Array"&&$.entries||q,x,z,Y;if(k&&(x=o(k.call(new A)),x!==Object.prototype&&x.next&&(!r&&o(x)!==g&&(s?s(x,g):a(x[w])||c(x,w,O)),u(x,T,!0,!0),r&&(h[T]=O))),v&&te===m&&q&&q.name!==m&&(!r&&p?l($,"name",m):(_=!0,S=function(){return e(q,this)})),te)if(z={values:D(m),keys:j?S:D(y),entries:D(b)},F)for(Y in z)(I||_||!(Y in $))&&c($,Y,z[Y]);else t({target:N,proto:!0,forced:I||_},z);return(!r||F)&&$[w]!==S&&c($,w,S,{name:te}),h[N]=S,z},Ti}var Oi,Ku;function $s(){return Ku||(Ku=1,Oi=function(t,e){return{value:t,done:e}}),Oi}var Ci,zu;function Ls(){if(zu)return Ci;zu=1;var t=Jr(),e=Ep(),r=Xr(),n=Ir(),a=yt().f,i=Nh(),o=$s(),s=lt(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ci=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 Ci}var Hu={},Bu;function Up(){if(Bu)return Hu;Bu=1;var t=Ie(),e=pe(),r=Eh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Hu}var Ai,Gu;function xh(){if(Gu)return Ai;Gu=1;var t=me(),e=$e(),r=Object.getOwnPropertyDescriptor;return Ai=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Ai}var Ui,Wu;function jn(){if(Wu)return Ui;Wu=1;var t=Ae(),e=Ue(),r=$e(),n=lt(),a=e("iterator");return Ui=!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"}),Ui}var $i,Vu;function Nn(){if(Vu)return $i;Vu=1;var t=Ah(),e=yt();return $i=function(r,n,a){return a.get&&t(a.get,n,{getter:!0}),a.set&&t(a.set,n,{setter:!0}),e.f(r,n,a)},$i}var Li,Ju;function $p(){if(Ju)return Li;Ju=1;var t=Xe();return Li=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},Li}var qi,Zu;function qs(){if(Zu)return qi;Zu=1;var t=Ln(),e=TypeError;return qi=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},qi}var ji,Yu;function Lp(){if(Yu)return ji;Yu=1;var t=On(),e=pe();return ji=function(r){if(t(r)==="Function")return e(r)},ji}var Ni,Xu;function Er(){if(Xu)return Ni;Xu=1;var t=Lp(),e=at(),r=Tn(),n=t(t.bind);return Ni=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Ni}var xi,Qu;function js(){if(Qu)return xi;Qu=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",xi=String(r)==="[object z]",xi}var Di,el;function Qr(){if(el)return Di;el=1;var t=js(),e=we(),r=On(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Di=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},Di}var Mi,tl;function wt(){if(tl)return Mi;tl=1;var t=Qr(),e=String;return Mi=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Mi}var Fi,rl;function xn(){if(rl)return Fi;rl=1;var t=Qr(),e=Es(),r=Cn(),n=Xr(),a=Ue(),i=a("iterator");return Fi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Fi}var Ki,nl;function Ns(){if(nl)return Ki;nl=1;var t=je(),e=at(),r=nt(),n=qn(),a=xn(),i=TypeError;return Ki=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")},Ki}var zi,al;function Qt(){if(al)return zi;al=1;var t=TypeError;return zi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},zi}var Hi,il;function Dn(){if(il)return Hi;il=1;var t=pe();return Hi=t([].slice),Hi}var Bi,ol;function qp(){if(ol)return Bi;ol=1;var t=Dn(),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 Bi=r,Bi}var Gi,sl;function Dh(){if(sl)return Gi;sl=1,Ls(),Up();var t=Ie(),e=me(),r=xh(),n=Ye(),a=je(),i=pe(),o=$e(),s=jn(),u=Xe(),l=Nn(),c=$p(),f=Pr(),h=jh(),d=Ir(),v=qs(),p=we(),g=Je(),I=Er(),w=Qr(),y=nt(),m=Ze(),b=wt(),O=Yr(),A=Yt(),N=Ns(),H=xn(),V=$s(),te=Qt(),j=Ue(),F=qp(),D=j("iterator"),T="URLSearchParams",_=T+"Iterator",$=d.set,q=d.getterFor(T),S=d.getterFor(_),k=r("fetch"),x=r("Request"),z=r("Headers"),Y=x&&x.prototype,J=z&&z.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),Tt=i("".split),Ot=i("".slice),Or=i(/./.exec),er=/\+/g,Ct="�",ge=/^[0-9a-f]+$/i,et=function(M,G){var W=Ot(M,G,G+2);return Or(ge,W)?ke(W,16):NaN},At=function(M){for(var G=0,W=128;W>0&&(M&W)!==0;W>>=1)G++;return G},K=function(M){var G=null;switch(M.length){case 1:G=M[0];break;case 2:G=(M[0]&31)<<6|M[1]&63;break;case 3:G=(M[0]&15)<<12|(M[1]&63)<<6|M[2]&63;break;case 4:G=(M[0]&7)<<18|(M[1]&63)<<12|(M[2]&63)<<6|M[3]&63;break}return G>1114111?null:G},X=function(M){M=Qe(M,er," ");for(var G=M.length,W="",Z=0;Z<G;){var ie=Ne(M,Z);if(ie==="%"){if(Ne(M,Z+1)==="%"||Z+3>G){W+="%",Z++;continue}var se=et(M,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(M,Z)!=="%"));){var qe=et(M,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 it=K(ve);it===null?W+=Ct:ie=ae(it)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(M){return ue[M]},He=function(M){return Qe(ne(M),oe,de)},_e=h(function(G,W){$(this,{type:_,target:q(G).entries,index:0,kind:W})},T,function(){var G=S(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(M){this.entries=[],this.url=null,M!==void 0&&(m(M)?this.parseObject(M):this.parseQuery(typeof M=="string"?Ne(M,0)==="?"?Ot(M,1):M:b(M)))};Me.prototype={type:T,bindURL:function(M){this.url=M,this.update()},parseObject:function(M){var G=this.entries,W=H(M),Z,ie,se,he,ve,be,qe;if(W)for(Z=N(M,W),ie=Z.next;!(se=a(ie,Z)).done;){if(he=N(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 it in M)g(M,it)&&Le(G,{key:it,value:b(M[it])})},parseQuery:function(M){if(M)for(var G=this.entries,W=Tt(M,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Tt(ie,"="),Le(G,{key:X(St(se)),value:X(De(se,"="))}))},serialize:function(){for(var M=this.entries,G=[],W=0,Z;W<M.length;)Z=M[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 Re=function(){v(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=$(this,new Me(G));o||(this.size=W.entries.length)},Ge=Re.prototype;if(c(Ge,{append:function(G,W){var Z=q(this);te(arguments.length,2),Le(Z.entries,{key:b(G),value:b(W)}),o||this.length++,Z.updateURL()},delete:function(M){for(var G=q(this),W=te(arguments.length,1),Z=G.entries,ie=b(M),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=q(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=q(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=q(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=q(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=q(this);F(G.entries,function(W,Z){return W.key>Z.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=q(this).entries,Z=I(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,D,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return q(this).serialize()},{enumerable:!0}),o&&l(Ge,"size",{get:function(){return q(this).entries.length},configurable:!0,enumerable:!0}),f(Re,T),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Re}),!s&&p(z)){var tr=i(J.has),Cr=i(J.set),rr=function(M){if(m(M)){var G=M.body,W;if(w(G)===T)return W=M.headers?new z(M.headers):new z,tr(W,"content-type")||Cr(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),O(M,{body:A(0,b(G)),headers:A(0,W)})}return M};if(p(k)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return k(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 Gi={URLSearchParams:Re,getState:q},Gi}var cl;function jp(){return cl||(cl=1,Dh()),vc}var ul={},ll;function Np(){if(ll)return ul;ll=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(O,A){l(v,{key:A,value:O})}),n(h,1);for(var p=r(f),g=r(d),I=0,w=0,y=!1,m=v.length,b;I<m;)b=v[I++],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}),ul}var fl={},dl;function xp(){if(dl)return fl;dl=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}),fl}var hl={},vl;function Dp(){if(vl)return hl;vl=1;var t=$e(),e=pe(),r=Nn(),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}),hl}var Wi,pl;function Mn(){if(pl)return Wi;pl=1;var t=me();return Wi=t,Wi}var Vi,ml;function Mh(){if(ml)return Vi;ml=1,jp(),Np(),xp(),Dp();var t=Mn();return Vi=t.URLSearchParams,Vi}var gl={},yl={},wl={},Ji,bl;function Fh(){if(bl)return Ji;bl=1;var t=pe(),e=ks(),r=wt(),n=An(),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 Ji={codeAt:s(!1),charAt:s(!0)},Ji}var Sl;function Kh(){if(Sl)return wl;Sl=1;var t=Fh().charAt,e=wt(),r=Ir(),n=Nh(),a=$s(),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))}),wl}var Zi,Il;function Mp(){if(Il)return Zi;Il=1;var t=$e(),e=pe(),r=je(),n=Ae(),a=_h(),i=Uh(),o=Th(),s=Un(),u=vh(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Zi=!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,I=1,w=i.f,y=o.f;g>I;)for(var m=u(arguments[I++]),b=w?f(a(m),w(m)):a(m),O=b.length,A=0,N;O>A;)N=b[A++],(!t||r(y,m,N))&&(p[N]=m[N]);return p}:l,Zi}var Yi,Pl;function zh(){if(Pl)return Yi;Pl=1;var t=je(),e=nt(),r=Es();return Yi=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},Yi}var Xi,El;function Fp(){if(El)return Xi;El=1;var t=nt(),e=zh();return Xi=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Xi}var Qi,kl;function Hh(){if(kl)return Qi;kl=1;var t=Ue(),e=Xr(),r=t("iterator"),n=Array.prototype;return Qi=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},Qi}var eo,_l;function Bh(){if(_l)return eo;_l=1;var t=pe(),e=Ae(),r=we(),n=Qr(),a=Ye(),i=Cs(),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,eo=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,eo}var to,Rl;function Kp(){if(Rl)return to;Rl=1;var t=$e(),e=yt(),r=Yt();return to=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},to}var ro,Tl;function zp(){if(Tl)return ro;Tl=1;var t=Er(),e=je(),r=Un(),n=Fp(),a=Hh(),i=Bh(),o=_s(),s=Kp(),u=Ns(),l=xn(),c=Array;return ro=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,I=g!==void 0;I&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,O,A,N,H;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),N=A.next;!(O=e(N,A)).done;y++)H=I?n(A,g,[O.value,y],!0):O.value,s(b,y,H);else for(m=o(d),b=v?new this(m):c(m);m>y;y++)H=I?g(d[y],y):d[y],s(b,y,H);return b.length=y,b},ro}var no,Ol;function Hp(){if(Ol)return no;Ol=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,I=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),O=t("".split),A=t("".toLowerCase),N=function(j){for(var F=[],D=0,T=j.length;D<T;){var _=w(j,D++);if(_>=55296&&_<=56319&&D<T){var $=w(j,D++);($&64512)===56320?m(F,((_&1023)<<10)+($&1023)+65536):(m(F,_),D--)}else m(F,_)}return F},H=function(j){return j+22+75*(j<26)},V=function(j,F,D){var T=0;for(j=D?g(j/o):j>>1,j+=g(j/F);j>d*a>>1;)j=g(j/d),T+=r;return g(T+(d+1)*j/(j+i))},te=function(j){var F=[];j=N(j);var D=j.length,T=u,_=0,$=s,q,S;for(q=0;q<j.length;q++)S=j[q],S<128&&m(F,I(S));var k=F.length,x=k;for(k&&m(F,l);x<D;){var z=e;for(q=0;q<j.length;q++)S=j[q],S>=T&&S<z&&(z=S);var Y=x+1;if(z-T>g((e-_)/Y))throw new v(h);for(_+=(z-T)*Y,T=z,q=0;q<j.length;q++){if(S=j[q],S<T&&++_>e)throw new v(h);if(S===T){for(var J=_,fe=r;;){var ne=fe<=$?n:fe>=$+a?a:fe-$;if(J<ne)break;var ce=J-ne,ae=r-ne;m(F,I(H(ne+ce%ae))),J=g(ce/ae),fe+=r}m(F,I(H(J))),$=V(_,Y,x===k),_=0,x++}}_++,T++}return y(F,"")};return no=function(j){var F=[],D=O(b(A(j),f,"."),"."),T,_;for(T=0;T<D.length;T++)_=D[T],m(F,p(c,_)?"xn--"+te(_):_);return y(F,".")},no}var Cl;function Bp(){if(Cl)return yl;Cl=1,Kh();var t=Ie(),e=$e(),r=jn(),n=me(),a=Er(),i=pe(),o=Xe(),s=Nn(),u=qs(),l=Je(),c=Mp(),f=zp(),h=Dn(),d=Fh().codeAt,v=Hp(),p=wt(),g=Pr(),I=Qt(),w=Dh(),y=Ir(),m=y.set,b=y.getterFor("URL"),O=w.URLSearchParams,A=w.getState,N=n.URL,H=n.TypeError,V=n.parseInt,te=Math.floor,j=Math.pow,F=i("".charAt),D=i(/./.exec),T=i([].join),_=i(1.1.toString),$=i([].pop),q=i([].push),S=i("".replace),k=i([].shift),x=i("".split),z=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,Tt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ot=/[\0\t\n\r #/:<>?@[\\\]^|]/,Or=/^[\u0000-\u0020]+/,er=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ct=/[\t\n\r]/g,ge,et=function(E){var L=x(E,"."),R,P,C,re,B,ye,Se;if(L.length&&L[L.length-1]===""&&L.length--,R=L.length,R>4)return E;for(P=[],C=0;C<R;C++){if(re=L[C],re==="")return E;if(B=10,re.length>1&&F(re,0)==="0"&&(B=D(Le,re)?16:8,re=z(re,B===8?1:2)),re==="")ye=0;else{if(!D(B===10?St:B===8?Qe:It,re))return E;ye=V(re,B)}q(P,ye)}for(C=0;C<R;C++)if(ye=P[C],C===R-1){if(ye>=j(256,5-R))return null}else if(ye>255)return null;for(Se=$(P),C=0;C<P.length;C++)Se+=P[C]*j(256,3-C);return Se},At=function(E){var L=[0,0,0,0,0,0,0,0],R=0,P=null,C=0,re,B,ye,Se,Te,Ve,U,Pe=function(){return F(E,C)};if(Pe()===":"){if(F(E,1)!==":")return;C+=2,R++,P=R}for(;Pe();){if(R===8)return;if(Pe()===":"){if(P!==null)return;C++,R++,P=R;continue}for(re=B=0;B<4&&D(It,Pe());)re=re*16+V(Pe(),16),C++,B++;if(Pe()==="."){if(B===0||(C-=B,R>6))return;for(ye=0;Pe();){if(Se=null,ye>0)if(Pe()==="."&&ye<4)C++;else return;if(!D(De,Pe()))return;for(;D(De,Pe());){if(Te=V(Pe(),10),Se===null)Se=Te;else{if(Se===0)return;Se=Se*10+Te}if(Se>255)return;C++}L[R]=L[R]*256+Se,ye++,(ye===2||ye===4)&&R++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;L[R++]=re}if(P!==null)for(Ve=R-P,R=7;R!==0&&Ve>0;)U=L[R],L[R--]=L[P+Ve-1],L[P+--Ve]=U;else if(R!==8)return;return L},K=function(E){for(var L=null,R=1,P=null,C=0,re=0;re<8;re++)E[re]!==0?(C>R&&(L=P,R=C),P=null,C=0):(P===null&&(P=re),++C);return C>R?P:L},X=function(E){var L,R,P,C;if(typeof E=="number"){for(L=[],R=0;R<4;R++)J(L,E%256),E=te(E/256);return T(L,".")}if(typeof E=="object"){for(L="",P=K(E),R=0;R<8;R++)C&&E[R]===0||(C&&(C=!1),P===R?(L+=R?":":"::",C=!0):(L+=_(E[R],16),R<7&&(L+=":")));return"["+L+"]"}return E},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(E,L){var R=d(E,0);return R>32&&R<127&&!l(L,E)?E:encodeURIComponent(E)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Re=function(E,L){var R;return E.length===2&&D(ke,F(E,0))&&((R=F(E,1))===":"||!L&&R==="|")},Ge=function(E){var L;return E.length>1&&Re(z(E,0,2))&&(E.length===2||(L=F(E,2))==="/"||L==="\\"||L==="?"||L==="#")},tr=function(E){return E==="."||Y(E)==="%2e"},Cr=function(E){return E=Y(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},rr={},nr={},M={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},it={},Xn={},sc={},Qn={},ar={},ot={},cc={},Ut={},ft={},ea=function(E,L,R){var P=p(E),C,re,B;if(L){if(re=this.parse(P),re)throw new H(re);this.searchParams=null}else{if(R!==void 0&&(C=new ea(R,!0)),re=this.parse(P,null,C),re)throw new H(re);B=A(new O),B.bindURL(this),this.searchParams=B}};ea.prototype={type:"URL",parse:function(E,L,R){var P=this,C=L||rr,re=0,B="",ye=!1,Se=!1,Te=!1,Ve,U,Pe,dt;for(E=p(E),L||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=S(E,Or,""),E=S(E,er,"$1")),E=S(E,Ct,""),Ve=f(E);re<=Ve.length;){switch(U=Ve[re],C){case rr:if(U&&D(ke,U))B+=Y(U),C=nr;else{if(L)return ne;C=M;continue}break;case nr:if(U&&(D(Ne,U)||U==="+"||U==="-"||U==="."))B+=Y(U);else if(U===":"){if(L&&(P.isSpecial()!==l(Me,B)||B==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=B,L){P.isSpecial()&&Me[P.scheme]===P.port&&(P.port=null);return}B="",P.scheme==="file"?C=Xn:P.isSpecial()&&R&&R.scheme===P.scheme?C=G:P.isSpecial()?C=se:Ve[re+1]==="/"?(C=W,re++):(P.cannotBeABaseURL=!0,q(P.path,""),C=cc)}else{if(L)return ne;B="",C=M,re=0;continue}break;case M:if(!R||R.cannotBeABaseURL&&U!=="#")return ne;if(R.cannotBeABaseURL&&U==="#"){P.scheme=R.scheme,P.path=h(R.path),P.query=R.query,P.fragment="",P.cannotBeABaseURL=!0,C=ft;break}C=R.scheme==="file"?Xn: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=ot;continue}case Z:if(P.scheme=R.scheme,U===ge)P.username=R.username,P.password=R.password,P.host=R.host,P.port=R.port,P.path=h(R.path),P.query=R.query;else if(U==="/"||U==="\\"&&P.isSpecial())C=ie;else if(U==="?")P.username=R.username,P.password=R.password,P.host=R.host,P.port=R.port,P.path=h(R.path),P.query="",C=Ut;else if(U==="#")P.username=R.username,P.password=R.password,P.host=R.host,P.port=R.port,P.path=h(R.path),P.query=R.query,P.fragment="",C=ft;else{P.username=R.username,P.password=R.password,P.host=R.host,P.port=R.port,P.path=h(R.path),P.path.length--,C=ot;continue}break;case ie:if(P.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=ve;else{P.username=R.username,P.password=R.password,P.host=R.host,P.port=R.port,C=ot;continue}break;case se:if(C=he,U!=="/"||F(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 ta=0;ta<Pe.length;ta++){var fc=Pe[ta];if(fc===":"&&!Te){Te=!0;continue}var dc=_e(fc,He);Te?P.password+=dc:P.username+=dc}B=""}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(ye&&B==="")return fe;re-=f(B).length+1,B="",C=be}else B+=U;break;case be:case qe:if(L&&P.scheme==="file"){C=Qn;continue}else if(U===":"&&!Se){if(B==="")return ce;if(dt=P.parseHost(B),dt)return dt;if(B="",C=it,L===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(P.isSpecial()&&B==="")return ce;if(L&&B===""&&(P.includesCredentials()||P.port!==null))return;if(dt=P.parseHost(B),dt)return dt;if(B="",C=ar,L)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case it:if(D(De,U))B+=U;else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()||L){if(B!==""){var ra=V(B,10);if(ra>65535)return ae;P.port=P.isSpecial()&&ra===Me[P.scheme]?null:ra,B=""}if(L)return;C=ar;continue}else return ae;break;case Xn:if(P.scheme="file",U==="/"||U==="\\")C=sc;else if(R&&R.scheme==="file")switch(U){case ge:P.host=R.host,P.path=h(R.path),P.query=R.query;break;case"?":P.host=R.host,P.path=h(R.path),P.query="",C=Ut;break;case"#":P.host=R.host,P.path=h(R.path),P.query=R.query,P.fragment="",C=ft;break;default:Ge(T(h(Ve,re),""))||(P.host=R.host,P.path=h(R.path),P.shortenPath()),C=ot;continue}else{C=ot;continue}break;case sc:if(U==="/"||U==="\\"){C=Qn;break}R&&R.scheme==="file"&&!Ge(T(h(Ve,re),""))&&(Re(R.path[0],!0)?q(P.path,R.path[0]):P.host=R.host),C=ot;continue;case Qn:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!L&&Re(B))C=ot;else if(B===""){if(P.host="",L)return;C=ar}else{if(dt=P.parseHost(B),dt)return dt;if(P.host==="localhost"&&(P.host=""),L)return;B="",C=ar}continue}else B+=U;break;case ar:if(P.isSpecial()){if(C=ot,U!=="/"&&U!=="\\")continue}else if(!L&&U==="?")P.query="",C=Ut;else if(!L&&U==="#")P.fragment="",C=ft;else if(U!==ge&&(C=ot,U!=="/"))continue;break;case ot:if(U===ge||U==="/"||U==="\\"&&P.isSpecial()||!L&&(U==="?"||U==="#")){if(Cr(B)?(P.shortenPath(),U!=="/"&&!(U==="\\"&&P.isSpecial())&&q(P.path,"")):tr(B)?U!=="/"&&!(U==="\\"&&P.isSpecial())&&q(P.path,""):(P.scheme==="file"&&!P.path.length&&Re(B)&&(P.host&&(P.host=""),B=F(B,0)+":"),q(P.path,B)),B="",P.scheme==="file"&&(U===ge||U==="?"||U==="#"))for(;P.path.length>1&&P.path[0]==="";)k(P.path);U==="?"?(P.query="",C=Ut):U==="#"&&(P.fragment="",C=ft)}else B+=_e(U,de);break;case cc:U==="?"?(P.query="",C=Ut):U==="#"?(P.fragment="",C=ft):U!==ge&&(P.path[0]+=_e(U,oe));break;case Ut:!L&&U==="#"?(P.fragment="",C=ft):U!==ge&&(U==="'"&&P.isSpecial()?P.query+="%27":U==="#"?P.query+="%23":P.query+=_e(U,oe));break;case ft:U!==ge&&(P.fragment+=_e(U,ue));break}re++}},parseHost:function(E){var L,R,P;if(F(E,0)==="["){if(F(E,E.length-1)!=="]"||(L=At(z(E,1,-1)),!L))return ce;this.host=L}else if(this.isSpecial()){if(E=v(E),D(Tt,E)||(L=et(E),L===null))return ce;this.host=L}else{if(D(Ot,E))return ce;for(L="",R=f(E),P=0;P<R.length;P++)L+=_e(R[P],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 E=this.path,L=E.length;L&&(this.scheme!=="file"||L!==1||!Re(E[0],!0))&&E.length--},serialize:function(){var E=this,L=E.scheme,R=E.username,P=E.password,C=E.host,re=E.port,B=E.path,ye=E.query,Se=E.fragment,Te=L+":";return C!==null?(Te+="//",E.includesCredentials()&&(Te+=R+(P?":"+P:"")+"@"),Te+=X(C),re!==null&&(Te+=":"+re)):L==="file"&&(Te+="//"),Te+=E.cannotBeABaseURL?B[0]:B.length?"/"+T(B,"/"):"",ye!==null&&(Te+="?"+ye),Se!==null&&(Te+="#"+Se),Te},setHref:function(E){var L=this.parse(E);if(L)throw new H(L);this.searchParams.update()},getOrigin:function(){var E=this.scheme,L=this.port;if(E==="blob")try{return new ir(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+(L!==null?":"+L:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",rr)},getUsername:function(){return this.username},setUsername:function(E){var L=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var R=0;R<L.length;R++)this.username+=_e(L[R],He)}},getPassword:function(){return this.password},setPassword:function(E){var L=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var R=0;R<L.length;R++)this.password+=_e(L[R],He)}},getHost:function(){var E=this.host,L=this.port;return E===null?"":L===null?X(E):X(E)+":"+L},setHost:function(E){this.cannotBeABaseURL||this.parse(E,be)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,qe)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,it))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+T(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,ar))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(F(E,0)==="?"&&(E=z(E,1)),this.query="",this.parse(E,Ut)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}F(E,0)==="#"&&(E=z(E,1)),this.fragment="",this.parse(E,ft)},update:function(){this.query=this.searchParams.serialize()||null}};var ir=function(L){var R=u(this,xe),P=I(arguments.length,1)>1?arguments[1]:void 0,C=m(R,new ea(L,!1,P));e||(R.href=C.serialize(),R.origin=C.getOrigin(),R.protocol=C.getProtocol(),R.username=C.getUsername(),R.password=C.getPassword(),R.host=C.getHost(),R.hostname=C.getHostname(),R.port=C.getPort(),R.pathname=C.getPathname(),R.search=C.getSearch(),R.searchParams=C.getSearchParams(),R.hash=C.getHash())},xe=ir.prototype,We=function(E,L){return{get:function(){return b(this)[E]()},set:L&&function(R){return b(this)[L](R)},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}),N){var uc=N.createObjectURL,lc=N.revokeObjectURL;uc&&o(ir,"createObjectURL",a(uc,N)),lc&&o(ir,"revokeObjectURL",a(lc,N))}return g(ir,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:ir}),yl}var Al;function Gp(){return Al||(Al=1,Bp()),gl}var Ul={},$l;function Wp(){if($l)return Ul;$l=1;var t=Ie(),e=Ye(),r=Ae(),n=Qt(),a=wt(),i=jn(),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}}}),Ul}var Ll={},ql;function Vp(){if(ql)return Ll;ql=1;var t=Ie(),e=Ye(),r=Qt(),n=wt(),a=jn(),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}}}),Ll}var jl={},Nl;function Jp(){if(Nl)return jl;Nl=1;var t=Ie(),e=je();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),jl}var ao,xl;function Zp(){if(xl)return ao;xl=1,Mh(),Gp(),Wp(),Vp(),Jp();var t=Mn();return ao=t.URL,ao}var io,Dl;function Yp(){if(Dl)return io;Dl=1;var t=Zp();return io=t,io}var oo,Ml;function Xp(){if(Ml)return oo;Ml=1;var t=Yp();return oo=t,oo}Xp();var Fl={},so,Kl;function Qp(){return Kl||(Kl=1,so={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}),so}var co,zl;function em(){if(zl)return co;zl=1;var t=$n(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return co=r===Object.prototype?void 0:r,co}var Hl;function Gh(){if(Hl)return Fl;Hl=1;var t=me(),e=Qp(),r=em(),n=Ls(),a=Xt(),i=Pr(),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"),Fl}var uo,Bl;function tm(){if(Bl)return uo;Bl=1;var t=Mh();return Gh(),uo=t,uo}var lo,Gl;function rm(){if(Gl)return lo;Gl=1;var t=tm();return lo=t,lo}rm();var Wl={},Vl={},fo,Jl;function nm(){if(Jl)return fo;Jl=1;var t=Ze(),e=Xt();return fo=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},fo}var ho,Zl;function am(){if(Zl)return ho;Zl=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 ho=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},ho}var vo,Yl;function im(){if(Yl)return vo;Yl=1;var t=Ae(),e=Yt();return vo=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),vo}var po,Xl;function om(){if(Xl)return po;Xl=1;var t=Xt(),e=am(),r=im(),n=Error.captureStackTrace;return po=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},po}var mo,Ql;function en(){if(Ql)return mo;Ql=1;var t=Er(),e=je(),r=nt(),n=qn(),a=Hh(),i=_s(),o=Ln(),s=Ns(),u=xn(),l=zh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return mo=function(d,v,p){var g=p&&p.that,I=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),O,A,N,H,V,te,j,F=function(T){return O&&l(O,"normal"),new f(!0,T)},D=function(T){return I?(r(T),m?b(T[0],T[1],F):b(T[0],T[1])):m?b(T,F):b(T)};if(w)O=d.iterator;else if(y)O=d;else{if(A=u(d),!A)throw new c(n(d)+" is not iterable");if(a(A)){for(N=0,H=i(d);H>N;N++)if(V=D(d[N]),V&&o(h,V))return V;return new f(!1)}O=s(d,A)}for(te=w?d.next:O.next;!(j=e(te,O)).done;){try{V=D(j.value)}catch(T){l(O,"throw",T)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},mo}var go,ef;function sm(){if(ef)return go;ef=1;var t=wt();return go=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},go}var tf;function cm(){if(tf)return Vl;tf=1;var t=Ie(),e=Ln(),r=As(),n=Us(),a=$h(),i=Yr(),o=Xt(),s=Yt(),u=nm(),l=om(),c=en(),f=sm(),h=Ue(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(I,this),O;n?O=n(new v,b?r(this):I):(O=b?this:i(I),o(O,d,"Error")),m!==void 0&&o(O,"message",f(m)),l(O,g,O.stack,1),arguments.length>2&&u(O,arguments[2]);var A=[];return c(y,p,{that:A}),o(O,"errors",A),O};n?n(g,v):a(g,v,{name:!0});var I=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}),Vl}var rf;function um(){return rf||(rf=1,cm()),Wl}var nf={},yo,af;function lm(){if(af)return yo;af=1;var t=js(),e=Qr();return yo=t?{}.toString:function(){return"[object "+e(this)+"]"},yo}var of;function fm(){if(of)return nf;of=1;var t=js(),e=Xe(),r=lm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),nf}var sf={},cf={},wo,uf;function Wh(){if(uf)return wo;uf=1;var t=me(),e=Zr(),r=On(),n=function(a){return e.slice(0,a.length)===a};return wo=(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"})(),wo}var bo,lf;function xs(){if(lf)return bo;lf=1;var t=Wh();return bo=t==="NODE",bo}var So,ff;function dm(){if(ff)return So;ff=1;var t=Ye(),e=Nn(),r=Ue(),n=$e(),a=r("species");return So=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},So}var Io,df;function hm(){if(df)return Io;df=1;var t=Bh(),e=qn(),r=TypeError;return Io=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Io}var Po,hf;function Vh(){if(hf)return Po;hf=1;var t=nt(),e=hm(),r=Cn(),n=Ue(),a=n("species");return Po=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},Po}var Eo,vf;function Jh(){if(vf)return Eo;vf=1;var t=Tn(),e=Function.prototype,r=e.apply,n=e.call;return Eo=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),Eo}var ko,pf;function Zh(){if(pf)return ko;pf=1;var t=Zr();return ko=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),ko}var _o,mf;function Yh(){if(mf)return _o;mf=1;var t=me(),e=Jh(),r=Er(),n=we(),a=Je(),i=Ae(),o=Rh(),s=Dn(),u=$n(),l=Qt(),c=Zh(),f=xs(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,I=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",O,A,N,H;i(function(){O=t.location});var V=function(D){if(a(m,D)){var T=m[D];delete m[D],T()}},te=function(D){return function(){V(D)}},j=function(D){V(D.data)},F=function(D){t.postMessage(w(D),O.protocol+"//"+O.host)};return(!h||!d)&&(h=function(T){l(arguments.length,1);var _=n(T)?T:g(T),$=s(arguments,1);return m[++y]=function(){e(_,void 0,$)},A(y),y},d=function(T){delete m[T]},f?A=function(D){v.nextTick(te(D))}:p&&p.now?A=function(D){p.now(te(D))}:I&&!c?(N=new I,H=N.port2,N.port1.onmessage=j,A=r(H.postMessage,H)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&O&&O.protocol!=="file:"&&!i(F)?(A=F,t.addEventListener("message",j,!1)):b in u("script")?A=function(D){o.appendChild(u("script"))[b]=function(){o.removeChild(this),V(D)}}:A=function(D){setTimeout(te(D),0)}),_o={set:h,clear:d},_o}var Ro,gf;function Xh(){if(gf)return Ro;gf=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 To,yf;function vm(){if(yf)return To;yf=1;var t=Zr();return To=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",To}var Oo,wf;function pm(){if(wf)return Oo;wf=1;var t=Zr();return Oo=/web0s(?!.*chrome)/i.test(t),Oo}var Co,bf;function mm(){if(bf)return Co;bf=1;var t=me(),e=xh(),r=Er(),n=Yh().set,a=Xh(),i=Zh(),o=vm(),s=pm(),u=xs(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,g,I,w;if(!d){var y=new a,m=function(){var b,O;for(u&&(b=f.domain)&&b.exit();O=y.get();)try{O()}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?(I=h.resolve(void 0),I.constructor=h,w=r(I.then,I),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 Co=d,Co}var Ao,Sf;function gm(){return Sf||(Sf=1,Ao=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),Ao}var Uo,If;function kr(){return If||(If=1,Uo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Uo}var $o,Pf;function _r(){if(Pf)return $o;Pf=1;var t=me();return $o=t.Promise,$o}var Lo,Ef;function tn(){if(Ef)return Lo;Ef=1;var t=me(),e=_r(),r=we(),n=Lh(),a=Cs(),i=Ue(),o=Wh(),s=lt(),u=gh(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var g=new e(function(y){y(1)}),I=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=I,f=g.then(function(){})instanceof I,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return Lo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},Lo}var qo={},kf;function bt(){if(kf)return qo;kf=1;var t=at(),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 qo.f=function(n){return new r(n)},qo}var _f;function ym(){if(_f)return cf;_f=1;var t=Ie(),e=lt(),r=xs(),n=me(),a=Mn(),i=je(),o=Xe(),s=Us(),u=Pr(),l=dm(),c=at(),f=we(),h=Ze(),d=qs(),v=Vh(),p=Yh().set,g=mm(),I=gm(),w=kr(),y=Xh(),m=Ir(),b=_r(),O=tn(),A=bt(),N="Promise",H=O.CONSTRUCTOR,V=O.REJECTION_EVENT,te=O.SUBCLASSING,j=m.getterFor(N),F=m.set,D=b&&b.prototype,T=b,_=D,$=n.TypeError,q=n.document,S=n.process,k=A.f,x=k,z=!!(q&&q.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,Re,Ge,tr;try{de?(ue||(X.rejection===ke&&Ct(X),X.rejection=ae),de===!0?Re=oe:(Me&&Me.enter(),Re=de(oe),Me&&(Me.exit(),tr=!0)),Re===K.promise?_e(new $("Promise-chain cycle")):(Ge=St(Re))?i(Ge,Re,He,_e):He(Re)):_e(oe)}catch(Cr){Me&&!tr&&Me.exit(),_e(Cr)}},Tt=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&&Or(K)}))},Ot=function(K,X,oe){var ue,de;z?(ue=q.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&&I("Unhandled promise rejection",oe)},Or=function(K){i(p,n,function(){var X=K.facade,oe=K.value,ue=er(K),de;if(ue&&(de=w(function(){r?S.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?S.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,Tt(K,!0))},At=function(K,X,oe){if(!K.done){K.done=!0,oe&&(K=oe);try{if(K.facade===X)throw new $("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,Tt(K,!1))}catch(de){et({done:!1},de,K)}}};if(H&&(T=function(X){d(this,_),c(X),i(Ne,this);var oe=j(this);try{X(ge(At,oe),ge(et,oe))}catch(ue){et(oe,ue)}},_=T.prototype,Ne=function(X){F(this,{type:N,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(_,"then",function(X,oe){var ue=j(this),de=k(v(this,T));return ue.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?S.domain:void 0,ue.state===fe?ue.reactions.add(de):g(function(){It(de,ue)}),de.promise}),De=function(){var K=new Ne,X=j(K);this.promise=K,this.resolve=ge(At,X),this.reject=ge(et,X)},A.f=k=function(K){return K===T||K===Le?new De(K):x(K)},!e&&f(b)&&D!==Object.prototype)){Qe=D.then,te||o(D,"then",function(X,oe){var ue=this;return new T(function(de,He){i(Qe,ue,de,He)}).then(X,oe)},{unsafe:!0});try{delete D.constructor}catch{}s&&s(D,_)}return t({global:!0,constructor:!0,wrap:!0,forced:H},{Promise:T}),Le=a.Promise,u(T,N,!1,!0),l(N),cf}var Rf={},jo,Tf;function wm(){if(Tf)return jo;Tf=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 jo=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},jo}var No,Of;function Fn(){if(Of)return No;Of=1;var t=_r(),e=wm(),r=tn().CONSTRUCTOR;return No=r||!e(function(n){t.all(n).then(void 0,function(){})}),No}var Cf;function bm(){if(Cf)return Rf;Cf=1;var t=Ie(),e=je(),r=at(),n=bt(),a=kr(),i=en(),o=Fn();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,I=1;i(u,function(w){var y=g++,m=!1;I++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--I||f(p))},h)}),--I||f(p)});return d.error&&h(d.value),c.promise}}),Rf}var Af={},Uf;function Sm(){if(Uf)return Af;Uf=1;var t=Ie(),e=lt(),r=tn().CONSTRUCTOR,n=_r(),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 Af}var $f={},Lf;function Im(){if(Lf)return $f;Lf=1;var t=Ie(),e=je(),r=at(),n=bt(),a=kr(),i=en(),o=Fn();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 qf={},jf;function Pm(){if(jf)return qf;jf=1;var t=Ie(),e=bt(),r=tn().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}}),qf}var Nf={},xo,xf;function Qh(){if(xf)return xo;xf=1;var t=nt(),e=Ze(),r=bt();return xo=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},xo}var Df;function Em(){if(Df)return Nf;Df=1;var t=Ie(),e=Ye(),r=lt(),n=_r(),a=tn().CONSTRUCTOR,i=Qh(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),Nf}var Mf;function km(){return Mf||(Mf=1,ym(),bm(),Sm(),Im(),Pm(),Em()),sf}var Ff={},Kf;function _m(){if(Kf)return Ff;Kf=1;var t=Ie(),e=je(),r=at(),n=bt(),a=kr(),i=en(),o=Fn();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,I=1;i(u,function(w){var y=g++,m=!1;I++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--I||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--I||f(p))})}),--I||f(p)});return d.error&&h(d.value),c.promise}}),Ff}var zf={},Hf;function Rm(){if(Hf)return zf;Hf=1;var t=Ie(),e=je(),r=at(),n=Ye(),a=bt(),i=kr(),o=en(),s=Fn(),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 I=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(O){var A=y++,N=!1;m++,e(I,f,O).then(function(H){N||b||(b=!0,v(H))},function(H){N||b||(N=!0,w[A]=H,--m||p(new h(w,u)))})}),--m||p(new h(w,u))});return g.error&&p(g.value),d.promise}}),zf}var Bf={},Gf;function ev(){if(Gf)return Bf;Gf=1;var t=Ie(),e=me(),r=Jh(),n=Dn(),a=bt(),i=at(),o=kr(),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}}),Bf}var Wf={},Vf;function tv(){if(Vf)return Wf;Vf=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}}}),Wf}var Jf={},Zf;function Tm(){if(Zf)return Jf;Zf=1;var t=Ie(),e=lt(),r=_r(),n=Ae(),a=Ye(),i=we(),o=Vh(),s=Qh(),u=Xe(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Jf}var Do,Yf;function Om(){if(Yf)return Do;Yf=1,um(),Ls(),fm(),km(),_m(),Rm(),ev(),tv(),Tm(),Kh();var t=Mn();return Do=t.Promise,Do}var Mo,Xf;function Cm(){if(Xf)return Mo;Xf=1;var t=Om();return Gh(),Mo=t,Mo}var Qf={},ed;function Am(){return ed||(ed=1,ev()),Qf}var td={},rd;function Um(){return rd||(rd=1,tv()),td}var Fo,nd;function $m(){if(nd)return Fo;nd=1;var t=Cm();return Am(),Um(),Fo=t,Fo}$m();const rv="sesamy-debug";function Lm(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 qm(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 jm(t){Lm(rv,t.toString(),1)}function Nm(){return qm(rv)==="true"}function le(t){Nm()&&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 ct(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 Ds(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ms(t,e){return t(e={exports:{}},e.exports),e.exports}var Lt=Ms((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()}}));Ds(Lt);var xm=Ds(Ms((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 I(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,I)}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:I(0),throw:I(1),return:I(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function I(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,I,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]:(I=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:I,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,I;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]):((I=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(I)),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 I(){if(g||(window.removeEventListener("storage",I),c.removeFromWaiting(I),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",I),c.addToWaiting(I);var w=setTimeout(I,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 I=!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),I=!0)}}}I&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const Dm={timeoutInSeconds:60},nv={name:"auth0-spa-js",version:"2.8.0"},av=()=>Date.now();let Ee=class is extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,is.prototype)}static fromPayload({error:e,error_description:r}){return new is(e,r)}},Mm=class iv extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,iv.prototype)}},Fm=class ov extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,ov.prototype)}},os=class sv extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,sv.prototype)}};class Fs extends os{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Fs.prototype)}}let Km=class cv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,cv.prototype)}},zm=class uv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,uv.prototype)}},lv=class fv extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${yn(e,["default"])}', scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,fv.prototype)}},Hm=class dv extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${yn(e,["default"])}', missing scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,dv.prototype)}},hv=class vv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,vv.prototype)}};function yn(t,e=[]){return t&&!e.includes(t)?t:""}const wn=()=>window.crypto,Ur=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Ko=t=>btoa(t),Bm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Gm=t=>Object.keys(t).reduce(((e,r)=>{const n=Bm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),ss=t=>{var{clientId:e}=t,r=ct(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()},ad=async t=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),id=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),od=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Wm=new TextEncoder,Vm=new TextDecoder;function Fr(t){return typeof t=="string"?Wm.encode(t):Vm.decode(t)}function sd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Zm(`${t.name} modulusLength must be at least 2048 bits`)}async function Jm(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=`${Kr(Fr(JSON.stringify(t)))}.${Kr(Fr(JSON.stringify(e)))}`;return`${n}.${Kr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return sd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return sd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Dt})(r),r,Fr(n)))}`}let cs;Uint8Array.prototype.toBase64?cs=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):cs=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 Kr(t){return cs(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)}},Zm=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 Ym(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 pv(t){return t instanceof CryptoKey}function mv(t){return pv(t)&&t.type==="public"}async function Xm(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!pv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!mv(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Jm({alg:Ym(o),typ:"dpop+jwt",jwk:await gv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Kr(await crypto.subtle.digest("SHA-256",Fr(a))):void 0}),o)}async function gv(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const Qm=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function eg(){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 tg(t){return(async function(e){if(!mv(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await gv(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Dt("unsupported JWK kty")}return Kr(await crypto.subtle.digest({name:"SHA-256"},Fr(JSON.stringify(n))))})(t.publicKey)}function rg({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 Xm(t,i,r,n,a)}const ng=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},ag=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([ng(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ig=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},og=async(t,e,r,n,a,i,o=1e4,s)=>a?ig(t,e,r,n,o,a,i,s):ag(t,n,o);async function yv(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await og(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=ct(h,["error","error_description"]),{headers:g,ok:I}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!I){const y=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new zm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new lv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new hv(w);return yv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function sg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=ct(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?ss(d):JSON.stringify(d),p=(g=c.grant_type,Qm.includes(g));var g;return await yv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Gm(o||nv)))}},e,s,u,p?l:void 0)}const hn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},nn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),hn(n,e)};let vt=class us{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 us({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new us({scope:r,audience:n,clientId:a})}},cg=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},wv=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},ug=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||av}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new vt({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 vt({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 vt({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=vt.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=vt.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)}}}},lg=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 $r=t=>typeof t=="number",fg=["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"],dg=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(id(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],fg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(id(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&&!$r(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||!$r(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!$r(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&&$r(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&&$r(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=Ms((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}))}}));Ds(Mt),Mt.encode,Mt.parse,Mt.getAll;var hg=Mt.get,bv=Mt.set,Sv=Mt.remove;const cr={get(t){const e=hg(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),bv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r)}},vg={get(t){return cr.get(t)||cr.get(`_legacy_${t}`)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),bv(`_legacy_${t}`,JSON.stringify(e),n),cr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r),cr.remove(t,e),cr.remove(`_legacy_${t}`,e)}},pg={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 mg(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 cd,ud,ld,zo,gg=(cd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ud=null,ld=!1,function(t){return zo=zo||mg(cd,ud,ld),new Worker(zo,t)});const Ho={};let yg=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 wg={memory:()=>new wv().enclosedCache,localstorage:()=>new cg},fd=t=>wg[t],dd=t=>{const{openUrl:e,onRedirect:r}=t,n=ct(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},hd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},$t={NONCE:"nonce",KEYPAIR:"keypair"};let bg=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)}},Sg=class{constructor(e){this.storage=new bg(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 eg(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return rg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return tg(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var ur;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(ur||(ur={}));let Ig=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=ur.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?ur.DPoP:ur.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===ur.DPoP&&await this.setDpopProofHeader(e,i)}getHeader(e,r){return Array.isArray(e)?new Headers(e).get(r)||"":typeof e.get=="function"?e.get(r)||"":e[r]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const r=this.getHeader(e.headers,"www-authenticate");return r.includes("invalid_dpop_nonce")||r.includes("use_dpop_nonce")}async handleResponse(e,r){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!r.onUseDpopNonceError)throw new hv(n);return r.onUseDpopNonceError()}async internalFetchWithAuth(e,r,n,a){const i=this.buildBaseRequest(e,r);await this.prepareRequest(i,a);const o=await this.config.fetch(i);return this.handleResponse(o,n)}fetchWithAuth(e,r,n){const a={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,r,Object.assign(Object.assign({},a),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,r,a,n)}},Pg=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 vd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new vd(r)}},vd=class Iv extends Error{constructor({type:e,status:r,title:n,detail:a,validation_errors:i}){super(a),this.name="MyAccountApiError",this.type=e,this.status=r,this.title=n,this.detail=a,this.validation_errors=i,Object.setPrototypeOf(this,Iv.prototype)}};const Bo=new xm;let Eg=class{constructor(e){let r,n;if(this.userCache=new wv().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await Bo.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(!wn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wn().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",!fd(r))throw new Error(`Invalid cache location "${r}"`);n=fd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?ur:vg,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:pg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:hn(l,u,...c)};let f={default:hn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=hn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new lg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||av,this.cacheManager=new ug(n,n.allKeys?void 0:new yg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Sg(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 Pg(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 gg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||nv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${us(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return dg({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(Ur()),o=Ho(Ur()),s=Ur(),u=await ad(s),l=od(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,S,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:nn(v,p.scope,p.audience),response_type:"code",response_mode:m||"query",state:g,nonce:S,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 Km(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(Ae.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 Ae("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=dd(e),{openUrl:a,fragment:i,appState:o}=n,s=pt(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=pt(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Mt.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 Ae("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===Mt.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 Mm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ae("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:Mt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Fm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ae("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ae("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:Mt.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:nn(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=pt(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:nn(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({},Dm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new It({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=pt(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=dd(e),{openUrl:a}=n,i=pt(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 Ae("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,S=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",O,!1))};let O;const A=setTimeout((()=>{y(new cs),b()}),1e3*S);O=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(Ae.fromPayload(j.data.response)):w(j.data.response),clearTimeout(A),window.removeEventListener("message",O,!1),setTimeout(b,2e3)},window.addEventListener("message",O,!1),window.document.body.appendChild(m),m.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ae("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 It({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new lv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],S=g.every((w=>p.includes(w)));return p.length>=g.length&&S?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||!hd(l,s))&&!hd(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 Hm(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=pt(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 It({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 It({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 sg(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:nn(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 Ig(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(Ur()),u=Ur(),l=await ad(u),c=od(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:Mt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function kg(t){const e=new Eg(t);return await e.checkSession(),e}var Je=(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))(Je||{});const _g="sesamy.com",Rg="sesamy.dev",Tg="https://sesa.my",pd="sesamyCacheTimestamp",md="sesamyContentReloaded";function Pv(t,e){return`${t}.${e==="dev"?Rg:_g}`}function vt(t,e){return`https://${Pv(t,e)}`}function bn(){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",!fd(r))throw new Error(`Invalid cache location "${r}"`);n=fd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?cr:vg,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:pg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:hn(l,u,...c)};let f={default:hn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=hn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new lg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||av,this.cacheManager=new ug(n,n.allKeys?void 0:new yg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Sg(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 Pg(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 gg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||nv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${ss(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return dg({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=Ko(Ur()),o=Ko(Ur()),s=Ur(),u=await ad(s),l=od(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,I,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:nn(v,p.scope,p.audience),response_type:"code",response_mode:m||"query",state:g,nonce:I,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 Km(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Fs(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=dd(e),{openUrl:a,fragment:i,appState:o}=n,s=ct(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=ct(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 Mm(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 Fm(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:nn(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=Ho[s];return u||(u=o().finally((()=>{delete Ho[s],u=null})),Ho[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=ct(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})((()=>Bo.acquireLock(a,5e3)),10))throw new os;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 Bo.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:nn(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({},Dm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new vt({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=ct(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ss(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=dd(e),{openUrl:a}=n,i=ct(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,I=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",O,!1))};let O;const A=setTimeout((()=>{y(new os),b()}),1e3*I);O=function(N){if(N.origin!=g||!N.data||N.data.type!=="authorization_response")return;const H=N.source;H&&H.close(),N.data.response.error?y(Ee.fromPayload(N.data.response)):w(N.data.response),clearTimeout(A),window.removeEventListener("message",O,!1),setTimeout(b,2e3)},window.addEventListener("message",O,!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 vt({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new lv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],I=g.every((w=>p.includes(w)));return p.length>=g.length&&I?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||!hd(l,s))&&!hd(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 Hm(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=ct(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 vt({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 vt({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 sg(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:nn(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 Ig(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=Ko(Ur()),u=Ur(),l=await ad(u),c=od(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 kg(t){const e=new Eg(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 _g="sesamy.com",Rg="sesamy.dev",Tg="https://sesa.my",pd="sesamyCacheTimestamp",md="sesamyContentReloaded";function Pv(t,e){return`${t}.${e==="dev"?Rg:_g}`}function st(t,e){return`https://${Pv(t,e)}`}function Ks(){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:()=>Og,k:()=>Bs});var Lr=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())})},jr=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 Lr(this,void 0,Promise,function(){return jr(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 Lr(this,void 0,void 0,function(){var h,d;return jr(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 Lr(this,void 0,Promise,function(){return jr(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 S=g.target.result,w=function(y){i(y)};try{S.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{S.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,S,w,y=window;return(w=(S=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||S===void 0?void 0:S.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 Lr(this,void 0,Promise,function(){var d,v,p;return jr(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(S){p.error&&p.error.name==="InvalidStateError"&&S.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return Lr(this,void 0,Promise,function(){return jr(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 Og=Bs;Hs.A;const Cg=Hs.k,vn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(vn);return t===null?void 0:t==="true"}catch{return}}async function Ag(){try{const t=sessionStorage.getItem(vn);if(t!==null)return t==="true";const{isPrivate:e}=await Cg();return sessionStorage.setItem(vn,e.toString()),e}catch{try{sessionStorage.setItem(vn,"false")}catch{}return!1}}function Gr(){return typeof window<"u"}function gd(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 Ug="function",$g="string",ot="undefined",Lg="boolean",Sn="object",jg="array",qg="number",Ng="symbol",xg="null",hs=function(){},Ev="any",kv="*",Zt="__",Dg="form",Mg="input",Fg="button",Kg="select",In=typeof process!==ot?process:{};In.env&&In.env.NODE_ENV;var Ne=typeof document!==ot;In.versions!=null&&In.versions.node!=null;typeof Deno!==ot&&Deno.core;Ne&&window.name==="nodejs"||typeof navigator!==ot&&typeof navigator.userAgent!==ot&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _v(t,e){return e.charAt(0)[t]()+e.slice(1)}var zg=_v.bind(null,"toUpperCase"),Hg=_v.bind(null,"toLowerCase");function Bg(t){return Rv(t)?zg(xg):typeof t===Sn?Jg(t):Object.prototype.toString.call(t).slice(8,-1)}function Pn(t,e){e===void 0&&(e=!0);var r=Bg(t);return e?Hg(r):r}function rn(t,e){return typeof e===t}var Ve=rn.bind(null,Ug),Ut=rn.bind(null,$g),fr=rn.bind(null,ot),Gg=rn.bind(null,Lg);rn.bind(null,Ng);function Rv(t){return t===null}function Wg(t){return Pn(t)===qg&&!isNaN(t)}function Tv(t){return Pn(t)===jg}function We(t){if(!Vg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Vg(t){return t&&(typeof t===Sn||t!==null)}function Jg(t){return Ve(t.constructor)?t.constructor.name:null}function Zg(t){return t instanceof Error||Ut(t.message)&&t.constructor&&Wg(t.constructor.stackTraceLimit)}function Ov(t,e){if(typeof e!="object"||Rv(e))return!1;if(e instanceof t)return!0;var r=Pn(new t(""));if(Zg(e))for(;e;){if(Pn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Ov.bind(null,TypeError);Ov.bind(null,SyntaxError);function Hn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Yg(t,e):r}function Yg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Bn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Bn(Hn,Dg);Bn(Hn,Fg);Bn(Hn,Mg);Bn(Hn,Kg);function Xg(t){return t?Tv(t)?t:[t]:[]}function yd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Qg(){if(Ne){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function ey(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ty(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=yd(r[1]),o=yd(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&&(ry(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return Ne&&window.location.search.substring(1)})())}function ry(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 Gn(){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 ny(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",gr=Zt+Ht+Zt,yr=typeof self===Sn&&self.self===self&&self||typeof global===Sn&&global[Ht]===global&&global||void 0;function Yt(t){return yr[gr][t]}function Xt(t,e){return yr[gr][t]=e}function Tr(t){delete yr[gr][t]}function Or(t,e,r){var n;try{if(Ws(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}yr[gr]||(yr[gr]={});var an={};function Ws(t){if(typeof an[t]!==ot)return an[t];try{var e=window[t];e.setItem(ot,ot),e.removeItem(ot)}catch{return an[t]=!1}return an[t]=!0}function ae(){return ae=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},ae.apply(null,arguments)}var Ct="function",Pt="undefined",zr="reducer",Cv="@@redux/",vs=Cv+"INIT",ay=Cv+Math.random().toString(36),wd=(function(){return typeof Symbol===Ct&&Symbol.observable||"@@observable"})(),on=" != "+Ct;function Av(t,e,r){var n;if(typeof e===Ct&&typeof r===Pt&&(r=e,e=void 0),typeof r!==Pt){if(typeof r!==Ct)throw new Error("enhancer"+on);return r(Av)(t,e)}if(typeof t!==Ct)throw new Error(zr+on);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!==Ct)throw new Error("Listener"+on);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(!We(d))throw new Error("Act != obj");if(typeof d.type===Pt)throw new Error("ActType "+Pt);if(u)throw new Error("Dispatch in "+zr);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!==Ct)throw new Error("next "+zr+on);a=d,h({type:vs})}})[wd]=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)}}})[wd]=function(){return this},d},n}function iy(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+zr+" "+t+" returns "+Pt}function wr(){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 oy(){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)}),ae({},o,{dispatch:s=wr.apply(void 0,i)(o.dispatch)})}}}var $t=Zt+"anon_id",Bt=Zt+"user_id",hr=Zt+"user_traits",ps="analytics",Ot="userId",dr="anonymousId",pn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ms=["name","EVENTS","config","loaded"],ne=pn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),bd=/^utm_/,Sd=/^an_prop_/,Id=/^an_trait_/;function sy(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===ne.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e($t,o.anonymousId),l||e(Bt,o.userId),u.traits&&e(hr,ae({},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(bd)||p.match(/^(d|g)clid/)){var g=p.replace(bd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Sd)&&(v.props[p.replace(Sd,"")]=i[p]),p.match(Id)&&(v.traits[p.replace(Id,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(ae({type:ne.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:ne.campaign,campaign:d.campaign})}}return n(a)}}}}function cy(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===ne.setItemEnd){if(r.key===$t)return ae({},e,{anonymousId:r.value});if(r.key===Bt)return ae({},e,{userId:r.value})}switch(r.type){case ne.identify:return Object.assign({},e,{userId:r.userId,traits:ae({},e.traits,r.traits)});case ne.reset:return[Bt,$t,hr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Pd(t){return{userId:t.getItem(Bt),anonymousId:t.getItem($t),traits:t.getItem(hr)}}var gs=function(t){return Zt+"TEMP"+Zt+t};function uy(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===ne.reset&&([Bt,hr,$t].forEach(function(d){n(d)}),[Ot,dr,"traits"].forEach(function(d){Tr(gs(d))})),s.type===ne.identify){a($t)||r($t,Gn());var f=a(Bt),h=a(hr)||{};f&&f!==u&&i.dispatch({type:ne.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Bt,u),l&&r(hr,ae({},h,l))}return o(s)}}}}var Dr={};function Ed(t,e){Dr[t]&&Ve(Dr[t])&&(Dr[t](e),delete Dr[t])}function Uv(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ae({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Uv(t,e,r-10).then(n,a)})})}function ly(t){return{abort:t}}function $v(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&&Ve(p)){var g,S=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Ot,dr].reduce(function(O,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(O[A]=b[A]),O},m)})(h.payload,u),w=n[S.meta.rid];if(!w&&(g=p({payload:S,config:o[d].config,instance:r,abort:ly}))&&We(g)&&g.abort)return void(n[S.meta.rid]=!0);if(!w){var y=v+":"+d;t.dispatch(ae({},S,{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,S){return function(w,y,m){var b=y.config,O=y.name,A=O+"."+w.type;m&&(A=m.event);var j=w.type.match(vr)?(function(z,B,ie,L,D){return function(q,T){var Y=L?L.name:z,te=T&&Wr(T)?T:ie;if(L&&(!(te=T&&Wr(T)?T:[z]).includes(z)||te.length!==1))throw new Error("Method "+B+" can only abort "+z+" plugin. "+JSON.stringify(te)+" input valid");return ae({},D,{abort:{reason:q,plugins:te,caller:B,_:Y}})}})(O,A,S,m,w):(function(z,B){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+B)}})(w,A);return{payload:fy(w),instance:g,config:b||{},abort:j}}})(n,d),p=e.exact.reduce(function(g,S){var w=S.pluginName,y=S.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,S,w){var y=S.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var O=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,j,z){return Promise.resolve(A).then(function(B){return j.method&&Ve(j.method)?((function(q,T){var Y=Ad(q);if(Y&&Y.name===T){var te=Ad(Y.method);throw new Error([T+" plugin is calling method "+q,"Plugins cant call self","Use "+Y.method+" "+(te?"or "+te.method:"")+" in "+T+" plugin insteadof "+q].join(`
35
- `))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:B,instance:n,abort:(ie=B,L=y,D=j.pluginName,function(q,T){return ae({},ie,{abort:{reason:q,plugins:T||[L],caller:f,from:D||L}})}),config:Rd(j.pluginName,l,i),plugins:l})).then(function(q){var T=We(q)?q:{};return Promise.resolve(ae({},B,T))})):B;var ie,L,D})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return O&&O.then?O.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(S,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,O=i[b];return Promise.resolve(S).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(O[f]({abort:z.abort,payload:j,instance:n,config:Rd(b,l,i),plugins:l})).then(function(B){var ie=We(B)?B:{},L=ae({},A,ie),D=g[b];if(Zo(D,b))Jo({data:D,method:f,instance:n,pluginName:b,store:s});else{var q=f+":"+b;(q.match(/:/g)||[]).length<2&&!f.match(kd)&&!f.match(_d)&&n.dispatch(ae({},h?L:j,{type:q,_:{called:q,from:"submethod"}}))}return Promise.resolve(L)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(S){if(!(f.match(vr)||f.match(/^registerPlugin/)||f.match(_d)||f.match(kd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),S._&&S._.originalAction===f)return S;var w=ae({},S,{_:{originalAction:S.type,called:S.type,from:"engineEnd"}});Lv(S,e.exact.length)&&!f.match(/End$/)&&(w=ae({},w,{type:S.type+"Aborted"})),s.dispatch(w)}return S})})}catch(g){return Promise.reject(g)}},vr=/Start$/,kd=/^bootstrap/,_d=/^ready/;function Jo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ae({},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 Td(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Od(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||Cd(r,e)||r&&Cd(r.plugins,e))}function Lv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||Ut(r))return!0;var n=r.plugins;return Wr(r)&&r.length===e||Wr(n)&&n.length===e}function Wr(t){return Array.isArray(t)}function Cd(t,e){return!(!t||!Wr(t))&&t.includes(e)}function Ad(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function fy(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=We(t[r])?Object.assign({},t[r]):t[r]),e},{})}function dy(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===ne.enablePlugin&&a.dispatch({type:ne.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===ne.disablePlugin&&setTimeout(function(){return Ed(o.meta.rid,{payload:o})},0),l===ne.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=[],S=o.disabled,w=v.map(function(m){var b=m.loaded,O=m.name,A=m.config;return Uv(m,function(){return b({config:A})},1e4).then(function(j){return n[O]||(a.dispatch({type:ne.pluginReadyType(O),name:O,events:Object.keys(m).filter(function(z){return!ms.includes(z)})}),n[O]=!0),p=p.concat(O),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:S};setTimeout(function(){d.length===w.length+S.length&&a.dispatch(ae({},{type:ne.ready},b))},0)})}var y=(function(){if(l!==ne.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return $v(a,e,t)},0),Promise.resolve((function(m,b,O,A,j){try{var z=Ve(b)?b():b,B=m.type,ie=B.replace(vr,"");if(m._&&m._.called)return Promise.resolve(m);var L=O.getState(),D=(Y=z,(te=L.plugins)===void 0&&(te={}),(Q=m.options)===void 0&&(Q={}),Object.keys(Y).filter(function(I){var _=Q.plugins||{};return Gg(_[I])?_[I]:_.all!==!1&&(!te[I]||te[I].enabled!==!1)}).map(function(I){return Y[I]}));B===ne.initializeStart&&m.fromEnable&&(D=Object.keys(L.plugins).filter(function(I){var _=L.plugins[I];return m.plugins.includes(I)&&!_.initialized}).map(function(I){return z[I]}));var q=D.map(function(I){return I.name}),T=(function(I,_){var N=Od(I).map(function(F){return Td(F,_)});return _.reduce(function(F,Z){var V=Z.name,he=Od(I,V).map(function(ke){return Td(ke,_)}),oe=he[0],le=he[1],se=he[2];return oe.length&&(F.beforeNS[V]=oe),le.length&&(F.duringNS[V]=le),se.length&&(F.afterNS[V]=se),F},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})})(B,D);return Promise.resolve(Vo({action:m,data:{exact:T.before,namespaced:T.beforeNS},state:L,allPlugins:z,allMatches:T,instance:O,store:A,EVENTS:j})).then(function(I){function _(){var Z=(function(){if(B.match(vr))return Promise.resolve(Vo({action:ae({},N,{type:ie+"End"}),data:{exact:T.after,namespaced:T.afterNS},state:L,allPlugins:z,allMatches:T,instance:O,store:A,EVENTS:j})).then(function(V){V.meta&&V.meta.hasCallback&&Ed(V.meta.rid,{payload:V})})})();return Z&&Z.then?Z.then(function(){return I}):I}if(Lv(I,q.length))return I;var N,F=(function(){if(B!==ie)return Promise.resolve(Vo({action:ae({},I,{type:ie}),data:{exact:T.during,namespaced:T.duringNS},state:L,allPlugins:z,allMatches:T,instance:O,store:A,EVENTS:j})).then(function(Z){N=Z});N=I})();return F&&F.then?F.then(_):_()})}catch(I){return Promise.reject(I)}var Y,te,Q})(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 hy(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===ne.setItem||a===ne.removeItem){if(n.abort)return r(n);a===ne.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var vy=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 wr.apply(void 0,o)(n)(a)}}}}};function py(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=Ud(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},ae({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Ud(r.type,ne.initialize),l=t()[u];return l&&u?(n[u]=ae({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ae({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ae({},e[r.name],{loaded:!0}),ae({},e,n);switch(r.type){case ne.disablePlugin:return ae({},e,$d(r.plugins,!1,e));case ne.enablePlugin:return ae({},e,$d(r.plugins,!0,e));default:return e}}}function Ud(t,e){return t.substring(e.length+1,t.length)}function $d(t,e,r){return t.reduce(function(n,a){return n[a]=ae({},r[a],{enabled:e}),n},r)}function jv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var my={last:{},history:[]};function gy(t,e){t===void 0&&(t=my);var r=e.options,n=e.meta;if(e.type===ne.track){var a=jv(ae({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ae({},t,{last:a,history:t.history.concat(a)})}return t}var yy={actions:[]};function wy(t,e){t===void 0&&(t=yy);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===ne.identify?[e].concat(t.actions):t.actions.concat(e),ae({},t,{actions:n});case"dequeue":return[];default:return t}}var qv=/#.*$/;function by(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(qv,""):"")}var Nv,xv,Dv,Mv,Sy=function(t){if(t===void 0&&(t={}),!Ne)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(Ne){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:by(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ae({},f,t)},Iy={last:{},history:[]};function Py(t,e){t===void 0&&(t=Iy);var r=e.options;if(e.type===ne.page){var n=jv(ae({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ae({},t,{last:n,history:t.history.concat(n)})}return t}Nv=(function(){if(!Ne)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"})(),xv=Ne?document.referrer:null,Dv=Qg(),Mv=ey();var Ld={initialized:!1,sessionId:Gn(),app:null,version:null,debug:!1,offline:!!Ne&&!navigator.onLine,os:{name:Nv},userAgent:Ne?navigator.userAgent:"node",library:{name:ps,version:"0.13.1"},timezone:Mv,locale:Dv,campaign:{},referrer:xv};function Ey(t,e){t===void 0&&(t=Ld);var r=t.initialized,n=e.campaign;switch(e.type){case ne.campaign:return ae({},t,{campaign:n});case ne.offline:return ae({},t,{offline:!0});case ne.online:return ae({},t,{offline:!1});default:return r?t:ae({},Ld,t,{initialized:!0})}}var ky=["plugins","reducers","storage"];function _y(t,e,r){if(Ne){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Ry(t){var e=_y.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Fv(){return Xt(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 yr[gr][ps].push(o.action||o),i(o)}})}}}function jd(t){return function(){return wr(wr.apply(null,arguments),Fv())}}function Yo(t){return t?Tv(t)?t:[t]:[]}function qd(t,e,r){t===void 0&&(t={});var n,a,i=Gn();return e&&(Dr[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(Ve(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ae({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Ty(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,_){if(Ve(_))return I.middlewares=I.middlewares.concat(_),I;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var N=_.EVENTS?Object.keys(_.EVENTS).map(function(V){return _.EVENTS[V]}):[];I.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(I.methods[_.name]=Object.keys(_.methods).reduce(function(V,he){var oe;return V[he]=(oe=_.methods[he],function(){for(var le=Array.prototype.slice.call(arguments),se=new Array(oe.length),ke=0;ke<le.length;ke++)se[ke]=le[ke];return se[se.length]=b,oe.apply({instance:b},se)}),V},{}),delete _.methods);var F=Object.keys(_).concat(N),Z=new Set(I.events.concat(F));if(I.events=Array.from(Z),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:Yt,setItem:Xt,removeItem:Tr},i=(function(I){return function(_,N,F){return N.getState("user")[_]||(F&&We(F)&&F[_]?F[_]:Pd(I)[_]||Yt(gs(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ms.includes(I)}).sort(),u=new Set(s.concat(pn).filter(function(I){return!ms.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new vy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=ty(),S=Pd(a),w=ae({},S,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Gn());var y=ae({enable:function(I,_){return new Promise(function(N){T.dispatch({type:ne.enablePlugin,plugins:Yo(I),_:{originalAction:ne.enablePlugin}},N,[_])})},disable:function(I,_){return new Promise(function(N){T.dispatch({type:ne.disablePlugin,plugins:Yo(I),_:{originalAction:ne.disablePlugin}},N,[_])})}},n.methods),m=!1,b={identify:function(I,_,N,F){try{var Z=Ut(I)?I:null,V=We(I)?I:_,he=N||{},oe=b.user();Xt(gs(Ot),Z);var le=Z||V.userId||i(Ot,b,V);return Promise.resolve(new Promise(function(se){T.dispatch(ae({type:ne.identifyStart,userId:le,traits:V||{},options:he,anonymousId:oe.anonymousId},oe.id&&oe.id!==Z&&{previousId:oe.id}),se,[_,N,F])}))}catch(se){return Promise.reject(se)}},track:function(I,_,N,F){try{var Z=We(I)?I.event:I;if(!Z||!Ut(Z))throw new Error("EventMissing");var V=We(I)?I:_||{},he=We(N)?N:{};return Promise.resolve(new Promise(function(oe){T.dispatch({type:ne.trackStart,event:Z,properties:V,options:he,userId:i(Ot,b,_),anonymousId:i(dr,b,_)},oe,[_,N,F])}))}catch(oe){return Promise.reject(oe)}},page:function(I,_,N){try{var F=We(I)?I:{},Z=We(_)?_:{};return Promise.resolve(new Promise(function(V){T.dispatch({type:ne.pageStart,properties:Sy(F),options:Z,userId:i(Ot,b,F),anonymousId:i(dr,b,F)},V,[I,_,N])}))}catch(V){return Promise.reject(V)}},user:function(I){if(I===Ot||I==="id")return i(Ot,b);if(I===dr||I==="anonId")return i(dr,b);var _=b.getState("user");return I?gd(_,I):_},reset:function(I){return new Promise(function(_){T.dispatch({type:ne.resetStart},_,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(ne.ready,function(_){I&&I(_),m=!0})},on:function(I,_){if(!I||!Ve(_))return!1;if(I===ne.bootstrap)throw new Error(".on disabled for "+I);var N=/Start$|Start:/;if(I==="*"){var F=function(oe){return function(le){return function(se){return se.type.match(N)&&_({payload:se,instance:b,plugins:o}),le(se)}}},Z=function(oe){return function(le){return function(se){return se.type.match(N)||_({payload:se,instance:b,plugins:o}),le(se)}}};return h(F,sn),h(Z,cn),function(){d(F,sn),d(Z,cn)}}var V=I.match(N)?sn:cn,he=function(oe){return function(le){return function(se){return se.type===I&&_({payload:se,instance:b,plugins:o,abort:p}),le(se)}}};return h(he,V),function(){return d(he,V)}},once:function(I,_){if(!I||!Ve(_))return!1;if(I===ne.bootstrap)throw new Error(".once disabled for "+I);var N=b.on(I,function(F){_({payload:F.payload,instance:b,plugins:o,abort:p}),N()});return N},getState:function(I){var _=T.getState();return I?gd(_,I):Object.assign({},_)},dispatch:function(I){var _=Ut(I)?{type:I}:I;if(pn.includes(_.type))throw new Error("reserved action "+_.type);var N=ae({},_,{_:ae({originalAction:_.type},I._||{})});T.dispatch(N)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,_,N){T.dispatch({type:ne.setItemStart,key:I,value:_,options:N})},removeItem:function(I,_){T.dispatch({type:ne.removeItemStart,key:I,options:_})}},setAnonymousId:function(I,_){b.storage.setItem($t,I,_)},events:{core:pn,plugins:s}},O=n.middlewares.concat([function(I){return function(_){return function(N){return N.meta||(N.meta=qd()),_(N)}}},v(sn),dy(b,c,{all:l,plugins:s}),hy(a),sy(b),uy(b),v(cn)]),A={context:Ey,user:cy(a),page:Py,track:gy,plugins:py(c),queue:wy},j=wr,z=wr;if(Ne&&t.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(j=B({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Fv():We(typeof arguments[0])?jd():jd().apply(null,arguments)}}var ie,L=(function(I){return Object.keys(I).reduce(function(_,N){return ky.includes(N)||(_[N]=I[N]),_},{})})(t),D=n.pluginsArray.reduce(function(I,_){var N=_.name,F=_.config,Z=_.loaded,V=n.pluginEnabled[N];return I[N]={enabled:V,initialized:!!V&&!_.initialize,loaded:!!Z({config:F}),config:F},I},{}),q={context:L,user:w,plugins:D},T=Av((function(I){for(var _=Object.keys(I),N={},F=0;F<_.length;F++){var Z=_[F];typeof I[Z]===Ct&&(N[Z]=I[Z])}var V,he=Object.keys(N);try{(function(oe){Object.keys(oe).forEach(function(le){var se=oe[le];if(typeof se(void 0,{type:vs})===Pt||typeof se(void 0,{type:ay})===Pt)throw new Error(zr+" "+le+" "+Pt)})})(N)}catch(oe){V=oe}return function(oe,le){if(oe===void 0&&(oe={}),V)throw V;for(var se=!1,ke={},Ue=0;Ue<he.length;Ue++){var Fe=he[Ue],Te=oe[Fe],Ze=(0,N[Fe])(Te,le);if(typeof Ze===Pt){var lt=iy(Fe,le);throw new Error(lt)}ke[Fe]=Ze,se=se||Ze!==Te}return se?ke:oe}})(ae({},A,e)),q,z(j(oy.apply(void 0,O))));T.dispatch=(ie=T.dispatch,function(I,_,N){var F=ae({},I,{meta:qd(I.meta,_,Yo(N))});return ie.apply(null,[F])});var Y=Object.keys(o);T.dispatch({type:ne.bootstrap,plugins:Y,config:L,params:g,user:w,initialUser:r,persistedUser:S});var te=Y.filter(function(I){return n.pluginEnabled[I]}),Q=Y.filter(function(I){return!n.pluginEnabled[I]});return T.dispatch({type:ne.registerPlugins,plugins:Y,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,_){var N=I.bootstrap,F=I.config,Z=I.name;N&&Ve(N)&&N({instance:b,config:F,payload:I}),T.dispatch({type:ne.registerPluginType(Z),name:Z,enabled:n.pluginEnabled[Z],plugin:I}),n.pluginsArray.length===_+1&&T.dispatch({type:ne.initializeStart,plugins:te,disabled:Q})}),Ry(function(I){T.dispatch({type:I?ne.offline:ne.online})}),(function(I,_,N){setInterval(function(){return $v(I,_,N)},3e3)})(T,c,b),b}var sn="before",cn="after",Gt="cookie",Ft=Hv(),Kv=Wn,Oy=Wn;function zv(t){return Ft?Wn(t,"",-1):Tr(t)}function Hv(){if(Ft!==void 0)return Ft;var t=Gt+Gt;try{Wn(t,t),Ft=document.cookie.indexOf(t)!==-1,zv(t)}catch{Ft=!1}return Ft}function Wn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ft===!1&&(o?Xt(t,e):Yt(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 Et="localStorage",Cy=Ws.bind(null,Et);Or(Et,"getItem",Yt);Or(Et,"setItem",Xt);Or(Et,"removeItem",Tr);var kt="sessionStorage",Ay=Ws.bind(null,kt);Or(kt,"getItem",Yt);Or(kt,"setItem",Xt);Or(kt,"removeItem",Tr);function pr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(We(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var Uy=Cy(),$y=Ay(),Ly=Hv();function Wt(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(Kv(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=Yt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function En(t,e,r){if(t&&!fr(e)){var n={},a=Vs(r),i=JSON.stringify(e),o=!Xs(a);return Js(a)&&(n[Et]=un(Et,e,pr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[Et]:Zs(a)&&(n[Gt]=un(Gt,e,pr(Kv(t))),Oy(t,i),o)?n[Gt]:Ys(a)&&(n[kt]=un(kt,e,pr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[kt]:(n[Ht]=un(Ht,e,Yt(t)),Xt(t,e),o?n[Ht]:n)}}function jy(t,e){if(t){var r=Vs(e),n=Wt(t,kv),a={};return!fr(n.localStorage)&&Js(r)&&(localStorage.removeItem(t),a[Et]=n.localStorage),!fr(n.cookie)&&Zs(r)&&(zv(t),a[Gt]=n.cookie),!fr(n.sessionStorage)&&Ys(r)&&(sessionStorage.removeItem(t),a[kt]=n.sessionStorage),!fr(n.global)&&Vn(r,Ht)&&(Tr(t),a[Ht]=n.global),a}}function Vs(t){return t?Ut(t)?t:t.storage:Ev}function Js(t){return Uy&&Vn(t,Et)}function Zs(t){return Ly&&Vn(t,Gt)}function Ys(t){return $y&&Vn(t,kt)}function Xs(t){return t===kv||t==="all"}function Vn(t,e){return t===Ev||t===e||Xs(t)}function un(t,e,r){return{location:t,current:e,previous:r}}var qy={setItem:En,getItem:Wt,removeItem:jy};function Ny(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nd(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 xd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nd(Object(r),!0).forEach(function(n){Ny(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:qy};return Ty(xd(xd({},e),t))}const Qs="@sesamy/sesamy-js",Jn="1.58.0";function Dy(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=Fy(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function My(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Fy(t){return["#","?"].forEach(e=>t=My(t,e)),t}function Ky(){Dy(()=>{St.page()})}var Xo="up",Qo="down";function zy(t){if(t===void 0&&(t={}),!Ne)return hs;var e=Md(),r=ys(),n=Dd(),a=ln(n,e),i=ln(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=ny(function(){var p=Md(),g=(function(L,D){return D.map(function(q){return q===100?L-5:L*(q/100)})})(p,d),S=ys(),w=Dd(),y=ln(w,p),m=ln(S,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,O=Xo;b?O="initial":l<=w&&(O=Qo);var A=g,j=d;(O===Xo||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function(L,D,q){var T=A[q];return u.includes(D)&&w<=T&&(u=u.filter(function(Y){return Y!==D}),L.singleFunction=D),O===Qo&&!o.includes(D)&&w>=T&&D>i?(s.push(D),L.callbacks=L.callbacks.concat(D),L):O===Xo&&!o.includes(D)&&w<=T&&D<=y?(L.foundFunc=[D],L):(b&&w>=T&&L.foundFunc.length===0&&(L.foundFunc=[D]),!s.includes(D)&&w>=T&&(s.push(D),L.singleFunction?u.push(D):L.singleFunction=D),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(l=w,O===Qo&&z.callbacks&&z.callbacks.forEach(function(L){Ve(t[L])&&(t[L]({trigger:L,direction:O,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(L))}),z.singleFunction){var B=z.singleFunction,ie=z.direction;Ve(t[B])&&t[B]({trigger:B,direction:ie,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(B)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function ys(){return Ne?document.body.scrollTop||document.documentElement.scrollTop:0}function Hy(){return Ne?window.innerHeight||document.documentElement.clientHeight:0}function Dd(){return Math.round(ys()+Hy())}function Md(){if(!Ne)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function ln(t,e){return Math.round(t/e*100)}var ec="Event",Fd=ec+"Listener";function By(t){return function(e,r,n,a){var i=n||hs,o=a||!1;if(!Ne)return i;var s=kn(r),u=kn(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"+Fd:"remove"+Fd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?Gy(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 kn(t,e){if(Ut(t))return e?kn(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=Xg(t);return e?i.map(function(o){return Ut(o)?kn(o,!0):o}).flat():i}function Gy(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var es=By(ec);function Bv(t,e){return Ne&&Ve(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),Ve(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}Bv.bind(null,"onerror");Bv.bind(null,"onload");var Gv=typeof window>"u",Kd="hidden";function Wy(t){if(Gv)return!1;var e=Vy(),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 Vy(){var t=["webkit","moz","ms","o"];return Gv||Kd in document?Kd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Jy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Zy(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=Wy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Jy.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 Yy(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(qr(h),g),a&&c&&(c=!1,a(qr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(qr(h),g))},s)}var p=Zy(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:qr(h,f),idle:c?qr(r,f):0}}}}function qr(t,e){return e?0:Math.round((new Date-t)/1e3)}const zd=5e3;class Xy{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),Yy({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:zd}),zy({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*zd: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 Wv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Qy(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 Hd="sesamy_session_id";function ew(){let t=sessionStorage.getItem(Hd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Hd,t)),t}function Vv(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 tw(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}let Ge={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"}},Jv=[],Zv=!1,Vt;function Yv(){const t=window.location.pathname;return Jv.find(e=>e.path?t.includes(e.path):!0)}function rw(t,e){Jv=t.content||[];const r=Yv();r&&r.type==="article"&&(Ge={...Ge,...tw(r.selectors)},Zv=r.enablePaywallSettingsUrlFallback||!1),Vt=e}function nw(t,e){const{selector:r}=e;return r===Ge.article.selector?t:t.querySelector(r)}function Xv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Xv(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 Qv({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 aw(){const t=document.querySelectorAll(Ge.article.selector);return Array.from(t).map(Zn).filter(e=>e!==null)}function Zn(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Vv(e)},n=(i,o,s,u)=>{const l=nw(e,o);if(l){const c=Xv(l,o)||Qv({publisherContentId:s,key:i});c!==void 0&&(r[i]=u?u(c):c)}};n("id",Ge.id),n("title",Ge.title,r.id),n("excerpt",Ge.excerpt,r.id),n("image",Ge.image,r.id),n("price",Ge.price,r.id,i=>parseFloat(i)),n("currency",Ge.currency,r.id),n("url",Ge.url,r.id),n("pass",Ge.pass,r.id),n("paywallUrl",Ge.paywallUrl,r.id),n("accessLevel",Ge.accessLevel,r.id,i=>i||"entitlement");const a=Yv();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)),Zv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r}async function iw(t){const e=Zn(t);if(!e)throw new Error("Could not find article element");if(e.paywallUrl){const a=(await Vt.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement";if(e.accessLevel=a,a==="logged-in"){const i=await Vt.auth.isAuthenticated();return e.hasAccess=i,e}}if(!e.url)throw new Error("Article must have a URL");const r=await Vt.entitlements.hasAccess(e.url,e.pass?.split(",")||[]);return e.hasAccess=!!r,e.entitlement=r,e}async function ow(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=Zn(r);if(!n?.url)throw new Error("Could not find content for element");const a=await Vt.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Vt.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Vv(r.parentElement||r);return Vt.proxy.getContent(i.token,n.url,o)}let ep=!1,mn,_n,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:ew(),timestamp:new Date().toISOString(),version:Jn,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=Qy(async t=>{if(t.length>0){const e=tp(t);ep?navigator.sendBeacon(_n,e):(await fetch(_n,{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(_n,tp([e]))}else rp.push(t)}function sw(){return ep=!0,rp.flush()}function cw(t,e,r){mn=e,_n=`${vt("logs",r)}/events`,ws=t}const uw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!mn)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(!mn)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(!mn)return;const{properties:e,anonymousId:r,userId:n}=t;ts({anonymousId:r,userId:n,properties:e,type:"identify"})}},Bd=["source","medium","campaign","term","content"],At="utm_",lw=1800*1e3;function np(t){return t?Date.now()-parseInt(t,10)>lw:!0}function Gd(){const t=document.referrer||"";if(!t)return;const e=Wt(`${At}set_at`);(np(e)||!Wt(`${At}referrer`))&&En(`${At}referrer`,t)}function fw(){const t=()=>{const r={};for(const a of Bd){const i=Wt(`${At}${a}`);i&&(r[`utm_${a}`]=i)}const n=Wt(`${At}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Gd()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${At}set_at`);if(Object.keys(n).length>0&&np(a)){for(const o of Bd){const s=n[o];s&&En(`${At}${o}`,s)}En(`${At}set_at`,String(Date.now()))}Gd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const dw=fw(),Wd=new Map,Vd=new Map;function hw({clientId:t,enabled:e=!0,environment:r}){cw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Vd.forEach((n,a)=>{n.bind(a)()}),sw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Wd.forEach((n,a)=>{n.bind(a)()})}),Ky(),Wv(()=>{const n=new Xy({element:document.body,viewCallback:()=>{St.page()},activeDurationCallback:(a,i,o)=>{St.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{St.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{St.track("scroll",{scroll:a.scrollMax})}});Vd.set(document.body,()=>{n.flush()}),Wd.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Je.AUTHENTICATED,async n=>{const a=n;await St.identify(a.detail.sub)}),window.addEventListener(Je.LOGOUT,async()=>{await St.track("logout",{}),await St.reset()}))}const St=xy({app:Qs,version:Jn,plugins:[dw,uw]});function ap(t,e){St.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 vw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function pw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function mw(){return/android/i.test(navigator.userAgent)}let qe,op,Hr,bs=!1,gn=!1;Gr()&&window.addEventListener("pageshow",()=>{gn=!1});const br="sesamyAccessToken",rs="sesamyRefreshToken",Rn="sesamySilentAuthThrottle",gw=300*1e3;async function Yn(){return bs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{bs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Je.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function yw(t){if(!t)return null;const e=localStorage.getItem(rs);if(!e)return pe("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(br,i.access_token),i.access_token}catch{nc()}}async function tc(){const t=localStorage.getItem(br);if(!t)return null;const e=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await yw(e);if(r)return r;localStorage.removeItem(br)}return t}let fn=null;const ww=64;function bw(){try{if(fn!==null)return fn;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===ww)return fn=!0,!0}}catch(t){pe(`Error checking for existing auth0 tokens: ${t.message}`)}return fn=!1,!1}function Sw(t){if(t.domains&&t.domains.length>0){const e=Sr(window.location.href);if(e){for(const r of t.domains)if(Sr(`https://${r}`)===e)return pe(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;pe(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return pe(`Using fallback domain property: ${t.domain}`),t.domain}function Sr(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 Iw(t){if(t.enabled===!1)return;op=t.organization;const e=Sw(t);Hr=e&&!bw()?e:Pv("token",t.environment);const r={domain:Hr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",Sr(window.location.href)!==Sr(`https://${Hr}`)&&(r.useRefreshTokens=!0),pe(`Initializing auth0 client: ${JSON.stringify(r)}`),qe=await kg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)pe("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{pe("Code found in URL, handling redirect");try{const u=await qe.handleRedirectCallback();pe(`Login result: ${JSON.stringify(u)}`);const l=await qe.getUser();if(!l)throw pe("No user found"),new Error("No user found");pe(`User found ${JSON.stringify(l)}`),rc(),Lt(Je.AUTHENTICATED,l),pe("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,Lt(Je.AUTH_INITIALIZED,{})}async function Vr(){return await Yn(),await tc()?!0:qe?qe.isAuthenticated():!1}async function Pw(){return await Yn(),await tc()?(pe("Using local user"),{sub:"local",name:"Local User"}):qe?qe.getUser():null}function sp(t){if(gn)return pe("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(br),!qe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:op,redirect_uri:window.location.href,ui_locales:bn(),incognito:Gs(),...e}}}async function Xn(t){const e=sp(t);if(e)return qe.loginWithRedirect(e)}async function cp(t){const e=sp(t);if(!e)return;await qe.loginWithPopup(e,{timeoutInSeconds:1800}),rc(),ip(Je.AUTHENTICATED,await qe.getUser()).canceled||window.location.reload()}async function Ew(t){return Hr&&Sr(window.location.href)!==Sr(`https://${Hr}`)&&(pw()||mw()||Gs())?cp(t):Xn(t)}function kw(){try{const t=sessionStorage.getItem(Rn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<gw}catch{return sessionStorage.removeItem(Rn),!1}}function _w(){try{const t={timestamp:Date.now()};sessionStorage.setItem(Rn,JSON.stringify(t))}catch{pe("Failed to set silent auth throttle in sessionStorage")}}function rc(){try{sessionStorage.removeItem(Rn)}catch{}}async function xt(t=!0,e=!1){await Yn();const r=await tc();if(r)return r;if(!e&&kw()){if(pe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!qe)return pe("Auth client not initialized"),null;let n=await qe.getTokenSilently();const a=ac(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await qe.getTokenSilently({cacheMode:e?"off":"on"})),rc(),n}catch(n){const a=n;if(pe(`Failed to get token silently: ${a.message}`),_w(),await qe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await nc(),t)throw n;return null}}async function nc(t={}){if(await Yn(),localStorage.removeItem(br),Lt(Je.LOGOUT,{}),!!qe)return pe(`Logout with options: ${JSON.stringify(t)}`),qe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function ac(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=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");pe("Set token"),localStorage.setItem(br,t),Lt(Je.AUTHENTICATED,e)}const Rw=(t,e)=>e.skipDedupe||e.method!=="GET",Tw=(t,e)=>e.method+"@"+t,Ow=t=>t.clone(),Jd=({skip:t=Rw,key:e=Tw,resolver:r=Ow}={})=>{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)}}},Cw=(t,e)=>t*e,Aw=t=>t&&t.ok,Zd=({delayTimer:t=500,delayRamp:e=Cw,maxAttempts:r=10,until:n=Aw,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 S=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))},S)}).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 Br 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,Br)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}var Tn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Tn||{});const Uw="application/json",up="Content-Type",sr=Symbol(),lp=Symbol();function Yd(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 Xd(t){return/^application\/.*json.*/.test(t)}const Jt=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]=Jt(o,i,r):n[a]=i,n},{...t})},Ir={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 $w(t,e=!1){Ir.options=e?t:Jt(Ir.options,t)}function Lw(t,e=!1){Ir.polyfills=e?t:Jt(Ir.polyfills,t)}function jw(t){Ir.errorType=t}const qw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class fp extends Error{}const Nw=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=Jt(a.options,n);let f=r;const h=qw(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 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 O=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(O&&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),O=b?m[sr]:m,A=O?.status&&l.get(O.status)||l.get(O?.name)||b&&l.has(sr)&&l.get(sr);if(A)return A(O,t);const j=l.get(lp);if(j)return j(O,t);throw O}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.then(b=>m?m(b):b)),S={_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}),S);return o.reduce((y,m)=>m(y,t),w)},xw={_url:"",_options:{},_config:Ir,_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:Jt(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:Jt(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:Jt(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=Yd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Xd(a));return n=r?o?n.json(r,a):n.body(r):n,Nw(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||Xd(r)&&r||Uw).body(JSON.stringify(t))}};function st(t="",e={}){return{...xw,_url:t,_options:e}}st.default=st;st.options=$w;st.errorType=jw;st.polyfills=Lw;st.WretchError=fp;const Dw=(t,e)=>e.skipDedupe||e.method!=="GET",Mw=(t,e)=>e.method+"@"+t,Fw=t=>t.clone(),Kw=({skip:t=Dw,key:e=Mw,resolver:r=Fw}={})=>{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)}}},zw=(t,e)=>e.skipCache||e.method!=="GET",Hw=(t,e)=>e.method+"@"+t,Bw=()=>!1,Gw=()=>null,Ww=t=>t.ok,Vw=({throttle:t=1e3,skip:e=zw,key:r=Hw,clear:n=Bw,invalidate:a=Gw,condition:i=Ww,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(S=>{typeof S=="string"?s.delete(S):S instanceof RegExp&&s.forEach((w,y)=>{S.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 S=s.get(p).clone();return o&&Object.defineProperty(S,o,{value:p,enumerable:!1}),Promise.resolve(S)}else if(u.has(p))return new Promise((S,w)=>{u.get(p).push([S,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(S=>(i(S.clone())&&s.set(p,S.clone()),u.get(p).forEach(([w])=>w(S.clone())),u.delete(p),S)).catch(S=>{throw u.get(p).forEach(([,w])=>w(S)),u.delete(p),S})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Jw=(t,e)=>t*e,Zw=t=>t&&t.ok,Yw=({delayTimer:t=500,delayRamp:e=Jw,maxAttempts:r=10,until:n=Zw,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 S=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))},S)}).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)})},Xw="@sesamy/sdk",Qw="1.13.0";class eb{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 Mr="sesamyCacheTimestamp",tb=t=>{const{libraryName:e=Xw,libraryVersion:r=Qw,cache:n}=t,a=n?.storage||new eb,i=[s=>async(u,l)=>{if(n?.mode===Tn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Mr),c||(c=Date.now().toString(),sessionStorage.setItem(Mr,c))):(c=a.get(Mr),c||(c=Date.now().toString(),a.set(Mr,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:`Bearer ${c}`}};return s(u,f)},Kw()];n?.mode===Tn.NORMAL&&i.push(Vw({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Yw({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=st(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?JSON.parse(u.body):void 0);break;case"put":h=c.put(u.body?JSON.parse(u.body):void 0);break;case"patch":h=c.patch(u.body?JSON.parse(u.body):void 0);break;case"delete":h=c.delete();break;default:h=c.get()}const d=await h.res();if(d.status===204)return null;if(!d.ok){const v=await d.text().catch(()=>"Unknown error");throw new Br(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Br)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Br(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},tt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Mr),"Cache cleared"),Nr={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`)},Qd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},eh={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},xr={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:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},dn={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)})},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}/checkout`);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(`meta-${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}/checkout`);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(`meta-${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkout",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkout/${e}`),update:async(t,e,r)=>t.request(`/checkout/${e}`,{method:"PATCH",body:JSON.stringify(r)})},th={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},rh={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},rb={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},nb={list:async t=>t.request("/payment-issues")},ab={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)}},ib={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},nh={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ob=t=>{const e=tb(t);return{profile:{get:r=>Nr.get(e,r),update:(r,n)=>Nr.update(e,r,n),checkSpotifyLink:()=>Nr.checkSpotifyLink(e),unlinkSpotify:()=>Nr.unlinkSpotify(e),delete:()=>Nr.delete(e)},entitlements:{list:r=>ns.list(e,r),get:r=>ns.get(e,r),getAccess:r=>ns.getAccess(e,r)},subscriptions:{list:()=>Qd.list(e),get:r=>Qd.get(e,r)},products:{get:r=>eh.get(e,r),autoOnboard:r=>eh.autoOnboard(e,r)},contracts:{list:()=>xr.list(e),get:r=>xr.get(e,r),cancel:r=>xr.cancel(e,r),createAmendment:(r,n)=>xr.createAmendment(e,r,n),confirmAmendment:(r,n)=>xr.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:()=>dn.list(e),get:r=>dn.get(e,r),update:(r,n)=>dn.update(e,r,n),create:r=>dn.create(e,r)},tags:{list:()=>is.list(e),add:r=>is.add(e,r),remove:r=>is.remove(e,r)},checkout:{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:()=>th.list(e),get:r=>th.get(e,r)},fulfillments:{list:()=>rh.list(e),create:r=>rh.create(e,r)},paywall:{get:r=>rb.get(e,r)},paymentIssues:{list:()=>nb.list(e)},proxy:{content:(r,n,a,i)=>ab.content(e,r,n,a,i)},transactions:{list:r=>ib.list(e,r)},vendor:{get:()=>nh.get(e),list:()=>nh.list(e)}}};class sb{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 ah(t){return t.endsWith("/")?t.slice(0,-1):t}function ih(t,e){if(!Is(t)||!Is(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&ah(r.pathname)===ah(n.pathname)}function cb(t,e,r){const n=new URL(`${vt("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(`meta-${c}`,String(f))}),n}const hp="sesamySignedURLs";function ic(){const t=sessionStorage.getItem(hp);return t?JSON.parse(t):[]}function ub(t){const e=ic();e.push(t),pe(`Adding signed URL: ${t}`),sessionStorage.setItem(hp,JSON.stringify(e))}function lb(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ps="sesamyAttribution";function fb(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 db(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function On(){return fb(Ps)||{}}function vp(t){if(t===null)localStorage.removeItem(Ps);else{pe(`Setting attribution ${JSON.stringify(t)}`);const e=On()??{},r=lb({...e,...db(t)});localStorage.setItem(Ps,JSON.stringify({value:r}))}}function hb(t){const e=t.endpoint||vt("api2",t.environment),n=ob({baseUrl:e,tokenProvider:async()=>{const R=await xt(!0);if(!R)throw new Error("No access token available");return R},libraryName:Qs,libraryVersion:Jn,vendorId:t.vendorId,cache:{mode:Tn.BROWSER,storage:new sb}}),a=R=>async(K,J)=>{let re=sessionStorage.getItem(pd);re||(re=Date.now().toString(),sessionStorage.setItem(pd,re));const me={...J,headers:{...J.headers,"Cache-Timestamp":re}};return R(K,me)},i=(R=!0)=>K=>async(J,re)=>{let me=null;if(me=await xt(R),!me){if(R)throw new Error("No access token available");return K(J,re)}const Oe={...re,headers:{...re.headers,...me?{Authorization:`Bearer ${me}`}:{}}};return K(J,Oe)},o=R=>(K,J)=>{if(J.headers&&"Authorization"in J.headers)return R(K,J);const re=localStorage.getItem("__anon_id"),me=btoa(`${t.clientId}|${re}:`),Oe={...J,headers:{...J.headers,Authorization:`Basic ${me}`}};return R(K,Oe)},s=st(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Jd(),Zd({delayTimer:1e3,delayRamp:(R,K)=>R*K,maxAttempts:3,until:R=>!!(R&&(R.ok||R.status>=400&&R.status<500)),retryOnNetworkError:!1})]),u=st(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Jd(),Zd({delayTimer:1e3,delayRamp:(R,K)=>R*K,maxAttempts:3,until:R=>!!(R&&(R.ok||R.status>=400&&R.status<500)),retryOnNetworkError:!1})]);async function l(R={}){const{waitForEntitlementAfter:K,includeSignedLinks:J=!0}=R,re=await Vr()?await n.entitlements.list({waitForEntitlementAfter:K?.toISOString()}):[];return J&&re.push(...ic()),re}async function c(R,K=[]){return(await l())?.find(me=>{if(R){const{sku:Oe,purchaseOption:M}=dp(R);if("sku"in me&&Oe===me.sku||M&&"purchaseOptionsId"in me&&M===me.purchaseOptionsId||ih(R,me.url))return!0}return!!K.some(Oe=>ih(Oe,me.url))})}async function f(R){return n.entitlements.get(R)}async function h(R){return n.entitlements.getAccess(R)}async function d(R,K,J){const re=new URL(vt("api2",t.environment));return re.pathname="/proxy",re.searchParams.set("url",K),J&&re.searchParams.set("selector",J),st(re.toString()).headers({Authorization:`Bearer ${R}`}).get().text()}async function v(R){if(!R)throw new Error("SKU is required to get fulfillments");return await Vr()?await s.get(`/fulfillments?sku=${encodeURIComponent(R)}`).json():[]}async function p(R,K){if(!R||!K)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:R},`/fulfillments/${encodeURIComponent(K)}/request-delivery?`).res()).ok}async function g(){return s.get("/contracts").json()}async function S(R){return(await s.get("/contracts").json())?.find(J=>J.id===R)}async function w(R){const K=await s.post({},`/contracts/${encodeURIComponent(R)}/cancel`).res();return tt(),K.ok}async function y(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function m(){return s.get("/bills").json()}async function b(R){return(await s.get("/bills").json())?.find(J=>J.id===R)}async function O(){return s.get("/transactions").json()}async function A(R){return(await s.get("/transactions").json())?.find(J=>J.id===R)}async function j(R,K){const J=await s.url(`/user-metadata/${encodeURIComponent(R)}`).put(K).json();return Lt(Je.USER_ATTRIBUTE_CHANGED,{}),tt(),J}async function z(R){const K=await s.url(`/user-metadata/${encodeURIComponent(R)}`).delete().res();return tt(),K.ok}async function B(){return await s.url("/user-metadata").get().json()}async function ie(R){return(await B())[R]||null}async function L(){return await s.url("/tags").get().json()}async function D(R){const K=await s.url(`/tags/${encodeURIComponent(R)}`).delete().res();return tt(),K.ok}async function q(R){const K=await s.url("/tags").post(encodeURIComponent(R)).res();return Lt(Je.USER_ATTRIBUTE_CHANGED,{}),tt(),K.ok}async function T(R){return(await u.url("/tallies").get().json())[R]}async function Y(){return await u.url("/tallies").get().json()}async function te(R){const K=await u.url(`/tallies/${R}`).delete().res();return tt(),K.ok}async function Q(R,K){return await u.url(`/tallies/${encodeURIComponent(R)}/push`).post(K).json()}async function I(R){return n.products.get(R)}async function _(){return await xt(!1)?await s.url("/profile").get().json():null}async function N(R){const K=await s.url("/profile").patch(R).res();return tt(),K.ok}async function F(){return await s.url("/payment-issues").get().json()}async function Z(){return(await s.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function V(){return(await s.url("/profile/unlink-spotify").post().res()).ok}async function he(R){const K=await xt(!1);if(!K)throw new Error("No access token available");const J=new URL(`${vt("access-sync",t.environment)}/spotify/sesamy-callback`);J.searchParams.set("access_token",K),J.searchParams.set("state",R),window.location.href=J.toString()}async function oe(R){const K=await s.url(`/products/${encodeURIComponent(R)}/auto-onboard`).post().json();return K.length&&tt(),K}async function le(R,K=3600){const{shortlink:J}=await st(Tg).post({url:R,ttl:K}).json();return J}async function se(R){const K=await xt(!1,!0);let J;const re=R.language||bn(),me=On();switch(R.target){case"account":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(R.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}${R.contractId?`/${encodeURIComponent(R.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",R.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(R.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(R.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",R.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(R.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(R.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",R.redirectUrl||window.location.href);break;case"consume":J=new URL(`${vt("consume",t.environment)}/${encodeURIComponent(R.language||re)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(R.sku)}`),R.episodeId?J.href+=`/${R.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",R.redirectUrl||window.location.href);break;case"checkout":J=cb(t,{language:re,...R},me);break;default:throw new Error("Invalid target")}return K&&(J.hash=`#access_token=${K}`),R.shorten?le(J.href,R.ttl):J.href}async function ke(R){const K=On(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(me=>{const Oe=K,[M,ee]=me.trim().split("=");J.includes(M)&&!Oe[M]&&(Oe[M]=ee)}),(await u.url("/checkouts").post({language:bn(),...R,attribution:{...K,...R.attribution},vendorId:t.vendorId})).json()}async function Ue(R,K){return(await u.url(`/checkouts/${R}`).patch(K)).json()}async function Fe(R){return(await u.url(`/checkouts/${R}`).get()).json()}async function Te(R){return(await u.url(`/paywalls/${R}`).get()).json()}async function Ze(){return(await u.url("/vendor").get()).json()}async function lt(){return(await s.url("/vendors").get()).json()}async function ft(R){return(await s.url(`/contracts/${encodeURIComponent(R.contractId)}/amendments`).post({amendmentType:R.amendmentType,discountCode:R.discountCode})).json()}async function gt(R){return await s.url(`/amendments/${encodeURIComponent(R)}/confirm`).post(),!0}async function yt(){const R=await xt(!1),K=new URL(`${vt("account",t.environment)}/subscriptions/${t.clientId}`);R&&(K.hash=`#access_token=${R}`),window.location.href=K.toString()}return{autoOnboardProduct:oe,cancelContract:w,confirmAmendment:gt,createAmendment:ft,createCheckout:ke,deleteTag:D,deleteTally:te,deleteUserMetadata:z,generateLink:se,getBill:b,getBills:m,getCheckout:Fe,getProxyContent:d,getContract:S,getContracts:g,getEntitlement:f,getEntitlementAccess:h,getEntitlements:l,getFulfillments:v,requestDelivery:p,getPaywall:Te,getPaymentIssues:F,getProfile:_,getProduct:I,getSubscriptions:y,getTally:T,getTallies:Y,getTags:L,getTransaction:A,getTransactions:O,getUserMetadata:ie,hasAccess:c,isSpotifyLinked:Z,linkSpotify:he,listUserMetadata:B,openHostedAccountPage:yt,pushTally:Q,setTag:q,setUserMetadata:j,unlinkSpotify:V,updateCheckout:Ue,updateProfile:N,getVendorSettings:Ze,listVendors:lt}}const vb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function pb(){return new Promise(t=>{const e=vb.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",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 mb(){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}}const pp="sesamyFlags";async function mp(t){try{localStorage.setItem(pp,JSON.stringify(t))}catch{pe("Failed to save flags to localStorage")}}async function gb(t,e){const r=await Qn();r[t]=e,await mp(r)}async function yb(t){return(await Qn())[t]}async function wb(t){const e=await Qn();t in e&&(delete e[t],await mp(e))}async function Qn(){try{const t=localStorage.getItem(pp);return t?JSON.parse(t):{}}catch{return{}}}function bb(t){const{autoOnboardProduct:e,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:u,getBills:l,getCheckout:c,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:p,getFulfillments:g,getPaywall:S,getPaymentIssues:w,getProfile:y,getProduct:m,getProxyContent:b,getSubscriptions:O,getTags:A,getTally:j,getTallies:z,getTransaction:B,getTransactions:ie,getUserMetadata:L,getVendorSettings:D,listVendors:q,hasAccess:T,isSpotifyLinked:Y,linkSpotify:te,listUserMetadata:Q,openHostedAccountPage:I,pushTally:_,requestDelivery:N,setTag:F,setUserMetadata:Z,unlinkSpotify:V,updateCheckout:he,updateProfile:oe}=hb(t),le={analytics:{track:ap},attribution:{get:On,set:vp},auth:{getUser:y,getTokenSilently:xt,isAuthenticated:Vr,loginWithRedirect:Xn,loginWithPopup:cp,login:Ew,logout:nc,setToken:Ss},bills:{get:u,list:l},browser:{detectAdblock:pb,isInAppBrowser:mb,isIncognito:Gs},checkouts:{create:n,get:c,update:he},clearCache:tt,content:{list:aw,get:Zn,getLanguage:bn,hasAccess:iw,unlock:ow,getPropertyFromHTML:Qv},contracts:{cancel:r,get:f,list:h},entitlements:{access:v,get:d,hasAccess:T,list:p,signedLinks:ic},events:{emit:ip,cancel:vw},flags:{get:yb,set:gb,list:Qn,delete:wb},fulfillments:{list:g,requestDelivery:N},generateLink:s,getPaymentIssues:w,getVersion:Sb,isReady:()=>exports.isInitialized,log:pe,paywalls:{get:S},products:{autoOnboard:e,get:m,linkSpotify:te},profile:{get:y,isSpotifyLinked:Y,openHostedAccountPage:I,unlinkSpotify:V,update:oe},proxy:{getContent:b},subscriptions:{list:O},tags:{delete:a,list:A,set:F},tallies:{delete:i,get:j,list:z,push:_},transactions:{get:B,list:ie},userMetadata:{delete:o,get:L,list:Q,set:Z},vendors:{get:D,list:q},setToken:Ss};return t.namespace&&(window[t.namespace]=le),le}function Sb(){return Jn}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 ls={d:(t,e)=>{for(var r in e)ls.o(e,r)&&!ls.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},zs={};ls.d(zs,{A:()=>Og,k:()=>Hs});var Lr=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())})},qr=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 Hs(){return Lr(this,void 0,Promise,function(){return qr(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 Lr(this,void 0,void 0,function(){var h,d;return qr(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 Lr(this,void 0,Promise,function(){return qr(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 I=g.target.result,w=function(y){i(y)};try{I.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{I.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,I,w,y=window;return(w=(I=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||I===void 0?void 0:I.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 Lr(this,void 0,Promise,function(){var d,v,p;return qr(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(I){p.error&&p.error.name==="InvalidStateError"&&I.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return Lr(this,void 0,Promise,function(){return qr(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=Hs);const Og=Hs;zs.A;const Cg=zs.k,vn="sesamy_incognito_mode";function Bs(){try{const t=sessionStorage.getItem(vn);return t===null?void 0:t==="true"}catch{return}}async function Ag(){try{const t=sessionStorage.getItem(vn);if(t!==null)return t==="true";const{isPrivate:e}=await Cg();return sessionStorage.setItem(vn,e.toString()),e}catch{try{sessionStorage.setItem(vn,"false")}catch{}return!1}}function Gr(){return typeof window<"u"}function gd(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 Ug="function",$g="string",tt="undefined",Lg="boolean",bn="object",qg="array",jg="number",Ng="symbol",xg="null",fs=function(){},Ev="any",kv="*",Vt="__",Dg="form",Mg="input",Fg="button",Kg="select",Sn=typeof process!==tt?process:{};Sn.env&&Sn.env.NODE_ENV;var Ce=typeof document!==tt;Sn.versions!=null&&Sn.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 _v(t,e){return e.charAt(0)[t]()+e.slice(1)}var zg=_v.bind(null,"toUpperCase"),Hg=_v.bind(null,"toLowerCase");function Bg(t){return Rv(t)?zg(xg):typeof t===bn?Jg(t):Object.prototype.toString.call(t).slice(8,-1)}function In(t,e){e===void 0&&(e=!0);var r=Bg(t);return e?Hg(r):r}function rn(t,e){return typeof e===t}var ze=rn.bind(null,Ug),_t=rn.bind(null,$g),lr=rn.bind(null,tt),Gg=rn.bind(null,Lg);rn.bind(null,Ng);function Rv(t){return t===null}function Wg(t){return In(t)===jg&&!isNaN(t)}function Tv(t){return In(t)===qg}function Ke(t){if(!Vg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Vg(t){return t&&(typeof t===bn||t!==null)}function Jg(t){return ze(t.constructor)?t.constructor.name:null}function Zg(t){return t instanceof Error||_t(t.message)&&t.constructor&&Wg(t.constructor.stackTraceLimit)}function Ov(t,e){if(typeof e!="object"||Rv(e))return!1;if(e instanceof t)return!0;var r=In(new t(""));if(Zg(e))for(;e;){if(In(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Ov.bind(null,TypeError);Ov.bind(null,SyntaxError);function Kn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Yg(t,e):r}function Yg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function zn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}zn(Kn,Dg);zn(Kn,Fg);zn(Kn,Mg);zn(Kn,Kg);function Xg(t){return t?Tv(t)?t:[t]:[]}function yd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Qg(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function ey(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ty(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=yd(r[1]),o=yd(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&&(ry(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 ry(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 Hn(){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 ny(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",mr=Vt+Ft+Vt,gr=typeof self===bn&&self.self===self&&self||typeof global===bn&&global[Ft]===global&&global||void 0;function Jt(t){return gr[mr][t]}function Zt(t,e){return gr[mr][t]=e}function Rr(t){delete gr[mr][t]}function Tr(t,e,r){var n;try{if(Gs(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}gr[mr]||(gr[mr]={});var an={};function Gs(t){if(typeof an[t]!==tt)return an[t];try{var e=window[t];e.setItem(tt,tt),e.removeItem(tt)}catch{return an[t]=!1}return an[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",zr="reducer",Cv="@@redux/",ds=Cv+"INIT",ay=Cv+Math.random().toString(36),wd=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),on=" != "+Et;function Av(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"+on);return r(Av)(t,e)}if(typeof t!==Et)throw new Error(zr+on);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"+on);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 "+zr);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:ds}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+zr+on);a=d,h({type:ds})}})[wd]=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)}}})[wd]=function(){return this},d},n}function iy(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+zr+" "+t+" returns "+pt}function yr(){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 oy(){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=yr.apply(void 0,i)(o.dispatch)})}}}var Rt=Vt+"anon_id",Kt=Vt+"user_id",dr=Vt+"user_traits",hs="analytics",Pt="userId",fr="anonymousId",pn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],vs=["name","EVENTS","config","loaded"],Q=pn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),bd=/^utm_/,Sd=/^an_prop_/,Id=/^an_trait_/;function sy(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(Kt,o.userId),u.traits&&e(dr,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(bd)||p.match(/^(d|g)clid/)){var g=p.replace(bd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Sd)&&(v.props[p.replace(Sd,"")]=i[p]),p.match(Id)&&(v.traits[p.replace(Id,"")]=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 cy(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===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,Rt,dr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Pd(t){return{userId:t.getItem(Kt),anonymousId:t.getItem(Rt),traits:t.getItem(dr)}}var ps=function(t){return Vt+"TEMP"+Vt+t};function uy(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,dr,Rt].forEach(function(d){n(d)}),[Pt,fr,"traits"].forEach(function(d){Rr(ps(d))})),s.type===Q.identify){a(Rt)||r(Rt,Hn());var f=a(Kt),h=a(dr)||{};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(dr,ee({},h,l))}return o(s)}}}}var Dr={};function Ed(t,e){Dr[t]&&ze(Dr[t])&&(Dr[t](e),delete Dr[t])}function Uv(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 Uv(t,e,r-10).then(n,a)})})}function ly(t){return{abort:t}}function $v(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,I=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Pt,fr].reduce(function(O,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(O[A]=b[A]),O},m)})(h.payload,u),w=n[I.meta.rid];if(!w&&(g=p({payload:I,config:o[d].config,instance:r,abort:ly}))&&Ke(g)&&g.abort)return void(n[I.meta.rid]=!0);if(!w){var y=v+":"+d;t.dispatch(ee({},I,{type:y,_:{called:y,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var Go=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(hr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,I){return function(w,y,m){var b=y.config,O=y.name,A=O+"."+w.type;m&&(A=m.event);var N=w.type.match(hr)?(function(H,V,te,j,F){return function(D,T){var _=j?j.name:H,$=T&&Wr(T)?T:te;if(j&&(!($=T&&Wr(T)?T:[H]).includes(H)||$.length!==1))throw new Error("Method "+V+" can only abort "+H+" plugin. "+JSON.stringify($)+" input valid");return ee({},F,{abort:{reason:D,plugins:$,caller:V,_}})}})(O,A,I,m,w):(function(H,V){return function(){throw new Error(H.type+" action not cancellable. Remove abort in "+V)}})(w,A);return{payload:fy(w),instance:g,config:b||{},abort:N}}})(n,d),p=e.exact.reduce(function(g,I){var w=I.pluginName,y=I.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,I,w){var y=I.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var O=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,N,H){return Promise.resolve(A).then(function(V){return N.method&&ze(N.method)?((function(D,T){var _=Ad(D);if(_&&_.name===T){var $=Ad(_.method);throw new Error([T+" plugin is calling method "+D,"Plugins cant call self","Use "+_.method+" "+($?"or "+$.method:"")+" in "+T+" plugin insteadof "+D].join(`
35
+ `))}})(N.methodName,N.pluginName),Promise.resolve(N.method({payload:V,instance:n,abort:(te=V,j=y,F=N.pluginName,function(D,T){return ee({},te,{abort:{reason:D,plugins:T||[j],caller:f,from:F||j}})}),config:Rd(N.pluginName,l,i),plugins:l})).then(function(D){var T=Ke(D)?D:{};return Promise.resolve(ee({},V,T))})):V;var te,j,F})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return O&&O.then?O.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(I,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,O=i[b];return Promise.resolve(I).then(function(A){var N=g[b]?g[b]:{};if(h&&(N=A),Vo(N,b))return Wo({data:N,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(Vo(A,b))return m&&Wo({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:N,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var H=v(g[b],i[b]);return Promise.resolve(O[f]({abort:H.abort,payload:N,instance:n,config:Rd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},j=ee({},A,te),F=g[b];if(Vo(F,b))Wo({data:F,method:f,instance:n,pluginName:b,store:s});else{var D=f+":"+b;(D.match(/:/g)||[]).length<2&&!f.match(kd)&&!f.match(_d)&&n.dispatch(ee({},h?j:N,{type:D,_:{called:D,from:"submethod"}}))}return Promise.resolve(j)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(I){if(!(f.match(hr)||f.match(/^registerPlugin/)||f.match(_d)||f.match(kd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),I._&&I._.originalAction===f)return I;var w=ee({},I,{_:{originalAction:I.type,called:I.type,from:"engineEnd"}});Lv(I,e.exact.length)&&!f.match(/End$/)&&(w=ee({},w,{type:I.type+"Aborted"})),s.dispatch(w)}return I})})}catch(g){return Promise.reject(g)}},hr=/Start$/,kd=/^bootstrap/,_d=/^ready/;function Wo(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 Td(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Od(t,e){var r=t.replace(hr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Vo(t,e){var r=t.abort;return!!r&&(r===!0||Cd(r,e)||r&&Cd(r.plugins,e))}function Lv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||_t(r))return!0;var n=r.plugins;return Wr(r)&&r.length===e||Wr(n)&&n.length===e}function Wr(t){return Array.isArray(t)}function Cd(t,e){return!(!t||!Wr(t))&&t.includes(e)}function Ad(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function fy(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 dy(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 Ed(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=[],I=o.disabled,w=v.map(function(m){var b=m.loaded,O=m.name,A=m.config;return Uv(m,function(){return b({config:A})},1e4).then(function(N){return n[O]||(a.dispatch({type:Q.pluginReadyType(O),name:O,events:Object.keys(m).filter(function(H){return!vs.includes(H)})}),n[O]=!0),p=p.concat(O),m}).catch(function(N){if(N instanceof Error)throw new Error(N);return g=g.concat(N.name),N})});Promise.all(w).then(function(m){var b={plugins:p,failed:g,disabled:I};setTimeout(function(){d.length===w.length+I.length&&a.dispatch(ee({},{type:Q.ready},b))},0)})}var y=(function(){if(l!==Q.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return $v(a,e,t)},0),Promise.resolve((function(m,b,O,A,N){try{var H=ze(b)?b():b,V=m.type,te=V.replace(hr,"");if(m._&&m._.called)return Promise.resolve(m);var j=O.getState(),F=(_=H,($=j.plugins)===void 0&&($={}),(q=m.options)===void 0&&(q={}),Object.keys(_).filter(function(S){var k=q.plugins||{};return Gg(k[S])?k[S]:k.all!==!1&&(!$[S]||$[S].enabled!==!1)}).map(function(S){return _[S]}));V===Q.initializeStart&&m.fromEnable&&(F=Object.keys(j.plugins).filter(function(S){var k=j.plugins[S];return m.plugins.includes(S)&&!k.initialized}).map(function(S){return H[S]}));var D=F.map(function(S){return S.name}),T=(function(S,k){var x=Od(S).map(function(z){return Td(z,k)});return k.reduce(function(z,Y){var J=Y.name,fe=Od(S,J).map(function(ke){return Td(ke,k)}),ne=fe[0],ce=fe[1],ae=fe[2];return ne.length&&(z.beforeNS[J]=ne),ce.length&&(z.duringNS[J]=ce),ae.length&&(z.afterNS[J]=ae),z},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,F);return Promise.resolve(Go({action:m,data:{exact:T.before,namespaced:T.beforeNS},state:j,allPlugins:H,allMatches:T,instance:O,store:A,EVENTS:N})).then(function(S){function k(){var Y=(function(){if(V.match(hr))return Promise.resolve(Go({action:ee({},x,{type:te+"End"}),data:{exact:T.after,namespaced:T.afterNS},state:j,allPlugins:H,allMatches:T,instance:O,store:A,EVENTS:N})).then(function(J){J.meta&&J.meta.hasCallback&&Ed(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return S}):S}if(Lv(S,D.length))return S;var x,z=(function(){if(V!==te)return Promise.resolve(Go({action:ee({},S,{type:te}),data:{exact:T.during,namespaced:T.duringNS},state:j,allPlugins:H,allMatches:T,instance:O,store:A,EVENTS:N})).then(function(Y){x=Y});x=S})();return z&&z.then?z.then(k):k()})}catch(S){return Promise.reject(S)}var _,$,q})(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 hy(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 vy=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 yr.apply(void 0,o)(n)(a)}}}}};function py(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=Ud(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=Ud(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,$d(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,$d(r.plugins,!0,e));default:return e}}}function Ud(t,e){return t.substring(e.length+1,t.length)}function $d(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function qv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var my={last:{},history:[]};function gy(t,e){t===void 0&&(t=my);var r=e.options,n=e.meta;if(e.type===Q.track){var a=qv(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 yy={actions:[]};function wy(t,e){t===void 0&&(t=yy);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 jv=/#.*$/;function by(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(jv,""):"")}var Nv,xv,Dv,Mv,Sy=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(jv,"")})(l),f={title:r,url:c,path:by(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},Iy={last:{},history:[]};function Py(t,e){t===void 0&&(t=Iy);var r=e.options;if(e.type===Q.page){var n=qv(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}Nv=(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"})(),xv=Ce?document.referrer:null,Dv=Qg(),Mv=ey();var Ld={initialized:!1,sessionId:Hn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:Nv},userAgent:Ce?navigator.userAgent:"node",library:{name:hs,version:"0.13.1"},timezone:Mv,locale:Dv,campaign:{},referrer:xv};function Ey(t,e){t===void 0&&(t=Ld);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({},Ld,t,{initialized:!0})}}var ky=["plugins","reducers","storage"];function _y(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Ry(t){var e=_y.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Fv(){return Zt(hs,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return gr[mr][hs].push(o.action||o),i(o)}})}}}function qd(t){return function(){return yr(yr.apply(null,arguments),Fv())}}function Jo(t){return t?Tv(t)?t:[t]:[]}function jd(t,e,r){t===void 0&&(t={});var n,a,i=Hn();return e&&(Dr[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 Ty(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(S,k){if(ze(k))return S.middlewares=S.middlewares.concat(k),S;if(k.NAMESPACE&&(k.name=k.NAMESPACE),!k.name)throw new Error("https://lytics.dev/errors/1");k.config||(k.config={});var x=k.EVENTS?Object.keys(k.EVENTS).map(function(J){return k.EVENTS[J]}):[];S.pluginEnabled[k.name]=!(k.enabled===!1||k.config.enabled===!1),delete k.enabled,k.methods&&(S.methods[k.name]=Object.keys(k.methods).reduce(function(J,fe){var ne;return J[fe]=(ne=k.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 k.methods);var z=Object.keys(k).concat(x),Y=new Set(S.events.concat(z));if(S.events=Array.from(Y),S.pluginsArray=S.pluginsArray.concat(k),S.plugins[k.name])throw new Error(k.name+"AlreadyLoaded");return S.plugins[k.name]=k,S.plugins[k.name].loaded||(S.plugins[k.name].loaded=function(){return!0}),S},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Jt,setItem:Zt,removeItem:Rr},i=(function(S){return function(k,x,z){return x.getState("user")[k]||(z&&Ke(z)&&z[k]?z[k]:Pd(S)[k]||Jt(ps(k))||null)}})(a),o=n.plugins,s=n.events.filter(function(S){return!vs.includes(S)}).sort(),u=new Set(s.concat(pn).filter(function(S){return!vs.includes(S)})),l=Array.from(u).sort(),c=function(){return o},f=new vy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=ty(),I=Pd(a),w=ee({},I,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Hn());var y=ee({enable:function(S,k){return new Promise(function(x){T.dispatch({type:Q.enablePlugin,plugins:Jo(S),_:{originalAction:Q.enablePlugin}},x,[k])})},disable:function(S,k){return new Promise(function(x){T.dispatch({type:Q.disablePlugin,plugins:Jo(S),_:{originalAction:Q.disablePlugin}},x,[k])})}},n.methods),m=!1,b={identify:function(S,k,x,z){try{var Y=_t(S)?S:null,J=Ke(S)?S:k,fe=x||{},ne=b.user();Zt(ps(Pt),Y);var ce=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){T.dispatch(ee({type:Q.identifyStart,userId:ce,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[k,x,z])}))}catch(ae){return Promise.reject(ae)}},track:function(S,k,x,z){try{var Y=Ke(S)?S.event:S;if(!Y||!_t(Y))throw new Error("EventMissing");var J=Ke(S)?S:k||{},fe=Ke(x)?x:{};return Promise.resolve(new Promise(function(ne){T.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Pt,b,k),anonymousId:i(fr,b,k)},ne,[k,x,z])}))}catch(ne){return Promise.reject(ne)}},page:function(S,k,x){try{var z=Ke(S)?S:{},Y=Ke(k)?k:{};return Promise.resolve(new Promise(function(J){T.dispatch({type:Q.pageStart,properties:Sy(z),options:Y,userId:i(Pt,b,z),anonymousId:i(fr,b,z)},J,[S,k,x])}))}catch(J){return Promise.reject(J)}},user:function(S){if(S===Pt||S==="id")return i(Pt,b);if(S===fr||S==="anonId")return i(fr,b);var k=b.getState("user");return S?gd(k,S):k},reset:function(S){return new Promise(function(k){T.dispatch({type:Q.resetStart},k,S)})},ready:function(S){return m&&S({plugins:y,instance:b}),b.on(Q.ready,function(k){S&&S(k),m=!0})},on:function(S,k){if(!S||!ze(k))return!1;if(S===Q.bootstrap)throw new Error(".on disabled for "+S);var x=/Start$|Start:/;if(S==="*"){var z=function(ne){return function(ce){return function(ae){return ae.type.match(x)&&k({payload:ae,instance:b,plugins:o}),ce(ae)}}},Y=function(ne){return function(ce){return function(ae){return ae.type.match(x)||k({payload:ae,instance:b,plugins:o}),ce(ae)}}};return h(z,sn),h(Y,cn),function(){d(z,sn),d(Y,cn)}}var J=S.match(x)?sn:cn,fe=function(ne){return function(ce){return function(ae){return ae.type===S&&k({payload:ae,instance:b,plugins:o,abort:p}),ce(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(S,k){if(!S||!ze(k))return!1;if(S===Q.bootstrap)throw new Error(".once disabled for "+S);var x=b.on(S,function(z){k({payload:z.payload,instance:b,plugins:o,abort:p}),x()});return x},getState:function(S){var k=T.getState();return S?gd(k,S):Object.assign({},k)},dispatch:function(S){var k=_t(S)?{type:S}:S;if(pn.includes(k.type))throw new Error("reserved action "+k.type);var x=ee({},k,{_:ee({originalAction:k.type},S._||{})});T.dispatch(x)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(S,k,x){T.dispatch({type:Q.setItemStart,key:S,value:k,options:x})},removeItem:function(S,k){T.dispatch({type:Q.removeItemStart,key:S,options:k})}},setAnonymousId:function(S,k){b.storage.setItem(Rt,S,k)},events:{core:pn,plugins:s}},O=n.middlewares.concat([function(S){return function(k){return function(x){return x.meta||(x.meta=jd()),k(x)}}},v(sn),dy(b,c,{all:l,plugins:s}),hy(a),sy(b),uy(b),v(cn)]),A={context:Ey,user:cy(a),page:Py,track:gy,plugins:py(c),queue:wy},N=yr,H=yr;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(N=V({trace:!0,traceLimit:25})),H=function(){return arguments.length===0?Fv():Ke(typeof arguments[0])?qd():qd().apply(null,arguments)}}var te,j=(function(S){return Object.keys(S).reduce(function(k,x){return ky.includes(x)||(k[x]=S[x]),k},{})})(t),F=n.pluginsArray.reduce(function(S,k){var x=k.name,z=k.config,Y=k.loaded,J=n.pluginEnabled[x];return S[x]={enabled:J,initialized:!!J&&!k.initialize,loaded:!!Y({config:z}),config:z},S},{}),D={context:j,user:w,plugins:F},T=Av((function(S){for(var k=Object.keys(S),x={},z=0;z<k.length;z++){var Y=k[z];typeof S[Y]===Et&&(x[Y]=S[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:ds})===pt||typeof ae(void 0,{type:ay})===pt)throw new Error(zr+" "+ce+" "+pt)})})(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===pt){var St=iy(De,ce);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),D,H(N(oy.apply(void 0,O))));T.dispatch=(te=T.dispatch,function(S,k,x){var z=ee({},S,{meta:jd(S.meta,k,Jo(x))});return te.apply(null,[z])});var _=Object.keys(o);T.dispatch({type:Q.bootstrap,plugins:_,config:j,params:g,user:w,initialUser:r,persistedUser:I});var $=_.filter(function(S){return n.pluginEnabled[S]}),q=_.filter(function(S){return!n.pluginEnabled[S]});return T.dispatch({type:Q.registerPlugins,plugins:_,enabled:n.pluginEnabled}),n.pluginsArray.map(function(S,k){var x=S.bootstrap,z=S.config,Y=S.name;x&&ze(x)&&x({instance:b,config:z,payload:S}),T.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:S}),n.pluginsArray.length===k+1&&T.dispatch({type:Q.initializeStart,plugins:$,disabled:q})}),Ry(function(S){T.dispatch({type:S?Q.offline:Q.online})}),(function(S,k,x){setInterval(function(){return $v(S,k,x)},3e3)})(T,c,b),b}var sn="before",cn="after",zt="cookie",xt=Hv(),Kv=Bn,Oy=Bn;function zv(t){return xt?Bn(t,"",-1):Rr(t)}function Hv(){if(xt!==void 0)return xt;var t=zt+zt;try{Bn(t,t),xt=document.cookie.indexOf(t)!==-1,zv(t)}catch{xt=!1}return xt}function Bn(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",Cy=Gs.bind(null,mt);Tr(mt,"getItem",Jt);Tr(mt,"setItem",Zt);Tr(mt,"removeItem",Rr);var gt="sessionStorage",Ay=Gs.bind(null,gt);Tr(gt,"getItem",Jt);Tr(gt,"setItem",Zt);Tr(gt,"removeItem",Rr);function vr(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 Uy=Cy(),$y=Ay(),Ly=Hv();function Ht(t,e){if(t){var r=Ws(e),n=!Ys(r),a=Vs(r)?vr(localStorage.getItem(t)):void 0;if(n&&!lr(a))return a;var i=Js(r)?vr(Kv(t)):void 0;if(n&&i)return i;var o=Zs(r)?vr(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 Pn(t,e,r){if(t&&!lr(e)){var n={},a=Ws(r),i=JSON.stringify(e),o=!Ys(a);return Vs(a)&&(n[mt]=un(mt,e,vr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:Js(a)&&(n[zt]=un(zt,e,vr(Kv(t))),Oy(t,i),o)?n[zt]:Zs(a)&&(n[gt]=un(gt,e,vr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ft]=un(Ft,e,Jt(t)),Zt(t,e),o?n[Ft]:n)}}function qy(t,e){if(t){var r=Ws(e),n=Ht(t,kv),a={};return!lr(n.localStorage)&&Vs(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!lr(n.cookie)&&Js(r)&&(zv(t),a[zt]=n.cookie),!lr(n.sessionStorage)&&Zs(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!lr(n.global)&&Gn(r,Ft)&&(Rr(t),a[Ft]=n.global),a}}function Ws(t){return t?_t(t)?t:t.storage:Ev}function Vs(t){return Uy&&Gn(t,mt)}function Js(t){return Ly&&Gn(t,zt)}function Zs(t){return $y&&Gn(t,gt)}function Ys(t){return t===kv||t==="all"}function Gn(t,e){return t===Ev||t===e||Ys(t)}function un(t,e,r){return{location:t,current:e,previous:r}}var jy={setItem:Pn,getItem:Ht,removeItem:qy};function Ny(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nd(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 xd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nd(Object(r),!0).forEach(function(n){Ny(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:jy};return Ty(xd(xd({},e),t))}const Xs="@sesamy/sesamy-js",Wn="1.59.0";function Dy(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=Fy(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function My(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Fy(t){return["#","?"].forEach(e=>t=My(t,e)),t}function Ky(){Dy(()=>{ht.page()})}var Zo="up",Yo="down";function zy(t){if(t===void 0&&(t={}),!Ce)return fs;var e=Md(),r=ms(),n=Dd(),a=ln(n,e),i=ln(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return fs;var d=h.map(function(p){return Number(p)}),v=ny(function(){var p=Md(),g=(function(j,F){return F.map(function(D){return D===100?j-5:j*(D/100)})})(p,d),I=ms(),w=Dd(),y=ln(w,p),m=ln(I,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,O=Zo;b?O="initial":l<=w&&(O=Yo);var A=g,N=d;(O===Zo||b)&&(A=g.slice().reverse(),N=d.slice().reverse());var H=N.reduce(function(j,F,D){var T=A[D];return u.includes(F)&&w<=T&&(u=u.filter(function(_){return _!==F}),j.singleFunction=F),O===Yo&&!o.includes(F)&&w>=T&&F>i?(s.push(F),j.callbacks=j.callbacks.concat(F),j):O===Zo&&!o.includes(F)&&w<=T&&F<=y?(j.foundFunc=[F],j):(b&&w>=T&&j.foundFunc.length===0&&(j.foundFunc=[F]),!s.includes(F)&&w>=T&&(s.push(F),j.singleFunction?u.push(F):j.singleFunction=F),j)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(l=w,O===Yo&&H.callbacks&&H.callbacks.forEach(function(j){ze(t[j])&&(t[j]({trigger:j,direction:O,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(j))}),H.singleFunction){var V=H.singleFunction,te=H.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 ms(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function Hy(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Dd(){return Math.round(ms()+Hy())}function Md(){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 ln(t,e){return Math.round(t/e*100)}var Qs="Event",Fd=Qs+"Listener";function By(t){return function(e,r,n,a){var i=n||fs,o=a||!1;if(!Ce)return i;var s=En(r),u=En(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+Qs);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Fd:"remove"+Fd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?Gy(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 En(t,e){if(_t(t))return e?En(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=Xg(t);return e?i.map(function(o){return _t(o)?En(o,!0):o}).flat():i}function Gy(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var Xo=By(Qs);function Bv(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}Bv.bind(null,"onerror");Bv.bind(null,"onload");var Gv=typeof window>"u",Kd="hidden";function Wy(t){if(Gv)return!1;var e=Vy(),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 Vy(){var t=["webkit","moz","ms","o"];return Gv||Kd in document?Kd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Jy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Zy(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=Wy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Jy.map(function(s){return Xo(document,s,r)})).concat(Xo(window,"load",r)).concat(Xo(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Yy(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(jr(h),g),a&&c&&(c=!1,a(jr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(jr(h),g))},s)}var p=Zy(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:jr(h,f),idle:c?jr(r,f):0}}}}function jr(t,e){return e?0:Math.round((new Date-t)/1e3)}const zd=5e3;class Xy{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),Yy({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:zd}),zy({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*zd: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 Wv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Qy(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 Hd="sesamy_session_id";function ew(){let t=sessionStorage.getItem(Hd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Hd,t)),t}function Vv(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 tw(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"}},Jv=[],Zv=!1,Bt;function Yv(){const t=window.location.pathname;return Jv.find(e=>e.path?t.includes(e.path):!0)}function rw(t,e){Jv=t.content||[];const r=Yv();r&&r.type==="article"&&(Fe={...Fe,...tw(r.selectors)},Zv=r.enablePaywallSettingsUrlFallback||!1),Bt=e}function nw(t,e){const{selector:r}=e;return r===Fe.article.selector?t:t.querySelector(r)}function Xv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Xv(t.parentElement,e):t.textContent??void 0}function pr(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 Qv({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||pr(`sesamy:${e}`)||pr(`og:${e}`)||pr(e)||r}function aw(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(Vn).filter(e=>e!==null)}function Vn(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Vv(e)},n=(i,o,s,u)=>{const l=nw(e,o);if(l){const c=Xv(l,o)||Qv({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=Yv();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)),Zv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r}async function iw(t){const e=Vn(t);if(!e)throw new Error("Could not find article element");if(e.paywallUrl){const a=(await Bt.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement";if(e.accessLevel=a,a==="logged-in"){const i=await Bt.auth.isAuthenticated();return e.hasAccess=i,e}}if(!e.url)throw new Error("Article must have a URL");const r=await Bt.entitlements.hasAccess(e.url,e.pass?.split(",")||[]);return e.hasAccess=!!r,e.entitlement=r,e}async function ow(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=Vn(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||Vv(r.parentElement||r);return Bt.proxy.getContent(i.token,n.url,o)}let ep=!1,mn,kn,gs;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:gs,requestId:Math.random().toString(36).slice(2,9),sessionId:ew(),timestamp:new Date().toISOString(),version:Wn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:pr("sesamy:item-src"),publisherContentId:pr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Xs,userAgent:navigator.userAgent,clientId:gs}}}))}const rp=Qy(async t=>{if(t.length>0){const e=tp(t);ep?navigator.sendBeacon(kn,e):(await fetch(kn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Qo(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(kn,tp([e]))}else rp.push(t)}function sw(){return ep=!0,rp.flush()}function cw(t,e,r){mn=e,kn=`${st("logs",r)}/events`,gs=t}const uw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;Qo({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;Qo({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n}=t;Qo({anonymousId:r,userId:n,properties:e,type:"identify"})}},Bd=["source","medium","campaign","term","content"],kt="utm_",lw=1800*1e3;function np(t){return t?Date.now()-parseInt(t,10)>lw:!0}function Gd(){const t=document.referrer||"";if(!t)return;const e=Ht(`${kt}set_at`);(np(e)||!Ht(`${kt}referrer`))&&Pn(`${kt}referrer`,t)}function fw(){const t=()=>{const r={};for(const a of Bd){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(){Gd()},campaign({payload:r}){const n=r?.campaign||{},a=Ht(`${kt}set_at`);if(Object.keys(n).length>0&&np(a)){for(const o of Bd){const s=n[o];s&&Pn(`${kt}${o}`,s)}Pn(`${kt}set_at`,String(Date.now()))}Gd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const dw=fw(),Wd=new Map,Vd=new Map;function hw({clientId:t,enabled:e=!0,environment:r}){cw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Vd.forEach((n,a)=>{n.bind(a)()}),sw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Wd.forEach((n,a)=>{n.bind(a)()})}),Ky(),Wv(()=>{const n=new Xy({element:document.body,viewCallback:()=>{ht.page()},activeDurationCallback:(a,i,o)=>{ht.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{ht.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{ht.track("scroll",{scroll:a.scrollMax})}});Vd.set(document.body,()=>{n.flush()}),Wd.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Be.AUTHENTICATED,async n=>{const a=n;await ht.identify(a.detail.sub)}),window.addEventListener(Be.LOGOUT,async()=>{await ht.track("logout",{}),await ht.reset()}))}const ht=xy({app:Xs,version:Wn,plugins:[dw,uw]});function ap(t,e){ht.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 vw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function pw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function mw(){return/android/i.test(navigator.userAgent)}let Oe,op,Hr,ys=!1,gn=!1;Gr()&&window.addEventListener("pageshow",()=>{gn=!1});const wr="sesamyAccessToken",es="sesamyRefreshToken",_n="sesamySilentAuthThrottle",gw=300*1e3;async function Jn(){return ys?!0:new Promise((t,e)=>{const r=setTimeout(()=>{ys?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function yw(t){if(!t)return null;const e=localStorage.getItem(es);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(es),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(es,i.refresh_token),localStorage.setItem(wr,i.access_token),i.access_token}catch{rc()}}async function ec(){const t=localStorage.getItem(wr);if(!t)return null;const e=nc(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await yw(e);if(r)return r;localStorage.removeItem(wr)}return t}let fn=null;const ww=64;function bw(){try{if(fn!==null)return fn;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===ww)return fn=!0,!0}}catch(t){le(`Error checking for existing auth0 tokens: ${t.message}`)}return fn=!1,!1}function Sw(t){if(t.domains&&t.domains.length>0){const e=br(window.location.href);if(e){for(const r of t.domains)if(br(`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 br(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 Iw(t){if(t.enabled===!1)return;op=t.organization;const e=Sw(t);Hr=e&&!bw()?e:Pv("token",t.environment);const r={domain:Hr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",br(window.location.href)!==br(`https://${Hr}`)&&(r.useRefreshTokens=!0),le(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await kg(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)}`),tc(),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())}ys=!0,Wt(Be.AUTH_INITIALIZED,{})}async function Vr(){return await Jn(),await ec()?!0:Oe?Oe.isAuthenticated():!1}async function Pw(){return await Jn(),await ec()?(le("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function sp(t){if(gn)return le("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(wr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:op,redirect_uri:window.location.href,ui_locales:Ks(),incognito:Bs(),...e}}}async function Zn(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}),tc(),ip(Be.AUTHENTICATED,await Oe.getUser()).canceled||window.location.reload()}async function Ew(t){return Hr&&br(window.location.href)!==br(`https://${Hr}`)&&(pw()||mw()||Bs())?cp(t):Zn(t)}function kw(){try{const t=sessionStorage.getItem(_n);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<gw}catch{return sessionStorage.removeItem(_n),!1}}function _w(){try{const t={timestamp:Date.now()};sessionStorage.setItem(_n,JSON.stringify(t))}catch{le("Failed to set silent auth throttle in sessionStorage")}}function tc(){try{sessionStorage.removeItem(_n)}catch{}}async function qt(t=!0,e=!1){await Jn();const r=await ec();if(r)return r;if(!e&&kw()){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=nc(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),tc(),n}catch(n){const a=n;if(le(`Failed to get token silently: ${a.message}`),_w(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await rc(),t)throw n;return null}}async function rc(t={}){if(await Jn(),localStorage.removeItem(wr),Wt(Be.LOGOUT,{}),!!Oe)return le(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function nc(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 ws(t){const e=nc(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");le("Set token"),localStorage.setItem(wr,t),Wt(Be.AUTHENTICATED,e)}const Rw=(t,e)=>e.skipDedupe||e.method!=="GET",Tw=(t,e)=>e.method+"@"+t,Ow=t=>t.clone(),Jd=({skip:t=Rw,key:e=Tw,resolver:r=Ow}={})=>{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)}}},Cw=(t,e)=>t*e,Aw=t=>t&&t.ok,Zd=({delayTimer:t=500,delayRamp:e=Cw,maxAttempts:r=10,until:n=Aw,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 I=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))},I)}).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 Br 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,Br)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}var Rn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Rn||{});const Uw="application/json",up="Content-Type",or=Symbol(),lp=Symbol();function Yd(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 Xd(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})},Sr={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 $w(t,e=!1){Sr.options=e?t:Gt(Sr.options,t)}function Lw(t,e=!1){Sr.polyfills=e?t:Gt(Sr.polyfills,t)}function qw(t){Sr.errorType=t}const jw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class fp extends Error{}const Nw=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=jw(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 O=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(O&&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),O=b?m[or]:m,A=O?.status&&l.get(O.status)||l.get(O?.name)||b&&l.has(or)&&l.get(or);if(A)return A(O,t);const N=l.get(lp);if(N)return N(O,t);throw O}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.then(b=>m?m(b):b)),I={_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}),I);return o.reduce((y,m)=>m(y,t),w)},xw={_url:"",_options:{},_config:Sr,_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=Yd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Xd(a));return n=r?o?n.json(r,a):n.body(r):n,Nw(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||Xd(r)&&r||Uw).body(JSON.stringify(t))}};function rt(t="",e={}){return{...xw,_url:t,_options:e}}rt.default=rt;rt.options=$w;rt.errorType=qw;rt.polyfills=Lw;rt.WretchError=fp;const Dw=(t,e)=>e.skipDedupe||e.method!=="GET",Mw=(t,e)=>e.method+"@"+t,Fw=t=>t.clone(),Kw=({skip:t=Dw,key:e=Mw,resolver:r=Fw}={})=>{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)}}},zw=(t,e)=>e.skipCache||e.method!=="GET",Hw=(t,e)=>e.method+"@"+t,Bw=()=>!1,Gw=()=>null,Ww=t=>t.ok,Vw=({throttle:t=1e3,skip:e=zw,key:r=Hw,clear:n=Bw,invalidate:a=Gw,condition:i=Ww,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(I=>{typeof I=="string"?s.delete(I):I instanceof RegExp&&s.forEach((w,y)=>{I.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 I=s.get(p).clone();return o&&Object.defineProperty(I,o,{value:p,enumerable:!1}),Promise.resolve(I)}else if(u.has(p))return new Promise((I,w)=>{u.get(p).push([I,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(I=>(i(I.clone())&&s.set(p,I.clone()),u.get(p).forEach(([w])=>w(I.clone())),u.delete(p),I)).catch(I=>{throw u.get(p).forEach(([,w])=>w(I)),u.delete(p),I})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Jw=(t,e)=>t*e,Zw=t=>t&&t.ok,Yw=({delayTimer:t=500,delayRamp:e=Jw,maxAttempts:r=10,until:n=Zw,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 I=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))},I)}).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)})},Xw="@sesamy/sdk",Qw="1.14.0";class eb{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 Mr="sesamyCacheTimestamp",tb=t=>{const{libraryName:e=Xw,libraryVersion:r=Qw,cache:n}=t,a=n?.storage||new eb,i=[s=>async(u,l)=>{if(n?.mode===Rn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Mr),c||(c=Date.now().toString(),sessionStorage.setItem(Mr,c))):(c=a.get(Mr),c||(c=Date.now().toString(),a.set(Mr,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:`Bearer ${c}`}};return s(u,f)},Kw()];n?.mode===Rn.NORMAL&&i.push(Vw({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Yw({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=rt(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?JSON.parse(u.body):void 0);break;case"put":h=c.put(u.body?JSON.parse(u.body):void 0);break;case"patch":h=c.patch(u.body?JSON.parse(u.body):void 0);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)&&ut(),d.status===204)return null;if(!d.ok){const v=await d.text().catch(()=>"Unknown error");throw new Br(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Br)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Br(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},ut=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Mr),"Cache cleared"),Nr={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"})}},ts={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`)},Qd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},eh={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},xr={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"})},rs={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},dn={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)})},ns={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"})}},sr={generateCheckoutLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkout`);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(`meta-${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()}},as={generateLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkout`);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(`meta-${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkout",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkout/${e}`),update:async(t,e,r)=>t.request(`/checkout/${e}`,{method:"PATCH",body:JSON.stringify(r)})},th={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},rh={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},rb={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},nb={list:async t=>t.request("/payment-issues")},ab={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)}},ib={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},nh={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ob=t=>{const e=tb(t);return{profile:{get:r=>Nr.get(e,r),update:(r,n)=>Nr.update(e,r,n),checkSpotifyLink:()=>Nr.checkSpotifyLink(e),unlinkSpotify:()=>Nr.unlinkSpotify(e),delete:()=>Nr.delete(e)},entitlements:{list:r=>ts.list(e,r),get:r=>ts.get(e,r),getAccess:r=>ts.getAccess(e,r)},subscriptions:{list:()=>Qd.list(e),get:r=>Qd.get(e,r)},products:{get:r=>eh.get(e,r),autoOnboard:r=>eh.autoOnboard(e,r)},contracts:{list:()=>xr.list(e),get:r=>xr.get(e,r),cancel:r=>xr.cancel(e,r),createAmendment:(r,n)=>xr.createAmendment(e,r,n),confirmAmendment:(r,n)=>xr.confirmAmendment(e,r,n)},userMetadata:{get:()=>rs.get(e),set:(r,n)=>rs.set(e,r,n),delete:r=>rs.delete(e,r)},tallies:{list:()=>dn.list(e),get:r=>dn.get(e,r),update:(r,n)=>dn.update(e,r,n),create:r=>dn.create(e,r)},tags:{list:()=>ns.list(e),add:r=>ns.add(e,r),remove:r=>ns.remove(e,r)},checkout:{generateLink:(r,n)=>sr.generateCheckoutLink(r,n),create:r=>as.create(e,r),get:r=>as.get(e,r),update:(r,n)=>as.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>sr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>sr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>sr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>sr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>sr.generateConsumeLink(r,n)},bills:{list:()=>th.list(e),get:r=>th.get(e,r)},fulfillments:{list:()=>rh.list(e),create:r=>rh.create(e,r)},paywalls:{get:r=>rb.get(e,r)},paymentIssues:{list:()=>nb.list(e)},proxy:{content:(r,n,a,i)=>ab.content(e,r,n,a,i)},transactions:{list:r=>ib.list(e,r)},vendor:{get:()=>nh.get(e),list:()=>nh.list(e)}}};class sb{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 bs(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function dp(t,e){if(bs(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 ah(t){return t.endsWith("/")?t.slice(0,-1):t}function ih(t,e){if(!bs(t)||!bs(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&ah(r.pathname)===ah(n.pathname)}function cb(t,e,r){const n=new URL(`${st("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(`meta-${c}`,String(f))}),n}const hp="sesamySignedURLs";function ac(){const t=sessionStorage.getItem(hp);return t?JSON.parse(t):[]}function ub(t){const e=ac();e.push(t),le(`Adding signed URL: ${t}`),sessionStorage.setItem(hp,JSON.stringify(e))}function lb(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ss="sesamyAttribution";function fb(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 db(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function ic(){return fb(Ss)||{}}function vp(t){if(t===null)localStorage.removeItem(Ss);else{le(`Setting attribution ${JSON.stringify(t)}`);const e=ic()??{},r=lb({...e,...db(t)});localStorage.setItem(Ss,JSON.stringify({value:r}))}}function hb(t){const e=t.endpoint||st("api2",t.environment),n=ob({baseUrl:e,tokenProvider:async()=>{const _=await qt(!0);if(!_)throw new Error("No access token available");return _},libraryName:Xs,libraryVersion:Wn,vendorId:t.vendorId,cache:{mode:Rn.BROWSER,storage:new sb}}),a=_=>async($,q)=>{let S=sessionStorage.getItem(pd);S||(S=Date.now().toString(),sessionStorage.setItem(pd,S));const k={...q,headers:{...q.headers,"Cache-Timestamp":S}};return _($,k)},i=(_=!0)=>$=>async(q,S)=>{let k=null;if(k=await qt(_),!k){if(_)throw new Error("No access token available");return $(q,S)}const x={...S,headers:{...S.headers,...k?{Authorization:`Bearer ${k}`}:{}}};return $(q,x)},o=_=>($,q)=>{if(q.headers&&"Authorization"in q.headers)return _($,q);const S=localStorage.getItem("__anon_id"),k=btoa(`${t.clientId}|${S}:`),x={...q,headers:{...q.headers,Authorization:`Basic ${k}`}};return _($,x)},s=rt(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Jd(),Zd({delayTimer:1e3,delayRamp:(_,$)=>_*$,maxAttempts:3,until:_=>!!(_&&(_.ok||_.status>=400&&_.status<500)),retryOnNetworkError:!1})]),u=rt(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Jd(),Zd({delayTimer:1e3,delayRamp:(_,$)=>_*$,maxAttempts:3,until:_=>!!(_&&(_.ok||_.status>=400&&_.status<500)),retryOnNetworkError:!1})]);async function l(_={}){const{waitForEntitlementAfter:$,includeSignedLinks:q=!0}=_,S=await Vr()?await n.entitlements.list({waitForEntitlementAfter:$?.toISOString()}):[];return q&&S.push(...ac()),S}async function c(_,$=[]){return(await l())?.find(k=>{if(_){const{sku:x,purchaseOption:z}=dp(_);if("sku"in k&&x===k.sku||z&&"purchaseOptionsId"in k&&z===k.purchaseOptionsId||ih(_,k.url))return!0}return!!$.some(x=>ih(x,k.url))})}async function f(_,$,q){const S=new URL(st("api2",t.environment));return S.pathname="/proxy",S.searchParams.set("url",$),q&&S.searchParams.set("selector",q),rt(S.toString()).headers({Authorization:`Bearer ${_}`}).get().text()}async function h(_){if(!_)throw new Error("SKU is required to get fulfillments");return await Vr()?await s.get(`/fulfillments?sku=${encodeURIComponent(_)}`).json():[]}async function d(_,$){if(!_||!$)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:_},`/fulfillments/${encodeURIComponent($)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function p(_){return(await n.transactions.list())?.find(q=>q.id===_)}async function g(){return await s.url("/tags").get().json()}async function I(_){const $=await s.url(`/tags/${encodeURIComponent(_)}`).delete().res();return ut(),$.ok}async function w(_){const $=await s.url("/tags").post(encodeURIComponent(_)).res();return Wt(Be.USER_ATTRIBUTE_CHANGED,{}),ut(),$.ok}async function y(_){return(await u.url("/tallies").get().json())[_]}async function m(){return await u.url("/tallies").get().json()}async function b(_){const $=await u.url(`/tallies/${_}`).delete().res();return ut(),$.ok}async function O(_,$){return await u.url(`/tallies/${encodeURIComponent(_)}/push`).post($).json()}async function A(){return await qt(!1)?await s.url("/profile").get().json():null}async function N(_){const $=await s.url("/profile").patch(_).res();return ut(),$.ok}async function H(){return(await s.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function V(){return(await s.url("/profile/unlink-spotify").post().res()).ok}async function te(_){const $=await qt(!1);if(!$)throw new Error("No access token available");const q=new URL(`${st("access-sync",t.environment)}/spotify/sesamy-callback`);q.searchParams.set("access_token",$),q.searchParams.set("state",_),window.location.href=q.toString()}async function j(_){const $=await s.url(`/products/${encodeURIComponent(_)}/auto-onboard`).post().json();return $.length&&ut(),$}async function F(_,$=3600){const{shortlink:q}=await rt(Tg).post({url:_,ttl:$}).json();return q}async function D(_){const $=await qt(!1,!0);let q;const S=_.language||Ks(),k=ic();switch(_.target){case"account":q=new URL(`${st("account",t.environment)}/${encodeURIComponent(_.language||S)}/subscriptions/${encodeURIComponent(t.clientId)}${_.contractId?`/${encodeURIComponent(_.contractId)}`:""}`),q.searchParams.set("sesamy-redirect-url",_.redirectUrl||window.location.href);break;case"change-payment":q=new URL(`${st("account",t.environment)}/${encodeURIComponent(_.language||S)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(_.contractId)}/change-payment-method`),q.searchParams.set("sesamy-redirect-url",_.redirectUrl||window.location.href);break;case"change-plan":q=new URL(`${st("account",t.environment)}/${encodeURIComponent(_.language||S)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(_.contractId)}/edit-plan`),q.searchParams.set("sesamy-redirect-url",_.redirectUrl||window.location.href);break;case"consume":q=new URL(`${st("consume",t.environment)}/${encodeURIComponent(_.language||S)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(_.sku)}`),_.episodeId?q.href+=`/${_.episodeId}`:q.href+="/listen",q.searchParams.set("sesamy-redirect-url",_.redirectUrl||window.location.href);break;case"checkout":q=cb(t,{language:S,..._},k);break;default:throw new Error("Invalid target")}return $&&(q.hash=`#access_token=${$}`),_.shorten?F(q.href,_.ttl):q.href}async function T(){const _=await qt(!1),$=new URL(`${st("account",t.environment)}/subscriptions/${t.clientId}`);_&&($.hash=`#access_token=${_}`),window.location.href=$.toString()}return{autoOnboardProduct:j,bills:n.bills,checkout:n.checkout,contracts:n.contracts,deleteTag:I,deleteTally:b,entitlements:n.entitlements,generateLink:D,getProxyContent:f,getEntitlements:l,getFulfillments:h,requestDelivery:d,hasAccess:c,isSpotifyLinked:H,linkSpotify:te,openHostedAccountPage:T,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:A,products:n.products,getSubscriptions:v,getTally:y,getTallies:m,getTags:g,getTransaction:p,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:O,setTag:w,unlinkSpotify:V,updateProfile:N,vendor:n.vendor}}const vb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function pb(){return new Promise(t=>{const e=vb.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",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 mb(){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}}const pp="sesamyFlags";async function mp(t){try{localStorage.setItem(pp,JSON.stringify(t))}catch{le("Failed to save flags to localStorage")}}async function gb(t,e){const r=await Yn();r[t]=e,await mp(r)}async function yb(t){return(await Yn())[t]}async function wb(t){const e=await Yn();t in e&&(delete e[t],await mp(e))}async function Yn(){try{const t=localStorage.getItem(pp);return t?JSON.parse(t):{}}catch{return{}}}function bb(t){const{autoOnboardProduct:e,bills:r,checkout: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:I,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:O,paymentIssues:A,products:N,pushTally:H,requestDelivery:V,setTag:te,transactions:j,unlinkSpotify:F,updateProfile:D,userMetadata:T,vendor:_}=hb(t),$={analytics:{track:ap},attribution:{get:ic,set:vp},auth:{getUser:f,getTokenSilently:qt,isAuthenticated:Vr,loginWithRedirect:Zn,loginWithPopup:cp,login:Ew,logout:rc,setToken:ws},bills:r,browser:{detectAdblock:pb,isInAppBrowser:mb,isIncognito:Bs},checkouts:n,clearCache:ut,content:{list:aw,get:Vn,getLanguage:Ks,hasAccess:iw,unlock:ow,getPropertyFromHTML:Qv},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:ac},events:{emit:ip,cancel:vw},flags:{get:yb,set:gb,list:Yn,delete:wb},fulfillments:{list:c,requestDelivery:V},generateLink:u,getVersion:Sb,isReady:()=>exports.isInitialized,log:le,paywalls:O,paymentIssues:A,products:{...N,autoOnboard:e,linkSpotify:m},profile:{get:f,isSpotifyLinked:y,openHostedAccountPage:b,unlinkSpotify:F,update:D},proxy:{getContent:h},subscriptions:{list:d},tags:{delete:i,list:v,set:te},tallies:{delete:o,get:p,list:g,push:H},transactions:{...j,get:I},userMetadata:T,vendor:_,setToken:ws};return t.namespace&&(window[t.namespace]=$),$}function Sb(){return Wn}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=`
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 Pb(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 oc(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 Pb(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 Eb(t,e){const r=e.insertionPoint||"inside",n=await oc(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 kb(t,e){const r=await oc(e);t.innerHTML=r}async function _b(t,e){const r=await oc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Rb({enabled:t=!1,rules:e}){t&&Wv(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 Eb(s,a);break;case"replace":await kb(s,a);break;case"remove":o.remove();break;case"wrap":await _b(s,a);break;case"gradient":Ib(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const oh="access_token";function Tb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(oh);if(e){Ss(e);const r=new URL(window.location.href);t.delete(oh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const sh="sesamy-refresh",ch="force-refetch-entitlements";function Ob(){const t=new URLSearchParams(window.location.search),e=t.get(ch),r=t.get(sh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(ch),t.delete(sh),n.search=t.toString(),tt(),window.history.replaceState(null,"",n)}}function Cb(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 Ab(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Cb(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()};ub(i)}catch(n){pe(`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 uh="sesamy-user";async function Ub(){const e=new URLSearchParams(window.location.search).get(uh)?.toLowerCase();if(!e)return;const r=await Pw();r?.email!==e?(pe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),tt(),Xn({authorizationParams:{login_hint:e}})):pe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(uh),window.history.replaceState(null,"",n)}const lh="sesamy-purchase";function $b(){const t=new URLSearchParams(window.location.search),e=t.get(lh);if(e!==null){const r=new URL(window.location.href);t.delete(lh),r.search=t.toString(),pe(`Purchase ${e}`),Lt(Je.PURCHASE,{itemSrc:e}),tt(),window.history.replaceState(null,"",r)}}const fh="sesamy-login",Lb="sesamy_login";async function jb(){const t=new URLSearchParams(window.location.search);if(!(t.get(fh)||t.get(Lb)))return;await Vr()||Xn();const n=new URL(window.location.href);n.searchParams.delete(fh),window.history.replaceState(null,"",n)}const dh="sesamy-debug";async function qb(){const e=new URLSearchParams(window.location.search).get(dh)?.toLowerCase();if(!e)return;qm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(dh),window.history.replaceState(null,"",r)}function Nb(){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 xb(t){if(!Gr())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:Nb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),vp(r)}function Db(){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(md)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(md,"true"),n||(pe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Mb(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 Fb(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 Kb(t){const e=mr("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 hh(t,e){pe(`Init with config: ${JSON.stringify(t)}`);try{Db(),hw({clientId:t.clientId,environment:t.environment,...t.analytics}),await Iw({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),rw(t,e),t.transform&&await Rb(t.transform),Ag(),qb(),xb(e),Tb(),Ob(),Ab(),await jb(),await Ub(),$b(),await Fb(e),await Mb(e),await Kb(e),exports.isInitialized=!0,Lt(Je.READY,{})}catch(r){pe(`Failed to init ${r.message}`)}}async function gp(t){pe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Gr()&&e in window)return pe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=bb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Gr()?(t.awaitAllServices?await hh(t,r):hh(t,r),r):(exports.isInitialized=!0,r)}if(Gr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);gp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Je;exports.init=gp;
47
+ `,document.head.appendChild(i)}async function Pb(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 oc(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 Pb(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 Eb(t,e){const r=e.insertionPoint||"inside",n=await oc(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 kb(t,e){const r=await oc(e);t.innerHTML=r}async function _b(t,e){const r=await oc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Rb({enabled:t=!1,rules:e}){t&&Wv(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 Eb(s,a);break;case"replace":await kb(s,a);break;case"remove":o.remove();break;case"wrap":await _b(s,a);break;case"gradient":Ib(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const oh="access_token";function Tb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(oh);if(e){ws(e);const r=new URL(window.location.href);t.delete(oh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const sh="sesamy-refresh",ch="force-refetch-entitlements";function Ob(){const t=new URLSearchParams(window.location.search),e=t.get(ch),r=t.get(sh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(ch),t.delete(sh),n.search=t.toString(),ut(),window.history.replaceState(null,"",n)}}function Cb(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 Ab(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Cb(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()};ub(i)}catch(n){le(`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 uh="sesamy-user";async function Ub(){const e=new URLSearchParams(window.location.search).get(uh)?.toLowerCase();if(!e)return;const r=await Pw();r?.email!==e?(le(`Current user does not match sesamy user: ${r?.email} !== ${e}`),ut(),Zn({authorizationParams:{login_hint:e}})):le(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(uh),window.history.replaceState(null,"",n)}const lh="sesamy-purchase";function $b(){const t=new URLSearchParams(window.location.search),e=t.get(lh);if(e!==null){const r=new URL(window.location.href);t.delete(lh),r.search=t.toString(),le(`Purchase ${e}`),Wt(Be.PURCHASE,{itemSrc:e}),ut(),window.history.replaceState(null,"",r)}}const fh="sesamy-login",Lb="sesamy_login";async function qb(){const t=new URLSearchParams(window.location.search);if(!(t.get(fh)||t.get(Lb)))return;await Vr()||Zn();const n=new URL(window.location.href);n.searchParams.delete(fh),window.history.replaceState(null,"",n)}const dh="sesamy-debug";async function jb(){const e=new URLSearchParams(window.location.search).get(dh)?.toLowerCase();if(!e)return;jm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(dh),window.history.replaceState(null,"",r)}function Nb(){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 xb(t){if(!Gr())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:Nb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),vp(r)}function Db(){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(md)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(md,"true"),n||(le("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Mb(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 Fb(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 Kb(t){const e=pr("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 hh(t,e){le(`Init with config: ${JSON.stringify(t)}`);try{Db(),hw({clientId:t.clientId,environment:t.environment,...t.analytics}),await Iw({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),rw(t,e),t.transform&&await Rb(t.transform),Ag(),jb(),xb(e),Tb(),Ob(),Ab(),await qb(),await Ub(),$b(),await Fb(e),await Mb(e),await Kb(e),exports.isInitialized=!0,Wt(Be.READY,{})}catch(r){le(`Failed to init ${r.message}`)}}async function gp(t){le("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Gr()&&e in window)return le("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=bb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Gr()?(t.awaitAllServices?await hh(t,r):hh(t,r),r):(exports.isInitialized=!0,r)}if(Gr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);gp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Be;exports.init=gp;