@sesamy/sesamy-js 1.102.0 → 1.103.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,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ws={},jn,Vs;function Ae(){return Vs||(Vs=1,jn=function(e){try{return!!e()}catch{return!0}}),jn}var Dn,zs;function vn(){if(zs)return Dn;zs=1;var e=Ae();return Dn=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),Dn}var Mn,Ks;function pe(){if(Ks)return Mn;Ks=1;var e=vn(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Mn=e?n:function(a){return function(){return t.apply(a,arguments)}},Mn}var Fn,Js;function hn(){if(Js)return Fn;Js=1;var e=pe(),r=e({}.toString),t=e("".slice);return Fn=function(n){return t(r(n),8,-1)},Fn}var Bn,Ys;function Wd(){if(Ys)return Bn;Ys=1;var e=pe(),r=Ae(),t=hn(),n=Object,a=e("".split);return Bn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,Bn}var Hn,Qs;function pn(){return Qs||(Qs=1,Hn=function(e){return e==null}),Hn}var Gn,Xs;function mn(){if(Xs)return Gn;Xs=1;var e=pn(),r=TypeError;return Gn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Gn}var Wn,Zs;function Lt(){if(Zs)return Wn;Zs=1;var e=Wd(),r=mn();return Wn=function(t){return e(r(t))},Wn}var bt,eu;function me(){if(eu)return bt;eu=1;var e=function(r){return r&&r.Math===Math&&r};return bt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof Gs=="object"&&Gs)||e(typeof bt=="object"&&bt)||(function(){return this})()||Function("return this")(),bt}var Vn={exports:{}},zn,ru;function ur(){return ru||(ru=1,zn=!1),zn}var Kn,tu;function is(){if(tu)return Kn;tu=1;var e=me(),r=Object.defineProperty;return Kn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},Kn}var nu;function os(){if(nu)return Vn.exports;nu=1;var e=ur(),r=me(),t=is(),n="__core-js_shared__",a=Vn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"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"}),Vn.exports}var Jn,au;function Vd(){if(au)return Jn;au=1;var e=os();return Jn=function(r,t){return e[r]||(e[r]=t||{})},Jn}var Yn,iu;function gn(){if(iu)return Yn;iu=1;var e=mn(),r=Object;return Yn=function(t){return r(e(t))},Yn}var Qn,ou;function Ke(){if(ou)return Qn;ou=1;var e=pe(),r=gn(),t=e({}.hasOwnProperty);return Qn=Object.hasOwn||function(a,i){return t(r(a),i)},Qn}var Xn,su;function zd(){if(su)return Xn;su=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Xn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Xn}var Zn,uu;function xt(){if(uu)return Zn;uu=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Zn=t?String(t):"",Zn}var ea,cu;function Kd(){if(cu)return ea;cu=1;var e=me(),r=xt(),t=e.process,n=e.Deno,a=t&&t.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&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ea=s,ea}var ra,lu;function Jd(){if(lu)return ra;lu=1;var e=Kd(),r=Ae(),t=me(),n=t.String;return ra=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),ra}var ta,fu;function Yd(){if(fu)return ta;fu=1;var e=Jd();return ta=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ta}var na,du;function ke(){if(du)return na;du=1;var e=me(),r=Vd(),t=Ke(),n=zd(),a=Jd(),i=Yd(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return na=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},na}var aa,vu;function be(){if(vu)return aa;vu=1;var e=typeof document=="object"&&document.all;return aa=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},aa}var ia,hu;function Je(){if(hu)return ia;hu=1;var e=be();return ia=function(r){return typeof r=="object"?r!==null:e(r)},ia}var oa,pu;function rr(){if(pu)return oa;pu=1;var e=Je(),r=String,t=TypeError;return oa=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},oa}var sa={},ua,mu;function qe(){if(mu)return ua;mu=1;var e=Ae();return ua=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ua}var ca,gu;function Qd(){if(gu)return ca;gu=1;var e=qe(),r=Ae();return ca=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ca}var la={},fa,yu;function yn(){if(yu)return fa;yu=1;var e=me(),r=Je(),t=e.document,n=r(t)&&r(t.createElement);return fa=function(a){return n?t.createElement(a):{}},fa}var da,wu;function Xd(){if(wu)return da;wu=1;var e=qe(),r=Ae(),t=yn();return da=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),da}var va,bu;function Le(){if(bu)return va;bu=1;var e=vn(),r=Function.prototype.call;return va=e?r.bind(r):function(){return r.apply(r,arguments)},va}var ha,Su;function Ye(){if(Su)return ha;Su=1;var e=me(),r=be(),t=function(n){return r(n)?n:void 0};return ha=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},ha}var pa,Iu;function wn(){if(Iu)return pa;Iu=1;var e=pe();return pa=e({}.isPrototypeOf),pa}var ma,Pu;function Zd(){if(Pu)return ma;Pu=1;var e=Ye(),r=be(),t=wn(),n=Yd(),a=Object;return ma=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},ma}var ga,Eu;function bn(){if(Eu)return ga;Eu=1;var e=String;return ga=function(r){try{return e(r)}catch{return"Object"}},ga}var ya,Ru;function tr(){if(Ru)return ya;Ru=1;var e=be(),r=bn(),t=TypeError;return ya=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},ya}var wa,Tu;function ss(){if(Tu)return wa;Tu=1;var e=tr(),r=pn();return wa=function(t,n){var a=t[n];return r(a)?void 0:e(a)},wa}var ba,Ou;function Gh(){if(Ou)return ba;Ou=1;var e=Le(),r=be(),t=Je(),n=TypeError;return ba=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ba}var Sa,Cu;function Wh(){if(Cu)return Sa;Cu=1;var e=Le(),r=Je(),t=Zd(),n=ss(),a=Gh(),i=ke(),o=TypeError,s=i("toPrimitive");return Sa=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},Sa}var Ia,_u;function ev(){if(_u)return Ia;_u=1;var e=Wh(),r=Zd();return Ia=function(t){var n=e(t,"string");return r(n)?n:n+""},Ia}var Au;function yr(){if(Au)return la;Au=1;var e=qe(),r=Xd(),t=Qd(),n=rr(),a=ev(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return la.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},la}var Pa,ku;function Vh(){if(ku)return Pa;ku=1;var e=Math.ceil,r=Math.floor;return Pa=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Pa}var Ea,qu;function us(){if(qu)return Ea;qu=1;var e=Vh();return Ea=function(r){var t=+r;return t!==t||t===0?0:e(t)},Ea}var Ra,$u;function rv(){if($u)return Ra;$u=1;var e=us(),r=Math.max,t=Math.min;return Ra=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ra}var Ta,Uu;function zh(){if(Uu)return Ta;Uu=1;var e=us(),r=Math.min;return Ta=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ta}var Oa,Lu;function cs(){if(Lu)return Oa;Lu=1;var e=zh();return Oa=function(r){return e(r.length)},Oa}var Ca,xu;function Kh(){if(xu)return Ca;xu=1;var e=Lt(),r=rv(),t=cs(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Ca={includes:n(!0),indexOf:n(!1)},Ca}var _a,Nu;function ls(){return Nu||(Nu=1,_a={}),_a}var Aa,ju;function tv(){if(ju)return Aa;ju=1;var e=pe(),r=Ke(),t=Lt(),n=Kh().indexOf,a=ls(),i=e([].push);return Aa=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},Aa}var ka,Du;function fs(){return Du||(Du=1,ka=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ka}var qa,Mu;function nv(){if(Mu)return qa;Mu=1;var e=tv(),r=fs();return qa=Object.keys||function(n){return e(n,r)},qa}var Fu;function Jh(){if(Fu)return sa;Fu=1;var e=qe(),r=Qd(),t=yr(),n=rr(),a=Lt(),i=nv();return sa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},sa}var $a,Bu;function av(){if(Bu)return $a;Bu=1;var e=Ye();return $a=e("document","documentElement"),$a}var Ua,Hu;function ds(){if(Hu)return Ua;Hu=1;var e=Vd(),r=zd(),t=e("keys");return Ua=function(n){return t[n]||(t[n]=r(n))},Ua}var La,Gu;function Nt(){if(Gu)return La;Gu=1;var e=rr(),r=Jh(),t=fs(),n=ls(),a=av(),i=yn(),o=ds(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",w;return I.style.display="none",a.appendChild(I),I.src=String(g),w=I.contentWindow.document,w.open(),w.write(d("document.F=Object")),w.close(),w.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,La=Object.create||function(g,w){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),w===void 0?y:r.f(y,w)},La}var xa,Wu;function Yh(){if(Wu)return xa;Wu=1;var e=ke(),r=Nt(),t=yr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),xa=function(i){a[n][i]=!0},xa}var Na,Vu;function jt(){return Vu||(Vu=1,Na={}),Na}var ja,zu;function Qh(){if(zu)return ja;zu=1;var e=me(),r=be(),t=e.WeakMap;return ja=r(t)&&/native code/.test(String(t)),ja}var Da,Ku;function Gr(){return Ku||(Ku=1,Da=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),Da}var Ma,Ju;function Wr(){if(Ju)return Ma;Ju=1;var e=qe(),r=yr(),t=Gr();return Ma=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Ma}var Fa,Yu;function ft(){if(Yu)return Fa;Yu=1;var e=Qh(),r=me(),t=Je(),n=Wr(),a=Ke(),i=os(),o=ds(),s=ls(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var w;if(!t(g)||(w=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return w}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Fa={set:f,get:v,has:d,enforce:h,getterFor:p},Fa}var Ba={},Ha={},Qu;function iv(){if(Qu)return Ha;Qu=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Ha.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Ha}var Xu;function ov(){if(Xu)return Ba;Xu=1;var e=qe(),r=Le(),t=iv(),n=Gr(),a=Lt(),i=ev(),o=Ke(),s=Xd(),u=Object.getOwnPropertyDescriptor;return Ba.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Ba}var Ga={exports:{}},Wa,Zu;function sv(){if(Zu)return Wa;Zu=1;var e=qe(),r=Ke(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Wa={EXISTS:a,PROPER:i,CONFIGURABLE:o},Wa}var Va,ec;function vs(){if(ec)return Va;ec=1;var e=pe(),r=be(),t=os(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Va=t.inspectSource,Va}var rc;function uv(){if(rc)return Ga.exports;rc=1;var e=pe(),r=Ae(),t=be(),n=Ke(),a=qe(),i=sv().CONFIGURABLE,o=vs(),s=ft(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=Ga.exports=function(I,g,w){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),w&&w.getter&&(g="get "+g),w&&w.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&w&&n(w,"arity")&&I.length!==w.arity&&f(I,"length",{value:w.arity});try{w&&n(w,"constructor")&&w.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),Ga.exports}var za,tc;function Qe(){if(tc)return za;tc=1;var e=be(),r=yr(),t=uv(),n=is();return za=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,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:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},za}var Ka={},nc;function Xh(){if(nc)return Ka;nc=1;var e=tv(),r=fs(),t=r.concat("length","prototype");return Ka.f=Object.getOwnPropertyNames||function(a){return e(a,t)},Ka}var Ja={},ac;function cv(){return ac||(ac=1,Ja.f=Object.getOwnPropertySymbols),Ja}var Ya,ic;function Zh(){if(ic)return Ya;ic=1;var e=Ye(),r=pe(),t=Xh(),n=cv(),a=rr(),i=r([].concat);return Ya=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},Ya}var Qa,oc;function lv(){if(oc)return Qa;oc=1;var e=Ke(),r=Zh(),t=ov(),n=yr();return Qa=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},Qa}var Xa,sc;function fv(){if(sc)return Xa;sc=1;var e=Ae(),r=be(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Xa=n,Xa}var Za,uc;function Pe(){if(uc)return Za;uc=1;var e=me(),r=ov().f,t=Wr(),n=Qe(),a=is(),i=lv(),o=fv();return Za=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},Za}var ei,cc;function ep(){if(cc)return ei;cc=1;var e=Ae();return ei=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),ei}var ri,lc;function hs(){if(lc)return ri;lc=1;var e=Ke(),r=be(),t=gn(),n=ds(),a=ep(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ri=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ri}var ti,fc;function dv(){if(fc)return ti;fc=1;var e=Ae(),r=be(),t=Je(),n=Nt(),a=hs(),i=Qe(),o=ke(),s=ur(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),ti={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},ti}var ni,dc;function dt(){if(dc)return ni;dc=1;var e=yr().f,r=Ke(),t=ke(),n=t("toStringTag");return ni=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ni}var ai,vc;function vv(){if(vc)return ai;vc=1;var e=dv().IteratorPrototype,r=Nt(),t=Gr(),n=dt(),a=jt(),i=function(){return this};return ai=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ai}var ii,hc;function rp(){if(hc)return ii;hc=1;var e=pe(),r=tr();return ii=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},ii}var oi,pc;function tp(){if(pc)return oi;pc=1;var e=Je();return oi=function(r){return e(r)||r===null},oi}var si,mc;function np(){if(mc)return si;mc=1;var e=tp(),r=String,t=TypeError;return si=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},si}var ui,gc;function ps(){if(gc)return ui;gc=1;var e=rp(),r=Je(),t=mn(),n=np();return ui=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),ui}var ci,yc;function hv(){if(yc)return ci;yc=1;var e=Pe(),r=Le(),t=ur(),n=sv(),a=be(),i=vv(),o=hs(),s=ps(),u=dt(),c=Wr(),l=Qe(),f=ke(),v=jt(),d=dv(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",w="values",y="entries",A=function(){return this};return ci=function($,j,G,K,re,x,M){i(G,j,K);var N=function(Y){if(Y===re&&b)return b;if(!R&&Y&&Y in L)return L[Y];switch(Y){case g:return function(){return new G(this,Y)};case w:return function(){return new G(this,Y)};case y:return function(){return new G(this,Y)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,L=$.prototype,F=L[I]||L["@@iterator"]||re&&L[re],b=!R&&F||N(re),T=j==="Array"&&L.entries||F,k,H,J;if(T&&(k=o(T.call(new $)),k!==Object.prototype&&k.next&&(!t&&o(k)!==S&&(s?s(k,S):a(k[I])||l(k,I,A)),u(k,m,!0,!0),t&&(v[m]=A))),h&&re===w&&F&&F.name!==w&&(!t&&p?c(L,"name",w):(C=!0,b=function(){return r(F,this)})),re)if(H={values:N(w),keys:x?b:N(g),entries:N(y)},M)for(J in H)(R||C||!(J in L))&&l(L,J,H[J]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&L[I]!==b&&l(L,I,b,{name:re}),v[j]=b,H},ci}var li,wc;function ms(){return wc||(wc=1,li=function(e,r){return{value:e,done:r}}),li}var fi,bc;function gs(){if(bc)return fi;bc=1;var e=Lt(),r=Yh(),t=jt(),n=ft(),a=yr().f,i=hv(),o=ms(),s=ur(),u=qe(),c="Array Iterator",l=n.set,f=n.getterFor(c);fi=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return fi}var Sc={},Ic;function ap(){if(Ic)return Sc;Ic=1;var e=Pe(),r=pe(),t=rv(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),Sc}var di,Pc;function pv(){if(Pc)return di;Pc=1;var e=me(),r=qe(),t=Object.getOwnPropertyDescriptor;return di=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},di}var vi,Ec;function Sn(){if(Ec)return vi;Ec=1;var e=Ae(),r=ke(),t=qe(),n=ur(),a=r("iterator");return vi=!e(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(c,l){o.delete("b"),u+=l+c}),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||!t)||!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"}),vi}var hi,Rc;function In(){if(Rc)return hi;Rc=1;var e=uv(),r=yr();return hi=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},hi}var pi,Tc;function ip(){if(Tc)return pi;Tc=1;var e=Qe();return pi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},pi}var mi,Oc;function ys(){if(Oc)return mi;Oc=1;var e=wn(),r=TypeError;return mi=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},mi}var gi,Cc;function op(){if(Cc)return gi;Cc=1;var e=hn(),r=pe();return gi=function(t){if(e(t)==="Function")return r(t)},gi}var yi,_c;function vt(){if(_c)return yi;_c=1;var e=op(),r=tr(),t=vn(),n=e(e.bind);return yi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},yi}var wi,Ac;function ws(){if(Ac)return wi;Ac=1;var e=ke(),r=e("toStringTag"),t={};return t[r]="z",wi=String(t)==="[object z]",wi}var bi,kc;function Dt(){if(kc)return bi;kc=1;var e=ws(),r=be(),t=hn(),n=ke(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return bi=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},bi}var Si,qc;function wr(){if(qc)return Si;qc=1;var e=Dt(),r=String;return Si=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},Si}var Ii,$c;function Pn(){if($c)return Ii;$c=1;var e=Dt(),r=ss(),t=pn(),n=jt(),a=ke(),i=a("iterator");return Ii=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},Ii}var Pi,Uc;function bs(){if(Uc)return Pi;Uc=1;var e=Le(),r=tr(),t=rr(),n=bn(),a=Pn(),i=TypeError;return Pi=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},Pi}var Ei,Lc;function Vr(){if(Lc)return Ei;Lc=1;var e=TypeError;return Ei=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Ei}var Ri,xc;function En(){if(xc)return Ri;xc=1;var e=pe();return Ri=e([].slice),Ri}var Ti,Nc;function sp(){if(Nc)return Ti;Nc=1;var e=En(),r=Math.floor,t=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 c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return Ti=t,Ti}var Oi,jc;function mv(){if(jc)return Oi;jc=1,gs(),ap();var e=Pe(),r=me(),t=pv(),n=Ye(),a=Le(),i=pe(),o=qe(),s=Sn(),u=Qe(),c=In(),l=ip(),f=dt(),v=vv(),d=ft(),h=ys(),p=be(),S=Ke(),R=vt(),I=Dt(),g=rr(),w=Je(),y=wr(),A=Nt(),$=Gr(),j=bs(),G=Pn(),K=ms(),re=Vr(),x=ke(),M=sp(),N=x("iterator"),m="URLSearchParams",C=m+"Iterator",L=d.set,F=d.getterFor(m),b=d.getterFor(C),T=t("fetch"),k=t("Request"),H=t("Headers"),J=k&&k.prototype,Y=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),Re=parseInt,xe=i("".charAt),je=i([].join),$e=i([].push),Xe=i("".replace),Sr=i([].shift),Ir=i([].splice),_r=i("".split),Ar=i("".slice),yt=i(/./.exec),zr=/\+/g,kr="�",ye=/^[0-9a-f]+$/i,Ze=function(D,V){var z=Ar(D,V,V+2);return yt(ye,z)?Re(z,16):NaN},qr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=Xe(D,zr," ");for(var V=D.length,z="",Q=0;Q<V;){var ie=xe(D,Q);if(ie==="%"){if(xe(D,Q+1)==="%"||Q+3>V){z+="%",Q++;continue}var se=Ze(D,Q+1);if(se!==se){z+=ie,Q++;continue}Q+=2;var ve=qr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=kr,Q++;continue}for(var he=[se],Se=1;Se<ve&&(Q++,!(Q+3>V||xe(D,Q)!=="%"));){var Ue=Ze(D,Q+1);if(Ue!==Ue){Q+=3;break}if(Ue>191||Ue<128)break;$e(he,Ue),Q+=2,Se++}if(he.length!==ve){z+=kr;continue}var nr=B(he);nr===null?z+=kr:ie=ae(nr)}}z+=ie,Q++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},He=function(D){return Xe(ne(D),oe,fe)},Te=v(function(V,z){L(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=b(this),z=V.target,Q=V.index++;if(!z||Q>=z.length)return V.target=null,K(void 0,!0);var ie=z[Q];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),De=function(D){this.entries=[],this.url=null,D!==void 0&&(w(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Ar(D,1):D:y(D)))};De.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Q,ie,se,ve,he,Se,Ue;if(z)for(Q=j(D,z),ie=Q.next;!(se=a(ie,Q)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Ue=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");$e(V,{key:y(Se.value),value:y(Ue.value)})}else for(var nr in D)S(D,nr)&&$e(V,{key:nr,value:y(D[nr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=_r(D,"&"),Q=0,ie,se;Q<z.length;)ie=z[Q++],ie.length&&(se=_r(ie,"="),$e(V,{key:X(Sr(se)),value:X(je(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Q;z<D.length;)Q=D[z++],$e(V,He(Q.key)+"="+He(Q.value));return je(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Oe=function(){h(this,Ge);var V=arguments.length>0?arguments[0]:void 0,z=L(this,new De(V));o||(this.size=z.entries.length)},Ge=Oe.prototype;if(l(Ge,{append:function(V,z){var Q=F(this);re(arguments.length,2),$e(Q.entries,{key:y(V),value:y(z)}),o||this.length++,Q.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Q=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Q.length;){var Se=Q[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(Ir(Q,he,1),ve!==void 0)break}else he++}o||(this.size=Q.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Q)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Q&&$e(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Q=re(arguments.length,1),ie=y(V),se=Q<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Q=F(this);re(arguments.length,1);for(var ie=Q.entries,se=!1,ve=y(V),he=y(z),Se=0,Ue;Se<ie.length;Se++)Ue=ie[Se],Ue.key===ve&&(se?Ir(ie,Se--,1):(se=!0,Ue.value=he));se||$e(ie,{key:ve,value:he}),o||(this.size=ie.length),Q.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Q){return z.key>Q.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Q=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Q(se.value,se.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Oe,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:Oe}),!s&&p(H)){var Kr=i(Y.has),wt=i(Y.set),Jr=function(D){if(w(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,Kr(z,"content-type")||wt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:$(0,y(V)),headers:$(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?Jr(arguments[1]):{})}}),p(k)){var Yr=function(V){return h(this,J),new k(V,arguments.length>1?Jr(arguments[1]):{})};J.constructor=Yr,Yr.prototype=J,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Yr})}}return Oi={URLSearchParams:Oe,getState:F},Oi}var Dc;function up(){return Dc||(Dc=1,mv()),Ws}var Mc={},Fc;function cp(){if(Fc)return Mc;Fc=1;var e=Qe(),r=pe(),t=wr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,$){c(h,{key:$,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,w=h.length,y;R<w;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<w;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),Mc}var Bc={},Hc;function lp(){if(Hc)return Bc;Hc=1;var e=Qe(),r=pe(),t=wr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),Bc}var Gc={},Wc;function fp(){if(Wc)return Gc;Wc=1;var e=qe(),r=pe(),t=In(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Gc}var Ci,Vc;function Rn(){if(Vc)return Ci;Vc=1;var e=me();return Ci=e,Ci}var _i,zc;function gv(){if(zc)return _i;zc=1,up(),cp(),lp(),fp();var e=Rn();return _i=e.URLSearchParams,_i}var Kc={},Jc={},Yc={},Ai,Qc;function yv(){if(Qc)return Ai;Qc=1;var e=pe(),r=us(),t=wr(),n=mn(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return Ai={codeAt:s(!1),charAt:s(!0)},Ai}var Xc;function wv(){if(Xc)return Yc;Xc=1;var e=yv().charAt,r=wr(),t=ft(),n=hv(),a=ms(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),Yc}var ki,Zc;function dp(){if(Zc)return ki;Zc=1;var e=qe(),r=pe(),t=Le(),n=Ae(),a=nv(),i=cv(),o=iv(),s=gn(),u=Wd(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return ki=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var w=u(arguments[R++]),y=I?f(a(w),I(w)):a(w),A=y.length,$=0,j;A>$;)j=y[$++],(!e||t(g,w,j))&&(p[j]=w[j]);return p}:c,ki}var qi,el;function bv(){if(el)return qi;el=1;var e=Le(),r=rr(),t=ss();return qi=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},qi}var $i,rl;function vp(){if(rl)return $i;rl=1;var e=rr(),r=bv();return $i=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},$i}var Ui,tl;function Sv(){if(tl)return Ui;tl=1;var e=ke(),r=jt(),t=e("iterator"),n=Array.prototype;return Ui=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},Ui}var Li,nl;function Iv(){if(nl)return Li;nl=1;var e=pe(),r=Ae(),t=be(),n=Dt(),a=Ye(),i=vs(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Li=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Li}var xi,al;function hp(){if(al)return xi;al=1;var e=qe(),r=yr(),t=Gr();return xi=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},xi}var Ni,il;function pp(){if(il)return Ni;il=1;var e=vt(),r=Le(),t=gn(),n=vp(),a=Sv(),i=Iv(),o=cs(),s=hp(),u=bs(),c=Pn(),l=Array;return Ni=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,w,y,A,$,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],$=u(d,I),j=$.next;!(A=r(j,$)).done;g++)G=R?n($,S,[A.value,g],!0):A.value,s(y,g,G);else for(w=o(d),y=h?new this(w):l(w);w>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},Ni}var ji,ol;function mp(){if(ol)return ji;ol=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),w=e([].push),y=e("".replace),A=e("".split),$=e("".toLowerCase),j=function(x){for(var M=[],N=0,m=x.length;N<m;){var C=I(x,N++);if(C>=55296&&C<=56319&&N<m){var L=I(x,N++);(L&64512)===56320?w(M,((C&1023)<<10)+(L&1023)+65536):(w(M,C),N--)}else w(M,C)}return M},G=function(x){return x+22+75*(x<26)},K=function(x,M,N){var m=0;for(x=N?S(x/o):x>>1,x+=S(x/M);x>d*a>>1;)x=S(x/d),m+=t;return S(m+(d+1)*x/(x+i))},re=function(x){var M=[];x=j(x);var N=x.length,m=u,C=0,L=s,F,b;for(F=0;F<x.length;F++)b=x[F],b<128&&w(M,R(b));var T=M.length,k=T;for(T&&w(M,c);k<N;){var H=r;for(F=0;F<x.length;F++)b=x[F],b>=m&&b<H&&(H=b);var J=k+1;if(H-m>S((r-C)/J))throw new h(v);for(C+=(H-m)*J,m=H,F=0;F<x.length;F++){if(b=x[F],b<m&&++C>r)throw new h(v);if(b===m){for(var Y=C,le=t;;){var ne=le<=L?n:le>=L+a?a:le-L;if(Y<ne)break;var ue=Y-ne,ae=t-ne;w(M,R(G(ne+ue%ae))),Y=S(ue/ae),le+=t}w(M,R(G(Y))),L=K(C,J,k===T),C=0,k++}}C++,m++}return g(M,"")};return ji=function(x){var M=[],N=A(y($(x),f,"."),"."),m,C;for(m=0;m<N.length;m++)C=N[m],w(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},ji}var sl;function gp(){if(sl)return Jc;sl=1,wv();var e=Pe(),r=qe(),t=Sn(),n=me(),a=vt(),i=pe(),o=Qe(),s=In(),u=ys(),c=Ke(),l=dp(),f=pp(),v=En(),d=yv().codeAt,h=mp(),p=wr(),S=dt(),R=Vr(),I=mv(),g=ft(),w=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,$=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,x=Math.pow,M=i("".charAt),N=i(/./.exec),m=i([].join),C=i(1.1.toString),L=i([].pop),F=i([].push),b=i("".replace),T=i([].shift),k=i("".split),H=i("".slice),J=i("".toLowerCase),Y=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",Re=/[a-z]/i,xe=/[\d+-.a-z]/i,je=/\d/,$e=/^0x/i,Xe=/^[0-7]+$/,Sr=/^\d+$/,Ir=/^[\da-f]+$/i,_r=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ar=/[\0\t\n\r #/:<>?@[\\\]^|]/,yt=/^[\u0000-\u0020]+/,zr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kr=/[\t\n\r]/g,ye,Ze=function(E){var U=k(E,"."),O,P,_,te,W,we,Ie;if(U.length&&U[U.length-1]===""&&U.length--,O=U.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=U[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=N($e,te)?16:8,te=H(te,W===8?1:2)),te==="")we=0;else{if(!N(W===10?Sr:W===8?Xe:Ir,te))return E;we=K(te,W)}F(P,we)}for(_=0;_<O;_++)if(we=P[_],_===O-1){if(we>=x(256,5-O))return null}else if(we>255)return null;for(Ie=L(P),_=0;_<P.length;_++)Ie+=P[_]*x(256,3-_);return Ie},qr=function(E){var U=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,we,Ie,Ce,Ve,q,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&N(Ir,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(we=0;Ee();){if(Ie=null,we>0)if(Ee()==="."&&we<4)_++;else return;if(!N(je,Ee()))return;for(;N(je,Ee());){if(Ce=K(Ee(),10),Ie===null)Ie=Ce;else{if(Ie===0)return;Ie=Ie*10+Ce}if(Ie>255)return;_++}U[O]=U[O]*256+Ie,we++,(we===2||we===4)&&O++}if(we!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;U[O++]=te}if(P!==null)for(Ve=O-P,O=7;O!==0&&Ve>0;)q=U[O],U[O--]=U[P+Ve-1],U[P+--Ve]=q;else if(O!==8)return;return U},B=function(E){for(var U=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&(U=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:U},X=function(E){var U,O,P,_;if(typeof E=="number"){for(U=[],O=0;O<4;O++)Y(U,E%256),E=re(E/256);return m(U,".")}if(typeof E=="object"){for(U="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?(U+=O?":":"::",_=!0):(U+=C(E[O],16),O<7&&(U+=":")));return"["+U+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),He=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(E,U){var O=d(E,0);return O>32&&O<127&&!c(U,E)?E:encodeURIComponent(E)},De={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(E,U){var O;return E.length===2&&N(Re,M(E,0))&&((O=M(E,1))===":"||!U&&O==="|")},Ge=function(E){var U;return E.length>1&&Oe(H(E,0,2))&&(E.length===2||(U=M(E,2))==="/"||U==="\\"||U==="?"||U==="#")},Kr=function(E){return E==="."||J(E)==="%2e"},wt=function(E){return E=J(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},Jr={},Yr={},D={},V={},z={},Q={},ie={},se={},ve={},he={},Se={},Ue={},nr={},$n={},js={},Un={},Qr={},ar={},Ds={},$r={},cr={},Ln=function(E,U,O){var P=p(E),_,te,W;if(U){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Ln(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=$(new A),W.bindURL(this),this.searchParams=W}};Ln.prototype={type:"URL",parse:function(E,U,O){var P=this,_=U||Jr,te=0,W="",we=!1,Ie=!1,Ce=!1,Ve,q,Ee,lr;for(E=p(E),U||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=b(E,yt,""),E=b(E,zr,"$1")),E=b(E,kr,""),Ve=f(E);te<=Ve.length;){switch(q=Ve[te],_){case Jr:if(q&&N(Re,q))W+=J(q),_=Yr;else{if(U)return ne;_=D;continue}break;case Yr:if(q&&(N(xe,q)||q==="+"||q==="-"||q==="."))W+=J(q);else if(q===":"){if(U&&(P.isSpecial()!==c(De,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,U){P.isSpecial()&&De[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=$n:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Ve[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=Ds)}else{if(U)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&q!=="#")return ne;if(O.cannotBeABaseURL&&q==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=cr;break}_=O.scheme==="file"?$n:Q;continue;case V:if(q==="/"&&Ve[te+1]==="/")_=ve,te++;else{_=Q;continue}break;case z:if(q==="/"){_=he;break}else{_=ar;continue}case Q:if(P.scheme=O.scheme,q===ye)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(q==="/"||q==="\\"&&P.isSpecial())_=ie;else if(q==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=$r;else if(q==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=cr;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ar;continue}break;case ie:if(P.isSpecial()&&(q==="/"||q==="\\"))_=ve;else if(q==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ar;continue}break;case se:if(_=ve,q!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(q!=="/"&&q!=="\\"){_=he;continue}break;case he:if(q==="@"){we&&(W="%40"+W),we=!0,Ee=f(W);for(var xn=0;xn<Ee.length;xn++){var Bs=Ee[xn];if(Bs===":"&&!Ce){Ce=!0;continue}var Hs=Te(Bs,He);Ce?P.password+=Hs:P.username+=Hs}W=""}else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(we&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=q;break;case Se:case Ue:if(U&&P.scheme==="file"){_=Un;continue}else if(q===":"&&!Ie){if(W==="")return ue;if(lr=P.parseHost(W),lr)return lr;if(W="",_=nr,U===Ue)return}else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if(U&&W===""&&(P.includesCredentials()||P.port!==null))return;if(lr=P.parseHost(W),lr)return lr;if(W="",_=Qr,U)return;continue}else q==="["?Ie=!0:q==="]"&&(Ie=!1),W+=q;break;case nr:if(N(je,q))W+=q;else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()||U){if(W!==""){var Nn=K(W,10);if(Nn>65535)return ae;P.port=P.isSpecial()&&Nn===De[P.scheme]?null:Nn,W=""}if(U)return;_=Qr;continue}else return ae;break;case $n:if(P.scheme="file",q==="/"||q==="\\")_=js;else if(O&&O.scheme==="file")switch(q){case ye:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=$r;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=cr;break;default:Ge(m(v(Ve,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ar;continue}else{_=ar;continue}break;case js:if(q==="/"||q==="\\"){_=Un;break}O&&O.scheme==="file"&&!Ge(m(v(Ve,te),""))&&(Oe(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ar;continue;case Un:if(q===ye||q==="/"||q==="\\"||q==="?"||q==="#"){if(!U&&Oe(W))_=ar;else if(W===""){if(P.host="",U)return;_=Qr}else{if(lr=P.parseHost(W),lr)return lr;if(P.host==="localhost"&&(P.host=""),U)return;W="",_=Qr}continue}else W+=q;break;case Qr:if(P.isSpecial()){if(_=ar,q!=="/"&&q!=="\\")continue}else if(!U&&q==="?")P.query="",_=$r;else if(!U&&q==="#")P.fragment="",_=cr;else if(q!==ye&&(_=ar,q!=="/"))continue;break;case ar:if(q===ye||q==="/"||q==="\\"&&P.isSpecial()||!U&&(q==="?"||q==="#")){if(wt(W)?(P.shortenPath(),q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,"")):Kr(W)?q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&Oe(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(q===ye||q==="?"||q==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);q==="?"?(P.query="",_=$r):q==="#"&&(P.fragment="",_=cr)}else W+=Te(q,fe);break;case Ds:q==="?"?(P.query="",_=$r):q==="#"?(P.fragment="",_=cr):q!==ye&&(P.path[0]+=Te(q,oe));break;case $r:!U&&q==="#"?(P.fragment="",_=cr):q!==ye&&(q==="'"&&P.isSpecial()?P.query+="%27":q==="#"?P.query+="%23":P.query+=Te(q,oe));break;case cr:q!==ye&&(P.fragment+=Te(q,ce));break}te++}},parseHost:function(E){var U,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||(U=qr(H(E,1,-1)),!U))return ue;this.host=U}else if(this.isSpecial()){if(E=h(E),N(_r,E)||(U=Ze(E),U===null))return ue;this.host=U}else{if(N(Ar,E))return ue;for(U="",O=f(E),P=0;P<O.length;P++)U+=Te(O[P],oe);this.host=U}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return c(De,this.scheme)},shortenPath:function(){var E=this.path,U=E.length;U&&(this.scheme!=="file"||U!==1||!Oe(E[0],!0))&&E.length--},serialize:function(){var E=this,U=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,we=E.query,Ie=E.fragment,Ce=U+":";return _!==null?(Ce+="//",E.includesCredentials()&&(Ce+=O+(P?":"+P:"")+"@"),Ce+=X(_),te!==null&&(Ce+=":"+te)):U==="file"&&(Ce+="//"),Ce+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",we!==null&&(Ce+="?"+we),Ie!==null&&(Ce+="#"+Ie),Ce},setHref:function(E){var U=this.parse(E);if(U)throw new G(U);this.searchParams.update()},getOrigin:function(){var E=this.scheme,U=this.port;if(E==="blob")try{return new Xr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+(U!==null?":"+U:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",Jr)},getUsername:function(){return this.username},setUsername:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<U.length;O++)this.username+=Te(U[O],He)}},getPassword:function(){return this.password},setPassword:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<U.length;O++)this.password+=Te(U[O],He)}},getHost:function(){var E=this.host,U=this.port;return E===null?"":U===null?X(E):X(E)+":"+U},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ue)},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,nr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,Qr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,$r)),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}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,cr)},update:function(){this.query=this.searchParams.serialize()||null}};var Xr=function(U){var O=u(this,Ne),P=R(arguments.length,1)>1?arguments[1]:void 0,_=w(O,new Ln(U,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},Ne=Xr.prototype,We=function(E,U){return{get:function(){return y(this)[E]()},set:U&&function(O){return y(this)[U](O)},configurable:!0,enumerable:!0}};if(r&&(s(Ne,"href",We("serialize","setHref")),s(Ne,"origin",We("getOrigin")),s(Ne,"protocol",We("getProtocol","setProtocol")),s(Ne,"username",We("getUsername","setUsername")),s(Ne,"password",We("getPassword","setPassword")),s(Ne,"host",We("getHost","setHost")),s(Ne,"hostname",We("getHostname","setHostname")),s(Ne,"port",We("getPort","setPort")),s(Ne,"pathname",We("getPathname","setPathname")),s(Ne,"search",We("getSearch","setSearch")),s(Ne,"searchParams",We("getSearchParams")),s(Ne,"hash",We("getHash","setHash"))),o(Ne,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(Ne,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var Ms=j.createObjectURL,Fs=j.revokeObjectURL;Ms&&o(Xr,"createObjectURL",a(Ms,j)),Fs&&o(Xr,"revokeObjectURL",a(Fs,j))}return S(Xr,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:Xr}),Jc}var ul;function yp(){return ul||(ul=1,gp()),Kc}var cl={},ll;function wp(){if(ll)return cl;ll=1;var e=Pe(),r=Ye(),t=Ae(),n=Vr(),a=wr(),i=Sn(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),cl}var fl={},dl;function bp(){if(dl)return fl;dl=1;var e=Pe(),r=Ye(),t=Vr(),n=wr(),a=Sn(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),fl}var vl={},hl;function Sp(){if(hl)return vl;hl=1;var e=Pe(),r=Le();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),vl}var Di,pl;function Ip(){if(pl)return Di;pl=1,gv(),yp(),wp(),bp(),Sp();var e=Rn();return Di=e.URL,Di}var Mi,ml;function Pp(){if(ml)return Mi;ml=1;var e=Ip();return Mi=e,Mi}var Fi,gl;function Ep(){if(gl)return Fi;gl=1;var e=Pp();return Fi=e,Fi}Ep();var yl={},Bi,wl;function Rp(){return wl||(wl=1,Bi={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}),Bi}var Hi,bl;function Tp(){if(bl)return Hi;bl=1;var e=yn(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return Hi=t===Object.prototype?void 0:t,Hi}var Sl;function Pv(){if(Sl)return yl;Sl=1;var e=me(),r=Rp(),t=Tp(),n=gs(),a=Wr(),i=dt(),o=ke(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),yl}var Gi,Il;function Op(){if(Il)return Gi;Il=1;var e=gv();return Pv(),Gi=e,Gi}var Wi,Pl;function Cp(){if(Pl)return Wi;Pl=1;var e=Op();return Wi=e,Wi}Cp();var El={},Rl={},Vi,Tl;function _p(){if(Tl)return Vi;Tl=1;var e=Je(),r=Wr();return Vi=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},Vi}var zi,Ol;function Ap(){if(Ol)return zi;Ol=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return zi=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},zi}var Ki,Cl;function kp(){if(Cl)return Ki;Cl=1;var e=Ae(),r=Gr();return Ki=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),Ki}var Ji,_l;function qp(){if(_l)return Ji;_l=1;var e=Wr(),r=Ap(),t=kp(),n=Error.captureStackTrace;return Ji=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},Ji}var Yi,Al;function Mt(){if(Al)return Yi;Al=1;var e=vt(),r=Le(),t=rr(),n=bn(),a=Sv(),i=cs(),o=wn(),s=bs(),u=Pn(),c=bv(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return Yi=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),w=!!(p&&p.INTERRUPTED),y=e(h,S),A,$,j,G,K,re,x,M=function(m){return A&&c(A,"normal"),new f(!0,m)},N=function(m){return R?(t(m),w?y(m[0],m[1],M):y(m[0],m[1])):w?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if($=u(d),!$)throw new l(n(d)+" is not iterable");if(a($)){for(j=0,G=i(d);G>j;j++)if(K=N(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,$)}for(re=I?d.next:A.next;!(x=r(re,A)).done;){try{K=N(x.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},Yi}var Qi,kl;function $p(){if(kl)return Qi;kl=1;var e=wr();return Qi=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},Qi}var ql;function Up(){if(ql)return Rl;ql=1;var e=Pe(),r=wn(),t=hs(),n=ps(),a=lv(),i=Nt(),o=Wr(),s=Gr(),u=_p(),c=qp(),l=Mt(),f=$p(),v=ke(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,w){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),w!==void 0&&o(A,"message",f(w)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var $=[];return l(g,p,{that:$}),o(A,"errors",$),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),Rl}var $l;function Lp(){return $l||($l=1,Up()),El}var Ul={},Xi,Ll;function xp(){if(Ll)return Xi;Ll=1;var e=ws(),r=Dt();return Xi=e?{}.toString:function(){return"[object "+r(this)+"]"},Xi}var xl;function Np(){if(xl)return Ul;xl=1;var e=ws(),r=Qe(),t=xp();return e||r(Object.prototype,"toString",t,{unsafe:!0}),Ul}var Nl={},jl={},Zi,Dl;function Ev(){if(Dl)return Zi;Dl=1;var e=me(),r=xt(),t=hn(),n=function(a){return r.slice(0,a.length)===a};return Zi=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),Zi}var eo,Ml;function Ss(){if(Ml)return eo;Ml=1;var e=Ev();return eo=e==="NODE",eo}var ro,Fl;function jp(){if(Fl)return ro;Fl=1;var e=Ye(),r=In(),t=ke(),n=qe(),a=t("species");return ro=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},ro}var to,Bl;function Dp(){if(Bl)return to;Bl=1;var e=Iv(),r=bn(),t=TypeError;return to=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},to}var no,Hl;function Rv(){if(Hl)return no;Hl=1;var e=rr(),r=Dp(),t=pn(),n=ke(),a=n("species");return no=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},no}var ao,Gl;function Tv(){if(Gl)return ao;Gl=1;var e=vn(),r=Function.prototype,t=r.apply,n=r.call;return ao=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),ao}var io,Wl;function Ov(){if(Wl)return io;Wl=1;var e=xt();return io=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),io}var oo,Vl;function Cv(){if(Vl)return oo;Vl=1;var e=me(),r=Tv(),t=vt(),n=be(),a=Ke(),i=Ae(),o=av(),s=En(),u=yn(),c=Vr(),l=Ov(),f=Ss(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,w={},y="onreadystatechange",A,$,j,G;i(function(){A=e.location});var K=function(N){if(a(w,N)){var m=w[N];delete w[N],m()}},re=function(N){return function(){K(N)}},x=function(N){K(N.data)},M=function(N){e.postMessage(I(N),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),L=s(arguments,1);return w[++g]=function(){r(C,void 0,L)},$(g),g},d=function(m){delete w[m]},f?$=function(N){h.nextTick(re(N))}:p&&p.now?$=function(N){p.now(re(N))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=x,$=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?($=M,e.addEventListener("message",x,!1)):y in u("script")?$=function(N){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(N)}}:$=function(N){setTimeout(re(N),0)}),oo={set:v,clear:d},oo}var so,zl;function _v(){if(zl)return so;zl=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},so=e,so}var uo,Kl;function Mp(){if(Kl)return uo;Kl=1;var e=xt();return uo=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",uo}var co,Jl;function Fp(){if(Jl)return co;Jl=1;var e=xt();return co=/web0s(?!.*chrome)/i.test(e),co}var lo,Yl;function Bp(){if(Yl)return lo;Yl=1;var e=me(),r=pv(),t=vt(),n=Cv().set,a=_v(),i=Ov(),o=Mp(),s=Fp(),u=Ss(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,w=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch($){throw g.head&&h(),$}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(w).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(w)}):u?h=function(){f.nextTick(w)}:(n=t(n,e),h=function(){n(w)}),d=function(y){g.head||h(),g.add(y)}}return lo=d,lo}var fo,Ql;function Hp(){return Ql||(Ql=1,fo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),fo}var vo,Xl;function ht(){return Xl||(Xl=1,vo=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),vo}var ho,Zl;function pt(){if(Zl)return ho;Zl=1;var e=me();return ho=e.Promise,ho}var po,ef;function Ft(){if(ef)return po;ef=1;var e=me(),r=pt(),t=be(),n=fv(),a=vs(),i=ke(),o=Ev(),s=ur(),u=Kd(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return po={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},po}var mo={},rf;function br(){if(rf)return mo;rf=1;var e=tr(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return mo.f=function(n){return new t(n)},mo}var tf;function Gp(){if(tf)return jl;tf=1;var e=Pe(),r=ur(),t=Ss(),n=me(),a=Rn(),i=Le(),o=Qe(),s=ps(),u=dt(),c=jp(),l=tr(),f=be(),v=Je(),d=ys(),h=Rv(),p=Cv().set,S=Bp(),R=Hp(),I=ht(),g=_v(),w=ft(),y=pt(),A=Ft(),$=br(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,x=w.getterFor(j),M=w.set,N=y&&y.prototype,m=y,C=N,L=n.TypeError,F=n.document,b=n.process,T=$.f,k=T,H=!!(F&&F.createEvent&&n.dispatchEvent),J="unhandledrejection",Y="rejectionhandled",le=0,ne=1,ue=2,ae=1,Re=2,xe,je,$e,Xe,Sr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},Ir=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,He=B.resolve,Te=B.reject,De=B.domain,Oe,Ge,Kr;try{fe?(ce||(X.rejection===Re&&kr(X),X.rejection=ae),fe===!0?Oe=oe:(De&&De.enter(),Oe=fe(oe),De&&(De.exit(),Kr=!0)),Oe===B.promise?Te(new L("Promise-chain cycle")):(Ge=Sr(Oe))?i(Ge,Oe,He,Te):He(Oe)):Te(oe)}catch(wt){De&&!Kr&&De.exit(),Te(wt)}},_r=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)Ir(ce,B);B.notified=!1,X&&!B.rejection&&yt(B)}))},Ar=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===J&&R("Unhandled promise rejection",oe)},yt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=zr(B),fe;if(ce&&(fe=I(function(){t?b.emit("unhandledRejection",oe,X):Ar(J,X,oe)}),B.rejection=t||zr(B)?Re:ae,fe.error))throw fe.value})},zr=function(B){return B.rejection!==ae&&!B.parent},kr=function(B){i(p,n,function(){var X=B.facade;t?b.emit("rejectionHandled",X):Ar(Y,X,B.value)})},ye=function(B,X,oe){return function(ce){B(X,ce,oe)}},Ze=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,_r(B,!0))},qr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new L("Promise can't be resolved itself");var ce=Sr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,ye(qr,fe,B),ye(Ze,fe,B))}catch(He){Ze(fe,He,B)}}):(B.value=X,B.state=ne,_r(B,!1))}catch(fe){Ze({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=x(this);try{X(ye(qr,oe),ye(Ze,oe))}catch(ce){Ze(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=x(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?b.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){Ir(fe,ce)}),fe.promise}),je=function(){var B=new xe,X=x(B);this.promise=B,this.resolve=ye(qr,X),this.reject=ye(Ze,X)},$.f=T=function(B){return B===m||B===$e?new je(B):k(B)},!r&&f(y)&&N!==Object.prototype)){Xe=N.then,re||o(N,"then",function(X,oe){var ce=this;return new m(function(fe,He){i(Xe,ce,fe,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),$e=a.Promise,u(m,j,!1,!0),c(j),jl}var nf={},go,af;function Wp(){if(af)return go;af=1;var e=ke(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return go=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},go}var yo,of;function Tn(){if(of)return yo;of=1;var e=pt(),r=Wp(),t=Ft().CONSTRUCTOR;return yo=t||!r(function(n){e.all(n).then(void 0,function(){})}),yo}var sf;function Vp(){if(sf)return nf;sf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,w=!1;R++,r(h,c,I).then(function(y){w||(w=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),nf}var uf={},cf;function zp(){if(cf)return uf;cf=1;var e=Pe(),r=ur(),t=Ft().CONSTRUCTOR,n=pt(),a=Ye(),i=be(),o=Qe(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return uf}var lf={},ff;function Kp(){if(ff)return lf;ff=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),lf}var df={},vf;function Jp(){if(vf)return df;vf=1;var e=Pe(),r=br(),t=Ft().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),df}var hf={},wo,pf;function Av(){if(pf)return wo;pf=1;var e=rr(),r=Je(),t=br();return wo=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},wo}var mf;function Yp(){if(mf)return hf;mf=1;var e=Pe(),r=Ye(),t=ur(),n=pt(),a=Ft().CONSTRUCTOR,i=Av(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),hf}var gf;function Qp(){return gf||(gf=1,Gp(),Vp(),zp(),Kp(),Jp(),Yp()),Nl}var yf={},wf;function Xp(){if(wf)return yf;wf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,w=!1;R++,r(h,c,I).then(function(y){w||(w=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){w||(w=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),yf}var bf={},Sf;function Zp(){if(Sf)return bf;Sf=1;var e=Pe(),r=Le(),t=tr(),n=Ye(),a=br(),i=ht(),o=Mt(),s=Tn(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,w=1,y=!1;o(l,function(A){var $=g++,j=!1;w++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[$]=G,--w||p(new v(I,u)))})}),--w||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),bf}var If={},Pf;function kv(){if(Pf)return If;Pf=1;var e=Pe(),r=me(),t=Tv(),n=En(),a=br(),i=tr(),o=ht(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),If}var Ef={},Rf;function qv(){if(Rf)return Ef;Rf=1;var e=Pe(),r=br();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Ef}var Tf={},Of;function em(){if(Of)return Tf;Of=1;var e=Pe(),r=ur(),t=pt(),n=Ae(),a=Ye(),i=be(),o=Rv(),s=Av(),u=Qe(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return Tf}var bo,Cf;function rm(){if(Cf)return bo;Cf=1,Lp(),gs(),Np(),Qp(),Xp(),Zp(),kv(),qv(),em(),wv();var e=Rn();return bo=e.Promise,bo}var So,_f;function tm(){if(_f)return So;_f=1;var e=rm();return Pv(),So=e,So}var Af={},kf;function nm(){return kf||(kf=1,kv()),Af}var qf={},$f;function am(){return $f||($f=1,qv()),qf}var Io,Uf;function im(){if(Uf)return Io;Uf=1;var e=tm();return nm(),am(),Io=e,Io}im();const $v="sesamy-debug";function om(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function sm(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function um(e){om($v,e.toString(),1)}function cm(){return sm($v)==="true"}function de(e){cm()&&console.log(e)}var ze=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ze||{});const lm=Object.freeze(Object.defineProperty({__proto__:null,Events:ze},Symbol.toStringTag,{value:"Module"}));function Lf(e,r){const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}function Lr(e,r){typeof window>"u"||(e===ze.READY&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Lf(e,r),{once:!0}):Lf(e,r))}const fm=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:Lr},Symbol.toStringTag,{value:"Module"}));let Uv=null;function tn(e){Uv=e}function Is(){return Uv}const Lv="sesamy_is_authenticated";function dm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${Lv}=true`))}catch{return!1}}function Po(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${Lv}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function xf(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),dm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,Po(!0),Lr(ze.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,Po(!1))}else a=!1;n=!0,Lr(ze.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,Po(!1),Lr(ze.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const vm="sesamyAccessToken";let $t=!1;function Cr(){const e=Is();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function hm(e){if(e.enabled===!1){de("Auth disabled via config"),$t=!0;return}e.useHttpCookies?(de("useHttpCookies=true — using cookie-based BFF plugin"),tn(xf())):Is()||(de("No auth plugin registered — falling back to cookie-based BFF plugin"),tn(xf())),await Cr().init(e),$t=!0}async function or(){return $t?Cr().isAuthenticated():!1}async function dr(e=!0,r=!1){return $t?Cr().getTokenSilently(e,r):null}async function pm(){return $t?Cr().getUser():null}async function mm(e){return Cr().login(e)}async function Ps(e){return Cr().loginWithRedirect(e)}async function gm(e){return Cr().loginWithPopup(e)}async function ym(e={}){return Cr().logout(e)}async function Mo(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(vm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>fm),{Events:i}=await Promise.resolve().then(()=>lm);a(i.AUTHENTICATED,{...n,appState:void 0})}const wm=(e,r)=>r.skipDedupe||r.method!=="GET",bm=(e,r)=>r.method+"@"+e,Sm=e=>e.clone(),Im=({skip:e=wm,key:r=bm,resolver:t=Sm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Pm=(e,r)=>e*r,Em=e=>e&&e.ok,Rm=({delayTimer:e=500,delayRamp:r=Pm,maxAttempts:t=10,until:n=Em,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,w;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(w=I&&I.options)!==null&&w!==void 0?w:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Eo=class xv extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,xv)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var nn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(nn||{});const Tm="application/json",Nv="Content-Type",Zr=Symbol(),jv=Symbol();function Nf(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===Nv.toLowerCase()))===null||r===void 0?void 0:r[1]}function jf(e){return/^application\/.*json.*/.test(e)}const xr=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=xr(o,i,t):n[a]=i,n},{...e})},st={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Om(e,r=!1){st.options=r?e:xr(st.options,e)}function Cm(e,r=!1){st.polyfills=r?e:xr(st.polyfills,e)}function _m(e){st.errorType=e}const Am=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let Dv=class extends Error{};const km=e=>{const r=Object.create(null);e=e._addons.reduce((g,w)=>w.beforeRequest&&w.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=xr(a.options,n);let f=t;const v=Am(s)((g,w)=>(f=g,a.polyfill("fetch")(g,w)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var w;if(!g.ok){const y=new Dv;if(y.cause=d,y.stack=y.stack+`
2
- CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((w=g.headers.get("Content-Type"))===null||w===void 0?void 0:w.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then($=>{if(y.message=typeof $=="string"?$:g.statusText,$)if(A&&typeof $=="string"){y.text=$;try{y.json=JSON.parse($)}catch{}}else y[a.errorType]=$;throw y})}return g}),p=g=>g.catch(w=>{const y=Object.prototype.hasOwnProperty.call(w,Zr),A=y?w[Zr]:w,$=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if($)return $(A,e);const j=c.get(jv);if(j)return j(A,e);throw A}),S=g=>w=>p(g?h.then(y=>y&&y[g]()).then(y=>w?w(y):y):h.then(y=>w?w(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,w){return c.set(g,w),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,w)=>({...g,...typeof w.resolver=="function"?w.resolver(g):w.resolver}),R);return o.reduce((g,w)=>w(g,e),I)},qm={_url:"",_options:{},_config:st,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,r=!1){return{...this,_config:{...this._config,polyfills:r?e:xr(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:xr(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:xr(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Nv]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(jv,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=Nf(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||jf(a));return n=t?o?n.json(t,a):n.body(t):n,km(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,r){const t=Nf(this._options.headers);return this.content(r||jf(t)&&t||Tm).body(JSON.stringify(e))}};function sr(e="",r={}){return{...qm,_url:e,_options:r}}sr.default=sr;sr.options=Om;sr.errorType=_m;sr.polyfills=Cm;sr.WretchError=Dv;const $m=(e,r)=>r.skipDedupe||r.method!=="GET",Um=(e,r)=>r.method+"@"+e,Lm=e=>e.clone(),xm=({skip:e=$m,key:r=Um,resolver:t=Lm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Nm=(e,r)=>r.skipCache||r.method!=="GET",jm=(e,r)=>r.method+"@"+e,Dm=()=>!1,Mm=()=>null,Fm=e=>e.ok,Bm=({throttle:e=1e3,skip:r=Nm,key:t=jm,clear:n=Dm,invalidate:a=Mm,condition:i=Fm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Hm=(e,r)=>e*r,Gm=e=>e&&e.ok,Wm=({delayTimer:e=500,delayRamp:r=Hm,maxAttempts:t=10,until:n=Gm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,w;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(w=I&&I.options)!==null&&w!==void 0?w:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Vm="@sesamy/sdk",zm="1.25.0";let Km=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Tt="sesamyCacheTimestamp",Jm=e=>{const{libraryName:r=Vm,libraryVersion:t=zm,cache:n}=e,a=n?.storage||new Km,i=[s=>async(u,c)=>{if(n?.mode===nn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Tt),l||(l=Date.now().toString(),sessionStorage.setItem(Tt,l))):(l=a.get(Tt),l||(l=Date.now().toString(),a.set(Tt,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,{...c,credentials:"include"});const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},xm()];n?.mode===nn.NORMAL&&i.push(Bm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Wm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=sr(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&hr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Eo(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Eo)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Eo(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},hr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Tt),"Cache cleared"),St={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Ro={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Df={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},Mf={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Ym=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Ff=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Ym(e.manageUrl,r)},It={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},To={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},et={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},Oo={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},rt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Co={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},Bf={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Hf={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Gf={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}},checkAccess:async(e,r,t)=>e.request(`/paywalls/${encodeURIComponent(r)}/access`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})},Qm={list:async e=>e.request("/payment-issues")},Xm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Zm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},Wf={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},eg=e=>{const r=Jm(e);return{profile:{get:t=>St.get(r,t),update:(t,n)=>St.update(r,t,n),checkSpotifyLink:()=>St.checkSpotifyLink(r),unlinkSpotify:()=>St.unlinkSpotify(r),delete:()=>St.delete(r)},entitlements:{list:t=>Ro.list(r,t),get:t=>Ro.get(r,t),getAccess:t=>Ro.getAccess(r,t)},subscriptions:{list:()=>Df.list(r),get:t=>Df.get(r,t)},products:{get:t=>Mf.get(r,t),autoOnboard:t=>Mf.autoOnboard(r,t)},contracts:{list:async()=>{const t=await It.list(r),n=await e.tokenProvider();if(!n||!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Ff(i,a))},get:async t=>{const n=await It.get(r,t),a=await e.tokenProvider();if(!a||!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Ff(n,i)},cancel:t=>It.cancel(r,t),createAmendment:(t,n)=>It.createAmendment(r,t,n),confirmAmendment:(t,n)=>It.confirmAmendment(r,t,n)},userMetadata:{get:()=>To.get(r),set:(t,n)=>To.set(r,t,n),delete:t=>To.delete(r,t)},tallies:{list:()=>et.list(r),get:t=>et.get(r,t),update:(t,n)=>et.update(r,t,n),create:t=>et.create(r,t),delete:t=>et.delete(r,t),push:(t,n)=>et.push(r,t,n)},tags:{list:()=>Oo.list(r),add:t=>Oo.add(r,t),remove:t=>Oo.remove(r,t)},checkouts:{generateLink:(t,n)=>rt.generateCheckoutLink(t,n),create:t=>Co.create(r,t),get:t=>Co.get(r,t),update:(t,n)=>Co.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>rt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>rt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>rt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>rt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>rt.generateConsumeLink(t,n)},bills:{list:()=>Bf.list(r),get:t=>Bf.get(r,t)},fulfillments:{list:()=>Hf.list(r),create:t=>Hf.create(r,t)},paywalls:{get:t=>Gf.get(r,t),checkAccess:(t,n)=>Gf.checkAccess(r,t,n)},paymentIssues:{list:()=>Qm.list(r)},proxy:{content:(t,n,a,i)=>Xm.content(r,t,n,a,i)},transactions:{list:t=>Zm.list(r,t)},vendor:{get:()=>Wf.get(r),list:()=>Wf.list(r)}}},rg="sesamy.com",tg="sesamy.dev",ng="https://sesa.my",Vf="sesamyCacheTimestamp",zf="sesamyContentReloaded";class ag{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ig(e,r){return`${e}.${r==="dev"?tg:rg}`}function ir(e,r){return`https://${ig(e,r)}`}function Xt(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Fo(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function Mv(e,r){if(Fo(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Kf(e){return e.endsWith("/")?e.slice(0,-1):e}function Jf(e,r){if(!Fo(e)||!Fo(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Kf(t.pathname)===Kf(n.pathname)}function og(e,r,t){const n=new URL(`${ir("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=Mv(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const Fv="sesamySignedURLs";function Es(){const e=sessionStorage.getItem(Fv);return e?JSON.parse(e):[]}function Yf(e){const r=Es();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(Fv,JSON.stringify(r))}function sg(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Bo="sesamyAttribution";function ug(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function cg(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function an(){return ug(Bo)||{}}function Bv(e){if(e===null)localStorage.removeItem(Bo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=an()??{},t=sg({...r,...cg(e)});localStorage.setItem(Bo,JSON.stringify({value:t}))}}const Rs="@sesamy/sesamy-js",Bt="1.102.0",Hv="sesamyFlags";async function Gv(e){try{localStorage.setItem(Hv,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Wv(e,r){const t=await Ht();t[e]=r,await Gv(t)}async function Vv(e){return(await Ht())[e]}async function zv(e){const r=await Ht();e in r&&(delete r[e],await Gv(r))}async function Ht(){try{const e=localStorage.getItem(Hv);return e?JSON.parse(e):{}}catch{return{}}}function Kv(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function Jv(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function lg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let Me={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"}},Yv=[],Qv=!1,vr;function fg(e){try{const t=new URL(e).pathname.split("/").filter(Boolean);return t[t.length-1]||e}catch{return e}}function Ts(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return Yv.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function dg(){return Ts()}function vg(e,r){Yv=e.content||[];const t=Ts();t&&t.type==="article"&&(Me={...Me,...Jv(t.selectors)},Qv=t.enablePaywallSettingsUrlFallback||!1),vr=r}function hg(e,r){const{selector:t,attribute:n}=r;return t===Me.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Xv(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Xv(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function Ot(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ct=null;function Zv(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function _t(e){const r=Zv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function pg(e){const r=Zv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Ho(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function mg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Ho(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function _o(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function eh(){if(Ct)return Ct;const e=_t("NewsArticle")||_t("Article")||_t("BlogPosting")||_t("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:mg(e?.author)||(Ot("article:author").length>0?Ot("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(_o(e?.keywords),_o(ge("keywords"))),tags:Ot("article:tag").length>0?Ot("article:tag"):void 0,categories:_o(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Ho(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Ho(e.publisher,"logo","url")}:void 0};return Ct=Jv(n),Ct}function gg(){Ct=null}function Os({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function rh(){const e=document.querySelectorAll(Me.article.selector);return Array.from(e).map(Gt).filter(r=>r!==null)}function Gt(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Kv(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=hg(r,o),v=Xv(f,o,l),d=Os({publisherContentId:s,key:lg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",Me.id),n("title",Me.title,t.id),n("excerpt",Me.excerpt,t.id),n("image",Me.image,t.id),n("price",Me.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Me.currency,t.id),n("url",Me.url,t.id),n("pass",Me.pass,t.id,{collect:!0}),n("paywallUrl",Me.paywallUrl,t.id),n("accessLevel",Me.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Ts();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Qv&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=eh(),t}async function yg(e){const r=Gt(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await vr.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await vr.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await vr.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");const t=await vr.entitlements.hasAccess(r.url,r.pass?.split(",")||[]);if(t)return t;if(r.paywallUrl){const n=fg(r.paywallUrl),a=await vr.paywalls.checkAccess(n,{articleId:r.id||r.url,url:r.url});if(a.status==="allowed")return{id:"leaky-paywall",sku:"",url:a.signedLink,token:new URL(a.signedLink).searchParams.get("sesamy_token")||void 0,hasAccess:!0}}return null}async function th(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Gt(t);if(!n?.url)throw new Error("Could not find content for element");const a=await vr.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");let i;if(a.token)i=a.token;else{const s=await vr.entitlements.access(a.id);if(!s.token)throw new Error("Could not get access token");i=s.token}const o=r||Kv(t.parentElement||t);return vr.proxy.getContent(i,n.url,o)}function nh(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function wg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function bg(e){const r=e.endpoint??ir("api2",e.environment),n=eg({baseUrl:r,tokenProvider:async()=>{if(await or())try{const L=await dr(!1);return L?`Bearer ${L}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:Rs,libraryVersion:Bt,vendorId:e.vendorId,cache:{mode:nn.BROWSER,storage:new ag}}),a=m=>async(C,L)=>{let F=sessionStorage.getItem(Vf);F||(F=Date.now().toString(),sessionStorage.setItem(Vf,F));const b={...L,headers:{...L.headers,"Cache-Timestamp":F}};return m(C,b)},i=(m=!0)=>C=>async(L,F)=>{const b=await dr(m);if(!b){if(await or()){const k={...F,credentials:"include"};return C(L,k)}if(m)throw new Error("No access token available");return C(L,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${b}`}};return C(L,T)},o=sr(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),Im(),Rm({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:L=!0}=m,F=await or()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return L&&F.push(...Es()),F}async function u(m,C=[]){return(await s())?.find(b=>{if(m){const{sku:T,purchaseOption:k}=Mv(m);if("sku"in b&&T===b.sku||k&&"purchaseOptionsId"in b&&k===b.purchaseOptionsId||Jf(m,b.url))return!0}return!!C.some(T=>Jf(T,b.url))})}async function c(m,C,L){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),L&&F.searchParams.set("selector",L),sr(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await or()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(L=>L.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return hr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return Lr(ze.USER_ATTRIBUTE_CHANGED,{}),hr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const L of m)C[L.id]=L.value;return C}async function g(m){return await n.tallies.delete(m)}async function w(m,C){return await n.tallies.push(m,C)}async function y(){return!await dr(!1)&&!await or()?null:await o.url("/profile").get().json()}async function A(m){const C=await o.url("/profile").patch(m).res();return hr(),C.ok}async function $(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function G(m){const C=await dr(!1);if(!C)throw new Error("No access token available");const L=new URL(`${ir("access-sync",e.environment)}/spotify/sesamy-callback`);L.searchParams.set("access_token",C),L.searchParams.set("state",m),window.location.href=L.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&hr(),C}async function re(m,C=3600){const{shortlink:L}=await sr(ng).post({url:m,ttl:C}).json();return L}async function x(m){const C=await dr(!1,!0);let L;const F=m.language||Xt(),b=an();switch(m.target){case"account":L=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":L=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":L=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":L=new URL(`${ir("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?L.href+=`/${m.episodeId}`:L.href+="/listen",L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":L=og(e,{language:F,...m},b);break;default:throw new Error("Invalid target")}return C&&(L.hash=`#access_token=${C}`),m.shorten?re(L.href,m.ttl):L.href}async function M(){const m=await dr(!1),C=new URL(`${ir("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function N(m){const C=an(),L=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[b,T]=F.trim().split("=");L.includes(b)&&!C[b]&&(C[b]=T)}),n.checkouts.create({language:Xt(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:rh,get:Gt,getLanguage:Xt,unlock:th,getPropertyFromHTML:Os},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:Vv,set:Wv,list:Ht,delete:zv},generateLink:x,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:$,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:w,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function Qf(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var Sg="function",Ig="string",er="undefined",Pg="boolean",on="object",Eg="array",Rg="number",Tg="symbol",Og="null",Go=function(){},ah="any",ih="*",Fr="__",Cg="form",_g="input",Ag="button",kg="select",sn=typeof process!==er?process:{};sn.env&&sn.env.NODE_ENV;var _e=typeof document!==er;sn.versions!=null&&sn.versions.node!=null;typeof Deno!==er&&Deno.core;_e&&window.name==="nodejs"||typeof navigator!==er&&typeof navigator.userAgent!==er&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function oh(e,r){return r.charAt(0)[e]()+r.slice(1)}var qg=oh.bind(null,"toUpperCase"),$g=oh.bind(null,"toLowerCase");function Ug(e){return sh(e)?qg(Og):typeof e===on?jg(e):Object.prototype.toString.call(e).slice(8,-1)}function un(e,r){r===void 0&&(r=!0);var t=Ug(e);return r?$g(t):t}function Wt(e,r){return typeof r===e}var Be=Wt.bind(null,Sg),Tr=Wt.bind(null,Ig),tt=Wt.bind(null,er),Lg=Wt.bind(null,Pg);Wt.bind(null,Tg);function sh(e){return e===null}function xg(e){return un(e)===Rg&&!isNaN(e)}function uh(e){return un(e)===Eg}function Fe(e){if(!Ng(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ng(e){return e&&(typeof e===on||e!==null)}function jg(e){return Be(e.constructor)?e.constructor.name:null}function Dg(e){return e instanceof Error||Tr(e.message)&&e.constructor&&xg(e.constructor.stackTraceLimit)}function ch(e,r){if(typeof r!="object"||sh(r))return!1;if(r instanceof e)return!0;var t=un(new e(""));if(Dg(r))for(;r;){if(un(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}ch.bind(null,TypeError);ch.bind(null,SyntaxError);function On(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?Mg(e,r):t}function Mg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function Cn(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}Cn(On,Cg);Cn(On,Ag);Cn(On,_g);Cn(On,kg);function Fg(e){return e?uh(e)?e:[e]:[]}function Xf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Bg(){if(_e){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Hg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Gg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=Xf(t[1]),o=Xf(t[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 c=u.split("[");c.length>1&&(Wg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return _e&&window.location.search.substring(1)})())}function Wg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function _n(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Vg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",ut=Fr+Nr+Fr,ct=typeof self===on&&self.self===self&&self||typeof global===on&&global[Nr]===global&&global||void 0;function Br(e){return ct[ut][e]}function Hr(e,r){return ct[ut][e]=r}function mt(e){delete ct[ut][e]}function gt(e,r,t){var n;try{if(Cs(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}ct[ut]||(ct[ut]={});var Vt={};function Cs(e){if(typeof Vt[e]!==er)return Vt[e];try{var r=window[e];r.setItem(er,er),r.removeItem(er)}catch{return Vt[e]=!1}return Vt[e]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ee.apply(null,arguments)}var Er="function",pr="undefined",kt="reducer",lh="@@redux/",Wo=lh+"INIT",zg=lh+Math.random().toString(36),Zf=(function(){return typeof Symbol===Er&&Symbol.observable||"@@observable"})(),zt=" != "+Er;function fh(e,r,t){var n;if(typeof r===Er&&typeof t===pr&&(t=r,r=void 0),typeof t!==pr){if(typeof t!==Er)throw new Error("enhancer"+zt);return t(fh)(e,r)}if(typeof e!==Er)throw new Error(kt+zt);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Er)throw new Error("Listener"+zt);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===pr)throw new Error("ActType "+pr);if(u)throw new Error("Dispatch in "+kt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:Wo}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Er)throw new Error("next "+kt+zt);a=d,v({type:Wo})}})[Zf]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[Zf]=function(){return this},d},n}function Kg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+kt+" "+e+" returns "+pr}function lt(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function Jg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),ee({},o,{dispatch:s=lt.apply(void 0,i)(o.dispatch)})}}}var Or=Fr+"anon_id",jr=Fr+"user_id",at=Fr+"user_traits",Vo="analytics",Pr="userId",nt="anonymousId",Zt=["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"],zo=["name","EVENTS","config","loaded"],Z=Zt.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),ed=/^utm_/,rd=/^an_prop_/,td=/^an_trait_/;function Yg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===Z.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Or,o.anonymousId),c||r(jr,o.userId),u.traits&&r(at,ee({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(ed)||p.match(/^(d|g)clid/)){var S=p.replace(ed,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(rd)&&(h.props[p.replace(rd,"")]=i[p]),p.match(td)&&(h.traits[p.replace(td,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(ee({type:Z.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:Z.campaign,campaign:d.campaign})}}return n(a)}}}}function Qg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===Z.setItemEnd){if(t.key===Or)return ee({},r,{anonymousId:t.value});if(t.key===jr)return ee({},r,{userId:t.value})}switch(t.type){case Z.identify:return Object.assign({},r,{userId:t.userId,traits:ee({},r.traits,t.traits)});case Z.reset:return[jr,Or,at].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function nd(e){return{userId:e.getItem(jr),anonymousId:e.getItem(Or),traits:e.getItem(at)}}var Ko=function(e){return Fr+"TEMP"+Fr+e};function Xg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===Z.reset&&([jr,at,Or].forEach(function(d){n(d)}),[Pr,nt,"traits"].forEach(function(d){mt(Ko(d))})),s.type===Z.identify){a(Or)||t(Or,_n());var f=a(jr),v=a(at)||{};f&&f!==u&&i.dispatch({type:Z.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(jr,u),c&&t(at,ee({},v,c))}return o(s)}}}}var At={};function ad(e,r){At[e]&&Be(At[e])&&(At[e](r),delete At[e])}function dh(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(ee({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return dh(e,r,t-10).then(n,a)})})}function Zg(e){return{abort:e}}function vh(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Be(p)){var S,R=(function(w,y){return w===void 0&&(w={}),y===void 0&&(y={}),[Pr,nt].reduce(function(A,$){return w.hasOwnProperty($)&&y[$]&&y[$]!==w[$]&&(A[$]=y[$]),A},w)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Zg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(ee({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var Ao=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(it),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,w){var y=g.config,A=g.name,$=A+"."+I.type;w&&($=w.event);var j=I.type.match(it)?(function(G,K,re,x,M){return function(N,m){var C=x?x.name:G,L=m&&Ut(m)?m:re;if(x&&(!(L=m&&Ut(m)?m:[G]).includes(G)||L.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(L)+" input valid");return ee({},M,{abort:{reason:N,plugins:L,caller:K,_:C}})}})(A,$,R,w,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,$);return{payload:ey(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,w=!1;return g.match(/^initialize/)||g.match(/^reset/)||(w=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(w=!0),S[""+I]=w,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(w){function y(){return Promise.resolve(w)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function($,j,G){return Promise.resolve($).then(function(K){return j.method&&Be(j.method)?((function(N,m){var C=fd(N);if(C&&C.name===m){var L=fd(C.method);throw new Error([m+" plugin is calling method "+N,"Plugins cant call self","Use "+C.method+" "+(L?"or "+L.method:"")+" in "+m+" plugin insteadof "+N].join(`
3
- `))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,x=g,M=j.pluginName,function(N,m){return ee({},re,{abort:{reason:N,plugins:m||[x],caller:f,from:M||x}})}),config:sd(j.pluginName,c,i),plugins:c})).then(function(N){var m=Fe(N)?N:{};return Promise.resolve(ee({},K,m))})):K;var re,x,M})},Promise.resolve(t))).then(function($){w[g]=$});w[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var w=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function($){var j=S[y]?S[y]:{};if(v&&(j=$),qo(j,y))return ko({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve($);if(qo($,y))return w&&ko({data:$,method:f,instance:n,store:s}),Promise.resolve($);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve($);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:sd(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},x=ee({},$,re),M=S[y];if(qo(M,y))ko({data:M,method:f,instance:n,pluginName:y,store:s});else{var N=f+":"+y;(N.match(/:/g)||[]).length<2&&!f.match(id)&&!f.match(od)&&n.dispatch(ee({},v?x:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(x)})})}catch($){return Promise.reject($)}},Promise.resolve(t))).then(function(R){if(!(f.match(it)||f.match(/^registerPlugin/)||f.match(od)||f.match(id)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=ee({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});hh(R,r.exact.length)&&!f.match(/End$/)&&(I=ee({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},it=/Start$/,id=/^bootstrap/,od=/^ready/;function ko(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(ee({},e.data,{type:t,_:{called:t,from:"abort"}}))}function sd(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function ud(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function cd(e,r){var t=e.replace(it,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function qo(e,r){var t=e.abort;return!!t&&(t===!0||ld(t,r)||t&&ld(t.plugins,r))}function hh(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Tr(t))return!0;var n=t.plugins;return Ut(t)&&t.length===r||Ut(n)&&n.length===r}function Ut(e){return Array.isArray(e)}function ld(e,r){return!(!e||!Ut(e))&&e.includes(r)}function fd(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function ey(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function ry(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(w){return s?w:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===Z.enablePlugin&&a.dispatch({type:Z.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===Z.disablePlugin&&setTimeout(function(){return ad(o.meta.rid,{payload:o})},0),c===Z.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(w){return l.includes(w)}).map(function(w){return v[w]}),p=[],S=[],R=o.disabled,I=h.map(function(w){var y=w.loaded,A=w.name,$=w.config;return dh(w,function(){return y({config:$})},1e4).then(function(j){return n[A]||(a.dispatch({type:Z.pluginReadyType(A),name:A,events:Object.keys(w).filter(function(G){return!zo.includes(G)})}),n[A]=!0),p=p.concat(A),w}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(w){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(ee({},{type:Z.ready},y))},0)})}var g=(function(){if(c!==Z.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return vh(a,r,e)},0),Promise.resolve((function(w,y,A,$,j){try{var G=Be(y)?y():y,K=w.type,re=K.replace(it,"");if(w._&&w._.called)return Promise.resolve(w);var x=A.getState(),M=(C=G,(L=x.plugins)===void 0&&(L={}),(F=w.options)===void 0&&(F={}),Object.keys(C).filter(function(b){var T=F.plugins||{};return Lg(T[b])?T[b]:T.all!==!1&&(!L[b]||L[b].enabled!==!1)}).map(function(b){return C[b]}));K===Z.initializeStart&&w.fromEnable&&(M=Object.keys(x.plugins).filter(function(b){var T=x.plugins[b];return w.plugins.includes(b)&&!T.initialized}).map(function(b){return G[b]}));var N=M.map(function(b){return b.name}),m=(function(b,T){var k=cd(b).map(function(H){return ud(H,T)});return T.reduce(function(H,J){var Y=J.name,le=cd(b,Y).map(function(Re){return ud(Re,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[Y]=ne),ue.length&&(H.duringNS[Y]=ue),ae.length&&(H.afterNS[Y]=ae),H},{before:k[0],beforeNS:{},during:k[1],duringNS:{},after:k[2],afterNS:{}})})(K,M);return Promise.resolve(Ao({action:w,data:{exact:m.before,namespaced:m.beforeNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(b){function T(){var J=(function(){if(K.match(it))return Promise.resolve(Ao({action:ee({},k,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(Y){Y.meta&&Y.meta.hasCallback&&ad(Y.meta.rid,{payload:Y})})})();return J&&J.then?J.then(function(){return b}):b}if(hh(b,N.length))return b;var k,H=(function(){if(K!==re)return Promise.resolve(Ao({action:ee({},b,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(J){k=J});k=b})();return H&&H.then?H.then(T):T()})}catch(b){return Promise.reject(b)}var C,L,F})(o,r,e,a,t)).then(function(w){var y=i(w);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(w){return Promise.reject(w)}}}}}function ty(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Z.setItem||a===Z.removeItem){if(n.abort)return t(n);a===Z.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ny=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return lt.apply(void 0,o)(n)(a)}}}}};function ay(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=dd(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=dd(t.type,Z.initialize),c=e()[u];return c&&u?(n[u]=ee({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),ee({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=ee({},r[t.name],{loaded:!0}),ee({},r,n);switch(t.type){case Z.disablePlugin:return ee({},r,vd(t.plugins,!1,r));case Z.enablePlugin:return ee({},r,vd(t.plugins,!0,r));default:return r}}}function dd(e,r){return e.substring(r.length+1,e.length)}function vd(e,r,t){return e.reduce(function(n,a){return n[a]=ee({},t[a],{enabled:r}),n},t)}function ph(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var iy={last:{},history:[]};function oy(e,r){e===void 0&&(e=iy);var t=r.options,n=r.meta;if(r.type===Z.track){var a=ph(ee({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return ee({},e,{last:a,history:e.history.concat(a)})}return e}var sy={actions:[]};function uy(e,r){e===void 0&&(e=sy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===Z.identify?[r].concat(e.actions):e.actions.concat(r),ee({},e,{actions:n});case"dequeue":return[];default:return e}}var mh=/#.*$/;function cy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(mh,""):"")}var gh,yh,wh,bh,ly=function(e){if(e===void 0&&(e={}),!_e)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(_e){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(mh,"")})(c),f={title:t,url:l,path:cy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,e)},fy={last:{},history:[]};function dy(e,r){e===void 0&&(e=fy);var t=r.options;if(r.type===Z.page){var n=ph(ee({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return ee({},e,{last:n,history:e.history.concat(n)})}return e}gh=(function(){if(!_e)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),yh=_e?document.referrer:null,wh=Bg(),bh=Hg();var hd={initialized:!1,sessionId:_n(),app:null,version:null,debug:!1,offline:!!_e&&!navigator.onLine,os:{name:gh},userAgent:_e?navigator.userAgent:"node",library:{name:Vo,version:"0.13.1"},timezone:bh,locale:wh,campaign:{},referrer:yh};function vy(e,r){e===void 0&&(e=hd);var t=e.initialized,n=r.campaign;switch(r.type){case Z.campaign:return ee({},e,{campaign:n});case Z.offline:return ee({},e,{offline:!0});case Z.online:return ee({},e,{offline:!1});default:return t?e:ee({},hd,e,{initialized:!0})}}var hy=["plugins","reducers","storage"];function py(e,r,t){if(_e){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function my(e){var r=py.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function Sh(){return Hr(Vo,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return ct[ut][Vo].push(o.action||o),i(o)}})}}}function pd(e){return function(){return lt(lt.apply(null,arguments),Sh())}}function $o(e){return e?uh(e)?e:[e]:[]}function md(e,r,t){e===void 0&&(e={});var n,a,i=_n();return r&&(At[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Be(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),ee({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function gy(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(b,T){if(Be(T))return b.middlewares=b.middlewares.concat(T),b;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var k=T.EVENTS?Object.keys(T.EVENTS).map(function(Y){return T.EVENTS[Y]}):[];b.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(b.methods[T.name]=Object.keys(T.methods).reduce(function(Y,le){var ne;return Y[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),Re=0;Re<ue.length;Re++)ae[Re]=ue[Re];return ae[ae.length]=y,ne.apply({instance:y},ae)}),Y},{}),delete T.methods);var H=Object.keys(T).concat(k),J=new Set(b.events.concat(H));if(b.events=Array.from(J),b.pluginsArray=b.pluginsArray.concat(T),b.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return b.plugins[T.name]=T,b.plugins[T.name].loaded||(b.plugins[T.name].loaded=function(){return!0}),b},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:Br,setItem:Hr,removeItem:mt},i=(function(b){return function(T,k,H){return k.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:nd(b)[T]||Br(Ko(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(b){return!zo.includes(b)}).sort(),u=new Set(s.concat(Zt).filter(function(b){return!zo.includes(b)})),c=Array.from(u).sort(),l=function(){return o},f=new ny,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Gg(),R=nd(a),I=ee({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=_n());var g=ee({enable:function(b,T){return new Promise(function(k){m.dispatch({type:Z.enablePlugin,plugins:$o(b),_:{originalAction:Z.enablePlugin}},k,[T])})},disable:function(b,T){return new Promise(function(k){m.dispatch({type:Z.disablePlugin,plugins:$o(b),_:{originalAction:Z.disablePlugin}},k,[T])})}},n.methods),w=!1,y={identify:function(b,T,k,H){try{var J=Tr(b)?b:null,Y=Fe(b)?b:T,le=k||{},ne=y.user();Hr(Ko(Pr),J);var ue=J||Y.userId||i(Pr,y,Y);return Promise.resolve(new Promise(function(ae){m.dispatch(ee({type:Z.identifyStart,userId:ue,traits:Y||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==J&&{previousId:ne.id}),ae,[T,k,H])}))}catch(ae){return Promise.reject(ae)}},track:function(b,T,k,H){try{var J=Fe(b)?b.event:b;if(!J||!Tr(J))throw new Error("EventMissing");var Y=Fe(b)?b:T||{},le=Fe(k)?k:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:Z.trackStart,event:J,properties:Y,options:le,userId:i(Pr,y,T),anonymousId:i(nt,y,T)},ne,[T,k,H])}))}catch(ne){return Promise.reject(ne)}},page:function(b,T,k){try{var H=Fe(b)?b:{},J=Fe(T)?T:{};return Promise.resolve(new Promise(function(Y){m.dispatch({type:Z.pageStart,properties:ly(H),options:J,userId:i(Pr,y,H),anonymousId:i(nt,y,H)},Y,[b,T,k])}))}catch(Y){return Promise.reject(Y)}},user:function(b){if(b===Pr||b==="id")return i(Pr,y);if(b===nt||b==="anonId")return i(nt,y);var T=y.getState("user");return b?Qf(T,b):T},reset:function(b){return new Promise(function(T){m.dispatch({type:Z.resetStart},T,b)})},ready:function(b){return w&&b({plugins:g,instance:y}),y.on(Z.ready,function(T){b&&b(T),w=!0})},on:function(b,T){if(!b||!Be(T))return!1;if(b===Z.bootstrap)throw new Error(".on disabled for "+b);var k=/Start$|Start:/;if(b==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(k)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},J=function(ne){return function(ue){return function(ae){return ae.type.match(k)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,Kt),v(J,Jt),function(){d(H,Kt),d(J,Jt)}}var Y=b.match(k)?Kt:Jt,le=function(ne){return function(ue){return function(ae){return ae.type===b&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,Y),function(){return d(le,Y)}},once:function(b,T){if(!b||!Be(T))return!1;if(b===Z.bootstrap)throw new Error(".once disabled for "+b);var k=y.on(b,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),k()});return k},getState:function(b){var T=m.getState();return b?Qf(T,b):Object.assign({},T)},dispatch:function(b){var T=Tr(b)?{type:b}:b;if(Zt.includes(T.type))throw new Error("reserved action "+T.type);var k=ee({},T,{_:ee({originalAction:T.type},b._||{})});m.dispatch(k)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(b,T,k){m.dispatch({type:Z.setItemStart,key:b,value:T,options:k})},removeItem:function(b,T){m.dispatch({type:Z.removeItemStart,key:b,options:T})}},setAnonymousId:function(b,T){y.storage.setItem(Or,b,T)},events:{core:Zt,plugins:s}},A=n.middlewares.concat([function(b){return function(T){return function(k){return k.meta||(k.meta=md()),T(k)}}},h(Kt),ry(y,l,{all:c,plugins:s}),ty(a),Yg(y),Xg(y),h(Jt)]),$={context:vy,user:Qg(a),page:dy,track:oy,plugins:ay(l),queue:uy},j=lt,G=lt;if(_e&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?Sh():Fe(typeof arguments[0])?pd():pd().apply(null,arguments)}}var re,x=(function(b){return Object.keys(b).reduce(function(T,k){return hy.includes(k)||(T[k]=b[k]),T},{})})(e),M=n.pluginsArray.reduce(function(b,T){var k=T.name,H=T.config,J=T.loaded,Y=n.pluginEnabled[k];return b[k]={enabled:Y,initialized:!!Y&&!T.initialize,loaded:!!J({config:H}),config:H},b},{}),N={context:x,user:I,plugins:M},m=fh((function(b){for(var T=Object.keys(b),k={},H=0;H<T.length;H++){var J=T[H];typeof b[J]===Er&&(k[J]=b[J])}var Y,le=Object.keys(k);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:Wo})===pr||typeof ae(void 0,{type:zg})===pr)throw new Error(kt+" "+ue+" "+pr)})})(k)}catch(ne){Y=ne}return function(ne,ue){if(ne===void 0&&(ne={}),Y)throw Y;for(var ae=!1,Re={},xe=0;xe<le.length;xe++){var je=le[xe],$e=ne[je],Xe=(0,k[je])($e,ue);if(typeof Xe===pr){var Sr=Kg(je,ue);throw new Error(Sr)}Re[je]=Xe,ae=ae||Xe!==$e}return ae?Re:ne}})(ee({},$,r)),N,G(j(Jg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(b,T,k){var H=ee({},b,{meta:md(b.meta,T,$o(k))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:Z.bootstrap,plugins:C,config:x,params:S,user:I,initialUser:t,persistedUser:R});var L=C.filter(function(b){return n.pluginEnabled[b]}),F=C.filter(function(b){return!n.pluginEnabled[b]});return m.dispatch({type:Z.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(b,T){var k=b.bootstrap,H=b.config,J=b.name;k&&Be(k)&&k({instance:y,config:H,payload:b}),m.dispatch({type:Z.registerPluginType(J),name:J,enabled:n.pluginEnabled[J],plugin:b}),n.pluginsArray.length===T+1&&m.dispatch({type:Z.initializeStart,plugins:L,disabled:F})}),my(function(b){m.dispatch({type:b?Z.offline:Z.online})}),(function(b,T,k){setInterval(function(){return vh(b,T,k)},3e3)})(m,l,y),y}var Kt="before",Jt="after",Dr="cookie",Ur=Eh(),Ih=An,yy=An;function Ph(e){return Ur?An(e,"",-1):mt(e)}function Eh(){if(Ur!==void 0)return Ur;var e=Dr+Dr;try{An(e,e),Ur=document.cookie.indexOf(e)!==-1,Ph(e)}catch{Ur=!1}return Ur}function An(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ur===!1&&(o?Hr(e,r):Br(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var mr="localStorage",wy=Cs.bind(null,mr);gt(mr,"getItem",Br);gt(mr,"setItem",Hr);gt(mr,"removeItem",mt);var gr="sessionStorage",by=Cs.bind(null,gr);gt(gr,"getItem",Br);gt(gr,"setItem",Hr);gt(gr,"removeItem",mt);function ot(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var Sy=wy(),Iy=by(),Py=Eh();function Mr(e,r){if(e){var t=_s(r),n=!$s(t),a=As(t)?ot(localStorage.getItem(e)):void 0;if(n&&!tt(a))return a;var i=ks(t)?ot(Ih(e)):void 0;if(n&&i)return i;var o=qs(t)?ot(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=Br(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function cn(e,r,t){if(e&&!tt(r)){var n={},a=_s(t),i=JSON.stringify(r),o=!$s(a);return As(a)&&(n[mr]=Yt(mr,r,ot(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[mr]:ks(a)&&(n[Dr]=Yt(Dr,r,ot(Ih(e))),yy(e,i),o)?n[Dr]:qs(a)&&(n[gr]=Yt(gr,r,ot(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[gr]:(n[Nr]=Yt(Nr,r,Br(e)),Hr(e,r),o?n[Nr]:n)}}function Ey(e,r){if(e){var t=_s(r),n=Mr(e,ih),a={};return!tt(n.localStorage)&&As(t)&&(localStorage.removeItem(e),a[mr]=n.localStorage),!tt(n.cookie)&&ks(t)&&(Ph(e),a[Dr]=n.cookie),!tt(n.sessionStorage)&&qs(t)&&(sessionStorage.removeItem(e),a[gr]=n.sessionStorage),!tt(n.global)&&kn(t,Nr)&&(mt(e),a[Nr]=n.global),a}}function _s(e){return e?Tr(e)?e:e.storage:ah}function As(e){return Sy&&kn(e,mr)}function ks(e){return Py&&kn(e,Dr)}function qs(e){return Iy&&kn(e,gr)}function $s(e){return e===ih||e==="all"}function kn(e,r){return e===ah||e===r||$s(e)}function Yt(e,r,t){return{location:e,current:r,previous:t}}var Ry={setItem:cn,getItem:Mr,removeItem:Ey};function Ty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function gd(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function yd(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?gd(Object(t),!0).forEach(function(n){Ty(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gd(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Oy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Ry};return gy(yd(yd({},r),e))}function Cy(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=Ay(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function _y(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function Ay(e){return["#","?"].forEach(r=>e=_y(e,r)),e}function ky(){Cy(()=>{fr.page()})}var Uo="up",Lo="down";function qy(e){if(e===void 0&&(e={}),!_e)return Go;var r=bd(),t=Jo(),n=wd(),a=Qt(n,r),i=Qt(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Go;var d=v.map(function(p){return Number(p)}),h=Vg(function(){var p=bd(),S=(function(x,M){return M.map(function(N){return N===100?x-5:x*(N/100)})})(p,d),R=Jo(),I=wd(),g=Qt(I,p),w=Qt(R,p);if(l=g>l?g:l,f=w<f?w:f,!(o.length>=d.length)){var y=c===I,A=Uo;y?A="initial":c<=I&&(A=Lo);var $=S,j=d;(A===Uo||y)&&($=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(x,M,N){var m=$[N];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),x.singleFunction=M),A===Lo&&!o.includes(M)&&I>=m&&M>i?(s.push(M),x.callbacks=x.callbacks.concat(M),x):A===Uo&&!o.includes(M)&&I<=m&&M<=g?(x.foundFunc=[M],x):(y&&I>=m&&x.foundFunc.length===0&&(x.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),x.singleFunction?u.push(M):x.singleFunction=M),x)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===Lo&&G.callbacks&&G.callbacks.forEach(function(x){Be(e[x])&&(e[x]({trigger:x,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(x))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Be(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function Jo(){return _e?document.body.scrollTop||document.documentElement.scrollTop:0}function $y(){return _e?window.innerHeight||document.documentElement.clientHeight:0}function wd(){return Math.round(Jo()+$y())}function bd(){if(!_e)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Qt(e,r){return Math.round(e/r*100)}var Us="Event",Sd=Us+"Listener";function Uy(e){return function(r,t,n,a){var i=n||Go,o=a||!1;if(!_e)return i;var s=ln(t),u=ln(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+Us);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+Sd:"remove"+Sd,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?Ly(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function ln(e,r){if(Tr(e))return r?ln(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Fg(e);return r?i.map(function(o){return Tr(o)?ln(o,!0):o}).flat():i}function Ly(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var xo=Uy(Us);function Rh(e,r){return _e&&Be(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Be(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}Rh.bind(null,"onerror");Rh.bind(null,"onload");var Th=typeof window>"u",Id="hidden";function xy(e){if(Th)return!1;var r=Ny(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ny(){var e=["webkit","moz","ms","o"];return Th||Id in document?Id:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var jy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Dy(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=xy(function(s){s||t({type:"tabVisible"})});return n=[o].concat(jy.map(function(s){return xo(document,s,t)})).concat(xo(window,"load",t)).concat(xo(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function My(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Pt(v),S),a&&l&&(l=!1,a(Pt(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Pt(v),S))},s)}var p=Dy(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Pt(v,f),idle:l?Pt(t,f):0}}}}function Pt(e,r){return r?0:Math.round((new Date-e)/1e3)}const Pd=5e3;class Fy{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),My({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:Pd}),qy({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(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*Pd:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Oh(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function By(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const Ed="sesamy_session_id";function Hy(){let e=sessionStorage.getItem(Ed);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Ed,e)),e}let Ch=!1,en,fn,Yo;function _h(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:Yo,requestId:Math.random().toString(36).slice(2,9),sessionId:Hy(),timestamp:new Date().toISOString(),version:Bt,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:Rs,userAgent:navigator.userAgent,clientId:Yo}}}))}const Ah=By(async e=>{if(e.length>0){const r=_h(e);Ch?navigator.sendBeacon(fn,r):(await fetch(fn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function No(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(fn,_h([r]))}else Ah.push(e)}function Gy(){return Ch=!0,Ah.flush()}function Wy(e,r,t){en=r,fn=`${ir("logs",t)}/events`,Yo=e}const Vy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;No({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;No({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n}=e;No({anonymousId:t,userId:n,properties:r,type:"identify"})}},Rd=["source","medium","campaign","term","content"],Rr="utm_",zy=1800*1e3;function kh(e){return e?Date.now()-parseInt(e,10)>zy:!0}function Td(){const e=document.referrer||"";if(!e)return;const r=Mr(`${Rr}set_at`);(kh(r)||!Mr(`${Rr}referrer`))&&cn(`${Rr}referrer`,e)}function Ky(){const e=()=>{const t={};for(const a of Rd){const i=Mr(`${Rr}${a}`);i&&(t[`utm_${a}`]=i)}const n=Mr(`${Rr}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){Td()},campaign({payload:t}){const n=t?.campaign||{},a=Mr(`${Rr}set_at`);if(Object.keys(n).length>0&&kh(a)){for(const o of Rd){const s=n[o];s&&cn(`${Rr}${o}`,s)}cn(`${Rr}set_at`,String(Date.now()))}Td()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const Jy=Ky(),Od=new Map,Cd=new Map;function Yy({clientId:e,enabled:r=!0,environment:t}){Wy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{Cd.forEach((n,a)=>{n.bind(a)()}),Gy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Od.forEach((n,a)=>{n.bind(a)()})}),ky(),Oh(()=>{const n=new Fy({element:document.body,viewCallback:()=>{fr.page()},activeDurationCallback:(a,i,o)=>{fr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{fr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{fr.track("scroll",{scroll:a.scrollMax})}});Cd.set(document.body,()=>{n.flush()}),Od.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(ze.AUTHENTICATED,async n=>{const a=n;await fr.identify(a.detail.sub)}),window.addEventListener(ze.LOGOUT,async()=>{await fr.track("logout",{}),await fr.reset()}))}const fr=Oy({app:Rs,version:Bt,plugins:[Jy,Vy]});function qh(e,r){fr.track(e,r)}const Qy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function $h(){return new Promise(e=>{const r=Qy.map(t=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function Uh(){const e=navigator.userAgent.toLowerCase(),r=[{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 t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vs={},jn,zs;function Ae(){return zs||(zs=1,jn=function(e){try{return!!e()}catch{return!0}}),jn}var Dn,Ks;function vn(){if(Ks)return Dn;Ks=1;var e=Ae();return Dn=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),Dn}var Mn,Js;function pe(){if(Js)return Mn;Js=1;var e=vn(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Mn=e?n:function(a){return function(){return t.apply(a,arguments)}},Mn}var Fn,Ys;function hn(){if(Ys)return Fn;Ys=1;var e=pe(),r=e({}.toString),t=e("".slice);return Fn=function(n){return t(r(n),8,-1)},Fn}var Bn,Qs;function Vd(){if(Qs)return Bn;Qs=1;var e=pe(),r=Ae(),t=hn(),n=Object,a=e("".split);return Bn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,Bn}var Hn,Xs;function pn(){return Xs||(Xs=1,Hn=function(e){return e==null}),Hn}var Gn,Zs;function mn(){if(Zs)return Gn;Zs=1;var e=pn(),r=TypeError;return Gn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Gn}var Wn,eu;function Ut(){if(eu)return Wn;eu=1;var e=Vd(),r=mn();return Wn=function(t){return e(r(t))},Wn}var bt,ru;function me(){if(ru)return bt;ru=1;var e=function(r){return r&&r.Math===Math&&r};return bt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof Ws=="object"&&Ws)||e(typeof bt=="object"&&bt)||(function(){return this})()||Function("return this")(),bt}var Vn={exports:{}},zn,tu;function ur(){return tu||(tu=1,zn=!1),zn}var Kn,nu;function is(){if(nu)return Kn;nu=1;var e=me(),r=Object.defineProperty;return Kn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},Kn}var au;function os(){if(au)return Vn.exports;au=1;var e=ur(),r=me(),t=is(),n="__core-js_shared__",a=Vn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"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"}),Vn.exports}var Jn,iu;function zd(){if(iu)return Jn;iu=1;var e=os();return Jn=function(r,t){return e[r]||(e[r]=t||{})},Jn}var Yn,ou;function gn(){if(ou)return Yn;ou=1;var e=mn(),r=Object;return Yn=function(t){return r(e(t))},Yn}var Qn,su;function Ke(){if(su)return Qn;su=1;var e=pe(),r=gn(),t=e({}.hasOwnProperty);return Qn=Object.hasOwn||function(a,i){return t(r(a),i)},Qn}var Xn,uu;function Kd(){if(uu)return Xn;uu=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Xn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Xn}var Zn,cu;function xt(){if(cu)return Zn;cu=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Zn=t?String(t):"",Zn}var ea,lu;function Jd(){if(lu)return ea;lu=1;var e=me(),r=xt(),t=e.process,n=e.Deno,a=t&&t.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&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ea=s,ea}var ra,fu;function Yd(){if(fu)return ra;fu=1;var e=Jd(),r=Ae(),t=me(),n=t.String;return ra=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),ra}var ta,du;function Qd(){if(du)return ta;du=1;var e=Yd();return ta=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ta}var na,vu;function ke(){if(vu)return na;vu=1;var e=me(),r=zd(),t=Ke(),n=Kd(),a=Yd(),i=Qd(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return na=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},na}var aa,hu;function be(){if(hu)return aa;hu=1;var e=typeof document=="object"&&document.all;return aa=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},aa}var ia,pu;function Je(){if(pu)return ia;pu=1;var e=be();return ia=function(r){return typeof r=="object"?r!==null:e(r)},ia}var oa,mu;function rr(){if(mu)return oa;mu=1;var e=Je(),r=String,t=TypeError;return oa=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},oa}var sa={},ua,gu;function qe(){if(gu)return ua;gu=1;var e=Ae();return ua=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ua}var ca,yu;function Xd(){if(yu)return ca;yu=1;var e=qe(),r=Ae();return ca=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ca}var la={},fa,wu;function yn(){if(wu)return fa;wu=1;var e=me(),r=Je(),t=e.document,n=r(t)&&r(t.createElement);return fa=function(a){return n?t.createElement(a):{}},fa}var da,bu;function Zd(){if(bu)return da;bu=1;var e=qe(),r=Ae(),t=yn();return da=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),da}var va,Su;function Ue(){if(Su)return va;Su=1;var e=vn(),r=Function.prototype.call;return va=e?r.bind(r):function(){return r.apply(r,arguments)},va}var ha,Iu;function Ye(){if(Iu)return ha;Iu=1;var e=me(),r=be(),t=function(n){return r(n)?n:void 0};return ha=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},ha}var pa,Pu;function wn(){if(Pu)return pa;Pu=1;var e=pe();return pa=e({}.isPrototypeOf),pa}var ma,Eu;function ev(){if(Eu)return ma;Eu=1;var e=Ye(),r=be(),t=wn(),n=Qd(),a=Object;return ma=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},ma}var ga,Ru;function bn(){if(Ru)return ga;Ru=1;var e=String;return ga=function(r){try{return e(r)}catch{return"Object"}},ga}var ya,Tu;function tr(){if(Tu)return ya;Tu=1;var e=be(),r=bn(),t=TypeError;return ya=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},ya}var wa,Ou;function ss(){if(Ou)return wa;Ou=1;var e=tr(),r=pn();return wa=function(t,n){var a=t[n];return r(a)?void 0:e(a)},wa}var ba,Cu;function Gh(){if(Cu)return ba;Cu=1;var e=Ue(),r=be(),t=Je(),n=TypeError;return ba=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ba}var Sa,_u;function Wh(){if(_u)return Sa;_u=1;var e=Ue(),r=Je(),t=ev(),n=ss(),a=Gh(),i=ke(),o=TypeError,s=i("toPrimitive");return Sa=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},Sa}var Ia,Au;function rv(){if(Au)return Ia;Au=1;var e=Wh(),r=ev();return Ia=function(t){var n=e(t,"string");return r(n)?n:n+""},Ia}var ku;function yr(){if(ku)return la;ku=1;var e=qe(),r=Zd(),t=Xd(),n=rr(),a=rv(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return la.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},la}var Pa,qu;function Vh(){if(qu)return Pa;qu=1;var e=Math.ceil,r=Math.floor;return Pa=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Pa}var Ea,$u;function us(){if($u)return Ea;$u=1;var e=Vh();return Ea=function(r){var t=+r;return t!==t||t===0?0:e(t)},Ea}var Ra,Lu;function tv(){if(Lu)return Ra;Lu=1;var e=us(),r=Math.max,t=Math.min;return Ra=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ra}var Ta,Uu;function zh(){if(Uu)return Ta;Uu=1;var e=us(),r=Math.min;return Ta=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ta}var Oa,xu;function cs(){if(xu)return Oa;xu=1;var e=zh();return Oa=function(r){return e(r.length)},Oa}var Ca,Nu;function Kh(){if(Nu)return Ca;Nu=1;var e=Ut(),r=tv(),t=cs(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Ca={includes:n(!0),indexOf:n(!1)},Ca}var _a,ju;function ls(){return ju||(ju=1,_a={}),_a}var Aa,Du;function nv(){if(Du)return Aa;Du=1;var e=pe(),r=Ke(),t=Ut(),n=Kh().indexOf,a=ls(),i=e([].push);return Aa=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},Aa}var ka,Mu;function fs(){return Mu||(Mu=1,ka=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ka}var qa,Fu;function av(){if(Fu)return qa;Fu=1;var e=nv(),r=fs();return qa=Object.keys||function(n){return e(n,r)},qa}var Bu;function Jh(){if(Bu)return sa;Bu=1;var e=qe(),r=Xd(),t=yr(),n=rr(),a=Ut(),i=av();return sa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},sa}var $a,Hu;function iv(){if(Hu)return $a;Hu=1;var e=Ye();return $a=e("document","documentElement"),$a}var La,Gu;function ds(){if(Gu)return La;Gu=1;var e=zd(),r=Kd(),t=e("keys");return La=function(n){return t[n]||(t[n]=r(n))},La}var Ua,Wu;function Nt(){if(Wu)return Ua;Wu=1;var e=rr(),r=Jh(),t=fs(),n=ls(),a=iv(),i=yn(),o=ds(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",w;return I.style.display="none",a.appendChild(I),I.src=String(g),w=I.contentWindow.document,w.open(),w.write(d("document.F=Object")),w.close(),w.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,Ua=Object.create||function(g,w){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),w===void 0?y:r.f(y,w)},Ua}var xa,Vu;function Yh(){if(Vu)return xa;Vu=1;var e=ke(),r=Nt(),t=yr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),xa=function(i){a[n][i]=!0},xa}var Na,zu;function jt(){return zu||(zu=1,Na={}),Na}var ja,Ku;function Qh(){if(Ku)return ja;Ku=1;var e=me(),r=be(),t=e.WeakMap;return ja=r(t)&&/native code/.test(String(t)),ja}var Da,Ju;function Gr(){return Ju||(Ju=1,Da=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),Da}var Ma,Yu;function Wr(){if(Yu)return Ma;Yu=1;var e=qe(),r=yr(),t=Gr();return Ma=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Ma}var Fa,Qu;function ft(){if(Qu)return Fa;Qu=1;var e=Qh(),r=me(),t=Je(),n=Wr(),a=Ke(),i=os(),o=ds(),s=ls(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var w;if(!t(g)||(w=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return w}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Fa={set:f,get:v,has:d,enforce:h,getterFor:p},Fa}var Ba={},Ha={},Xu;function ov(){if(Xu)return Ha;Xu=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Ha.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Ha}var Zu;function sv(){if(Zu)return Ba;Zu=1;var e=qe(),r=Ue(),t=ov(),n=Gr(),a=Ut(),i=rv(),o=Ke(),s=Zd(),u=Object.getOwnPropertyDescriptor;return Ba.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Ba}var Ga={exports:{}},Wa,ec;function uv(){if(ec)return Wa;ec=1;var e=qe(),r=Ke(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Wa={EXISTS:a,PROPER:i,CONFIGURABLE:o},Wa}var Va,rc;function vs(){if(rc)return Va;rc=1;var e=pe(),r=be(),t=os(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Va=t.inspectSource,Va}var tc;function cv(){if(tc)return Ga.exports;tc=1;var e=pe(),r=Ae(),t=be(),n=Ke(),a=qe(),i=uv().CONFIGURABLE,o=vs(),s=ft(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=Ga.exports=function(I,g,w){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),w&&w.getter&&(g="get "+g),w&&w.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&w&&n(w,"arity")&&I.length!==w.arity&&f(I,"length",{value:w.arity});try{w&&n(w,"constructor")&&w.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),Ga.exports}var za,nc;function Qe(){if(nc)return za;nc=1;var e=be(),r=yr(),t=cv(),n=is();return za=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,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:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},za}var Ka={},ac;function Xh(){if(ac)return Ka;ac=1;var e=nv(),r=fs(),t=r.concat("length","prototype");return Ka.f=Object.getOwnPropertyNames||function(a){return e(a,t)},Ka}var Ja={},ic;function lv(){return ic||(ic=1,Ja.f=Object.getOwnPropertySymbols),Ja}var Ya,oc;function Zh(){if(oc)return Ya;oc=1;var e=Ye(),r=pe(),t=Xh(),n=lv(),a=rr(),i=r([].concat);return Ya=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},Ya}var Qa,sc;function fv(){if(sc)return Qa;sc=1;var e=Ke(),r=Zh(),t=sv(),n=yr();return Qa=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},Qa}var Xa,uc;function dv(){if(uc)return Xa;uc=1;var e=Ae(),r=be(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Xa=n,Xa}var Za,cc;function Pe(){if(cc)return Za;cc=1;var e=me(),r=sv().f,t=Wr(),n=Qe(),a=is(),i=fv(),o=dv();return Za=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},Za}var ei,lc;function ep(){if(lc)return ei;lc=1;var e=Ae();return ei=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),ei}var ri,fc;function hs(){if(fc)return ri;fc=1;var e=Ke(),r=be(),t=gn(),n=ds(),a=ep(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ri=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ri}var ti,dc;function vv(){if(dc)return ti;dc=1;var e=Ae(),r=be(),t=Je(),n=Nt(),a=hs(),i=Qe(),o=ke(),s=ur(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),ti={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},ti}var ni,vc;function dt(){if(vc)return ni;vc=1;var e=yr().f,r=Ke(),t=ke(),n=t("toStringTag");return ni=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ni}var ai,hc;function hv(){if(hc)return ai;hc=1;var e=vv().IteratorPrototype,r=Nt(),t=Gr(),n=dt(),a=jt(),i=function(){return this};return ai=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ai}var ii,pc;function rp(){if(pc)return ii;pc=1;var e=pe(),r=tr();return ii=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},ii}var oi,mc;function tp(){if(mc)return oi;mc=1;var e=Je();return oi=function(r){return e(r)||r===null},oi}var si,gc;function np(){if(gc)return si;gc=1;var e=tp(),r=String,t=TypeError;return si=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},si}var ui,yc;function ps(){if(yc)return ui;yc=1;var e=rp(),r=Je(),t=mn(),n=np();return ui=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),ui}var ci,wc;function pv(){if(wc)return ci;wc=1;var e=Pe(),r=Ue(),t=ur(),n=uv(),a=be(),i=hv(),o=hs(),s=ps(),u=dt(),c=Wr(),l=Qe(),f=ke(),v=jt(),d=vv(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",w="values",y="entries",A=function(){return this};return ci=function($,j,G,K,re,x,M){i(G,j,K);var N=function(Y){if(Y===re&&b)return b;if(!R&&Y&&Y in U)return U[Y];switch(Y){case g:return function(){return new G(this,Y)};case w:return function(){return new G(this,Y)};case y:return function(){return new G(this,Y)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,U=$.prototype,F=U[I]||U["@@iterator"]||re&&U[re],b=!R&&F||N(re),T=j==="Array"&&U.entries||F,k,H,J;if(T&&(k=o(T.call(new $)),k!==Object.prototype&&k.next&&(!t&&o(k)!==S&&(s?s(k,S):a(k[I])||l(k,I,A)),u(k,m,!0,!0),t&&(v[m]=A))),h&&re===w&&F&&F.name!==w&&(!t&&p?c(U,"name",w):(C=!0,b=function(){return r(F,this)})),re)if(H={values:N(w),keys:x?b:N(g),entries:N(y)},M)for(J in H)(R||C||!(J in U))&&l(U,J,H[J]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&U[I]!==b&&l(U,I,b,{name:re}),v[j]=b,H},ci}var li,bc;function ms(){return bc||(bc=1,li=function(e,r){return{value:e,done:r}}),li}var fi,Sc;function gs(){if(Sc)return fi;Sc=1;var e=Ut(),r=Yh(),t=jt(),n=ft(),a=yr().f,i=pv(),o=ms(),s=ur(),u=qe(),c="Array Iterator",l=n.set,f=n.getterFor(c);fi=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return fi}var Ic={},Pc;function ap(){if(Pc)return Ic;Pc=1;var e=Pe(),r=pe(),t=tv(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),Ic}var di,Ec;function mv(){if(Ec)return di;Ec=1;var e=me(),r=qe(),t=Object.getOwnPropertyDescriptor;return di=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},di}var vi,Rc;function Sn(){if(Rc)return vi;Rc=1;var e=Ae(),r=ke(),t=qe(),n=ur(),a=r("iterator");return vi=!e(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(c,l){o.delete("b"),u+=l+c}),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||!t)||!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"}),vi}var hi,Tc;function In(){if(Tc)return hi;Tc=1;var e=cv(),r=yr();return hi=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},hi}var pi,Oc;function ip(){if(Oc)return pi;Oc=1;var e=Qe();return pi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},pi}var mi,Cc;function ys(){if(Cc)return mi;Cc=1;var e=wn(),r=TypeError;return mi=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},mi}var gi,_c;function op(){if(_c)return gi;_c=1;var e=hn(),r=pe();return gi=function(t){if(e(t)==="Function")return r(t)},gi}var yi,Ac;function vt(){if(Ac)return yi;Ac=1;var e=op(),r=tr(),t=vn(),n=e(e.bind);return yi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},yi}var wi,kc;function ws(){if(kc)return wi;kc=1;var e=ke(),r=e("toStringTag"),t={};return t[r]="z",wi=String(t)==="[object z]",wi}var bi,qc;function Dt(){if(qc)return bi;qc=1;var e=ws(),r=be(),t=hn(),n=ke(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return bi=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},bi}var Si,$c;function wr(){if($c)return Si;$c=1;var e=Dt(),r=String;return Si=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},Si}var Ii,Lc;function Pn(){if(Lc)return Ii;Lc=1;var e=Dt(),r=ss(),t=pn(),n=jt(),a=ke(),i=a("iterator");return Ii=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},Ii}var Pi,Uc;function bs(){if(Uc)return Pi;Uc=1;var e=Ue(),r=tr(),t=rr(),n=bn(),a=Pn(),i=TypeError;return Pi=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},Pi}var Ei,xc;function Vr(){if(xc)return Ei;xc=1;var e=TypeError;return Ei=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Ei}var Ri,Nc;function En(){if(Nc)return Ri;Nc=1;var e=pe();return Ri=e([].slice),Ri}var Ti,jc;function sp(){if(jc)return Ti;jc=1;var e=En(),r=Math.floor,t=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 c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return Ti=t,Ti}var Oi,Dc;function gv(){if(Dc)return Oi;Dc=1,gs(),ap();var e=Pe(),r=me(),t=mv(),n=Ye(),a=Ue(),i=pe(),o=qe(),s=Sn(),u=Qe(),c=In(),l=ip(),f=dt(),v=hv(),d=ft(),h=ys(),p=be(),S=Ke(),R=vt(),I=Dt(),g=rr(),w=Je(),y=wr(),A=Nt(),$=Gr(),j=bs(),G=Pn(),K=ms(),re=Vr(),x=ke(),M=sp(),N=x("iterator"),m="URLSearchParams",C=m+"Iterator",U=d.set,F=d.getterFor(m),b=d.getterFor(C),T=t("fetch"),k=t("Request"),H=t("Headers"),J=k&&k.prototype,Y=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),Re=parseInt,xe=i("".charAt),je=i([].join),$e=i([].push),Xe=i("".replace),Sr=i([].shift),Ir=i([].splice),_r=i("".split),Ar=i("".slice),yt=i(/./.exec),zr=/\+/g,kr="�",ye=/^[0-9a-f]+$/i,Ze=function(D,V){var z=Ar(D,V,V+2);return yt(ye,z)?Re(z,16):NaN},qr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=Xe(D,zr," ");for(var V=D.length,z="",Q=0;Q<V;){var ie=xe(D,Q);if(ie==="%"){if(xe(D,Q+1)==="%"||Q+3>V){z+="%",Q++;continue}var se=Ze(D,Q+1);if(se!==se){z+=ie,Q++;continue}Q+=2;var ve=qr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=kr,Q++;continue}for(var he=[se],Se=1;Se<ve&&(Q++,!(Q+3>V||xe(D,Q)!=="%"));){var Le=Ze(D,Q+1);if(Le!==Le){Q+=3;break}if(Le>191||Le<128)break;$e(he,Le),Q+=2,Se++}if(he.length!==ve){z+=kr;continue}var nr=B(he);nr===null?z+=kr:ie=ae(nr)}}z+=ie,Q++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},He=function(D){return Xe(ne(D),oe,fe)},Te=v(function(V,z){U(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=b(this),z=V.target,Q=V.index++;if(!z||Q>=z.length)return V.target=null,K(void 0,!0);var ie=z[Q];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),De=function(D){this.entries=[],this.url=null,D!==void 0&&(w(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Ar(D,1):D:y(D)))};De.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Q,ie,se,ve,he,Se,Le;if(z)for(Q=j(D,z),ie=Q.next;!(se=a(ie,Q)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Le=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");$e(V,{key:y(Se.value),value:y(Le.value)})}else for(var nr in D)S(D,nr)&&$e(V,{key:nr,value:y(D[nr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=_r(D,"&"),Q=0,ie,se;Q<z.length;)ie=z[Q++],ie.length&&(se=_r(ie,"="),$e(V,{key:X(Sr(se)),value:X(je(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Q;z<D.length;)Q=D[z++],$e(V,He(Q.key)+"="+He(Q.value));return je(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Oe=function(){h(this,Ge);var V=arguments.length>0?arguments[0]:void 0,z=U(this,new De(V));o||(this.size=z.entries.length)},Ge=Oe.prototype;if(l(Ge,{append:function(V,z){var Q=F(this);re(arguments.length,2),$e(Q.entries,{key:y(V),value:y(z)}),o||this.length++,Q.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Q=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Q.length;){var Se=Q[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(Ir(Q,he,1),ve!==void 0)break}else he++}o||(this.size=Q.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Q)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Q&&$e(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Q=re(arguments.length,1),ie=y(V),se=Q<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Q=F(this);re(arguments.length,1);for(var ie=Q.entries,se=!1,ve=y(V),he=y(z),Se=0,Le;Se<ie.length;Se++)Le=ie[Se],Le.key===ve&&(se?Ir(ie,Se--,1):(se=!0,Le.value=he));se||$e(ie,{key:ve,value:he}),o||(this.size=ie.length),Q.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Q){return z.key>Q.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Q=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Q(se.value,se.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Oe,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:Oe}),!s&&p(H)){var Kr=i(Y.has),wt=i(Y.set),Jr=function(D){if(w(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,Kr(z,"content-type")||wt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:$(0,y(V)),headers:$(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?Jr(arguments[1]):{})}}),p(k)){var Yr=function(V){return h(this,J),new k(V,arguments.length>1?Jr(arguments[1]):{})};J.constructor=Yr,Yr.prototype=J,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Yr})}}return Oi={URLSearchParams:Oe,getState:F},Oi}var Mc;function up(){return Mc||(Mc=1,gv()),Vs}var Fc={},Bc;function cp(){if(Bc)return Fc;Bc=1;var e=Qe(),r=pe(),t=wr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,$){c(h,{key:$,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,w=h.length,y;R<w;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<w;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),Fc}var Hc={},Gc;function lp(){if(Gc)return Hc;Gc=1;var e=Qe(),r=pe(),t=wr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),Hc}var Wc={},Vc;function fp(){if(Vc)return Wc;Vc=1;var e=qe(),r=pe(),t=In(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Wc}var Ci,zc;function Rn(){if(zc)return Ci;zc=1;var e=me();return Ci=e,Ci}var _i,Kc;function yv(){if(Kc)return _i;Kc=1,up(),cp(),lp(),fp();var e=Rn();return _i=e.URLSearchParams,_i}var Jc={},Yc={},Qc={},Ai,Xc;function wv(){if(Xc)return Ai;Xc=1;var e=pe(),r=us(),t=wr(),n=mn(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return Ai={codeAt:s(!1),charAt:s(!0)},Ai}var Zc;function bv(){if(Zc)return Qc;Zc=1;var e=wv().charAt,r=wr(),t=ft(),n=pv(),a=ms(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),Qc}var ki,el;function dp(){if(el)return ki;el=1;var e=qe(),r=pe(),t=Ue(),n=Ae(),a=av(),i=lv(),o=ov(),s=gn(),u=Vd(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return ki=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var w=u(arguments[R++]),y=I?f(a(w),I(w)):a(w),A=y.length,$=0,j;A>$;)j=y[$++],(!e||t(g,w,j))&&(p[j]=w[j]);return p}:c,ki}var qi,rl;function Sv(){if(rl)return qi;rl=1;var e=Ue(),r=rr(),t=ss();return qi=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},qi}var $i,tl;function vp(){if(tl)return $i;tl=1;var e=rr(),r=Sv();return $i=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},$i}var Li,nl;function Iv(){if(nl)return Li;nl=1;var e=ke(),r=jt(),t=e("iterator"),n=Array.prototype;return Li=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},Li}var Ui,al;function Pv(){if(al)return Ui;al=1;var e=pe(),r=Ae(),t=be(),n=Dt(),a=Ye(),i=vs(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Ui=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Ui}var xi,il;function hp(){if(il)return xi;il=1;var e=qe(),r=yr(),t=Gr();return xi=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},xi}var Ni,ol;function pp(){if(ol)return Ni;ol=1;var e=vt(),r=Ue(),t=gn(),n=vp(),a=Iv(),i=Pv(),o=cs(),s=hp(),u=bs(),c=Pn(),l=Array;return Ni=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,w,y,A,$,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],$=u(d,I),j=$.next;!(A=r(j,$)).done;g++)G=R?n($,S,[A.value,g],!0):A.value,s(y,g,G);else for(w=o(d),y=h?new this(w):l(w);w>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},Ni}var ji,sl;function mp(){if(sl)return ji;sl=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),w=e([].push),y=e("".replace),A=e("".split),$=e("".toLowerCase),j=function(x){for(var M=[],N=0,m=x.length;N<m;){var C=I(x,N++);if(C>=55296&&C<=56319&&N<m){var U=I(x,N++);(U&64512)===56320?w(M,((C&1023)<<10)+(U&1023)+65536):(w(M,C),N--)}else w(M,C)}return M},G=function(x){return x+22+75*(x<26)},K=function(x,M,N){var m=0;for(x=N?S(x/o):x>>1,x+=S(x/M);x>d*a>>1;)x=S(x/d),m+=t;return S(m+(d+1)*x/(x+i))},re=function(x){var M=[];x=j(x);var N=x.length,m=u,C=0,U=s,F,b;for(F=0;F<x.length;F++)b=x[F],b<128&&w(M,R(b));var T=M.length,k=T;for(T&&w(M,c);k<N;){var H=r;for(F=0;F<x.length;F++)b=x[F],b>=m&&b<H&&(H=b);var J=k+1;if(H-m>S((r-C)/J))throw new h(v);for(C+=(H-m)*J,m=H,F=0;F<x.length;F++){if(b=x[F],b<m&&++C>r)throw new h(v);if(b===m){for(var Y=C,le=t;;){var ne=le<=U?n:le>=U+a?a:le-U;if(Y<ne)break;var ue=Y-ne,ae=t-ne;w(M,R(G(ne+ue%ae))),Y=S(ue/ae),le+=t}w(M,R(G(Y))),U=K(C,J,k===T),C=0,k++}}C++,m++}return g(M,"")};return ji=function(x){var M=[],N=A(y($(x),f,"."),"."),m,C;for(m=0;m<N.length;m++)C=N[m],w(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},ji}var ul;function gp(){if(ul)return Yc;ul=1,bv();var e=Pe(),r=qe(),t=Sn(),n=me(),a=vt(),i=pe(),o=Qe(),s=In(),u=ys(),c=Ke(),l=dp(),f=pp(),v=En(),d=wv().codeAt,h=mp(),p=wr(),S=dt(),R=Vr(),I=gv(),g=ft(),w=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,$=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,x=Math.pow,M=i("".charAt),N=i(/./.exec),m=i([].join),C=i(1.1.toString),U=i([].pop),F=i([].push),b=i("".replace),T=i([].shift),k=i("".split),H=i("".slice),J=i("".toLowerCase),Y=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",Re=/[a-z]/i,xe=/[\d+-.a-z]/i,je=/\d/,$e=/^0x/i,Xe=/^[0-7]+$/,Sr=/^\d+$/,Ir=/^[\da-f]+$/i,_r=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ar=/[\0\t\n\r #/:<>?@[\\\]^|]/,yt=/^[\u0000-\u0020]+/,zr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kr=/[\t\n\r]/g,ye,Ze=function(E){var L=k(E,"."),O,P,_,te,W,we,Ie;if(L.length&&L[L.length-1]===""&&L.length--,O=L.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=L[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=N($e,te)?16:8,te=H(te,W===8?1:2)),te==="")we=0;else{if(!N(W===10?Sr:W===8?Xe:Ir,te))return E;we=K(te,W)}F(P,we)}for(_=0;_<O;_++)if(we=P[_],_===O-1){if(we>=x(256,5-O))return null}else if(we>255)return null;for(Ie=U(P),_=0;_<P.length;_++)Ie+=P[_]*x(256,3-_);return Ie},qr=function(E){var L=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,we,Ie,Ce,Ve,q,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&N(Ir,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(we=0;Ee();){if(Ie=null,we>0)if(Ee()==="."&&we<4)_++;else return;if(!N(je,Ee()))return;for(;N(je,Ee());){if(Ce=K(Ee(),10),Ie===null)Ie=Ce;else{if(Ie===0)return;Ie=Ie*10+Ce}if(Ie>255)return;_++}L[O]=L[O]*256+Ie,we++,(we===2||we===4)&&O++}if(we!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;L[O++]=te}if(P!==null)for(Ve=O-P,O=7;O!==0&&Ve>0;)q=L[O],L[O--]=L[P+Ve-1],L[P+--Ve]=q;else if(O!==8)return;return L},B=function(E){for(var L=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&(L=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:L},X=function(E){var L,O,P,_;if(typeof E=="number"){for(L=[],O=0;O<4;O++)Y(L,E%256),E=re(E/256);return m(L,".")}if(typeof E=="object"){for(L="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?(L+=O?":":"::",_=!0):(L+=C(E[O],16),O<7&&(L+=":")));return"["+L+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),He=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(E,L){var O=d(E,0);return O>32&&O<127&&!c(L,E)?E:encodeURIComponent(E)},De={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(E,L){var O;return E.length===2&&N(Re,M(E,0))&&((O=M(E,1))===":"||!L&&O==="|")},Ge=function(E){var L;return E.length>1&&Oe(H(E,0,2))&&(E.length===2||(L=M(E,2))==="/"||L==="\\"||L==="?"||L==="#")},Kr=function(E){return E==="."||J(E)==="%2e"},wt=function(E){return E=J(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},Jr={},Yr={},D={},V={},z={},Q={},ie={},se={},ve={},he={},Se={},Le={},nr={},$n={},Ds={},Ln={},Qr={},ar={},Ms={},$r={},cr={},Un=function(E,L,O){var P=p(E),_,te,W;if(L){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Un(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=$(new A),W.bindURL(this),this.searchParams=W}};Un.prototype={type:"URL",parse:function(E,L,O){var P=this,_=L||Jr,te=0,W="",we=!1,Ie=!1,Ce=!1,Ve,q,Ee,lr;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=b(E,yt,""),E=b(E,zr,"$1")),E=b(E,kr,""),Ve=f(E);te<=Ve.length;){switch(q=Ve[te],_){case Jr:if(q&&N(Re,q))W+=J(q),_=Yr;else{if(L)return ne;_=D;continue}break;case Yr:if(q&&(N(xe,q)||q==="+"||q==="-"||q==="."))W+=J(q);else if(q===":"){if(L&&(P.isSpecial()!==c(De,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,L){P.isSpecial()&&De[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=$n:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Ve[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=Ms)}else{if(L)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&q!=="#")return ne;if(O.cannotBeABaseURL&&q==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=cr;break}_=O.scheme==="file"?$n:Q;continue;case V:if(q==="/"&&Ve[te+1]==="/")_=ve,te++;else{_=Q;continue}break;case z:if(q==="/"){_=he;break}else{_=ar;continue}case Q:if(P.scheme=O.scheme,q===ye)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(q==="/"||q==="\\"&&P.isSpecial())_=ie;else if(q==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=$r;else if(q==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=cr;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ar;continue}break;case ie:if(P.isSpecial()&&(q==="/"||q==="\\"))_=ve;else if(q==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ar;continue}break;case se:if(_=ve,q!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(q!=="/"&&q!=="\\"){_=he;continue}break;case he:if(q==="@"){we&&(W="%40"+W),we=!0,Ee=f(W);for(var xn=0;xn<Ee.length;xn++){var Hs=Ee[xn];if(Hs===":"&&!Ce){Ce=!0;continue}var Gs=Te(Hs,He);Ce?P.password+=Gs:P.username+=Gs}W=""}else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(we&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=q;break;case Se:case Le:if(L&&P.scheme==="file"){_=Ln;continue}else if(q===":"&&!Ie){if(W==="")return ue;if(lr=P.parseHost(W),lr)return lr;if(W="",_=nr,L===Le)return}else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if(L&&W===""&&(P.includesCredentials()||P.port!==null))return;if(lr=P.parseHost(W),lr)return lr;if(W="",_=Qr,L)return;continue}else q==="["?Ie=!0:q==="]"&&(Ie=!1),W+=q;break;case nr:if(N(je,q))W+=q;else if(q===ye||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()||L){if(W!==""){var Nn=K(W,10);if(Nn>65535)return ae;P.port=P.isSpecial()&&Nn===De[P.scheme]?null:Nn,W=""}if(L)return;_=Qr;continue}else return ae;break;case $n:if(P.scheme="file",q==="/"||q==="\\")_=Ds;else if(O&&O.scheme==="file")switch(q){case ye:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=$r;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=cr;break;default:Ge(m(v(Ve,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ar;continue}else{_=ar;continue}break;case Ds:if(q==="/"||q==="\\"){_=Ln;break}O&&O.scheme==="file"&&!Ge(m(v(Ve,te),""))&&(Oe(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ar;continue;case Ln:if(q===ye||q==="/"||q==="\\"||q==="?"||q==="#"){if(!L&&Oe(W))_=ar;else if(W===""){if(P.host="",L)return;_=Qr}else{if(lr=P.parseHost(W),lr)return lr;if(P.host==="localhost"&&(P.host=""),L)return;W="",_=Qr}continue}else W+=q;break;case Qr:if(P.isSpecial()){if(_=ar,q!=="/"&&q!=="\\")continue}else if(!L&&q==="?")P.query="",_=$r;else if(!L&&q==="#")P.fragment="",_=cr;else if(q!==ye&&(_=ar,q!=="/"))continue;break;case ar:if(q===ye||q==="/"||q==="\\"&&P.isSpecial()||!L&&(q==="?"||q==="#")){if(wt(W)?(P.shortenPath(),q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,"")):Kr(W)?q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&Oe(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(q===ye||q==="?"||q==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);q==="?"?(P.query="",_=$r):q==="#"&&(P.fragment="",_=cr)}else W+=Te(q,fe);break;case Ms:q==="?"?(P.query="",_=$r):q==="#"?(P.fragment="",_=cr):q!==ye&&(P.path[0]+=Te(q,oe));break;case $r:!L&&q==="#"?(P.fragment="",_=cr):q!==ye&&(q==="'"&&P.isSpecial()?P.query+="%27":q==="#"?P.query+="%23":P.query+=Te(q,oe));break;case cr:q!==ye&&(P.fragment+=Te(q,ce));break}te++}},parseHost:function(E){var L,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||(L=qr(H(E,1,-1)),!L))return ue;this.host=L}else if(this.isSpecial()){if(E=h(E),N(_r,E)||(L=Ze(E),L===null))return ue;this.host=L}else{if(N(Ar,E))return ue;for(L="",O=f(E),P=0;P<O.length;P++)L+=Te(O[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 c(De,this.scheme)},shortenPath:function(){var E=this.path,L=E.length;L&&(this.scheme!=="file"||L!==1||!Oe(E[0],!0))&&E.length--},serialize:function(){var E=this,L=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,we=E.query,Ie=E.fragment,Ce=L+":";return _!==null?(Ce+="//",E.includesCredentials()&&(Ce+=O+(P?":"+P:"")+"@"),Ce+=X(_),te!==null&&(Ce+=":"+te)):L==="file"&&(Ce+="//"),Ce+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",we!==null&&(Ce+="?"+we),Ie!==null&&(Ce+="#"+Ie),Ce},setHref:function(E){var L=this.parse(E);if(L)throw new G(L);this.searchParams.update()},getOrigin:function(){var E=this.scheme,L=this.port;if(E==="blob")try{return new Xr(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)+":",Jr)},getUsername:function(){return this.username},setUsername:function(E){var L=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<L.length;O++)this.username+=Te(L[O],He)}},getPassword:function(){return this.password},setPassword:function(E){var L=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<L.length;O++)this.password+=Te(L[O],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,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Le)},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,nr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,Qr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,$r)),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}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,cr)},update:function(){this.query=this.searchParams.serialize()||null}};var Xr=function(L){var O=u(this,Ne),P=R(arguments.length,1)>1?arguments[1]:void 0,_=w(O,new Un(L,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},Ne=Xr.prototype,We=function(E,L){return{get:function(){return y(this)[E]()},set:L&&function(O){return y(this)[L](O)},configurable:!0,enumerable:!0}};if(r&&(s(Ne,"href",We("serialize","setHref")),s(Ne,"origin",We("getOrigin")),s(Ne,"protocol",We("getProtocol","setProtocol")),s(Ne,"username",We("getUsername","setUsername")),s(Ne,"password",We("getPassword","setPassword")),s(Ne,"host",We("getHost","setHost")),s(Ne,"hostname",We("getHostname","setHostname")),s(Ne,"port",We("getPort","setPort")),s(Ne,"pathname",We("getPathname","setPathname")),s(Ne,"search",We("getSearch","setSearch")),s(Ne,"searchParams",We("getSearchParams")),s(Ne,"hash",We("getHash","setHash"))),o(Ne,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(Ne,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var Fs=j.createObjectURL,Bs=j.revokeObjectURL;Fs&&o(Xr,"createObjectURL",a(Fs,j)),Bs&&o(Xr,"revokeObjectURL",a(Bs,j))}return S(Xr,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:Xr}),Yc}var cl;function yp(){return cl||(cl=1,gp()),Jc}var ll={},fl;function wp(){if(fl)return ll;fl=1;var e=Pe(),r=Ye(),t=Ae(),n=Vr(),a=wr(),i=Sn(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),ll}var dl={},vl;function bp(){if(vl)return dl;vl=1;var e=Pe(),r=Ye(),t=Vr(),n=wr(),a=Sn(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),dl}var hl={},pl;function Sp(){if(pl)return hl;pl=1;var e=Pe(),r=Ue();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),hl}var Di,ml;function Ip(){if(ml)return Di;ml=1,yv(),yp(),wp(),bp(),Sp();var e=Rn();return Di=e.URL,Di}var Mi,gl;function Pp(){if(gl)return Mi;gl=1;var e=Ip();return Mi=e,Mi}var Fi,yl;function Ep(){if(yl)return Fi;yl=1;var e=Pp();return Fi=e,Fi}Ep();var wl={},Bi,bl;function Rp(){return bl||(bl=1,Bi={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}),Bi}var Hi,Sl;function Tp(){if(Sl)return Hi;Sl=1;var e=yn(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return Hi=t===Object.prototype?void 0:t,Hi}var Il;function Ev(){if(Il)return wl;Il=1;var e=me(),r=Rp(),t=Tp(),n=gs(),a=Wr(),i=dt(),o=ke(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),wl}var Gi,Pl;function Op(){if(Pl)return Gi;Pl=1;var e=yv();return Ev(),Gi=e,Gi}var Wi,El;function Cp(){if(El)return Wi;El=1;var e=Op();return Wi=e,Wi}Cp();var Rl={},Tl={},Vi,Ol;function _p(){if(Ol)return Vi;Ol=1;var e=Je(),r=Wr();return Vi=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},Vi}var zi,Cl;function Ap(){if(Cl)return zi;Cl=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return zi=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},zi}var Ki,_l;function kp(){if(_l)return Ki;_l=1;var e=Ae(),r=Gr();return Ki=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),Ki}var Ji,Al;function qp(){if(Al)return Ji;Al=1;var e=Wr(),r=Ap(),t=kp(),n=Error.captureStackTrace;return Ji=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},Ji}var Yi,kl;function Mt(){if(kl)return Yi;kl=1;var e=vt(),r=Ue(),t=rr(),n=bn(),a=Iv(),i=cs(),o=wn(),s=bs(),u=Pn(),c=Sv(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return Yi=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),w=!!(p&&p.INTERRUPTED),y=e(h,S),A,$,j,G,K,re,x,M=function(m){return A&&c(A,"normal"),new f(!0,m)},N=function(m){return R?(t(m),w?y(m[0],m[1],M):y(m[0],m[1])):w?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if($=u(d),!$)throw new l(n(d)+" is not iterable");if(a($)){for(j=0,G=i(d);G>j;j++)if(K=N(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,$)}for(re=I?d.next:A.next;!(x=r(re,A)).done;){try{K=N(x.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},Yi}var Qi,ql;function $p(){if(ql)return Qi;ql=1;var e=wr();return Qi=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},Qi}var $l;function Lp(){if($l)return Tl;$l=1;var e=Pe(),r=wn(),t=hs(),n=ps(),a=fv(),i=Nt(),o=Wr(),s=Gr(),u=_p(),c=qp(),l=Mt(),f=$p(),v=ke(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,w){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),w!==void 0&&o(A,"message",f(w)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var $=[];return l(g,p,{that:$}),o(A,"errors",$),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),Tl}var Ll;function Up(){return Ll||(Ll=1,Lp()),Rl}var Ul={},Xi,xl;function xp(){if(xl)return Xi;xl=1;var e=ws(),r=Dt();return Xi=e?{}.toString:function(){return"[object "+r(this)+"]"},Xi}var Nl;function Np(){if(Nl)return Ul;Nl=1;var e=ws(),r=Qe(),t=xp();return e||r(Object.prototype,"toString",t,{unsafe:!0}),Ul}var jl={},Dl={},Zi,Ml;function Rv(){if(Ml)return Zi;Ml=1;var e=me(),r=xt(),t=hn(),n=function(a){return r.slice(0,a.length)===a};return Zi=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),Zi}var eo,Fl;function Ss(){if(Fl)return eo;Fl=1;var e=Rv();return eo=e==="NODE",eo}var ro,Bl;function jp(){if(Bl)return ro;Bl=1;var e=Ye(),r=In(),t=ke(),n=qe(),a=t("species");return ro=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},ro}var to,Hl;function Dp(){if(Hl)return to;Hl=1;var e=Pv(),r=bn(),t=TypeError;return to=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},to}var no,Gl;function Tv(){if(Gl)return no;Gl=1;var e=rr(),r=Dp(),t=pn(),n=ke(),a=n("species");return no=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},no}var ao,Wl;function Ov(){if(Wl)return ao;Wl=1;var e=vn(),r=Function.prototype,t=r.apply,n=r.call;return ao=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),ao}var io,Vl;function Cv(){if(Vl)return io;Vl=1;var e=xt();return io=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),io}var oo,zl;function _v(){if(zl)return oo;zl=1;var e=me(),r=Ov(),t=vt(),n=be(),a=Ke(),i=Ae(),o=iv(),s=En(),u=yn(),c=Vr(),l=Cv(),f=Ss(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,w={},y="onreadystatechange",A,$,j,G;i(function(){A=e.location});var K=function(N){if(a(w,N)){var m=w[N];delete w[N],m()}},re=function(N){return function(){K(N)}},x=function(N){K(N.data)},M=function(N){e.postMessage(I(N),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),U=s(arguments,1);return w[++g]=function(){r(C,void 0,U)},$(g),g},d=function(m){delete w[m]},f?$=function(N){h.nextTick(re(N))}:p&&p.now?$=function(N){p.now(re(N))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=x,$=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?($=M,e.addEventListener("message",x,!1)):y in u("script")?$=function(N){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(N)}}:$=function(N){setTimeout(re(N),0)}),oo={set:v,clear:d},oo}var so,Kl;function Av(){if(Kl)return so;Kl=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},so=e,so}var uo,Jl;function Mp(){if(Jl)return uo;Jl=1;var e=xt();return uo=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",uo}var co,Yl;function Fp(){if(Yl)return co;Yl=1;var e=xt();return co=/web0s(?!.*chrome)/i.test(e),co}var lo,Ql;function Bp(){if(Ql)return lo;Ql=1;var e=me(),r=mv(),t=vt(),n=_v().set,a=Av(),i=Cv(),o=Mp(),s=Fp(),u=Ss(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,w=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch($){throw g.head&&h(),$}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(w).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(w)}):u?h=function(){f.nextTick(w)}:(n=t(n,e),h=function(){n(w)}),d=function(y){g.head||h(),g.add(y)}}return lo=d,lo}var fo,Xl;function Hp(){return Xl||(Xl=1,fo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),fo}var vo,Zl;function ht(){return Zl||(Zl=1,vo=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),vo}var ho,ef;function pt(){if(ef)return ho;ef=1;var e=me();return ho=e.Promise,ho}var po,rf;function Ft(){if(rf)return po;rf=1;var e=me(),r=pt(),t=be(),n=dv(),a=vs(),i=ke(),o=Rv(),s=ur(),u=Jd(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return po={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},po}var mo={},tf;function br(){if(tf)return mo;tf=1;var e=tr(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return mo.f=function(n){return new t(n)},mo}var nf;function Gp(){if(nf)return Dl;nf=1;var e=Pe(),r=ur(),t=Ss(),n=me(),a=Rn(),i=Ue(),o=Qe(),s=ps(),u=dt(),c=jp(),l=tr(),f=be(),v=Je(),d=ys(),h=Tv(),p=_v().set,S=Bp(),R=Hp(),I=ht(),g=Av(),w=ft(),y=pt(),A=Ft(),$=br(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,x=w.getterFor(j),M=w.set,N=y&&y.prototype,m=y,C=N,U=n.TypeError,F=n.document,b=n.process,T=$.f,k=T,H=!!(F&&F.createEvent&&n.dispatchEvent),J="unhandledrejection",Y="rejectionhandled",le=0,ne=1,ue=2,ae=1,Re=2,xe,je,$e,Xe,Sr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},Ir=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,He=B.resolve,Te=B.reject,De=B.domain,Oe,Ge,Kr;try{fe?(ce||(X.rejection===Re&&kr(X),X.rejection=ae),fe===!0?Oe=oe:(De&&De.enter(),Oe=fe(oe),De&&(De.exit(),Kr=!0)),Oe===B.promise?Te(new U("Promise-chain cycle")):(Ge=Sr(Oe))?i(Ge,Oe,He,Te):He(Oe)):Te(oe)}catch(wt){De&&!Kr&&De.exit(),Te(wt)}},_r=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)Ir(ce,B);B.notified=!1,X&&!B.rejection&&yt(B)}))},Ar=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===J&&R("Unhandled promise rejection",oe)},yt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=zr(B),fe;if(ce&&(fe=I(function(){t?b.emit("unhandledRejection",oe,X):Ar(J,X,oe)}),B.rejection=t||zr(B)?Re:ae,fe.error))throw fe.value})},zr=function(B){return B.rejection!==ae&&!B.parent},kr=function(B){i(p,n,function(){var X=B.facade;t?b.emit("rejectionHandled",X):Ar(Y,X,B.value)})},ye=function(B,X,oe){return function(ce){B(X,ce,oe)}},Ze=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,_r(B,!0))},qr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new U("Promise can't be resolved itself");var ce=Sr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,ye(qr,fe,B),ye(Ze,fe,B))}catch(He){Ze(fe,He,B)}}):(B.value=X,B.state=ne,_r(B,!1))}catch(fe){Ze({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=x(this);try{X(ye(qr,oe),ye(Ze,oe))}catch(ce){Ze(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=x(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?b.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){Ir(fe,ce)}),fe.promise}),je=function(){var B=new xe,X=x(B);this.promise=B,this.resolve=ye(qr,X),this.reject=ye(Ze,X)},$.f=T=function(B){return B===m||B===$e?new je(B):k(B)},!r&&f(y)&&N!==Object.prototype)){Xe=N.then,re||o(N,"then",function(X,oe){var ce=this;return new m(function(fe,He){i(Xe,ce,fe,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),$e=a.Promise,u(m,j,!1,!0),c(j),Dl}var af={},go,of;function Wp(){if(of)return go;of=1;var e=ke(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return go=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},go}var yo,sf;function Tn(){if(sf)return yo;sf=1;var e=pt(),r=Wp(),t=Ft().CONSTRUCTOR;return yo=t||!r(function(n){e.all(n).then(void 0,function(){})}),yo}var uf;function Vp(){if(uf)return af;uf=1;var e=Pe(),r=Ue(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,w=!1;R++,r(h,c,I).then(function(y){w||(w=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),af}var cf={},lf;function zp(){if(lf)return cf;lf=1;var e=Pe(),r=ur(),t=Ft().CONSTRUCTOR,n=pt(),a=Ye(),i=be(),o=Qe(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return cf}var ff={},df;function Kp(){if(df)return ff;df=1;var e=Pe(),r=Ue(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),ff}var vf={},hf;function Jp(){if(hf)return vf;hf=1;var e=Pe(),r=br(),t=Ft().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),vf}var pf={},wo,mf;function kv(){if(mf)return wo;mf=1;var e=rr(),r=Je(),t=br();return wo=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},wo}var gf;function Yp(){if(gf)return pf;gf=1;var e=Pe(),r=Ye(),t=ur(),n=pt(),a=Ft().CONSTRUCTOR,i=kv(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),pf}var yf;function Qp(){return yf||(yf=1,Gp(),Vp(),zp(),Kp(),Jp(),Yp()),jl}var wf={},bf;function Xp(){if(bf)return wf;bf=1;var e=Pe(),r=Ue(),t=tr(),n=br(),a=ht(),i=Mt(),o=Tn();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,w=!1;R++,r(h,c,I).then(function(y){w||(w=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){w||(w=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),wf}var Sf={},If;function Zp(){if(If)return Sf;If=1;var e=Pe(),r=Ue(),t=tr(),n=Ye(),a=br(),i=ht(),o=Mt(),s=Tn(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,w=1,y=!1;o(l,function(A){var $=g++,j=!1;w++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[$]=G,--w||p(new v(I,u)))})}),--w||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),Sf}var Pf={},Ef;function qv(){if(Ef)return Pf;Ef=1;var e=Pe(),r=me(),t=Ov(),n=En(),a=br(),i=tr(),o=ht(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),Pf}var Rf={},Tf;function $v(){if(Tf)return Rf;Tf=1;var e=Pe(),r=br();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Rf}var Of={},Cf;function em(){if(Cf)return Of;Cf=1;var e=Pe(),r=ur(),t=pt(),n=Ae(),a=Ye(),i=be(),o=Tv(),s=kv(),u=Qe(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return Of}var bo,_f;function rm(){if(_f)return bo;_f=1,Up(),gs(),Np(),Qp(),Xp(),Zp(),qv(),$v(),em(),bv();var e=Rn();return bo=e.Promise,bo}var So,Af;function tm(){if(Af)return So;Af=1;var e=rm();return Ev(),So=e,So}var kf={},qf;function nm(){return qf||(qf=1,qv()),kf}var $f={},Lf;function am(){return Lf||(Lf=1,$v()),$f}var Io,Uf;function im(){if(Uf)return Io;Uf=1;var e=tm();return nm(),am(),Io=e,Io}im();const Lv="sesamy-debug";function om(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function sm(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function um(e){om(Lv,e.toString(),1)}function cm(){return sm(Lv)==="true"}function de(e){cm()&&console.log(e)}var ze=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ze||{});const lm=Object.freeze(Object.defineProperty({__proto__:null,Events:ze},Symbol.toStringTag,{value:"Module"}));function xf(e,r){const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}function Ur(e,r){typeof window>"u"||(e===ze.READY&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>xf(e,r),{once:!0}):xf(e,r))}const fm=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:Ur},Symbol.toStringTag,{value:"Module"}));let Uv=null;function tn(e){Uv=e}function Is(){return Uv}const xv="sesamy_is_authenticated";function dm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${xv}=true`))}catch{return!1}}function Po(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${xv}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function Nf(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),dm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,Po(!0),Ur(ze.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,Po(!1))}else a=!1;n=!0,Ur(ze.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,Po(!1),Ur(ze.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const vm="sesamyAccessToken";let $t=!1;function Cr(){const e=Is();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function hm(e){if(e.enabled===!1){de("Auth disabled via config"),$t=!0;return}e.useHttpCookies?(de("useHttpCookies=true — using cookie-based BFF plugin"),tn(Nf())):Is()||(de("No auth plugin registered — falling back to cookie-based BFF plugin"),tn(Nf())),await Cr().init(e),$t=!0}async function or(){return $t?Cr().isAuthenticated():!1}async function dr(e=!0,r=!1){return $t?Cr().getTokenSilently(e,r):null}async function pm(){return $t?Cr().getUser():null}async function mm(e){return Cr().login(e)}async function Ps(e){return Cr().loginWithRedirect(e)}async function gm(e){return Cr().loginWithPopup(e)}async function ym(e={}){return Cr().logout(e)}async function Mo(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(vm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>fm),{Events:i}=await Promise.resolve().then(()=>lm);a(i.AUTHENTICATED,{...n,appState:void 0})}const wm=(e,r)=>r.skipDedupe||r.method!=="GET",bm=(e,r)=>r.method+"@"+e,Sm=e=>e.clone(),Im=({skip:e=wm,key:r=bm,resolver:t=Sm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Pm=(e,r)=>e*r,Em=e=>e&&e.ok,Rm=({delayTimer:e=500,delayRamp:r=Pm,maxAttempts:t=10,until:n=Em,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,w;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(w=I&&I.options)!==null&&w!==void 0?w:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Eo=class Nv extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Nv)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var nn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(nn||{});const Tm="application/json",jv="Content-Type",Zr=Symbol(),Dv=Symbol();function jf(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===jv.toLowerCase()))===null||r===void 0?void 0:r[1]}function Df(e){return/^application\/.*json.*/.test(e)}const xr=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=xr(o,i,t):n[a]=i,n},{...e})},st={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Om(e,r=!1){st.options=r?e:xr(st.options,e)}function Cm(e,r=!1){st.polyfills=r?e:xr(st.polyfills,e)}function _m(e){st.errorType=e}const Am=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let Mv=class extends Error{};const km=e=>{const r=Object.create(null);e=e._addons.reduce((g,w)=>w.beforeRequest&&w.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=xr(a.options,n);let f=t;const v=Am(s)((g,w)=>(f=g,a.polyfill("fetch")(g,w)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var w;if(!g.ok){const y=new Mv;if(y.cause=d,y.stack=y.stack+`
2
+ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((w=g.headers.get("Content-Type"))===null||w===void 0?void 0:w.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then($=>{if(y.message=typeof $=="string"?$:g.statusText,$)if(A&&typeof $=="string"){y.text=$;try{y.json=JSON.parse($)}catch{}}else y[a.errorType]=$;throw y})}return g}),p=g=>g.catch(w=>{const y=Object.prototype.hasOwnProperty.call(w,Zr),A=y?w[Zr]:w,$=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if($)return $(A,e);const j=c.get(Dv);if(j)return j(A,e);throw A}),S=g=>w=>p(g?h.then(y=>y&&y[g]()).then(y=>w?w(y):y):h.then(y=>w?w(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,w){return c.set(g,w),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,w)=>({...g,...typeof w.resolver=="function"?w.resolver(g):w.resolver}),R);return o.reduce((g,w)=>w(g,e),I)},qm={_url:"",_options:{},_config:st,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,r=!1){return{...this,_config:{...this._config,polyfills:r?e:xr(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:xr(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:xr(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[jv]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(Dv,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=jf(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||Df(a));return n=t?o?n.json(t,a):n.body(t):n,km(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,r){const t=jf(this._options.headers);return this.content(r||Df(t)&&t||Tm).body(JSON.stringify(e))}};function sr(e="",r={}){return{...qm,_url:e,_options:r}}sr.default=sr;sr.options=Om;sr.errorType=_m;sr.polyfills=Cm;sr.WretchError=Mv;const $m=(e,r)=>r.skipDedupe||r.method!=="GET",Lm=(e,r)=>r.method+"@"+e,Um=e=>e.clone(),xm=({skip:e=$m,key:r=Lm,resolver:t=Um}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Nm=(e,r)=>r.skipCache||r.method!=="GET",jm=(e,r)=>r.method+"@"+e,Dm=()=>!1,Mm=()=>null,Fm=e=>e.ok,Bm=({throttle:e=1e3,skip:r=Nm,key:t=jm,clear:n=Dm,invalidate:a=Mm,condition:i=Fm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Hm=(e,r)=>e*r,Gm=e=>e&&e.ok,Wm=({delayTimer:e=500,delayRamp:r=Hm,maxAttempts:t=10,until:n=Gm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,w;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(w=I&&I.options)!==null&&w!==void 0?w:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Vm="@sesamy/sdk",zm="1.25.0";let Km=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Tt="sesamyCacheTimestamp",Jm=e=>{const{libraryName:r=Vm,libraryVersion:t=zm,cache:n}=e,a=n?.storage||new Km,i=[s=>async(u,c)=>{if(n?.mode===nn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Tt),l||(l=Date.now().toString(),sessionStorage.setItem(Tt,l))):(l=a.get(Tt),l||(l=Date.now().toString(),a.set(Tt,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,{...c,credentials:"include"});const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},xm()];n?.mode===nn.NORMAL&&i.push(Bm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Wm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=sr(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&hr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Eo(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Eo)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Eo(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},hr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Tt),"Cache cleared"),St={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Ro={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Mf={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},Ff={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Ym=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Bf=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Ym(e.manageUrl,r)},It={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},To={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},et={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},Oo={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},rt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Co={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},Hf={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Gf={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Wf={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}},checkAccess:async(e,r,t)=>e.request(`/paywalls/${encodeURIComponent(r)}/access`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})},Qm={list:async e=>e.request("/payment-issues")},Xm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Zm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},Vf={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},eg=e=>{const r=Jm(e);return{profile:{get:t=>St.get(r,t),update:(t,n)=>St.update(r,t,n),checkSpotifyLink:()=>St.checkSpotifyLink(r),unlinkSpotify:()=>St.unlinkSpotify(r),delete:()=>St.delete(r)},entitlements:{list:t=>Ro.list(r,t),get:t=>Ro.get(r,t),getAccess:t=>Ro.getAccess(r,t)},subscriptions:{list:()=>Mf.list(r),get:t=>Mf.get(r,t)},products:{get:t=>Ff.get(r,t),autoOnboard:t=>Ff.autoOnboard(r,t)},contracts:{list:async()=>{const t=await It.list(r),n=await e.tokenProvider();if(!n||!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Bf(i,a))},get:async t=>{const n=await It.get(r,t),a=await e.tokenProvider();if(!a||!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Bf(n,i)},cancel:t=>It.cancel(r,t),createAmendment:(t,n)=>It.createAmendment(r,t,n),confirmAmendment:(t,n)=>It.confirmAmendment(r,t,n)},userMetadata:{get:()=>To.get(r),set:(t,n)=>To.set(r,t,n),delete:t=>To.delete(r,t)},tallies:{list:()=>et.list(r),get:t=>et.get(r,t),update:(t,n)=>et.update(r,t,n),create:t=>et.create(r,t),delete:t=>et.delete(r,t),push:(t,n)=>et.push(r,t,n)},tags:{list:()=>Oo.list(r),add:t=>Oo.add(r,t),remove:t=>Oo.remove(r,t)},checkouts:{generateLink:(t,n)=>rt.generateCheckoutLink(t,n),create:t=>Co.create(r,t),get:t=>Co.get(r,t),update:(t,n)=>Co.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>rt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>rt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>rt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>rt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>rt.generateConsumeLink(t,n)},bills:{list:()=>Hf.list(r),get:t=>Hf.get(r,t)},fulfillments:{list:()=>Gf.list(r),create:t=>Gf.create(r,t)},paywalls:{get:t=>Wf.get(r,t),checkAccess:(t,n)=>Wf.checkAccess(r,t,n)},paymentIssues:{list:()=>Qm.list(r)},proxy:{content:(t,n,a,i)=>Xm.content(r,t,n,a,i)},transactions:{list:t=>Zm.list(r,t)},vendor:{get:()=>Vf.get(r),list:()=>Vf.list(r)}}},rg="sesamy.com",tg="sesamy.dev",ng="https://sesa.my",zf="sesamyCacheTimestamp",Kf="sesamyContentReloaded";class ag{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ig(e,r){return`${e}.${r==="dev"?tg:rg}`}function ir(e,r){return`https://${ig(e,r)}`}function Xt(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Fo(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function Fv(e,r){if(Fo(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Jf(e){return e.endsWith("/")?e.slice(0,-1):e}function Yf(e,r){if(!Fo(e)||!Fo(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Jf(t.pathname)===Jf(n.pathname)}function og(e,r,t){const n=new URL(`${ir("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=Fv(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const Bv="sesamySignedURLs";function Es(){const e=sessionStorage.getItem(Bv);return e?JSON.parse(e):[]}function Qf(e){const r=Es();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(Bv,JSON.stringify(r))}function sg(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Bo="sesamyAttribution";function ug(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function cg(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function an(){return ug(Bo)||{}}function Hv(e){if(e===null)localStorage.removeItem(Bo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=an()??{},t=sg({...r,...cg(e)});localStorage.setItem(Bo,JSON.stringify({value:t}))}}const Rs="@sesamy/sesamy-js",Bt="1.103.0",Gv="sesamyFlags";async function Wv(e){try{localStorage.setItem(Gv,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Vv(e,r){const t=await Ht();t[e]=r,await Wv(t)}async function zv(e){return(await Ht())[e]}async function Kv(e){const r=await Ht();e in r&&(delete r[e],await Wv(r))}async function Ht(){try{const e=localStorage.getItem(Gv);return e?JSON.parse(e):{}}catch{return{}}}function Jv(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function Yv(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function lg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let Me={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"}},Qv=[],Xv=!1,vr;function fg(e){try{const t=new URL(e).pathname.split("/").filter(Boolean);return t[t.length-1]||e}catch{return e}}function Ts(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return Qv.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function dg(){return Ts()}function vg(e,r){Qv=e.content||[];const t=Ts();t&&t.type==="article"&&(Me={...Me,...Yv(t.selectors)},Xv=t.enablePaywallSettingsUrlFallback||!1),vr=r}function hg(e,r){const{selector:t,attribute:n}=r;return t===Me.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Zv(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Zv(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function Ot(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ct=null;function eh(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function _t(e){const r=eh(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function pg(e){const r=eh(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Ho(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function mg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Ho(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function _o(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function rh(){if(Ct)return Ct;const e=_t("NewsArticle")||_t("Article")||_t("BlogPosting")||_t("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:mg(e?.author)||(Ot("article:author").length>0?Ot("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(_o(e?.keywords),_o(ge("keywords"))),tags:Ot("article:tag").length>0?Ot("article:tag"):void 0,categories:_o(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Ho(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Ho(e.publisher,"logo","url")}:void 0};return Ct=Yv(n),Ct}function gg(){Ct=null}function Os({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function th(){const e=document.querySelectorAll(Me.article.selector);return Array.from(e).map(Gt).filter(r=>r!==null)}function Gt(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Jv(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=hg(r,o),v=Zv(f,o,l),d=Os({publisherContentId:s,key:lg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",Me.id),n("title",Me.title,t.id),n("excerpt",Me.excerpt,t.id),n("image",Me.image,t.id),n("price",Me.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Me.currency,t.id),n("url",Me.url,t.id),n("pass",Me.pass,t.id,{collect:!0}),n("paywallUrl",Me.paywallUrl,t.id),n("accessLevel",Me.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Ts();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Xv&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=rh(),t}async function yg(e){const r=Gt(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await vr.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await vr.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await vr.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");const t=await vr.entitlements.hasAccess(r.url,r.pass?.split(",")||[]);if(t)return t;if(r.paywallUrl){const n=fg(r.paywallUrl),a=await vr.paywalls.checkAccess(n,{articleId:r.id||r.url,url:r.url});if(a.status==="allowed")return{id:"leaky-paywall",sku:"",url:a.signedLink,token:new URL(a.signedLink).searchParams.get("sesamy_token")||void 0,hasAccess:!0}}return null}async function nh(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Gt(t);if(!n?.url)throw new Error("Could not find content for element");const a=await vr.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");let i;if(a.token)i=a.token;else{const s=await vr.entitlements.access(a.id);if(!s.token)throw new Error("Could not get access token");i=s.token}const o=r||Jv(t.parentElement||t);return vr.proxy.getContent(i,n.url,o)}function ah(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function wg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function bg(e){const r=e.endpoint??ir("api2",e.environment),n=eg({baseUrl:r,tokenProvider:async()=>{if(await or())try{const U=await dr(!1);return U?`Bearer ${U}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:Rs,libraryVersion:Bt,vendorId:e.vendorId,cache:{mode:nn.BROWSER,storage:new ag}}),a=m=>async(C,U)=>{let F=sessionStorage.getItem(zf);F||(F=Date.now().toString(),sessionStorage.setItem(zf,F));const b={...U,headers:{...U.headers,"Cache-Timestamp":F}};return m(C,b)},i=(m=!0)=>C=>async(U,F)=>{const b=await dr(m);if(!b){if(await or()){const k={...F,credentials:"include"};return C(U,k)}if(m)throw new Error("No access token available");return C(U,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${b}`}};return C(U,T)},o=sr(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),Im(),Rm({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:U=!0}=m,F=await or()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return U&&F.push(...Es()),F}async function u(m,C=[]){return(await s())?.find(b=>{if(m){const{sku:T,purchaseOption:k}=Fv(m);if("sku"in b&&T===b.sku||k&&"purchaseOptionsId"in b&&k===b.purchaseOptionsId||Yf(m,b.url))return!0}return!!C.some(T=>Yf(T,b.url))})}async function c(m,C,U){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),U&&F.searchParams.set("selector",U),sr(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await or()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(U=>U.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return hr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return Ur(ze.USER_ATTRIBUTE_CHANGED,{}),hr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const U of m)C[U.id]=U.value;return C}async function g(m){return await n.tallies.delete(m)}async function w(m,C){return await n.tallies.push(m,C)}async function y(){return!await dr(!1)&&!await or()?null:await o.url("/profile").get().json()}async function A(m){const C=await o.url("/profile").patch(m).res();return hr(),C.ok}async function $(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function G(m){const C=await dr(!1);if(!C)throw new Error("No access token available");const U=new URL(`${ir("access-sync",e.environment)}/spotify/sesamy-callback`);U.searchParams.set("access_token",C),U.searchParams.set("state",m),window.location.href=U.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&hr(),C}async function re(m,C=3600){const{shortlink:U}=await sr(ng).post({url:m,ttl:C}).json();return U}async function x(m){const C=await dr(!1,!0);let U;const F=m.language||Xt(),b=an();switch(m.target){case"account":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":U=new URL(`${ir("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?U.href+=`/${m.episodeId}`:U.href+="/listen",U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":U=og(e,{language:F,...m},b);break;default:throw new Error("Invalid target")}return C&&(U.hash=`#access_token=${C}`),m.shorten?re(U.href,m.ttl):U.href}async function M(){const m=await dr(!1),C=new URL(`${ir("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function N(m){const C=an(),U=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[b,T]=F.trim().split("=");U.includes(b)&&!C[b]&&(C[b]=T)}),n.checkouts.create({language:Xt(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:th,get:Gt,getLanguage:Xt,unlock:nh,getPropertyFromHTML:Os},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:zv,set:Vv,list:Ht,delete:Kv},generateLink:x,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:$,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:w,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function Xf(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var Sg="function",Ig="string",er="undefined",Pg="boolean",on="object",Eg="array",Rg="number",Tg="symbol",Og="null",Go=function(){},ih="any",oh="*",Fr="__",Cg="form",_g="input",Ag="button",kg="select",sn=typeof process!==er?process:{};sn.env&&sn.env.NODE_ENV;var _e=typeof document!==er;sn.versions!=null&&sn.versions.node!=null;typeof Deno!==er&&Deno.core;_e&&window.name==="nodejs"||typeof navigator!==er&&typeof navigator.userAgent!==er&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function sh(e,r){return r.charAt(0)[e]()+r.slice(1)}var qg=sh.bind(null,"toUpperCase"),$g=sh.bind(null,"toLowerCase");function Lg(e){return uh(e)?qg(Og):typeof e===on?jg(e):Object.prototype.toString.call(e).slice(8,-1)}function un(e,r){r===void 0&&(r=!0);var t=Lg(e);return r?$g(t):t}function Wt(e,r){return typeof r===e}var Be=Wt.bind(null,Sg),Tr=Wt.bind(null,Ig),tt=Wt.bind(null,er),Ug=Wt.bind(null,Pg);Wt.bind(null,Tg);function uh(e){return e===null}function xg(e){return un(e)===Rg&&!isNaN(e)}function ch(e){return un(e)===Eg}function Fe(e){if(!Ng(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ng(e){return e&&(typeof e===on||e!==null)}function jg(e){return Be(e.constructor)?e.constructor.name:null}function Dg(e){return e instanceof Error||Tr(e.message)&&e.constructor&&xg(e.constructor.stackTraceLimit)}function lh(e,r){if(typeof r!="object"||uh(r))return!1;if(r instanceof e)return!0;var t=un(new e(""));if(Dg(r))for(;r;){if(un(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}lh.bind(null,TypeError);lh.bind(null,SyntaxError);function On(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?Mg(e,r):t}function Mg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function Cn(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}Cn(On,Cg);Cn(On,Ag);Cn(On,_g);Cn(On,kg);function Fg(e){return e?ch(e)?e:[e]:[]}function Zf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Bg(){if(_e){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Hg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Gg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=Zf(t[1]),o=Zf(t[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 c=u.split("[");c.length>1&&(Wg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return _e&&window.location.search.substring(1)})())}function Wg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function _n(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Vg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",ut=Fr+Nr+Fr,ct=typeof self===on&&self.self===self&&self||typeof global===on&&global[Nr]===global&&global||void 0;function Br(e){return ct[ut][e]}function Hr(e,r){return ct[ut][e]=r}function mt(e){delete ct[ut][e]}function gt(e,r,t){var n;try{if(Cs(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}ct[ut]||(ct[ut]={});var Vt={};function Cs(e){if(typeof Vt[e]!==er)return Vt[e];try{var r=window[e];r.setItem(er,er),r.removeItem(er)}catch{return Vt[e]=!1}return Vt[e]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ee.apply(null,arguments)}var Er="function",pr="undefined",kt="reducer",fh="@@redux/",Wo=fh+"INIT",zg=fh+Math.random().toString(36),ed=(function(){return typeof Symbol===Er&&Symbol.observable||"@@observable"})(),zt=" != "+Er;function dh(e,r,t){var n;if(typeof r===Er&&typeof t===pr&&(t=r,r=void 0),typeof t!==pr){if(typeof t!==Er)throw new Error("enhancer"+zt);return t(dh)(e,r)}if(typeof e!==Er)throw new Error(kt+zt);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Er)throw new Error("Listener"+zt);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===pr)throw new Error("ActType "+pr);if(u)throw new Error("Dispatch in "+kt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:Wo}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Er)throw new Error("next "+kt+zt);a=d,v({type:Wo})}})[ed]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[ed]=function(){return this},d},n}function Kg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+kt+" "+e+" returns "+pr}function lt(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function Jg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),ee({},o,{dispatch:s=lt.apply(void 0,i)(o.dispatch)})}}}var Or=Fr+"anon_id",jr=Fr+"user_id",at=Fr+"user_traits",Vo="analytics",Pr="userId",nt="anonymousId",Zt=["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"],zo=["name","EVENTS","config","loaded"],Z=Zt.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),rd=/^utm_/,td=/^an_prop_/,nd=/^an_trait_/;function Yg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===Z.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Or,o.anonymousId),c||r(jr,o.userId),u.traits&&r(at,ee({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(rd)||p.match(/^(d|g)clid/)){var S=p.replace(rd,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(td)&&(h.props[p.replace(td,"")]=i[p]),p.match(nd)&&(h.traits[p.replace(nd,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(ee({type:Z.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:Z.campaign,campaign:d.campaign})}}return n(a)}}}}function Qg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===Z.setItemEnd){if(t.key===Or)return ee({},r,{anonymousId:t.value});if(t.key===jr)return ee({},r,{userId:t.value})}switch(t.type){case Z.identify:return Object.assign({},r,{userId:t.userId,traits:ee({},r.traits,t.traits)});case Z.reset:return[jr,Or,at].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function ad(e){return{userId:e.getItem(jr),anonymousId:e.getItem(Or),traits:e.getItem(at)}}var Ko=function(e){return Fr+"TEMP"+Fr+e};function Xg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===Z.reset&&([jr,at,Or].forEach(function(d){n(d)}),[Pr,nt,"traits"].forEach(function(d){mt(Ko(d))})),s.type===Z.identify){a(Or)||t(Or,_n());var f=a(jr),v=a(at)||{};f&&f!==u&&i.dispatch({type:Z.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(jr,u),c&&t(at,ee({},v,c))}return o(s)}}}}var At={};function id(e,r){At[e]&&Be(At[e])&&(At[e](r),delete At[e])}function vh(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(ee({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return vh(e,r,t-10).then(n,a)})})}function Zg(e){return{abort:e}}function hh(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Be(p)){var S,R=(function(w,y){return w===void 0&&(w={}),y===void 0&&(y={}),[Pr,nt].reduce(function(A,$){return w.hasOwnProperty($)&&y[$]&&y[$]!==w[$]&&(A[$]=y[$]),A},w)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Zg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(ee({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var Ao=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(it),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,w){var y=g.config,A=g.name,$=A+"."+I.type;w&&($=w.event);var j=I.type.match(it)?(function(G,K,re,x,M){return function(N,m){var C=x?x.name:G,U=m&&Lt(m)?m:re;if(x&&(!(U=m&&Lt(m)?m:[G]).includes(G)||U.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(U)+" input valid");return ee({},M,{abort:{reason:N,plugins:U,caller:K,_:C}})}})(A,$,R,w,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,$);return{payload:ey(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,w=!1;return g.match(/^initialize/)||g.match(/^reset/)||(w=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(w=!0),S[""+I]=w,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(w){function y(){return Promise.resolve(w)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function($,j,G){return Promise.resolve($).then(function(K){return j.method&&Be(j.method)?((function(N,m){var C=dd(N);if(C&&C.name===m){var U=dd(C.method);throw new Error([m+" plugin is calling method "+N,"Plugins cant call self","Use "+C.method+" "+(U?"or "+U.method:"")+" in "+m+" plugin insteadof "+N].join(`
3
+ `))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,x=g,M=j.pluginName,function(N,m){return ee({},re,{abort:{reason:N,plugins:m||[x],caller:f,from:M||x}})}),config:ud(j.pluginName,c,i),plugins:c})).then(function(N){var m=Fe(N)?N:{};return Promise.resolve(ee({},K,m))})):K;var re,x,M})},Promise.resolve(t))).then(function($){w[g]=$});w[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var w=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function($){var j=S[y]?S[y]:{};if(v&&(j=$),qo(j,y))return ko({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve($);if(qo($,y))return w&&ko({data:$,method:f,instance:n,store:s}),Promise.resolve($);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve($);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:ud(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},x=ee({},$,re),M=S[y];if(qo(M,y))ko({data:M,method:f,instance:n,pluginName:y,store:s});else{var N=f+":"+y;(N.match(/:/g)||[]).length<2&&!f.match(od)&&!f.match(sd)&&n.dispatch(ee({},v?x:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(x)})})}catch($){return Promise.reject($)}},Promise.resolve(t))).then(function(R){if(!(f.match(it)||f.match(/^registerPlugin/)||f.match(sd)||f.match(od)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=ee({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});ph(R,r.exact.length)&&!f.match(/End$/)&&(I=ee({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},it=/Start$/,od=/^bootstrap/,sd=/^ready/;function ko(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(ee({},e.data,{type:t,_:{called:t,from:"abort"}}))}function ud(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function cd(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function ld(e,r){var t=e.replace(it,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function qo(e,r){var t=e.abort;return!!t&&(t===!0||fd(t,r)||t&&fd(t.plugins,r))}function ph(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Tr(t))return!0;var n=t.plugins;return Lt(t)&&t.length===r||Lt(n)&&n.length===r}function Lt(e){return Array.isArray(e)}function fd(e,r){return!(!e||!Lt(e))&&e.includes(r)}function dd(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function ey(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function ry(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(w){return s?w:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===Z.enablePlugin&&a.dispatch({type:Z.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===Z.disablePlugin&&setTimeout(function(){return id(o.meta.rid,{payload:o})},0),c===Z.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(w){return l.includes(w)}).map(function(w){return v[w]}),p=[],S=[],R=o.disabled,I=h.map(function(w){var y=w.loaded,A=w.name,$=w.config;return vh(w,function(){return y({config:$})},1e4).then(function(j){return n[A]||(a.dispatch({type:Z.pluginReadyType(A),name:A,events:Object.keys(w).filter(function(G){return!zo.includes(G)})}),n[A]=!0),p=p.concat(A),w}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(w){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(ee({},{type:Z.ready},y))},0)})}var g=(function(){if(c!==Z.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return hh(a,r,e)},0),Promise.resolve((function(w,y,A,$,j){try{var G=Be(y)?y():y,K=w.type,re=K.replace(it,"");if(w._&&w._.called)return Promise.resolve(w);var x=A.getState(),M=(C=G,(U=x.plugins)===void 0&&(U={}),(F=w.options)===void 0&&(F={}),Object.keys(C).filter(function(b){var T=F.plugins||{};return Ug(T[b])?T[b]:T.all!==!1&&(!U[b]||U[b].enabled!==!1)}).map(function(b){return C[b]}));K===Z.initializeStart&&w.fromEnable&&(M=Object.keys(x.plugins).filter(function(b){var T=x.plugins[b];return w.plugins.includes(b)&&!T.initialized}).map(function(b){return G[b]}));var N=M.map(function(b){return b.name}),m=(function(b,T){var k=ld(b).map(function(H){return cd(H,T)});return T.reduce(function(H,J){var Y=J.name,le=ld(b,Y).map(function(Re){return cd(Re,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[Y]=ne),ue.length&&(H.duringNS[Y]=ue),ae.length&&(H.afterNS[Y]=ae),H},{before:k[0],beforeNS:{},during:k[1],duringNS:{},after:k[2],afterNS:{}})})(K,M);return Promise.resolve(Ao({action:w,data:{exact:m.before,namespaced:m.beforeNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(b){function T(){var J=(function(){if(K.match(it))return Promise.resolve(Ao({action:ee({},k,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(Y){Y.meta&&Y.meta.hasCallback&&id(Y.meta.rid,{payload:Y})})})();return J&&J.then?J.then(function(){return b}):b}if(ph(b,N.length))return b;var k,H=(function(){if(K!==re)return Promise.resolve(Ao({action:ee({},b,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:x,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(J){k=J});k=b})();return H&&H.then?H.then(T):T()})}catch(b){return Promise.reject(b)}var C,U,F})(o,r,e,a,t)).then(function(w){var y=i(w);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(w){return Promise.reject(w)}}}}}function ty(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Z.setItem||a===Z.removeItem){if(n.abort)return t(n);a===Z.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ny=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return lt.apply(void 0,o)(n)(a)}}}}};function ay(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=vd(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=vd(t.type,Z.initialize),c=e()[u];return c&&u?(n[u]=ee({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),ee({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=ee({},r[t.name],{loaded:!0}),ee({},r,n);switch(t.type){case Z.disablePlugin:return ee({},r,hd(t.plugins,!1,r));case Z.enablePlugin:return ee({},r,hd(t.plugins,!0,r));default:return r}}}function vd(e,r){return e.substring(r.length+1,e.length)}function hd(e,r,t){return e.reduce(function(n,a){return n[a]=ee({},t[a],{enabled:r}),n},t)}function mh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var iy={last:{},history:[]};function oy(e,r){e===void 0&&(e=iy);var t=r.options,n=r.meta;if(r.type===Z.track){var a=mh(ee({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return ee({},e,{last:a,history:e.history.concat(a)})}return e}var sy={actions:[]};function uy(e,r){e===void 0&&(e=sy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===Z.identify?[r].concat(e.actions):e.actions.concat(r),ee({},e,{actions:n});case"dequeue":return[];default:return e}}var gh=/#.*$/;function cy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(gh,""):"")}var yh,wh,bh,Sh,ly=function(e){if(e===void 0&&(e={}),!_e)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(_e){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(gh,"")})(c),f={title:t,url:l,path:cy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,e)},fy={last:{},history:[]};function dy(e,r){e===void 0&&(e=fy);var t=r.options;if(r.type===Z.page){var n=mh(ee({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return ee({},e,{last:n,history:e.history.concat(n)})}return e}yh=(function(){if(!_e)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),wh=_e?document.referrer:null,bh=Bg(),Sh=Hg();var pd={initialized:!1,sessionId:_n(),app:null,version:null,debug:!1,offline:!!_e&&!navigator.onLine,os:{name:yh},userAgent:_e?navigator.userAgent:"node",library:{name:Vo,version:"0.13.1"},timezone:Sh,locale:bh,campaign:{},referrer:wh};function vy(e,r){e===void 0&&(e=pd);var t=e.initialized,n=r.campaign;switch(r.type){case Z.campaign:return ee({},e,{campaign:n});case Z.offline:return ee({},e,{offline:!0});case Z.online:return ee({},e,{offline:!1});default:return t?e:ee({},pd,e,{initialized:!0})}}var hy=["plugins","reducers","storage"];function py(e,r,t){if(_e){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function my(e){var r=py.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function Ih(){return Hr(Vo,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return ct[ut][Vo].push(o.action||o),i(o)}})}}}function md(e){return function(){return lt(lt.apply(null,arguments),Ih())}}function $o(e){return e?ch(e)?e:[e]:[]}function gd(e,r,t){e===void 0&&(e={});var n,a,i=_n();return r&&(At[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Be(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),ee({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function gy(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(b,T){if(Be(T))return b.middlewares=b.middlewares.concat(T),b;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var k=T.EVENTS?Object.keys(T.EVENTS).map(function(Y){return T.EVENTS[Y]}):[];b.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(b.methods[T.name]=Object.keys(T.methods).reduce(function(Y,le){var ne;return Y[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),Re=0;Re<ue.length;Re++)ae[Re]=ue[Re];return ae[ae.length]=y,ne.apply({instance:y},ae)}),Y},{}),delete T.methods);var H=Object.keys(T).concat(k),J=new Set(b.events.concat(H));if(b.events=Array.from(J),b.pluginsArray=b.pluginsArray.concat(T),b.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return b.plugins[T.name]=T,b.plugins[T.name].loaded||(b.plugins[T.name].loaded=function(){return!0}),b},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:Br,setItem:Hr,removeItem:mt},i=(function(b){return function(T,k,H){return k.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:ad(b)[T]||Br(Ko(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(b){return!zo.includes(b)}).sort(),u=new Set(s.concat(Zt).filter(function(b){return!zo.includes(b)})),c=Array.from(u).sort(),l=function(){return o},f=new ny,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Gg(),R=ad(a),I=ee({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=_n());var g=ee({enable:function(b,T){return new Promise(function(k){m.dispatch({type:Z.enablePlugin,plugins:$o(b),_:{originalAction:Z.enablePlugin}},k,[T])})},disable:function(b,T){return new Promise(function(k){m.dispatch({type:Z.disablePlugin,plugins:$o(b),_:{originalAction:Z.disablePlugin}},k,[T])})}},n.methods),w=!1,y={identify:function(b,T,k,H){try{var J=Tr(b)?b:null,Y=Fe(b)?b:T,le=k||{},ne=y.user();Hr(Ko(Pr),J);var ue=J||Y.userId||i(Pr,y,Y);return Promise.resolve(new Promise(function(ae){m.dispatch(ee({type:Z.identifyStart,userId:ue,traits:Y||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==J&&{previousId:ne.id}),ae,[T,k,H])}))}catch(ae){return Promise.reject(ae)}},track:function(b,T,k,H){try{var J=Fe(b)?b.event:b;if(!J||!Tr(J))throw new Error("EventMissing");var Y=Fe(b)?b:T||{},le=Fe(k)?k:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:Z.trackStart,event:J,properties:Y,options:le,userId:i(Pr,y,T),anonymousId:i(nt,y,T)},ne,[T,k,H])}))}catch(ne){return Promise.reject(ne)}},page:function(b,T,k){try{var H=Fe(b)?b:{},J=Fe(T)?T:{};return Promise.resolve(new Promise(function(Y){m.dispatch({type:Z.pageStart,properties:ly(H),options:J,userId:i(Pr,y,H),anonymousId:i(nt,y,H)},Y,[b,T,k])}))}catch(Y){return Promise.reject(Y)}},user:function(b){if(b===Pr||b==="id")return i(Pr,y);if(b===nt||b==="anonId")return i(nt,y);var T=y.getState("user");return b?Xf(T,b):T},reset:function(b){return new Promise(function(T){m.dispatch({type:Z.resetStart},T,b)})},ready:function(b){return w&&b({plugins:g,instance:y}),y.on(Z.ready,function(T){b&&b(T),w=!0})},on:function(b,T){if(!b||!Be(T))return!1;if(b===Z.bootstrap)throw new Error(".on disabled for "+b);var k=/Start$|Start:/;if(b==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(k)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},J=function(ne){return function(ue){return function(ae){return ae.type.match(k)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,Kt),v(J,Jt),function(){d(H,Kt),d(J,Jt)}}var Y=b.match(k)?Kt:Jt,le=function(ne){return function(ue){return function(ae){return ae.type===b&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,Y),function(){return d(le,Y)}},once:function(b,T){if(!b||!Be(T))return!1;if(b===Z.bootstrap)throw new Error(".once disabled for "+b);var k=y.on(b,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),k()});return k},getState:function(b){var T=m.getState();return b?Xf(T,b):Object.assign({},T)},dispatch:function(b){var T=Tr(b)?{type:b}:b;if(Zt.includes(T.type))throw new Error("reserved action "+T.type);var k=ee({},T,{_:ee({originalAction:T.type},b._||{})});m.dispatch(k)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(b,T,k){m.dispatch({type:Z.setItemStart,key:b,value:T,options:k})},removeItem:function(b,T){m.dispatch({type:Z.removeItemStart,key:b,options:T})}},setAnonymousId:function(b,T){y.storage.setItem(Or,b,T)},events:{core:Zt,plugins:s}},A=n.middlewares.concat([function(b){return function(T){return function(k){return k.meta||(k.meta=gd()),T(k)}}},h(Kt),ry(y,l,{all:c,plugins:s}),ty(a),Yg(y),Xg(y),h(Jt)]),$={context:vy,user:Qg(a),page:dy,track:oy,plugins:ay(l),queue:uy},j=lt,G=lt;if(_e&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?Ih():Fe(typeof arguments[0])?md():md().apply(null,arguments)}}var re,x=(function(b){return Object.keys(b).reduce(function(T,k){return hy.includes(k)||(T[k]=b[k]),T},{})})(e),M=n.pluginsArray.reduce(function(b,T){var k=T.name,H=T.config,J=T.loaded,Y=n.pluginEnabled[k];return b[k]={enabled:Y,initialized:!!Y&&!T.initialize,loaded:!!J({config:H}),config:H},b},{}),N={context:x,user:I,plugins:M},m=dh((function(b){for(var T=Object.keys(b),k={},H=0;H<T.length;H++){var J=T[H];typeof b[J]===Er&&(k[J]=b[J])}var Y,le=Object.keys(k);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:Wo})===pr||typeof ae(void 0,{type:zg})===pr)throw new Error(kt+" "+ue+" "+pr)})})(k)}catch(ne){Y=ne}return function(ne,ue){if(ne===void 0&&(ne={}),Y)throw Y;for(var ae=!1,Re={},xe=0;xe<le.length;xe++){var je=le[xe],$e=ne[je],Xe=(0,k[je])($e,ue);if(typeof Xe===pr){var Sr=Kg(je,ue);throw new Error(Sr)}Re[je]=Xe,ae=ae||Xe!==$e}return ae?Re:ne}})(ee({},$,r)),N,G(j(Jg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(b,T,k){var H=ee({},b,{meta:gd(b.meta,T,$o(k))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:Z.bootstrap,plugins:C,config:x,params:S,user:I,initialUser:t,persistedUser:R});var U=C.filter(function(b){return n.pluginEnabled[b]}),F=C.filter(function(b){return!n.pluginEnabled[b]});return m.dispatch({type:Z.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(b,T){var k=b.bootstrap,H=b.config,J=b.name;k&&Be(k)&&k({instance:y,config:H,payload:b}),m.dispatch({type:Z.registerPluginType(J),name:J,enabled:n.pluginEnabled[J],plugin:b}),n.pluginsArray.length===T+1&&m.dispatch({type:Z.initializeStart,plugins:U,disabled:F})}),my(function(b){m.dispatch({type:b?Z.offline:Z.online})}),(function(b,T,k){setInterval(function(){return hh(b,T,k)},3e3)})(m,l,y),y}var Kt="before",Jt="after",Dr="cookie",Lr=Rh(),Ph=An,yy=An;function Eh(e){return Lr?An(e,"",-1):mt(e)}function Rh(){if(Lr!==void 0)return Lr;var e=Dr+Dr;try{An(e,e),Lr=document.cookie.indexOf(e)!==-1,Eh(e)}catch{Lr=!1}return Lr}function An(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Lr===!1&&(o?Hr(e,r):Br(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var mr="localStorage",wy=Cs.bind(null,mr);gt(mr,"getItem",Br);gt(mr,"setItem",Hr);gt(mr,"removeItem",mt);var gr="sessionStorage",by=Cs.bind(null,gr);gt(gr,"getItem",Br);gt(gr,"setItem",Hr);gt(gr,"removeItem",mt);function ot(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var Sy=wy(),Iy=by(),Py=Rh();function Mr(e,r){if(e){var t=_s(r),n=!$s(t),a=As(t)?ot(localStorage.getItem(e)):void 0;if(n&&!tt(a))return a;var i=ks(t)?ot(Ph(e)):void 0;if(n&&i)return i;var o=qs(t)?ot(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=Br(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function cn(e,r,t){if(e&&!tt(r)){var n={},a=_s(t),i=JSON.stringify(r),o=!$s(a);return As(a)&&(n[mr]=Yt(mr,r,ot(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[mr]:ks(a)&&(n[Dr]=Yt(Dr,r,ot(Ph(e))),yy(e,i),o)?n[Dr]:qs(a)&&(n[gr]=Yt(gr,r,ot(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[gr]:(n[Nr]=Yt(Nr,r,Br(e)),Hr(e,r),o?n[Nr]:n)}}function Ey(e,r){if(e){var t=_s(r),n=Mr(e,oh),a={};return!tt(n.localStorage)&&As(t)&&(localStorage.removeItem(e),a[mr]=n.localStorage),!tt(n.cookie)&&ks(t)&&(Eh(e),a[Dr]=n.cookie),!tt(n.sessionStorage)&&qs(t)&&(sessionStorage.removeItem(e),a[gr]=n.sessionStorage),!tt(n.global)&&kn(t,Nr)&&(mt(e),a[Nr]=n.global),a}}function _s(e){return e?Tr(e)?e:e.storage:ih}function As(e){return Sy&&kn(e,mr)}function ks(e){return Py&&kn(e,Dr)}function qs(e){return Iy&&kn(e,gr)}function $s(e){return e===oh||e==="all"}function kn(e,r){return e===ih||e===r||$s(e)}function Yt(e,r,t){return{location:e,current:r,previous:t}}var Ry={setItem:cn,getItem:Mr,removeItem:Ey};function Ty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function yd(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function wd(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?yd(Object(t),!0).forEach(function(n){Ty(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yd(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Oy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Ry};return gy(wd(wd({},r),e))}function Cy(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=Ay(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function _y(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function Ay(e){return["#","?"].forEach(r=>e=_y(e,r)),e}function ky(){Cy(()=>{fr.page()})}var Lo="up",Uo="down";function qy(e){if(e===void 0&&(e={}),!_e)return Go;var r=Sd(),t=Jo(),n=bd(),a=Qt(n,r),i=Qt(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Go;var d=v.map(function(p){return Number(p)}),h=Vg(function(){var p=Sd(),S=(function(x,M){return M.map(function(N){return N===100?x-5:x*(N/100)})})(p,d),R=Jo(),I=bd(),g=Qt(I,p),w=Qt(R,p);if(l=g>l?g:l,f=w<f?w:f,!(o.length>=d.length)){var y=c===I,A=Lo;y?A="initial":c<=I&&(A=Uo);var $=S,j=d;(A===Lo||y)&&($=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(x,M,N){var m=$[N];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),x.singleFunction=M),A===Uo&&!o.includes(M)&&I>=m&&M>i?(s.push(M),x.callbacks=x.callbacks.concat(M),x):A===Lo&&!o.includes(M)&&I<=m&&M<=g?(x.foundFunc=[M],x):(y&&I>=m&&x.foundFunc.length===0&&(x.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),x.singleFunction?u.push(M):x.singleFunction=M),x)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===Uo&&G.callbacks&&G.callbacks.forEach(function(x){Be(e[x])&&(e[x]({trigger:x,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(x))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Be(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function Jo(){return _e?document.body.scrollTop||document.documentElement.scrollTop:0}function $y(){return _e?window.innerHeight||document.documentElement.clientHeight:0}function bd(){return Math.round(Jo()+$y())}function Sd(){if(!_e)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Qt(e,r){return Math.round(e/r*100)}var Ls="Event",Id=Ls+"Listener";function Ly(e){return function(r,t,n,a){var i=n||Go,o=a||!1;if(!_e)return i;var s=ln(t),u=ln(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+Ls);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+Id:"remove"+Id,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?Uy(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function ln(e,r){if(Tr(e))return r?ln(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Fg(e);return r?i.map(function(o){return Tr(o)?ln(o,!0):o}).flat():i}function Uy(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var xo=Ly(Ls);function Th(e,r){return _e&&Be(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Be(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}Th.bind(null,"onerror");Th.bind(null,"onload");var Oh=typeof window>"u",Pd="hidden";function xy(e){if(Oh)return!1;var r=Ny(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ny(){var e=["webkit","moz","ms","o"];return Oh||Pd in document?Pd:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var jy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Dy(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=xy(function(s){s||t({type:"tabVisible"})});return n=[o].concat(jy.map(function(s){return xo(document,s,t)})).concat(xo(window,"load",t)).concat(xo(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function My(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Pt(v),S),a&&l&&(l=!1,a(Pt(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Pt(v),S))},s)}var p=Dy(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Pt(v,f),idle:l?Pt(t,f):0}}}}function Pt(e,r){return r?0:Math.round((new Date-e)/1e3)}const Ed=5e3;class Fy{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),My({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:Ed}),qy({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(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*Ed:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Us(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function By(){return new Promise(e=>{Us(()=>e())})}function Hy(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const Rd="sesamy_session_id";function Gy(){let e=sessionStorage.getItem(Rd);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Rd,e)),e}let Ch=!1,en,fn,Yo;function _h(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:Yo,requestId:Math.random().toString(36).slice(2,9),sessionId:Gy(),timestamp:new Date().toISOString(),version:Bt,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:Rs,userAgent:navigator.userAgent,clientId:Yo}}}))}const Ah=Hy(async e=>{if(e.length>0){const r=_h(e);Ch?navigator.sendBeacon(fn,r):(await fetch(fn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function No(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(fn,_h([r]))}else Ah.push(e)}function Wy(){return Ch=!0,Ah.flush()}function Vy(e,r,t){en=r,fn=`${ir("logs",t)}/events`,Yo=e}const zy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;No({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;No({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!en)return;const{properties:r,anonymousId:t,userId:n}=e;No({anonymousId:t,userId:n,properties:r,type:"identify"})}},Td=["source","medium","campaign","term","content"],Rr="utm_",Ky=1800*1e3;function kh(e){return e?Date.now()-parseInt(e,10)>Ky:!0}function Od(){const e=document.referrer||"";if(!e)return;const r=Mr(`${Rr}set_at`);(kh(r)||!Mr(`${Rr}referrer`))&&cn(`${Rr}referrer`,e)}function Jy(){const e=()=>{const t={};for(const a of Td){const i=Mr(`${Rr}${a}`);i&&(t[`utm_${a}`]=i)}const n=Mr(`${Rr}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){Od()},campaign({payload:t}){const n=t?.campaign||{},a=Mr(`${Rr}set_at`);if(Object.keys(n).length>0&&kh(a)){for(const o of Td){const s=n[o];s&&cn(`${Rr}${o}`,s)}cn(`${Rr}set_at`,String(Date.now()))}Od()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const Yy=Jy(),Cd=new Map,_d=new Map;function Qy({clientId:e,enabled:r=!0,environment:t}){Vy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{_d.forEach((n,a)=>{n.bind(a)()}),Wy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Cd.forEach((n,a)=>{n.bind(a)()})}),ky(),Us(()=>{const n=new Fy({element:document.body,viewCallback:()=>{fr.page()},activeDurationCallback:(a,i,o)=>{fr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{fr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{fr.track("scroll",{scroll:a.scrollMax})}});_d.set(document.body,()=>{n.flush()}),Cd.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(ze.AUTHENTICATED,async n=>{const a=n;await fr.identify(a.detail.sub)}),window.addEventListener(ze.LOGOUT,async()=>{await fr.track("logout",{}),await fr.reset()}))}const fr=Oy({app:Rs,version:Bt,plugins:[Yy,zy]});function qh(e,r){fr.track(e,r)}const Xy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function $h(){return new Promise(e=>{const r=Xy.map(t=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function Lh(){const e=navigator.userAgent.toLowerCase(),r=[{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 t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
4
4
  *
5
5
  * detectIncognito v1.6.2
6
6
  *
@@ -30,7 +30,7 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
30
30
  *
31
31
  * Please keep this comment intact in order to properly abide by the MIT License.
32
32
  *
33
- **/var Qo={d:(e,r)=>{for(var t in r)Qo.o(r,t)&&!Qo.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},Ls={};Qo.d(Ls,{A:()=>Xy,k:()=>xs});var Et=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function o(c){try{u(n.next(c))}catch(l){i(l)}}function s(c){try{u(n.throw(c))}catch(l){i(l)}}function u(c){var l;c.done?a(c.value):(l=c.value,l instanceof t?l:new t(function(f){f(l)})).then(o,s)}u((n=n.apply(e,[])).next())})},Rt=function(e,r){var t,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(c){return(function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(t=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||l[0]!==6&&l[0]!==2)){o=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(l[0]===6&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=r.call(e,o)}catch(f){l=[6,f],n=0}finally{t=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}})([u,c])}}};function xs(){return Et(this,void 0,Promise,function(){return Rt(this,function(e){switch(e.label){case 0:return[4,new Promise(function(r,t){var n="Unknown",a=!1;function i(v){a||(a=!0,r({isPrivate:v,browserName:n}))}function o(){var v=0,d=parseInt("-1");try{d.toFixed(d)}catch(h){v=h.message.length}return v}function s(){return Et(this,void 0,void 0,function(){var v,d;return Rt(this,function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return h.sent(),i(!1),[3,3];case 2:return v=h.sent(),d=v instanceof Error&&typeof v.message=="string"?v.message:String(v),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var v;return Et(this,void 0,Promise,function(){return Rt(this,function(d){switch(d.label){case 0:return typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var h=String(Math.random());try{var p=indexedDB.open(h,1);p.onupgradeneeded=function(S){var R=S.target.result,I=function(g){i(g)};try{R.createObjectStore("t",{autoIncrement:!0}).put(new Blob),I(!1)}catch(g){(g instanceof Error&&typeof g.message=="string"?g.message:String(g)).includes("are not yet supported")?I(!0):I(!1)}finally{R.close(),indexedDB.deleteDatabase(h)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var h=window.openDatabase,p=window.localStorage;try{h(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 c(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(v,d){var h=Math.round(d/1048576),p=2*Math.round((function(){var S,R,I,g=window;return(I=(R=(S=g?.performance)===null||S===void 0?void 0:S.memory)===null||R===void 0?void 0:R.jsHeapSizeLimit)!==null&&I!==void 0?I:1073741824})()/1048576);i(h<p)},function(v){t(new Error("detectIncognito somehow failed to query storage quota: "+v.message))})}function l(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?c():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var v;return Et(this,void 0,Promise,function(){var d,h,p;return Rt(this,function(S){switch(S.label){case 0:if(typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function")return[3,5];S.label=1;case 1:return S.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return S.sent(),i(!1),[3,4];case 3:return d=S.sent(),h=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(h.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(R){p.error&&p.error.name==="InvalidStateError"&&R.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},S.label=6;case 6:return[2]}})})}(function(){return Et(this,void 0,Promise,function(){return Rt(this,function(v){switch(v.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return v.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",l(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return v.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):t(new Error("detectIncognito cannot determine the browser")),v.label=6;case 6:return[2]}var d})})})().catch(t)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=xs);const Xy=xs;Ls.A;const Zy=Ls.k,rn="sesamy_incognito_mode";function Lh(){try{const e=sessionStorage.getItem(rn);return e===null?void 0:e==="true"}catch{return}}async function xh(){try{const e=sessionStorage.getItem(rn);if(e!==null)return e==="true";const{isPrivate:r}=await Zy();return sessionStorage.setItem(rn,r.toString()),r}catch{try{sessionStorage.setItem(rn,"false")}catch{}return!1}}function ew(e,r,t=!1){const n={name:e,data:r},a=new CustomEvent(e,{detail:n,cancelable:t,bubbles:!0});qh(`event:${e}`,{...r,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return t&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function rw(e,r){e.cancelable&&(e.detail.cancellationMessage=r,e.preventDefault())}const tw=["sesamy","__sesamy","__anon_id","auth0","a0","_legacy_auth0"],nw=["access_token","id_token","refresh_token","token"];function Xo(e){const r=e.split(".");return r.length===3?`${r[0]}.${r[1]}.[REDACTED]`:e}function Nh(e){const r=e.toLowerCase();return nw.some(t=>r.includes(t))}function jh(e){const r=e.split(".");return r.length===3&&r.every(t=>t.length>0)}function _d(e){const r=[];for(let t=0;t<e.length;t++){const n=e.key(t);if(!n)continue;if(tw.some(i=>n.toLowerCase().startsWith(i.toLowerCase()))){let i=e.getItem(n)||"",o=!1;(Nh(n)||jh(i))&&(i=Xo(i),o=!0);try{const s=JSON.parse(i);if(typeof s=="object"&&s!==null){const u=Zo(s);u.wasRedacted&&(i=JSON.stringify(u.value),o=!0)}}catch{}r.push({key:n,value:i,redacted:o})}}return r}function Zo(e){if(e==null)return{value:e,wasRedacted:!1};if(typeof e=="string")return jh(e)?{value:Xo(e),wasRedacted:!0}:{value:e,wasRedacted:!1};if(Array.isArray(e)){let r=!1;return{value:e.map(n=>{const a=Zo(n);return a.wasRedacted&&(r=!0),a.value}),wasRedacted:r}}if(typeof e=="object"){let r=!1;const t={};for(const[n,a]of Object.entries(e))if(Nh(n)&&typeof a=="string")t[n]=Xo(a),r=!0;else{const i=Zo(a);i.wasRedacted&&(r=!0),t[n]=i.value}return{value:t,wasRedacted:r}}return{value:e,wasRedacted:!1}}function aw(){const e=navigator;return{userAgent:e.userAgent,platform:e.platform,language:e.language,languages:[...e.languages||[]],cookiesEnabled:e.cookieEnabled,onLine:e.onLine,hardwareConcurrency:e.hardwareConcurrency,deviceMemory:e.deviceMemory,maxTouchPoints:e.maxTouchPoints,vendor:e.vendor,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,screenWidth:screen.width,screenHeight:screen.height,pixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}async function iw(){await xh();const[e]=await Promise.all([$h()]),r=Uh();return{adBlockEnabled:e,incognitoMode:Lh()??!1,inAppBrowser:r.isInAppBrowser}}async function Dh(e){const r=[],t={timestamp:new Date().toISOString(),sdkVersion:Bt,clientId:e.clientId,fallbackId:e.fallbackId};t.pageUrl=window.location.href,t.pageTitle=document.title;try{t.browser=aw()}catch(a){r.push(`Browser info collection failed: ${a.message}`)}try{t.detection=await iw()}catch(a){r.push(`Detection collection failed: ${a.message}`)}try{t.localStorage=_d(localStorage)}catch(a){r.push(`LocalStorage collection failed: ${a.message}`)}try{t.sessionStorage=_d(sessionStorage)}catch(a){r.push(`SessionStorage collection failed: ${a.message}`)}if(await or()){try{const a=await dr(!1);if(a){const i=a.split(".");if(i.length>=2){const o=JSON.parse(atob(i[1]));t.userId=o.sub}}}catch(a){r.push(`User ID extraction failed: ${a.message}`)}if(e.getProfile)try{t.profile=await e.getProfile()||void 0}catch(a){r.push(`Profile collection failed: ${a.message}`)}if(e.getEntitlements)try{t.entitlements=await e.getEntitlements()}catch(a){r.push(`Entitlements collection failed: ${a.message}`)}if(e.getContracts)try{t.contracts=await e.getContracts()}catch(a){r.push(`Contracts collection failed: ${a.message}`)}if(e.getTags)try{t.tags=await e.getTags()}catch(a){r.push(`Tags collection failed: ${a.message}`)}if(e.getTallies)try{t.tallies=await e.getTallies()}catch(a){r.push(`Tallies collection failed: ${a.message}`)}}return r.length>0&&(t.errors=r),t}async function ow(e,r,t){const a=`${ir("api2",r)}/diagnostics`,i={"Content-Type":"application/json"};if(await or())try{const s=await dr(!1);s&&(i.Authorization=`Bearer ${s}`)}catch{}if(!i.Authorization&&t){const s=localStorage.getItem("__anon_id")?.replace(/"/g,"")||"",u=btoa(`${t}|${s}:`);i.Authorization=`Basic ${u}`}const o=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(e)});if(!o.ok){const s=await o.text();throw new Error(`Failed to submit diagnostics: ${s}`)}return o.json()}const Ad="user-diagnostics",kd="diagnostics-id",sw=`
33
+ **/var Qo={d:(e,r)=>{for(var t in r)Qo.o(r,t)&&!Qo.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},xs={};Qo.d(xs,{A:()=>Zy,k:()=>Ns});var Et=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function o(c){try{u(n.next(c))}catch(l){i(l)}}function s(c){try{u(n.throw(c))}catch(l){i(l)}}function u(c){var l;c.done?a(c.value):(l=c.value,l instanceof t?l:new t(function(f){f(l)})).then(o,s)}u((n=n.apply(e,[])).next())})},Rt=function(e,r){var t,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(c){return(function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(t=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||l[0]!==6&&l[0]!==2)){o=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(l[0]===6&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=r.call(e,o)}catch(f){l=[6,f],n=0}finally{t=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}})([u,c])}}};function Ns(){return Et(this,void 0,Promise,function(){return Rt(this,function(e){switch(e.label){case 0:return[4,new Promise(function(r,t){var n="Unknown",a=!1;function i(v){a||(a=!0,r({isPrivate:v,browserName:n}))}function o(){var v=0,d=parseInt("-1");try{d.toFixed(d)}catch(h){v=h.message.length}return v}function s(){return Et(this,void 0,void 0,function(){var v,d;return Rt(this,function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return h.sent(),i(!1),[3,3];case 2:return v=h.sent(),d=v instanceof Error&&typeof v.message=="string"?v.message:String(v),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var v;return Et(this,void 0,Promise,function(){return Rt(this,function(d){switch(d.label){case 0:return typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var h=String(Math.random());try{var p=indexedDB.open(h,1);p.onupgradeneeded=function(S){var R=S.target.result,I=function(g){i(g)};try{R.createObjectStore("t",{autoIncrement:!0}).put(new Blob),I(!1)}catch(g){(g instanceof Error&&typeof g.message=="string"?g.message:String(g)).includes("are not yet supported")?I(!0):I(!1)}finally{R.close(),indexedDB.deleteDatabase(h)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var h=window.openDatabase,p=window.localStorage;try{h(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 c(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(v,d){var h=Math.round(d/1048576),p=2*Math.round((function(){var S,R,I,g=window;return(I=(R=(S=g?.performance)===null||S===void 0?void 0:S.memory)===null||R===void 0?void 0:R.jsHeapSizeLimit)!==null&&I!==void 0?I:1073741824})()/1048576);i(h<p)},function(v){t(new Error("detectIncognito somehow failed to query storage quota: "+v.message))})}function l(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?c():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var v;return Et(this,void 0,Promise,function(){var d,h,p;return Rt(this,function(S){switch(S.label){case 0:if(typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function")return[3,5];S.label=1;case 1:return S.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return S.sent(),i(!1),[3,4];case 3:return d=S.sent(),h=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(h.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(R){p.error&&p.error.name==="InvalidStateError"&&R.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},S.label=6;case 6:return[2]}})})}(function(){return Et(this,void 0,Promise,function(){return Rt(this,function(v){switch(v.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return v.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",l(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return v.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):t(new Error("detectIncognito cannot determine the browser")),v.label=6;case 6:return[2]}var d})})})().catch(t)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Ns);const Zy=Ns;xs.A;const ew=xs.k,rn="sesamy_incognito_mode";function Uh(){try{const e=sessionStorage.getItem(rn);return e===null?void 0:e==="true"}catch{return}}async function xh(){try{const e=sessionStorage.getItem(rn);if(e!==null)return e==="true";const{isPrivate:r}=await ew();return sessionStorage.setItem(rn,r.toString()),r}catch{try{sessionStorage.setItem(rn,"false")}catch{}return!1}}function rw(e,r,t=!1){const n={name:e,data:r},a=new CustomEvent(e,{detail:n,cancelable:t,bubbles:!0});qh(`event:${e}`,{...r,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return t&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function tw(e,r){e.cancelable&&(e.detail.cancellationMessage=r,e.preventDefault())}const nw=["sesamy","__sesamy","__anon_id","auth0","a0","_legacy_auth0"],aw=["access_token","id_token","refresh_token","token"];function Xo(e){const r=e.split(".");return r.length===3?`${r[0]}.${r[1]}.[REDACTED]`:e}function Nh(e){const r=e.toLowerCase();return aw.some(t=>r.includes(t))}function jh(e){const r=e.split(".");return r.length===3&&r.every(t=>t.length>0)}function Ad(e){const r=[];for(let t=0;t<e.length;t++){const n=e.key(t);if(!n)continue;if(nw.some(i=>n.toLowerCase().startsWith(i.toLowerCase()))){let i=e.getItem(n)||"",o=!1;(Nh(n)||jh(i))&&(i=Xo(i),o=!0);try{const s=JSON.parse(i);if(typeof s=="object"&&s!==null){const u=Zo(s);u.wasRedacted&&(i=JSON.stringify(u.value),o=!0)}}catch{}r.push({key:n,value:i,redacted:o})}}return r}function Zo(e){if(e==null)return{value:e,wasRedacted:!1};if(typeof e=="string")return jh(e)?{value:Xo(e),wasRedacted:!0}:{value:e,wasRedacted:!1};if(Array.isArray(e)){let r=!1;return{value:e.map(n=>{const a=Zo(n);return a.wasRedacted&&(r=!0),a.value}),wasRedacted:r}}if(typeof e=="object"){let r=!1;const t={};for(const[n,a]of Object.entries(e))if(Nh(n)&&typeof a=="string")t[n]=Xo(a),r=!0;else{const i=Zo(a);i.wasRedacted&&(r=!0),t[n]=i.value}return{value:t,wasRedacted:r}}return{value:e,wasRedacted:!1}}function iw(){const e=navigator;return{userAgent:e.userAgent,platform:e.platform,language:e.language,languages:[...e.languages||[]],cookiesEnabled:e.cookieEnabled,onLine:e.onLine,hardwareConcurrency:e.hardwareConcurrency,deviceMemory:e.deviceMemory,maxTouchPoints:e.maxTouchPoints,vendor:e.vendor,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,screenWidth:screen.width,screenHeight:screen.height,pixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}async function ow(){await xh();const[e]=await Promise.all([$h()]),r=Lh();return{adBlockEnabled:e,incognitoMode:Uh()??!1,inAppBrowser:r.isInAppBrowser}}async function Dh(e){const r=[],t={timestamp:new Date().toISOString(),sdkVersion:Bt,clientId:e.clientId,fallbackId:e.fallbackId};t.pageUrl=window.location.href,t.pageTitle=document.title;try{t.browser=iw()}catch(a){r.push(`Browser info collection failed: ${a.message}`)}try{t.detection=await ow()}catch(a){r.push(`Detection collection failed: ${a.message}`)}try{t.localStorage=Ad(localStorage)}catch(a){r.push(`LocalStorage collection failed: ${a.message}`)}try{t.sessionStorage=Ad(sessionStorage)}catch(a){r.push(`SessionStorage collection failed: ${a.message}`)}if(await or()){try{const a=await dr(!1);if(a){const i=a.split(".");if(i.length>=2){const o=JSON.parse(atob(i[1]));t.userId=o.sub}}}catch(a){r.push(`User ID extraction failed: ${a.message}`)}if(e.getProfile)try{t.profile=await e.getProfile()||void 0}catch(a){r.push(`Profile collection failed: ${a.message}`)}if(e.getEntitlements)try{t.entitlements=await e.getEntitlements()}catch(a){r.push(`Entitlements collection failed: ${a.message}`)}if(e.getContracts)try{t.contracts=await e.getContracts()}catch(a){r.push(`Contracts collection failed: ${a.message}`)}if(e.getTags)try{t.tags=await e.getTags()}catch(a){r.push(`Tags collection failed: ${a.message}`)}if(e.getTallies)try{t.tallies=await e.getTallies()}catch(a){r.push(`Tallies collection failed: ${a.message}`)}}return r.length>0&&(t.errors=r),t}async function sw(e,r,t){const a=`${ir("api2",r)}/diagnostics`,i={"Content-Type":"application/json"};if(await or())try{const s=await dr(!1);s&&(i.Authorization=`Bearer ${s}`)}catch{}if(!i.Authorization&&t){const s=localStorage.getItem("__anon_id")?.replace(/"/g,"")||"",u=btoa(`${t}|${s}:`);i.Authorization=`Basic ${u}`}const o=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(e)});if(!o.ok){const s=await o.text();throw new Error(`Failed to submit diagnostics: ${s}`)}return o.json()}const kd="user-diagnostics",qd="diagnostics-id",uw=`
34
34
  .sesamy-diagnostics-modal {
35
35
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
36
36
  background: white;
@@ -127,8 +127,8 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
127
127
  @keyframes spin {
128
128
  to { transform: rotate(360deg); }
129
129
  }
130
- `;function uw(){const e=document.createElement("div");return e.className="sesamy-diagnostics-modal",e.innerHTML=`
131
- <style>${sw}</style>
130
+ `;function cw(){const e=document.createElement("div");return e.className="sesamy-diagnostics-modal",e.innerHTML=`
131
+ <style>${uw}</style>
132
132
  <h2>Send Diagnostics</h2>
133
133
  <p>
134
134
  Our support team has requested diagnostic information to help troubleshoot your issue.
@@ -139,7 +139,7 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
139
139
  <button class="btn-primary" data-action="send">Send Diagnostics</button>
140
140
  </div>
141
141
  <div class="status" style="display: none;"></div>
142
- `,e}function Mh(e){return new Promise(r=>{const t=uw(),{close:n}=nh(t,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=t.querySelector('[data-action="cancel"]'),i=t.querySelector('[data-action="send"]'),o=t.querySelector(".status"),s=(u,c)=>{o.style.display="block",o.className=`status ${c}`,c==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),r({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await Dh(e);s("Sending diagnostics...","loading");const c=await ow(u,e.environment,e.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),r({sent:!0,id:c.id})},1500)}catch(u){de(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function cw(e){const r=new URLSearchParams(window.location.search);if(r.get(Ad)?.toLowerCase()!=="true")return;const n=r.get(kd);n&&(e.fallbackId=n),de("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(Ad),a.searchParams.delete(kd),window.history.replaceState(null,"",a);const i=await Mh(e);i.sent?de(`Diagnostics sent with ID: ${i.id}`):de("User cancelled diagnostics")}async function lw(e){return Mh(e)}function fw(e){const{autoOnboardProduct:r,bills:t,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:c,getFulfillments:l,getProfile:f,getProxyContent:v,getSubscriptions:d,getTags:h,getTally:p,getTallies:S,getTransaction:R,hasAccess:I,isSpotifyLinked:g,linkSpotify:w,openHostedAccountPage:y,paywalls:A,paymentIssues:$,products:j,pushTally:G,requestDelivery:K,setTag:re,transactions:x,unlinkSpotify:M,updateProfile:N,userMetadata:m,vendor:C}=bg(e),L=()=>$.list(),T={analytics:{track:qh},attribution:{get:an,set:Bv},auth:{getUser:f,getTokenSilently:dr,isAuthenticated:or,loginWithRedirect:Ps,loginWithPopup:gm,login:mm,logout:ym,setToken:Mo},bills:t,browser:{detectAdblock:$h,isInAppBrowser:Uh,isIncognito:Lh},checkouts:n,clearCache:hr,content:{list:rh,get:Gt,getLanguage:Xt,hasAccess:yg,unlock:th,getPropertyFromHTML:Os,showModal:nh,showNotificationBar:wg},contracts:a,diagnostics:{send:k=>lw({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()}),collect:k=>Dh({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()})},entitlements:{...s,access:async k=>{try{const J=(await c()).find(Y=>Y.id===k||Y.sku===k);if(J?.token&&J?.url)return{id:J.id,url:J.url,token:J.token}}catch{}return s.getAccess(k)},hasAccess:I,list:c,signedLinks:Es},events:{emit:ew,cancel:rw},flags:{get:Vv,set:Wv,list:Ht,delete:zv},fulfillments:{list:l,requestDelivery:K},generateLink:u,getPaymentIssues:L,getVersion:dw,isReady:()=>exports.isInitialized,log:de,paywalls:A,paymentIssues:$,products:{...j,autoOnboard:r,linkSpotify:w},profile:{get:f,isSpotifyLinked:g,openHostedAccountPage:y,unlinkSpotify:M,update:N},proxy:{getContent:v},subscriptions:{list:d},tags:{delete:i,list:h,set:re},tallies:{delete:o,get:p,list:S,push:G},transactions:{...x,get:R},userMetadata:m,vendor:C,setToken:Mo};return e.namespace&&typeof window<"u"&&(window[e.namespace]=T),T}function dw(){return Bt}function vw(e,r){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
142
+ `,e}function Mh(e){return new Promise(r=>{const t=cw(),{close:n}=ah(t,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=t.querySelector('[data-action="cancel"]'),i=t.querySelector('[data-action="send"]'),o=t.querySelector(".status"),s=(u,c)=>{o.style.display="block",o.className=`status ${c}`,c==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),r({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await Dh(e);s("Sending diagnostics...","loading");const c=await sw(u,e.environment,e.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),r({sent:!0,id:c.id})},1500)}catch(u){de(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function lw(e){const r=new URLSearchParams(window.location.search);if(r.get(kd)?.toLowerCase()!=="true")return;const n=r.get(qd);n&&(e.fallbackId=n),de("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(kd),a.searchParams.delete(qd),window.history.replaceState(null,"",a);const i=await Mh(e);i.sent?de(`Diagnostics sent with ID: ${i.id}`):de("User cancelled diagnostics")}async function fw(e){return Mh(e)}function dw(e){const{autoOnboardProduct:r,bills:t,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:c,getFulfillments:l,getProfile:f,getProxyContent:v,getSubscriptions:d,getTags:h,getTally:p,getTallies:S,getTransaction:R,hasAccess:I,isSpotifyLinked:g,linkSpotify:w,openHostedAccountPage:y,paywalls:A,paymentIssues:$,products:j,pushTally:G,requestDelivery:K,setTag:re,transactions:x,unlinkSpotify:M,updateProfile:N,userMetadata:m,vendor:C}=bg(e),U=()=>$.list(),T={analytics:{track:qh},attribution:{get:an,set:Hv},auth:{getUser:f,getTokenSilently:dr,isAuthenticated:or,loginWithRedirect:Ps,loginWithPopup:gm,login:mm,logout:ym,setToken:Mo},bills:t,browser:{detectAdblock:$h,isInAppBrowser:Lh,isIncognito:Uh},checkouts:n,clearCache:hr,content:{list:th,get:Gt,getLanguage:Xt,hasAccess:yg,unlock:nh,getPropertyFromHTML:Os,showModal:ah,showNotificationBar:wg},contracts:a,diagnostics:{send:k=>fw({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()}),collect:k=>Dh({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()})},entitlements:{...s,access:async k=>{try{const J=(await c()).find(Y=>Y.id===k||Y.sku===k);if(J?.token&&J?.url)return{id:J.id,url:J.url,token:J.token}}catch{}return s.getAccess(k)},hasAccess:I,list:c,signedLinks:Es},events:{emit:rw,cancel:tw},flags:{get:zv,set:Vv,list:Ht,delete:Kv},fulfillments:{list:l,requestDelivery:K},generateLink:u,getPaymentIssues:U,getVersion:vw,isReady:()=>exports.isInitialized,log:de,paywalls:A,paymentIssues:$,products:{...j,autoOnboard:r,linkSpotify:w},profile:{get:f,isSpotifyLinked:g,openHostedAccountPage:y,unlinkSpotify:M,update:N},proxy:{getContent:v},subscriptions:{list:d},tags:{delete:i,list:h,set:re},tallies:{delete:o,get:p,list:S,push:G},transactions:{...x,get:R},userMetadata:m,vendor:C,setToken:Mo};return e.namespace&&typeof window<"u"&&(window[e.namespace]=T),T}function vw(){return Bt}function hw(e,r){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
143
143
  ${r.selector}::before {
144
144
  content: '';
145
145
  position: absolute;
@@ -150,4 +150,4 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
150
150
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
151
151
  pointer-events: none;
152
152
  }
153
- `,document.head.appendChild(i)}async function hw(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function Ns(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await hw(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function pw(e,r){const t=r.insertionPoint||"inside",n=await Ns(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function mw(e,r){const t=await Ns(r);e.innerHTML=t}async function gw(e,r){const t=await Ns(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function yw({enabled:e=!1,rules:r}){e&&Oh(async()=>{const t=await or(),n=window.location.href;for(const a of r){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!==t))switch(a.transform){case"insert":await pw(s,a);break;case"replace":await mw(s,a);break;case"remove":o.remove();break;case"wrap":await gw(s,a);break;case"gradient":vw(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const qd="access_token";function ww(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(qd);if(r){Mo(r);const t=new URL(window.location.href);e.delete(qd),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const $d="sesamy-refresh",Ud="force-refetch-entitlements";function bw(){const e=new URLSearchParams(window.location.search),r=e.get(Ud),t=e.get($d);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(Ud),e.delete($d),n.search=e.toString(),hr(),window.history.replaceState(null,"",n)}}const es=(e,r)=>r.some(t=>e instanceof t);let Ld,xd;function Sw(){return Ld||(Ld=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Iw(){return xd||(xd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rs=new WeakMap,jo=new WeakMap,qn=new WeakMap;function Pw(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(dn(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return qn.set(r,e),r}function Ew(e){if(rs.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});rs.set(e,r)}let ts={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return rs.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return dn(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function Fh(e){ts=e(ts)}function Rw(e){return Iw().includes(e)?function(...r){return e.apply(ns(this),r),dn(this.request)}:function(...r){return dn(e.apply(ns(this),r))}}function Tw(e){return typeof e=="function"?Rw(e):(e instanceof IDBTransaction&&Ew(e),es(e,Sw())?new Proxy(e,ts):e)}function dn(e){if(e instanceof IDBRequest)return Pw(e);if(jo.has(e))return jo.get(e);const r=Tw(e);return r!==e&&(jo.set(e,r),qn.set(r,e)),r}const ns=e=>qn.get(e),Ow=["get","getKey","getAll","getAllKeys","count"],Cw=["put","add","delete","clear"],Do=new Map;function Nd(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(Do.get(r))return Do.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=Cw.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Ow.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return Do.set(r,i),i}Fh(e=>({...e,get:(r,t,n)=>Nd(r,t)||e.get(r,t,n),has:(r,t)=>!!Nd(r,t)||e.has(r,t)}));const _w=["continue","continuePrimaryKey","advance"],jd={},as=new WeakMap,Bh=new WeakMap,Aw={get(e,r){if(!_w.includes(r))return e[r];let t=jd[r];return t||(t=jd[r]=function(...n){as.set(this,Bh.get(this)[r](...n))}),t}};async function*kw(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,Aw);for(Bh.set(t,r),qn.set(t,ns(r));r;)yield t,r=await(as.get(t)||r.continue()),as.delete(t)}function Dd(e,r){return r===Symbol.asyncIterator&&es(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&es(e,[IDBIndex,IDBObjectStore])}Fh(e=>({...e,get(r,t,n){return Dd(r,t)?kw:e.get(r,t,n)},has(r,t){return Dd(r,t)||e.has(r,t)}}));function qw(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob($w(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function $w(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function Uw(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}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 Lw(e,r){const t=new Date(e.exp*1e3);return{id:e.s?.toString()||"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function xw(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Nw(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=qw(r);if(n.valid&&!n.expired){const a=xw(n.payload,r);Yf(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=Uw(r),i=Lw(a,r);Yf(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const Md="sesamy-user";async function jw(){const r=new URLSearchParams(window.location.search).get(Md)?.toLowerCase();if(!r)return;const t=await pm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),hr(),Ps({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(Md),window.history.replaceState(null,"",n)}const Fd="sesamy-purchase";function Dw(){const e=new URLSearchParams(window.location.search),r=e.get(Fd);if(r!==null){const t=new URL(window.location.href);e.delete(Fd),t.search=e.toString(),de(`Purchase ${r}`),Lr(ze.PURCHASE,{itemSrc:r}),hr(),window.history.replaceState(null,"",t)}}const Bd="sesamy-login",Mw="sesamy_login";async function Fw(){const e=new URLSearchParams(window.location.search);if(!(e.get(Bd)||e.get(Mw)))return;await or()||Ps();const n=new URL(window.location.href);n.searchParams.delete(Bd),window.history.replaceState(null,"",n)}const Hd="sesamy-debug";async function Bw(){const r=new URLSearchParams(window.location.search).get(Hd)?.toLowerCase();if(!r)return;um(r==="true");const t=new URL(window.location.href);t.searchParams.delete(Hd),window.history.replaceState(null,"",t)}function qt(){return typeof window<"u"}function Hw(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Gw(e){if(!qt())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Hw()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Bv(t)}function Ww(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem(zf)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem(zf,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Vw(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function zw(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function Kw(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}exports.isInitialized=!1;async function Gd(e,r,t){de(`Init with config: ${JSON.stringify(e)}`);try{Ww(),Yy({clientId:e.clientId,environment:e.environment,...e.analytics}),t&&tn(t),await hm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),vg(e,r),e.transform&&await yw(e.transform),xh(),Bw(),cw({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Gw(r),ww(),bw(),Nw(),await Fw(),await jw(),Dw(),await zw(r),await Vw(r),await Kw(r),exports.isInitialized=!0,Lr(ze.READY,{})}catch(n){de(`Failed to init ${n.message}`)}}async function Hh(e,r){de("Initializing Sesamy");const t=e.api?.namespace||"sesamy";if(qt()&&t in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[t];let n=r?.authPlugin;if(!n&&!Is()&&qt()){const i=window;typeof i.auth0Plugin?.createAuth0Plugin=="function"&&(n=i.auth0Plugin.createAuth0Plugin())}const a=fw({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api,namespace:t});return qt()?(e.awaitAllServices?await Gd(e,a,n):Gd(e,a,n),a):(exports.isInitialized=!0,a)}if(qt()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent);Hh(r)}catch(r){console.error("Failed to parse config",r)}}exports.Events=ze;exports.clearMetadataCache=gg;exports.getAllLdJson=pg;exports.getAllMetaTags=Ot;exports.getContentConfig=dg;exports.getContentMetadata=eh;exports.getLdJson=_t;exports.init=Hh;exports.registerAuthPlugin=tn;
153
+ `,document.head.appendChild(i)}async function pw(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function js(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await pw(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function mw(e,r){const t=r.insertionPoint||"inside",n=await js(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function gw(e,r){const t=await js(r);e.innerHTML=t}async function yw(e,r){const t=await js(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function ww({enabled:e=!1,rules:r}){e&&Us(async()=>{const t=await or(),n=window.location.href;for(const a of r){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!==t))switch(a.transform){case"insert":await mw(s,a);break;case"replace":await gw(s,a);break;case"remove":o.remove();break;case"wrap":await yw(s,a);break;case"gradient":hw(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const $d="access_token";function bw(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get($d);if(r){Mo(r);const t=new URL(window.location.href);e.delete($d),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const Ld="sesamy-refresh",Ud="force-refetch-entitlements";function Sw(){const e=new URLSearchParams(window.location.search),r=e.get(Ud),t=e.get(Ld);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(Ud),e.delete(Ld),n.search=e.toString(),hr(),window.history.replaceState(null,"",n)}}const es=(e,r)=>r.some(t=>e instanceof t);let xd,Nd;function Iw(){return xd||(xd=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Pw(){return Nd||(Nd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rs=new WeakMap,jo=new WeakMap,qn=new WeakMap;function Ew(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(dn(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return qn.set(r,e),r}function Rw(e){if(rs.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});rs.set(e,r)}let ts={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return rs.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return dn(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function Fh(e){ts=e(ts)}function Tw(e){return Pw().includes(e)?function(...r){return e.apply(ns(this),r),dn(this.request)}:function(...r){return dn(e.apply(ns(this),r))}}function Ow(e){return typeof e=="function"?Tw(e):(e instanceof IDBTransaction&&Rw(e),es(e,Iw())?new Proxy(e,ts):e)}function dn(e){if(e instanceof IDBRequest)return Ew(e);if(jo.has(e))return jo.get(e);const r=Ow(e);return r!==e&&(jo.set(e,r),qn.set(r,e)),r}const ns=e=>qn.get(e),Cw=["get","getKey","getAll","getAllKeys","count"],_w=["put","add","delete","clear"],Do=new Map;function jd(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(Do.get(r))return Do.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=_w.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Cw.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return Do.set(r,i),i}Fh(e=>({...e,get:(r,t,n)=>jd(r,t)||e.get(r,t,n),has:(r,t)=>!!jd(r,t)||e.has(r,t)}));const Aw=["continue","continuePrimaryKey","advance"],Dd={},as=new WeakMap,Bh=new WeakMap,kw={get(e,r){if(!Aw.includes(r))return e[r];let t=Dd[r];return t||(t=Dd[r]=function(...n){as.set(this,Bh.get(this)[r](...n))}),t}};async function*qw(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,kw);for(Bh.set(t,r),qn.set(t,ns(r));r;)yield t,r=await(as.get(t)||r.continue()),as.delete(t)}function Md(e,r){return r===Symbol.asyncIterator&&es(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&es(e,[IDBIndex,IDBObjectStore])}Fh(e=>({...e,get(r,t,n){return Md(r,t)?qw:e.get(r,t,n)},has(r,t){return Md(r,t)||e.has(r,t)}}));function $w(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob(Lw(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function Lw(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function Uw(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}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 xw(e,r){const t=new Date(e.exp*1e3);return{id:e.s?.toString()||"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Nw(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function jw(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=$w(r);if(n.valid&&!n.expired){const a=Nw(n.payload,r);Qf(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=Uw(r),i=xw(a,r);Qf(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const Fd="sesamy-user";async function Dw(){const r=new URLSearchParams(window.location.search).get(Fd)?.toLowerCase();if(!r)return;const t=await pm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),hr(),Ps({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(Fd),window.history.replaceState(null,"",n)}const Bd="sesamy-purchase";function Mw(){const e=new URLSearchParams(window.location.search),r=e.get(Bd);if(r!==null){const t=new URL(window.location.href);e.delete(Bd),t.search=e.toString(),de(`Purchase ${r}`),Ur(ze.PURCHASE,{itemSrc:r}),hr(),window.history.replaceState(null,"",t)}}const Hd="sesamy-login",Fw="sesamy_login";async function Bw(){const e=new URLSearchParams(window.location.search);if(!(e.get(Hd)||e.get(Fw)))return;await or()||Ps();const n=new URL(window.location.href);n.searchParams.delete(Hd),window.history.replaceState(null,"",n)}const Gd="sesamy-debug";async function Hw(){const r=new URLSearchParams(window.location.search).get(Gd)?.toLowerCase();if(!r)return;um(r==="true");const t=new URL(window.location.href);t.searchParams.delete(Gd),window.history.replaceState(null,"",t)}function qt(){return typeof window<"u"}function Gw(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Ww(e){if(!qt())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Gw()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Hv(t)}function Vw(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem(Kf)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem(Kf,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function zw(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function Kw(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function Jw(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}exports.isInitialized=!1;async function Wd(e,r,t){de(`Init with config: ${JSON.stringify(e)}`);try{Vw(),Qy({clientId:e.clientId,environment:e.environment,...e.analytics}),t&&tn(t),await hm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),await By(),vg(e,r),e.transform&&await ww(e.transform),xh(),Hw(),lw({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Ww(r),bw(),Sw(),jw(),await Bw(),await Dw(),Mw(),await Kw(r),await zw(r),await Jw(r),exports.isInitialized=!0,Ur(ze.READY,{})}catch(n){de(`Failed to init ${n.message}`)}}async function Hh(e,r){de("Initializing Sesamy");const t=e.api?.namespace||"sesamy";if(qt()&&t in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[t];let n=r?.authPlugin;if(!n&&!Is()&&qt()){const i=window;typeof i.auth0Plugin?.createAuth0Plugin=="function"&&(n=i.auth0Plugin.createAuth0Plugin())}const a=dw({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api,namespace:t});return qt()?(e.awaitAllServices?await Wd(e,a,n):Wd(e,a,n),a):(exports.isInitialized=!0,a)}if(qt()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent);Hh(r)}catch(r){console.error("Failed to parse config",r)}}exports.Events=ze;exports.clearMetadataCache=gg;exports.getAllLdJson=pg;exports.getAllMetaTags=Ot;exports.getContentConfig=dg;exports.getContentMetadata=rh;exports.getLdJson=_t;exports.init=Hh;exports.registerAuthPlugin=tn;