@sesamy/sesamy-js 1.37.1 → 1.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sesamy-js.cjs +10 -10
- package/dist/sesamy-js.iife.js +10 -10
- package/dist/sesamy-js.mjs +6261 -5193
- package/package.json +4 -4
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";var or=Object.defineProperty;var ir=($e,De,Fe)=>De in $e?or($e,De,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):$e[De]=Fe;var Dt=($e,De,Fe)=>ir($e,typeof De!="symbol"?De+"":De,Fe);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fails$h=function($e){try{return!!$e()}catch{return!0}},fails$g=fails$h,functionBindNative=!fails$g(function(){var $e=(function(){}).bind();return typeof $e!="function"||$e.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$i=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$i,call$i),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function($e){return function(){return call$i.apply($e,arguments)}},uncurryThis$n=functionUncurryThis,toString$a=uncurryThis$n({}.toString),stringSlice$4=uncurryThis$n("".slice),classofRaw$2=function($e){return stringSlice$4(toString$a($e),8,-1)},uncurryThis$m=functionUncurryThis,fails$f=fails$h,classof$7=classofRaw$2,$Object$4=Object,split$3=uncurryThis$m("".split),indexedObject=fails$f(function(){return!$Object$4("z").propertyIsEnumerable(0)})?function($e){return classof$7($e)==="String"?split$3($e,""):$Object$4($e)}:$Object$4,isNullOrUndefined$4=function($e){return $e==null},isNullOrUndefined$3=isNullOrUndefined$4,$TypeError$c=TypeError,requireObjectCoercible$4=function($e){if(isNullOrUndefined$3($e))throw new $TypeError$c("Can't call method on "+$e);return $e},IndexedObject$1=indexedObject,requireObjectCoercible$3=requireObjectCoercible$4,toIndexedObject$5=function($e){return IndexedObject$1(requireObjectCoercible$3($e))},check=function($e){return $e&&$e.Math===Math&&$e},globalThis_1=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||Function("return this")(),sharedStore={exports:{}},isPure=!1,globalThis$n=globalThis_1,defineProperty$6=Object.defineProperty,defineGlobalProperty$3=function($e,De){try{defineProperty$6(globalThis$n,$e,{value:De,configurable:!0,writable:!0})}catch{globalThis$n[$e]=De}return De},globalThis$m=globalThis_1,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=sharedStore.exports=globalThis$m[SHARED]||defineGlobalProperty$2(SHARED,{});(store$3.versions||(store$3.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedStoreExports=sharedStore.exports,store$2=sharedStoreExports,shared$3=function($e,De){return store$2[$e]||(store$2[$e]=De||{})},requireObjectCoercible$2=requireObjectCoercible$4,$Object$3=Object,toObject$4=function($e){return $Object$3(requireObjectCoercible$2($e))},uncurryThis$l=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty=uncurryThis$l({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(De,Fe){return hasOwnProperty(toObject$3(De),Fe)},uncurryThis$k=functionUncurryThis,id=0,postfix=Math.random(),toString$9=uncurryThis$k(1 .toString),uid$2=function($e){return"Symbol("+($e===void 0?"":$e)+")_"+toString$9(++id+postfix,36)},globalThis$l=globalThis_1,navigator$1=globalThis$l.navigator,userAgent$5=navigator$1&&navigator$1.userAgent,environmentUserAgent=userAgent$5?String(userAgent$5):"",globalThis$k=globalThis_1,userAgent$4=environmentUserAgent,process$4=globalThis$k.process,Deno$1=globalThis$k.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version$1;v8&&(match=v8.split("."),version$1=match[0]>0&&match[0]<4?1:+(match[0]+match[1]));!version$1&&userAgent$4&&(match=userAgent$4.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$4.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var environmentV8Version=version$1,V8_VERSION$1=environmentV8Version,fails$e=fails$h,globalThis$j=globalThis_1,$String$5=globalThis$j.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$e(function(){var $e=Symbol("symbol detection");return!$String$5($e)||!(Object($e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",globalThis$i=globalThis_1,shared$2=shared$3,hasOwn$b=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID$1=useSymbolAsUid,Symbol$1=globalThis$i.Symbol,WellKnownSymbolsStore=shared$2("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID$1?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$h=function($e){return hasOwn$b(WellKnownSymbolsStore,$e)||(WellKnownSymbolsStore[$e]=NATIVE_SYMBOL&&hasOwn$b(Symbol$1,$e)?Symbol$1[$e]:createWellKnownSymbol("Symbol."+$e)),WellKnownSymbolsStore[$e]},documentAll=typeof document=="object"&&document.all,isCallable$l=typeof documentAll>"u"&&documentAll!==void 0?function($e){return typeof $e=="function"||$e===documentAll}:function($e){return typeof $e=="function"},isCallable$k=isCallable$l,isObject$c=function($e){return typeof $e=="object"?$e!==null:isCallable$k($e)},isObject$b=isObject$c,$String$4=String,$TypeError$b=TypeError,anObject$b=function($e){if(isObject$b($e))return $e;throw new $TypeError$b($String$4($e)+" is not an object")},objectDefineProperties={},fails$d=fails$h,descriptors=!fails$d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),DESCRIPTORS$g=descriptors,fails$c=fails$h,v8PrototypeDefineBug=DESCRIPTORS$g&&fails$c(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),objectDefineProperty={},globalThis$h=globalThis_1,isObject$a=isObject$c,document$3=globalThis$h.document,EXISTS$1=isObject$a(document$3)&&isObject$a(document$3.createElement),documentCreateElement$2=function($e){return EXISTS$1?document$3.createElement($e):{}},DESCRIPTORS$f=descriptors,fails$b=fails$h,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$f&&!fails$b(function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}),NATIVE_BIND$2=functionBindNative,call$h=Function.prototype.call,functionCall=NATIVE_BIND$2?call$h.bind(call$h):function(){return call$h.apply(call$h,arguments)},globalThis$g=globalThis_1,isCallable$j=isCallable$l,aFunction=function($e){return isCallable$j($e)?$e:void 0},getBuiltIn$c=function($e,De){return arguments.length<2?aFunction(globalThis$g[$e]):globalThis$g[$e]&&globalThis$g[$e][De]},uncurryThis$j=functionUncurryThis,objectIsPrototypeOf=uncurryThis$j({}.isPrototypeOf),getBuiltIn$b=getBuiltIn$c,isCallable$i=isCallable$l,isPrototypeOf$3=objectIsPrototypeOf,USE_SYMBOL_AS_UID=useSymbolAsUid,$Object$2=Object,isSymbol$2=USE_SYMBOL_AS_UID?function($e){return typeof $e=="symbol"}:function($e){var De=getBuiltIn$b("Symbol");return isCallable$i(De)&&isPrototypeOf$3(De.prototype,$Object$2($e))},$String$3=String,tryToString$4=function($e){try{return $String$3($e)}catch{return"Object"}},isCallable$h=isCallable$l,tryToString$3=tryToString$4,$TypeError$a=TypeError,aCallable$b=function($e){if(isCallable$h($e))return $e;throw new $TypeError$a(tryToString$3($e)+" is not a function")},aCallable$a=aCallable$b,isNullOrUndefined$2=isNullOrUndefined$4,getMethod$3=function($e,De){var Fe=$e[De];return isNullOrUndefined$2(Fe)?void 0:aCallable$a(Fe)},call$g=functionCall,isCallable$g=isCallable$l,isObject$9=isObject$c,$TypeError$9=TypeError,ordinaryToPrimitive$1=function($e,De){var Fe,Be;if(De==="string"&&isCallable$g(Fe=$e.toString)&&!isObject$9(Be=call$g(Fe,$e))||isCallable$g(Fe=$e.valueOf)&&!isObject$9(Be=call$g(Fe,$e))||De!=="string"&&isCallable$g(Fe=$e.toString)&&!isObject$9(Be=call$g(Fe,$e)))return Be;throw new $TypeError$9("Can't convert object to primitive value")},call$f=functionCall,isObject$8=isObject$c,isSymbol$1=isSymbol$2,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$g=wellKnownSymbol$h,$TypeError$8=TypeError,TO_PRIMITIVE=wellKnownSymbol$g("toPrimitive"),toPrimitive$1=function($e,De){if(!isObject$8($e)||isSymbol$1($e))return $e;var Fe=getMethod$2($e,TO_PRIMITIVE),Be;if(Fe){if(De===void 0&&(De="default"),Be=call$f(Fe,$e,De),!isObject$8(Be)||isSymbol$1(Be))return Be;throw new $TypeError$8("Can't convert object to primitive value")}return De===void 0&&(De="number"),ordinaryToPrimitive($e,De)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$2=function($e){var De=toPrimitive($e,"string");return isSymbol(De)?De:De+""},DESCRIPTORS$e=descriptors,IE8_DOM_DEFINE$1=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$a=anObject$b,toPropertyKey$1=toPropertyKey$2,$TypeError$7=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$e?V8_PROTOTYPE_DEFINE_BUG$1?function(De,Fe,Be){if(anObject$a(De),Fe=toPropertyKey$1(Fe),anObject$a(Be),typeof De=="function"&&Fe==="prototype"&&"value"in Be&&WRITABLE in Be&&!Be[WRITABLE]){var He=$getOwnPropertyDescriptor$1(De,Fe);He&&He[WRITABLE]&&(De[Fe]=Be.value,Be={configurable:CONFIGURABLE$1 in Be?Be[CONFIGURABLE$1]:He[CONFIGURABLE$1],enumerable:ENUMERABLE in Be?Be[ENUMERABLE]:He[ENUMERABLE],writable:!1})}return $defineProperty(De,Fe,Be)}:$defineProperty:function(De,Fe,Be){if(anObject$a(De),Fe=toPropertyKey$1(Fe),anObject$a(Be),IE8_DOM_DEFINE$1)try{return $defineProperty(De,Fe,Be)}catch{}if("get"in Be||"set"in Be)throw new $TypeError$7("Accessors not supported");return"value"in Be&&(De[Fe]=Be.value),De};var ceil=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(De){var Fe=+De;return(Fe>0?floor$3:ceil)(Fe)},trunc=mathTrunc,toIntegerOrInfinity$3=function($e){var De=+$e;return De!==De||De===0?0:trunc(De)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max=Math.max,min$1=Math.min,toAbsoluteIndex$2=function($e,De){var Fe=toIntegerOrInfinity$2($e);return Fe<0?max(Fe+De,0):min$1(Fe,De)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min=Math.min,toLength$1=function($e){var De=toIntegerOrInfinity$1($e);return De>0?min(De,9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$3=function($e){return toLength($e.length)},toIndexedObject$4=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$2=lengthOfArrayLike$3,createMethod$1=function($e){return function(De,Fe,Be){var He=toIndexedObject$4(De),Ke=lengthOfArrayLike$2(He);if(Ke===0)return!$e&&-1;var Ge=toAbsoluteIndex$1(Be,Ke),We;if($e&&Fe!==Fe){for(;Ke>Ge;)if(We=He[Ge++],We!==We)return!0}else for(;Ke>Ge;Ge++)if(($e||Ge in He)&&He[Ge]===Fe)return $e||Ge||0;return!$e&&-1}},arrayIncludes={includes:createMethod$1(!0),indexOf:createMethod$1(!1)},hiddenKeys$4={},uncurryThis$i=functionUncurryThis,hasOwn$a=hasOwnProperty_1,toIndexedObject$3=toIndexedObject$5,indexOf=arrayIncludes.indexOf,hiddenKeys$3=hiddenKeys$4,push$5=uncurryThis$i([].push),objectKeysInternal=function($e,De){var Fe=toIndexedObject$3($e),Be=0,He=[],Ke;for(Ke in Fe)!hasOwn$a(hiddenKeys$3,Ke)&&hasOwn$a(Fe,Ke)&&push$5(He,Ke);for(;De.length>Be;)hasOwn$a(Fe,Ke=De[Be++])&&(~indexOf(He,Ke)||push$5(He,Ke));return He},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$2=Object.keys||function(De){return internalObjectKeys$1(De,enumBugKeys$2)},DESCRIPTORS$d=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$4=objectDefineProperty,anObject$9=anObject$b,toIndexedObject$2=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$d&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(De,Fe){anObject$9(De);for(var Be=toIndexedObject$2(Fe),He=objectKeys$1(Fe),Ke=He.length,Ge=0,We;Ke>Ge;)definePropertyModule$4.f(De,We=He[Ge++],Be[We]);return De};var getBuiltIn$a=getBuiltIn$c,html$2=getBuiltIn$a("document","documentElement"),shared$1=shared$3,uid=uid$2,keys=shared$1("keys"),sharedKey$3=function($e){return keys[$e]||(keys[$e]=uid($e))},anObject$8=anObject$b,definePropertiesModule=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$2=hiddenKeys$4,html$1=html$2,documentCreateElement$1=documentCreateElement$2,sharedKey$2=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$2("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function($e){return LT+SCRIPT+GT+$e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function($e){$e.write(scriptTag("")),$e.close();var De=$e.parentWindow.Object;return $e=null,De},NullProtoObjectViaIFrame=function(){var $e=documentCreateElement$1("iframe"),De="java"+SCRIPT+":",Fe;return $e.style.display="none",html$1.appendChild($e),$e.src=String(De),Fe=$e.contentWindow.document,Fe.open(),Fe.write(scriptTag("document.F=Object")),Fe.close(),Fe.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch{}NullProtoObject=typeof document<"u"?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var $e=enumBugKeys$1.length;$e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys$1[$e]];return NullProtoObject()};hiddenKeys$2[IE_PROTO$1]=!0;var objectCreate=Object.create||function(De,Fe){var Be;return De!==null?(EmptyConstructor[PROTOTYPE]=anObject$8(De),Be=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,Be[IE_PROTO$1]=De):Be=NullProtoObject(),Fe===void 0?Be:definePropertiesModule.f(Be,Fe)},wellKnownSymbol$f=wellKnownSymbol$h,create$3=objectCreate,defineProperty$5=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$f("unscopables"),ArrayPrototype$1=Array.prototype;ArrayPrototype$1[UNSCOPABLES]===void 0&&defineProperty$5(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$3(null)});var addToUnscopables$1=function($e){ArrayPrototype$1[UNSCOPABLES][$e]=!0},iterators={},globalThis$f=globalThis_1,isCallable$f=isCallable$l,WeakMap$1=globalThis$f.WeakMap,weakMapBasicDetection=isCallable$f(WeakMap$1)&&/native code/.test(String(WeakMap$1)),createPropertyDescriptor$7=function($e,De){return{enumerable:!($e&1),configurable:!($e&2),writable:!($e&4),value:De}},DESCRIPTORS$c=descriptors,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$7,createNonEnumerableProperty$7=DESCRIPTORS$c?function($e,De,Fe){return definePropertyModule$3.f($e,De,createPropertyDescriptor$6(1,Fe))}:function($e,De,Fe){return $e[De]=Fe,$e},NATIVE_WEAK_MAP=weakMapBasicDetection,globalThis$e=globalThis_1,isObject$7=isObject$c,createNonEnumerableProperty$6=createNonEnumerableProperty$7,hasOwn$9=hasOwnProperty_1,shared=sharedStoreExports,sharedKey$1=sharedKey$3,hiddenKeys$1=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=globalThis$e.TypeError,WeakMap=globalThis$e.WeakMap,set$1,get,has,enforce=function($e){return has($e)?get($e):set$1($e,{})},getterFor=function($e){return function(De){var Fe;if(!isObject$7(De)||(Fe=get(De)).type!==$e)throw new TypeError$4("Incompatible receiver, "+$e+" required");return Fe}};if(NATIVE_WEAK_MAP||shared.state){var store$1=shared.state||(shared.state=new WeakMap);store$1.get=store$1.get,store$1.has=store$1.has,store$1.set=store$1.set,set$1=function($e,De){if(store$1.has($e))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return De.facade=$e,store$1.set($e,De),De},get=function($e){return store$1.get($e)||{}},has=function($e){return store$1.has($e)}}else{var STATE=sharedKey$1("state");hiddenKeys$1[STATE]=!0,set$1=function($e,De){if(hasOwn$9($e,STATE))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return De.facade=$e,createNonEnumerableProperty$6($e,STATE,De),De},get=function($e){return hasOwn$9($e,STATE)?$e[STATE]:{}},has=function($e){return hasOwn$9($e,STATE)}}var internalState={set:set$1,get,has,enforce,getterFor},objectGetOwnPropertyDescriptor={},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$2&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(De){var Fe=getOwnPropertyDescriptor$2(this,De);return!!Fe&&Fe.enumerable}:$propertyIsEnumerable;var DESCRIPTORS$b=descriptors,call$e=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$5=createPropertyDescriptor$7,toIndexedObject$1=toIndexedObject$5,toPropertyKey=toPropertyKey$2,hasOwn$8=hasOwnProperty_1,IE8_DOM_DEFINE=ie8DomDefine,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$b?$getOwnPropertyDescriptor:function(De,Fe){if(De=toIndexedObject$1(De),Fe=toPropertyKey(Fe),IE8_DOM_DEFINE)try{return $getOwnPropertyDescriptor(De,Fe)}catch{}if(hasOwn$8(De,Fe))return createPropertyDescriptor$5(!call$e(propertyIsEnumerableModule$1.f,De,Fe),De[Fe])};var makeBuiltIn$3={exports:{}},DESCRIPTORS$a=descriptors,hasOwn$7=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$a&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$7(FunctionPrototype$1,"name"),PROPER=EXISTS&&(function(){}).name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$a||DESCRIPTORS$a&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$h=functionUncurryThis,isCallable$e=isCallable$l,store=sharedStoreExports,functionToString=uncurryThis$h(Function.toString);isCallable$e(store.inspectSource)||(store.inspectSource=function($e){return functionToString($e)});var inspectSource$3=store.inspectSource,uncurryThis$g=functionUncurryThis,fails$a=fails$h,isCallable$d=isCallable$l,hasOwn$6=hasOwnProperty_1,DESCRIPTORS$9=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$5=internalState,enforceInternalState=InternalStateModule$5.enforce,getInternalState$2=InternalStateModule$5.get,$String$2=String,defineProperty$4=Object.defineProperty,stringSlice$3=uncurryThis$g("".slice),replace$5=uncurryThis$g("".replace),join$4=uncurryThis$g([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$9&&!fails$a(function(){return defineProperty$4(function(){},"length",{value:8}).length!==8}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function($e,De,Fe){stringSlice$3($String$2(De),0,7)==="Symbol("&&(De="["+replace$5($String$2(De),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),Fe&&Fe.getter&&(De="get "+De),Fe&&Fe.setter&&(De="set "+De),(!hasOwn$6($e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&$e.name!==De)&&(DESCRIPTORS$9?defineProperty$4($e,"name",{value:De,configurable:!0}):$e.name=De),CONFIGURABLE_LENGTH&&Fe&&hasOwn$6(Fe,"arity")&&$e.length!==Fe.arity&&defineProperty$4($e,"length",{value:Fe.arity});try{Fe&&hasOwn$6(Fe,"constructor")&&Fe.constructor?DESCRIPTORS$9&&defineProperty$4($e,"prototype",{writable:!1}):$e.prototype&&($e.prototype=void 0)}catch{}var Be=enforceInternalState($e);return hasOwn$6(Be,"source")||(Be.source=join$4(TEMPLATE,typeof De=="string"?De:"")),$e};Function.prototype.toString=makeBuiltIn$2(function(){return isCallable$d(this)&&getInternalState$2(this).source||inspectSource$2(this)},"toString");var makeBuiltInExports=makeBuiltIn$3.exports,isCallable$c=isCallable$l,definePropertyModule$2=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$c=function($e,De,Fe,Be){Be||(Be={});var He=Be.enumerable,Ke=Be.name!==void 0?Be.name:De;if(isCallable$c(Fe)&&makeBuiltIn$1(Fe,Ke,Be),Be.global)He?$e[De]=Fe:defineGlobalProperty$1(De,Fe);else{try{Be.unsafe?$e[De]&&(He=!0):delete $e[De]}catch{}He?$e[De]=Fe:definePropertyModule$2.f($e,De,{value:Fe,enumerable:!1,configurable:!Be.nonConfigurable,writable:!Be.nonWritable})}return $e},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(De){return internalObjectKeys(De,hiddenKeys)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$9=getBuiltIn$c,uncurryThis$f=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$7=anObject$b,concat$1=uncurryThis$f([].concat),ownKeys$2=getBuiltIn$9("Reflect","ownKeys")||function(De){var Fe=getOwnPropertyNamesModule.f(anObject$7(De)),Be=getOwnPropertySymbolsModule$1.f;return Be?concat$1(Fe,Be(De)):Fe},hasOwn$5=hasOwnProperty_1,ownKeys$1=ownKeys$2,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,copyConstructorProperties$2=function($e,De,Fe){for(var Be=ownKeys$1(De),He=definePropertyModule$1.f,Ke=getOwnPropertyDescriptorModule.f,Ge=0;Ge<Be.length;Ge++){var We=Be[Ge];!hasOwn$5($e,We)&&!(Fe&&hasOwn$5(Fe,We))&&He($e,We,Ke(De,We))}},fails$9=fails$h,isCallable$b=isCallable$l,replacement=/#|\.prototype\./,isForced$2=function($e,De){var Fe=data[normalize($e)];return Fe===POLYFILL?!0:Fe===NATIVE?!1:isCallable$b(De)?fails$9(De):!!De},normalize=isForced$2.normalize=function($e){return String($e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,globalThis$d=globalThis_1,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$5=createNonEnumerableProperty$7,defineBuiltIn$b=defineBuiltIn$c,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced$1=isForced_1,_export=function($e,De){var Fe=$e.target,Be=$e.global,He=$e.stat,Ke,Ge,We,Ze,Xe,Je;if(Be?Ge=globalThis$d:He?Ge=globalThis$d[Fe]||defineGlobalProperty(Fe,{}):Ge=globalThis$d[Fe]&&globalThis$d[Fe].prototype,Ge)for(We in De){if(Xe=De[We],$e.dontCallGetSet?(Je=getOwnPropertyDescriptor$1(Ge,We),Ze=Je&&Je.value):Ze=Ge[We],Ke=isForced$1(Be?We:Fe+(He?".":"#")+We,$e.forced),!Ke&&Ze!==void 0){if(typeof Xe==typeof Ze)continue;copyConstructorProperties$1(Xe,Ze)}($e.sham||Ze&&Ze.sham)&&createNonEnumerableProperty$5(Xe,"sham",!0),defineBuiltIn$b(Ge,We,Xe,$e)}},fails$8=fails$h,correctPrototypeGetter=!fails$8(function(){function $e(){}return $e.prototype.constructor=null,Object.getPrototypeOf(new $e)!==$e.prototype}),hasOwn$4=hasOwnProperty_1,isCallable$a=isCallable$l,toObject$2=toObject$4,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object$1=Object,ObjectPrototype=$Object$1.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object$1.getPrototypeOf:function($e){var De=toObject$2($e);if(hasOwn$4(De,IE_PROTO))return De[IE_PROTO];var Fe=De.constructor;return isCallable$a(Fe)&&De instanceof Fe?Fe.prototype:De instanceof $Object$1?ObjectPrototype:null},fails$7=fails$h,isCallable$9=isCallable$l,isObject$6=isObject$c,getPrototypeOf$2=objectGetPrototypeOf,defineBuiltIn$a=defineBuiltIn$c,wellKnownSymbol$e=wellKnownSymbol$h,ITERATOR$7=wellKnownSymbol$e("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$2(getPrototypeOf$2(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$6(IteratorPrototype$2)||fails$7(function(){var $e={};return IteratorPrototype$2[ITERATOR$7].call($e)!==$e});NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={});isCallable$9(IteratorPrototype$2[ITERATOR$7])||defineBuiltIn$a(IteratorPrototype$2,ITERATOR$7,function(){return this});var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$d=wellKnownSymbol$h,TO_STRING_TAG$3=wellKnownSymbol$d("toStringTag"),setToStringTag$6=function($e,De,Fe){$e&&!Fe&&($e=$e.prototype),$e&&!hasOwn$3($e,TO_STRING_TAG$3)&&defineProperty$3($e,TO_STRING_TAG$3,{configurable:!0,value:De})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$4=createPropertyDescriptor$7,setToStringTag$5=setToStringTag$6,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function($e,De,Fe,Be){var He=De+" Iterator";return $e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$4(+!Be,Fe)}),setToStringTag$5($e,He,!1),Iterators$4[He]=returnThis$1,$e},uncurryThis$e=functionUncurryThis,aCallable$9=aCallable$b,functionUncurryThisAccessor=function($e,De,Fe){try{return uncurryThis$e(aCallable$9(Object.getOwnPropertyDescriptor($e,De)[Fe]))}catch{}},isObject$5=isObject$c,isPossiblePrototype$1=function($e){return isObject$5($e)||$e===null},isPossiblePrototype=isPossiblePrototype$1,$String$1=String,$TypeError$6=TypeError,aPossiblePrototype$1=function($e){if(isPossiblePrototype($e))return $e;throw new $TypeError$6("Can't set "+$String$1($e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,isObject$4=isObject$c,requireObjectCoercible$1=requireObjectCoercible$4,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var $e=!1,De={},Fe;try{Fe=uncurryThisAccessor(Object.prototype,"__proto__","set"),Fe(De,[]),$e=De instanceof Array}catch{}return function(He,Ke){return requireObjectCoercible$1(He),aPossiblePrototype(Ke),isObject$4(He)&&($e?Fe(He,Ke):He.__proto__=Ke),He}}():void 0),$$l=_export,call$d=functionCall,FunctionName=functionName,isCallable$8=isCallable$l,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$1=objectGetPrototypeOf,setPrototypeOf$2=objectSetPrototypeOf,setToStringTag$4=setToStringTag$6,createNonEnumerableProperty$4=createNonEnumerableProperty$7,defineBuiltIn$9=defineBuiltIn$c,wellKnownSymbol$c=wellKnownSymbol$h,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$6=wellKnownSymbol$c("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function($e,De,Fe,Be,He,Ke,Ge){createIteratorConstructor$1(Fe,De,Be);var We=function(ft){if(ft===He&&Qe)return Qe;if(!BUGGY_SAFARI_ITERATORS&&ft&&ft in Je)return Je[ft];switch(ft){case KEYS:return function(){return new Fe(this,ft)};case VALUES:return function(){return new Fe(this,ft)};case ENTRIES:return function(){return new Fe(this,ft)}}return function(){return new Fe(this)}},Ze=De+" Iterator",Xe=!1,Je=$e.prototype,Ye=Je[ITERATOR$6]||Je["@@iterator"]||He&&Je[He],Qe=!BUGGY_SAFARI_ITERATORS&&Ye||We(He),et=De==="Array"&&Je.entries||Ye,tt,ct,at;if(et&&(tt=getPrototypeOf$1(et.call(new $e)),tt!==Object.prototype&&tt.next&&(getPrototypeOf$1(tt)!==IteratorPrototype&&(setPrototypeOf$2?setPrototypeOf$2(tt,IteratorPrototype):isCallable$8(tt[ITERATOR$6])||defineBuiltIn$9(tt,ITERATOR$6,returnThis)),setToStringTag$4(tt,Ze,!0))),PROPER_FUNCTION_NAME&&He===VALUES&&Ye&&Ye.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$4(Je,"name",VALUES):(Xe=!0,Qe=function(){return call$d(Ye,this)})),He)if(ct={values:We(VALUES),keys:Ke?Qe:We(KEYS),entries:We(ENTRIES)},Ge)for(at in ct)(BUGGY_SAFARI_ITERATORS||Xe||!(at in Je))&&defineBuiltIn$9(Je,at,ct[at]);else $$l({target:De,proto:!0,forced:BUGGY_SAFARI_ITERATORS||Xe},ct);return Je[ITERATOR$6]!==Qe&&defineBuiltIn$9(Je,ITERATOR$6,Qe,{name:He}),Iterators$3[De]=Qe,ct},createIterResultObject$3=function($e,De){return{value:$e,done:De}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$1,Iterators$2=iterators,InternalStateModule$4=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$2=createIterResultObject$3,DESCRIPTORS$8=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$4=InternalStateModule$4.set,getInternalState$1=InternalStateModule$4.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",function($e,De){setInternalState$4(this,{type:ARRAY_ITERATOR,target:toIndexedObject($e),index:0,kind:De})},function(){var $e=getInternalState$1(this),De=$e.target,Fe=$e.index++;if(!De||Fe>=De.length)return $e.target=null,createIterResultObject$2(void 0,!0);switch($e.kind){case"keys":return createIterResultObject$2(Fe,!1);case"values":return createIterResultObject$2(De[Fe],!1)}return createIterResultObject$2([Fe,De[Fe]],!1)},"values"),values=Iterators$2.Arguments=Iterators$2.Array;addToUnscopables("keys");addToUnscopables("values");addToUnscopables("entries");if(DESCRIPTORS$8&&values.name!=="values")try{defineProperty$2(values,"name",{value:"values"})}catch{}var $$k=_export,uncurryThis$d=functionUncurryThis,toAbsoluteIndex=toAbsoluteIndex$2,$RangeError$1=RangeError,fromCharCode$2=String.fromCharCode,$fromCodePoint=String.fromCodePoint,join$3=uncurryThis$d([].join),INCORRECT_LENGTH=!!$fromCodePoint&&$fromCodePoint.length!==1;$$k({target:"String",stat:!0,arity:1,forced:INCORRECT_LENGTH},{fromCodePoint:function(De){for(var Fe=[],Be=arguments.length,He=0,Ke;Be>He;){if(Ke=+arguments[He++],toAbsoluteIndex(Ke,1114111)!==Ke)throw new $RangeError$1(Ke+" is not a valid code point");Fe[He]=Ke<65536?fromCharCode$2(Ke):fromCharCode$2(((Ke-=65536)>>10)+55296,Ke%1024+56320)}return join$3(Fe,"")}});var globalThis$c=globalThis_1,DESCRIPTORS$7=descriptors,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn$2=function($e){if(!DESCRIPTORS$7)return globalThis$c[$e];var De=getOwnPropertyDescriptor(globalThis$c,$e);return De&&De.value},fails$6=fails$h,wellKnownSymbol$b=wellKnownSymbol$h,DESCRIPTORS$6=descriptors,IS_PURE=isPure,ITERATOR$5=wellKnownSymbol$b("iterator"),urlConstructorDetection=!fails$6(function(){var $e=new URL("b?a=1&b=2&c=3","https://a"),De=$e.searchParams,Fe=new URLSearchParams("a=1&a=2&b=3"),Be="";return $e.pathname="c%20d",De.forEach(function(He,Ke){De.delete("b"),Be+=Ke+He}),Fe.delete("a",2),Fe.delete("b",void 0),IS_PURE&&(!$e.toJSON||!Fe.has("a",1)||Fe.has("a",2)||!Fe.has("a",void 0)||Fe.has("b"))||!De.size&&(IS_PURE||!DESCRIPTORS$6)||!De.sort||$e.href!=="https://a/c%20d?a=1&c=3"||De.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!De[ITERATOR$5]||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"||Be!=="a1c3"||new URL("https://x",void 0).host!=="x"}),makeBuiltIn=makeBuiltInExports,defineProperty$1=objectDefineProperty,defineBuiltInAccessor$4=function($e,De,Fe){return Fe.get&&makeBuiltIn(Fe.get,De,{getter:!0}),Fe.set&&makeBuiltIn(Fe.set,De,{setter:!0}),defineProperty$1.f($e,De,Fe)},defineBuiltIn$8=defineBuiltIn$c,defineBuiltIns$1=function($e,De,Fe){for(var Be in De)defineBuiltIn$8($e,Be,De[Be],Fe);return $e},isPrototypeOf$2=objectIsPrototypeOf,$TypeError$5=TypeError,anInstance$3=function($e,De){if(isPrototypeOf$2(De,$e))return $e;throw new $TypeError$5("Incorrect invocation")},classofRaw$1=classofRaw$2,uncurryThis$c=functionUncurryThis,functionUncurryThisClause=function($e){if(classofRaw$1($e)==="Function")return uncurryThis$c($e)},uncurryThis$b=functionUncurryThisClause,aCallable$8=aCallable$b,NATIVE_BIND$1=functionBindNative,bind$7=uncurryThis$b(uncurryThis$b.bind),functionBindContext=function($e,De){return aCallable$8($e),De===void 0?$e:NATIVE_BIND$1?bind$7($e,De):function(){return $e.apply(De,arguments)}},wellKnownSymbol$a=wellKnownSymbol$h,TO_STRING_TAG$2=wellKnownSymbol$a("toStringTag"),test={};test[TO_STRING_TAG$2]="z";var toStringTagSupport=String(test)==="[object z]",TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$7=isCallable$l,classofRaw=classofRaw$2,wellKnownSymbol$9=wellKnownSymbol$h,TO_STRING_TAG$1=wellKnownSymbol$9("toStringTag"),$Object=Object,CORRECT_ARGUMENTS=classofRaw(function(){return arguments}())==="Arguments",tryGet=function($e,De){try{return $e[De]}catch{}},classof$6=TO_STRING_TAG_SUPPORT$2?classofRaw:function($e){var De,Fe,Be;return $e===void 0?"Undefined":$e===null?"Null":typeof(Fe=tryGet(De=$Object($e),TO_STRING_TAG$1))=="string"?Fe:CORRECT_ARGUMENTS?classofRaw(De):(Be=classofRaw(De))==="Object"&&isCallable$7(De.callee)?"Arguments":Be},classof$5=classof$6,$String=String,toString$8=function($e){if(classof$5($e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String($e)},classof$4=classof$6,getMethod$1=getMethod$3,isNullOrUndefined$1=isNullOrUndefined$4,Iterators$1=iterators,wellKnownSymbol$8=wellKnownSymbol$h,ITERATOR$4=wellKnownSymbol$8("iterator"),getIteratorMethod$4=function($e){if(!isNullOrUndefined$1($e))return getMethod$1($e,ITERATOR$4)||getMethod$1($e,"@@iterator")||Iterators$1[classof$4($e)]},call$c=functionCall,aCallable$7=aCallable$b,anObject$6=anObject$b,tryToString$2=tryToString$4,getIteratorMethod$3=getIteratorMethod$4,$TypeError$4=TypeError,getIterator$3=function($e,De){var Fe=arguments.length<2?getIteratorMethod$3($e):De;if(aCallable$7(Fe))return anObject$6(call$c(Fe,$e));throw new $TypeError$4(tryToString$2($e)+" is not iterable")},$TypeError$3=TypeError,validateArgumentsLength$7=function($e,De){if($e<De)throw new $TypeError$3("Not enough arguments");return $e},uncurryThis$a=functionUncurryThis,arraySlice$3=uncurryThis$a([].slice),arraySlice$2=arraySlice$3,floor$2=Math.floor,sort=function($e,De){var Fe=$e.length;if(Fe<8)for(var Be=1,He,Ke;Be<Fe;){for(Ke=Be,He=$e[Be];Ke&&De($e[Ke-1],He)>0;)$e[Ke]=$e[--Ke];Ke!==Be++&&($e[Ke]=He)}else for(var Ge=floor$2(Fe/2),We=sort(arraySlice$2($e,0,Ge),De),Ze=sort(arraySlice$2($e,Ge),De),Xe=We.length,Je=Ze.length,Ye=0,Qe=0;Ye<Xe||Qe<Je;)$e[Ye+Qe]=Ye<Xe&&Qe<Je?De(We[Ye],Ze[Qe])<=0?We[Ye++]:Ze[Qe++]:Ye<Xe?We[Ye++]:Ze[Qe++];return $e},arraySort$1=sort,$$j=_export,globalThis$b=globalThis_1,safeGetBuiltIn$1=safeGetBuiltIn$2,getBuiltIn$8=getBuiltIn$c,call$b=functionCall,uncurryThis$9=functionUncurryThis,DESCRIPTORS$5=descriptors,USE_NATIVE_URL$3=urlConstructorDetection,defineBuiltIn$7=defineBuiltIn$c,defineBuiltInAccessor$3=defineBuiltInAccessor$4,defineBuiltIns=defineBuiltIns$1,setToStringTag$3=setToStringTag$6,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$2=anInstance$3,isCallable$6=isCallable$l,hasOwn$2=hasOwnProperty_1,bind$6=functionBindContext,classof$3=classof$6,anObject$5=anObject$b,isObject$3=isObject$c,$toString$1=toString$8,create$1=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$7,getIterator$2=getIterator$3,getIteratorMethod$2=getIteratorMethod$4,createIterResultObject$1=createIterResultObject$3,validateArgumentsLength$6=validateArgumentsLength$7,wellKnownSymbol$7=wellKnownSymbol$h,arraySort=arraySort$1,ITERATOR$3=wellKnownSymbol$7("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),nativeFetch=safeGetBuiltIn$1("fetch"),NativeRequest=safeGetBuiltIn$1("Request"),Headers=safeGetBuiltIn$1("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,TypeError$3=globalThis$b.TypeError,encodeURIComponent$1=globalThis$b.encodeURIComponent,fromCharCode$1=String.fromCharCode,fromCodePoint=getBuiltIn$8("String","fromCodePoint"),$parseInt=parseInt,charAt$3=uncurryThis$9("".charAt),join$2=uncurryThis$9([].join),push$4=uncurryThis$9([].push),replace$4=uncurryThis$9("".replace),shift$1=uncurryThis$9([].shift),splice=uncurryThis$9([].splice),split$2=uncurryThis$9("".split),stringSlice$2=uncurryThis$9("".slice),exec$3=uncurryThis$9(/./.exec),plus=/\+/g,FALLBACK_REPLACER="�",VALID_HEX=/^[0-9a-f]+$/i,parseHexOctet=function($e,De){var Fe=stringSlice$2($e,De,De+2);return exec$3(VALID_HEX,Fe)?$parseInt(Fe,16):NaN},getLeadingOnes=function($e){for(var De=0,Fe=128;Fe>0&&$e&Fe;Fe>>=1)De++;return De},utf8Decode=function($e){var De=null;switch($e.length){case 1:De=$e[0];break;case 2:De=($e[0]&31)<<6|$e[1]&63;break;case 3:De=($e[0]&15)<<12|($e[1]&63)<<6|$e[2]&63;break;case 4:De=($e[0]&7)<<18|($e[1]&63)<<12|($e[2]&63)<<6|$e[3]&63;break}return De>1114111?null:De},decode=function($e){$e=replace$4($e,plus," ");for(var De=$e.length,Fe="",Be=0;Be<De;){var He=charAt$3($e,Be);if(He==="%"){if(charAt$3($e,Be+1)==="%"||Be+3>De){Fe+="%",Be++;continue}var Ke=parseHexOctet($e,Be+1);if(Ke!==Ke){Fe+=He,Be++;continue}Be+=2;var Ge=getLeadingOnes(Ke);if(Ge===0)He=fromCharCode$1(Ke);else{if(Ge===1||Ge>4){Fe+=FALLBACK_REPLACER,Be++;continue}for(var We=[Ke],Ze=1;Ze<Ge&&(Be++,!(Be+3>De||charAt$3($e,Be)!=="%"));){var Xe=parseHexOctet($e,Be+1);if(Xe!==Xe){Be+=3;break}if(Xe>191||Xe<128)break;push$4(We,Xe),Be+=2,Ze++}if(We.length!==Ge){Fe+=FALLBACK_REPLACER;continue}var Je=utf8Decode(We);Je===null?Fe+=FALLBACK_REPLACER:He=fromCodePoint(Je)}}Fe+=He,Be++}return Fe},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function($e){return replacements[$e]},serialize=function($e){return replace$4(encodeURIComponent$1($e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor(function(De,Fe){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,target:getInternalParamsState(De).entries,index:0,kind:Fe})},URL_SEARCH_PARAMS,function(){var De=getInternalIteratorState(this),Fe=De.target,Be=De.index++;if(!Fe||Be>=Fe.length)return De.target=null,createIterResultObject$1(void 0,!0);var He=Fe[Be];switch(De.kind){case"keys":return createIterResultObject$1(He.key,!1);case"values":return createIterResultObject$1(He.value,!1)}return createIterResultObject$1([He.key,He.value],!1)},!0),URLSearchParamsState=function($e){this.entries=[],this.url=null,$e!==void 0&&(isObject$3($e)?this.parseObject($e):this.parseQuery(typeof $e=="string"?charAt$3($e,0)==="?"?stringSlice$2($e,1):$e:$toString$1($e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function($e){this.url=$e,this.update()},parseObject:function($e){var De=this.entries,Fe=getIteratorMethod$2($e),Be,He,Ke,Ge,We,Ze,Xe;if(Fe)for(Be=getIterator$2($e,Fe),He=Be.next;!(Ke=call$b(He,Be)).done;){if(Ge=getIterator$2(anObject$5(Ke.value)),We=Ge.next,(Ze=call$b(We,Ge)).done||(Xe=call$b(We,Ge)).done||!call$b(We,Ge).done)throw new TypeError$3("Expected sequence with length 2");push$4(De,{key:$toString$1(Ze.value),value:$toString$1(Xe.value)})}else for(var Je in $e)hasOwn$2($e,Je)&&push$4(De,{key:Je,value:$toString$1($e[Je])})},parseQuery:function($e){if($e)for(var De=this.entries,Fe=split$2($e,"&"),Be=0,He,Ke;Be<Fe.length;)He=Fe[Be++],He.length&&(Ke=split$2(He,"="),push$4(De,{key:decode(shift$1(Ke)),value:decode(join$2(Ke,"="))}))},serialize:function(){for(var $e=this.entries,De=[],Fe=0,Be;Fe<$e.length;)Be=$e[Fe++],push$4(De,serialize(Be.key)+"="+serialize(Be.value));return join$2(De,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$2(this,URLSearchParamsPrototype$3);var De=arguments.length>0?arguments[0]:void 0,Fe=setInternalState$3(this,new URLSearchParamsState(De));DESCRIPTORS$5||(this.size=Fe.entries.length)},URLSearchParamsPrototype$3=URLSearchParamsConstructor.prototype;defineBuiltIns(URLSearchParamsPrototype$3,{append:function(De,Fe){var Be=getInternalParamsState(this);validateArgumentsLength$6(arguments.length,2),push$4(Be.entries,{key:$toString$1(De),value:$toString$1(Fe)}),DESCRIPTORS$5||this.length++,Be.updateURL()},delete:function($e){for(var De=getInternalParamsState(this),Fe=validateArgumentsLength$6(arguments.length,1),Be=De.entries,He=$toString$1($e),Ke=Fe<2?void 0:arguments[1],Ge=Ke===void 0?Ke:$toString$1(Ke),We=0;We<Be.length;){var Ze=Be[We];if(Ze.key===He&&(Ge===void 0||Ze.value===Ge)){if(splice(Be,We,1),Ge!==void 0)break}else We++}DESCRIPTORS$5||(this.size=Be.length),De.updateURL()},get:function(De){var Fe=getInternalParamsState(this).entries;validateArgumentsLength$6(arguments.length,1);for(var Be=$toString$1(De),He=0;He<Fe.length;He++)if(Fe[He].key===Be)return Fe[He].value;return null},getAll:function(De){var Fe=getInternalParamsState(this).entries;validateArgumentsLength$6(arguments.length,1);for(var Be=$toString$1(De),He=[],Ke=0;Ke<Fe.length;Ke++)Fe[Ke].key===Be&&push$4(He,Fe[Ke].value);return He},has:function(De){for(var Fe=getInternalParamsState(this).entries,Be=validateArgumentsLength$6(arguments.length,1),He=$toString$1(De),Ke=Be<2?void 0:arguments[1],Ge=Ke===void 0?Ke:$toString$1(Ke),We=0;We<Fe.length;){var Ze=Fe[We++];if(Ze.key===He&&(Ge===void 0||Ze.value===Ge))return!0}return!1},set:function(De,Fe){var Be=getInternalParamsState(this);validateArgumentsLength$6(arguments.length,1);for(var He=Be.entries,Ke=!1,Ge=$toString$1(De),We=$toString$1(Fe),Ze=0,Xe;Ze<He.length;Ze++)Xe=He[Ze],Xe.key===Ge&&(Ke?splice(He,Ze--,1):(Ke=!0,Xe.value=We));Ke||push$4(He,{key:Ge,value:We}),DESCRIPTORS$5||(this.size=He.length),Be.updateURL()},sort:function(){var De=getInternalParamsState(this);arraySort(De.entries,function(Fe,Be){return Fe.key>Be.key?1:-1}),De.updateURL()},forEach:function(De){for(var Fe=getInternalParamsState(this).entries,Be=bind$6(De,arguments.length>1?arguments[1]:void 0),He=0,Ke;He<Fe.length;)Ke=Fe[He++],Be(Ke.value,Ke.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0});defineBuiltIn$7(URLSearchParamsPrototype$3,ITERATOR$3,URLSearchParamsPrototype$3.entries,{name:"entries"});defineBuiltIn$7(URLSearchParamsPrototype$3,"toString",function(){return getInternalParamsState(this).serialize()},{enumerable:!0});DESCRIPTORS$5&&defineBuiltInAccessor$3(URLSearchParamsPrototype$3,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0});setToStringTag$3(URLSearchParamsConstructor,URL_SEARCH_PARAMS);$$j({global:!0,constructor:!0,forced:!USE_NATIVE_URL$3},{URLSearchParams:URLSearchParamsConstructor});if(!USE_NATIVE_URL$3&&isCallable$6(Headers)){var headersHas=uncurryThis$9(HeadersPrototype.has),headersSet=uncurryThis$9(HeadersPrototype.set),wrapRequestOptions=function($e){if(isObject$3($e)){var De=$e.body,Fe;if(classof$3(De)===URL_SEARCH_PARAMS)return Fe=$e.headers?new Headers($e.headers):new Headers,headersHas(Fe,"content-type")||headersSet(Fe,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1($e,{body:createPropertyDescriptor$3(0,$toString$1(De)),headers:createPropertyDescriptor$3(0,Fe)})}return $e};if(isCallable$6(nativeFetch)&&$$j({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(De){return nativeFetch(De,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$6(NativeRequest)){var RequestConstructor=function(De){return anInstance$2(this,RequestPrototype),new NativeRequest(De,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$j({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},defineBuiltIn$6=defineBuiltIn$c,uncurryThis$8=functionUncurryThis,toString$7=toString$8,validateArgumentsLength$5=validateArgumentsLength$7,$URLSearchParams$1=URLSearchParams,URLSearchParamsPrototype$2=$URLSearchParams$1.prototype,append=uncurryThis$8(URLSearchParamsPrototype$2.append),$delete=uncurryThis$8(URLSearchParamsPrototype$2.delete),forEach$1=uncurryThis$8(URLSearchParamsPrototype$2.forEach),push$3=uncurryThis$8([].push),params$1=new $URLSearchParams$1("a=1&a=2&b=3");params$1.delete("a",1);params$1.delete("b",void 0);params$1+""!="a=2"&&defineBuiltIn$6(URLSearchParamsPrototype$2,"delete",function($e){var De=arguments.length,Fe=De<2?void 0:arguments[1];if(De&&Fe===void 0)return $delete(this,$e);var Be=[];forEach$1(this,function(Ye,Qe){push$3(Be,{key:Qe,value:Ye})}),validateArgumentsLength$5(De,1);for(var He=toString$7($e),Ke=toString$7(Fe),Ge=0,We=0,Ze=!1,Xe=Be.length,Je;Ge<Xe;)Je=Be[Ge++],Ze||Je.key===He?(Ze=!0,$delete(this,Je.key)):We++;for(;We<Xe;)Je=Be[We++],Je.key===He&&Je.value===Ke||append(this,Je.key,Je.value)},{enumerable:!0,unsafe:!0});var defineBuiltIn$5=defineBuiltIn$c,uncurryThis$7=functionUncurryThis,toString$6=toString$8,validateArgumentsLength$4=validateArgumentsLength$7,$URLSearchParams=URLSearchParams,URLSearchParamsPrototype$1=$URLSearchParams.prototype,getAll=uncurryThis$7(URLSearchParamsPrototype$1.getAll),$has=uncurryThis$7(URLSearchParamsPrototype$1.has),params=new $URLSearchParams("a=1");(params.has("a",2)||!params.has("a",void 0))&&defineBuiltIn$5(URLSearchParamsPrototype$1,"has",function(De){var Fe=arguments.length,Be=Fe<2?void 0:arguments[1];if(Fe&&Be===void 0)return $has(this,De);var He=getAll(this,De);validateArgumentsLength$4(Fe,1);for(var Ke=toString$6(Be),Ge=0;Ge<He.length;)if(He[Ge++]===Ke)return!0;return!1},{enumerable:!0,unsafe:!0});var DESCRIPTORS$4=descriptors,uncurryThis$6=functionUncurryThis,defineBuiltInAccessor$2=defineBuiltInAccessor$4,URLSearchParamsPrototype=URLSearchParams.prototype,forEach=uncurryThis$6(URLSearchParamsPrototype.forEach);DESCRIPTORS$4&&!("size"in URLSearchParamsPrototype)&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){var De=0;return forEach(this,function(){De++}),De},configurable:!0,enumerable:!0});var globalThis$a=globalThis_1,path$3=globalThis$a,path$2=path$3;path$2.URLSearchParams;var uncurryThis$5=functionUncurryThis,toIntegerOrInfinity=toIntegerOrInfinity$3,toString$5=toString$8,requireObjectCoercible=requireObjectCoercible$4,charAt$2=uncurryThis$5("".charAt),charCodeAt$1=uncurryThis$5("".charCodeAt),stringSlice$1=uncurryThis$5("".slice),createMethod=function($e){return function(De,Fe){var Be=toString$5(requireObjectCoercible(De)),He=toIntegerOrInfinity(Fe),Ke=Be.length,Ge,We;return He<0||He>=Ke?$e?"":void 0:(Ge=charCodeAt$1(Be,He),Ge<55296||Ge>56319||He+1===Ke||(We=charCodeAt$1(Be,He+1))<56320||We>57343?$e?charAt$2(Be,He):Ge:$e?stringSlice$1(Be,He,He+2):(Ge-55296<<10)+(We-56320)+65536)}},stringMultibyte={codeAt:createMethod(!1),charAt:createMethod(!0)},charAt$1=stringMultibyte.charAt,toString$4=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",function($e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$4($e),index:0})},function(){var De=getInternalState(this),Fe=De.string,Be=De.index,He;return Be>=Fe.length?createIterResultObject(void 0,!0):(He=charAt$1(Fe,Be),De.index+=He.length,createIterResultObject(He,!1))});var DESCRIPTORS$3=descriptors,uncurryThis$4=functionUncurryThis,call$a=functionCall,fails$5=fails$h,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$4,IndexedObject=indexedObject,$assign=Object.assign,defineProperty=Object.defineProperty,concat=uncurryThis$4([].concat),objectAssign=!$assign||fails$5(function(){if(DESCRIPTORS$3&&$assign({b:1},$assign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var $e={},De={},Fe=Symbol("assign detection"),Be="abcdefghijklmnopqrst";return $e[Fe]=7,Be.split("").forEach(function(He){De[He]=He}),$assign({},$e)[Fe]!==7||objectKeys($assign({},De)).join("")!==Be})?function(De,Fe){for(var Be=toObject$1(De),He=arguments.length,Ke=1,Ge=getOwnPropertySymbolsModule.f,We=propertyIsEnumerableModule.f;He>Ke;)for(var Ze=IndexedObject(arguments[Ke++]),Xe=Ge?concat(objectKeys(Ze),Ge(Ze)):objectKeys(Ze),Je=Xe.length,Ye=0,Qe;Je>Ye;)Qe=Xe[Ye++],(!DESCRIPTORS$3||call$a(We,Ze,Qe))&&(Be[Qe]=Ze[Qe]);return Be}:$assign,call$9=functionCall,anObject$4=anObject$b,getMethod=getMethod$3,iteratorClose$2=function($e,De,Fe){var Be,He;anObject$4($e);try{if(Be=getMethod($e,"return"),!Be){if(De==="throw")throw Fe;return Fe}Be=call$9(Be,$e)}catch(Ke){He=!0,Be=Ke}if(De==="throw")throw Fe;if(He)throw Be;return anObject$4(Be),Fe},anObject$3=anObject$b,iteratorClose$1=iteratorClose$2,callWithSafeIterationClosing$1=function($e,De,Fe,Be){try{return Be?De(anObject$3(Fe)[0],Fe[1]):De(Fe)}catch(He){iteratorClose$1($e,"throw",He)}},wellKnownSymbol$6=wellKnownSymbol$h,Iterators=iterators,ITERATOR$2=wellKnownSymbol$6("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$2=function($e){return $e!==void 0&&(Iterators.Array===$e||ArrayPrototype[ITERATOR$2]===$e)},uncurryThis$3=functionUncurryThis,fails$4=fails$h,isCallable$5=isCallable$l,classof$2=classof$6,getBuiltIn$7=getBuiltIn$c,inspectSource$1=inspectSource$3,noop=function(){},construct=getBuiltIn$7("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$3(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.test(noop),isConstructorModern=function(De){if(!isCallable$5(De))return!1;try{return construct(noop,[],De),!0}catch{return!1}},isConstructorLegacy=function(De){if(!isCallable$5(De))return!1;switch(classof$2(De)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource$1(De))}catch{return!0}};isConstructorLegacy.sham=!0;var isConstructor$2=!construct||fails$4(function(){var $e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){$e=!0})||$e})?isConstructorLegacy:isConstructorModern,DESCRIPTORS$2=descriptors,definePropertyModule=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$7,createProperty$1=function($e,De,Fe){DESCRIPTORS$2?definePropertyModule.f($e,De,createPropertyDescriptor$2(0,Fe)):$e[De]=Fe},bind$5=functionBindContext,call$8=functionCall,toObject=toObject$4,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod$1=isArrayIteratorMethod$2,isConstructor$1=isConstructor$2,lengthOfArrayLike$1=lengthOfArrayLike$3,createProperty=createProperty$1,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$4,$Array=Array,arrayFrom$1=function(De){var Fe=toObject(De),Be=isConstructor$1(this),He=arguments.length,Ke=He>1?arguments[1]:void 0,Ge=Ke!==void 0;Ge&&(Ke=bind$5(Ke,He>2?arguments[2]:void 0));var We=getIteratorMethod$1(Fe),Ze=0,Xe,Je,Ye,Qe,et,tt;if(We&&!(this===$Array&&isArrayIteratorMethod$1(We)))for(Je=Be?new this:[],Qe=getIterator$1(Fe,We),et=Qe.next;!(Ye=call$8(et,Qe)).done;Ze++)tt=Ge?callWithSafeIterationClosing(Qe,Ke,[Ye.value,Ze],!0):Ye.value,createProperty(Je,Ze,tt);else for(Xe=lengthOfArrayLike$1(Fe),Je=Be?new this(Xe):$Array(Xe);Xe>Ze;Ze++)tt=Ge?Ke(Fe[Ze],Ze):Fe[Ze],createProperty(Je,Ze,tt);return Je.length=Ze,Je},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$1=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$1=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$3=uncurryThis$2("".replace),split$1=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function($e){for(var De=[],Fe=0,Be=$e.length;Fe<Be;){var He=charCodeAt($e,Fe++);if(He>=55296&&He<=56319&&Fe<Be){var Ke=charCodeAt($e,Fe++);(Ke&64512)===56320?push$2(De,((He&1023)<<10)+(Ke&1023)+65536):(push$2(De,He),Fe--)}else push$2(De,He)}return De},digitToBasic=function($e){return $e+22+75*($e<26)},adapt=function($e,De,Fe){var Be=0;for($e=Fe?floor$1($e/damp):$e>>1,$e+=floor$1($e/De);$e>baseMinusTMin*tMax>>1;)$e=floor$1($e/baseMinusTMin),Be+=base;return floor$1(Be+(baseMinusTMin+1)*$e/($e+skew))},encode=function($e){var De=[];$e=ucs2decode($e);var Fe=$e.length,Be=initialN,He=0,Ke=initialBias,Ge,We;for(Ge=0;Ge<$e.length;Ge++)We=$e[Ge],We<128&&push$2(De,fromCharCode(We));var Ze=De.length,Xe=Ze;for(Ze&&push$2(De,delimiter);Xe<Fe;){var Je=maxInt;for(Ge=0;Ge<$e.length;Ge++)We=$e[Ge],We>=Be&&We<Je&&(Je=We);var Ye=Xe+1;if(Je-Be>floor$1((maxInt-He)/Ye))throw new $RangeError(OVERFLOW_ERROR);for(He+=(Je-Be)*Ye,Be=Je,Ge=0;Ge<$e.length;Ge++){if(We=$e[Ge],We<Be&&++He>maxInt)throw new $RangeError(OVERFLOW_ERROR);if(We===Be){for(var Qe=He,et=base;;){var tt=et<=Ke?tMin:et>=Ke+tMax?tMax:et-Ke;if(Qe<tt)break;var ct=Qe-tt,at=base-tt;push$2(De,fromCharCode(digitToBasic(tt+ct%at))),Qe=floor$1(ct/at),et+=base}push$2(De,fromCharCode(digitToBasic(Qe))),Ke=adapt(He,Ye,Xe===Ze),He=0,Xe++}}He++,Be++}return join$1(De,"")},stringPunycodeToAscii=function($e){var De=[],Fe=split$1(replace$3(toLowerCase$1($e),regexSeparators,"."),"."),Be,He;for(Be=0;Be<Fe.length;Be++)He=Fe[Be],push$2(De,exec$1(regexNonASCII,He)?"xn--"+encode(He):He);return join$1(De,".")},$$i=_export,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$2=urlConstructorDetection,globalThis$9=globalThis_1,bind$4=functionBindContext,uncurryThis$1=functionUncurryThis,defineBuiltIn$4=defineBuiltIn$c,defineBuiltInAccessor$1=defineBuiltInAccessor$4,anInstance$1=anInstance$3,hasOwn$1=hasOwnProperty_1,assign=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySlice$3,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$8,setToStringTag$2=setToStringTag$6,validateArgumentsLength$3=validateArgumentsLength$7,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,getInternalURLState=InternalStateModule$1.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=globalThis$9.URL,TypeError$2=globalThis$9.TypeError,parseInt$1=globalThis$9.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis$1("".charAt),exec=uncurryThis$1(/./.exec),join=uncurryThis$1([].join),numberToString=uncurryThis$1(1 .toString),pop=uncurryThis$1([].pop),push$1=uncurryThis$1([].push),replace$2=uncurryThis$1("".replace),shift=uncurryThis$1([].shift),split=uncurryThis$1("".split),stringSlice=uncurryThis$1("".slice),toLowerCase=uncurryThis$1("".toLowerCase),unshift=uncurryThis$1([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseIPv4=function($e){var De=split($e,"."),Fe,Be,He,Ke,Ge,We,Ze;if(De.length&&De[De.length-1]===""&&De.length--,Fe=De.length,Fe>4)return $e;for(Be=[],He=0;He<Fe;He++){if(Ke=De[He],Ke==="")return $e;if(Ge=10,Ke.length>1&&charAt(Ke,0)==="0"&&(Ge=exec(HEX_START,Ke)?16:8,Ke=stringSlice(Ke,Ge===8?1:2)),Ke==="")We=0;else{if(!exec(Ge===10?DEC:Ge===8?OCT:HEX,Ke))return $e;We=parseInt$1(Ke,Ge)}push$1(Be,We)}for(He=0;He<Fe;He++)if(We=Be[He],He===Fe-1){if(We>=pow(256,5-Fe))return null}else if(We>255)return null;for(Ze=pop(Be),He=0;He<Be.length;He++)Ze+=Be[He]*pow(256,3-He);return Ze},parseIPv6=function($e){var De=[0,0,0,0,0,0,0,0],Fe=0,Be=null,He=0,Ke,Ge,We,Ze,Xe,Je,Ye,Qe=function(){return charAt($e,He)};if(Qe()===":"){if(charAt($e,1)!==":")return;He+=2,Fe++,Be=Fe}for(;Qe();){if(Fe===8)return;if(Qe()===":"){if(Be!==null)return;He++,Fe++,Be=Fe;continue}for(Ke=Ge=0;Ge<4&&exec(HEX,Qe());)Ke=Ke*16+parseInt$1(Qe(),16),He++,Ge++;if(Qe()==="."){if(Ge===0||(He-=Ge,Fe>6))return;for(We=0;Qe();){if(Ze=null,We>0)if(Qe()==="."&&We<4)He++;else return;if(!exec(DIGIT,Qe()))return;for(;exec(DIGIT,Qe());){if(Xe=parseInt$1(Qe(),10),Ze===null)Ze=Xe;else{if(Ze===0)return;Ze=Ze*10+Xe}if(Ze>255)return;He++}De[Fe]=De[Fe]*256+Ze,We++,(We===2||We===4)&&Fe++}if(We!==4)return;break}else if(Qe()===":"){if(He++,!Qe())return}else if(Qe())return;De[Fe++]=Ke}if(Be!==null)for(Je=Fe-Be,Fe=7;Fe!==0&&Je>0;)Ye=De[Fe],De[Fe--]=De[Be+Je-1],De[Be+--Je]=Ye;else if(Fe!==8)return;return De},findLongestZeroSequence=function($e){for(var De=null,Fe=1,Be=null,He=0,Ke=0;Ke<8;Ke++)$e[Ke]!==0?(He>Fe&&(De=Be,Fe=He),Be=null,He=0):(Be===null&&(Be=Ke),++He);return He>Fe?Be:De},serializeHost=function($e){var De,Fe,Be,He;if(typeof $e=="number"){for(De=[],Fe=0;Fe<4;Fe++)unshift(De,$e%256),$e=floor($e/256);return join(De,".")}if(typeof $e=="object"){for(De="",Be=findLongestZeroSequence($e),Fe=0;Fe<8;Fe++)He&&$e[Fe]===0||(He&&(He=!1),Be===Fe?(De+=Fe?":":"::",He=!0):(De+=numberToString($e[Fe],16),Fe<7&&(De+=":")));return"["+De+"]"}return $e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function($e,De){var Fe=codeAt($e,0);return Fe>32&&Fe<127&&!hasOwn$1(De,$e)?$e:encodeURIComponent($e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function($e,De){var Fe;return $e.length===2&&exec(ALPHA,charAt($e,0))&&((Fe=charAt($e,1))===":"||!De&&Fe==="|")},startsWithWindowsDriveLetter=function($e){var De;return $e.length>1&&isWindowsDriveLetter(stringSlice($e,0,2))&&($e.length===2||(De=charAt($e,2))==="/"||De==="\\"||De==="?"||De==="#")},isSingleDot=function($e){return $e==="."||toLowerCase($e)==="%2e"},isDoubleDot=function($e){return $e=toLowerCase($e),$e===".."||$e==="%2e."||$e===".%2e"||$e==="%2e%2e"},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function($e,De,Fe){var Be=$toString($e),He,Ke,Ge;if(De){if(Ke=this.parse(Be),Ke)throw new TypeError$2(Ke);this.searchParams=null}else{if(Fe!==void 0&&(He=new URLState(Fe,!0)),Ke=this.parse(Be,null,He),Ke)throw new TypeError$2(Ke);Ge=getInternalSearchParamsState(new URLSearchParams$1),Ge.bindURL(this),this.searchParams=Ge}};URLState.prototype={type:"URL",parse:function($e,De,Fe){var Be=this,He=De||SCHEME_START,Ke=0,Ge="",We=!1,Ze=!1,Xe=!1,Je,Ye,Qe,et;for($e=$toString($e),De||(Be.scheme="",Be.username="",Be.password="",Be.host=null,Be.port=null,Be.path=[],Be.query=null,Be.fragment=null,Be.cannotBeABaseURL=!1,$e=replace$2($e,LEADING_C0_CONTROL_OR_SPACE,""),$e=replace$2($e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),$e=replace$2($e,TAB_AND_NEW_LINE,""),Je=arrayFrom($e);Ke<=Je.length;){switch(Ye=Je[Ke],He){case SCHEME_START:if(Ye&&exec(ALPHA,Ye))Ge+=toLowerCase(Ye),He=SCHEME;else{if(De)return INVALID_SCHEME;He=NO_SCHEME;continue}break;case SCHEME:if(Ye&&(exec(ALPHANUMERIC,Ye)||Ye==="+"||Ye==="-"||Ye==="."))Ge+=toLowerCase(Ye);else if(Ye===":"){if(De&&(Be.isSpecial()!==hasOwn$1(specialSchemes,Ge)||Ge==="file"&&(Be.includesCredentials()||Be.port!==null)||Be.scheme==="file"&&!Be.host))return;if(Be.scheme=Ge,De){Be.isSpecial()&&specialSchemes[Be.scheme]===Be.port&&(Be.port=null);return}Ge="",Be.scheme==="file"?He=FILE:Be.isSpecial()&&Fe&&Fe.scheme===Be.scheme?He=SPECIAL_RELATIVE_OR_AUTHORITY:Be.isSpecial()?He=SPECIAL_AUTHORITY_SLASHES:Je[Ke+1]==="/"?(He=PATH_OR_AUTHORITY,Ke++):(Be.cannotBeABaseURL=!0,push$1(Be.path,""),He=CANNOT_BE_A_BASE_URL_PATH)}else{if(De)return INVALID_SCHEME;Ge="",He=NO_SCHEME,Ke=0;continue}break;case NO_SCHEME:if(!Fe||Fe.cannotBeABaseURL&&Ye!=="#")return INVALID_SCHEME;if(Fe.cannotBeABaseURL&&Ye==="#"){Be.scheme=Fe.scheme,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",Be.cannotBeABaseURL=!0,He=FRAGMENT;break}He=Fe.scheme==="file"?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if(Ye==="/"&&Je[Ke+1]==="/")He=SPECIAL_AUTHORITY_IGNORE_SLASHES,Ke++;else{He=RELATIVE;continue}break;case PATH_OR_AUTHORITY:if(Ye==="/"){He=AUTHORITY;break}else{He=PATH;continue}case RELATIVE:if(Be.scheme=Fe.scheme,Ye===EOF)Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query;else if(Ye==="/"||Ye==="\\"&&Be.isSpecial())He=RELATIVE_SLASH;else if(Ye==="?")Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query="",He=QUERY;else if(Ye==="#")Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",He=FRAGMENT;else{Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.path.length--,He=PATH;continue}break;case RELATIVE_SLASH:if(Be.isSpecial()&&(Ye==="/"||Ye==="\\"))He=SPECIAL_AUTHORITY_IGNORE_SLASHES;else if(Ye==="/")He=AUTHORITY;else{Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,He=PATH;continue}break;case SPECIAL_AUTHORITY_SLASHES:if(He=SPECIAL_AUTHORITY_IGNORE_SLASHES,Ye!=="/"||charAt(Ge,Ke+1)!=="/")continue;Ke++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if(Ye!=="/"&&Ye!=="\\"){He=AUTHORITY;continue}break;case AUTHORITY:if(Ye==="@"){We&&(Ge="%40"+Ge),We=!0,Qe=arrayFrom(Ge);for(var tt=0;tt<Qe.length;tt++){var ct=Qe[tt];if(ct===":"&&!Xe){Xe=!0;continue}var at=percentEncode(ct,userinfoPercentEncodeSet);Xe?Be.password+=at:Be.username+=at}Ge=""}else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()){if(We&&Ge==="")return INVALID_AUTHORITY;Ke-=arrayFrom(Ge).length+1,Ge="",He=HOST}else Ge+=Ye;break;case HOST:case HOSTNAME:if(De&&Be.scheme==="file"){He=FILE_HOST;continue}else if(Ye===":"&&!Ze){if(Ge==="")return INVALID_HOST;if(et=Be.parseHost(Ge),et)return et;if(Ge="",He=PORT,De===HOSTNAME)return}else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()){if(Be.isSpecial()&&Ge==="")return INVALID_HOST;if(De&&Ge===""&&(Be.includesCredentials()||Be.port!==null))return;if(et=Be.parseHost(Ge),et)return et;if(Ge="",He=PATH_START,De)return;continue}else Ye==="["?Ze=!0:Ye==="]"&&(Ze=!1),Ge+=Ye;break;case PORT:if(exec(DIGIT,Ye))Ge+=Ye;else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()||De){if(Ge!==""){var ft=parseInt$1(Ge,10);if(ft>65535)return INVALID_PORT;Be.port=Be.isSpecial()&&ft===specialSchemes[Be.scheme]?null:ft,Ge=""}if(De)return;He=PATH_START;continue}else return INVALID_PORT;break;case FILE:if(Be.scheme="file",Ye==="/"||Ye==="\\")He=FILE_SLASH;else if(Fe&&Fe.scheme==="file")switch(Ye){case EOF:Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query;break;case"?":Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query="",He=QUERY;break;case"#":Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",He=FRAGMENT;break;default:startsWithWindowsDriveLetter(join(arraySlice$1(Je,Ke),""))||(Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.shortenPath()),He=PATH;continue}else{He=PATH;continue}break;case FILE_SLASH:if(Ye==="/"||Ye==="\\"){He=FILE_HOST;break}Fe&&Fe.scheme==="file"&&!startsWithWindowsDriveLetter(join(arraySlice$1(Je,Ke),""))&&(isWindowsDriveLetter(Fe.path[0],!0)?push$1(Be.path,Fe.path[0]):Be.host=Fe.host),He=PATH;continue;case FILE_HOST:if(Ye===EOF||Ye==="/"||Ye==="\\"||Ye==="?"||Ye==="#"){if(!De&&isWindowsDriveLetter(Ge))He=PATH;else if(Ge===""){if(Be.host="",De)return;He=PATH_START}else{if(et=Be.parseHost(Ge),et)return et;if(Be.host==="localhost"&&(Be.host=""),De)return;Ge="",He=PATH_START}continue}else Ge+=Ye;break;case PATH_START:if(Be.isSpecial()){if(He=PATH,Ye!=="/"&&Ye!=="\\")continue}else if(!De&&Ye==="?")Be.query="",He=QUERY;else if(!De&&Ye==="#")Be.fragment="",He=FRAGMENT;else if(Ye!==EOF&&(He=PATH,Ye!=="/"))continue;break;case PATH:if(Ye===EOF||Ye==="/"||Ye==="\\"&&Be.isSpecial()||!De&&(Ye==="?"||Ye==="#")){if(isDoubleDot(Ge)?(Be.shortenPath(),Ye!=="/"&&!(Ye==="\\"&&Be.isSpecial())&&push$1(Be.path,"")):isSingleDot(Ge)?Ye!=="/"&&!(Ye==="\\"&&Be.isSpecial())&&push$1(Be.path,""):(Be.scheme==="file"&&!Be.path.length&&isWindowsDriveLetter(Ge)&&(Be.host&&(Be.host=""),Ge=charAt(Ge,0)+":"),push$1(Be.path,Ge)),Ge="",Be.scheme==="file"&&(Ye===EOF||Ye==="?"||Ye==="#"))for(;Be.path.length>1&&Be.path[0]==="";)shift(Be.path);Ye==="?"?(Be.query="",He=QUERY):Ye==="#"&&(Be.fragment="",He=FRAGMENT)}else Ge+=percentEncode(Ye,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:Ye==="?"?(Be.query="",He=QUERY):Ye==="#"?(Be.fragment="",He=FRAGMENT):Ye!==EOF&&(Be.path[0]+=percentEncode(Ye,C0ControlPercentEncodeSet));break;case QUERY:!De&&Ye==="#"?(Be.fragment="",He=FRAGMENT):Ye!==EOF&&(Ye==="'"&&Be.isSpecial()?Be.query+="%27":Ye==="#"?Be.query+="%23":Be.query+=percentEncode(Ye,C0ControlPercentEncodeSet));break;case FRAGMENT:Ye!==EOF&&(Be.fragment+=percentEncode(Ye,fragmentPercentEncodeSet));break}Ke++}},parseHost:function($e){var De,Fe,Be;if(charAt($e,0)==="["){if(charAt($e,$e.length-1)!=="]"||(De=parseIPv6(stringSlice($e,1,-1)),!De))return INVALID_HOST;this.host=De}else if(this.isSpecial()){if($e=toASCII($e),exec(FORBIDDEN_HOST_CODE_POINT,$e)||(De=parseIPv4($e),De===null))return INVALID_HOST;this.host=De}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,$e))return INVALID_HOST;for(De="",Fe=arrayFrom($e),Be=0;Be<Fe.length;Be++)De+=percentEncode(Fe[Be],C0ControlPercentEncodeSet);this.host=De}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var $e=this.path,De=$e.length;De&&(this.scheme!=="file"||De!==1||!isWindowsDriveLetter($e[0],!0))&&$e.length--},serialize:function(){var $e=this,De=$e.scheme,Fe=$e.username,Be=$e.password,He=$e.host,Ke=$e.port,Ge=$e.path,We=$e.query,Ze=$e.fragment,Xe=De+":";return He!==null?(Xe+="//",$e.includesCredentials()&&(Xe+=Fe+(Be?":"+Be:"")+"@"),Xe+=serializeHost(He),Ke!==null&&(Xe+=":"+Ke)):De==="file"&&(Xe+="//"),Xe+=$e.cannotBeABaseURL?Ge[0]:Ge.length?"/"+join(Ge,"/"):"",We!==null&&(Xe+="?"+We),Ze!==null&&(Xe+="#"+Ze),Xe},setHref:function($e){var De=this.parse($e);if(De)throw new TypeError$2(De);this.searchParams.update()},getOrigin:function(){var $e=this.scheme,De=this.port;if($e==="blob")try{return new URLConstructor($e.path[0]).origin}catch{return"null"}return $e==="file"||!this.isSpecial()?"null":$e+"://"+serializeHost(this.host)+(De!==null?":"+De:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function($e){this.parse($toString($e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function($e){var De=arrayFrom($toString($e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var Fe=0;Fe<De.length;Fe++)this.username+=percentEncode(De[Fe],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function($e){var De=arrayFrom($toString($e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var Fe=0;Fe<De.length;Fe++)this.password+=percentEncode(De[Fe],userinfoPercentEncodeSet)}},getHost:function(){var $e=this.host,De=this.port;return $e===null?"":De===null?serializeHost($e):serializeHost($e)+":"+De},setHost:function($e){this.cannotBeABaseURL||this.parse($e,HOST)},getHostname:function(){var $e=this.host;return $e===null?"":serializeHost($e)},setHostname:function($e){this.cannotBeABaseURL||this.parse($e,HOSTNAME)},getPort:function(){var $e=this.port;return $e===null?"":$toString($e)},setPort:function($e){this.cannotHaveUsernamePasswordPort()||($e=$toString($e),$e===""?this.port=null:this.parse($e,PORT))},getPathname:function(){var $e=this.path;return this.cannotBeABaseURL?$e[0]:$e.length?"/"+join($e,"/"):""},setPathname:function($e){this.cannotBeABaseURL||(this.path=[],this.parse($e,PATH_START))},getSearch:function(){var $e=this.query;return $e?"?"+$e:""},setSearch:function($e){$e=$toString($e),$e===""?this.query=null:(charAt($e,0)==="?"&&($e=stringSlice($e,1)),this.query="",this.parse($e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var $e=this.fragment;return $e?"#"+$e:""},setHash:function($e){if($e=$toString($e),$e===""){this.fragment=null;return}charAt($e,0)==="#"&&($e=stringSlice($e,1)),this.fragment="",this.parse($e,FRAGMENT)},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(De){var Fe=anInstance$1(this,URLPrototype),Be=validateArgumentsLength$3(arguments.length,1)>1?arguments[1]:void 0,He=setInternalState$1(Fe,new URLState(De,!1,Be));DESCRIPTORS$1||(Fe.href=He.serialize(),Fe.origin=He.getOrigin(),Fe.protocol=He.getProtocol(),Fe.username=He.getUsername(),Fe.password=He.getPassword(),Fe.host=He.getHost(),Fe.hostname=He.getHostname(),Fe.port=He.getPort(),Fe.pathname=He.getPathname(),Fe.search=He.getSearch(),Fe.searchParams=He.getSearchParams(),Fe.hash=He.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function($e,De){return{get:function(){return getInternalURLState(this)[$e]()},set:De&&function(Fe){return getInternalURLState(this)[De](Fe)},configurable:!0,enumerable:!0}};DESCRIPTORS$1&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash")));defineBuiltIn$4(URLPrototype,"toJSON",function(){return getInternalURLState(this).serialize()},{enumerable:!0});defineBuiltIn$4(URLPrototype,"toString",function(){return getInternalURLState(this).serialize()},{enumerable:!0});if(NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$4(URLConstructor,"createObjectURL",bind$4(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$4(URLConstructor,"revokeObjectURL",bind$4(nativeRevokeObjectURL,NativeURL))}setToStringTag$2(URLConstructor,"URL");$$i({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2,sham:!DESCRIPTORS$1},{URL:URLConstructor});var $$h=_export,getBuiltIn$6=getBuiltIn$c,fails$3=fails$h,validateArgumentsLength$2=validateArgumentsLength$7,toString$3=toString$8,USE_NATIVE_URL$1=urlConstructorDetection,URL$2=getBuiltIn$6("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL$1&&fails$3(function(){URL$2.canParse()}),WRONG_ARITY=fails$3(function(){return URL$2.canParse.length!==1});$$h({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS||WRONG_ARITY},{canParse:function(De){var Fe=validateArgumentsLength$2(arguments.length,1),Be=toString$3(De),He=Fe<2||arguments[1]===void 0?void 0:toString$3(arguments[1]);try{return!!new URL$2(Be,He)}catch{return!1}}});var $$g=_export,getBuiltIn$5=getBuiltIn$c,validateArgumentsLength$1=validateArgumentsLength$7,toString$2=toString$8,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$5("URL");$$g({target:"URL",stat:!0,forced:!USE_NATIVE_URL},{parse:function(De){var Fe=validateArgumentsLength$1(arguments.length,1),Be=toString$2(De),He=Fe<2||arguments[1]===void 0?void 0:toString$2(arguments[1]);try{return new URL$1(Be,He)}catch{return null}}});var $$f=_export,call$7=functionCall;$$f({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return call$7(URL.prototype.toString,this)}});var path$1=path$3;path$1.URL;var domIterables={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},documentCreateElement=documentCreateElement$2,classList=documentCreateElement("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,globalThis$8=globalThis_1,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$3=createNonEnumerableProperty$7,setToStringTag$1=setToStringTag$6,wellKnownSymbol$5=wellKnownSymbol$h,ITERATOR$1=wellKnownSymbol$5("iterator"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function($e,De){if($e){if($e[ITERATOR$1]!==ArrayValues)try{createNonEnumerableProperty$3($e,ITERATOR$1,ArrayValues)}catch{$e[ITERATOR$1]=ArrayValues}if(setToStringTag$1($e,De,!0),DOMIterables[De]){for(var Fe in ArrayIteratorMethods)if($e[Fe]!==ArrayIteratorMethods[Fe])try{createNonEnumerableProperty$3($e,Fe,ArrayIteratorMethods[Fe])}catch{$e[Fe]=ArrayIteratorMethods[Fe]}}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(globalThis$8[COLLECTION_NAME]&&globalThis$8[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var isObject$2=isObject$c,createNonEnumerableProperty$2=createNonEnumerableProperty$7,installErrorCause$1=function($e,De){isObject$2(De)&&"cause"in De&&createNonEnumerableProperty$2($e,"cause",De.cause)},uncurryThis=functionUncurryThis,$Error$1=Error,replace$1=uncurryThis("".replace),TEST=function($e){return String(new $Error$1($e).stack)}("zxcasd"),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function($e,De){if(IS_V8_OR_CHAKRA_STACK&&typeof $e=="string"&&!$Error$1.prepareStackTrace)for(;De--;)$e=replace$1($e,V8_OR_CHAKRA_STACK_ENTRY,"");return $e},fails$2=fails$h,createPropertyDescriptor$1=createPropertyDescriptor$7,errorStackInstallable=!fails$2(function(){var $e=new Error("a");return"stack"in $e?(Object.defineProperty($e,"stack",createPropertyDescriptor$1(1,7)),$e.stack!==7):!0}),createNonEnumerableProperty$1=createNonEnumerableProperty$7,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function($e,De,Fe,Be){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace($e,De):createNonEnumerableProperty$1($e,"stack",clearErrorStack(Fe,Be)))},bind$3=functionBindContext,call$6=functionCall,anObject$2=anObject$b,tryToString$1=tryToString$4,isArrayIteratorMethod=isArrayIteratorMethod$2,lengthOfArrayLike=lengthOfArrayLike$3,isPrototypeOf$1=objectIsPrototypeOf,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$4,iteratorClose=iteratorClose$2,$TypeError$2=TypeError,Result=function($e,De){this.stopped=$e,this.result=De},ResultPrototype=Result.prototype,iterate$5=function($e,De,Fe){var Be=Fe&&Fe.that,He=!!(Fe&&Fe.AS_ENTRIES),Ke=!!(Fe&&Fe.IS_RECORD),Ge=!!(Fe&&Fe.IS_ITERATOR),We=!!(Fe&&Fe.INTERRUPTED),Ze=bind$3(De,Be),Xe,Je,Ye,Qe,et,tt,ct,at=function(ut){return Xe&&iteratorClose(Xe,"normal",ut),new Result(!0,ut)},ft=function(ut){return He?(anObject$2(ut),We?Ze(ut[0],ut[1],at):Ze(ut[0],ut[1])):We?Ze(ut,at):Ze(ut)};if(Ke)Xe=$e.iterator;else if(Ge)Xe=$e;else{if(Je=getIteratorMethod($e),!Je)throw new $TypeError$2(tryToString$1($e)+" is not iterable");if(isArrayIteratorMethod(Je)){for(Ye=0,Qe=lengthOfArrayLike($e);Qe>Ye;Ye++)if(et=ft($e[Ye]),et&&isPrototypeOf$1(ResultPrototype,et))return et;return new Result(!1)}Xe=getIterator($e,Je)}for(tt=Ke?$e.next:Xe.next;!(ct=call$6(tt,Xe)).done;){try{et=ft(ct.value)}catch(ut){iteratorClose(Xe,"throw",ut)}if(typeof et=="object"&&et&&isPrototypeOf$1(ResultPrototype,et))return et}return new Result(!1)},toString$1=toString$8,normalizeStringArgument$1=function($e,De){return $e===void 0?arguments.length<2?"":De:toString$1($e)},$$e=_export,isPrototypeOf=objectIsPrototypeOf,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$2,create=objectCreate,createNonEnumerableProperty=createNonEnumerableProperty$7,createPropertyDescriptor=createPropertyDescriptor$7,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$4=iterate$5,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$4=wellKnownSymbol$h,TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),$Error=Error,push=[].push,$AggregateError=function(De,Fe){var Be=isPrototypeOf(AggregateErrorPrototype,this),He;setPrototypeOf$1?He=setPrototypeOf$1(new $Error,Be?getPrototypeOf(this):AggregateErrorPrototype):(He=Be?this:create(AggregateErrorPrototype),createNonEnumerableProperty(He,TO_STRING_TAG,"Error")),Fe!==void 0&&createNonEnumerableProperty(He,"message",normalizeStringArgument(Fe)),installErrorStack(He,$AggregateError,He.stack,1),arguments.length>2&&installErrorCause(He,arguments[2]);var Ke=[];return iterate$4(De,push,{that:Ke}),createNonEnumerableProperty(He,"errors",Ke),He};setPrototypeOf$1?setPrototypeOf$1($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create($Error.prototype,{constructor:createPropertyDescriptor(1,$AggregateError),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});$$e({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$1=classof$6,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$1(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineBuiltIn$3=defineBuiltIn$c,toString=objectToString;TO_STRING_TAG_SUPPORT||defineBuiltIn$3(Object.prototype,"toString",toString,{unsafe:!0});var globalThis$7=globalThis_1,userAgent$3=environmentUserAgent,classof=classofRaw$2,userAgentStartsWith=function($e){return userAgent$3.slice(0,$e.length)===$e},environment=function(){return userAgentStartsWith("Bun/")?"BUN":userAgentStartsWith("Cloudflare-Workers")?"CLOUDFLARE":userAgentStartsWith("Deno/")?"DENO":userAgentStartsWith("Node.js/")?"NODE":globalThis$7.Bun&&typeof Bun.version=="string"?"BUN":globalThis$7.Deno&&typeof Deno.version=="object"?"DENO":classof(globalThis$7.process)==="process"?"NODE":globalThis$7.window&&globalThis$7.document?"BROWSER":"REST"}(),ENVIRONMENT$1=environment,environmentIsNode=ENVIRONMENT$1==="NODE",getBuiltIn$4=getBuiltIn$c,defineBuiltInAccessor=defineBuiltInAccessor$4,wellKnownSymbol$3=wellKnownSymbol$h,DESCRIPTORS=descriptors,SPECIES$2=wellKnownSymbol$3("species"),setSpecies$1=function($e){var De=getBuiltIn$4($e);DESCRIPTORS&&De&&!De[SPECIES$2]&&defineBuiltInAccessor(De,SPECIES$2,{configurable:!0,get:function(){return this}})},isConstructor=isConstructor$2,tryToString=tryToString$4,$TypeError$1=TypeError,aConstructor$1=function($e){if(isConstructor($e))return $e;throw new $TypeError$1(tryToString($e)+" is not a constructor")},anObject$1=anObject$b,aConstructor=aConstructor$1,isNullOrUndefined=isNullOrUndefined$4,wellKnownSymbol$2=wellKnownSymbol$h,SPECIES$1=wellKnownSymbol$2("species"),speciesConstructor$2=function($e,De){var Fe=anObject$1($e).constructor,Be;return Fe===void 0||isNullOrUndefined(Be=anObject$1(Fe)[SPECIES$1])?De:aConstructor(Be)},NATIVE_BIND=functionBindNative,FunctionPrototype=Function.prototype,apply$2=FunctionPrototype.apply,call$5=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND?call$5.bind(apply$2):function(){return call$5.apply(apply$2,arguments)}),userAgent$2=environmentUserAgent,environmentIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2),globalThis$6=globalThis_1,apply$1=functionApply,bind$2=functionBindContext,isCallable$4=isCallable$l,hasOwn=hasOwnProperty_1,fails$1=fails$h,html=html$2,arraySlice=arraySlice$3,createElement=documentCreateElement$2,validateArgumentsLength=validateArgumentsLength$7,IS_IOS$1=environmentIsIos,IS_NODE$2=environmentIsNode,set=globalThis$6.setImmediate,clear=globalThis$6.clearImmediate,process$3=globalThis$6.process,Dispatch=globalThis$6.Dispatch,Function$1=globalThis$6.Function,MessageChannel$1=globalThis$6.MessageChannel,String$1=globalThis$6.String,counter=0,queue$3={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;fails$1(function(){$location=globalThis$6.location});var run=function($e){if(hasOwn(queue$3,$e)){var De=queue$3[$e];delete queue$3[$e],De()}},runner=function($e){return function(){run($e)}},eventListener=function($e){run($e.data)},globalPostMessageDefer=function($e){globalThis$6.postMessage(String$1($e),$location.protocol+"//"+$location.host)};(!set||!clear)&&(set=function(De){validateArgumentsLength(arguments.length,1);var Fe=isCallable$4(De)?De:Function$1(De),Be=arraySlice(arguments,1);return queue$3[++counter]=function(){apply$1(Fe,void 0,Be)},defer(counter),counter},clear=function(De){delete queue$3[De]},IS_NODE$2?defer=function($e){process$3.nextTick(runner($e))}:Dispatch&&Dispatch.now?defer=function($e){Dispatch.now(runner($e))}:MessageChannel$1&&!IS_IOS$1?(channel=new MessageChannel$1,port=channel.port2,channel.port1.onmessage=eventListener,defer=bind$2(port.postMessage,port)):globalThis$6.addEventListener&&isCallable$4(globalThis$6.postMessage)&&!globalThis$6.importScripts&&$location&&$location.protocol!=="file:"&&!fails$1(globalPostMessageDefer)?(defer=globalPostMessageDefer,globalThis$6.addEventListener("message",eventListener,!1)):ONREADYSTATECHANGE in createElement("script")?defer=function($e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run($e)}}:defer=function($e){setTimeout(runner($e),0)});var task$1={set,clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function($e){var De={item:$e,next:null},Fe=this.tail;Fe?Fe.next=De:this.head=De,this.tail=De},get:function(){var $e=this.head;if($e){var De=this.head=$e.next;return De===null&&(this.tail=null),$e.item}}};var queue$2=Queue$2,userAgent$1=environmentUserAgent,environmentIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&typeof Pebble<"u",userAgent=environmentUserAgent,environmentIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),globalThis$5=globalThis_1,safeGetBuiltIn=safeGetBuiltIn$2,bind$1=functionBindContext,macrotask=task$1.set,Queue$1=queue$2,IS_IOS=environmentIsIos,IS_IOS_PEBBLE=environmentIsIosPebble,IS_WEBOS_WEBKIT=environmentIsWebosWebkit,IS_NODE$1=environmentIsNode,MutationObserver=globalThis$5.MutationObserver||globalThis$5.WebKitMutationObserver,document$2=globalThis$5.document,process$2=globalThis$5.process,Promise$2=globalThis$5.Promise,microtask$1=safeGetBuiltIn("queueMicrotask"),notify$1,toggle,node,promise,then;if(!microtask$1){var queue$1=new Queue$1,flush=function(){var $e,De;for(IS_NODE$1&&($e=process$2.domain)&&$e.exit();De=queue$1.get();)try{De()}catch(Fe){throw queue$1.head&¬ify$1(),Fe}$e&&$e.enter()};!IS_IOS&&!IS_NODE$1&&!IS_WEBOS_WEBKIT&&MutationObserver&&document$2?(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}):!IS_IOS_PEBBLE&&Promise$2&&Promise$2.resolve?(promise=Promise$2.resolve(void 0),promise.constructor=Promise$2,then=bind$1(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$1?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$1(macrotask,globalThis$5),notify$1=function(){macrotask(flush)}),microtask$1=function($e){queue$1.head||notify$1(),queue$1.add($e)}}var microtask_1=microtask$1,hostReportErrors$1=function($e,De){try{arguments.length===1?console.error($e):console.error($e,De)}catch{}},perform$6=function($e){try{return{error:!1,value:$e()}}catch(De){return{error:!0,value:De}}},globalThis$4=globalThis_1,promiseNativeConstructor=globalThis$4.Promise,globalThis$3=globalThis_1,NativePromiseConstructor$4=promiseNativeConstructor,isCallable$3=isCallable$l,isForced=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$1=wellKnownSymbol$h,ENVIRONMENT=environment,V8_VERSION=environmentV8Version;NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype;var SPECIES=wellKnownSymbol$1("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$3(globalThis$3.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",function(){var $e=inspectSource(NativePromiseConstructor$4),De=$e!==String(NativePromiseConstructor$4);if(!De&&V8_VERSION===66)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test($e)){var Fe=new NativePromiseConstructor$4(function(Ke){Ke(1)}),Be=function(Ke){Ke(function(){},function(){})},He=Fe.constructor={};if(He[SPECIES]=Be,SUBCLASSING=Fe.then(function(){})instanceof Be,!SUBCLASSING)return!0}return!De&&(ENVIRONMENT==="BROWSER"||ENVIRONMENT==="DENO")&&!NATIVE_PROMISE_REJECTION_EVENT$1}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING},newPromiseCapability$2={},aCallable$6=aCallable$b,$TypeError=TypeError,PromiseCapability=function($e){var De,Fe;this.promise=new $e(function(Be,He){if(De!==void 0||Fe!==void 0)throw new $TypeError("Bad Promise constructor");De=Be,Fe=He}),this.resolve=aCallable$6(De),this.reject=aCallable$6(Fe)};newPromiseCapability$2.f=function($e){return new PromiseCapability($e)};var $$d=_export,IS_NODE=environmentIsNode,globalThis$2=globalThis_1,call$4=functionCall,defineBuiltIn$2=defineBuiltIn$c,setPrototypeOf=objectSetPrototypeOf,setToStringTag=setToStringTag$6,setSpecies=setSpecies$1,aCallable$5=aCallable$b,isCallable$2=isCallable$l,isObject$1=isObject$c,anInstance=anInstance$3,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$2,InternalStateModule=internalState,NativePromiseConstructor$3=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$7=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule.getterFor(PROMISE),setInternalState=InternalStateModule.set,NativePromisePrototype$2=NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,PromiseConstructor=NativePromiseConstructor$3,PromisePrototype=NativePromisePrototype$2,TypeError$1=globalThis$2.TypeError,document$1=globalThis$2.document,process$1=globalThis$2.process,newPromiseCapability$1=newPromiseCapabilityModule$7.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&globalThis$2.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,isThenable=function($e){var De;return isObject$1($e)&&isCallable$2(De=$e.then)?De:!1},callReaction=function($e,De){var Fe=De.value,Be=De.state===FULFILLED,He=Be?$e.ok:$e.fail,Ke=$e.resolve,Ge=$e.reject,We=$e.domain,Ze,Xe,Je;try{He?(Be||(De.rejection===UNHANDLED&&onHandleUnhandled(De),De.rejection=HANDLED),He===!0?Ze=Fe:(We&&We.enter(),Ze=He(Fe),We&&(We.exit(),Je=!0)),Ze===$e.promise?Ge(new TypeError$1("Promise-chain cycle")):(Xe=isThenable(Ze))?call$4(Xe,Ze,Ke,Ge):Ke(Ze)):Ge(Fe)}catch(Ye){We&&!Je&&We.exit(),Ge(Ye)}},notify=function($e,De){$e.notified||($e.notified=!0,microtask(function(){for(var Fe=$e.reactions,Be;Be=Fe.get();)callReaction(Be,$e);$e.notified=!1,De&&!$e.rejection&&onUnhandled($e)}))},dispatchEvent$1=function($e,De,Fe){var Be,He;DISPATCH_EVENT?(Be=document$1.createEvent("Event"),Be.promise=De,Be.reason=Fe,Be.initEvent($e,!1,!0),globalThis$2.dispatchEvent(Be)):Be={promise:De,reason:Fe},!NATIVE_PROMISE_REJECTION_EVENT&&(He=globalThis$2["on"+$e])?He(Be):$e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",Fe)},onUnhandled=function($e){call$4(task,globalThis$2,function(){var De=$e.facade,Fe=$e.value,Be=isUnhandled($e),He;if(Be&&(He=perform$5(function(){IS_NODE?process$1.emit("unhandledRejection",Fe,De):dispatchEvent$1(UNHANDLED_REJECTION,De,Fe)}),$e.rejection=IS_NODE||isUnhandled($e)?UNHANDLED:HANDLED,He.error))throw He.value})},isUnhandled=function($e){return $e.rejection!==HANDLED&&!$e.parent},onHandleUnhandled=function($e){call$4(task,globalThis$2,function(){var De=$e.facade;IS_NODE?process$1.emit("rejectionHandled",De):dispatchEvent$1(REJECTION_HANDLED,De,$e.value)})},bind=function($e,De,Fe){return function(Be){$e(De,Be,Fe)}},internalReject=function($e,De,Fe){$e.done||($e.done=!0,Fe&&($e=Fe),$e.value=De,$e.state=REJECTED,notify($e,!0))},internalResolve=function($e,De,Fe){if(!$e.done){$e.done=!0,Fe&&($e=Fe);try{if($e.facade===De)throw new TypeError$1("Promise can't be resolved itself");var Be=isThenable(De);Be?microtask(function(){var He={done:!1};try{call$4(Be,De,bind(internalResolve,He,$e),bind(internalReject,He,$e))}catch(Ke){internalReject(He,Ke,$e)}}):($e.value=De,$e.state=FULFILLED,notify($e,!1))}catch(He){internalReject({done:!1},He,$e)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromiseConstructor=function(De){anInstance(this,PromisePrototype),aCallable$5(De),call$4(Internal,this);var Fe=getInternalPromiseState(this);try{De(bind(internalResolve,Fe),bind(internalReject,Fe))}catch(Be){internalReject(Fe,Be)}},PromisePrototype=PromiseConstructor.prototype,Internal=function(De){setInternalState(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:null})},Internal.prototype=defineBuiltIn$2(PromisePrototype,"then",function(De,Fe){var Be=getInternalPromiseState(this),He=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return Be.parent=!0,He.ok=isCallable$2(De)?De:!0,He.fail=isCallable$2(Fe)&&Fe,He.domain=IS_NODE?process$1.domain:void 0,Be.state===PENDING?Be.reactions.add(He):microtask(function(){callReaction(He,Be)}),He.promise}),OwnPromiseCapability=function(){var $e=new Internal,De=getInternalPromiseState($e);this.promise=$e,this.resolve=bind(internalResolve,De),this.reject=bind(internalReject,De)},newPromiseCapabilityModule$7.f=newPromiseCapability$1=function($e){return $e===PromiseConstructor||$e===PromiseWrapper?new OwnPromiseCapability($e):newGenericPromiseCapability($e)},isCallable$2(NativePromiseConstructor$3)&&NativePromisePrototype$2!==Object.prototype)){nativeThen=NativePromisePrototype$2.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$2(NativePromisePrototype$2,"then",function(De,Fe){var Be=this;return new PromiseConstructor(function(He,Ke){call$4(nativeThen,Be,He,Ke)}).then(De,Fe)},{unsafe:!0});try{delete NativePromisePrototype$2.constructor}catch{}setPrototypeOf&&setPrototypeOf(NativePromisePrototype$2,PromisePrototype)}$$d({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor});setToStringTag(PromiseConstructor,PROMISE,!1);setSpecies(PROMISE);var wellKnownSymbol=wellKnownSymbol$h,ITERATOR=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch{}var checkCorrectnessOfIteration$1=function($e,De){try{if(!De&&!SAFE_CLOSING)return!1}catch{return!1}var Fe=!1;try{var Be={};Be[ITERATOR]=function(){return{next:function(){return{done:Fe=!0}}}},$e(Be)}catch{}return Fe},NativePromiseConstructor$2=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration(function($e){NativePromiseConstructor$2.all($e).then(void 0,function(){})}),$$c=_export,call$3=functionCall,aCallable$4=aCallable$b,newPromiseCapabilityModule$6=newPromiseCapability$2,perform$4=perform$6,iterate$3=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$c({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(De){var Fe=this,Be=newPromiseCapabilityModule$6.f(Fe),He=Be.resolve,Ke=Be.reject,Ge=perform$4(function(){var We=aCallable$4(Fe.resolve),Ze=[],Xe=0,Je=1;iterate$3(De,function(Ye){var Qe=Xe++,et=!1;Je++,call$3(We,Fe,Ye).then(function(tt){et||(et=!0,Ze[Qe]=tt,--Je||He(Ze))},Ke)}),--Je||He(Ze)});return Ge.error&&Ke(Ge.value),Be.promise}});var $$b=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$1=promiseNativeConstructor,getBuiltIn$3=getBuiltIn$c,isCallable$1=isCallable$l,defineBuiltIn$1=defineBuiltIn$c,NativePromisePrototype$1=NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;$$b({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function($e){return this.then(void 0,$e)}});if(isCallable$1(NativePromiseConstructor$1)){var method$1=getBuiltIn$3("Promise").prototype.catch;NativePromisePrototype$1.catch!==method$1&&defineBuiltIn$1(NativePromisePrototype$1,"catch",method$1,{unsafe:!0})}var $$a=_export,call$2=functionCall,aCallable$3=aCallable$b,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$3=perform$6,iterate$2=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$a({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(De){var Fe=this,Be=newPromiseCapabilityModule$5.f(Fe),He=Be.reject,Ke=perform$3(function(){var Ge=aCallable$3(Fe.resolve);iterate$2(De,function(We){call$2(Ge,Fe,We).then(Be.resolve,He)})});return Ke.error&&He(Ke.value),Be.promise}});var $$9=_export,newPromiseCapabilityModule$4=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$9({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(De){var Fe=newPromiseCapabilityModule$4.f(this),Be=Fe.reject;return Be(De),Fe.promise}});var anObject=anObject$b,isObject=isObject$c,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function($e,De){if(anObject($e),isObject(De)&&De.constructor===$e)return De;var Fe=newPromiseCapability.f($e),Be=Fe.resolve;return Be(De),Fe.promise},$$8=_export,getBuiltIn$2=getBuiltIn$c,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2;getBuiltIn$2("Promise");$$8({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(De){return promiseResolve$1(this,De)}});var $$7=_export,call$1=functionCall,aCallable$2=aCallable$b,newPromiseCapabilityModule$3=newPromiseCapability$2,perform$2=perform$6,iterate$1=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$7({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(De){var Fe=this,Be=newPromiseCapabilityModule$3.f(Fe),He=Be.resolve,Ke=Be.reject,Ge=perform$2(function(){var We=aCallable$2(Fe.resolve),Ze=[],Xe=0,Je=1;iterate$1(De,function(Ye){var Qe=Xe++,et=!1;Je++,call$1(We,Fe,Ye).then(function(tt){et||(et=!0,Ze[Qe]={status:"fulfilled",value:tt},--Je||He(Ze))},function(tt){et||(et=!0,Ze[Qe]={status:"rejected",reason:tt},--Je||He(Ze))})}),--Je||He(Ze)});return Ge.error&&Ke(Ge.value),Be.promise}});var $$6=_export,call=functionCall,aCallable$1=aCallable$b,getBuiltIn$1=getBuiltIn$c,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$6,iterate=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$6({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(De){var Fe=this,Be=getBuiltIn$1("AggregateError"),He=newPromiseCapabilityModule$2.f(Fe),Ke=He.resolve,Ge=He.reject,We=perform$1(function(){var Ze=aCallable$1(Fe.resolve),Xe=[],Je=0,Ye=1,Qe=!1;iterate(De,function(et){var tt=Je++,ct=!1;Ye++,call(Ze,Fe,et).then(function(at){ct||Qe||(Qe=!0,Ke(at))},function(at){ct||Qe||(ct=!0,Xe[tt]=at,--Ye||Ge(new Be(Xe,PROMISE_ANY_ERROR)))})}),--Ye||Ge(new Be(Xe,PROMISE_ANY_ERROR))});return We.error&&Ge(We.value),He.promise}});var $$5=_export,globalThis$1=globalThis_1,apply=functionApply,slice=arraySlice$3,newPromiseCapabilityModule$1=newPromiseCapability$2,aCallable=aCallable$b,perform=perform$6,Promise$1=globalThis$1.Promise,ACCEPT_ARGUMENTS=!1,FORCED=!Promise$1||!Promise$1.try||perform(function(){Promise$1.try(function($e){ACCEPT_ARGUMENTS=$e===8},8)}).error||!ACCEPT_ARGUMENTS;$$5({target:"Promise",stat:!0,forced:FORCED},{try:function($e){var De=arguments.length>1?slice(arguments,1):[],Fe=newPromiseCapabilityModule$1.f(this),Be=perform(function(){return apply(aCallable($e),void 0,De)});return(Be.error?Fe.reject:Fe.resolve)(Be.value),Fe.promise}});var $$4=_export,newPromiseCapabilityModule=newPromiseCapability$2;$$4({target:"Promise",stat:!0},{withResolvers:function(){var De=newPromiseCapabilityModule.f(this);return{promise:De.promise,resolve:De.resolve,reject:De.reject}}});var $$3=_export,NativePromiseConstructor=promiseNativeConstructor,fails=fails$h,getBuiltIn=getBuiltIn$c,isCallable=isCallable$l,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,defineBuiltIn=defineBuiltIn$c,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails(function(){NativePromisePrototype.finally.call({then:function(){}},function(){})});$$3({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function($e){var De=speciesConstructor(this,getBuiltIn("Promise")),Fe=isCallable($e);return this.then(Fe?function(Be){return promiseResolve(De,$e()).then(function(){return Be})}:$e,Fe?function(Be){return promiseResolve(De,$e()).then(function(){throw Be})}:$e)}});if(isCallable(NativePromiseConstructor)){var method=getBuiltIn("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn(NativePromisePrototype,"finally",method,{unsafe:!0})}var path=path$3;path.Promise;const DEBUG_COOKIE="sesamy-debug";function setCookie($e,De,Fe){const Be=new Date;Be.setTime(Be.getTime()+Fe*60*60*1e3);const He="expires="+Be.toUTCString();document.cookie=`${$e}=${De}; ${He}; path=/`}function getCookie($e){if(typeof document>"u")return null;const De=$e+"=",Fe=document.cookie.split(";");for(let Be=0;Be<Fe.length;Be++){let He=Fe[Be];for(;He.charAt(0)===" ";)He=He.substring(1);if(He.indexOf(De)===0)return He.substring(De.length,He.length)}return null}function setDebug($e){setCookie(DEBUG_COOKIE,$e.toString(),1)}function getDebug(){return getCookie(DEBUG_COOKIE)==="true"}function log($e){getDebug()&&console.log($e)}function triggerEvent($e,De){if(typeof window>"u")return;const Fe=new CustomEvent($e,{detail:De,bubbles:!0,composed:!0});log(`Triggering event: ${$e}`),dispatchEvent(Fe)}function e$1($e,De){var Fe={};for(var Be in $e)Object.prototype.hasOwnProperty.call($e,Be)&&De.indexOf(Be)<0&&(Fe[Be]=$e[Be]);if($e!=null&&typeof Object.getOwnPropertySymbols=="function"){var He=0;for(Be=Object.getOwnPropertySymbols($e);He<Be.length;He++)De.indexOf(Be[He])<0&&Object.prototype.propertyIsEnumerable.call($e,Be[He])&&(Fe[Be[He]]=$e[Be[He]])}return Fe}var t$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i$6($e){return $e&&$e.__esModule&&Object.prototype.hasOwnProperty.call($e,"default")?$e.default:$e}function o$5($e,De){return $e(De={exports:{}},De.exports),De.exports}var n$2=o$5(function($e,De){Object.defineProperty(De,"__esModule",{value:!0});var Fe=function(){function Be(){var He=this;this.locked=new Map,this.addToLocked=function(Ke,Ge){var We=He.locked.get(Ke);We===void 0?Ge===void 0?He.locked.set(Ke,[]):He.locked.set(Ke,[Ge]):Ge!==void 0&&(We.unshift(Ge),He.locked.set(Ke,We))},this.isLocked=function(Ke){return He.locked.has(Ke)},this.lock=function(Ke){return new Promise(function(Ge,We){He.isLocked(Ke)?He.addToLocked(Ke,Ge):(He.addToLocked(Ke),Ge())})},this.unlock=function(Ke){var Ge=He.locked.get(Ke);if(Ge!==void 0&&Ge.length!==0){var We=Ge.pop();He.locked.set(Ke,Ge),We!==void 0&&setTimeout(We,0)}else He.locked.delete(Ke)}}return Be.getInstance=function(){return Be.instance===void 0&&(Be.instance=new Be),Be.instance},Be}();De.default=function(){return Fe.getInstance()}});i$6(n$2);var a$6=i$6(o$5(function($e,De){var Fe=t$1&&t$1.__awaiter||function(Je,Ye,Qe,et){return new(Qe||(Qe=Promise))(function(tt,ct){function at(it){try{ut(et.next(it))}catch(rt){ct(rt)}}function ft(it){try{ut(et.throw(it))}catch(rt){ct(rt)}}function ut(it){it.done?tt(it.value):new Qe(function(rt){rt(it.value)}).then(at,ft)}ut((et=et.apply(Je,Ye||[])).next())})},Be=t$1&&t$1.__generator||function(Je,Ye){var Qe,et,tt,ct,at={label:0,sent:function(){if(1&tt[0])throw tt[1];return tt[1]},trys:[],ops:[]};return ct={next:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(ct[Symbol.iterator]=function(){return this}),ct;function ft(ut){return function(it){return function(rt){if(Qe)throw new TypeError("Generator is already executing.");for(;at;)try{if(Qe=1,et&&(tt=2&rt[0]?et.return:rt[0]?et.throw||((tt=et.return)&&tt.call(et),0):et.next)&&!(tt=tt.call(et,rt[1])).done)return tt;switch(et=0,tt&&(rt=[2&rt[0],tt.value]),rt[0]){case 0:case 1:tt=rt;break;case 4:return at.label++,{value:rt[1],done:!1};case 5:at.label++,et=rt[1],rt=[0];continue;case 7:rt=at.ops.pop(),at.trys.pop();continue;default:if(tt=at.trys,!((tt=tt.length>0&&tt[tt.length-1])||rt[0]!==6&&rt[0]!==2)){at=0;continue}if(rt[0]===3&&(!tt||rt[1]>tt[0]&&rt[1]<tt[3])){at.label=rt[1];break}if(rt[0]===6&&at.label<tt[1]){at.label=tt[1],tt=rt;break}if(tt&&at.label<tt[2]){at.label=tt[2],at.ops.push(rt);break}tt[2]&&at.ops.pop(),at.trys.pop();continue}rt=Ye.call(Je,at)}catch(lt){rt=[6,lt],et=0}finally{Qe=tt=0}if(5&rt[0])throw rt[1];return{value:rt[0]?rt[1]:void 0,done:!0}}([ut,it])}}},He=t$1;Object.defineProperty(De,"__esModule",{value:!0});var Ke="browser-tabs-lock-key",Ge={key:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},getItem:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},clear:function(){return Fe(He,void 0,void 0,function(){return Be(this,function(Je){return[2,window.localStorage.clear()]})})},removeItem:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},setItem:function(Je,Ye){return Fe(He,void 0,void 0,function(){return Be(this,function(Qe){throw new Error("Unsupported")})})},keySync:function(Je){return window.localStorage.key(Je)},getItemSync:function(Je){return window.localStorage.getItem(Je)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(Je){return window.localStorage.removeItem(Je)},setItemSync:function(Je,Ye){return window.localStorage.setItem(Je,Ye)}};function We(Je){return new Promise(function(Ye){return setTimeout(Ye,Je)})}function Ze(Je){for(var Ye="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",Qe="",et=0;et<Je;et++)Qe+=Ye[Math.floor(Math.random()*Ye.length)];return Qe}var Xe=function(){function Je(Ye){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Ze(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=Ye,Je.waiters===void 0&&(Je.waiters=[])}return Je.prototype.acquireLock=function(Ye,Qe){return Qe===void 0&&(Qe=5e3),Fe(this,void 0,void 0,function(){var et,tt,ct,at,ft,ut,it;return Be(this,function(rt){switch(rt.label){case 0:et=Date.now()+Ze(4),tt=Date.now()+Qe,ct=Ke+"-"+Ye,at=this.storageHandler===void 0?Ge:this.storageHandler,rt.label=1;case 1:return Date.now()<tt?[4,We(30)]:[3,8];case 2:return rt.sent(),at.getItemSync(ct)!==null?[3,5]:(ft=this.id+"-"+Ye+"-"+et,[4,We(Math.floor(25*Math.random()))]);case 3:return rt.sent(),at.setItemSync(ct,JSON.stringify({id:this.id,iat:et,timeoutKey:ft,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,We(30)];case 4:return rt.sent(),(ut=at.getItemSync(ct))!==null&&(it=JSON.parse(ut)).id===this.id&&it.iat===et?(this.acquiredIatSet.add(et),this.refreshLockWhileAcquired(ct,et),[2,!0]):[3,7];case 5:return Je.lockCorrector(this.storageHandler===void 0?Ge:this.storageHandler),[4,this.waitForSomethingToChange(tt)];case 6:rt.sent(),rt.label=7;case 7:return et=Date.now()+Ze(4),[3,1];case 8:return[2,!1]}})})},Je.prototype.refreshLockWhileAcquired=function(Ye,Qe){return Fe(this,void 0,void 0,function(){var et=this;return Be(this,function(tt){return setTimeout(function(){return Fe(et,void 0,void 0,function(){var ct,at,ft;return Be(this,function(ut){switch(ut.label){case 0:return[4,n$2.default().lock(Qe)];case 1:return ut.sent(),this.acquiredIatSet.has(Qe)?(ct=this.storageHandler===void 0?Ge:this.storageHandler,(at=ct.getItemSync(Ye))===null?(n$2.default().unlock(Qe),[2]):((ft=JSON.parse(at)).timeRefreshed=Date.now(),ct.setItemSync(Ye,JSON.stringify(ft)),n$2.default().unlock(Qe),this.refreshLockWhileAcquired(Ye,Qe),[2])):(n$2.default().unlock(Qe),[2])}})})},1e3),[2]})})},Je.prototype.waitForSomethingToChange=function(Ye){return Fe(this,void 0,void 0,function(){return Be(this,function(Qe){switch(Qe.label){case 0:return[4,new Promise(function(et){var tt=!1,ct=Date.now(),at=!1;function ft(){if(at||(window.removeEventListener("storage",ft),Je.removeFromWaiting(ft),clearTimeout(ut),at=!0),!tt){tt=!0;var it=50-(Date.now()-ct);it>0?setTimeout(et,it):et(null)}}window.addEventListener("storage",ft),Je.addToWaiting(ft);var ut=setTimeout(ft,Math.max(0,Ye-Date.now()))})];case 1:return Qe.sent(),[2]}})})},Je.addToWaiting=function(Ye){this.removeFromWaiting(Ye),Je.waiters!==void 0&&Je.waiters.push(Ye)},Je.removeFromWaiting=function(Ye){Je.waiters!==void 0&&(Je.waiters=Je.waiters.filter(function(Qe){return Qe!==Ye}))},Je.notifyWaiters=function(){Je.waiters!==void 0&&Je.waiters.slice().forEach(function(Ye){return Ye()})},Je.prototype.releaseLock=function(Ye){return Fe(this,void 0,void 0,function(){return Be(this,function(Qe){switch(Qe.label){case 0:return[4,this.releaseLock__private__(Ye)];case 1:return[2,Qe.sent()]}})})},Je.prototype.releaseLock__private__=function(Ye){return Fe(this,void 0,void 0,function(){var Qe,et,tt,ct;return Be(this,function(at){switch(at.label){case 0:return Qe=this.storageHandler===void 0?Ge:this.storageHandler,et=Ke+"-"+Ye,(tt=Qe.getItemSync(et))===null?[2]:(ct=JSON.parse(tt)).id!==this.id?[3,2]:[4,n$2.default().lock(ct.iat)];case 1:at.sent(),this.acquiredIatSet.delete(ct.iat),Qe.removeItemSync(et),n$2.default().unlock(ct.iat),Je.notifyWaiters(),at.label=2;case 2:return[2]}})})},Je.lockCorrector=function(Ye){for(var Qe=Date.now()-5e3,et=Ye,tt=[],ct=0;;){var at=et.keySync(ct);if(at===null)break;tt.push(at),ct++}for(var ft=!1,ut=0;ut<tt.length;ut++){var it=tt[ut];if(it.includes(Ke)){var rt=et.getItemSync(it);if(rt!==null){var lt=JSON.parse(rt);(lt.timeRefreshed===void 0&<.timeAcquired<Qe||lt.timeRefreshed!==void 0&<.timeRefreshed<Qe)&&(et.removeItemSync(it),ft=!0)}}}ft&&Je.notifyWaiters()},Je.waiters=void 0,Je}();De.default=Xe}));const r$3={timeoutInSeconds:60},s$2={name:"auth0-spa-js",version:"2.1.3"},c$4=()=>Date.now();let d$2=class Wt extends Error{constructor(De,Fe){super(Fe),this.error=De,this.error_description=Fe,Object.setPrototypeOf(this,Wt.prototype)}static fromPayload({error:De,error_description:Fe}){return new Wt(De,Fe)}},u$4=class qt extends d$2{constructor(De,Fe,Be,He=null){super(De,Fe),this.state=Be,this.appState=He,Object.setPrototypeOf(this,qt.prototype)}},l$3=class Jt extends d$2{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Jt.prototype)}},h$1=class Zt extends l$3{constructor(De){super(),this.popup=De,Object.setPrototypeOf(this,Zt.prototype)}},p$1=class Xt extends d$2{constructor(De){super("cancelled","Popup closed"),this.popup=De,Object.setPrototypeOf(this,Xt.prototype)}},m$2=class Qt extends d$2{constructor(De,Fe,Be){super(De,Fe),this.mfa_token=Be,Object.setPrototypeOf(this,Qt.prototype)}},f$2=class er extends d$2{constructor(De,Fe){super("missing_refresh_token",`Missing Refresh Token (audience: '${g$2(De,["default"])}', scope: '${g$2(Fe)}')`),this.audience=De,this.scope=Fe,Object.setPrototypeOf(this,er.prototype)}};function g$2($e,De=[]){return $e&&!De.includes($e)?$e:""}const w$1=()=>window.crypto,y$2=()=>{const $e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let De="";return Array.from(w$1().getRandomValues(new Uint8Array(43))).forEach(Fe=>De+=$e[Fe%$e.length]),De},k$2=$e=>btoa($e),v$1=$e=>{var{clientId:De}=$e,Fe=e$1($e,["clientId"]);return new URLSearchParams((Be=>Object.keys(Be).filter(He=>Be[He]!==void 0).reduce((He,Ke)=>Object.assign(Object.assign({},He),{[Ke]:Be[Ke]}),{}))(Object.assign({client_id:De},Fe))).toString()},b$5=$e=>(De=>decodeURIComponent(atob(De).split("").map(Fe=>"%"+("00"+Fe.charCodeAt(0).toString(16)).slice(-2)).join("")))($e.replace(/_/g,"/").replace(/-/g,"+")),_$1=async($e,De)=>{const Fe=await fetch($e,De);return{ok:Fe.ok,json:await Fe.json()}},I$3=async($e,De,Fe)=>{const Be=new AbortController;let He;return De.signal=Be.signal,Promise.race([_$1($e,De),new Promise((Ke,Ge)=>{He=setTimeout(()=>{Be.abort(),Ge(new Error("Timeout when executing 'fetch'"))},Fe)})]).finally(()=>{clearTimeout(He)})},S$1=async($e,De,Fe,Be,He,Ke,Ge)=>{return We={auth:{audience:De,scope:Fe},timeout:He,fetchUrl:$e,fetchOptions:Be,useFormData:Ge},Ze=Ke,new Promise(function(Xe,Je){const Ye=new MessageChannel;Ye.port1.onmessage=function(Qe){Qe.data.error?Je(new Error(Qe.data.error)):Xe(Qe.data),Ye.port1.close()},Ze.postMessage(We,[Ye.port2])});var We,Ze},O$2=async($e,De,Fe,Be,He,Ke,Ge=1e4)=>He?S$1($e,De,Fe,Be,Ge,He,Ke):I$3($e,Be,Ge);async function T$1($e,De){var{baseUrl:Fe,timeout:Be,audience:He,scope:Ke,auth0Client:Ge,useFormData:We}=$e,Ze=e$1($e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const Xe=We?v$1(Ze):JSON.stringify(Ze);return await async function(Je,Ye,Qe,et,tt,ct,at){let ft,ut=null;for(let vt=0;vt<3;vt++)try{ft=await O$2(Je,Qe,et,tt,ct,at,Ye),ut=null;break}catch(Et){ut=Et}if(ut)throw ut;const it=ft.json,{error:rt,error_description:lt}=it,pt=e$1(it,["error","error_description"]),{ok:gt}=ft;if(!gt){const vt=lt||`HTTP error. Unable to fetch ${Je}`;throw rt==="mfa_required"?new m$2(rt,vt,pt.mfa_token):rt==="missing_refresh_token"?new f$2(Qe,et):new d$2(rt||"request_error",vt)}return pt}(`${Fe}/oauth/token`,Be,He||"default",Ke,{method:"POST",body:Xe,headers:{"Content-Type":We?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Ge||s$2))}},De,We)}const j$1=(...$e)=>{return(De=$e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(De))).join(" ");var De};let C$2=class Yt{constructor(De,Fe="@@auth0spajs@@",Be){this.prefix=Fe,this.suffix=Be,this.clientId=De.clientId,this.scope=De.scope,this.audience=De.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(De){const[Fe,Be,He,Ke]=De.split("::");return new Yt({clientId:Be,scope:Ke,audience:He},Fe)}static fromCacheEntry(De){const{scope:Fe,audience:Be,client_id:He}=De;return new Yt({scope:Fe,audience:Be,clientId:He})}},z$1=class{set(De,Fe){localStorage.setItem(De,JSON.stringify(Fe))}get(De){const Fe=window.localStorage.getItem(De);if(Fe)try{return JSON.parse(Fe)}catch{return}}remove(De){localStorage.removeItem(De)}allKeys(){return Object.keys(window.localStorage).filter(De=>De.startsWith("@@auth0spajs@@"))}},P$1=class{constructor(){this.enclosedCache=function(){let De={};return{set(Fe,Be){De[Fe]=Be},get(Fe){const Be=De[Fe];if(Be)return Be},remove(Fe){delete De[Fe]},allKeys:()=>Object.keys(De)}}()}},x$2=class{constructor(De,Fe,Be){this.cache=De,this.keyManifest=Fe,this.nowProvider=Be||c$4}async setIdToken(De,Fe,Be){var He;const Ke=this.getIdTokenCacheKey(De);await this.cache.set(Ke,{id_token:Fe,decodedToken:Be}),await((He=this.keyManifest)===null||He===void 0?void 0:He.add(Ke))}async getIdToken(De){const Fe=await this.cache.get(this.getIdTokenCacheKey(De.clientId));if(!Fe&&De.scope&&De.audience){const Be=await this.get(De);return!Be||!Be.id_token||!Be.decodedToken?void 0:{id_token:Be.id_token,decodedToken:Be.decodedToken}}if(Fe)return{id_token:Fe.id_token,decodedToken:Fe.decodedToken}}async get(De,Fe=0){var Be;let He=await this.cache.get(De.toKey());if(!He){const We=await this.getCacheKeys();if(!We)return;const Ze=this.matchExistingCacheKey(De,We);Ze&&(He=await this.cache.get(Ze))}if(!He)return;const Ke=await this.nowProvider(),Ge=Math.floor(Ke/1e3);return He.expiresAt-Fe<Ge?He.body.refresh_token?(He.body={refresh_token:He.body.refresh_token},await this.cache.set(De.toKey(),He),He.body):(await this.cache.remove(De.toKey()),void await((Be=this.keyManifest)===null||Be===void 0?void 0:Be.remove(De.toKey()))):He.body}async set(De){var Fe;const Be=new C$2({clientId:De.client_id,scope:De.scope,audience:De.audience}),He=await this.wrapCacheEntry(De);await this.cache.set(Be.toKey(),He),await((Fe=this.keyManifest)===null||Fe===void 0?void 0:Fe.add(Be.toKey()))}async clear(De){var Fe;const Be=await this.getCacheKeys();Be&&(await Be.filter(He=>!De||He.includes(De)).reduce(async(He,Ke)=>{await He,await this.cache.remove(Ke)},Promise.resolve()),await((Fe=this.keyManifest)===null||Fe===void 0?void 0:Fe.clear()))}async wrapCacheEntry(De){const Fe=await this.nowProvider();return{body:De,expiresAt:Math.floor(Fe/1e3)+De.expires_in}}async getCacheKeys(){var De;return this.keyManifest?(De=await this.keyManifest.get())===null||De===void 0?void 0:De.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(De){return new C$2({clientId:De},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(De,Fe){return Fe.filter(Be=>{var He;const Ke=C$2.fromKey(Be),Ge=new Set(Ke.scope&&Ke.scope.split(" ")),We=((He=De.scope)===null||He===void 0?void 0:He.split(" "))||[],Ze=Ke.scope&&We.reduce((Xe,Je)=>Xe&&Ge.has(Je),!0);return Ke.prefix==="@@auth0spajs@@"&&Ke.clientId===De.clientId&&Ke.audience===De.audience&&Ze})[0]}},Z$1=class{constructor(De,Fe,Be){this.storage=De,this.clientId=Fe,this.cookieDomain=Be,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(De){this.storage.save(this.storageKey,De,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const K$1=$e=>typeof $e=="number",W$2=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],E$2=$e=>{if(!$e.id_token)throw new Error("ID token is required but missing");const De=(Ke=>{const Ge=Ke.split("."),[We,Ze,Xe]=Ge;if(Ge.length!==3||!We||!Ze||!Xe)throw new Error("ID token could not be decoded");const Je=JSON.parse(b$5(Ze)),Ye={__raw:Ke},Qe={};return Object.keys(Je).forEach(et=>{Ye[et]=Je[et],W$2.includes(et)||(Qe[et]=Je[et])}),{encoded:{header:We,payload:Ze,signature:Xe},header:JSON.parse(b$5(We)),claims:Ye,user:Qe}})($e.id_token);if(!De.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(De.claims.iss!==$e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${$e.iss}", found "${De.claims.iss}"`);if(!De.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(De.header.alg!=="RS256")throw new Error(`Signature algorithm of "${De.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!De.claims.aud||typeof De.claims.aud!="string"&&!Array.isArray(De.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(De.claims.aud)){if(!De.claims.aud.includes($e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${$e.aud}" but was not one of "${De.claims.aud.join(", ")}"`);if(De.claims.aud.length>1){if(!De.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(De.claims.azp!==$e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${$e.aud}", found "${De.claims.azp}"`)}}else if(De.claims.aud!==$e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${$e.aud}" but found "${De.claims.aud}"`);if($e.nonce){if(!De.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(De.claims.nonce!==$e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${$e.nonce}", found "${De.claims.nonce}"`)}if($e.max_age&&!K$1(De.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(De.claims.exp==null||!K$1(De.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!K$1(De.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const Fe=$e.leeway||60,Be=new Date($e.now||Date.now()),He=new Date(0);if(He.setUTCSeconds(De.claims.exp+Fe),Be>He)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${Be}) is after expiration time (${He})`);if(De.claims.nbf!=null&&K$1(De.claims.nbf)){const Ke=new Date(0);if(Ke.setUTCSeconds(De.claims.nbf-Fe),Be<Ke)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${Be}) is before ${Ke}`)}if(De.claims.auth_time!=null&&K$1(De.claims.auth_time)){const Ke=new Date(0);if(Ke.setUTCSeconds(parseInt(De.claims.auth_time)+$e.max_age+Fe),Be>Ke)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${Be}) is after last auth at ${Ke}`)}if($e.organization){const Ke=$e.organization.trim();if(Ke.startsWith("org_")){const Ge=Ke;if(!De.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(Ge!==De.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${Ge}", found "${De.claims.org_id}"`)}else{const Ge=Ke.toLowerCase();if(!De.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(Ge!==De.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${Ge}", found "${De.claims.org_name}"`)}}return De};var R$2=o$5(function($e,De){var Fe=t$1&&t$1.__assign||function(){return Fe=Object.assign||function(Ze){for(var Xe,Je=1,Ye=arguments.length;Je<Ye;Je++)for(var Qe in Xe=arguments[Je])Object.prototype.hasOwnProperty.call(Xe,Qe)&&(Ze[Qe]=Xe[Qe]);return Ze},Fe.apply(this,arguments)};function Be(Ze,Xe){if(!Xe)return"";var Je="; "+Ze;return Xe===!0?Je:Je+"="+Xe}function He(Ze,Xe,Je){return encodeURIComponent(Ze).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(Xe).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(Ye){if(typeof Ye.expires=="number"){var Qe=new Date;Qe.setMilliseconds(Qe.getMilliseconds()+864e5*Ye.expires),Ye.expires=Qe}return Be("Expires",Ye.expires?Ye.expires.toUTCString():"")+Be("Domain",Ye.domain)+Be("Path",Ye.path)+Be("Secure",Ye.secure)+Be("SameSite",Ye.sameSite)}(Je)}function Ke(Ze){for(var Xe={},Je=Ze?Ze.split("; "):[],Ye=/(%[\dA-F]{2})+/gi,Qe=0;Qe<Je.length;Qe++){var et=Je[Qe].split("="),tt=et.slice(1).join("=");tt.charAt(0)==='"'&&(tt=tt.slice(1,-1));try{Xe[et[0].replace(Ye,decodeURIComponent)]=tt.replace(Ye,decodeURIComponent)}catch{}}return Xe}function Ge(){return Ke(document.cookie)}function We(Ze,Xe,Je){document.cookie=He(Ze,Xe,Fe({path:"/"},Je))}De.__esModule=!0,De.encode=He,De.parse=Ke,De.getAll=Ge,De.get=function(Ze){return Ge()[Ze]},De.set=We,De.remove=function(Ze,Xe){We(Ze,"",Fe(Fe({},Xe),{expires:-1}))}});i$6(R$2),R$2.encode,R$2.parse,R$2.getAll;var U$2=R$2.get,L$2=R$2.set,D$1=R$2.remove;const X$1={get($e){const De=U$2($e);if(De!==void 0)return JSON.parse(De)},save($e,De,Fe){let Be={};window.location.protocol==="https:"&&(Be={secure:!0,sameSite:"none"}),Fe!=null&&Fe.daysUntilExpire&&(Be.expires=Fe.daysUntilExpire),Fe!=null&&Fe.cookieDomain&&(Be.domain=Fe.cookieDomain),L$2($e,JSON.stringify(De),Be)},remove($e,De){let Fe={};De!=null&&De.cookieDomain&&(Fe.domain=De.cookieDomain),D$1($e,Fe)}},N$2={get($e){return X$1.get($e)||X$1.get(`_legacy_${$e}`)},save($e,De,Fe){let Be={};window.location.protocol==="https:"&&(Be={secure:!0}),Fe!=null&&Fe.daysUntilExpire&&(Be.expires=Fe.daysUntilExpire),Fe!=null&&Fe.cookieDomain&&(Be.domain=Fe.cookieDomain),L$2(`_legacy_${$e}`,JSON.stringify(De),Be),X$1.save($e,De,Fe)},remove($e,De){let Fe={};De!=null&&De.cookieDomain&&(Fe.domain=De.cookieDomain),D$1($e,Fe),X$1.remove($e,De),X$1.remove(`_legacy_${$e}`,De)}},J$3={get($e){if(typeof sessionStorage>"u")return;const De=sessionStorage.getItem($e);return De!=null?JSON.parse(De):void 0},save($e,De){sessionStorage.setItem($e,JSON.stringify(De))},remove($e){sessionStorage.removeItem($e)}};function F$3($e,De,Fe){var Be=De===void 0?null:De,He=function(Ze,Xe){var Je=atob(Ze);if(Xe){for(var Ye=new Uint8Array(Je.length),Qe=0,et=Je.length;Qe<et;++Qe)Ye[Qe]=Je.charCodeAt(Qe);return String.fromCharCode.apply(null,new Uint16Array(Ye.buffer))}return Je}($e,Fe!==void 0&&Fe),Ke=He.indexOf(`
|
|
2
|
-
`,10)+1,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var As=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},js={},An,Us;function qe(){return Us||(Us=1,An=function(e){try{return!!e()}catch{return!0}}),An}var jn,Ls;function nn(){if(Ls)return jn;Ls=1;var e=qe();return jn=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),jn}var Un,qs;function Se(){if(qs)return Un;qs=1;var e=nn(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Un=e?n:function(a){return function(){return t.apply(a,arguments)}},Un}var Ln,xs;function an(){if(xs)return Ln;xs=1;var e=Se(),r=e({}.toString),t=e("".slice);return Ln=function(n){return t(r(n),8,-1)},Ln}var qn,Ns;function Id(){if(Ns)return qn;Ns=1;var e=Se(),r=qe(),t=an(),n=Object,a=e("".split);return qn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,qn}var xn,Ds;function on(){return Ds||(Ds=1,xn=function(e){return e==null}),xn}var Nn,$s;function sn(){if($s)return Nn;$s=1;var e=on(),r=TypeError;return Nn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Nn}var Dn,Ms;function Tt(){if(Ms)return Dn;Ms=1;var e=Id(),r=sn();return Dn=function(t){return e(r(t))},Dn}var mt,Fs;function Ie(){if(Fs)return mt;Fs=1;var e=function(r){return r&&r.Math===Math&&r};return mt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof As=="object"&&As)||e(typeof mt=="object"&&mt)||function(){return this}()||Function("return this")(),mt}var $n={exports:{}},Mn,Bs;function gr(){return Bs||(Bs=1,Mn=!1),Mn}var Fn,zs;function Bo(){if(zs)return Fn;zs=1;var e=Ie(),r=Object.defineProperty;return Fn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},Fn}var Hs;function zo(){if(Hs)return $n.exports;Hs=1;var e=gr(),r=Ie(),t=Bo(),n="__core-js_shared__",a=$n.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.39.0",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$n.exports}var Bn,Gs;function Pd(){if(Gs)return Bn;Gs=1;var e=zo();return Bn=function(r,t){return e[r]||(e[r]=t||{})},Bn}var zn,Ks;function un(){if(Ks)return zn;Ks=1;var e=sn(),r=Object;return zn=function(t){return r(e(t))},zn}var Hn,Ws;function tr(){if(Ws)return Hn;Ws=1;var e=Se(),r=un(),t=e({}.hasOwnProperty);return Hn=Object.hasOwn||function(a,i){return t(r(a),i)},Hn}var Gn,Vs;function Ed(){if(Vs)return Gn;Vs=1;var e=Se(),r=0,t=Math.random(),n=e(1 .toString);return Gn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Gn}var Kn,Js;function Ot(){if(Js)return Kn;Js=1;var e=Ie(),r=e.navigator,t=r&&r.userAgent;return Kn=t?String(t):"",Kn}var Wn,Zs;function Rd(){if(Zs)return Wn;Zs=1;var e=Ie(),r=Ot(),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]))),Wn=s,Wn}var Vn,Ys;function _d(){if(Ys)return Vn;Ys=1;var e=Rd(),r=qe(),t=Ie(),n=t.String;return Vn=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Vn}var Jn,Xs;function Td(){if(Xs)return Jn;Xs=1;var e=_d();return Jn=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Jn}var Zn,Qs;function xe(){if(Qs)return Zn;Qs=1;var e=Ie(),r=Pd(),t=tr(),n=Ed(),a=_d(),i=Td(),o=e.Symbol,s=r("wks"),c=i?o.for||o:o&&o.withoutSetter||n;return Zn=function(l){return t(s,l)||(s[l]=a&&t(o,l)?o[l]:c("Symbol."+l)),s[l]},Zn}var Yn,eu;function Re(){if(eu)return Yn;eu=1;var e=typeof document=="object"&&document.all;return Yn=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},Yn}var Xn,ru;function nr(){if(ru)return Xn;ru=1;var e=Re();return Xn=function(r){return typeof r=="object"?r!==null:e(r)},Xn}var Qn,tu;function ur(){if(tu)return Qn;tu=1;var e=nr(),r=String,t=TypeError;return Qn=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},Qn}var ea={},ra,nu;function Ne(){if(nu)return ra;nu=1;var e=qe();return ra=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ra}var ta,au;function Od(){if(au)return ta;au=1;var e=Ne(),r=qe();return ta=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ta}var na={},aa,iu;function cn(){if(iu)return aa;iu=1;var e=Ie(),r=nr(),t=e.document,n=r(t)&&r(t.createElement);return aa=function(a){return n?t.createElement(a):{}},aa}var ia,ou;function kd(){if(ou)return ia;ou=1;var e=Ne(),r=qe(),t=cn();return ia=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),ia}var oa,su;function Me(){if(su)return oa;su=1;var e=nn(),r=Function.prototype.call;return oa=e?r.bind(r):function(){return r.apply(r,arguments)},oa}var sa,uu;function ar(){if(uu)return sa;uu=1;var e=Ie(),r=Re(),t=function(n){return r(n)?n:void 0};return sa=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},sa}var ua,cu;function ln(){if(cu)return ua;cu=1;var e=Se();return ua=e({}.isPrototypeOf),ua}var ca,lu;function Cd(){if(lu)return ca;lu=1;var e=ar(),r=Re(),t=ln(),n=Td(),a=Object;return ca=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},ca}var la,fu;function fn(){if(fu)return la;fu=1;var e=String;return la=function(r){try{return e(r)}catch{return"Object"}},la}var fa,du;function cr(){if(du)return fa;du=1;var e=Re(),r=fn(),t=TypeError;return fa=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},fa}var da,hu;function Ho(){if(hu)return da;hu=1;var e=cr(),r=on();return da=function(t,n){var a=t[n];return r(a)?void 0:e(a)},da}var ha,vu;function mv(){if(vu)return ha;vu=1;var e=Me(),r=Re(),t=nr(),n=TypeError;return ha=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")},ha}var va,pu;function gv(){if(pu)return va;pu=1;var e=Me(),r=nr(),t=Cd(),n=Ho(),a=mv(),i=xe(),o=TypeError,s=i("toPrimitive");return va=function(c,l){if(!r(c)||t(c))return c;var u=n(c,s),f;if(u){if(l===void 0&&(l="default"),f=e(u,c,l),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(c,l)},va}var pa,mu;function Ad(){if(mu)return pa;mu=1;var e=gv(),r=Cd();return pa=function(t){var n=e(t,"string");return r(n)?n:n+""},pa}var gu;function Pr(){if(gu)return na;gu=1;var e=Ne(),r=kd(),t=Od(),n=ur(),a=Ad(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c="enumerable",l="configurable",u="writable";return na.f=e?t?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&u in v&&!v[u]){var m=s(h,d);m&&m[u]&&(h[d]=v.value,v={configurable:l in v?v[l]:m[l],enumerable:c in v?v[c]:m[c],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),r)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},na}var ma,yu;function yv(){if(yu)return ma;yu=1;var e=Math.ceil,r=Math.floor;return ma=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},ma}var ga,wu;function Go(){if(wu)return ga;wu=1;var e=yv();return ga=function(r){var t=+r;return t!==t||t===0?0:e(t)},ga}var ya,bu;function jd(){if(bu)return ya;bu=1;var e=Go(),r=Math.max,t=Math.min;return ya=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},ya}var wa,Su;function wv(){if(Su)return wa;Su=1;var e=Go(),r=Math.min;return wa=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},wa}var ba,Iu;function Ko(){if(Iu)return ba;Iu=1;var e=wv();return ba=function(r){return e(r.length)},ba}var Sa,Pu;function bv(){if(Pu)return Sa;Pu=1;var e=Tt(),r=jd(),t=Ko(),n=function(a){return function(i,o,s){var c=e(i),l=t(c);if(l===0)return!a&&-1;var u=r(s,l),f;if(a&&o!==o){for(;l>u;)if(f=c[u++],f!==f)return!0}else for(;l>u;u++)if((a||u in c)&&c[u]===o)return a||u||0;return!a&&-1}};return Sa={includes:n(!0),indexOf:n(!1)},Sa}var Ia,Eu;function Wo(){return Eu||(Eu=1,Ia={}),Ia}var Pa,Ru;function Ud(){if(Ru)return Pa;Ru=1;var e=Se(),r=tr(),t=Tt(),n=bv().indexOf,a=Wo(),i=e([].push);return Pa=function(o,s){var c=t(o),l=0,u=[],f;for(f in c)!r(a,f)&&r(c,f)&&i(u,f);for(;s.length>l;)r(c,f=s[l++])&&(~n(u,f)||i(u,f));return u},Pa}var Ea,_u;function Vo(){return _u||(_u=1,Ea=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ea}var Ra,Tu;function Ld(){if(Tu)return Ra;Tu=1;var e=Ud(),r=Vo();return Ra=Object.keys||function(n){return e(n,r)},Ra}var Ou;function Sv(){if(Ou)return ea;Ou=1;var e=Ne(),r=Od(),t=Pr(),n=ur(),a=Tt(),i=Ld();return ea.f=e&&!r?Object.defineProperties:function(s,c){n(s);for(var l=a(c),u=i(c),f=u.length,h=0,d;f>h;)t.f(s,d=u[h++],l[d]);return s},ea}var _a,ku;function qd(){if(ku)return _a;ku=1;var e=ar();return _a=e("document","documentElement"),_a}var Ta,Cu;function Jo(){if(Cu)return Ta;Cu=1;var e=Pd(),r=Ed(),t=e("keys");return Ta=function(n){return t[n]||(t[n]=r(n))},Ta}var Oa,Au;function kt(){if(Au)return Oa;Au=1;var e=ur(),r=Sv(),t=Vo(),n=Wo(),a=qd(),i=cn(),o=Jo(),s=">",c="<",l="prototype",u="script",f=o("IE_PROTO"),h=function(){},d=function(b){return c+u+s+b+c+"/"+u+s},v=function(b){b.write(d("")),b.close();var g=b.parentWindow.Object;return b=null,g},m=function(){var b=i("iframe"),g="java"+u+":",p;return b.style.display="none",a.appendChild(b),b.src=String(g),p=b.contentWindow.document,p.open(),p.write(d("document.F=Object")),p.close(),p.F},w,E=function(){try{w=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&w?v(w):m():v(w);for(var b=t.length;b--;)delete E[l][t[b]];return E()};return n[f]=!0,Oa=Object.create||function(g,p){var y;return g!==null?(h[l]=e(g),y=new h,h[l]=null,y[f]=g):y=E(),p===void 0?y:r.f(y,p)},Oa}var ka,ju;function Iv(){if(ju)return ka;ju=1;var e=xe(),r=kt(),t=Pr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),ka=function(i){a[n][i]=!0},ka}var Ca,Uu;function Ct(){return Uu||(Uu=1,Ca={}),Ca}var Aa,Lu;function Pv(){if(Lu)return Aa;Lu=1;var e=Ie(),r=Re(),t=e.WeakMap;return Aa=r(t)&&/native code/.test(String(t)),Aa}var ja,qu;function Fr(){return qu||(qu=1,ja=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),ja}var Ua,xu;function Br(){if(xu)return Ua;xu=1;var e=Ne(),r=Pr(),t=Fr();return Ua=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Ua}var La,Nu;function ut(){if(Nu)return La;Nu=1;var e=Pv(),r=Ie(),t=nr(),n=Br(),a=tr(),i=zo(),o=Jo(),s=Wo(),c="Object already initialized",l=r.TypeError,u=r.WeakMap,f,h,d,v=function(b){return d(b)?h(b):f(b,{})},m=function(b){return function(g){var p;if(!t(g)||(p=h(g)).type!==b)throw new l("Incompatible receiver, "+b+" required");return p}};if(e||i.state){var w=i.state||(i.state=new u);w.get=w.get,w.has=w.has,w.set=w.set,f=function(b,g){if(w.has(b))throw new l(c);return g.facade=b,w.set(b,g),g},h=function(b){return w.get(b)||{}},d=function(b){return w.has(b)}}else{var E=o("state");s[E]=!0,f=function(b,g){if(a(b,E))throw new l(c);return g.facade=b,n(b,E,g),g},h=function(b){return a(b,E)?b[E]:{}},d=function(b){return a(b,E)}}return La={set:f,get:h,has:d,enforce:v,getterFor:m},La}var qa={},xa={},Du;function xd(){if(Du)return xa;Du=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return xa.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,xa}var $u;function Nd(){if($u)return qa;$u=1;var e=Ne(),r=Me(),t=xd(),n=Fr(),a=Tt(),i=Ad(),o=tr(),s=kd(),c=Object.getOwnPropertyDescriptor;return qa.f=e?c:function(u,f){if(u=a(u),f=i(f),s)try{return c(u,f)}catch{}if(o(u,f))return n(!r(t.f,u,f),u[f])},qa}var Na={exports:{}},Da,Mu;function Dd(){if(Mu)return Da;Mu=1;var e=Ne(),r=tr(),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 Da={EXISTS:a,PROPER:i,CONFIGURABLE:o},Da}var $a,Fu;function Zo(){if(Fu)return $a;Fu=1;var e=Se(),r=Re(),t=zo(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),$a=t.inspectSource,$a}var Bu;function $d(){if(Bu)return Na.exports;Bu=1;var e=Se(),r=qe(),t=Re(),n=tr(),a=Ne(),i=Dd().CONFIGURABLE,o=Zo(),s=ut(),c=s.enforce,l=s.get,u=String,f=Object.defineProperty,h=e("".slice),d=e("".replace),v=e([].join),m=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),w=String(String).split("String"),E=Na.exports=function(b,g,p){h(u(g),0,7)==="Symbol("&&(g="["+d(u(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),p&&p.getter&&(g="get "+g),p&&p.setter&&(g="set "+g),(!n(b,"name")||i&&b.name!==g)&&(a?f(b,"name",{value:g,configurable:!0}):b.name=g),m&&p&&n(p,"arity")&&b.length!==p.arity&&f(b,"length",{value:p.arity});try{p&&n(p,"constructor")&&p.constructor?a&&f(b,"prototype",{writable:!1}):b.prototype&&(b.prototype=void 0)}catch{}var y=c(b);return n(y,"source")||(y.source=v(w,typeof g=="string"?g:"")),b};return Function.prototype.toString=E(function(){return t(this)&&l(this).source||o(this)},"toString"),Na.exports}var Ma,zu;function ir(){if(zu)return Ma;zu=1;var e=Re(),r=Pr(),t=$d(),n=Bo();return Ma=function(a,i,o,s){s||(s={});var c=s.enumerable,l=s.name!==void 0?s.name:i;if(e(o)&&t(o,l,s),s.global)c?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(c=!0):delete a[i]}catch{}c?a[i]=o:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},Ma}var Fa={},Hu;function Ev(){if(Hu)return Fa;Hu=1;var e=Ud(),r=Vo(),t=r.concat("length","prototype");return Fa.f=Object.getOwnPropertyNames||function(a){return e(a,t)},Fa}var Ba={},Gu;function Md(){return Gu||(Gu=1,Ba.f=Object.getOwnPropertySymbols),Ba}var za,Ku;function Rv(){if(Ku)return za;Ku=1;var e=ar(),r=Se(),t=Ev(),n=Md(),a=ur(),i=r([].concat);return za=e("Reflect","ownKeys")||function(s){var c=t.f(a(s)),l=n.f;return l?i(c,l(s)):c},za}var Ha,Wu;function Fd(){if(Wu)return Ha;Wu=1;var e=tr(),r=Rv(),t=Nd(),n=Pr();return Ha=function(a,i,o){for(var s=r(i),c=n.f,l=t.f,u=0;u<s.length;u++){var f=s[u];!e(a,f)&&!(o&&e(o,f))&&c(a,f,l(i,f))}},Ha}var Ga,Vu;function Bd(){if(Vu)return Ga;Vu=1;var e=qe(),r=Re(),t=/#|\.prototype\./,n=function(c,l){var u=i[a(c)];return u===s?!0:u===o?!1:r(l)?e(l):!!l},a=n.normalize=function(c){return String(c).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Ga=n,Ga}var Ka,Ju;function ke(){if(Ju)return Ka;Ju=1;var e=Ie(),r=Nd().f,t=Br(),n=ir(),a=Bo(),i=Fd(),o=Bd();return Ka=function(s,c){var l=s.target,u=s.global,f=s.stat,h,d,v,m,w,E;if(u?d=e:f?d=e[l]||a(l,{}):d=e[l]&&e[l].prototype,d)for(v in c){if(w=c[v],s.dontCallGetSet?(E=r(d,v),m=E&&E.value):m=d[v],h=o(u?v:l+(f?".":"#")+v,s.forced),!h&&m!==void 0){if(typeof w==typeof m)continue;i(w,m)}(s.sham||m&&m.sham)&&t(w,"sham",!0),n(d,v,w,s)}},Ka}var Wa,Zu;function _v(){if(Zu)return Wa;Zu=1;var e=qe();return Wa=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Wa}var Va,Yu;function Yo(){if(Yu)return Va;Yu=1;var e=tr(),r=Re(),t=un(),n=Jo(),a=_v(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Va=a?o.getPrototypeOf:function(c){var l=t(c);if(e(l,i))return l[i];var u=l.constructor;return r(u)&&l instanceof u?u.prototype:l instanceof o?s:null},Va}var Ja,Xu;function zd(){if(Xu)return Ja;Xu=1;var e=qe(),r=Re(),t=nr(),n=kt(),a=Yo(),i=ir(),o=xe(),s=gr(),c=o("iterator"),l=!1,u,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(u=f)):l=!0);var d=!t(u)||e(function(){var v={};return u[c].call(v)!==v});return d?u={}:s&&(u=n(u)),r(u[c])||i(u,c,function(){return this}),Ja={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},Ja}var Za,Qu;function ct(){if(Qu)return Za;Qu=1;var e=Pr().f,r=tr(),t=xe(),n=t("toStringTag");return Za=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},Za}var Ya,ec;function Hd(){if(ec)return Ya;ec=1;var e=zd().IteratorPrototype,r=kt(),t=Fr(),n=ct(),a=Ct(),i=function(){return this};return Ya=function(o,s,c,l){var u=s+" Iterator";return o.prototype=r(e,{next:t(+!l,c)}),n(o,u,!1,!0),a[u]=i,o},Ya}var Xa,rc;function Tv(){if(rc)return Xa;rc=1;var e=Se(),r=cr();return Xa=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},Xa}var Qa,tc;function Ov(){if(tc)return Qa;tc=1;var e=nr();return Qa=function(r){return e(r)||r===null},Qa}var ei,nc;function kv(){if(nc)return ei;nc=1;var e=Ov(),r=String,t=TypeError;return ei=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},ei}var ri,ac;function Xo(){if(ac)return ri;ac=1;var e=Tv(),r=nr(),t=sn(),n=kv();return ri=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(c,l){return t(c),n(l),r(c)&&(a?o(c,l):c.__proto__=l),c}}():void 0),ri}var ti,ic;function Gd(){if(ic)return ti;ic=1;var e=ke(),r=Me(),t=gr(),n=Dd(),a=Re(),i=Hd(),o=Yo(),s=Xo(),c=ct(),l=Br(),u=ir(),f=xe(),h=Ct(),d=zd(),v=n.PROPER,m=n.CONFIGURABLE,w=d.IteratorPrototype,E=d.BUGGY_SAFARI_ITERATORS,b=f("iterator"),g="keys",p="values",y="entries",k=function(){return this};return ti=function(A,j,z,H,ee,x,N){i(z,j,H);var q=function(Z){if(Z===ee&&S)return S;if(!E&&Z&&Z in re)return re[Z];switch(Z){case g:return function(){return new z(this,Z)};case p:return function(){return new z(this,Z)};case y:return function(){return new z(this,Z)}}return function(){return new z(this)}},O=j+" Iterator",X=!1,re=A.prototype,Q=re[b]||re["@@iterator"]||ee&&re[ee],S=!E&&Q||q(ee),_=j==="Array"&&re.entries||Q,D,B,K;if(_&&(D=o(_.call(new A)),D!==Object.prototype&&D.next&&(!t&&o(D)!==w&&(s?s(D,w):a(D[b])||u(D,b,k)),c(D,O,!0,!0),t&&(h[O]=k))),v&&ee===p&&Q&&Q.name!==p&&(!t&&m?l(re,"name",p):(X=!0,S=function(){return r(Q,this)})),ee)if(B={values:q(p),keys:x?S:q(g),entries:q(y)},N)for(K in B)(E||X||!(K in re))&&u(re,K,B[K]);else e({target:j,proto:!0,forced:E||X},B);return(!t||N)&&re[b]!==S&&u(re,b,S,{name:ee}),h[j]=S,B},ti}var ni,oc;function Qo(){return oc||(oc=1,ni=function(e,r){return{value:e,done:r}}),ni}var ai,sc;function es(){if(sc)return ai;sc=1;var e=Tt(),r=Iv(),t=Ct(),n=ut(),a=Pr().f,i=Gd(),o=Qo(),s=gr(),c=Ne(),l="Array Iterator",u=n.set,f=n.getterFor(l);ai=i(Array,"Array",function(d,v){u(this,{type:l,target:e(d),index:0,kind:v})},function(){var d=f(this),v=d.target,m=d.index++;if(!v||m>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(m,!1);case"values":return o(v[m],!1)}return o([m,v[m]],!1)},"values");var h=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&c&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return ai}var uc={},cc;function Cv(){if(cc)return uc;cc=1;var e=ke(),r=Se(),t=jd(),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(l){for(var u=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");u[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(u,"")}}),uc}var ii,lc;function Kd(){if(lc)return ii;lc=1;var e=Ie(),r=Ne(),t=Object.getOwnPropertyDescriptor;return ii=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},ii}var oi,fc;function dn(){if(fc)return oi;fc=1;var e=qe(),r=xe(),t=Ne(),n=gr(),a=r("iterator");return oi=!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"),c="";return i.pathname="c%20d",o.forEach(function(l,u){o.delete("b"),c+=u+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!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"||c!=="a1c3"||new URL("https://x",void 0).host!=="x"}),oi}var si,dc;function hn(){if(dc)return si;dc=1;var e=$d(),r=Pr();return si=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)},si}var ui,hc;function Av(){if(hc)return ui;hc=1;var e=ir();return ui=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},ui}var ci,vc;function rs(){if(vc)return ci;vc=1;var e=ln(),r=TypeError;return ci=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},ci}var li,pc;function jv(){if(pc)return li;pc=1;var e=an(),r=Se();return li=function(t){if(e(t)==="Function")return r(t)},li}var fi,mc;function lt(){if(mc)return fi;mc=1;var e=jv(),r=cr(),t=nn(),n=e(e.bind);return fi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},fi}var di,gc;function ts(){if(gc)return di;gc=1;var e=xe(),r=e("toStringTag"),t={};return t[r]="z",di=String(t)==="[object z]",di}var hi,yc;function At(){if(yc)return hi;yc=1;var e=ts(),r=Re(),t=an(),n=xe(),a=n("toStringTag"),i=Object,o=t(function(){return arguments}())==="Arguments",s=function(c,l){try{return c[l]}catch{}};return hi=e?t:function(c){var l,u,f;return c===void 0?"Undefined":c===null?"Null":typeof(u=s(l=i(c),a))=="string"?u:o?t(l):(f=t(l))==="Object"&&r(l.callee)?"Arguments":f},hi}var vi,wc;function Er(){if(wc)return vi;wc=1;var e=At(),r=String;return vi=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},vi}var pi,bc;function vn(){if(bc)return pi;bc=1;var e=At(),r=Ho(),t=on(),n=Ct(),a=xe(),i=a("iterator");return pi=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},pi}var mi,Sc;function ns(){if(Sc)return mi;Sc=1;var e=Me(),r=cr(),t=ur(),n=fn(),a=vn(),i=TypeError;return mi=function(o,s){var c=arguments.length<2?a(o):s;if(r(c))return t(e(c,o));throw new i(n(o)+" is not iterable")},mi}var gi,Ic;function zr(){if(Ic)return gi;Ic=1;var e=TypeError;return gi=function(r,t){if(r<t)throw new e("Not enough arguments");return r},gi}var yi,Pc;function pn(){if(Pc)return yi;Pc=1;var e=Se();return yi=e([].slice),yi}var wi,Ec;function Uv(){if(Ec)return wi;Ec=1;var e=pn(),r=Math.floor,t=function(n,a){var i=n.length;if(i<8)for(var o=1,s,c;o<i;){for(c=o,s=n[o];c&&a(n[c-1],s)>0;)n[c]=n[--c];c!==o++&&(n[c]=s)}else for(var l=r(i/2),u=t(e(n,0,l),a),f=t(e(n,l),a),h=u.length,d=f.length,v=0,m=0;v<h||m<d;)n[v+m]=v<h&&m<d?a(u[v],f[m])<=0?u[v++]:f[m++]:v<h?u[v++]:f[m++];return n};return wi=t,wi}var bi,Rc;function Wd(){if(Rc)return bi;Rc=1,es(),Cv();var e=ke(),r=Ie(),t=Kd(),n=ar(),a=Me(),i=Se(),o=Ne(),s=dn(),c=ir(),l=hn(),u=Av(),f=ct(),h=Hd(),d=ut(),v=rs(),m=Re(),w=tr(),E=lt(),b=At(),g=ur(),p=nr(),y=Er(),k=kt(),A=Fr(),j=ns(),z=vn(),H=Qo(),ee=zr(),x=xe(),N=Uv(),q=x("iterator"),O="URLSearchParams",X=O+"Iterator",re=d.set,Q=d.getterFor(O),S=d.getterFor(X),_=t("fetch"),D=t("Request"),B=t("Headers"),K=D&&D.prototype,Z=B&&B.prototype,de=r.TypeError,ae=r.encodeURIComponent,ue=String.fromCharCode,se=n("String","fromCodePoint"),Pe=parseInt,je=i("".charAt),Fe=i([].join),Ce=i([].push),Ve=i("".replace),lr=i([].shift),fr=i([].splice),T=i("".split),F=i("".slice),J=i(/./.exec),pe=/\+/g,ve="�",me=/^[0-9a-f]+$/i,Be=function($,W){var V=F($,W,W+2);return J(me,V)?Pe(V,16):NaN},M=function($){for(var W=0,V=128;V>0&&($&V)!==0;V>>=1)W++;return W},ie=function($){var W=null;switch($.length){case 1:W=$[0];break;case 2:W=($[0]&31)<<6|$[1]&63;break;case 3:W=($[0]&15)<<12|($[1]&63)<<6|$[2]&63;break;case 4:W=($[0]&7)<<18|($[1]&63)<<12|($[2]&63)<<6|$[3]&63;break}return W>1114111?null:W},le=function($){$=Ve($,pe," ");for(var W=$.length,V="",Y=0;Y<W;){var ce=je($,Y);if(ce==="%"){if(je($,Y+1)==="%"||Y+3>W){V+="%",Y++;continue}var he=Be($,Y+1);if(he!==he){V+=ce,Y++;continue}Y+=2;var we=M(he);if(we===0)ce=ue(he);else{if(we===1||we>4){V+=ve,Y++;continue}for(var be=[he],_e=1;_e<we&&(Y++,!(Y+3>W||je($,Y)!=="%"));){var De=Be($,Y+1);if(De!==De){Y+=3;break}if(De>191||De<128)break;Ce(be,De),Y+=2,_e++}if(be.length!==we){V+=ve;continue}var dr=ie(be);dr===null?V+=ve:ce=se(dr)}}V+=ce,Y++}return V},fe=/[!'()~]|%20/g,ge={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},or=function($){return ge[$]},sr=function($){return Ve(ae($),fe,or)},Te=h(function(W,V){re(this,{type:X,target:Q(W).entries,index:0,kind:V})},O,function(){var W=S(this),V=W.target,Y=W.index++;if(!V||Y>=V.length)return W.target=null,H(void 0,!0);var ce=V[Y];switch(W.kind){case"keys":return H(ce.key,!1);case"values":return H(ce.value,!1)}return H([ce.key,ce.value],!1)},!0),He=function($){this.entries=[],this.url=null,$!==void 0&&(p($)?this.parseObject($):this.parseQuery(typeof $=="string"?je($,0)==="?"?F($,1):$:y($)))};He.prototype={type:O,bindURL:function($){this.url=$,this.update()},parseObject:function($){var W=this.entries,V=z($),Y,ce,he,we,be,_e,De;if(V)for(Y=j($,V),ce=Y.next;!(he=a(ce,Y)).done;){if(we=j(g(he.value)),be=we.next,(_e=a(be,we)).done||(De=a(be,we)).done||!a(be,we).done)throw new de("Expected sequence with length 2");Ce(W,{key:y(_e.value),value:y(De.value)})}else for(var dr in $)w($,dr)&&Ce(W,{key:dr,value:y($[dr])})},parseQuery:function($){if($)for(var W=this.entries,V=T($,"&"),Y=0,ce,he;Y<V.length;)ce=V[Y++],ce.length&&(he=T(ce,"="),Ce(W,{key:le(lr(he)),value:le(Fe(he,"="))}))},serialize:function(){for(var $=this.entries,W=[],V=0,Y;V<$.length;)Y=$[V++],Ce(W,sr(Y.key)+"="+sr(Y.value));return Fe(W,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Je=function(){v(this,Xe);var W=arguments.length>0?arguments[0]:void 0,V=re(this,new He(W));o||(this.size=V.entries.length)},Xe=Je.prototype;if(u(Xe,{append:function(W,V){var Y=Q(this);ee(arguments.length,2),Ce(Y.entries,{key:y(W),value:y(V)}),o||this.length++,Y.updateURL()},delete:function($){for(var W=Q(this),V=ee(arguments.length,1),Y=W.entries,ce=y($),he=V<2?void 0:arguments[1],we=he===void 0?he:y(he),be=0;be<Y.length;){var _e=Y[be];if(_e.key===ce&&(we===void 0||_e.value===we)){if(fr(Y,be,1),we!==void 0)break}else be++}o||(this.size=Y.length),W.updateURL()},get:function(W){var V=Q(this).entries;ee(arguments.length,1);for(var Y=y(W),ce=0;ce<V.length;ce++)if(V[ce].key===Y)return V[ce].value;return null},getAll:function(W){var V=Q(this).entries;ee(arguments.length,1);for(var Y=y(W),ce=[],he=0;he<V.length;he++)V[he].key===Y&&Ce(ce,V[he].value);return ce},has:function(W){for(var V=Q(this).entries,Y=ee(arguments.length,1),ce=y(W),he=Y<2?void 0:arguments[1],we=he===void 0?he:y(he),be=0;be<V.length;){var _e=V[be++];if(_e.key===ce&&(we===void 0||_e.value===we))return!0}return!1},set:function(W,V){var Y=Q(this);ee(arguments.length,1);for(var ce=Y.entries,he=!1,we=y(W),be=y(V),_e=0,De;_e<ce.length;_e++)De=ce[_e],De.key===we&&(he?fr(ce,_e--,1):(he=!0,De.value=be));he||Ce(ce,{key:we,value:be}),o||(this.size=ce.length),Y.updateURL()},sort:function(){var W=Q(this);N(W.entries,function(V,Y){return V.key>Y.key?1:-1}),W.updateURL()},forEach:function(W){for(var V=Q(this).entries,Y=E(W,arguments.length>1?arguments[1]:void 0),ce=0,he;ce<V.length;)he=V[ce++],Y(he.value,he.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}),c(Xe,q,Xe.entries,{name:"entries"}),c(Xe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Xe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Je,O),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:Je}),!s&&m(B)){var pt=i(Z.has),Rn=i(Z.set),Hr=function($){if(p($)){var W=$.body,V;if(b(W)===O)return V=$.headers?new B($.headers):new B,pt(V,"content-type")||Rn(V,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),k($,{body:A(0,y(W)),headers:A(0,V)})}return $};if(m(_)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(W){return _(W,arguments.length>1?Hr(arguments[1]):{})}}),m(D)){var Gr=function(W){return v(this,K),new D(W,arguments.length>1?Hr(arguments[1]):{})};K.constructor=Gr,Gr.prototype=K,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Gr})}}return bi={URLSearchParams:Je,getState:Q},bi}var _c;function Lv(){return _c||(_c=1,Wd()),js}var Tc={},Oc;function qv(){if(Oc)return Tc;Oc=1;var e=ir(),r=Se(),t=Er(),n=zr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),c=r(i.forEach),l=r([].push),u=new a("a=1&a=2&b=3");return u.delete("a",1),u.delete("b",void 0),u+""!="a=2"&&e(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];c(this,function(k,A){l(v,{key:A,value:k})}),n(h,1);for(var m=t(f),w=t(d),E=0,b=0,g=!1,p=v.length,y;E<p;)y=v[E++],g||y.key===m?(g=!0,s(this,y.key)):b++;for(;b<p;)y=v[b++],y.key===m&&y.value===w||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),Tc}var kc={},Cc;function xv(){if(Cc)return kc;Cc=1;var e=ir(),r=Se(),t=Er(),n=zr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),c=new a("a=1");return(c.has("a",2)||!c.has("a",void 0))&&e(i,"has",function(u){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,u);var d=o(this,u);n(f,1);for(var v=t(h),m=0;m<d.length;)if(d[m++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),kc}var Ac={},jc;function Nv(){if(jc)return Ac;jc=1;var e=Ne(),r=Se(),t=hn(),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}),Ac}var Si,Uc;function as(){if(Uc)return Si;Uc=1;var e=Ie();return Si=e,Si}var Ii,Lc;function Vd(){if(Lc)return Ii;Lc=1,Lv(),qv(),xv(),Nv();var e=as();return Ii=e.URLSearchParams,Ii}var qc={},xc={},Nc={},Pi,Dc;function Jd(){if(Dc)return Pi;Dc=1;var e=Se(),r=Go(),t=Er(),n=sn(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(c){return function(l,u){var f=t(n(l)),h=r(u),d=f.length,v,m;return h<0||h>=d?c?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(m=i(f,h+1))<56320||m>57343?c?a(f,h):v:c?o(f,h,h+2):(v-55296<<10)+(m-56320)+65536)}};return Pi={codeAt:s(!1),charAt:s(!0)},Pi}var $c;function Zd(){if($c)return Nc;$c=1;var e=Jd().charAt,r=Er(),t=ut(),n=Gd(),a=Qo(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(c){o(this,{type:i,string:r(c),index:0})},function(){var l=s(this),u=l.string,f=l.index,h;return f>=u.length?a(void 0,!0):(h=e(u,f),l.index+=h.length,a(h,!1))}),Nc}var Ei,Mc;function Dv(){if(Mc)return Ei;Mc=1;var e=Ne(),r=Se(),t=Me(),n=qe(),a=Ld(),i=Md(),o=xd(),s=un(),c=Id(),l=Object.assign,u=Object.defineProperty,f=r([].concat);return Ei=!l||n(function(){if(e&&l({b:1},l(u({},"a",{enumerable:!0,get:function(){u(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),m="abcdefghijklmnopqrst";return h[v]=7,m.split("").forEach(function(w){d[w]=w}),l({},h)[v]!==7||a(l({},d)).join("")!==m})?function(d,v){for(var m=s(d),w=arguments.length,E=1,b=i.f,g=o.f;w>E;)for(var p=c(arguments[E++]),y=b?f(a(p),b(p)):a(p),k=y.length,A=0,j;k>A;)j=y[A++],(!e||t(g,p,j))&&(m[j]=p[j]);return m}:l,Ei}var Ri,Fc;function Yd(){if(Fc)return Ri;Fc=1;var e=Me(),r=ur(),t=Ho();return Ri=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(c){s=!0,o=c}if(a==="throw")throw i;if(s)throw o;return r(o),i},Ri}var _i,Bc;function $v(){if(Bc)return _i;Bc=1;var e=ur(),r=Yd();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 Ti,zc;function Xd(){if(zc)return Ti;zc=1;var e=xe(),r=Ct(),t=e("iterator"),n=Array.prototype;return Ti=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},Ti}var Oi,Hc;function Qd(){if(Hc)return Oi;Hc=1;var e=Se(),r=qe(),t=Re(),n=At(),a=ar(),i=Zo(),o=function(){},s=a("Reflect","construct"),c=/^\s*(?:class|function)\b/,l=e(c.exec),u=!c.test(o),f=function(v){if(!t(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!t(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return u||!!l(c,i(v))}catch{return!0}};return h.sham=!0,Oi=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,Oi}var ki,Gc;function Mv(){if(Gc)return ki;Gc=1;var e=Ne(),r=Pr(),t=Fr();return ki=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},ki}var Ci,Kc;function Fv(){if(Kc)return Ci;Kc=1;var e=lt(),r=Me(),t=un(),n=$v(),a=Xd(),i=Qd(),o=Ko(),s=Mv(),c=ns(),l=vn(),u=Array;return Ci=function(h){var d=t(h),v=i(this),m=arguments.length,w=m>1?arguments[1]:void 0,E=w!==void 0;E&&(w=e(w,m>2?arguments[2]:void 0));var b=l(d),g=0,p,y,k,A,j,z;if(b&&!(this===u&&a(b)))for(y=v?new this:[],A=c(d,b),j=A.next;!(k=r(j,A)).done;g++)z=E?n(A,w,[k.value,g],!0):k.value,s(y,g,z);else for(p=o(d),y=v?new this(p):u(p);p>g;g++)z=E?w(d[g],g):d[g],s(y,g,z);return y.length=g,y},Ci}var Ai,Wc;function Bv(){if(Wc)return Ai;Wc=1;var e=Se(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,c=128,l="-",u=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=t-n,v=RangeError,m=e(f.exec),w=Math.floor,E=String.fromCharCode,b=e("".charCodeAt),g=e([].join),p=e([].push),y=e("".replace),k=e("".split),A=e("".toLowerCase),j=function(x){for(var N=[],q=0,O=x.length;q<O;){var X=b(x,q++);if(X>=55296&&X<=56319&&q<O){var re=b(x,q++);(re&64512)===56320?p(N,((X&1023)<<10)+(re&1023)+65536):(p(N,X),q--)}else p(N,X)}return N},z=function(x){return x+22+75*(x<26)},H=function(x,N,q){var O=0;for(x=q?w(x/o):x>>1,x+=w(x/N);x>d*a>>1;)x=w(x/d),O+=t;return w(O+(d+1)*x/(x+i))},ee=function(x){var N=[];x=j(x);var q=x.length,O=c,X=0,re=s,Q,S;for(Q=0;Q<x.length;Q++)S=x[Q],S<128&&p(N,E(S));var _=N.length,D=_;for(_&&p(N,l);D<q;){var B=r;for(Q=0;Q<x.length;Q++)S=x[Q],S>=O&&S<B&&(B=S);var K=D+1;if(B-O>w((r-X)/K))throw new v(h);for(X+=(B-O)*K,O=B,Q=0;Q<x.length;Q++){if(S=x[Q],S<O&&++X>r)throw new v(h);if(S===O){for(var Z=X,de=t;;){var ae=de<=re?n:de>=re+a?a:de-re;if(Z<ae)break;var ue=Z-ae,se=t-ae;p(N,E(z(ae+ue%se))),Z=w(ue/se),de+=t}p(N,E(z(Z))),re=H(X,K,D===_),X=0,D++}}X++,O++}return g(N,"")};return Ai=function(x){var N=[],q=k(y(A(x),f,"."),"."),O,X;for(O=0;O<q.length;O++)X=q[O],p(N,m(u,X)?"xn--"+ee(X):X);return g(N,".")},Ai}var Vc;function zv(){if(Vc)return xc;Vc=1,Zd();var e=ke(),r=Ne(),t=dn(),n=Ie(),a=lt(),i=Se(),o=ir(),s=hn(),c=rs(),l=tr(),u=Dv(),f=Fv(),h=pn(),d=Jd().codeAt,v=Bv(),m=Er(),w=ct(),E=zr(),b=Wd(),g=ut(),p=g.set,y=g.getterFor("URL"),k=b.URLSearchParams,A=b.getState,j=n.URL,z=n.TypeError,H=n.parseInt,ee=Math.floor,x=Math.pow,N=i("".charAt),q=i(/./.exec),O=i([].join),X=i(1 .toString),re=i([].pop),Q=i([].push),S=i("".replace),_=i([].shift),D=i("".split),B=i("".slice),K=i("".toLowerCase),Z=i([].unshift),de="Invalid authority",ae="Invalid scheme",ue="Invalid host",se="Invalid port",Pe=/[a-z]/i,je=/[\d+-.a-z]/i,Fe=/\d/,Ce=/^0x/i,Ve=/^[0-7]+$/,lr=/^\d+$/,fr=/^[\da-f]+$/i,T=/[\0\t\n\r #%/:<>?@[\\\]^|]/,F=/[\0\t\n\r #/:<>?@[\\\]^|]/,J=/^[\u0000-\u0020]+/,pe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ve=/[\t\n\r]/g,me,Be=function(P){var L=D(P,"."),R,I,C,oe,G,Ee,Oe;if(L.length&&L[L.length-1]===""&&L.length--,R=L.length,R>4)return P;for(I=[],C=0;C<R;C++){if(oe=L[C],oe==="")return P;if(G=10,oe.length>1&&N(oe,0)==="0"&&(G=q(Ce,oe)?16:8,oe=B(oe,G===8?1:2)),oe==="")Ee=0;else{if(!q(G===10?lr:G===8?Ve:fr,oe))return P;Ee=H(oe,G)}Q(I,Ee)}for(C=0;C<R;C++)if(Ee=I[C],C===R-1){if(Ee>=x(256,5-R))return null}else if(Ee>255)return null;for(Oe=re(I),C=0;C<I.length;C++)Oe+=I[C]*x(256,3-C);return Oe},M=function(P){var L=[0,0,0,0,0,0,0,0],R=0,I=null,C=0,oe,G,Ee,Oe,Ue,er,U,Ae=function(){return N(P,C)};if(Ae()===":"){if(N(P,1)!==":")return;C+=2,R++,I=R}for(;Ae();){if(R===8)return;if(Ae()===":"){if(I!==null)return;C++,R++,I=R;continue}for(oe=G=0;G<4&&q(fr,Ae());)oe=oe*16+H(Ae(),16),C++,G++;if(Ae()==="."){if(G===0||(C-=G,R>6))return;for(Ee=0;Ae();){if(Oe=null,Ee>0)if(Ae()==="."&&Ee<4)C++;else return;if(!q(Fe,Ae()))return;for(;q(Fe,Ae());){if(Ue=H(Ae(),10),Oe===null)Oe=Ue;else{if(Oe===0)return;Oe=Oe*10+Ue}if(Oe>255)return;C++}L[R]=L[R]*256+Oe,Ee++,(Ee===2||Ee===4)&&R++}if(Ee!==4)return;break}else if(Ae()===":"){if(C++,!Ae())return}else if(Ae())return;L[R++]=oe}if(I!==null)for(er=R-I,R=7;R!==0&&er>0;)U=L[R],L[R--]=L[I+er-1],L[I+--er]=U;else if(R!==8)return;return L},ie=function(P){for(var L=null,R=1,I=null,C=0,oe=0;oe<8;oe++)P[oe]!==0?(C>R&&(L=I,R=C),I=null,C=0):(I===null&&(I=oe),++C);return C>R?I:L},le=function(P){var L,R,I,C;if(typeof P=="number"){for(L=[],R=0;R<4;R++)Z(L,P%256),P=ee(P/256);return O(L,".")}if(typeof P=="object"){for(L="",I=ie(P),R=0;R<8;R++)C&&P[R]===0||(C&&(C=!1),I===R?(L+=R?":":"::",C=!0):(L+=X(P[R],16),R<7&&(L+=":")));return"["+L+"]"}return P},fe={},ge=u({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),or=u({},ge,{"#":1,"?":1,"{":1,"}":1}),sr=u({},or,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(P,L){var R=d(P,0);return R>32&&R<127&&!l(L,P)?P:encodeURIComponent(P)},He={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Je=function(P,L){var R;return P.length===2&&q(Pe,N(P,0))&&((R=N(P,1))===":"||!L&&R==="|")},Xe=function(P){var L;return P.length>1&&Je(B(P,0,2))&&(P.length===2||(L=N(P,2))==="/"||L==="\\"||L==="?"||L==="#")},pt=function(P){return P==="."||K(P)==="%2e"},Rn=function(P){return P=K(P),P===".."||P==="%2e."||P===".%2e"||P==="%2e%2e"},Hr={},Gr={},$={},W={},V={},Y={},ce={},he={},we={},be={},_e={},De={},dr={},_n={},Rs={},Tn={},Kr={},hr={},_s={},Cr={},yr={},On=function(P,L,R){var I=m(P),C,oe,G;if(L){if(oe=this.parse(I),oe)throw new z(oe);this.searchParams=null}else{if(R!==void 0&&(C=new On(R,!0)),oe=this.parse(I,null,C),oe)throw new z(oe);G=A(new k),G.bindURL(this),this.searchParams=G}};On.prototype={type:"URL",parse:function(P,L,R){var I=this,C=L||Hr,oe=0,G="",Ee=!1,Oe=!1,Ue=!1,er,U,Ae,wr;for(P=m(P),L||(I.scheme="",I.username="",I.password="",I.host=null,I.port=null,I.path=[],I.query=null,I.fragment=null,I.cannotBeABaseURL=!1,P=S(P,J,""),P=S(P,pe,"$1")),P=S(P,ve,""),er=f(P);oe<=er.length;){switch(U=er[oe],C){case Hr:if(U&&q(Pe,U))G+=K(U),C=Gr;else{if(L)return ae;C=$;continue}break;case Gr:if(U&&(q(je,U)||U==="+"||U==="-"||U==="."))G+=K(U);else if(U===":"){if(L&&(I.isSpecial()!==l(He,G)||G==="file"&&(I.includesCredentials()||I.port!==null)||I.scheme==="file"&&!I.host))return;if(I.scheme=G,L){I.isSpecial()&&He[I.scheme]===I.port&&(I.port=null);return}G="",I.scheme==="file"?C=_n:I.isSpecial()&&R&&R.scheme===I.scheme?C=W:I.isSpecial()?C=he:er[oe+1]==="/"?(C=V,oe++):(I.cannotBeABaseURL=!0,Q(I.path,""),C=_s)}else{if(L)return ae;G="",C=$,oe=0;continue}break;case $:if(!R||R.cannotBeABaseURL&&U!=="#")return ae;if(R.cannotBeABaseURL&&U==="#"){I.scheme=R.scheme,I.path=h(R.path),I.query=R.query,I.fragment="",I.cannotBeABaseURL=!0,C=yr;break}C=R.scheme==="file"?_n:Y;continue;case W:if(U==="/"&&er[oe+1]==="/")C=we,oe++;else{C=Y;continue}break;case V:if(U==="/"){C=be;break}else{C=hr;continue}case Y:if(I.scheme=R.scheme,U===me)I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query;else if(U==="/"||U==="\\"&&I.isSpecial())C=ce;else if(U==="?")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query="",C=Cr;else if(U==="#")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query,I.fragment="",C=yr;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.path.length--,C=hr;continue}break;case ce:if(I.isSpecial()&&(U==="/"||U==="\\"))C=we;else if(U==="/")C=be;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,C=hr;continue}break;case he:if(C=we,U!=="/"||N(G,oe+1)!=="/")continue;oe++;break;case we:if(U!=="/"&&U!=="\\"){C=be;continue}break;case be:if(U==="@"){Ee&&(G="%40"+G),Ee=!0,Ae=f(G);for(var kn=0;kn<Ae.length;kn++){var ks=Ae[kn];if(ks===":"&&!Ue){Ue=!0;continue}var Cs=Te(ks,sr);Ue?I.password+=Cs:I.username+=Cs}G=""}else if(U===me||U==="/"||U==="?"||U==="#"||U==="\\"&&I.isSpecial()){if(Ee&&G==="")return de;oe-=f(G).length+1,G="",C=_e}else G+=U;break;case _e:case De:if(L&&I.scheme==="file"){C=Tn;continue}else if(U===":"&&!Oe){if(G==="")return ue;if(wr=I.parseHost(G),wr)return wr;if(G="",C=dr,L===De)return}else if(U===me||U==="/"||U==="?"||U==="#"||U==="\\"&&I.isSpecial()){if(I.isSpecial()&&G==="")return ue;if(L&&G===""&&(I.includesCredentials()||I.port!==null))return;if(wr=I.parseHost(G),wr)return wr;if(G="",C=Kr,L)return;continue}else U==="["?Oe=!0:U==="]"&&(Oe=!1),G+=U;break;case dr:if(q(Fe,U))G+=U;else if(U===me||U==="/"||U==="?"||U==="#"||U==="\\"&&I.isSpecial()||L){if(G!==""){var Cn=H(G,10);if(Cn>65535)return se;I.port=I.isSpecial()&&Cn===He[I.scheme]?null:Cn,G=""}if(L)return;C=Kr;continue}else return se;break;case _n:if(I.scheme="file",U==="/"||U==="\\")C=Rs;else if(R&&R.scheme==="file")switch(U){case me:I.host=R.host,I.path=h(R.path),I.query=R.query;break;case"?":I.host=R.host,I.path=h(R.path),I.query="",C=Cr;break;case"#":I.host=R.host,I.path=h(R.path),I.query=R.query,I.fragment="",C=yr;break;default:Xe(O(h(er,oe),""))||(I.host=R.host,I.path=h(R.path),I.shortenPath()),C=hr;continue}else{C=hr;continue}break;case Rs:if(U==="/"||U==="\\"){C=Tn;break}R&&R.scheme==="file"&&!Xe(O(h(er,oe),""))&&(Je(R.path[0],!0)?Q(I.path,R.path[0]):I.host=R.host),C=hr;continue;case Tn:if(U===me||U==="/"||U==="\\"||U==="?"||U==="#"){if(!L&&Je(G))C=hr;else if(G===""){if(I.host="",L)return;C=Kr}else{if(wr=I.parseHost(G),wr)return wr;if(I.host==="localhost"&&(I.host=""),L)return;G="",C=Kr}continue}else G+=U;break;case Kr:if(I.isSpecial()){if(C=hr,U!=="/"&&U!=="\\")continue}else if(!L&&U==="?")I.query="",C=Cr;else if(!L&&U==="#")I.fragment="",C=yr;else if(U!==me&&(C=hr,U!=="/"))continue;break;case hr:if(U===me||U==="/"||U==="\\"&&I.isSpecial()||!L&&(U==="?"||U==="#")){if(Rn(G)?(I.shortenPath(),U!=="/"&&!(U==="\\"&&I.isSpecial())&&Q(I.path,"")):pt(G)?U!=="/"&&!(U==="\\"&&I.isSpecial())&&Q(I.path,""):(I.scheme==="file"&&!I.path.length&&Je(G)&&(I.host&&(I.host=""),G=N(G,0)+":"),Q(I.path,G)),G="",I.scheme==="file"&&(U===me||U==="?"||U==="#"))for(;I.path.length>1&&I.path[0]==="";)_(I.path);U==="?"?(I.query="",C=Cr):U==="#"&&(I.fragment="",C=yr)}else G+=Te(U,or);break;case _s:U==="?"?(I.query="",C=Cr):U==="#"?(I.fragment="",C=yr):U!==me&&(I.path[0]+=Te(U,fe));break;case Cr:!L&&U==="#"?(I.fragment="",C=yr):U!==me&&(U==="'"&&I.isSpecial()?I.query+="%27":U==="#"?I.query+="%23":I.query+=Te(U,fe));break;case yr:U!==me&&(I.fragment+=Te(U,ge));break}oe++}},parseHost:function(P){var L,R,I;if(N(P,0)==="["){if(N(P,P.length-1)!=="]"||(L=M(B(P,1,-1)),!L))return ue;this.host=L}else if(this.isSpecial()){if(P=v(P),q(T,P)||(L=Be(P),L===null))return ue;this.host=L}else{if(q(F,P))return ue;for(L="",R=f(P),I=0;I<R.length;I++)L+=Te(R[I],fe);this.host=L}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(He,this.scheme)},shortenPath:function(){var P=this.path,L=P.length;L&&(this.scheme!=="file"||L!==1||!Je(P[0],!0))&&P.length--},serialize:function(){var P=this,L=P.scheme,R=P.username,I=P.password,C=P.host,oe=P.port,G=P.path,Ee=P.query,Oe=P.fragment,Ue=L+":";return C!==null?(Ue+="//",P.includesCredentials()&&(Ue+=R+(I?":"+I:"")+"@"),Ue+=le(C),oe!==null&&(Ue+=":"+oe)):L==="file"&&(Ue+="//"),Ue+=P.cannotBeABaseURL?G[0]:G.length?"/"+O(G,"/"):"",Ee!==null&&(Ue+="?"+Ee),Oe!==null&&(Ue+="#"+Oe),Ue},setHref:function(P){var L=this.parse(P);if(L)throw new z(L);this.searchParams.update()},getOrigin:function(){var P=this.scheme,L=this.port;if(P==="blob")try{return new Wr(P.path[0]).origin}catch{return"null"}return P==="file"||!this.isSpecial()?"null":P+"://"+le(this.host)+(L!==null?":"+L:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(P){this.parse(m(P)+":",Hr)},getUsername:function(){return this.username},setUsername:function(P){var L=f(m(P));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var R=0;R<L.length;R++)this.username+=Te(L[R],sr)}},getPassword:function(){return this.password},setPassword:function(P){var L=f(m(P));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var R=0;R<L.length;R++)this.password+=Te(L[R],sr)}},getHost:function(){var P=this.host,L=this.port;return P===null?"":L===null?le(P):le(P)+":"+L},setHost:function(P){this.cannotBeABaseURL||this.parse(P,_e)},getHostname:function(){var P=this.host;return P===null?"":le(P)},setHostname:function(P){this.cannotBeABaseURL||this.parse(P,De)},getPort:function(){var P=this.port;return P===null?"":m(P)},setPort:function(P){this.cannotHaveUsernamePasswordPort()||(P=m(P),P===""?this.port=null:this.parse(P,dr))},getPathname:function(){var P=this.path;return this.cannotBeABaseURL?P[0]:P.length?"/"+O(P,"/"):""},setPathname:function(P){this.cannotBeABaseURL||(this.path=[],this.parse(P,Kr))},getSearch:function(){var P=this.query;return P?"?"+P:""},setSearch:function(P){P=m(P),P===""?this.query=null:(N(P,0)==="?"&&(P=B(P,1)),this.query="",this.parse(P,Cr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var P=this.fragment;return P?"#"+P:""},setHash:function(P){if(P=m(P),P===""){this.fragment=null;return}N(P,0)==="#"&&(P=B(P,1)),this.fragment="",this.parse(P,yr)},update:function(){this.query=this.searchParams.serialize()||null}};var Wr=function(L){var R=c(this,ze),I=E(arguments.length,1)>1?arguments[1]:void 0,C=p(R,new On(L,!1,I));r||(R.href=C.serialize(),R.origin=C.getOrigin(),R.protocol=C.getProtocol(),R.username=C.getUsername(),R.password=C.getPassword(),R.host=C.getHost(),R.hostname=C.getHostname(),R.port=C.getPort(),R.pathname=C.getPathname(),R.search=C.getSearch(),R.searchParams=C.getSearchParams(),R.hash=C.getHash())},ze=Wr.prototype,Qe=function(P,L){return{get:function(){return y(this)[P]()},set:L&&function(R){return y(this)[L](R)},configurable:!0,enumerable:!0}};if(r&&(s(ze,"href",Qe("serialize","setHref")),s(ze,"origin",Qe("getOrigin")),s(ze,"protocol",Qe("getProtocol","setProtocol")),s(ze,"username",Qe("getUsername","setUsername")),s(ze,"password",Qe("getPassword","setPassword")),s(ze,"host",Qe("getHost","setHost")),s(ze,"hostname",Qe("getHostname","setHostname")),s(ze,"port",Qe("getPort","setPort")),s(ze,"pathname",Qe("getPathname","setPathname")),s(ze,"search",Qe("getSearch","setSearch")),s(ze,"searchParams",Qe("getSearchParams")),s(ze,"hash",Qe("getHash","setHash"))),o(ze,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(ze,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var Ts=j.createObjectURL,Os=j.revokeObjectURL;Ts&&o(Wr,"createObjectURL",a(Ts,j)),Os&&o(Wr,"revokeObjectURL",a(Os,j))}return w(Wr,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:Wr}),xc}var Jc;function Hv(){return Jc||(Jc=1,zv()),qc}var Zc={},Yc;function Gv(){if(Yc)return Zc;Yc=1;var e=ke(),r=ar(),t=qe(),n=zr(),a=Er(),i=dn(),o=r("URL"),s=i&&t(function(){o.canParse()}),c=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||c},{canParse:function(u){var f=n(arguments.length,1),h=a(u),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),Zc}var Xc={},Qc;function Kv(){if(Qc)return Xc;Qc=1;var e=ke(),r=ar(),t=zr(),n=Er(),a=dn(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var c=t(arguments.length,1),l=n(s),u=c<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,u)}catch{return null}}}),Xc}var el={},rl;function Wv(){if(rl)return el;rl=1;var e=ke(),r=Me();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),el}var ji,tl;function Vv(){if(tl)return ji;tl=1,Vd(),Hv(),Gv(),Kv(),Wv();var e=as();return ji=e.URL,ji}var Ui,nl;function Jv(){if(nl)return Ui;nl=1;var e=Vv();return Ui=e,Ui}var Li,al;function Zv(){if(al)return Li;al=1;var e=Jv();return Li=e,Li}Zv();var il={},qi,ol;function Yv(){return ol||(ol=1,qi={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}),qi}var xi,sl;function Xv(){if(sl)return xi;sl=1;var e=cn(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return xi=t===Object.prototype?void 0:t,xi}var ul;function eh(){if(ul)return il;ul=1;var e=Ie(),r=Yv(),t=Xv(),n=es(),a=Br(),i=ct(),o=xe(),s=o("iterator"),c=n.values,l=function(f,h){if(f){if(f[s]!==c)try{a(f,s,c)}catch{f[s]=c}if(i(f,h,!0),r[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var u in r)l(e[u]&&e[u].prototype,u);return l(t,"DOMTokenList"),il}var Ni,cl;function Qv(){if(cl)return Ni;cl=1;var e=Vd();return eh(),Ni=e,Ni}var Di,ll;function ep(){if(ll)return Di;ll=1;var e=Qv();return Di=e,Di}ep();var fl={},dl={},$i,hl;function rp(){if(hl)return $i;hl=1;var e=nr(),r=Br();return $i=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},$i}var Mi,vl;function tp(){if(vl)return Mi;vl=1;var e=Se(),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 Mi=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},Mi}var Fi,pl;function np(){if(pl)return Fi;pl=1;var e=qe(),r=Fr();return Fi=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),Fi}var Bi,ml;function ap(){if(ml)return Bi;ml=1;var e=Br(),r=tp(),t=np(),n=Error.captureStackTrace;return Bi=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},Bi}var zi,gl;function jt(){if(gl)return zi;gl=1;var e=lt(),r=Me(),t=ur(),n=fn(),a=Xd(),i=Ko(),o=ln(),s=ns(),c=vn(),l=Yd(),u=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return zi=function(d,v,m){var w=m&&m.that,E=!!(m&&m.AS_ENTRIES),b=!!(m&&m.IS_RECORD),g=!!(m&&m.IS_ITERATOR),p=!!(m&&m.INTERRUPTED),y=e(v,w),k,A,j,z,H,ee,x,N=function(O){return k&&l(k,"normal",O),new f(!0,O)},q=function(O){return E?(t(O),p?y(O[0],O[1],N):y(O[0],O[1])):p?y(O,N):y(O)};if(b)k=d.iterator;else if(g)k=d;else{if(A=c(d),!A)throw new u(n(d)+" is not iterable");if(a(A)){for(j=0,z=i(d);z>j;j++)if(H=q(d[j]),H&&o(h,H))return H;return new f(!1)}k=s(d,A)}for(ee=b?d.next:k.next;!(x=r(ee,k)).done;){try{H=q(x.value)}catch(O){l(k,"throw",O)}if(typeof H=="object"&&H&&o(h,H))return H}return new f(!1)},zi}var Hi,yl;function ip(){if(yl)return Hi;yl=1;var e=Er();return Hi=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},Hi}var wl;function op(){if(wl)return dl;wl=1;var e=ke(),r=ln(),t=Yo(),n=Xo(),a=Fd(),i=kt(),o=Br(),s=Fr(),c=rp(),l=ap(),u=jt(),f=ip(),h=xe(),d=h("toStringTag"),v=Error,m=[].push,w=function(g,p){var y=r(E,this),k;n?k=n(new v,y?t(this):E):(k=y?this:i(E),o(k,d,"Error")),p!==void 0&&o(k,"message",f(p)),l(k,w,k.stack,1),arguments.length>2&&c(k,arguments[2]);var A=[];return u(g,m,{that:A}),o(k,"errors",A),k};n?n(w,v):a(w,v,{name:!0});var E=w.prototype=i(v.prototype,{constructor:s(1,w),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:w}),dl}var bl;function sp(){return bl||(bl=1,op()),fl}var Sl={},Gi,Il;function up(){if(Il)return Gi;Il=1;var e=ts(),r=At();return Gi=e?{}.toString:function(){return"[object "+r(this)+"]"},Gi}var Pl;function cp(){if(Pl)return Sl;Pl=1;var e=ts(),r=ir(),t=up();return e||r(Object.prototype,"toString",t,{unsafe:!0}),Sl}var El={},Rl={},Ki,_l;function rh(){if(_l)return Ki;_l=1;var e=Ie(),r=Ot(),t=an(),n=function(a){return r.slice(0,a.length)===a};return Ki=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"}(),Ki}var Wi,Tl;function is(){if(Tl)return Wi;Tl=1;var e=rh();return Wi=e==="NODE",Wi}var Vi,Ol;function lp(){if(Ol)return Vi;Ol=1;var e=ar(),r=hn(),t=xe(),n=Ne(),a=t("species");return Vi=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},Vi}var Ji,kl;function fp(){if(kl)return Ji;kl=1;var e=Qd(),r=fn(),t=TypeError;return Ji=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},Ji}var Zi,Cl;function th(){if(Cl)return Zi;Cl=1;var e=ur(),r=fp(),t=on(),n=xe(),a=n("species");return Zi=function(i,o){var s=e(i).constructor,c;return s===void 0||t(c=e(s)[a])?o:r(c)},Zi}var Yi,Al;function nh(){if(Al)return Yi;Al=1;var e=nn(),r=Function.prototype,t=r.apply,n=r.call;return Yi=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),Yi}var Xi,jl;function ah(){if(jl)return Xi;jl=1;var e=Ot();return Xi=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),Xi}var Qi,Ul;function ih(){if(Ul)return Qi;Ul=1;var e=Ie(),r=nh(),t=lt(),n=Re(),a=tr(),i=qe(),o=qd(),s=pn(),c=cn(),l=zr(),u=ah(),f=is(),h=e.setImmediate,d=e.clearImmediate,v=e.process,m=e.Dispatch,w=e.Function,E=e.MessageChannel,b=e.String,g=0,p={},y="onreadystatechange",k,A,j,z;i(function(){k=e.location});var H=function(q){if(a(p,q)){var O=p[q];delete p[q],O()}},ee=function(q){return function(){H(q)}},x=function(q){H(q.data)},N=function(q){e.postMessage(b(q),k.protocol+"//"+k.host)};return(!h||!d)&&(h=function(O){l(arguments.length,1);var X=n(O)?O:w(O),re=s(arguments,1);return p[++g]=function(){r(X,void 0,re)},A(g),g},d=function(O){delete p[O]},f?A=function(q){v.nextTick(ee(q))}:m&&m.now?A=function(q){m.now(ee(q))}:E&&!u?(j=new E,z=j.port2,j.port1.onmessage=x,A=t(z.postMessage,z)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&k&&k.protocol!=="file:"&&!i(N)?(A=N,e.addEventListener("message",x,!1)):y in c("script")?A=function(q){o.appendChild(c("script"))[y]=function(){o.removeChild(this),H(q)}}:A=function(q){setTimeout(ee(q),0)}),Qi={set:h,clear:d},Qi}var eo,Ll;function oh(){if(Ll)return eo;Ll=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}}},eo=e,eo}var ro,ql;function dp(){if(ql)return ro;ql=1;var e=Ot();return ro=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",ro}var to,xl;function hp(){if(xl)return to;xl=1;var e=Ot();return to=/web0s(?!.*chrome)/i.test(e),to}var no,Nl;function vp(){if(Nl)return no;Nl=1;var e=Ie(),r=Kd(),t=lt(),n=ih().set,a=oh(),i=ah(),o=dp(),s=hp(),c=is(),l=e.MutationObserver||e.WebKitMutationObserver,u=e.document,f=e.process,h=e.Promise,d=r("queueMicrotask"),v,m,w,E,b;if(!d){var g=new a,p=function(){var y,k;for(c&&(y=f.domain)&&y.exit();k=g.get();)try{k()}catch(A){throw g.head&&v(),A}y&&y.enter()};!i&&!c&&!s&&l&&u?(m=!0,w=u.createTextNode(""),new l(p).observe(w,{characterData:!0}),v=function(){w.data=m=!m}):!o&&h&&h.resolve?(E=h.resolve(void 0),E.constructor=h,b=t(E.then,E),v=function(){b(p)}):c?v=function(){f.nextTick(p)}:(n=t(n,e),v=function(){n(p)}),d=function(y){g.head||v(),g.add(y)}}return no=d,no}var ao,Dl;function pp(){return Dl||(Dl=1,ao=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),ao}var io,$l;function ft(){return $l||($l=1,io=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),io}var oo,Ml;function dt(){if(Ml)return oo;Ml=1;var e=Ie();return oo=e.Promise,oo}var so,Fl;function Ut(){if(Fl)return so;Fl=1;var e=Ie(),r=dt(),t=Re(),n=Bd(),a=Zo(),i=xe(),o=rh(),s=gr(),c=Rd(),l=r&&r.prototype,u=i("species"),f=!1,h=t(e.PromiseRejectionEvent),d=n("Promise",function(){var v=a(r),m=v!==String(r);if(!m&&c===66||s&&!(l.catch&&l.finally))return!0;if(!c||c<51||!/native code/.test(v)){var w=new r(function(g){g(1)}),E=function(g){g(function(){},function(){})},b=w.constructor={};if(b[u]=E,f=w.then(function(){})instanceof E,!f)return!0}return!m&&(o==="BROWSER"||o==="DENO")&&!h});return so={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},so}var uo={},Bl;function Rr(){if(Bl)return uo;Bl=1;var e=cr(),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 uo.f=function(n){return new t(n)},uo}var zl;function mp(){if(zl)return Rl;zl=1;var e=ke(),r=gr(),t=is(),n=Ie(),a=Me(),i=ir(),o=Xo(),s=ct(),c=lp(),l=cr(),u=Re(),f=nr(),h=rs(),d=th(),v=ih().set,m=vp(),w=pp(),E=ft(),b=oh(),g=ut(),p=dt(),y=Ut(),k=Rr(),A="Promise",j=y.CONSTRUCTOR,z=y.REJECTION_EVENT,H=y.SUBCLASSING,ee=g.getterFor(A),x=g.set,N=p&&p.prototype,q=p,O=N,X=n.TypeError,re=n.document,Q=n.process,S=k.f,_=S,D=!!(re&&re.createEvent&&n.dispatchEvent),B="unhandledrejection",K="rejectionhandled",Z=0,de=1,ae=2,ue=1,se=2,Pe,je,Fe,Ce,Ve=function(M){var ie;return f(M)&&u(ie=M.then)?ie:!1},lr=function(M,ie){var le=ie.value,fe=ie.state===de,ge=fe?M.ok:M.fail,or=M.resolve,sr=M.reject,Te=M.domain,He,Je,Xe;try{ge?(fe||(ie.rejection===se&&pe(ie),ie.rejection=ue),ge===!0?He=le:(Te&&Te.enter(),He=ge(le),Te&&(Te.exit(),Xe=!0)),He===M.promise?sr(new X("Promise-chain cycle")):(Je=Ve(He))?a(Je,He,or,sr):or(He)):sr(le)}catch(pt){Te&&!Xe&&Te.exit(),sr(pt)}},fr=function(M,ie){M.notified||(M.notified=!0,m(function(){for(var le=M.reactions,fe;fe=le.get();)lr(fe,M);M.notified=!1,ie&&!M.rejection&&F(M)}))},T=function(M,ie,le){var fe,ge;D?(fe=re.createEvent("Event"),fe.promise=ie,fe.reason=le,fe.initEvent(M,!1,!0),n.dispatchEvent(fe)):fe={promise:ie,reason:le},!z&&(ge=n["on"+M])?ge(fe):M===B&&w("Unhandled promise rejection",le)},F=function(M){a(v,n,function(){var ie=M.facade,le=M.value,fe=J(M),ge;if(fe&&(ge=E(function(){t?Q.emit("unhandledRejection",le,ie):T(B,ie,le)}),M.rejection=t||J(M)?se:ue,ge.error))throw ge.value})},J=function(M){return M.rejection!==ue&&!M.parent},pe=function(M){a(v,n,function(){var ie=M.facade;t?Q.emit("rejectionHandled",ie):T(K,ie,M.value)})},ve=function(M,ie,le){return function(fe){M(ie,fe,le)}},me=function(M,ie,le){M.done||(M.done=!0,le&&(M=le),M.value=ie,M.state=ae,fr(M,!0))},Be=function(M,ie,le){if(!M.done){M.done=!0,le&&(M=le);try{if(M.facade===ie)throw new X("Promise can't be resolved itself");var fe=Ve(ie);fe?m(function(){var ge={done:!1};try{a(fe,ie,ve(Be,ge,M),ve(me,ge,M))}catch(or){me(ge,or,M)}}):(M.value=ie,M.state=de,fr(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(j&&(q=function(ie){h(this,O),l(ie),a(Pe,this);var le=ee(this);try{ie(ve(Be,le),ve(me,le))}catch(fe){me(le,fe)}},O=q.prototype,Pe=function(ie){x(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:Z,value:null})},Pe.prototype=i(O,"then",function(ie,le){var fe=ee(this),ge=S(d(this,q));return fe.parent=!0,ge.ok=u(ie)?ie:!0,ge.fail=u(le)&&le,ge.domain=t?Q.domain:void 0,fe.state===Z?fe.reactions.add(ge):m(function(){lr(ge,fe)}),ge.promise}),je=function(){var M=new Pe,ie=ee(M);this.promise=M,this.resolve=ve(Be,ie),this.reject=ve(me,ie)},k.f=S=function(M){return M===q||M===Fe?new je(M):_(M)},!r&&u(p)&&N!==Object.prototype)){Ce=N.then,H||i(N,"then",function(ie,le){var fe=this;return new q(function(ge,or){a(Ce,fe,ge,or)}).then(ie,le)},{unsafe:!0});try{delete N.constructor}catch{}o&&o(N,O)}return e({global:!0,constructor:!0,wrap:!0,forced:j},{Promise:q}),s(q,A,!1,!0),c(A),Rl}var Hl={},co,Gl;function gp(){if(Gl)return co;Gl=1;var e=xe(),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 co=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var c={};c[r]=function(){return{next:function(){return{done:s=!0}}}},i(c)}catch{}return s},co}var lo,Kl;function mn(){if(Kl)return lo;Kl=1;var e=dt(),r=gp(),t=Ut().CONSTRUCTOR;return lo=t||!r(function(n){e.all(n).then(void 0,function(){})}),lo}var Wl;function yp(){if(Wl)return Hl;Wl=1;var e=ke(),r=Me(),t=cr(),n=Rr(),a=ft(),i=jt(),o=mn();return e({target:"Promise",stat:!0,forced:o},{all:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=t(l.resolve),m=[],w=0,E=1;i(c,function(b){var g=w++,p=!1;E++,r(v,l,b).then(function(y){p||(p=!0,m[g]=y,--E||f(m))},h)}),--E||f(m)});return d.error&&h(d.value),u.promise}}),Hl}var Vl={},Jl;function wp(){if(Jl)return Vl;Jl=1;var e=ke(),r=gr(),t=Ut().CONSTRUCTOR,n=dt(),a=ar(),i=Re(),o=ir(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(l){return this.then(void 0,l)}}),!r&&i(n)){var c=a("Promise").prototype.catch;s.catch!==c&&o(s,"catch",c,{unsafe:!0})}return Vl}var Zl={},Yl;function bp(){if(Yl)return Zl;Yl=1;var e=ke(),r=Me(),t=cr(),n=Rr(),a=ft(),i=jt(),o=mn();return e({target:"Promise",stat:!0,forced:o},{race:function(c){var l=this,u=n.f(l),f=u.reject,h=a(function(){var d=t(l.resolve);i(c,function(v){r(d,l,v).then(u.resolve,f)})});return h.error&&f(h.value),u.promise}}),Zl}var Xl={},Ql;function Sp(){if(Ql)return Xl;Ql=1;var e=ke(),r=Rr(),t=Ut().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}}),Xl}var ef={},fo,rf;function sh(){if(rf)return fo;rf=1;var e=ur(),r=nr(),t=Rr();return fo=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},fo}var tf;function Ip(){if(tf)return ef;tf=1;var e=ke(),r=ar(),t=gr(),n=dt(),a=Ut().CONSTRUCTOR,i=sh(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),ef}var nf;function Pp(){return nf||(nf=1,mp(),yp(),wp(),bp(),Sp(),Ip()),El}var af={},of;function Ep(){if(of)return af;of=1;var e=ke(),r=Me(),t=cr(),n=Rr(),a=ft(),i=jt(),o=mn();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=t(l.resolve),m=[],w=0,E=1;i(c,function(b){var g=w++,p=!1;E++,r(v,l,b).then(function(y){p||(p=!0,m[g]={status:"fulfilled",value:y},--E||f(m))},function(y){p||(p=!0,m[g]={status:"rejected",reason:y},--E||f(m))})}),--E||f(m)});return d.error&&h(d.value),u.promise}}),af}var sf={},uf;function Rp(){if(uf)return sf;uf=1;var e=ke(),r=Me(),t=cr(),n=ar(),a=Rr(),i=ft(),o=jt(),s=mn(),c="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(u){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,m=d.reject,w=i(function(){var E=t(f.resolve),b=[],g=0,p=1,y=!1;o(u,function(k){var A=g++,j=!1;p++,r(E,f,k).then(function(z){j||y||(y=!0,v(z))},function(z){j||y||(j=!0,b[A]=z,--p||m(new h(b,c)))})}),--p||m(new h(b,c))});return w.error&&m(w.value),d.promise}}),sf}var cf={},lf;function uh(){if(lf)return cf;lf=1;var e=ke(),r=Ie(),t=nh(),n=pn(),a=Rr(),i=cr(),o=ft(),s=r.Promise,c=!1,l=!s||!s.try||o(function(){s.try(function(u){c=u===8},8)}).error||!c;return e({target:"Promise",stat:!0,forced:l},{try:function(u){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return t(i(u),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),cf}var ff={},df;function ch(){if(df)return ff;df=1;var e=ke(),r=Rr();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),ff}var hf={},vf;function _p(){if(vf)return hf;vf=1;var e=ke(),r=gr(),t=dt(),n=qe(),a=ar(),i=Re(),o=th(),s=sh(),c=ir(),l=t&&t.prototype,u=!!t&&n(function(){l.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:u},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(m){return s(d,h()).then(function(){return m})}:h,v?function(m){return s(d,h()).then(function(){throw m})}:h)}}),!r&&i(t)){var f=a("Promise").prototype.finally;l.finally!==f&&c(l,"finally",f,{unsafe:!0})}return hf}var ho,pf;function Tp(){if(pf)return ho;pf=1,sp(),es(),cp(),Pp(),Ep(),Rp(),uh(),ch(),_p(),Zd();var e=as();return ho=e.Promise,ho}var vo,mf;function Op(){if(mf)return vo;mf=1;var e=Tp();return eh(),vo=e,vo}var gf={},yf;function kp(){return yf||(yf=1,uh()),gf}var wf={},bf;function Cp(){return bf||(bf=1,ch()),wf}var po,Sf;function Ap(){if(Sf)return po;Sf=1;var e=Op();return kp(),Cp(),po=e,po}Ap();const lh="sesamy-debug";function jp(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 Up(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 Lp(e){jp(lh,e.toString(),1)}function qp(){return Up(lh)==="true"}function ye(e){qp()&&console.log(e)}function Ir(e,r){if(typeof window>"u")return;const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});ye(`Triggering event: ${e}`),dispatchEvent(t)}function pr(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ss(e,r){return e(r={exports:{}},r.exports),r.exports}var Ar=ss(function(e,r){Object.defineProperty(r,"__esModule",{value:!0});var t=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();r.default=function(){return t.getInstance()}});os(Ar);var xp=os(ss(function(e,r){var t=jr&&jr.__awaiter||function(u,f,h,d){return new(h||(h=Promise))(function(v,m){function w(g){try{b(d.next(g))}catch(p){m(p)}}function E(g){try{b(d.throw(g))}catch(p){m(p)}}function b(g){g.done?v(g.value):new h(function(p){p(g.value)}).then(w,E)}b((d=d.apply(u,f||[])).next())})},n=jr&&jr.__generator||function(u,f){var h,d,v,m,w={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return m={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function E(b){return function(g){return function(p){if(h)throw new TypeError("Generator is already executing.");for(;w;)try{if(h=1,d&&(v=2&p[0]?d.return:p[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,p[1])).done)return v;switch(d=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return w.label++,{value:p[1],done:!1};case 5:w.label++,d=p[1],p=[0];continue;case 7:p=w.ops.pop(),w.trys.pop();continue;default:if(v=w.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){w=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){w.label=p[1];break}if(p[0]===6&&w.label<v[1]){w.label=v[1],v=p;break}if(v&&w.label<v[2]){w.label=v[2],w.ops.push(p);break}v[2]&&w.ops.pop(),w.trys.pop();continue}p=f.call(u,w)}catch(y){p=[6,y],d=0}finally{h=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([b,g])}}},a=jr;Object.defineProperty(r,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return t(a,void 0,void 0,function(){return n(this,function(f){throw new Error("Unsupported")})})},getItem:function(u){return t(a,void 0,void 0,function(){return n(this,function(f){throw new Error("Unsupported")})})},clear:function(){return t(a,void 0,void 0,function(){return n(this,function(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return t(a,void 0,void 0,function(){return n(this,function(f){throw new Error("Unsupported")})})},setItem:function(u,f){return t(a,void 0,void 0,function(){return n(this,function(h){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,f){return window.localStorage.setItem(u,f)}};function s(u){return new Promise(function(f){return setTimeout(f,u)})}function c(u){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<u;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=function(){function u(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+c(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),t(this,void 0,void 0,function(){var d,v,m,w,E,b,g;return n(this,function(p){switch(p.label){case 0:d=Date.now()+c(4),v=Date.now()+h,m=i+"-"+f,w=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),w.getItemSync(m)!==null?[3,5]:(E=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),w.setItemSync(m,JSON.stringify({id:this.id,iat:d,timeoutKey:E,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(b=w.getItemSync(m))!==null&&(g=JSON.parse(b)).id===this.id&&g.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(m,d),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return d=Date.now()+c(4),[3,1];case 8:return[2,!1]}})})},u.prototype.refreshLockWhileAcquired=function(f,h){return t(this,void 0,void 0,function(){var d=this;return n(this,function(v){return setTimeout(function(){return t(d,void 0,void 0,function(){var m,w,E;return n(this,function(b){switch(b.label){case 0:return[4,Ar.default().lock(h)];case 1:return b.sent(),this.acquiredIatSet.has(h)?(m=this.storageHandler===void 0?o:this.storageHandler,(w=m.getItemSync(f))===null?(Ar.default().unlock(h),[2]):((E=JSON.parse(w)).timeRefreshed=Date.now(),m.setItemSync(f,JSON.stringify(E)),Ar.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Ar.default().unlock(h),[2])}})})},1e3),[2]})})},u.prototype.waitForSomethingToChange=function(f){return t(this,void 0,void 0,function(){return n(this,function(h){switch(h.label){case 0:return[4,new Promise(function(d){var v=!1,m=Date.now(),w=!1;function E(){if(w||(window.removeEventListener("storage",E),u.removeFromWaiting(E),clearTimeout(b),w=!0),!v){v=!0;var g=50-(Date.now()-m);g>0?setTimeout(d,g):d(null)}}window.addEventListener("storage",E),u.addToWaiting(E);var b=setTimeout(E,Math.max(0,f-Date.now()))})];case 1:return h.sent(),[2]}})})},u.addToWaiting=function(f){this.removeFromWaiting(f),u.waiters!==void 0&&u.waiters.push(f)},u.removeFromWaiting=function(f){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(h){return h!==f}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(f){return f()})},u.prototype.releaseLock=function(f){return t(this,void 0,void 0,function(){return n(this,function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}})})},u.prototype.releaseLock__private__=function(f){return t(this,void 0,void 0,function(){var h,d,v,m;return n(this,function(w){switch(w.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(m=JSON.parse(v)).id!==this.id?[3,2]:[4,Ar.default().lock(m.iat)];case 1:w.sent(),this.acquiredIatSet.delete(m.iat),h.removeItemSync(d),Ar.default().unlock(m.iat),u.notifyWaiters(),w.label=2;case 2:return[2]}})})},u.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],m=0;;){var w=d.keySync(m);if(w===null)break;v.push(w),m++}for(var E=!1,b=0;b<v.length;b++){var g=v[b];if(g.includes(i)){var p=d.getItemSync(g);if(p!==null){var y=JSON.parse(p);(y.timeRefreshed===void 0&&y.timeAcquired<h||y.timeRefreshed!==void 0&&y.timeRefreshed<h)&&(d.removeItemSync(g),E=!0)}}}E&&u.notifyWaiters()},u.waiters=void 0,u}();r.default=l}));const Np={timeoutInSeconds:60},fh={name:"auth0-spa-js",version:"2.1.3"},dh=()=>Date.now();let Ye=class To extends Error{constructor(r,t){super(t),this.error=r,this.error_description=t,Object.setPrototypeOf(this,To.prototype)}static fromPayload({error:r,error_description:t}){return new To(r,t)}},Dp=class hh extends Ye{constructor(r,t,n,a=null){super(r,t),this.state=n,this.appState=a,Object.setPrototypeOf(this,hh.prototype)}},Oo=class vh extends Ye{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,vh.prototype)}},$p=class ph extends Oo{constructor(r){super(),this.popup=r,Object.setPrototypeOf(this,ph.prototype)}},Mp=class mh extends Ye{constructor(r){super("cancelled","Popup closed"),this.popup=r,Object.setPrototypeOf(this,mh.prototype)}},Fp=class gh extends Ye{constructor(r,t,n){super(r,t),this.mfa_token=n,Object.setPrototypeOf(this,gh.prototype)}},yh=class wh extends Ye{constructor(r,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${If(r,["default"])}', scope: '${If(t)}')`),this.audience=r,this.scope=t,Object.setPrototypeOf(this,wh.prototype)}};function If(e,r=[]){return e&&!r.includes(e)?e:""}const Kt=()=>window.crypto,mo=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let r="";return Array.from(Kt().getRandomValues(new Uint8Array(43))).forEach(t=>r+=e[t%e.length]),r},Pf=e=>btoa(e),ko=e=>{var{clientId:r}=e,t=pr(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:r},t))).toString()},Ef=e=>(r=>decodeURIComponent(atob(r).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Bp=async(e,r)=>{const t=await fetch(e,r);return{ok:t.ok,json:await t.json()}},zp=async(e,r,t)=>{const n=new AbortController;let a;return r.signal=n.signal,Promise.race([Bp(e,r),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},t)})]).finally(()=>{clearTimeout(a)})},Hp=async(e,r,t,n,a,i,o)=>{return s={auth:{audience:r,scope:t},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},c=i,new Promise(function(l,u){const f=new MessageChannel;f.port1.onmessage=function(h){h.data.error?u(new Error(h.data.error)):l(h.data),f.port1.close()},c.postMessage(s,[f.port2])});var s,c},Gp=async(e,r,t,n,a,i,o=1e4)=>a?Hp(e,r,t,n,o,a,i):zp(e,n,o);async function Kp(e,r){var{baseUrl:t,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,c=pr(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const l=s?ko(c):JSON.stringify(c);return await async function(u,f,h,d,v,m,w){let E,b=null;for(let j=0;j<3;j++)try{E=await Gp(u,h,d,v,m,w,f),b=null;break}catch(z){b=z}if(b)throw b;const g=E.json,{error:p,error_description:y}=g,k=pr(g,["error","error_description"]),{ok:A}=E;if(!A){const j=y||`HTTP error. Unable to fetch ${u}`;throw p==="mfa_required"?new Fp(p,j,k.mfa_token):p==="missing_refresh_token"?new yh(h,d):new Ye(p||"request_error",j)}return k}(`${t}/oauth/token`,n,a||"default",i,{method:"POST",body:l,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||fh))}},r,s)}const qt=(...e)=>{return(r=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(r))).join(" ");var r};let Lr=class Co{constructor(r,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=r.clientId,this.scope=r.scope,this.audience=r.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(r){const[t,n,a,i]=r.split("::");return new Co({clientId:n,scope:i,audience:a},t)}static fromCacheEntry(r){const{scope:t,audience:n,client_id:a}=r;return new Co({scope:t,audience:n,clientId:a})}},Wp=class{set(r,t){localStorage.setItem(r,JSON.stringify(t))}get(r){const t=window.localStorage.getItem(r);if(t)try{return JSON.parse(t)}catch{return}}remove(r){localStorage.removeItem(r)}allKeys(){return Object.keys(window.localStorage).filter(r=>r.startsWith("@@auth0spajs@@"))}},bh=class{constructor(){this.enclosedCache=function(){let r={};return{set(t,n){r[t]=n},get(t){const n=r[t];if(n)return n},remove(t){delete r[t]},allKeys:()=>Object.keys(r)}}()}},Vp=class{constructor(r,t,n){this.cache=r,this.keyManifest=t,this.nowProvider=n||dh}async setIdToken(r,t,n){var a;const i=this.getIdTokenCacheKey(r);await this.cache.set(i,{id_token:t,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(r){const t=await this.cache.get(this.getIdTokenCacheKey(r.clientId));if(!t&&r.scope&&r.audience){const n=await this.get(r);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(r,t=0){var n;let a=await this.cache.get(r.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const c=this.matchExistingCacheKey(r,s);c&&(a=await this.cache.get(c))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-t<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(r.toKey(),a),a.body):(await this.cache.remove(r.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(r.toKey()))):a.body}async set(r){var t;const n=new Lr({clientId:r.client_id,scope:r.scope,audience:r.audience}),a=await this.wrapCacheEntry(r);await this.cache.set(n.toKey(),a),await((t=this.keyManifest)===null||t===void 0?void 0:t.add(n.toKey()))}async clear(r){var t;const n=await this.getCacheKeys();n&&(await n.filter(a=>!r||a.includes(r)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((t=this.keyManifest)===null||t===void 0?void 0:t.clear()))}async wrapCacheEntry(r){const t=await this.nowProvider();return{body:r,expiresAt:Math.floor(t/1e3)+r.expires_in}}async getCacheKeys(){var r;return this.keyManifest?(r=await this.keyManifest.get())===null||r===void 0?void 0:r.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(r){return new Lr({clientId:r},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(r,t){return t.filter(n=>{var a;const i=Lr.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=r.scope)===null||a===void 0?void 0:a.split(" "))||[],c=i.scope&&s.reduce((l,u)=>l&&o.has(u),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===r.clientId&&i.audience===r.audience&&c})[0]}},Jp=class{constructor(r,t,n){this.storage=r,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(r){this.storage.save(this.storageKey,r,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const gt=e=>typeof e=="number",Zp=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],Yp=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const r=(i=>{const o=i.split("."),[s,c,l]=o;if(o.length!==3||!s||!c||!l)throw new Error("ID token could not be decoded");const u=JSON.parse(Ef(c)),f={__raw:i},h={};return Object.keys(u).forEach(d=>{f[d]=u[d],Zp.includes(d)||(h[d]=u[d])}),{encoded:{header:s,payload:c,signature:l},header:JSON.parse(Ef(s)),claims:f,user:h}})(e.id_token);if(!r.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(r.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${r.claims.iss}"`);if(!r.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(r.header.alg!=="RS256")throw new Error(`Signature algorithm of "${r.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!r.claims.aud||typeof r.claims.aud!="string"&&!Array.isArray(r.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(r.claims.aud)){if(!r.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${r.claims.aud.join(", ")}"`);if(r.claims.aud.length>1){if(!r.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(r.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${r.claims.azp}"`)}}else if(r.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${r.claims.aud}"`);if(e.nonce){if(!r.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(r.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${r.claims.nonce}"`)}if(e.max_age&&!gt(r.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(r.claims.exp==null||!gt(r.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!gt(r.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const t=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(r.claims.exp+t),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(r.claims.nbf!=null&>(r.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(r.claims.nbf-t),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(r.claims.auth_time!=null&>(r.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(r.claims.auth_time)+e.max_age+t),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!r.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==r.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${r.claims.org_id}"`)}else{const o=i.toLowerCase();if(!r.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==r.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${r.claims.org_name}"`)}}return r};var qr=ss(function(e,r){var t=jr&&jr.__assign||function(){return t=Object.assign||function(c){for(var l,u=1,f=arguments.length;u<f;u++)for(var h in l=arguments[u])Object.prototype.hasOwnProperty.call(l,h)&&(c[h]=l[h]);return c},t.apply(this,arguments)};function n(c,l){if(!l)return"";var u="; "+c;return l===!0?u:u+"="+l}function a(c,l,u){return encodeURIComponent(c).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)}(u)}function i(c){for(var l={},u=c?c.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<u.length;h++){var d=u[h].split("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(c,l,u){document.cookie=a(c,l,t({path:"/"},u))}r.__esModule=!0,r.encode=a,r.parse=i,r.getAll=o,r.get=function(c){return o()[c]},r.set=s,r.remove=function(c,l){s(c,"",t(t({},l),{expires:-1}))}});os(qr),qr.encode,qr.parse,qr.getAll;var Xp=qr.get,Sh=qr.set,Ih=qr.remove;const Jr={get(e){const r=Xp(e);if(r!==void 0)return JSON.parse(r)},save(e,r,t){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),t?.daysUntilExpire&&(n.expires=t.daysUntilExpire),t?.cookieDomain&&(n.domain=t.cookieDomain),Sh(e,JSON.stringify(r),n)},remove(e,r){let t={};r?.cookieDomain&&(t.domain=r.cookieDomain),Ih(e,t)}},Qp={get(e){return Jr.get(e)||Jr.get(`_legacy_${e}`)},save(e,r,t){let n={};window.location.protocol==="https:"&&(n={secure:!0}),t?.daysUntilExpire&&(n.expires=t.daysUntilExpire),t?.cookieDomain&&(n.domain=t.cookieDomain),Sh(`_legacy_${e}`,JSON.stringify(r),n),Jr.save(e,r,t)},remove(e,r){let t={};r?.cookieDomain&&(t.domain=r.cookieDomain),Ih(e,t),Jr.remove(e,r),Jr.remove(`_legacy_${e}`,r)}},em={get(e){if(typeof sessionStorage>"u")return;const r=sessionStorage.getItem(e);return r!=null?JSON.parse(r):void 0},save(e,r){sessionStorage.setItem(e,JSON.stringify(r))},remove(e){sessionStorage.removeItem(e)}};function rm(e,r,t){var n=r===void 0?null:r,a=function(c,l){var u=atob(c);if(l){for(var f=new Uint8Array(u.length),h=0,d=u.length;h<d;++h)f[h]=u.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return u}(e,t!==void 0&&t),i=a.indexOf(`
|
|
2
|
+
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Rf,_f,Tf,go,tm=(Rf="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",_f=null,Tf=!1,function(e){return go=go||rm(Rf,_f,Tf),new Worker(go,e)});const yo={};let nm=class{constructor(r,t){this.cache=r,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(r){var t;const n=new Set(((t=await this.cache.get(this.manifestKey))===null||t===void 0?void 0:t.keys)||[]);n.add(r),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(r){const t=await this.cache.get(this.manifestKey);if(t){const n=new Set(t.keys);return n.delete(r),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(r){return`@@auth0spajs@@::${r}`}};const am={memory:()=>new bh().enclosedCache,localstorage:()=>new Wp},Of=e=>am[e],kf=e=>{const{openUrl:r,onRedirect:t}=e,n=pr(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:r===!1||r?r:t})},wo=new xp;let im=class{constructor(r){let t,n;if(this.userCache=new bh().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await wo.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),r),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),r.authorizationParams)}),typeof window<"u"&&(()=>{if(!Kt())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Kt().subtle===void 0)throw new Error(`
|
|
3
3
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
4
|
-
`)})(),De.cache&&De.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),De.cache)Be=De.cache;else{if(Fe=De.cacheLocation||"memory",!q$2(Fe))throw new Error(`Invalid cache location "${Fe}"`);Be=q$2(Fe)()}this.httpTimeoutMs=De.httpTimeoutInSeconds?1e3*De.httpTimeoutInSeconds:1e4,this.cookieStorage=De.legacySameSiteCookie===!1?X$1:N$2,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(Ge=>`auth0.${Ge}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=De.sessionCheckExpiryDays||1;const He=De.useCookiesForTransactions?this.cookieStorage:J$3;var Ke;this.scope=j$1("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Z$1(He,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||c$4,this.cacheManager=new x$2(Be,Be.allKeys?void 0:new B$1(Be,this.options.clientId),this.nowProvider),this.domainUrl=(Ke=this.options.domain,/^https?:\/\//.test(Ke)?Ke:`https://${Ke}`),this.tokenIssuer=((Ge,We)=>Ge?Ge.startsWith("https://")?Ge:`https://${Ge}/`:`${We}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&Fe==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new M$2)}_url(De){const Fe=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||s$2)));return`${this.domainUrl}${De}&auth0Client=${Fe}`}_authorizeUrl(De){return this._url(`/authorize?${v$1(De)}`)}async _verifyIdToken(De,Fe,Be){const He=await this.nowProvider();return E$2({iss:this.tokenIssuer,aud:this.options.clientId,id_token:De,nonce:Fe,organization:Be,leeway:this.options.leeway,max_age:(Ke=this.options.authorizationParams.max_age,typeof Ke!="string"?Ke:parseInt(Ke,10)||void 0),now:He});var Ke}_processOrgHint(De){De?this.cookieStorage.save(this.orgHintCookieName,De,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(De,Fe,Be){const He=k$2(y$2()),Ke=k$2(y$2()),Ge=y$2(),We=(Je=>{const Ye=new Uint8Array(Je);return(Qe=>{const et={"+":"-","/":"_","=":""};return Qe.replace(/[+/=]/g,tt=>et[tt])})(window.btoa(String.fromCharCode(...Array.from(Ye))))})(await(async Je=>await w$1().subtle.digest({name:"SHA-256"},new TextEncoder().encode(Je)))(Ge)),Ze=((Je,Ye,Qe,et,tt,ct,at,ft)=>Object.assign(Object.assign(Object.assign({client_id:Je.clientId},Je.authorizationParams),Qe),{scope:j$1(Ye,Qe.scope),response_type:"code",response_mode:ft||"query",state:et,nonce:tt,redirect_uri:at||Je.authorizationParams.redirect_uri,code_challenge:ct,code_challenge_method:"S256"}))(this.options,this.scope,De,He,Ke,We,De.redirect_uri||this.options.authorizationParams.redirect_uri||Be,Fe==null?void 0:Fe.response_mode),Xe=this._authorizeUrl(Ze);return{nonce:Ke,code_verifier:Ge,scope:Ze.scope,audience:Ze.audience||"default",redirect_uri:Ze.redirect_uri,state:He,url:Xe}}async loginWithPopup(De,Fe){var Be;if(De=De||{},!(Fe=Fe||{}).popup&&(Fe.popup=(We=>{const Ze=window.screenX+(window.innerWidth-400)/2,Xe=window.screenY+(window.innerHeight-600)/2;return window.open(We,"auth0:authorize:popup",`left=${Ze},top=${Xe},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!Fe.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const He=await this._prepareAuthorizeUrl(De.authorizationParams||{},{response_mode:"web_message"},window.location.origin);Fe.popup.location.href=He.url;const Ke=await(We=>new Promise((Ze,Xe)=>{let Je;const Ye=setInterval(()=>{We.popup&&We.popup.closed&&(clearInterval(Ye),clearTimeout(Qe),window.removeEventListener("message",Je,!1),Xe(new p$1(We.popup)))},1e3),Qe=setTimeout(()=>{clearInterval(Ye),Xe(new h$1(We.popup)),window.removeEventListener("message",Je,!1)},1e3*(We.timeoutInSeconds||60));Je=function(et){if(et.data&&et.data.type==="authorization_response"){if(clearTimeout(Qe),clearInterval(Ye),window.removeEventListener("message",Je,!1),We.popup.close(),et.data.response.error)return Xe(d$2.fromPayload(et.data.response));Ze(et.data.response)}},window.addEventListener("message",Je)}))(Object.assign(Object.assign({},Fe),{timeoutInSeconds:Fe.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(He.state!==Ke.state)throw new d$2("state_mismatch","Invalid state");const Ge=((Be=De.authorizationParams)===null||Be===void 0?void 0:Be.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:He.audience,scope:He.scope,code_verifier:He.code_verifier,grant_type:"authorization_code",code:Ke.code,redirect_uri:He.redirect_uri},{nonceIn:He.nonce,organization:Ge})}async getUser(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.user}async getIdTokenClaims(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.claims}async loginWithRedirect(De={}){var Fe;const Be=Q$2(De),{openUrl:He,fragment:Ke,appState:Ge}=Be,We=e$1(Be,["openUrl","fragment","appState"]),Ze=((Fe=We.authorizationParams)===null||Fe===void 0?void 0:Fe.organization)||this.options.authorizationParams.organization,Xe=await this._prepareAuthorizeUrl(We.authorizationParams||{}),{url:Je}=Xe,Ye=e$1(Xe,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},Ye),{appState:Ge}),Ze&&{organization:Ze}));const Qe=Ke?`${Je}#${Ke}`:Je;He?await He(Qe):window.location.assign(Qe)}async handleRedirectCallback(De=window.location.href){const Fe=De.split("?").slice(1);if(Fe.length===0)throw new Error("There are no query params available for parsing.");const{state:Be,code:He,error:Ke,error_description:Ge}=(Ye=>{Ye.indexOf("#")>-1&&(Ye=Ye.substring(0,Ye.indexOf("#")));const Qe=new URLSearchParams(Ye);return{state:Qe.get("state"),code:Qe.get("code")||void 0,error:Qe.get("error")||void 0,error_description:Qe.get("error_description")||void 0}})(Fe.join("")),We=this.transactionManager.get();if(!We)throw new d$2("missing_transaction","Invalid state");if(this.transactionManager.remove(),Ke)throw new u$4(Ke,Ge||Ke,Be,We.appState);if(!We.code_verifier||We.state&&We.state!==Be)throw new d$2("state_mismatch","Invalid state");const Ze=We.organization,Xe=We.nonce,Je=We.redirect_uri;return await this._requestToken(Object.assign({audience:We.audience,scope:We.scope,code_verifier:We.code_verifier,grant_type:"authorization_code",code:He},Je?{redirect_uri:Je}:{}),{nonceIn:Xe,organization:Ze}),{appState:We.appState}}async checkSession(De){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(De)}catch{}}async getTokenSilently(De={}){var Fe;const Be=Object.assign(Object.assign({cacheMode:"on"},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Fe=De.authorizationParams)===null||Fe===void 0?void 0:Fe.scope)})}),He=await((Ke,Ge)=>{let We=A$2[Ge];return We||(We=Ke().finally(()=>{delete A$2[Ge],We=null}),A$2[Ge]=We),We})(()=>this._getTokenSilently(Be),`${this.options.clientId}::${Be.authorizationParams.audience}::${Be.authorizationParams.scope}`);return De.detailedResponse?He:He==null?void 0:He.access_token}async _getTokenSilently(De){const{cacheMode:Fe}=De,Be=e$1(De,["cacheMode"]);if(Fe!=="off"){const He=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(He)return He}if(Fe!=="cache-only"){if(!await(async(He,Ke=3)=>{for(let Ge=0;Ge<Ke;Ge++)if(await He())return!0;return!1})(()=>ee$1.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new l$3;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),Fe!=="off"){const Xe=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(Xe)return Xe}const He=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(Be):await this._getTokenFromIFrame(Be),{id_token:Ke,access_token:Ge,oauthTokenScope:We,expires_in:Ze}=He;return Object.assign(Object.assign({id_token:Ke,access_token:Ge},We?{scope:We}:null),{expires_in:Ze})}finally{await ee$1.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(De={},Fe={}){var Be;const He=Object.assign(Object.assign({},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Be=De.authorizationParams)===null||Be===void 0?void 0:Be.scope)})});return Fe=Object.assign(Object.assign({},r$3),Fe),await this.loginWithPopup(He,Fe),(await this.cacheManager.get(new C$2({scope:He.authorizationParams.scope,audience:He.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(De){De.clientId!==null?De.clientId=De.clientId||this.options.clientId:delete De.clientId;const Fe=De.logoutParams||{},{federated:Be}=Fe,He=e$1(Fe,["federated"]),Ke=Be?"&federated":"";return this._url(`/v2/logout?${v$1(Object.assign({clientId:De.clientId},He))}`)+Ke}async logout(De={}){const Fe=Q$2(De),{openUrl:Be}=Fe,He=e$1(Fe,["openUrl"]);De.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(De.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const Ke=this._buildLogoutUrl(He);Be?await Be(Ke):Be!==!1&&window.location.assign(Ke)}async _getTokenFromIFrame(De){const Fe=Object.assign(Object.assign({},De.authorizationParams),{prompt:"none"}),Be=this.cookieStorage.get(this.orgHintCookieName);Be&&!Fe.organization&&(Fe.organization=Be);const{url:He,state:Ke,nonce:Ge,code_verifier:We,redirect_uri:Ze,scope:Xe,audience:Je}=await this._prepareAuthorizeUrl(Fe,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new d$2("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const Ye=De.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,Qe=await((tt,ct,at=60)=>new Promise((ft,ut)=>{const it=window.document.createElement("iframe");it.setAttribute("width","0"),it.setAttribute("height","0"),it.style.display="none";const rt=()=>{window.document.body.contains(it)&&(window.document.body.removeChild(it),window.removeEventListener("message",lt,!1))};let lt;const pt=setTimeout(()=>{ut(new l$3),rt()},1e3*at);lt=function(gt){if(gt.origin!=ct||!gt.data||gt.data.type!=="authorization_response")return;const vt=gt.source;vt&&vt.close(),gt.data.response.error?ut(d$2.fromPayload(gt.data.response)):ft(gt.data.response),clearTimeout(pt),window.removeEventListener("message",lt,!1),setTimeout(rt,2e3)},window.addEventListener("message",lt,!1),window.document.body.appendChild(it),it.setAttribute("src",tt)}))(He,this.domainUrl,Ye);if(Ke!==Qe.state)throw new d$2("state_mismatch","Invalid state");const et=await this._requestToken(Object.assign(Object.assign({},De.authorizationParams),{code_verifier:We,code:Qe.code,grant_type:"authorization_code",redirect_uri:Ze,timeout:De.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:Ge,organization:Fe.organization});return Object.assign(Object.assign({},et),{scope:Xe,oauthTokenScope:et.scope,audience:Je})}catch(Ye){throw Ye.error==="login_required"&&this.logout({openUrl:!1}),Ye}}async _getTokenUsingRefreshToken(De){const Fe=await this.cacheManager.get(new C$2({scope:De.authorizationParams.scope,audience:De.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(Fe&&Fe.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw new f$2(De.authorizationParams.audience||"default",De.authorizationParams.scope)}const Be=De.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,He=typeof De.timeoutInSeconds=="number"?1e3*De.timeoutInSeconds:null;try{const Ke=await this._requestToken(Object.assign(Object.assign(Object.assign({},De.authorizationParams),{grant_type:"refresh_token",refresh_token:Fe&&Fe.refresh_token,redirect_uri:Be}),He&&{timeout:He}));return Object.assign(Object.assign({},Ke),{scope:De.authorizationParams.scope,oauthTokenScope:Ke.scope,audience:De.authorizationParams.audience||"default"})}catch(Ke){if((Ke.message.indexOf("Missing Refresh Token")>-1||Ke.message&&Ke.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw Ke}}async _saveEntryInCache(De){const{id_token:Fe,decodedToken:Be}=De,He=e$1(De,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:Fe,decodedToken:Be}),await this.cacheManager.setIdToken(this.options.clientId,De.id_token,De.decodedToken),await this.cacheManager.set(He)}async _getIdTokenFromCache(){const De=this.options.authorizationParams.audience||"default",Fe=await this.cacheManager.getIdToken(new C$2({clientId:this.options.clientId,audience:De,scope:this.scope})),Be=this.userCache.get("@@user@@");return Fe&&Fe.id_token===(Be==null?void 0:Be.id_token)?Be:(this.userCache.set("@@user@@",Fe),Fe)}async _getEntryFromCache({scope:De,audience:Fe,clientId:Be}){const He=await this.cacheManager.get(new C$2({scope:De,audience:Fe,clientId:Be}),60);if(He&&He.access_token){const{access_token:Ke,oauthTokenScope:Ge,expires_in:We}=He,Ze=await this._getIdTokenFromCache();return Ze&&Object.assign(Object.assign({id_token:Ze.id_token,access_token:Ke},Ge?{scope:Ge}:null),{expires_in:We})}}async _requestToken(De,Fe){const{nonceIn:Be,organization:He}=Fe||{},Ke=await T$1(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},De),this.worker),Ge=await this._verifyIdToken(Ke.id_token,Be,He);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},Ke),{decodedToken:Ge,scope:De.scope,audience:De.audience||"default"}),Ke.scope?{oauthTokenScope:Ke.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(He||Ge.claims.org_id),Object.assign(Object.assign({},Ke),{decodedToken:Ge})}};async function oe$1($e){const De=new te$1($e);return await De.checkSession(),De}var Events=($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))(Events||{});const BASE_URL_DOMAIN="sesamy.com",DEV_BASE_URL_DOMAIN="sesamy.dev",SHORTLINK_URL="https://sesa.my",CACHE_TIMESTAMP_KEY="sesamyCacheTimestamp",SESMAY_CONTENT_RELOADED_KEY="sesamyContentReloaded";function getBaseDomain($e,De){return`${$e}.${De==="dev"?DEV_BASE_URL_DOMAIN:BASE_URL_DOMAIN}`}function getBaseUrl($e,De){return`https://${getBaseDomain($e,De)}`}function getLanguage(){var Fe;return(Fe=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0])==null?void 0:Fe.toLocaleLowerCase()}/*!
|
|
4
|
+
`)})(),r.cache&&r.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),r.cache)n=r.cache;else{if(t=r.cacheLocation||"memory",!Of(t))throw new Error(`Invalid cache location "${t}"`);n=Of(t)()}this.httpTimeoutMs=r.httpTimeoutInSeconds?1e3*r.httpTimeoutInSeconds:1e4,this.cookieStorage=r.legacySameSiteCookie===!1?Jr:Qp,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=r.sessionCheckExpiryDays||1;const a=r.useCookiesForTransactions?this.cookieStorage:em;var i;this.scope=qt("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Jp(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||dh,this.cacheManager=new Vp(n,n.allKeys?void 0:new nm(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&t==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new tm)}_url(r){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||fh)));return`${this.domainUrl}${r}&auth0Client=${t}`}_authorizeUrl(r){return this._url(`/authorize?${ko(r)}`)}async _verifyIdToken(r,t,n){const a=await this.nowProvider();return Yp({iss:this.tokenIssuer,aud:this.options.clientId,id_token:r,nonce:t,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(r){r?this.cookieStorage.save(this.orgHintCookieName,r,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(r,t,n){const a=Pf(mo()),i=Pf(mo()),o=mo(),s=(u=>{const f=new Uint8Array(u);return(h=>{const d={"+":"-","/":"_","=":""};return h.replace(/[+/=]/g,v=>d[v])})(window.btoa(String.fromCharCode(...Array.from(f))))})(await(async u=>await Kt().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(o)),c=((u,f,h,d,v,m,w,E)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),h),{scope:qt(f,h.scope),response_type:"code",response_mode:E||"query",state:d,nonce:v,redirect_uri:w||u.authorizationParams.redirect_uri,code_challenge:m,code_challenge_method:"S256"}))(this.options,this.scope,r,a,i,s,r.redirect_uri||this.options.authorizationParams.redirect_uri||n,t?.response_mode),l=this._authorizeUrl(c);return{nonce:i,code_verifier:o,scope:c.scope,audience:c.audience||"default",redirect_uri:c.redirect_uri,state:a,url:l}}async loginWithPopup(r,t){var n;if(r=r||{},!(t=t||{}).popup&&(t.popup=(s=>{const c=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${c},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(r.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=a.url;const i=await(s=>new Promise((c,l)=>{let u;const f=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",u,!1),l(new Mp(s.popup)))},1e3),h=setTimeout(()=>{clearInterval(f),l(new $p(s.popup)),window.removeEventListener("message",u,!1)},1e3*(s.timeoutInSeconds||60));u=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",u,!1),s.popup.close(),d.data.response.error)return l(Ye.fromPayload(d.data.response));c(d.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ye("state_mismatch","Invalid state");const o=((n=r.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var r;const t=await this._getIdTokenFromCache();return(r=t?.decodedToken)===null||r===void 0?void 0:r.user}async getIdTokenClaims(){var r;const t=await this._getIdTokenFromCache();return(r=t?.decodedToken)===null||r===void 0?void 0:r.claims}async loginWithRedirect(r={}){var t;const n=kf(r),{openUrl:a,fragment:i,appState:o}=n,s=pr(n,["openUrl","fragment","appState"]),c=((t=s.authorizationParams)===null||t===void 0?void 0:t.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=l,f=pr(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o}),c&&{organization:c}));const h=i?`${u}#${i}`:u;a?await a(h):window.location.assign(h)}async handleRedirectCallback(r=window.location.href){const t=r.split("?").slice(1);if(t.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(f=>{f.indexOf("#")>-1&&(f=f.substring(0,f.indexOf("#")));const h=new URLSearchParams(f);return{state:h.get("state"),code:h.get("code")||void 0,error:h.get("error")||void 0,error_description:h.get("error_description")||void 0}})(t.join("")),s=this.transactionManager.get();if(!s)throw new Ye("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new Dp(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new Ye("state_mismatch","Invalid state");const c=s.organization,l=s.nonce,u=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},u?{redirect_uri:u}:{}),{nonceIn:l,organization:c}),{appState:s.appState}}async checkSession(r){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(r)}catch{}}async getTokenSilently(r={}){var t;const n=Object.assign(Object.assign({cacheMode:"on"},r),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),r.authorizationParams),{scope:qt(this.scope,(t=r.authorizationParams)===null||t===void 0?void 0:t.scope)})}),a=await((i,o)=>{let s=yo[o];return s||(s=i().finally(()=>{delete yo[o],s=null}),yo[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return r.detailedResponse?a:a?.access_token}async _getTokenSilently(r){const{cacheMode:t}=r,n=pr(r,["cacheMode"]);if(t!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(t!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>wo.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Oo;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),t!=="off"){const l=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(l)return l}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:c}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:c})}finally{await wo.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(r={},t={}){var n;const a=Object.assign(Object.assign({},r),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),r.authorizationParams),{scope:qt(this.scope,(n=r.authorizationParams)===null||n===void 0?void 0:n.scope)})});return t=Object.assign(Object.assign({},Np),t),await this.loginWithPopup(a,t),(await this.cacheManager.get(new Lr({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(r){r.clientId!==null?r.clientId=r.clientId||this.options.clientId:delete r.clientId;const t=r.logoutParams||{},{federated:n}=t,a=pr(t,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ko(Object.assign({clientId:r.clientId},a))}`)+i}async logout(r={}){const t=kf(r),{openUrl:n}=t,a=pr(t,["openUrl"]);r.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(r.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(r){const t=Object.assign(Object.assign({},r.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:c,scope:l,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ye("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,h=await((v,m,w=60)=>new Promise((E,b)=>{const g=window.document.createElement("iframe");g.setAttribute("width","0"),g.setAttribute("height","0"),g.style.display="none";const p=()=>{window.document.body.contains(g)&&(window.document.body.removeChild(g),window.removeEventListener("message",y,!1))};let y;const k=setTimeout(()=>{b(new Oo),p()},1e3*w);y=function(A){if(A.origin!=m||!A.data||A.data.type!=="authorization_response")return;const j=A.source;j&&j.close(),A.data.response.error?b(Ye.fromPayload(A.data.response)):E(A.data.response),clearTimeout(k),window.removeEventListener("message",y,!1),setTimeout(p,2e3)},window.addEventListener("message",y,!1),window.document.body.appendChild(g),g.setAttribute("src",v)}))(a,this.domainUrl,f);if(i!==h.state)throw new Ye("state_mismatch","Invalid state");const d=await this._requestToken(Object.assign(Object.assign({},r.authorizationParams),{code_verifier:s,code:h.code,grant_type:"authorization_code",redirect_uri:c,timeout:r.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:t.organization});return Object.assign(Object.assign({},d),{scope:l,oauthTokenScope:d.scope,audience:u})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(r){const t=await this.cacheManager.get(new Lr({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(r);throw new yh(r.authorizationParams.audience||"default",r.authorizationParams.scope)}const n=r.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof r.timeoutInSeconds=="number"?1e3*r.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},r.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:r.authorizationParams.scope,oauthTokenScope:i.scope,audience:r.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(r);throw i}}async _saveEntryInCache(r){const{id_token:t,decodedToken:n}=r,a=pr(r,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,r.id_token,r.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const r=this.options.authorizationParams.audience||"default",t=await this.cacheManager.getIdToken(new Lr({clientId:this.options.clientId,audience:r,scope:this.scope})),n=this.userCache.get("@@user@@");return t&&t.id_token===n?.id_token?n:(this.userCache.set("@@user@@",t),t)}async _getEntryFromCache({scope:r,audience:t,clientId:n}){const a=await this.cacheManager.get(new Lr({scope:r,audience:t,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(r,t){const{nonceIn:n,organization:a}=t||{},i=await Kp(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},r),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:r.scope,audience:r.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function om(e){const r=new im(e);return await r.checkSession(),r}var We=(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))(We||{});const sm="sesamy.com",um="sesamy.dev",cm="https://sesa.my",Ao="sesamyCacheTimestamp",Cf="sesamyContentReloaded";function Ph(e,r){return`${e}.${r==="dev"?um:sm}`}function vr(e,r){return`https://${Ph(e,r)}`}function Yt(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLocaleLowerCase()}/*!
|
|
5
5
|
*
|
|
6
|
-
* detectIncognito v1.
|
|
6
|
+
* detectIncognito v1.5.0
|
|
7
7
|
*
|
|
8
8
|
* https://github.com/Joe12387/detectIncognito
|
|
9
9
|
*
|
|
10
10
|
* MIT License
|
|
11
11
|
*
|
|
12
|
-
* Copyright (c) 2021 -
|
|
12
|
+
* Copyright (c) 2021 - 2025 Joe Rutkowski <Joe@dreggle.com>
|
|
13
13
|
*
|
|
14
14
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
15
|
* of this software and associated documentation files (the "Software"), to deal
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Please keep this comment intact in order to properly abide by the MIT License.
|
|
33
33
|
*
|
|
34
|
-
**/var __webpack_require__={d:($e,De)=>{for(var Fe in De)__webpack_require__.o(De,Fe)&&!__webpack_require__.o($e,Fe)&&Object.defineProperty($e,Fe,{enumerable:!0,get:De[Fe]})},o:($e,De)=>Object.prototype.hasOwnProperty.call($e,De)},__webpack_exports__={};__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__,k:()=>detectIncognito});var __awaiter=function($e,De,Fe,Be){return new(Fe||(Fe=Promise))(function(He,Ke){function Ge(Xe){try{Ze(Be.next(Xe))}catch(Je){Ke(Je)}}function We(Xe){try{Ze(Be.throw(Xe))}catch(Je){Ke(Je)}}function Ze(Xe){var Je;Xe.done?He(Xe.value):(Je=Xe.value,Je instanceof Fe?Je:new Fe(function(Ye){Ye(Je)})).then(Ge,We)}Ze((Be=Be.apply($e,[])).next())})},__generator=function($e,De){var Fe,Be,He,Ke,Ge={label:0,sent:function(){if(1&He[0])throw He[1];return He[1]},trys:[],ops:[]};return Ke={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(Ke[Symbol.iterator]=function(){return this}),Ke;function We(Ze){return function(Xe){return function(Je){if(Fe)throw new TypeError("Generator is already executing.");for(;Ke&&(Ke=0,Je[0]&&(Ge=0)),Ge;)try{if(Fe=1,Be&&(He=2&Je[0]?Be.return:Je[0]?Be.throw||((He=Be.return)&&He.call(Be),0):Be.next)&&!(He=He.call(Be,Je[1])).done)return He;switch(Be=0,He&&(Je=[2&Je[0],He.value]),Je[0]){case 0:case 1:He=Je;break;case 4:return Ge.label++,{value:Je[1],done:!1};case 5:Ge.label++,Be=Je[1],Je=[0];continue;case 7:Je=Ge.ops.pop(),Ge.trys.pop();continue;default:if(He=Ge.trys,!((He=He.length>0&&He[He.length-1])||Je[0]!==6&&Je[0]!==2)){Ge=0;continue}if(Je[0]===3&&(!He||Je[1]>He[0]&&Je[1]<He[3])){Ge.label=Je[1];break}if(Je[0]===6&&Ge.label<He[1]){Ge.label=He[1],He=Je;break}if(He&&Ge.label<He[2]){Ge.label=He[2],Ge.ops.push(Je);break}He[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Je=De.call($e,Ge)}catch(Ye){Je=[6,Ye],Be=0}finally{Fe=He=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([Ze,Xe])}}};function detectIncognito(){return __awaiter(this,void 0,Promise,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback($e){resolve({isPrivate:$e,browserName})}function identifyChromium(){var $e=navigator.userAgent;return $e.match(/Chrome/)?navigator.brave!==void 0?"Brave":$e.match(/Edg/)?"Edge":$e.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString($e){return $e===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch($e){toFixedEngineID=$e.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var $e=String(Math.random());try{window.indexedDB.open($e,1).onupgradeneeded=function(De){var Fe,Be,He=(Fe=De.target)===null||Fe===void 0?void 0:Fe.result;try{He.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(Ge){var Ke=Ge;return Ge instanceof Error&&(Ke=(Be=Ge.message)!==null&&Be!==void 0?Be:Ge),typeof Ke!="string"?void __callback(!1):void __callback(Ke.includes("BlobURLs are not yet supported"))}finally{He.close(),window.indexedDB.deleteDatabase($e)}}}catch{__callback(!1)}}function oldSafariTest(){var $e=window.openDatabase,De=window.localStorage;try{$e(null,null,null,null)}catch{return void __callback(!0)}try{De.setItem("test","1"),De.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var $e=window;return $e.performance!==void 0&&$e.performance.memory!==void 0&&$e.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function($e,De){__callback(Math.round(De/1048576)<2*Math.round(getQuotaLimit()/1048576))},function($e){reject(new Error("detectIncognito somehow failed to query storage quota: "+$e.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=detectIncognito);const __WEBPACK_DEFAULT_EXPORT__=detectIncognito;__webpack_exports__.A;var __webpack_exports__detectIncognito=__webpack_exports__.k;const INCOGNITO_SESSION_KEY="sesamy_incognito_mode";function isIncognito(){try{const $e=sessionStorage.getItem(INCOGNITO_SESSION_KEY);return $e===null?void 0:$e==="true"}catch{return}}async function detectAndCacheIncognito(){try{const $e=sessionStorage.getItem(INCOGNITO_SESSION_KEY);if($e!==null)return $e==="true";const{isPrivate:De}=await __webpack_exports__detectIncognito();return sessionStorage.setItem(INCOGNITO_SESSION_KEY,De.toString()),De}catch{try{sessionStorage.setItem(INCOGNITO_SESSION_KEY,"false")}catch{}return!1}}function isBrowser(){return typeof window<"u"}function i$5($e,De,Fe,Be,He){for(De=De.split?De.split("."):De,Be=0;Be<De.length;Be++)$e=$e?$e[De[Be]]:He;return $e===He?Fe:$e}var e="undefined",o$4="object",g$1=function(){},b$4="any",m$1="*",j="__",F$2=typeof process<"u"?process:{};F$2.env&&F$2.env.NODE_ENV;var $$1=typeof document<"u";F$2.versions!=null&&F$2.versions.node!=null;typeof Deno<"u"&&Deno.core;$$1&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function M$1($e,De){return De.charAt(0)[$e]()+De.slice(1)}var U$1=M$1.bind(null,"toUpperCase"),H$1=M$1.bind(null,"toLowerCase");function J$2($e){return Y$1($e)?U$1("null"):typeof $e=="object"?yn($e):Object.prototype.toString.call($e).slice(8,-1)}function R$1($e,De){De===void 0&&(De=!0);var Fe=J$2($e);return De?H$1(Fe):Fe}function V$1($e,De){return typeof De===$e}var W$1=V$1.bind(null,"function"),q$1=V$1.bind(null,"string"),I$2=V$1.bind(null,"undefined"),Q$1=V$1.bind(null,"boolean");V$1.bind(null,"symbol");function Y$1($e){return $e===null}function nn($e){return R$1($e)==="number"&&!isNaN($e)}function rn($e){return R$1($e)==="array"}function on($e){if(!un($e))return!1;for(var De=$e;Object.getPrototypeOf(De)!==null;)De=Object.getPrototypeOf(De);return Object.getPrototypeOf($e)===De}function un($e){return $e&&(typeof $e=="object"||$e!==null)}function yn($e){return W$1($e.constructor)?$e.constructor.name:null}function hn($e){return $e instanceof Error||q$1($e.message)&&$e.constructor&&nn($e.constructor.stackTraceLimit)}function On($e,De){if(typeof De!="object"||Y$1(De))return!1;if(De instanceof $e)return!0;var Fe=R$1(new $e(""));if(hn(De))for(;De;){if(R$1(De)===Fe)return!0;De=Object.getPrototypeOf(De)}return!1}On.bind(null,TypeError);On.bind(null,SyntaxError);function $n($e,De){var Fe=$e instanceof Element||$e instanceof HTMLDocument;return Fe&&De?Tn($e,De):Fe}function Tn($e,De){return De===void 0&&(De=""),$e&&$e.nodeName===De.toUpperCase()}function _n($e){var De=[].slice.call(arguments,1);return function(){return $e.apply(void 0,[].slice.call(arguments).concat(De))}}_n($n,"form");_n($n,"button");_n($n,"input");_n($n,"select");function Hn($e){return $e?rn($e)?$e:[$e]:[]}function n$1($e){try{return decodeURIComponent($e.replace(/\+/g," "))}catch{return null}}function o$3(){if($$1){var $e=navigator,De=$e.languages;return $e.userLanguage||(De&&De.length?De[0]:$e.language)}}function a$5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function s$1($e){return function(De){for(var Fe,Be=Object.create(null),He=/([^&=]+)=?([^&]*)/g;Fe=He.exec(De);){var Ke=n$1(Fe[1]),Ge=n$1(Fe[2]);Ke.substring(Ke.length-2)==="[]"?(Be[Ke=Ke.substring(0,Ke.length-2)]||(Be[Ke]=[])).push(Ge):Be[Ke]=Ge===""||Ge}for(var We in Be){var Ze=We.split("[");Ze.length>1&&(m(Be,Ze.map(function(Xe){return Xe.replace(/[?[\]\\ ]/g,"")}),Be[We]),delete Be[We])}return Be}(function(De){return $$1&&window.location.search.substring(1)}())}function m($e,De,Fe){for(var Be=De.length-1,He=0;He<Be;++He){var Ke=De[He];if(Ke==="__proto__"||Ke==="constructor")break;Ke in $e||($e[Ke]={}),$e=$e[Ke]}$e[De[Be]]=Fe}function y$1(){for(var $e="",De=0,Fe=4294967295*Math.random()|0;De++<36;){var Be="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[De-1],He=15&Fe;$e+=Be=="-"||Be=="4"?Be:(Be=="x"?He:3&He|8).toString(16),Fe=De%8==0?4294967295*Math.random()|0:Fe>>4}return $e}function b$3($e,De){var Fe,Be,He,Ke=null,Ge=0,We=function(){Ge=new Date,Ke=null,He=$e.apply(Fe,Be)};return function(){var Ze=new Date;Ge||(Ge=Ze);var Xe=De-(Ze-Ge);return Fe=this,Be=arguments,Xe<=0?(clearTimeout(Ke),Ke=null,Ge=Ze,He=$e.apply(Fe,Be)):Ke||(Ke=setTimeout(We,Xe)),He}}var l$2="global",o$2=j+"global"+j,n=typeof self===o$4&&self.self===self&&self||typeof global===o$4&&global.global===global&&global||void 0;function a$4($e){return n[o$2][$e]}function f$1($e,De){return n[o$2][$e]=De}function i$4($e){delete n[o$2][$e]}function u$3($e,De,Fe){var Be;try{if(b$2($e)){var He=window[$e];Be=He[De].bind(He)}}catch{}return Be||Fe}n[o$2]||(n[o$2]={});var c$3={};function b$2($e){if(typeof c$3[$e]!==e)return c$3[$e];try{var De=window[$e];De.setItem(e,e),De.removeItem(e)}catch{return c$3[$e]=!1}return c$3[$e]=!0}function v(){return v=Object.assign||function($e){for(var De=1;De<arguments.length;De++){var Fe=arguments[De];for(var Be in Fe)Object.prototype.hasOwnProperty.call(Fe,Be)&&($e[Be]=Fe[Be])}return $e},v.apply(this,arguments)}var y="function",b$1="undefined",I$1="@@redux/"+Math.random().toString(36),w=function(){return typeof Symbol===y&&Symbol.observable||"@@observable"}(),E$1=" != "+y;function P($e,De,Fe){var Be;if(typeof De===y&&typeof Fe===b$1&&(Fe=De,De=void 0),typeof Fe!==b$1){if(typeof Fe!==y)throw new Error("enhancer"+E$1);return Fe(P)($e,De)}if(typeof $e!==y)throw new Error("reducer"+E$1);var He=$e,Ke=De,Ge=[],We=Ge,Ze=!1;function Xe(){We===Ge&&(We=Ge.slice())}function Je(){return Ke}function Ye(et){if(typeof et!==y)throw new Error("Listener"+E$1);var tt=!0;return Xe(),We.push(et),function(){if(tt){tt=!1,Xe();var ct=We.indexOf(et);We.splice(ct,1)}}}function Qe(et){if(!on(et))throw new Error("Act != obj");if(typeof et.type===b$1)throw new Error("ActType "+b$1);if(Ze)throw new Error("Dispatch in reducer");try{Ze=!0,Ke=He(Ke,et)}finally{Ze=!1}for(var tt=Ge=We,ct=0;ct<tt.length;ct++)(0,tt[ct])();return et}return Qe({type:"@@redux/INIT"}),(Be={dispatch:Qe,subscribe:Ye,getState:Je,replaceReducer:function(et){if(typeof et!==y)throw new Error("next reducer"+E$1);He=et,Qe({type:"@@redux/INIT"})}})[w]=function(){var et,tt=Ye;return(et={subscribe:function(ct){if(typeof ct!="object")throw new TypeError("Observer != obj");function at(){ct.next&&ct.next(Je())}return at(),{unsubscribe:tt(at)}}})[w]=function(){return this},et},Be}function S($e,De){var Fe=De&&De.type;return"action "+(Fe&&Fe.toString()||"?")+"reducer "+$e+" returns "+b$1}function N$1(){var $e=[].slice.call(arguments);return $e.length===0?function(De){return De}:$e.length===1?$e[0]:$e.reduce(function(De,Fe){return function(){return De(Fe.apply(void 0,[].slice.call(arguments)))}})}function O$1(){var $e=arguments;return function(De){return function(Fe,Be,He){var Ke,Ge=De(Fe,Be,He),We=Ge.dispatch,Ze={getState:Ge.getState,dispatch:function(Xe){return We(Xe)}};return Ke=[].slice.call($e).map(function(Xe){return Xe(Ze)}),v({},Ge,{dispatch:We=N$1.apply(void 0,Ke)(Ge.dispatch)})}}}var A$1=j+"anon_id",_=j+"user_id",x$1=j+"user_traits",k$1="userId",T="anonymousId",z=["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"],M=["name","EVENTS","config","loaded"],q=z.reduce(function($e,De){return $e[De]=De,$e},{registerPluginType:function($e){return"registerPlugin:"+$e},pluginReadyType:function($e){return"ready:"+$e}}),U=/^utm_/,V=/^an_prop_/,L$1=/^an_trait_/;function C$1($e){var De=$e.storage.setItem;return function(Fe){return function(Be){return function(He){if(He.type===q.bootstrap){var Ke=He.params,Ge=He.user,We=He.persistedUser,Ze=He.initialUser,Xe=We.userId===Ge.userId;We.anonymousId!==Ge.anonymousId&&De(A$1,Ge.anonymousId),Xe||De(_,Ge.userId),Ze.traits&&De(x$1,v({},Xe&&We.traits?We.traits:{},Ze.traits));var Je=Object.keys(He.params);if(Je.length){var Ye=Ke.an_uid,Qe=Ke.an_event,et=Je.reduce(function(tt,ct){if(ct.match(U)||ct.match(/^(d|g)clid/)){var at=ct.replace(U,"");tt.campaign[at==="campaign"?"name":at]=Ke[ct]}return ct.match(V)&&(tt.props[ct.replace(V,"")]=Ke[ct]),ct.match(L$1)&&(tt.traits[ct.replace(L$1,"")]=Ke[ct]),tt},{campaign:{},props:{},traits:{}});Fe.dispatch(v({type:q.params,raw:Ke},et,Ye?{userId:Ye}:{})),Ye&&setTimeout(function(){return $e.identify(Ye,et.traits)},0),Qe&&setTimeout(function(){return $e.track(Qe,et.props)},0),Object.keys(et.campaign).length&&Fe.dispatch({type:q.campaign,campaign:et.campaign})}}return Be(He)}}}}function R($e){return function(De,Fe){if(De===void 0&&(De={}),Fe===void 0&&(Fe={}),Fe.type===q.setItemEnd){if(Fe.key===A$1)return v({},De,{anonymousId:Fe.value});if(Fe.key===_)return v({},De,{userId:Fe.value})}switch(Fe.type){case q.identify:return Object.assign({},De,{userId:Fe.userId,traits:v({},De.traits,Fe.traits)});case q.reset:return[_,A$1,x$1].forEach(function(Be){$e.removeItem(Be)}),Object.assign({},De,{userId:null,anonymousId:null,traits:{}});default:return De}}}function $($e){return{userId:$e.getItem(_),anonymousId:$e.getItem(A$1),traits:$e.getItem(x$1)}}var D=function($e){return j+"TEMP"+j+$e};function B($e){var De=$e.storage,Fe=De.setItem,Be=De.removeItem,He=De.getItem;return function(Ke){return function(Ge){return function(We){var Ze=We.userId,Xe=We.traits,Je=We.options;if(We.type===q.reset&&([_,x$1,A$1].forEach(function(et){Be(et)}),[k$1,T,"traits"].forEach(function(et){i$4(D(et))})),We.type===q.identify){He(A$1)||Fe(A$1,y$1());var Ye=He(_),Qe=He(x$1)||{};Ye&&Ye!==Ze&&Ke.dispatch({type:q.userIdChanged,old:{userId:Ye,traits:Qe},new:{userId:Ze,traits:Xe},options:Je}),Ze&&Fe(_,Ze),Xe&&Fe(x$1,v({},Qe,Xe))}return Ge(We)}}}}var X={};function J$1($e,De){X[$e]&&W$1(X[$e])&&(X[$e](De),delete X[$e])}function W($e,De,Fe){return new Promise(function(Be,He){return De()?Be($e):Fe<1?He(v({},$e,{queue:!0})):new Promise(function(Ke){return setTimeout(Ke,10)}).then(function(Ke){return W($e,De,Fe-10).then(Be,He)})})}function H($e){return{abort:$e}}function F$1($e,De,Fe){var Be={},He=De(),Ke=$e.getState(),Ge=Ke.plugins,We=Ke.queue,Ze=Ke.user;if(!Ke.context.offline&&We&&We.actions&&We.actions.length){var Xe=We.actions.reduce(function(Ye,Qe,et){return Ge[Qe.plugin].loaded?(Ye.process.push(Qe),Ye.processIndex.push(et)):(Ye.requeue.push(Qe),Ye.requeueIndex.push(et)),Ye},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(Xe.processIndex&&Xe.processIndex.length){Xe.processIndex.forEach(function(Ye){var Qe=We.actions[Ye],et=Qe.plugin,tt=Qe.payload.type,ct=He[et][tt];if(ct&&W$1(ct)){var at,ft=function(rt,lt){return rt===void 0&&(rt={}),lt===void 0&&(lt={}),[k$1,T].reduce(function(pt,gt){return rt.hasOwnProperty(gt)&<[gt]&<[gt]!==rt[gt]&&(pt[gt]=lt[gt]),pt},rt)}(Qe.payload,Ze),ut=Be[ft.meta.rid];if(!ut&&(at=ct({payload:ft,config:Ge[et].config,instance:Fe,abort:H}))&&on(at)&&at.abort)return void(Be[ft.meta.rid]=!0);if(!ut){var it=tt+":"+et;$e.dispatch(v({},ft,{type:it,_:{called:it,from:"queueDrain"}}))}}});var Je=We.actions.filter(function(Ye,Qe){return!~Xe.processIndex.indexOf(Qe)});We.actions=Je}}}var G$1=function($e){var De=$e.data,Fe=$e.action,Be=$e.instance,He=$e.state,Ke=$e.allPlugins,Ge=$e.allMatches,We=$e.store,Ze=$e.EVENTS;try{var Xe=He.plugins,Je=He.context,Ye=Fe.type,Qe=Ye.match(K),et=De.exact.map(function(at){return at.pluginName});Qe&&(et=Ge.during.map(function(at){return at.pluginName}));var tt=function(at,ft){return function(ut,it,rt){var lt=it.config,pt=it.name,gt=pt+"."+ut.type;rt&&(gt=rt.event);var vt=ut.type.match(K)?function(Et,Pt,Nt,yt,It){return function(Rt,mt){var kt=yt?yt.name:Et,Ut=mt&&ae(mt)?mt:Nt;if(yt&&(!(Ut=mt&&ae(mt)?mt:[Et]).includes(Et)||Ut.length!==1))throw new Error("Method "+Pt+" can only abort "+Et+" plugin. "+JSON.stringify(Ut)+" input valid");return v({},It,{abort:{reason:Rt,plugins:Ut,caller:Pt,_:kt}})}}(pt,gt,ft,rt,ut):function(Et,Pt){return function(){throw new Error(Et.type+" action not cancellable. Remove abort in "+Pt)}}(ut,gt);return{payload:ce(ut),instance:at,config:lt||{},abort:vt}}}(Be,et),ct=De.exact.reduce(function(at,ft){var ut=ft.pluginName,it=ft.methodName,rt=!1;return it.match(/^initialize/)||it.match(/^reset/)||(rt=!Xe[ut].loaded),Je.offline&&it.match(/^(page|track|identify)/)&&(rt=!0),at[""+ut]=rt,at},{});return Promise.resolve(De.exact.reduce(function(at,ft,ut){try{var it=ft.pluginName;return Promise.resolve(at).then(function(rt){function lt(){return Promise.resolve(rt)}var pt=function(){if(De.namespaced&&De.namespaced[it])return Promise.resolve(De.namespaced[it].reduce(function(gt,vt,Et){try{return Promise.resolve(gt).then(function(Pt){return vt.method&&W$1(vt.method)?(function(Rt,mt){var kt=ue(Rt);if(kt&&kt.name===mt){var Ut=ue(kt.method);throw new Error([mt+" plugin is calling method "+Rt,"Plugins cant call self","Use "+kt.method+" "+(Ut?"or "+Ut.method:"")+" in "+mt+" plugin insteadof "+Rt].join(`
|
|
35
|
-
`))}}(vt.methodName,vt.pluginName),Promise.resolve(vt.method({payload:Pt,instance:Be,abort:(Nt=Pt,yt=it,It=vt.pluginName,function(Rt,mt){return v({},Nt,{abort:{reason:Rt,plugins:mt||[yt],caller:Ye,from:It||yt}})}),config:ee(vt.pluginName,Xe,Ke),plugins:Xe})).then(function(Rt){var mt=on(Rt)?Rt:{};return Promise.resolve(v({},Pt,mt))})):Pt;var Nt,yt,It})}catch(Pt){return Promise.reject(Pt)}},Promise.resolve(Fe))).then(function(gt){rt[it]=gt});rt[it]=Fe}();return pt&&pt.then?pt.then(lt):lt()})}catch(rt){return Promise.reject(rt)}},Promise.resolve({}))).then(function(at){return Promise.resolve(De.exact.reduce(function(ft,ut,it){try{var rt=De.exact.length===it+1,lt=ut.pluginName,pt=Ke[lt];return Promise.resolve(ft).then(function(gt){var vt=at[lt]?at[lt]:{};if(Qe&&(vt=gt),re(vt,lt))return Z({data:vt,method:Ye,instance:Be,pluginName:lt,store:We}),Promise.resolve(gt);if(re(gt,lt))return rt&&Z({data:gt,method:Ye,instance:Be,store:We}),Promise.resolve(gt);if(ct.hasOwnProperty(lt)&&ct[lt]===!0)return We.dispatch({type:"queue",plugin:lt,payload:vt,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(gt);var Et=tt(at[lt],Ke[lt]);return Promise.resolve(pt[Ye]({abort:Et.abort,payload:vt,instance:Be,config:ee(lt,Xe,Ke),plugins:Xe})).then(function(Pt){var Nt=on(Pt)?Pt:{},yt=v({},gt,Nt),It=at[lt];if(re(It,lt))Z({data:It,method:Ye,instance:Be,pluginName:lt,store:We});else{var Rt=Ye+":"+lt;(Rt.match(/:/g)||[]).length<2&&!Ye.match(Q)&&!Ye.match(Y)&&Be.dispatch(v({},Qe?yt:vt,{type:Rt,_:{called:Rt,from:"submethod"}}))}return Promise.resolve(yt)})})}catch(gt){return Promise.reject(gt)}},Promise.resolve(Fe))).then(function(ft){if(!(Ye.match(K)||Ye.match(/^registerPlugin/)||Ye.match(Y)||Ye.match(Q)||Ye.match(/^params/)||Ye.match(/^userIdChanged/))){if(Ze.plugins.includes(Ye),ft._&&ft._.originalAction===Ye)return ft;var ut=v({},ft,{_:{originalAction:ft.type,called:ft.type,from:"engineEnd"}});ie(ft,De.exact.length)&&!Ye.match(/End$/)&&(ut=v({},ut,{type:ft.type+"Aborted"})),We.dispatch(ut)}return ft})})}catch(at){return Promise.reject(at)}},K=/Start$/,Q=/^bootstrap/,Y=/^ready/;function Z($e){var De=$e.pluginName,Fe=$e.method+"Aborted"+(De?":"+De:"");$e.store.dispatch(v({},$e.data,{type:Fe,_:{called:Fe,from:"abort"}}))}function ee($e,De,Fe){var Be=De[$e]||Fe[$e];return Be&&Be.config?Be.config:{}}function ne($e,De){return De.reduce(function(Fe,Be){return Be[$e]?Fe.concat({methodName:$e,pluginName:Be.name,method:Be[$e]}):Fe},[])}function te($e,De){var Fe=$e.replace(K,""),Be=De?":"+De:"";return[""+$e+Be,""+Fe+Be,Fe+"End"+Be]}function re($e,De){var Fe=$e.abort;return!!Fe&&(Fe===!0||oe(Fe,De)||Fe&&oe(Fe.plugins,De))}function ie($e,De){var Fe=$e.abort;if(!Fe)return!1;if(Fe===!0||q$1(Fe))return!0;var Be=Fe.plugins;return ae(Fe)&&Fe.length===De||ae(Be)&&Be.length===De}function ae($e){return Array.isArray($e)}function oe($e,De){return!(!$e||!ae($e))&&$e.includes(De)}function ue($e){var De=$e.match(/(.*):(.*)/);return!!De&&{method:De[1],name:De[2]}}function ce($e){return Object.keys($e).reduce(function(De,Fe){return Fe==="type"||(De[Fe]=on($e[Fe])?Object.assign({},$e[Fe]):$e[Fe]),De},{})}function se($e,De,Fe){var Be={};return function(He){return function(Ke){return function(Ge){try{var We,Ze=function(rt){return We?rt:Ke(Ye)},Xe=Ge.type,Je=Ge.plugins,Ye=Ge;if(Ge.abort)return Promise.resolve(Ke(Ge));if(Xe===q.enablePlugin&&He.dispatch({type:q.initializeStart,plugins:Je,disabled:[],fromEnable:!0,meta:Ge.meta}),Xe===q.disablePlugin&&setTimeout(function(){return J$1(Ge.meta.rid,{payload:Ge})},0),Xe===q.initializeEnd){var Qe=De(),et=Object.keys(Qe),tt=et.filter(function(rt){return Je.includes(rt)}).map(function(rt){return Qe[rt]}),ct=[],at=[],ft=Ge.disabled,ut=tt.map(function(rt){var lt=rt.loaded,pt=rt.name,gt=rt.config;return W(rt,function(){return lt({config:gt})},1e4).then(function(vt){return Be[pt]||(He.dispatch({type:q.pluginReadyType(pt),name:pt,events:Object.keys(rt).filter(function(Et){return!M.includes(Et)})}),Be[pt]=!0),ct=ct.concat(pt),rt}).catch(function(vt){if(vt instanceof Error)throw new Error(vt);return at=at.concat(vt.name),vt})});Promise.all(ut).then(function(rt){var lt={plugins:ct,failed:at,disabled:ft};setTimeout(function(){et.length===ut.length+ft.length&&He.dispatch(v({},{type:q.ready},lt))},0)})}var it=function(){if(Xe!==q.bootstrap)return/^ready:([^:]*)$/.test(Xe)&&setTimeout(function(){return F$1(He,De,$e)},0),Promise.resolve(function(rt,lt,pt,gt,vt){try{var Et=W$1(lt)?lt():lt,Pt=rt.type,Nt=Pt.replace(K,"");if(rt._&&rt._.called)return Promise.resolve(rt);var yt=pt.getState(),It=(kt=Et,(Ut=yt.plugins)===void 0&&(Ut={}),(xt=rt.options)===void 0&&(xt={}),Object.keys(kt).filter(function(nt){var st=xt.plugins||{};return Q$1(st[nt])?st[nt]:st.all!==!1&&(!Ut[nt]||Ut[nt].enabled!==!1)}).map(function(nt){return kt[nt]}));Pt===q.initializeStart&&rt.fromEnable&&(It=Object.keys(yt.plugins).filter(function(nt){var st=yt.plugins[nt];return rt.plugins.includes(nt)&&!st.initialized}).map(function(nt){return Et[nt]}));var Rt=It.map(function(nt){return nt.name}),mt=function(nt,st,ht){var St=te(nt).map(function(bt){return ne(bt,st)});return st.reduce(function(bt,wt){var Lt=wt.name,Tt=te(nt,Lt).map(function(Ft){return ne(Ft,st)}),_t=Tt[0],Ot=Tt[1],jt=Tt[2];return _t.length&&(bt.beforeNS[Lt]=_t),Ot.length&&(bt.duringNS[Lt]=Ot),jt.length&&(bt.afterNS[Lt]=jt),bt},{before:St[0],beforeNS:{},during:St[1],duringNS:{},after:St[2],afterNS:{}})}(Pt,It);return Promise.resolve(G$1({action:rt,data:{exact:mt.before,namespaced:mt.beforeNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(nt){function st(){var bt=function(){if(Pt.match(K))return Promise.resolve(G$1({action:v({},ht,{type:Nt+"End"}),data:{exact:mt.after,namespaced:mt.afterNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(wt){wt.meta&&wt.meta.hasCallback&&J$1(wt.meta.rid,{payload:wt})})}();return bt&&bt.then?bt.then(function(){return nt}):nt}if(ie(nt,Rt.length))return nt;var ht,St=function(){if(Pt!==Nt)return Promise.resolve(G$1({action:v({},nt,{type:Nt}),data:{exact:mt.during,namespaced:mt.duringNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(bt){ht=bt});ht=nt}();return St&&St.then?St.then(st):st()})}catch(nt){return Promise.reject(nt)}var kt,Ut,xt}(Ge,De,$e,He,Fe)).then(function(rt){return We=1,Ke(rt)})}();return Promise.resolve(it&&it.then?it.then(Ze):Ze(it))}catch(rt){return Promise.reject(rt)}}}}}function le($e){return function(De){return function(Fe){return function(Be){var He=Be.type,Ke=Be.key,Ge=Be.value,We=Be.options;if(He===q.setItem||He===q.removeItem){if(Be.abort)return Fe(Be);He===q.setItem?$e.setItem(Ke,Ge,We):$e.removeItem(Ke,We)}return Fe(Be)}}}}var fe=function(){var $e=this;this.before=[],this.after=[],this.addMiddleware=function(De,Fe){$e[Fe]=$e[Fe].concat(De)},this.removeMiddleware=function(De,Fe){var Be=$e[Fe].findIndex(function(He){return He===De});Be!==-1&&($e[Fe]=[].concat($e[Fe].slice(0,Be),$e[Fe].slice(Be+1)))},this.dynamicMiddlewares=function(De){return function(Fe){return function(Be){return function(He){var Ke={getState:Fe.getState,dispatch:function(We){return Fe.dispatch(We)}},Ge=$e[De].map(function(We){return We(Ke)});return N$1.apply(void 0,Ge)(Be)(He)}}}}};function de($e){return function(De,Fe){De===void 0&&(De={});var Be={};if(Fe.type==="initialize:aborted")return De;if(/^registerPlugin:([^:]*)$/.test(Fe.type)){var He=pe(Fe.type,"registerPlugin"),Ke=$e()[He];if(!Ke||!He)return De;var Ge=Fe.enabled,We=Ke.config;return Be[He]={enabled:Ge,initialized:!!Ge&&!Ke.initialize,loaded:!!Ge&&!!Ke.loaded({config:We}),config:We},v({},De,Be)}if(/^initialize:([^:]*)$/.test(Fe.type)){var Ze=pe(Fe.type,q.initialize),Xe=$e()[Ze];return Xe&&Ze?(Be[Ze]=v({},De[Ze],{initialized:!0,loaded:!!Xe.loaded({config:Xe.config})}),v({},De,Be)):De}if(/^ready:([^:]*)$/.test(Fe.type))return Be[Fe.name]=v({},De[Fe.name],{loaded:!0}),v({},De,Be);switch(Fe.type){case q.disablePlugin:return v({},De,me(Fe.plugins,!1,De));case q.enablePlugin:return v({},De,me(Fe.plugins,!0,De));default:return De}}}function pe($e,De){return $e.substring(De.length+1,$e.length)}function me($e,De,Fe){return $e.reduce(function(Be,He){return Be[He]=v({},Fe[He],{enabled:De}),Be},Fe)}function ge($e){try{return JSON.parse(JSON.stringify($e))}catch{}return $e}var he={last:{},history:[]};function ve($e,De){$e===void 0&&($e=he);var Fe=De.options,Be=De.meta;if(De.type===q.track){var He=ge(v({event:De.event,properties:De.properties},Object.keys(Fe).length&&{options:Fe},{meta:Be}));return v({},$e,{last:He,history:$e.history.concat(He)})}return $e}var ye={actions:[]};function be($e,De){$e===void 0&&($e=ye);var Fe=De.payload;switch(De.type){case"queue":var Be;return Be=Fe&&Fe.type&&Fe.type===q.identify?[De].concat($e.actions):$e.actions.concat(De),v({},$e,{actions:Be});case"dequeue":return[];default:return $e}}var Ie=/#.*$/;function we($e){var De=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec($e);return"/"+(De&&De[3]?De[3].split("?")[0].replace(Ie,""):"")}var Ee,Pe,Se,Ne,Oe=function($e){if($e===void 0&&($e={}),!$$1)return $e;var De=document,Fe=De.title,Be=De.referrer,He=window,Ke=He.location,Ge=He.innerWidth,We=He.innerHeight,Ze=Ke.hash,Xe=Ke.search,Je=function(Qe){var et=function(){if($$1){for(var tt,ct=document.getElementsByTagName("link"),at=0;tt=ct[at];at++)if(tt.getAttribute("rel")==="canonical")return tt.getAttribute("href")}}();return et?et.match(/\?/)?et:et+Qe:window.location.href.replace(Ie,"")}(Xe),Ye={title:Fe,url:Je,path:we(Je),hash:Ze,search:Xe,width:Ge,height:We};return Be&&Be!==""&&(Ye.referrer=Be),v({},Ye,$e)},Ae={last:{},history:[]};function _e($e,De){$e===void 0&&($e=Ae);var Fe=De.options;if(De.type===q.page){var Be=ge(v({properties:De.properties,meta:De.meta},Object.keys(Fe).length&&{options:Fe}));return v({},$e,{last:Be,history:$e.history.concat(Be)})}return $e}Ee=function(){if(!$$1)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"}(),Pe=$$1?document.referrer:null,Se=o$3(),Ne=a$5();var xe={initialized:!1,sessionId:y$1(),app:null,version:null,debug:!1,offline:!!$$1&&!navigator.onLine,os:{name:Ee},userAgent:$$1?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Ne,locale:Se,campaign:{},referrer:Pe};function je($e,De){$e===void 0&&($e=xe);var Fe=$e.initialized,Be=De.campaign;switch(De.type){case q.campaign:return v({},$e,{campaign:Be});case q.offline:return v({},$e,{offline:!0});case q.online:return v({},$e,{offline:!1});default:return Fe?$e:v({},xe,$e,{initialized:!0})}}var ke=["plugins","reducers","storage"];function Te($e,De,Fe){if($$1){var Be=window[(Fe?"add":"remove")+"EventListener"];$e.split(" ").forEach(function(He){Be(He,De)})}}function ze($e){var De=Te.bind(null,"online offline",function(Fe){return Promise.resolve(!navigator.onLine).then($e)});return De(!0),function(Fe){return De(!1)}}function Me(){return f$1("analytics",[]),function($e){return function(De,Fe,Be){var He=$e(De,Fe,Be),Ke=He.dispatch;return Object.assign(He,{dispatch:function(Ge){return n[o$2].analytics.push(Ge.action||Ge),Ke(Ge)}})}}}function qe($e){return function(){return N$1(N$1.apply(null,arguments),Me())}}function Ue($e){return $e?rn($e)?$e:[$e]:[]}function Ve($e,De,Fe){$e===void 0&&($e={});var Be,He,Ke=y$1();return De&&(X[Ke]=(Be=De,He=function(Ge){for(var We,Ze=Ge||Array.prototype.slice.call(arguments),Xe=0;Xe<Ze.length;Xe++)if(W$1(Ze[Xe])){We=Ze[Xe];break}return We}(Fe),function(Ge){He&&He(Ge),Be(Ge)})),v({},$e,{rid:Ke,ts:new Date().getTime()},De?{hasCallback:!0}:{})}function Le($e){$e===void 0&&($e={});var De=$e.reducers||{},Fe=$e.initialUser||{},Be=($e.plugins||[]).reduce(function(nt,st){if(W$1(st))return nt.middlewares=nt.middlewares.concat(st),nt;if(st.NAMESPACE&&(st.name=st.NAMESPACE),!st.name)throw new Error("https://lytics.dev/errors/1");st.config||(st.config={});var ht=st.EVENTS?Object.keys(st.EVENTS).map(function(wt){return st.EVENTS[wt]}):[];nt.pluginEnabled[st.name]=!(st.enabled===!1||st.config.enabled===!1),delete st.enabled,st.methods&&(nt.methods[st.name]=Object.keys(st.methods).reduce(function(wt,Lt){var Tt;return wt[Lt]=(Tt=st.methods[Lt],function(){for(var _t=Array.prototype.slice.call(arguments),Ot=new Array(Tt.length),jt=0;jt<_t.length;jt++)Ot[jt]=_t[jt];return Ot[Ot.length]=lt,Tt.apply({instance:lt},Ot)}),wt},{}),delete st.methods);var St=Object.keys(st).concat(ht),bt=new Set(nt.events.concat(St));if(nt.events=Array.from(bt),nt.pluginsArray=nt.pluginsArray.concat(st),nt.plugins[st.name])throw new Error(st.name+"AlreadyLoaded");return nt.plugins[st.name]=st,nt.plugins[st.name].loaded||(nt.plugins[st.name].loaded=function(){return!0}),nt},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),He=$e.storage?$e.storage:{getItem:a$4,setItem:f$1,removeItem:i$4},Ke=function(nt){return function(st,ht,St){return ht.getState("user")[st]||(St&&on(St)&&St[st]?St[st]:$(nt)[st]||a$4(D(st))||null)}}(He),Ge=Be.plugins,We=Be.events.filter(function(nt){return!M.includes(nt)}).sort(),Ze=new Set(We.concat(z).filter(function(nt){return!M.includes(nt)})),Xe=Array.from(Ze).sort(),Je=function(){return Ge},Ye=new fe,Qe=Ye.addMiddleware,et=Ye.removeMiddleware,tt=Ye.dynamicMiddlewares,ct=function(){throw new Error("Abort disabled inListener")},at=s$1(),ft=$(He),ut=v({},ft,Fe,at.an_uid?{userId:at.an_uid}:{},at.an_aid?{anonymousId:at.an_aid}:{});ut.anonymousId||(ut.anonymousId=y$1());var it=v({enable:function(nt,st){return new Promise(function(ht){mt.dispatch({type:q.enablePlugin,plugins:Ue(nt),_:{originalAction:q.enablePlugin}},ht,[st])})},disable:function(nt,st){return new Promise(function(ht){mt.dispatch({type:q.disablePlugin,plugins:Ue(nt),_:{originalAction:q.disablePlugin}},ht,[st])})}},Be.methods),rt=!1,lt={identify:function(nt,st,ht,St){try{var bt=q$1(nt)?nt:null,wt=on(nt)?nt:st,Lt=ht||{},Tt=lt.user();f$1(D(k$1),bt);var _t=bt||wt.userId||Ke(k$1,lt,wt);return Promise.resolve(new Promise(function(Ot){mt.dispatch(v({type:q.identifyStart,userId:_t,traits:wt||{},options:Lt,anonymousId:Tt.anonymousId},Tt.id&&Tt.id!==bt&&{previousId:Tt.id}),Ot,[st,ht,St])}))}catch(Ot){return Promise.reject(Ot)}},track:function(nt,st,ht,St){try{var bt=on(nt)?nt.event:nt;if(!bt||!q$1(bt))throw new Error("EventMissing");var wt=on(nt)?nt:st||{},Lt=on(ht)?ht:{};return Promise.resolve(new Promise(function(Tt){mt.dispatch({type:q.trackStart,event:bt,properties:wt,options:Lt,userId:Ke(k$1,lt,st),anonymousId:Ke(T,lt,st)},Tt,[st,ht,St])}))}catch(Tt){return Promise.reject(Tt)}},page:function(nt,st,ht){try{var St=on(nt)?nt:{},bt=on(st)?st:{};return Promise.resolve(new Promise(function(wt){mt.dispatch({type:q.pageStart,properties:Oe(St),options:bt,userId:Ke(k$1,lt,St),anonymousId:Ke(T,lt,St)},wt,[nt,st,ht])}))}catch(wt){return Promise.reject(wt)}},user:function(nt){if(nt===k$1||nt==="id")return Ke(k$1,lt);if(nt===T||nt==="anonId")return Ke(T,lt);var st=lt.getState("user");return nt?i$5(st,nt):st},reset:function(nt){return new Promise(function(st){mt.dispatch({type:q.resetStart},st,nt)})},ready:function(nt){return rt&&nt({plugins:it,instance:lt}),lt.on(q.ready,function(st){nt(st),rt=!0})},on:function(nt,st){if(!nt||!W$1(st))return!1;if(nt===q.bootstrap)throw new Error(".on disabled for "+nt);var ht=/Start$|Start:/;if(nt==="*"){var St=function(Tt){return function(_t){return function(Ot){return Ot.type.match(ht)&&st({payload:Ot,instance:lt,plugins:Ge}),_t(Ot)}}},bt=function(Tt){return function(_t){return function(Ot){return Ot.type.match(ht)||st({payload:Ot,instance:lt,plugins:Ge}),_t(Ot)}}};return Qe(St,Ce),Qe(bt,Re),function(){et(St,Ce),et(bt,Re)}}var wt=nt.match(ht)?Ce:Re,Lt=function(Tt){return function(_t){return function(Ot){return Ot.type===nt&&st({payload:Ot,instance:lt,plugins:Ge,abort:ct}),_t(Ot)}}};return Qe(Lt,wt),function(){return et(Lt,wt)}},once:function(nt,st){if(!nt||!W$1(st))return!1;if(nt===q.bootstrap)throw new Error(".once disabled for "+nt);var ht=lt.on(nt,function(St){st({payload:St.payload,instance:lt,plugins:Ge,abort:ct}),ht()});return ht},getState:function(nt){var st=mt.getState();return nt?i$5(st,nt):Object.assign({},st)},dispatch:function(nt){var st=q$1(nt)?{type:nt}:nt;if(z.includes(st.type))throw new Error("reserved action "+st.type);var ht=v({},st,{_:v({originalAction:st.type},nt._||{})});mt.dispatch(ht)},enablePlugin:it.enable,disablePlugin:it.disable,plugins:it,storage:{getItem:He.getItem,setItem:function(nt,st,ht){mt.dispatch({type:q.setItemStart,key:nt,value:st,options:ht})},removeItem:function(nt,st){mt.dispatch({type:q.removeItemStart,key:nt,options:st})}},setAnonymousId:function(nt,st){lt.storage.setItem(A$1,nt,st)},events:{core:z,plugins:We}},pt=Be.middlewares.concat([function(nt){return function(st){return function(ht){return ht.meta||(ht.meta=Ve()),st(ht)}}},tt(Ce),se(lt,Je,{all:Xe,plugins:We}),le(He),C$1(lt),B(lt),tt(Re)]),gt={context:je,user:R(He),page:_e,track:ve,plugins:de(Je),queue:be},vt=N$1,Et=N$1;if($$1&&$e.debug){var Pt=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;Pt&&(vt=Pt({trace:!0,traceLimit:25})),Et=function(){return arguments.length===0?Me():on(typeof arguments[0])?qe():qe().apply(null,arguments)}}var Nt,yt=function(nt){return Object.keys(nt).reduce(function(st,ht){return ke.includes(ht)||(st[ht]=nt[ht]),st},{})}($e),It=Be.pluginsArray.reduce(function(nt,st){var ht=st.name,St=st.config,bt=st.loaded,wt=Be.pluginEnabled[ht];return nt[ht]={enabled:wt,initialized:!!wt&&!st.initialize,loaded:!!bt({config:St}),config:St},nt},{}),Rt={context:yt,user:ut,plugins:It},mt=P(function(nt){for(var st=Object.keys(nt),ht={},St=0;St<st.length;St++){var bt=st[St];typeof nt[bt]===y&&(ht[bt]=nt[bt])}var wt,Lt=Object.keys(ht);try{(function(Tt){Object.keys(Tt).forEach(function(_t){var Ot=Tt[_t];if(typeof Ot(void 0,{type:"@@redux/INIT"})===b$1||typeof Ot(void 0,{type:I$1})===b$1)throw new Error("reducer "+_t+" "+b$1)})})(ht)}catch(Tt){wt=Tt}return function(Tt,_t){if(Tt===void 0&&(Tt={}),wt)throw wt;for(var Ot=!1,jt={},Ft=0;Ft<Lt.length;Ft++){var Bt=Lt[Ft],Vt=Tt[Bt],Kt=(0,ht[Bt])(Vt,_t);if(typeof Kt===b$1){var zt=S(Bt,_t);throw new Error(zt)}jt[Bt]=Kt,Ot=Ot||Kt!==Vt}return Ot?jt:Tt}}(v({},gt,De)),Rt,Et(vt(O$1.apply(void 0,pt))));mt.dispatch=(Nt=mt.dispatch,function(nt,st,ht){var St=v({},nt,{meta:Ve(nt.meta,st,Ue(ht))});return Nt.apply(null,[St])});var kt=Object.keys(Ge);mt.dispatch({type:q.bootstrap,plugins:kt,config:yt,params:at,user:ut,initialUser:Fe,persistedUser:ft});var Ut=kt.filter(function(nt){return Be.pluginEnabled[nt]}),xt=kt.filter(function(nt){return!Be.pluginEnabled[nt]});return mt.dispatch({type:q.registerPlugins,plugins:kt,enabled:Be.pluginEnabled}),Be.pluginsArray.map(function(nt,st){var ht=nt.bootstrap,St=nt.config,bt=nt.name;ht&&W$1(ht)&&ht({instance:lt,config:St,payload:nt}),mt.dispatch({type:q.registerPluginType(bt),name:bt,enabled:Be.pluginEnabled[bt],plugin:nt}),Be.pluginsArray.length===st+1&&mt.dispatch({type:q.initializeStart,plugins:Ut,disabled:xt})}),ze(function(nt){mt.dispatch({type:nt?q.offline:q.online})}),function(nt,st,ht){setInterval(function(){return F$1(nt,st,ht)},3e3)}(mt,Je,lt),lt}var Ce="before",Re="after",t="cookie",i$3=a$3(),r$2=d$1,c$2=d$1;function u$2($e){return i$3?d$1($e,"",-1):i$4($e)}function a$3(){if(i$3!==void 0)return i$3;var $e="cookiecookie";try{d$1($e,$e),i$3=document.cookie.indexOf($e)!==-1,u$2($e)}catch{i$3=!1}return i$3}function d$1($e,De,Fe,Be,He,Ke){if(typeof window<"u"){var Ge=arguments.length>1;return i$3===!1&&(Ge?f$1($e,De):a$4($e)),Ge?document.cookie=$e+"="+encodeURIComponent(De)+(Fe?"; expires="+new Date(+new Date+1e3*Fe).toUTCString()+(Be?"; path="+Be:"")+(He?"; domain="+He:"")+(Ke?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+$e+"=")[1]||"").split(";")[0])}}var r$1="localStorage",g=b$2.bind(null,"localStorage");u$3("localStorage","getItem",a$4);u$3("localStorage","setItem",f$1);u$3("localStorage","removeItem",i$4);var a$2="sessionStorage",i$2=b$2.bind(null,"sessionStorage");u$3("sessionStorage","getItem",a$4);u$3("sessionStorage","setItem",f$1);u$3("sessionStorage","removeItem",i$4);function I($e){var De=$e;try{if((De=JSON.parse($e))==="true")return!0;if(De==="false")return!1;if(on(De))return De;parseFloat(De)===De&&(De=parseFloat(De))}catch{}if(De!==null&&De!=="")return De}var k=g(),O=i$2(),x=a$3();function C($e,De){if($e){var Fe=A(De),Be=!N(Fe),He=d(Fe)?I(localStorage.getItem($e)):void 0;if(Be&&!I$2(He))return He;var Ke=h(Fe)?I(r$2($e)):void 0;if(Be&&Ke)return Ke;var Ge=E(Fe)?I(sessionStorage.getItem($e)):void 0;if(Be&&Ge)return Ge;var We=a$4($e);return Be?We:{localStorage:He,sessionStorage:Ge,cookie:Ke,global:We}}}function L($e,De,Fe){if($e&&!I$2(De)){var Be={},He=A(Fe),Ke=JSON.stringify(De),Ge=!N(He);return d(He)&&(Be[r$1]=F(r$1,De,I(localStorage.getItem($e))),localStorage.setItem($e,Ke),Ge)?Be[r$1]:h(He)&&(Be[t]=F(t,De,I(r$2($e))),c$2($e,Ke),Ge)?Be[t]:E(He)&&(Be[a$2]=F(a$2,De,I(sessionStorage.getItem($e))),sessionStorage.setItem($e,Ke),Ge)?Be[a$2]:(Be[l$2]=F(l$2,De,a$4($e)),f$1($e,De),Ge?Be[l$2]:Be)}}function b($e,De){if($e){var Fe=A(De),Be=C($e,m$1),He={};return!I$2(Be.localStorage)&&d(Fe)&&(localStorage.removeItem($e),He[r$1]=Be.localStorage),!I$2(Be.cookie)&&h(Fe)&&(u$2($e),He[t]=Be.cookie),!I$2(Be.sessionStorage)&&E(Fe)&&(sessionStorage.removeItem($e),He[a$2]=Be.sessionStorage),!I$2(Be.global)&&G(Fe,l$2)&&(i$4($e),He[l$2]=Be.global),He}}function A($e){return $e?q$1($e)?$e:$e.storage:b$4}function d($e){return k&&G($e,r$1)}function h($e){return x&&G($e,t)}function E($e){return O&&G($e,a$2)}function N($e){return $e===m$1||$e==="all"}function G($e,De){return $e===b$4||$e===De||N($e)}function F($e,De,Fe){return{location:$e,current:De,previous:Fe}}var J={setItem:L,getItem:C,removeItem:b};function _defineProperty($e,De,Fe){return De in $e?Object.defineProperty($e,De,{value:Fe,enumerable:!0,configurable:!0,writable:!0}):$e[De]=Fe,$e}function ownKeys($e,De){var Fe=Object.keys($e);if(Object.getOwnPropertySymbols){var Be=Object.getOwnPropertySymbols($e);De&&(Be=Be.filter(function(He){return Object.getOwnPropertyDescriptor($e,He).enumerable})),Fe.push.apply(Fe,Be)}return Fe}function _objectSpread2($e){for(var De=1;De<arguments.length;De++){var Fe=arguments[De]!=null?arguments[De]:{};De%2?ownKeys(Object(Fe),!0).forEach(function(Be){_defineProperty($e,Be,Fe[Be])}):Object.getOwnPropertyDescriptors?Object.defineProperties($e,Object.getOwnPropertyDescriptors(Fe)):ownKeys(Object(Fe)).forEach(function(Be){Object.defineProperty($e,Be,Object.getOwnPropertyDescriptor(Fe,Be))})}return $e}function analyticsLib(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De={storage:J};return Le(_objectSpread2(_objectSpread2({},De),$e))}function saturated($e,De){De=De||{};var Fe,Be,He=[],Ke=De.max||1/0;function Ge(){clearInterval(Fe),$e(He.splice(0,Ke)),We()}function We(){Fe=setInterval(Ge,De.interval||1e4)}return We(),{flush:Ge,push:function(Ze){return Be=He.push(Ze),Be>=Ke&&Ge(),Be},size:function(){return He.length},end:function(Ze){Ze&&Ge(),clearInterval(Fe)}}}const name="@sesamy/sesamy-js",version="1.37.1";function onRouteChange($e){if(typeof window>"u")return;const{addEventListener:De,history:Fe,location:Be}=window;let He=Be.pathname;De("popstate",()=>$e(Be.pathname)),["push","replace"].map(Ke=>{const Ge=`${Ke}State`;if(Ge!=="pushState"&&Ge!=="replaceState")return;const We=Fe[Ge];Fe[Ge]=function(...Ze){var Ye;const Xe=((Ye=Ze[2])==null?void 0:Ye.toString())||"",Je=trimPath(Xe);return He!==Je&&(He=Je,setTimeout(()=>$e(Xe),0)),We.apply(Fe,Ze)}})}function remove($e,De){const Fe=$e.indexOf(De);return Fe>-1?$e.slice(0,Fe):$e}function trimPath($e){return["#","?"].forEach(De=>$e=remove($e,De)),$e}function routeChangeListener(){onRouteChange(()=>{analytics.page()})}function i$1($e){if($e===void 0&&($e={}),!$$1)return g$1;var De=l$1(),Fe=c$1(),Be=o$1(),He=s(Be,De),Ke=s(Fe,De),Ge=[],We=[],Ze=[],Xe=Be,Je=He,Ye=Ke,Qe=Object.keys($e);if(!Qe.length)return g$1;var et=Qe.map(function(ct){return Number(ct)}),tt=b$3(function(){var ct=l$1(),at=function(yt,It){return It.map(function(Rt){return Rt===100?yt-5:yt*(Rt/100)})}(ct,et),ft=c$1(),ut=o$1(),it=s(ut,ct),rt=s(ft,ct);if(Je=it>Je?it:Je,Ye=rt<Ye?rt:Ye,!(Ge.length>=et.length)){var lt=Xe===ut,pt="up";lt?pt="initial":Xe<=ut&&(pt="down");var gt=at,vt=et;(pt==="up"||lt)&&(gt=at.slice().reverse(),vt=et.slice().reverse());var Et=vt.reduce(function(yt,It,Rt){var mt=gt[Rt];return Ze.includes(It)&&ut<=mt&&(Ze=Ze.filter(function(kt){return kt!==It}),yt.singleFunction=It),pt==="down"&&!Ge.includes(It)&&ut>=mt&&It>Ke?(We.push(It),yt.callbacks=yt.callbacks.concat(It),yt):pt==="up"&&!Ge.includes(It)&&ut<=mt&&It<=it?(yt.foundFunc=[It],yt):(lt&&ut>=mt&&yt.foundFunc.length===0&&(yt.foundFunc=[It]),!We.includes(It)&&ut>=mt&&(We.push(It),yt.singleFunction?Ze.push(It):yt.singleFunction=It),yt)},{foundFunc:[],singleFunction:null,callbacks:[],direction:pt});if(Xe=ut,pt==="down"&&Et.callbacks&&Et.callbacks.forEach(function(yt){W$1($e[yt])&&($e[yt]({trigger:yt,direction:pt,scrollMin:Ye,scrollMax:Je,range:[Ye,Je]}),Ge.push(yt))}),Et.singleFunction){var Pt=Et.singleFunction,Nt=Et.direction;W$1($e[Pt])&&$e[Pt]({trigger:Pt,direction:Nt,scrollMin:Ye,scrollMax:Je,range:[Ye,Je]}),Ge.push(Pt)}}},500);return window.addEventListener("scroll",tt),function(){return window.removeEventListener("scroll",tt)}}function c$1(){return $$1?document.body.scrollTop||document.documentElement.scrollTop:0}function u$1(){return $$1?window.innerHeight||document.documentElement.clientHeight:0}function o$1(){return Math.round(c$1()+u$1())}function l$1(){if(!$$1)return 0;var $e=document.body,De=document.documentElement;return Math.max($e.scrollHeight,$e.offsetHeight,De.clientHeight,De.scrollHeight,De.offsetHeight)}function s($e,De){return Math.round($e/De*100)}var i="EventListener";function u($e){return function(De,Fe,Be,He){var Ke=Be||g$1,Ge=He||!1;if(!$$1)return Ke;var We=l(Fe),Ze=l(De,!0);if(!Ze.length)throw new Error("noElements");if(!We.length)throw new Error("noEvent");var Xe=[];return function Je(Ye){Ye&&(Xe=[]);for(var Qe=Ye?"add"+i:"remove"+i,et=0;et<Ze.length;et++){var tt=Ze[et];Xe[et]=Ye?Ge&&Ge.once?a$1(Ke):Ke:Xe[et]||Ke;for(var ct=0;ct<We.length;ct++)tt[Qe]?tt["on"+We[ct]]=Ye?Xe[et]:null:tt[Qe](We[ct],Xe[et],Ge)}return Je.bind(null,!Ye)}($e)}}function l($e,De){if(q$1($e))return De?l(document.querySelectorAll($e)):(Fe=$e).split(Fe.indexOf(",")>-1?",":" ").map(function(Ge){return Ge.trim()});var Fe;if(NodeList.prototype.isPrototypeOf($e)){for(var Be=[],He=$e.length>>>0;He--;)Be[He]=$e[He];return Be}var Ke=Hn($e);return De?Ke.map(function(Ge){return q$1(Ge)?l(Ge,!0):Ge}).flat():Ke}function a$1($e,De){var Fe;return function(){return $e&&(Fe=$e.apply(this,arguments),$e=null),Fe}}var f=u("Event");function p($e,De){return $$1&&W$1(window[$e])?(Fe=window[$e],Be=De,(He=window)===void 0&&(He=null),W$1(Fe)?function(){Fe.apply(He,arguments),Be.apply(He,arguments)}:Be):window[$e]=De;var Fe,Be,He}p.bind(null,"onerror");p.bind(null,"onload");var isServer=typeof window>"u",HIDDEN="hidden";function onTabChange($e){if(isServer)return!1;var De=getHiddenProp(),Fe="".concat(De.replace(/[H|h]idden/,""),"visibilitychange"),Be=function(){return $e(!!document[De])},He=function(){return document.addEventListener(Fe,Be)};return He(),function(){return document.removeEventListener(Fe,Be),He}}function getHiddenProp(){var $e=["webkit","moz","ms","o"];return isServer||HIDDEN in document?HIDDEN:$e.reduce(function(De,Fe){var Be=Fe+"Hidden";return!De&&Be in document?Be:De},null)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r($e,De){De===void 0&&(De={});var Fe=function(Ge,We){var Ze=this,Xe=!1;return function(Je){Xe||(Ge.call(Ze,Je),Xe=!0,setTimeout(function(){return Xe=!1},We))}}($e,De.throttle||1e4),Be=[];function He(){var Ge=onTabChange(function(We){We||Fe({type:"tabVisible"})});return Be=[Ge].concat(o.map(function(We){return f(document,We,Fe)})).concat(f(window,"load",Fe)).concat(f(window,"scroll",Fe,{capture:!0,passive:!0})),Ke}function Ke(){Be.map(function(Ge){return Ge()})}return He(),function(){return Ke(),He}}function a($e){var De,Fe,Be=$e.onIdle,He=$e.onWakeUp,Ke=$e.onHeartbeat,Ge=$e.timeout,We=Ge===void 0?1e4:Ge,Ze=$e.throttle,Xe=Ze===void 0?2e3:Ze,Je=!1,Ye=!1,Qe=new Date,et=function(){return clearTimeout(De)};function tt(at){et(),Ke&&!Je&&Ke(c(Qe),at),He&&Je&&(Je=!1,He(c(Fe),at),Qe=new Date),De=setTimeout(function(){Je=!0,Be&&(Fe=new Date,Be(c(Qe),at))},We)}var ct=r(tt,{throttle:Xe});return{disable:function(){Ye=!0,Je=!1,et();var at=ct();return function(){return Ye=!1,Qe=new Date,tt({type:"load"}),at()}},getStatus:function(){return{isIdle:Je,isDisabled:Ye,active:Je?0:c(Qe,Ye),idle:Je?c(Fe,Ye):0}}}}function c($e,De){return De?0:Math.round((new Date-$e)/1e3)}const timeout=5e3;class ElementTracker{constructor(De){Dt(this,"element");Dt(this,"isInViewport",!1);Dt(this,"isAwake",!1);Dt(this,"isFlushing");Dt(this,"observer");Dt(this,"lastEventAt",Date.now());Dt(this,"registeredView",!1);Dt(this,"viewCallback");Dt(this,"activeDurationCallback");Dt(this,"idleDurationCallback");Dt(this,"scrollCallback");this.element=De.element,this.viewCallback=De.viewCallback,this.activeDurationCallback=De.activeDurationCallback,this.idleDurationCallback=De.idleDurationCallback,this.scrollCallback=De.scrollCallback,this.observer=new IntersectionObserver(Fe=>{Fe.forEach(Be=>{this.handleInViewPort(Be.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),a({onIdle:Fe=>this.handleAwake(!1,Fe),onWakeUp:Fe=>this.handleAwake(!0,Fe),timeout}),i$1({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(De){De?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=De}handleAwake(De,Fe=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=De,this.lastEventAt=De?Date.now()-Fe*timeout:Date.now(),this.isInViewport&&this.trackAwake(De,Fe)}handleScroll(De){this.scrollCallback&&this.scrollCallback(De)}handleVisibilityChange(){this.isAwake=!1;const De=Math.round((Date.now()-this.lastEventAt)/1e3);De>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,De))}trackAwake(De,Fe){!De&&this.activeDurationCallback&&this.activeDurationCallback(Fe,this.isFlushing,this.lastEventAt),De&&this.idleDurationCallback&&this.idleDurationCallback(Fe,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const SESSION_ID_KEY="sesamy_session_id";function getSessionId(){let $e=sessionStorage.getItem(SESSION_ID_KEY);return $e||($e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(SESSION_ID_KEY,$e)),$e}function generateCSSSelector($e){function De(Be){return Be.id?`#${Be.id}`:Be.classList.length>0?Array.from(Be.classList).map(Ke=>`.${Ke}`).join(""):null}function Fe(Be){const He=[];let Ke=Be;for(;Ke&&Ke!==document.body&&Ke!==document.documentElement;){const Ge=De(Ke);if(Ge){He.unshift(Ge);break}if(Ke.parentElement){const We=Array.from(Ke.parentElement.children),Ze=We.indexOf(Ke)+1,Xe=Ke.tagName.toLowerCase();We.filter(Ye=>Ye.tagName.toLowerCase()===Xe).length>1?He.unshift(`${Xe}:nth-child(${Ze})`):He.unshift(Xe)}Ke=Ke.parentElement}return He.join(" > ")}return Fe($e)}let contentSelectors={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"}},api;function init$3($e,De){var Fe;contentSelectors={...contentSelectors,...(Fe=$e.content)==null?void 0:Fe.article},api=De}function getElementFromSelector($e,De){const{selector:Fe}=De;return Fe===contentSelectors.article.selector?$e:$e.querySelector(Fe)}function getElementValue($e,De){if($e)return De.attribute?De.attribute==="textContent"?$e.textContent??void 0:$e.getAttribute(De.attribute)??getElementValue($e.parentElement,De):$e.textContent??void 0}function getMetaTag($e){const De=document.head.querySelectorAll(`[property~='${$e}'][content]`);for(let Be=0;Be<De.length;Be+=1)if(De[Be].content)return De[Be].content;const Fe=document.head.querySelectorAll(`[name~='${$e}'][content]`);for(let Be=0;Be<Fe.length;Be+=1)if(Fe[Be].content)return Fe[Be].content}function getPropertyFromHTML({publisherContentId:$e,key:De,defaultValue:Fe=""}){const Be=$e?document.body.querySelector(`sesamy-content-data[id='${$e}']`):null;return(Be==null?void 0:Be.getAttribute(De))||getMetaTag(`sesamy:${De}`)||getMetaTag(`og:${De}`)||getMetaTag(De)||Fe}function listContent(){const $e=document.querySelectorAll(contentSelectors.article.selector);return Array.from($e).map(getContent$1).filter(De=>De!==null)}function getContent$1($e){const De=typeof $e=="string"?document.querySelector($e):$e;if(!De)return null;const Fe={element:De,selector:typeof $e=="string"?$e:generateCSSSelector(De)},Be=(He,Ke,Ge,We)=>{const Ze=getElementFromSelector(De,Ke);if(Ze){const Xe=getElementValue(Ze,Ke)||getPropertyFromHTML({publisherContentId:Ge,key:He});Xe!==void 0&&(Fe[He]=We?We(Xe):Xe)}};return Be("id",contentSelectors.id),Be("title",contentSelectors.title,Fe.id),Be("excerpt",contentSelectors.excerpt,Fe.id),Be("image",contentSelectors.image,Fe.id),Be("price",contentSelectors.price,Fe.id,He=>parseFloat(He)),Be("currency",contentSelectors.currency,Fe.id),Be("url",contentSelectors.url,Fe.id),Be("pass",contentSelectors.pass,Fe.id),Be("accessLevel",contentSelectors.accessLevel,Fe.id,He=>He||"entitlement"),Fe}async function unlockContent($e,De){var We;const Fe=typeof $e=="string"?document.querySelector($e):$e;if(!Fe)throw new Error("Could not find element");const Be=getContent$1(Fe);if(!(Be!=null&&Be.url))throw new Error("Could not find content for element");const He=await api.entitlements.hasAccess(Be.url||"",((We=Be.pass)==null?void 0:We.split(","))||[]);if(!He)throw new Error("User does not have access to the content");const Ke=await api.entitlements.access(He.id);if(!Ke.token)throw new Error("Could not get access token");const Ge=De||generateCSSSelector(Fe.parentElement||Fe);return api.proxy.getContent(Ke.token,Be.url,Ge)}function onDOMContentLoaded($e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$e):$e()}let flushing=!1,_clientId,_enabled,_endpoint;const visibilityListeners=new Map;function initAnalytics({clientId:$e,enabled:De=!0,environment:Fe}){_clientId=$e,_enabled=De,_endpoint=`${getBaseUrl("logs",Fe)}/events`,_enabled&&(window.addEventListener("beforeunload",()=>{unloadPageListeners.forEach((Be,He)=>{Be.bind(He)()}),flushQueue()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&visibilityListeners.forEach((Be,He)=>{Be.bind(He)()})}),routeChangeListener(),onDOMContentLoaded(()=>{const Be=new ElementTracker({element:document.body,viewCallback:()=>{analytics.page()},activeDurationCallback:(He,Ke,Ge)=>{analytics.track("activeDuration",{duration:He,durationStart:Ge,flushing:Ke})},idleDurationCallback:(He,Ke,Ge)=>{analytics.track("idleDuration",{duration:He,durationStart:Ge,flushing:Ke})},scrollCallback:He=>{analytics.track("scroll",{scroll:He.scrollMax})}});addUnloadPageListener(document.body,()=>{Be.flush()}),addVisibilityListener(document.body,()=>{Be.handleVisibilityChange()})}),window.addEventListener(Events.AUTHENTICATED,async Be=>{const He=Be;await analytics.identify(He.detail.sub)}),window.addEventListener(Events.LOGOUT,async()=>{await analytics.track("logout",{}),queue.flush(),await analytics.reset()}))}function createMessage($e){return JSON.stringify($e.map(De=>({...De,clientId:_clientId,requestId:Math.random().toString(36).slice(2,9),sessionId:getSessionId(),timestamp:new Date().toISOString(),version,event:De.event,context:{page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:getMetaTag("sesamy:item-src"),publisherContentId:getMetaTag("sesamy:publisher-content-id")},locale:navigator.language,library:name,userAgent:navigator.userAgent,clientId:_clientId}})))}const queue=saturated(async $e=>{if($e.length>0){const De=createMessage($e);flushing?navigator.sendBeacon(_endpoint,De):(await fetch(_endpoint,{method:"POST",body:De,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function send($e){var De;if($e.anonymousId)if((De=$e.properties)!=null&&De.flushing){const Fe={...$e};delete Fe.properties.flushing,navigator.sendBeacon(_endpoint,createMessage([Fe]))}else queue.push($e)}const analytics=analyticsLib({app:name,version,plugins:[{name:"custom-analytics-plugin",page:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be,event:He}=$e;send({anonymousId:Fe,userId:Be,properties:De,event:He,type:"page"})},track:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be,event:He}=$e;send({anonymousId:Fe,userId:Be,properties:De,event:He,type:"track"})},identify:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be}=$e;send({anonymousId:Fe,userId:Be,properties:De,type:"identify"})}}]});function track($e,De){analytics.track($e,De)}function flushQueue(){return flushing=!0,queue.flush()}const unloadPageListeners=new Map;function addUnloadPageListener($e,De){unloadPageListeners.set($e,De)}function addVisibilityListener($e,De){visibilityListeners.set($e,De)}function emitEvent($e,De,Fe=!1){const Be={name:$e,data:De},He=new CustomEvent($e,{detail:Be,cancelable:Fe,bubbles:!0});track(`event:${$e}`,{...De,timestamp:new Date().toISOString()});const Ke=window.dispatchEvent(He);return Fe&&!Ke?{canceled:!0,message:Be.cancellationMessage}:{canceled:!1}}function cancelEvent($e,De){$e.cancelable&&($e.detail.cancellationMessage=De,$e.preventDefault())}let auth0Client,organization,initialized=!1,loginInProgress=!1;isBrowser()&&window.addEventListener("pageshow",()=>{loginInProgress=!1});const ACCESS_TOKEN_KEY="sesamyAccessToken",REFRESH_TOKEN_KEY="sesamyRefreshToken";async function waitForInit(){return initialized?!0:new Promise(($e,De)=>{const Fe=setTimeout(()=>{initialized?$e(!0):De(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Events.AUTH_INITIALIZED,()=>{clearTimeout(Fe),$e(!0)})})}async function refreshLocalAccessToken($e){if(!$e)return null;const De=localStorage.getItem(REFRESH_TOKEN_KEY);if(!De)return log("No refresh token found in localstorage"),null;const Fe=new URLSearchParams;Fe.set("client_id",$e.iss),Fe.set("refresh_token",De),Fe.set("grant_type","refresh_token");const Be=new URL($e.iss);Be.pathname="/oauth/token",Be.searchParams.set("user_id",$e.sub);try{const He=await fetch(Be.href,{body:Fe.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!He.ok)throw localStorage.removeItem(REFRESH_TOKEN_KEY),new Error("Renew token failed");const Ke=await He.json();return localStorage.setItem(REFRESH_TOKEN_KEY,Ke.refresh_token),localStorage.setItem(ACCESS_TOKEN_KEY,Ke.access_token),Ke.access_token}catch{logout()}}async function getLocalStorageAccessToken(){const $e=localStorage.getItem(ACCESS_TOKEN_KEY);if(!$e)return null;const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3){const Fe=await refreshLocalAccessToken(De);if(Fe)return Fe;localStorage.removeItem(ACCESS_TOKEN_KEY)}return $e}let hasExistingTokenCache=null;function hasExistingAuth0RefreshToken(){try{if(hasExistingTokenCache!==null)return hasExistingTokenCache;const De=Object.keys(localStorage).filter(Fe=>Fe.startsWith("@@auth0spajs@@"));for(const Fe of De){const Be=JSON.parse(localStorage.getItem(Fe)||"{}");if(typeof Be=="object"&&"refresh_token"in Be)return hasExistingTokenCache=!0,!0}}catch($e){log(`Error checking for existing auth0 tokens: ${$e.message}`)}return hasExistingTokenCache=!1,!1}function getTopLevelDomain($e){try{const De=new URL($e).hostname,Fe=De.split(".");return Fe.length>1?Fe.slice(-2).join("."):De}catch{return null}}async function init$2($e){if($e.enabled===!1)return;organization=$e.organization;const De=$e.domain&&!hasExistingAuth0RefreshToken()?$e.domain:getBaseDomain("token",$e.environment),Fe={domain:De,clientId:$e.clientId,useCookiesForTransactions:!0};Fe.cacheLocation="localstorage",getTopLevelDomain(window.location.href)!==getTopLevelDomain(`https://${De}`)&&(Fe.useRefreshTokens=!0),log(`Initializing auth0 client: ${JSON.stringify(Fe)}`),auth0Client=await oe$1(Fe);const Be=new URLSearchParams(window.location.search),He=Be.get("code"),Ke=Be.get("state");if(He)if(window.opener)log("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:He,state:Ke}},window.location.origin);else{log("Code found in URL, handling redirect");try{const Ze=await auth0Client.handleRedirectCallback();log(`Login result: ${JSON.stringify(Ze)}`);const Xe=await auth0Client.getUser();if(!Xe)throw log("No user found"),new Error("No user found");log(`User found ${JSON.stringify(Xe)}`),triggerEvent(Events.AUTHENTICATED,Xe),log("Rewrite url")}catch(Ze){alert("There was an error logging in"),console.error(Ze)}const Ge=new URL(location.href),We=Ge.searchParams;We.delete("code"),We.delete("state"),Ge.search=We.toString(),window.history.replaceState({},document.title,Ge.toString())}initialized=!0,triggerEvent(Events.AUTH_INITIALIZED,{})}async function isAuthenticated(){return await waitForInit(),await getLocalStorageAccessToken()?!0:auth0Client?auth0Client.isAuthenticated():!1}async function getUser(){return await waitForInit(),await getLocalStorageAccessToken()?(log("Using local user"),{sub:"local",name:"Local User"}):auth0Client?auth0Client.getUser():null}function prepareLogin($e){if(loginInProgress)return log("Login already in progress"),null;if(loginInProgress=!0,setTimeout(()=>{loginInProgress=!1},3e3),localStorage.removeItem(ACCESS_TOKEN_KEY),!auth0Client)throw new Error("Auth0 client not initialized");const De=($e==null?void 0:$e.authorizationParams)||{};return{...$e,authorizationParams:{organization,redirect_uri:window.location.href,ui_locales:getLanguage(),incognito:isIncognito(),...De}}}async function loginWithRedirect($e){const De=prepareLogin($e);if(De)return auth0Client.loginWithRedirect(De)}async function loginWithPopup($e){const De=prepareLogin($e);if(!De)return;await auth0Client.loginWithPopup(De),emitEvent(Events.AUTHENTICATED,await auth0Client.getUser()).canceled||window.location.reload()}async function login($e){return await isIncognito()?loginWithPopup($e):loginWithRedirect($e)}async function getTokenSilently($e=!0,De=!1){await waitForInit();const Fe=await getLocalStorageAccessToken();if(Fe)return Fe;try{if(!auth0Client)return log("Auth client not initialized"),null;let Be=await auth0Client.getTokenSilently();const He=getPayloadFromJwt(Be);return De&&(He!=null&&He.exp)&&He.exp+3600<new Date().getTime()/1e3&&(Be=await auth0Client.getTokenSilently({cacheMode:De?"off":"on"})),Be}catch(Be){const He=Be;if(log(`Failed to get token silently: ${He.message}`),He.message==="Invalid refresh token"&&await logout(),$e)throw Be;return null}}async function logout($e={}){if(await waitForInit(),localStorage.removeItem(ACCESS_TOKEN_KEY),triggerEvent(Events.LOGOUT,{}),!!auth0Client)return log(`Logout with options: ${JSON.stringify($e)}`),auth0Client.logout({...$e,logoutParams:{returnTo:window.location.href,...$e.logoutParams}})}function getPayloadFromJwt($e){const De=$e.split(".");if(De.length!==3)return null;const Be=De[1].replace(/-/g,"+").replace(/_/g,"/"),He=decodeURIComponent(atob(Be).split("").map(function(Ke){return"%"+("00"+Ke.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(He)}async function setToken($e){const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3)throw new Error("Invalid token");log("Set token"),localStorage.setItem(ACCESS_TOKEN_KEY,$e),triggerEvent(Events.AUTHENTICATED,De)}const defaultSkip=($e,De)=>De.skipDedupe||De.method!=="GET",defaultKey=($e,De)=>De.method+"@"+$e,defaultResolver=$e=>$e.clone(),dedupe=({skip:$e=defaultSkip,key:De=defaultKey,resolver:Fe=defaultResolver}={})=>{const Be=new Map;return He=>(Ke,Ge)=>{if($e(Ke,Ge))return He(Ke,Ge);const We=De(Ke,Ge);if(!Be.has(We))Be.set(We,[]);else return new Promise((Ze,Xe)=>{Be.get(We).push([Ze,Xe])});try{return He(Ke,Ge).then(Ze=>(Be.get(We).forEach(([Xe])=>Xe(Fe(Ze))),Be.delete(We),Ze)).catch(Ze=>{throw Be.get(We).forEach(([,Xe])=>Xe(Ze)),Be.delete(We),Ze})}catch(Ze){return Be.delete(We),Promise.reject(Ze)}}},defaultDelayRamp=($e,De)=>$e*De,defaultUntil=$e=>$e&&$e.ok,retry=({delayTimer:$e=500,delayRamp:De=defaultDelayRamp,maxAttempts:Fe=10,until:Be=defaultUntil,onRetry:He=null,retryOnNetworkError:Ke=!1,resolveWithLatestResponse:Ge=!1,skip:We}={})=>Ze=>(Xe,Je)=>{let Ye=0;if(We&&We(Xe,Je))return Ze(Xe,Je);const Qe=(et,tt)=>Promise.resolve(Be(et,tt)).then(ct=>ct?et&&Ge?et:tt?Promise.reject(tt):et:(Ye++,!Fe||Ye<=Fe?new Promise(at=>{const ft=De($e,Ye);setTimeout(()=>{typeof He=="function"?Promise.resolve(He({response:et,error:tt,url:Xe,options:Je})).then((ut={})=>{var it,rt;at(Ze((it=ut&&ut.url)!==null&&it!==void 0?it:Xe,(rt=ut&&ut.options)!==null&&rt!==void 0?rt:Je))}):at(Ze(Xe,Je))},ft)}).then(Qe).catch(at=>{if(!Ke)throw at;return Qe(null,at)}):et&&Ge?et:Promise.reject(tt||new Error("Number of attempts exceeded."))));return Ze(Xe,Je).then(Qe).catch(et=>{if(!Ke)throw et;return Qe(null,et)})},JSON_MIME="application/json",CONTENT_TYPE_HEADER="Content-Type",FETCH_ERROR=Symbol(),CATCHER_FALLBACK=Symbol();function extractContentType($e={}){var De;return(De=Object.entries($e).find(([Fe])=>Fe.toLowerCase()===CONTENT_TYPE_HEADER.toLowerCase()))===null||De===void 0?void 0:De[1]}function isLikelyJsonMime($e){return/^application\/.*json.*/.test($e)}const mix=function($e,De,Fe=!1){return Object.entries(De).reduce((Be,[He,Ke])=>{const Ge=$e[He];return Array.isArray(Ge)&&Array.isArray(Ke)?Be[He]=Fe?[...Ge,...Ke]:Ke:typeof Ge=="object"&&typeof Ke=="object"?Be[He]=mix(Ge,Ke,Fe):Be[He]=Ke,Be},{...$e})},config={options:{},errorType:"text",polyfills:{},polyfill($e,De=!0,Fe=!1,...Be){const He=this.polyfills[$e]||(typeof self<"u"?self[$e]:null)||(typeof global<"u"?global[$e]:null);if(De&&!He)throw new Error($e+" is not defined");return Fe&&He?new He(...Be):He}};function setOptions($e,De=!1){config.options=De?$e:mix(config.options,$e)}function setPolyfills($e,De=!1){config.polyfills=De?$e:mix(config.polyfills,$e)}function setErrorType($e){config.errorType=$e}const middlewareHelper=$e=>De=>$e.reduceRight((Fe,Be)=>Be(Fe),De)||De;class WretchError extends Error{}const resolver=$e=>{const De=Object.create(null);$e=$e._addons.reduce((it,rt)=>rt.beforeRequest&&rt.beforeRequest(it,$e._options,De)||it,$e);const{_url:Fe,_options:Be,_config:He,_catchers:Ke,_resolvers:Ge,_middlewares:We,_addons:Ze}=$e,Xe=new Map(Ke),Je=mix(He.options,Be);let Ye=Fe;const Qe=middlewareHelper(We)((it,rt)=>(Ye=it,He.polyfill("fetch")(it,rt)))(Fe,Je),et=new Error,tt=Qe.catch(it=>{throw{[FETCH_ERROR]:it}}).then(it=>{var rt;if(!it.ok){const lt=new WretchError;if(lt.cause=et,lt.stack=lt.stack+`
|
|
36
|
-
CAUSE: `+et.stack,lt.response=it,lt.status=it.status,lt.url=Ye,it.type==="opaque")throw lt;const pt=He.errorType==="json"||((rt=it.headers.get("Content-Type"))===null||rt===void 0?void 0:rt.split(";")[0])==="application/json";return(He.errorType?pt?it.text():it[He.errorType]():Promise.resolve(it.body)).then(vt=>{throw lt.message=typeof vt=="string"?vt:it.statusText,vt&&(pt&&typeof vt=="string"?(lt.text=vt,lt.json=JSON.parse(vt)):lt[He.errorType]=vt),lt})}return it}),ct=it=>it.catch(rt=>{const lt=Object.prototype.hasOwnProperty.call(rt,FETCH_ERROR),pt=lt?rt[FETCH_ERROR]:rt,gt=(pt==null?void 0:pt.status)&&Xe.get(pt.status)||Xe.get(pt==null?void 0:pt.name)||lt&&Xe.has(FETCH_ERROR)&&Xe.get(FETCH_ERROR);if(gt)return gt(pt,$e);const vt=Xe.get(CATCHER_FALLBACK);if(vt)return vt(pt,$e);throw pt}),at=it=>rt=>ct(it?tt.then(lt=>lt&<[it]()).then(lt=>rt?rt(lt):lt):tt.then(lt=>rt?rt(lt):lt)),ft={_wretchReq:$e,_fetchReq:Qe,_sharedState:De,res:at(null),json:at("json"),blob:at("blob"),formData:at("formData"),arrayBuffer:at("arrayBuffer"),text:at("text"),error(it,rt){return Xe.set(it,rt),this},badRequest(it){return this.error(400,it)},unauthorized(it){return this.error(401,it)},forbidden(it){return this.error(403,it)},notFound(it){return this.error(404,it)},timeout(it){return this.error(408,it)},internalError(it){return this.error(500,it)},fetchError(it){return this.error(FETCH_ERROR,it)}},ut=Ze.reduce((it,rt)=>({...it,...typeof rt.resolver=="function"?rt.resolver(it):rt.resolver}),ft);return Ge.reduce((it,rt)=>rt(it,$e),ut)},core={_url:"",_options:{},_config:config,_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,De=!1){return{...this,_config:{...this._config,polyfills:De?$e:mix(this._config.polyfills,$e)}}},url($e,De=!1){if(De)return{...this,_url:$e};const Fe=this._url.split("?");return{...this,_url:Fe.length>1?Fe[0]+$e+"?"+Fe[1]:this._url+$e}},options($e,De=!1){return{...this,_options:De?$e:mix(this._options,$e)}},headers($e){const De=$e?Array.isArray($e)?Object.fromEntries($e):"entries"in $e?Object.fromEntries($e.entries()):$e:{};return{...this,_options:mix(this._options,{headers:De})}},accept($e){return this.headers({Accept:$e})},content($e){return this.headers({[CONTENT_TYPE_HEADER]:$e})},auth($e){return this.headers({Authorization:$e})},catcher($e,De){const Fe=new Map(this._catchers);return Fe.set($e,De),{...this,_catchers:Fe}},catcherFallback($e){return this.catcher(CATCHER_FALLBACK,$e)},resolve($e,De=!1){return{...this,_resolvers:De?[$e]:[...this._resolvers,$e]}},defer($e,De=!1){return{...this,_deferred:De?[$e]:[...this._deferred,$e]}},middlewares($e,De=!1){return{...this,_middlewares:De?$e:[...this._middlewares,...$e]}},fetch($e=this._options.method,De="",Fe=null){let Be=this.url(De).options({method:$e});const He=extractContentType(Be._options.headers),Ke=this._config.polyfill("FormData",!1),Ge=typeof Fe=="object"&&!(Ke&&Fe instanceof Ke)&&(!Be._options.headers||!He||isLikelyJsonMime(He));return Be=Fe?Ge?Be.json(Fe,He):Be.body(Fe):Be,resolver(Be._deferred.reduce((We,Ze)=>Ze(We,We._url,We._options),Be))},get($e=""){return this.fetch("GET",$e)},delete($e=""){return this.fetch("DELETE",$e)},put($e,De=""){return this.fetch("PUT",De,$e)},post($e,De=""){return this.fetch("POST",De,$e)},patch($e,De=""){return this.fetch("PATCH",De,$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,De){const Fe=extractContentType(this._options.headers);return this.content(De||isLikelyJsonMime(Fe)&&Fe||JSON_MIME).body(JSON.stringify($e))}};function factory($e="",De={}){return{...core,_url:$e,_options:De}}factory.default=factory;factory.options=setOptions;factory.errorType=setErrorType;factory.polyfills=setPolyfills;factory.WretchError=WretchError;function clearCache(){return sessionStorage.removeItem(CACHE_TIMESTAMP_KEY),log("Cache cleared"),triggerEvent(Events.CLEAR_CACHE,{}),"Cache cleared"}function isValidHttpUrl($e){let De;try{De=new URL($e)}catch{return!1}return De.protocol==="http:"||De.protocol==="https:"}function decodeItemSrc($e,De){if(isValidHttpUrl($e))return{itemSrc:$e};const[Fe,Be,He]=$e.split(":");return{sku:`${Fe}:${Be}`,purchaseOption:De||He}}function removeTrailingSlash($e){return $e.endsWith("/")?$e.slice(0,-1):$e}function compareUrlWithoutHash($e,De){if(!isValidHttpUrl($e)||!isValidHttpUrl(De))return!1;const Fe=new URL($e),Be=new URL(De);return Fe.origin===Be.origin&&removeTrailingSlash(Fe.pathname)===removeTrailingSlash(Be.pathname)}function generateCheckoutLink($e,De,Fe){const Be=new URL(`${getBaseUrl("checkout3",$e.environment)}`);if(De.language&&Be.searchParams.set("lang",De.language),De.sku)Be.searchParams.set("sku",De.sku),De.purchaseOptionId&&Be.searchParams.set("po-id",De.purchaseOptionId);else if(De.itemSrc){const{sku:We,purchaseOption:Ze,itemSrc:Xe}=decodeItemSrc(De.itemSrc,De.purchaseOptionId);Xe&&Be.searchParams.set("url",Xe),We&&Be.searchParams.set("sku",We),Ze&&Be.searchParams.set("po-id",Ze)}De.email&&Be.searchParams.set("email",De.email),De.business&&Be.searchParams.set("business","true"),De.currency&&Be.searchParams.set("currency",De.currency),De.price&&Be.searchParams.set("price",De.price.toString()),De.discountCode&&Be.searchParams.set("discount-code",De.discountCode),De.attributionItemSrc?Be.searchParams.set("itemSrc",De.attributionItemSrc):Fe.itemSrc&&Be.searchParams.set("itemSrc",Fe.itemSrc),De.attributionPublisherContentId?Be.searchParams.set("publisherContentId",De.attributionPublisherContentId):Fe.publisherContentId&&Be.searchParams.set("publisherContentId",Fe.publisherContentId),De.utmSource?Be.searchParams.set("utm_source",De.utmSource):Fe.utmSource&&Be.searchParams.set("utm_source",Fe.utmSource),De.utmMedium?Be.searchParams.set("utm_medium",De.utmMedium):Fe.utmMedium&&Be.searchParams.set("utm_medium",Fe.utmMedium),De.utmCampaign?Be.searchParams.set("utm_campaign",De.utmCampaign):Fe.utmCampaign&&Be.searchParams.set("utm_campaign",Fe.utmCampaign),De.utmTerm?Be.searchParams.set("utm_term",De.utmTerm):Fe.utmTerm&&Be.searchParams.set("utm_term",Fe.utmTerm),De.utmContent?Be.searchParams.set("utm_content",De.utmContent):Fe.utmContent&&Be.searchParams.set("utm_content",Fe.utmContent);const He=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(We=>{const[Ze,Xe]=We.trim().split("=");return{key:Ze,value:Xe}}).filter(We=>He.some(Ze=>Ze===We.key)).forEach(We=>{Be.searchParams.append(We.key,We.value)});const Ge=new URL(De.redirectUrl||window.location.href);return Ge.searchParams.set("force-refetch-entitlements","true"),De.itemSrc&&Ge.searchParams.set("sesamy-purchase",De.itemSrc),Be.searchParams.set("redirect-url",Ge.toString()),De.paymentMethodsFilter&&Be.searchParams.set("paymentmethods-filter",De.paymentMethodsFilter.flatMap(({provider:We,methods:Ze})=>Ze?Ze.map(Xe=>`${We}|${Xe}`):We).join(",")),Be}const SIGNED_URL_KEY="sesamySignedURLs";function getSignedLinks(){const $e=sessionStorage.getItem(SIGNED_URL_KEY);return $e?JSON.parse($e):[]}function addSignedLink($e){const De=getSignedLinks();De.push($e),log(`Adding signed URL: ${$e}`),sessionStorage.setItem(SIGNED_URL_KEY,JSON.stringify(De))}function removeUndefinedValues($e){const De={};return Object.keys($e).forEach(Fe=>{const Be=$e[Fe];Be!=null&&(De[Fe]=Be.toString())}),De}const ATTRIBUTION_KEY="sesamyAttribution";function parseFromLocalStorage($e){const De=localStorage.getItem($e);if(!De)return null;try{return JSON.parse(De).value}catch{return console.error(`Failed to parse ${$e}`),null}}function resetUtmTags($e){return Object.keys($e).find(De=>De.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...$e}:$e}function getAttribution(){return parseFromLocalStorage(ATTRIBUTION_KEY)||{}}function setAttribution($e){if($e===null)localStorage.removeItem(ATTRIBUTION_KEY);else{log(`Setting attribution ${JSON.stringify($e)}`);const De=getAttribution()??{},Fe=removeUndefinedValues({...De,...resetUtmTags($e)});localStorage.setItem(ATTRIBUTION_KEY,JSON.stringify({value:Fe}))}}function createApi($e){const De=getBaseUrl("api2",$e.environment),Fe=ot=>async(dt,$t)=>{let Ct=sessionStorage.getItem(CACHE_TIMESTAMP_KEY);Ct||(Ct=Date.now().toString(),sessionStorage.setItem(CACHE_TIMESTAMP_KEY,Ct));const At={...$t,headers:{...$t.headers,"Cache-Timestamp":Ct}};return ot(dt,At)},Be=(ot=!0)=>dt=>async($t,Ct)=>{let At=null;if(At=await getTokenSilently(ot),!At){if(ot)throw new Error("No access token available");return dt($t,Ct)}const Mt={...Ct,headers:{...Ct.headers,...At?{Authorization:`Bearer ${At}`}:{}}};return dt($t,Mt)},He=ot=>(dt,$t)=>{if($t.headers.Authorization)return ot(dt,$t);const Ct=localStorage.getItem("__anon_id"),At=btoa(`${$e.clientId}|${Ct}:`),Mt={...$t,headers:{...$t.headers,Authorization:`Basic ${At}`}};return ot(dt,Mt)},Ke=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(),dedupe(),retry({delayTimer:1e3,delayRamp:(ot,dt)=>ot*dt,maxAttempts:3,until:ot=>!!(ot&&(ot.ok||ot.status>=400&&ot.status<500)),retryOnNetworkError:!1})]),Ge=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(!1),He,dedupe(),retry({delayTimer:1e3,delayRamp:(ot,dt)=>ot*dt,maxAttempts:3,until:ot=>!!(ot&&(ot.ok||ot.status>=400&&ot.status<500)),retryOnNetworkError:!1})]);async function We(ot={}){const{waitForEntitlementAfter:dt,includeSignedLinks:$t=!0}=ot,Ct=dt?`?wait-for-entitlement-after=${dt.toISOString()}`:"",At=await isAuthenticated()?await Ke.get(`/entitlements${Ct}`).json():[];return $t&&At.push(...getSignedLinks()),At}async function Ze(ot,dt=[]){const $t=await We();return $t==null?void 0:$t.find(At=>{const{sku:Mt,purchaseOption:Ht}=decodeItemSrc(ot);let Gt="sku"in At&&Mt===At.sku;Gt&&Ht&&"purchaseOptionId"in At&&(Gt=Ht===At.purchaseOptionId);const rr=compareUrlWithoutHash(ot,At.url),nr=dt.some(ar=>compareUrlWithoutHash(ar,At.url));return Gt||rr||nr})}async function Xe(ot){const dt=await Ke.get("/entitlements").json();return dt==null?void 0:dt.find($t=>$t.id===ot)}async function Je(ot){return Ke.get(`/entitlements/${encodeURIComponent(ot)}/access`).json()}async function Ye(ot,dt,$t){const Ct=new URL(getBaseUrl("api2",$e.environment));return Ct.pathname="/proxy",Ct.searchParams.set("url",dt),$t&&Ct.searchParams.set("selector",$t),factory(Ct.toString()).headers({Authorization:`Bearer ${ot}`}).get().text()}async function Qe(ot){if(!ot)throw new Error("SKU is required to get fulfillments");return await isAuthenticated()?await Ke.get(`/fulfillments?sku=${encodeURIComponent(ot)}`).json():[]}async function et(ot,dt){if(!ot||!dt)throw new Error("SKU and itemId are required to request delivery");return(await Ke.post({sku:ot},`/fulfillments/${encodeURIComponent(dt)}/request-delivery?`).res()).ok}async function tt(){return Ke.get("/contracts").json()}async function ct(ot){const dt=await Ke.get("/contracts").json();return dt==null?void 0:dt.find($t=>$t.id===ot)}async function at(ot){const dt=await Ke.post({},`/contracts/${encodeURIComponent(ot)}/cancel`).res();return clearCache(),dt.ok}async function ft(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),Ke.get("/subscriptions").json()}async function ut(){return Ke.get("/bills").json()}async function it(ot){const dt=await Ke.get("/bills").json();return dt==null?void 0:dt.find($t=>$t.id===ot)}async function rt(){return Ke.get("/transactions").json()}async function lt(ot){const dt=await Ke.get("/transactions").json();return dt==null?void 0:dt.find($t=>$t.id===ot)}async function pt(ot,dt){const $t=await Ke.url(`/user-metadata/${encodeURIComponent(ot)}`).put(dt).json();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),$t}async function gt(ot){const dt=await Ke.url(`/user-metadata/${encodeURIComponent(ot)}`).delete().res();return clearCache(),dt.ok}async function vt(ot){return(await Ke.url(`/user-metadata/${encodeURIComponent(ot)}`).get().json())[ot]}async function Et(){return await Ke.url("/user-metadata").get().json()}async function Pt(){return await Ke.url("/tags").get().json()}async function Nt(ot){const dt=await Ke.url(`/tags/${encodeURIComponent(ot)}`).delete().res();return clearCache(),dt.ok}async function yt(ot){const dt=await Ke.url("/tags").post(encodeURIComponent(ot)).res();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),dt.ok}async function It(ot){return(await Ge.url("/tallies").get().json())[ot]}async function Rt(){return await Ge.url("/tallies").get().json()}async function mt(ot){const dt=await Ge.url(`/tallies/${ot}`).delete().res();return clearCache(),dt.ok}async function kt(ot,dt){return await Ge.url(`/tallies/${encodeURIComponent(ot)}/push`).post(dt).json()}async function Ut(ot){return await Ke.url(`/products/${encodeURIComponent(ot)}`).get().json()}async function xt(){return await getTokenSilently(!1)?await Ke.url("/profile").get().json():null}async function nt(ot){const dt=await Ke.url("/profile").patch(ot).res();return clearCache(),dt.ok}async function st(){return await Ke.url("/payment-issues").get().json()}async function ht(){return(await Ke.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function St(){return(await Ke.url("/profile/unlink-spotify").post().res()).ok}async function bt(ot){const dt=await getTokenSilently(!1);if(!dt)throw new Error("No access token available");const $t=new URL(`${getBaseUrl("access-sync",$e.environment)}/spotify/sesamy-callback`);$t.searchParams.set("access_token",dt),$t.searchParams.set("state",ot),window.location.href=$t.toString()}async function wt(ot){const dt=await Ke.url(`/products/${encodeURIComponent(ot)}/auto-onboard`).post().json();return dt.length&&clearCache(),dt}async function Lt(ot,dt=3600){const{shortlink:$t}=await factory(SHORTLINK_URL).post({url:ot,ttl:dt}).json();return $t}async function Tt(ot){const dt=await getTokenSilently(!1,!0);let $t;const Ct=ot.language||getLanguage(),At=getAttribution();switch(ot.target){case"account":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(ot.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}${ot.contractId?`/${encodeURIComponent(ot.contractId)}`:""}`),$t.searchParams.set("sesamy-redirect-url",ot.redirectUrl||window.location.href);break;case"change-payment":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(ot.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(ot.contractId)}/change-payment-method`),$t.searchParams.set("sesamy-redirect-url",ot.redirectUrl||window.location.href);break;case"change-plan":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(ot.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(ot.contractId)}/edit-plan`),$t.searchParams.set("sesamy-redirect-url",ot.redirectUrl||window.location.href);break;case"consume":$t=new URL(`${getBaseUrl("consume",$e.environment)}/${encodeURIComponent(ot.language||Ct)}/@${encodeURIComponent($e.clientId)}/${encodeURIComponent(ot.sku)}`),ot.episodeId?$t.href+=`/${ot.episodeId}`:$t.href+="/listen",$t.searchParams.set("sesamy-redirect-url",ot.redirectUrl||window.location.href);break;case"checkout":$t=generateCheckoutLink($e,{language:Ct,...ot},At);break;default:throw new Error("Invalid target")}return dt&&($t.hash=`#access_token=${dt}`),ot.shorten?Lt($t.href,ot.ttl):$t.href}async function _t(ot){const dt=getAttribution(),$t=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(At=>{const Mt=dt,[Ht,Gt]=At.trim().split("=");$t.includes(Ht)&&!Mt[Ht]&&(Mt[Ht]=Gt)}),(await Ge.url("/checkouts").post({language:getLanguage(),...ot,attribution:{...dt,...ot.attribution},vendorId:$e.clientId})).json()}async function Ot(ot,dt){return(await Ge.url(`/checkouts/${ot}`).patch(dt)).json()}async function jt(ot){return(await Ge.url(`/checkouts/${ot}`).get()).json()}async function Ft(ot){return(await Ge.url(`/paywalls/${ot}`).get()).json()}async function Bt(){return(await Ge.url("/vendor").get()).json()}async function Vt(){return(await Ke.url("/vendors").get()).json()}async function Kt(ot){return(await Ke.url(`/contracts/${encodeURIComponent(ot.contractId)}/amendments`).post({amendmentType:ot.amendmentType,discountCode:ot.discountCode})).json()}async function zt(ot){return await Ke.url(`/amendments/${encodeURIComponent(ot)}/confirm`).post(),!0}async function tr(){const ot=await getTokenSilently(!1),dt=new URL(`${getBaseUrl("account",$e.environment)}/subscriptions/${$e.clientId}`);ot&&(dt.hash=`#access_token=${ot}`),window.location.href=dt.toString()}return{autoOnboardProduct:wt,cancelContract:at,confirmAmendment:zt,createAmendment:Kt,createCheckout:_t,deleteTag:Nt,deleteTally:mt,deleteUserMetadata:gt,generateLink:Tt,getBill:it,getBills:ut,getCheckout:jt,getProxyContent:Ye,getContract:ct,getContracts:tt,getEntitlement:Xe,getEntitlementAccess:Je,getEntitlements:We,getFulfillments:Qe,requestDelivery:et,getPaywall:Ft,getPaymentIssues:st,getProfile:xt,getProduct:Ut,getSubscriptions:ft,getTally:It,getTallies:Rt,getTags:Pt,getTransaction:lt,getTransactions:rt,getUserMetadata:vt,hasAccess:Ze,isSpotifyLinked:ht,linkSpotify:bt,listUserMetadata:Et,openHostedAccountPage:tr,pushTally:kt,setTag:yt,setUserMetadata:pt,unlinkSpotify:St,updateCheckout:Ot,updateProfile:nt,getVendorSettings:Bt,listVendors:Vt}}const bannerIds=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function detectAdblock(){return new Promise($e=>{const De=bannerIds.map(Fe=>{const Be=document.createElement("div");return Be.innerHTML=" ",Be.id=Fe,Be.style.position="absolute",document.body.appendChild(Be),Be});window.setTimeout(()=>{const Fe=!De.every(Be=>{const He=document.querySelector(`#${Be.id}`);return He==null?void 0:He.offsetParent});De.forEach(Be=>Be.remove()),$e(Fe)},100)})}function isInAppBrowser(){const $e=navigator.userAgent.toLowerCase(),De=[{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 Fe of De)if(Fe.regex.test($e))return{isInAppBrowser:!0,browserName:Fe.name};return/; wv\)/.test($e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}const STORAGE_KEY="sesamyFlags";async function saveFlags($e){try{localStorage.setItem(STORAGE_KEY,JSON.stringify($e))}catch{log("Failed to save flags to localStorage")}}async function setFlag($e,De){const Fe=await listFlags();Fe[$e]=De,await saveFlags(Fe)}async function getFlag($e){return(await listFlags())[$e]}async function deleteFlag($e){const De=await listFlags();$e in De&&(delete De[$e],await saveFlags(De))}async function listFlags(){try{const $e=localStorage.getItem(STORAGE_KEY);return $e?JSON.parse($e):{}}catch{return{}}}function registerAPI($e){const{autoOnboardProduct:De,cancelContract:Fe,createCheckout:Be,deleteTag:He,deleteTally:Ke,deleteUserMetadata:Ge,generateLink:We,getBill:Ze,getBills:Xe,getCheckout:Je,getContract:Ye,getContracts:Qe,getEntitlement:et,getEntitlementAccess:tt,getEntitlements:ct,getFulfillments:at,getPaywall:ft,getPaymentIssues:ut,getProfile:it,getProduct:rt,getProxyContent:lt,getSubscriptions:pt,getTags:gt,getTally:vt,getTallies:Et,getTransaction:Pt,getTransactions:Nt,getUserMetadata:yt,getVendorSettings:It,listVendors:Rt,hasAccess:mt,isSpotifyLinked:kt,linkSpotify:Ut,listUserMetadata:xt,openHostedAccountPage:nt,pushTally:st,requestDelivery:ht,setTag:St,setUserMetadata:bt,unlinkSpotify:wt,updateCheckout:Lt,updateProfile:Tt}=createApi($e),_t={analytics:{track},attribution:{get:getAttribution,set:setAttribution},auth:{getUser:it,getTokenSilently,isAuthenticated,loginWithRedirect,loginWithPopup,login,logout,setToken},bills:{get:Ze,list:Xe},browser:{detectAdblock,isInAppBrowser,isIncognito},checkouts:{create:Be,get:Je,update:Lt},clearCache,content:{list:listContent,get:getContent$1,getLanguage,unlock:unlockContent,getPropertyFromHTML},contracts:{cancel:Fe,get:Ye,list:Qe},entitlements:{access:tt,get:et,hasAccess:mt,list:ct,signedLinks:getSignedLinks},events:{emit:emitEvent,cancel:cancelEvent},flags:{get:getFlag,set:setFlag,list:listFlags,delete:deleteFlag},fulfillments:{list:at,requestDelivery:ht},generateLink:We,getPaymentIssues:ut,getVersion,isReady:()=>exports.isInitialized,log,paywalls:{get:ft},products:{autoOnboard:De,get:rt,linkSpotify:Ut},profile:{get:it,isSpotifyLinked:kt,openHostedAccountPage:nt,unlinkSpotify:wt,update:Tt},proxy:{getContent:lt},subscriptions:{list:pt},tags:{delete:He,list:gt,set:St},tallies:{delete:Ke,get:vt,list:Et,push:st},transactions:{get:Pt,list:Nt},userMetadata:{delete:Ge,get:yt,list:xt,set:bt},vendors:{get:It,list:Rt},setToken};return $e.namespace&&(window[$e.namespace]=_t),_t}function getVersion(){return version}function gradient($e,De){$e.style.position="relative",$e.style.height="200px",$e.style.overflow="hidden";let Be=0;const He=Array.from($e.children);for(const Ge of He){const We=Ge.offsetHeight;Be+We>200?Ge.remove():Be+=We}const Ke=document.createElement("style");Ke.innerHTML=`
|
|
37
|
-
${
|
|
34
|
+
**/var jo={d:(e,r)=>{for(var t in r)jo.o(r,t)&&!jo.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},us={};jo.d(us,{A:()=>lm,k:()=>cs});var xt=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function o(l){try{c(n.next(l))}catch(u){i(u)}}function s(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){var u;l.done?a(l.value):(u=l.value,u instanceof t?u:new t(function(f){f(u)})).then(o,s)}c((n=n.apply(e,[])).next())})},Nt=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(c){return function(l){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(t=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||u[0]!==6&&u[0]!==2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=r.call(e,o)}catch(f){u=[6,f],n=0}finally{t=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([c,l])}}};function cs(){return xt(this,void 0,Promise,function(){return Nt(this,function(e){switch(e.label){case 0:return[4,new Promise(function(r,t){var n="Unknown",a=!1;function i(h){a||(a=!0,r({isPrivate:h,browserName:n}))}function o(){var h=0,d=parseInt("-1");try{d.toFixed(d)}catch(v){h=v.message.length}return h}function s(){return navigator.msSaveBlob!==void 0&&function(h){try{return h===eval.toString().length}catch{return!1}}(39)}function c(){var h;return xt(this,void 0,void 0,function(){var d,v;return Nt(this,function(m){switch(m.label){case 0:return m.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return m.sent(),i(!1),[3,3];case 2:return d=m.sent(),v=d,d instanceof Error&&(v=(h=d.message)!==null&&h!==void 0?h:d),typeof v!="string"?(i(!1),[2]):(i(!!v.includes("unknown transient reason")),[3,3]);case 3:return[2]}})})}function l(){var h;return xt(this,void 0,Promise,function(){return Nt(this,function(d){switch(d.label){case 0:return((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)===void 0?[3,2]:[4,c()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?function(){var v=String(Math.random());try{var m=indexedDB.open(v,1);m.onupgradeneeded=function(w){var E=w.target.result,b=function(g){i(g)};try{E.createObjectStore("t",{autoIncrement:!0}).put(new Blob),b(!1)}catch(g){(g.message||"").includes("are not yet supported")?b(!0):b(!1)}finally{E.close(),indexedDB.deleteDatabase(v)}},m.onerror=function(){return i(!1)}}catch{i(!1)}}():function(){var v=window.openDatabase,m=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{m.setItem("test","1"),m.removeItem("test")}catch{return void i(!0)}i(!1)}(),d.label=3;case 3:return[2]}})})}function u(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v;i(Math.round(d/1048576)<2*Math.round(((v=window).performance!==void 0&&v.performance.memory!==void 0&&v.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(h){t(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function f(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?u():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}(function(){return xt(this,void 0,Promise,function(){return Nt(this,function(h){switch(h.label){case 0:return o()!==44?[3,2]:(n="Safari",[4,l()]);case 1:return h.sent(),[3,3];case 2:o()===51?(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",f()):o()===25?(n="Firefox",i(navigator.serviceWorker===void 0)):s()?(n="Internet Explorer",i(window.indexedDB===void 0)):t(new Error("detectIncognito cannot determine the browser")),h.label=3;case 3:return[2]}var d})})})().catch(t)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=cs);const lm=cs;us.A;const fm=us.k,Wt="sesamy_incognito_mode";function ls(){try{const e=sessionStorage.getItem(Wt);return e===null?void 0:e==="true"}catch{return}}async function dm(){try{const e=sessionStorage.getItem(Wt);if(e!==null)return e==="true";const{isPrivate:r}=await fm();return sessionStorage.setItem(Wt,r.toString()),r}catch{try{sessionStorage.setItem(Wt,"false")}catch{}return!1}}function Et(){return typeof window<"u"}function Af(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 Dt="undefined",jf="object",Uo=function(){},Eh="any",Rh="*",Dr="__",Xt=typeof process<"u"?process:{};Xt.env&&Xt.env.NODE_ENV;var Le=typeof document<"u";Xt.versions!=null&&Xt.versions.node!=null;typeof Deno<"u"&&Deno.core;Le&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function _h(e,r){return r.charAt(0)[e]()+r.slice(1)}var hm=_h.bind(null,"toUpperCase"),vm=_h.bind(null,"toLowerCase");function pm(e){return Th(e)?hm("null"):typeof e=="object"?wm(e):Object.prototype.toString.call(e).slice(8,-1)}function Qt(e,r){r===void 0&&(r=!0);var t=pm(e);return r?vm(t):t}function Lt(e,r){return typeof r===e}var Ke=Lt.bind(null,"function"),Or=Lt.bind(null,"string"),Yr=Lt.bind(null,"undefined"),mm=Lt.bind(null,"boolean");Lt.bind(null,"symbol");function Th(e){return e===null}function gm(e){return Qt(e)==="number"&&!isNaN(e)}function Oh(e){return Qt(e)==="array"}function Ge(e){if(!ym(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function ym(e){return e&&(typeof e=="object"||e!==null)}function wm(e){return Ke(e.constructor)?e.constructor.name:null}function bm(e){return e instanceof Error||Or(e.message)&&e.constructor&&gm(e.constructor.stackTraceLimit)}function kh(e,r){if(typeof r!="object"||Th(r))return!1;if(r instanceof e)return!0;var t=Qt(new e(""));if(bm(r))for(;r;){if(Qt(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}kh.bind(null,TypeError);kh.bind(null,SyntaxError);function gn(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?Sm(e,r):t}function Sm(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function yn(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}yn(gn,"form");yn(gn,"button");yn(gn,"input");yn(gn,"select");function Im(e){return e?Oh(e)?e:[e]:[]}function Uf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Pm(){if(Le){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Em(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Rm(e){return function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=Uf(t[1]),o=Uf(t[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var c=s.split("[");c.length>1&&(_m(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(r){return Le&&window.location.search.substring(1)}())}function _m(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 wn(){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 Tm(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 c=new Date;o||(o=c);var l=r-(c-o);return t=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=c,a=e.apply(t,n)):i||(i=setTimeout(s,l)),a}}var bt="global",nt=Dr+"global"+Dr,at=typeof self===jf&&self.self===self&&self||typeof global===jf&&global.global===global&&global||void 0;function $r(e){return at[nt][e]}function Mr(e,r){return at[nt][e]=r}function ht(e){delete at[nt][e]}function vt(e,r,t){var n;try{if(fs(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}at[nt]||(at[nt]={});var $t={};function fs(e){if(typeof $t[e]!==Dt)return $t[e];try{var r=window[e];r.setItem(Dt,Dt),r.removeItem(Dt)}catch{return $t[e]=!1}return $t[e]=!0}function ne(){return ne=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ne.apply(this,arguments)}var Tr="function",Sr="undefined",Om="@@redux/"+Math.random().toString(36),Lf=function(){return typeof Symbol===Tr&&Symbol.observable||"@@observable"}(),Mt=" != "+Tr;function Ch(e,r,t){var n;if(typeof r===Tr&&typeof t===Sr&&(t=r,r=void 0),typeof t!==Sr){if(typeof t!==Tr)throw new Error("enhancer"+Mt);return t(Ch)(e,r)}if(typeof e!==Tr)throw new Error("reducer"+Mt);var a=e,i=r,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){return i}function f(d){if(typeof d!==Tr)throw new Error("Listener"+Mt);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var m=s.indexOf(d);s.splice(m,1)}}}function h(d){if(!Ge(d))throw new Error("Act != obj");if(typeof d.type===Sr)throw new Error("ActType "+Sr);if(c)throw new Error("Dispatch in reducer");try{c=!0,i=a(i,d)}finally{c=!1}for(var v=o=s,m=0;m<v.length;m++)(0,v[m])();return d}return h({type:"@@redux/INIT"}),(n={dispatch:h,subscribe:f,getState:u,replaceReducer:function(d){if(typeof d!==Tr)throw new Error("next reducer"+Mt);a=d,h({type:"@@redux/INIT"})}})[Lf]=function(){var d,v=f;return(d={subscribe:function(m){if(typeof m!="object")throw new TypeError("Observer != obj");function w(){m.next&&m.next(u())}return w(),{unsubscribe:v(w)}}})[Lf]=function(){return this},d},n}function km(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+"reducer "+e+" returns "+Sr}function it(){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 Cm(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,c={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(e).map(function(l){return l(c)}),ne({},o,{dispatch:s=it.apply(void 0,i)(o.dispatch)})}}}var kr=Dr+"anon_id",xr=Dr+"user_id",Qr=Dr+"user_traits",_r="userId",Xr="anonymousId",Vt=["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"],Lo=["name","EVENTS","config","loaded"],te=Vt.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),qf=/^utm_/,xf=/^an_prop_/,Nf=/^an_trait_/;function Am(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===te.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,c=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(kr,o.anonymousId),l||r(xr,o.userId),c.traits&&r(Qr,ne({},l&&s.traits?s.traits:{},c.traits));var u=Object.keys(a.params);if(u.length){var f=i.an_uid,h=i.an_event,d=u.reduce(function(v,m){if(m.match(qf)||m.match(/^(d|g)clid/)){var w=m.replace(qf,"");v.campaign[w==="campaign"?"name":w]=i[m]}return m.match(xf)&&(v.props[m.replace(xf,"")]=i[m]),m.match(Nf)&&(v.traits[m.replace(Nf,"")]=i[m]),v},{campaign:{},props:{},traits:{}});t.dispatch(ne({type:te.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),h&&setTimeout(function(){return e.track(h,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:te.campaign,campaign:d.campaign})}}return n(a)}}}}function jm(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===te.setItemEnd){if(t.key===kr)return ne({},r,{anonymousId:t.value});if(t.key===xr)return ne({},r,{userId:t.value})}switch(t.type){case te.identify:return Object.assign({},r,{userId:t.userId,traits:ne({},r.traits,t.traits)});case te.reset:return[xr,kr,Qr].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function Df(e){return{userId:e.getItem(xr),anonymousId:e.getItem(kr),traits:e.getItem(Qr)}}var qo=function(e){return Dr+"TEMP"+Dr+e};function Um(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var c=s.userId,l=s.traits,u=s.options;if(s.type===te.reset&&([xr,Qr,kr].forEach(function(d){n(d)}),[_r,Xr,"traits"].forEach(function(d){ht(qo(d))})),s.type===te.identify){a(kr)||t(kr,wn());var f=a(xr),h=a(Qr)||{};f&&f!==c&&i.dispatch({type:te.userIdChanged,old:{userId:f,traits:h},new:{userId:c,traits:l},options:u}),c&&t(xr,c),l&&t(Qr,ne({},h,l))}return o(s)}}}}var wt={};function $f(e,r){wt[e]&&Ke(wt[e])&&(wt[e](r),delete wt[e])}function Ah(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(ne({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Ah(e,r,t-10).then(n,a)})})}function Lm(e){return{abort:e}}function jh(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,c=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,m=a[d][v];if(m&&Ke(m)){var w,E=function(p,y){return p===void 0&&(p={}),y===void 0&&(y={}),[_r,Xr].reduce(function(k,A){return p.hasOwnProperty(A)&&y[A]&&y[A]!==p[A]&&(k[A]=y[A]),k},p)}(h.payload,c),b=n[E.meta.rid];if(!b&&(w=m({payload:E,config:o[d].config,instance:t,abort:Lm}))&&Ge(w)&&w.abort)return void(n[E.meta.rid]=!0);if(!b){var g=v+":"+d;e.dispatch(ne({},E,{type:g,_:{called:g,from:"queueDrain"}}))}}});var u=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=u}}}var bo=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,c=e.EVENTS;try{var l=a.plugins,u=a.context,f=t.type,h=f.match(et),d=r.exact.map(function(w){return w.pluginName});h&&(d=o.during.map(function(w){return w.pluginName}));var v=function(w,E){return function(b,g,p){var y=g.config,k=g.name,A=k+"."+b.type;p&&(A=p.event);var j=b.type.match(et)?function(z,H,ee,x,N){return function(q,O){var X=x?x.name:z,re=O&&Rt(O)?O:ee;if(x&&(!(re=O&&Rt(O)?O:[z]).includes(z)||re.length!==1))throw new Error("Method "+H+" can only abort "+z+" plugin. "+JSON.stringify(re)+" input valid");return ne({},N,{abort:{reason:q,plugins:re,caller:H,_:X}})}}(k,A,E,p,b):function(z,H){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+H)}}(b,A);return{payload:qm(b),instance:w,config:y||{},abort:j}}}(n,d),m=r.exact.reduce(function(w,E){var b=E.pluginName,g=E.methodName,p=!1;return g.match(/^initialize/)||g.match(/^reset/)||(p=!l[b].loaded),u.offline&&g.match(/^(page|track|identify)/)&&(p=!0),w[""+b]=p,w},{});return Promise.resolve(r.exact.reduce(function(w,E,b){try{var g=E.pluginName;return Promise.resolve(w).then(function(p){function y(){return Promise.resolve(p)}var k=function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function(A,j,z){try{return Promise.resolve(A).then(function(H){return j.method&&Ke(j.method)?(function(q,O){var X=Kf(q);if(X&&X.name===O){var re=Kf(X.method);throw new Error([O+" plugin is calling method "+q,"Plugins cant call self","Use "+X.method+" "+(re?"or "+re.method:"")+" in "+O+" plugin insteadof "+q].join(`
|
|
35
|
+
`))}}(j.methodName,j.pluginName),Promise.resolve(j.method({payload:H,instance:n,abort:(ee=H,x=g,N=j.pluginName,function(q,O){return ne({},ee,{abort:{reason:q,plugins:O||[x],caller:f,from:N||x}})}),config:Bf(j.pluginName,l,i),plugins:l})).then(function(q){var O=Ge(q)?q:{};return Promise.resolve(ne({},H,O))})):H;var ee,x,N})}catch(H){return Promise.reject(H)}},Promise.resolve(t))).then(function(A){p[g]=A});p[g]=t}();return k&&k.then?k.then(y):y()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(w){return Promise.resolve(r.exact.reduce(function(E,b,g){try{var p=r.exact.length===g+1,y=b.pluginName,k=i[y];return Promise.resolve(E).then(function(A){var j=w[y]?w[y]:{};if(h&&(j=A),Io(j,y))return So({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve(A);if(Io(A,y))return p&&So({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(m.hasOwnProperty(y)&&m[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(w[y],i[y]);return Promise.resolve(k[f]({abort:z.abort,payload:j,instance:n,config:Bf(y,l,i),plugins:l})).then(function(H){var ee=Ge(H)?H:{},x=ne({},A,ee),N=w[y];if(Io(N,y))So({data:N,method:f,instance:n,pluginName:y,store:s});else{var q=f+":"+y;(q.match(/:/g)||[]).length<2&&!f.match(Mf)&&!f.match(Ff)&&n.dispatch(ne({},h?x:j,{type:q,_:{called:q,from:"submethod"}}))}return Promise.resolve(x)})})}catch(A){return Promise.reject(A)}},Promise.resolve(t))).then(function(E){if(!(f.match(et)||f.match(/^registerPlugin/)||f.match(Ff)||f.match(Mf)||f.match(/^params/)||f.match(/^userIdChanged/))){if(c.plugins.includes(f),E._&&E._.originalAction===f)return E;var b=ne({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Uh(E,r.exact.length)&&!f.match(/End$/)&&(b=ne({},b,{type:E.type+"Aborted"})),s.dispatch(b)}return E})})}catch(w){return Promise.reject(w)}},et=/Start$/,Mf=/^bootstrap/,Ff=/^ready/;function So(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(ne({},e.data,{type:t,_:{called:t,from:"abort"}}))}function Bf(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function zf(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function Hf(e,r){var t=e.replace(et,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function Io(e,r){var t=e.abort;return!!t&&(t===!0||Gf(t,r)||t&&Gf(t.plugins,r))}function Uh(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Or(t))return!0;var n=t.plugins;return Rt(t)&&t.length===r||Rt(n)&&n.length===r}function Rt(e){return Array.isArray(e)}function Gf(e,r){return!(!e||!Rt(e))&&e.includes(r)}function Kf(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function qm(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Ge(e[t])?Object.assign({},e[t]):e[t]),r},{})}function xm(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,c=function(p){return s?p:i(f)},l=o.type,u=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===te.enablePlugin&&a.dispatch({type:te.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),l===te.disablePlugin&&setTimeout(function(){return $f(o.meta.rid,{payload:o})},0),l===te.initializeEnd){var h=r(),d=Object.keys(h),v=d.filter(function(p){return u.includes(p)}).map(function(p){return h[p]}),m=[],w=[],E=o.disabled,b=v.map(function(p){var y=p.loaded,k=p.name,A=p.config;return Ah(p,function(){return y({config:A})},1e4).then(function(j){return n[k]||(a.dispatch({type:te.pluginReadyType(k),name:k,events:Object.keys(p).filter(function(z){return!Lo.includes(z)})}),n[k]=!0),m=m.concat(k),p}).catch(function(j){if(j instanceof Error)throw new Error(j);return w=w.concat(j.name),j})});Promise.all(b).then(function(p){var y={plugins:m,failed:w,disabled:E};setTimeout(function(){d.length===b.length+E.length&&a.dispatch(ne({},{type:te.ready},y))},0)})}var g=function(){if(l!==te.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return jh(a,r,e)},0),Promise.resolve(function(p,y,k,A,j){try{var z=Ke(y)?y():y,H=p.type,ee=H.replace(et,"");if(p._&&p._.called)return Promise.resolve(p);var x=k.getState(),N=(X=z,(re=x.plugins)===void 0&&(re={}),(Q=p.options)===void 0&&(Q={}),Object.keys(X).filter(function(S){var _=Q.plugins||{};return mm(_[S])?_[S]:_.all!==!1&&(!re[S]||re[S].enabled!==!1)}).map(function(S){return X[S]}));H===te.initializeStart&&p.fromEnable&&(N=Object.keys(x.plugins).filter(function(S){var _=x.plugins[S];return p.plugins.includes(S)&&!_.initialized}).map(function(S){return z[S]}));var q=N.map(function(S){return S.name}),O=function(S,_,D){var B=Hf(S).map(function(K){return zf(K,_)});return _.reduce(function(K,Z){var de=Z.name,ae=Hf(S,de).map(function(je){return zf(je,_)}),ue=ae[0],se=ae[1],Pe=ae[2];return ue.length&&(K.beforeNS[de]=ue),se.length&&(K.duringNS[de]=se),Pe.length&&(K.afterNS[de]=Pe),K},{before:B[0],beforeNS:{},during:B[1],duringNS:{},after:B[2],afterNS:{}})}(H,N);return Promise.resolve(bo({action:p,data:{exact:O.before,namespaced:O.beforeNS},state:x,allPlugins:z,allMatches:O,instance:k,store:A,EVENTS:j})).then(function(S){function _(){var K=function(){if(H.match(et))return Promise.resolve(bo({action:ne({},D,{type:ee+"End"}),data:{exact:O.after,namespaced:O.afterNS},state:x,allPlugins:z,allMatches:O,instance:k,store:A,EVENTS:j})).then(function(Z){Z.meta&&Z.meta.hasCallback&&$f(Z.meta.rid,{payload:Z})})}();return K&&K.then?K.then(function(){return S}):S}if(Uh(S,q.length))return S;var D,B=function(){if(H!==ee)return Promise.resolve(bo({action:ne({},S,{type:ee}),data:{exact:O.during,namespaced:O.duringNS},state:x,allPlugins:z,allMatches:O,instance:k,store:A,EVENTS:j})).then(function(K){D=K});D=S}();return B&&B.then?B.then(_):_()})}catch(S){return Promise.reject(S)}var X,re,Q}(o,r,e,a,t)).then(function(p){return s=1,i(p)})}();return Promise.resolve(g&&g.then?g.then(c):c(g))}catch(p){return Promise.reject(p)}}}}}function Nm(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===te.setItem||a===te.removeItem){if(n.abort)return t(n);a===te.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var Dm=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 it.apply(void 0,o)(n)(a)}}}}};function $m(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=Wf(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},ne({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var c=Wf(t.type,te.initialize),l=e()[c];return l&&c?(n[c]=ne({},r[c],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ne({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=ne({},r[t.name],{loaded:!0}),ne({},r,n);switch(t.type){case te.disablePlugin:return ne({},r,Vf(t.plugins,!1,r));case te.enablePlugin:return ne({},r,Vf(t.plugins,!0,r));default:return r}}}function Wf(e,r){return e.substring(r.length+1,e.length)}function Vf(e,r,t){return e.reduce(function(n,a){return n[a]=ne({},t[a],{enabled:r}),n},t)}function Lh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var Mm={last:{},history:[]};function Fm(e,r){e===void 0&&(e=Mm);var t=r.options,n=r.meta;if(r.type===te.track){var a=Lh(ne({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return ne({},e,{last:a,history:e.history.concat(a)})}return e}var Bm={actions:[]};function zm(e,r){e===void 0&&(e=Bm);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===te.identify?[r].concat(e.actions):e.actions.concat(r),ne({},e,{actions:n});case"dequeue":return[];default:return e}}var qh=/#.*$/;function Hm(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(qh,""):"")}var xh,Nh,Dh,$h,Gm=function(e){if(e===void 0&&(e={}),!Le)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,c=i.hash,l=i.search,u=function(h){var d=function(){if(Le){for(var v,m=document.getElementsByTagName("link"),w=0;v=m[w];w++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return d?d.match(/\?/)?d:d+h:window.location.href.replace(qh,"")}(l),f={title:t,url:u,path:Hm(u),hash:c,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ne({},f,e)},Km={last:{},history:[]};function Wm(e,r){e===void 0&&(e=Km);var t=r.options;if(r.type===te.page){var n=Lh(ne({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return ne({},e,{last:n,history:e.history.concat(n)})}return e}xh=function(){if(!Le)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"}(),Nh=Le?document.referrer:null,Dh=Pm(),$h=Em();var Jf={initialized:!1,sessionId:wn(),app:null,version:null,debug:!1,offline:!!Le&&!navigator.onLine,os:{name:xh},userAgent:Le?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:$h,locale:Dh,campaign:{},referrer:Nh};function Vm(e,r){e===void 0&&(e=Jf);var t=e.initialized,n=r.campaign;switch(r.type){case te.campaign:return ne({},e,{campaign:n});case te.offline:return ne({},e,{offline:!0});case te.online:return ne({},e,{offline:!1});default:return t?e:ne({},Jf,e,{initialized:!0})}}var Jm=["plugins","reducers","storage"];function Zm(e,r,t){if(Le){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function Ym(e){var r=Zm.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function Mh(){return Mr("analytics",[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return at[nt].analytics.push(o.action||o),i(o)}})}}}function Zf(e){return function(){return it(it.apply(null,arguments),Mh())}}function Po(e){return e?Oh(e)?e:[e]:[]}function Yf(e,r,t){e===void 0&&(e={});var n,a,i=wn();return r&&(wt[i]=(n=r,a=function(o){for(var s,c=o||Array.prototype.slice.call(arguments),l=0;l<c.length;l++)if(Ke(c[l])){s=c[l];break}return s}(t),function(o){a&&a(o),n(o)})),ne({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function Xm(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(S,_){if(Ke(_))return S.middlewares=S.middlewares.concat(_),S;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var D=_.EVENTS?Object.keys(_.EVENTS).map(function(Z){return _.EVENTS[Z]}):[];S.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(S.methods[_.name]=Object.keys(_.methods).reduce(function(Z,de){var ae;return Z[de]=(ae=_.methods[de],function(){for(var ue=Array.prototype.slice.call(arguments),se=new Array(ae.length),Pe=0;Pe<ue.length;Pe++)se[Pe]=ue[Pe];return se[se.length]=y,ae.apply({instance:y},se)}),Z},{}),delete _.methods);var B=Object.keys(_).concat(D),K=new Set(S.events.concat(B));if(S.events=Array.from(K),S.pluginsArray=S.pluginsArray.concat(_),S.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return S.plugins[_.name]=_,S.plugins[_.name].loaded||(S.plugins[_.name].loaded=function(){return!0}),S},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:$r,setItem:Mr,removeItem:ht},i=function(S){return function(_,D,B){return D.getState("user")[_]||(B&&Ge(B)&&B[_]?B[_]:Df(S)[_]||$r(qo(_))||null)}}(a),o=n.plugins,s=n.events.filter(function(S){return!Lo.includes(S)}).sort(),c=new Set(s.concat(Vt).filter(function(S){return!Lo.includes(S)})),l=Array.from(c).sort(),u=function(){return o},f=new Dm,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,m=function(){throw new Error("Abort disabled inListener")},w=Rm(),E=Df(a),b=ne({},E,t,w.an_uid?{userId:w.an_uid}:{},w.an_aid?{anonymousId:w.an_aid}:{});b.anonymousId||(b.anonymousId=wn());var g=ne({enable:function(S,_){return new Promise(function(D){O.dispatch({type:te.enablePlugin,plugins:Po(S),_:{originalAction:te.enablePlugin}},D,[_])})},disable:function(S,_){return new Promise(function(D){O.dispatch({type:te.disablePlugin,plugins:Po(S),_:{originalAction:te.disablePlugin}},D,[_])})}},n.methods),p=!1,y={identify:function(S,_,D,B){try{var K=Or(S)?S:null,Z=Ge(S)?S:_,de=D||{},ae=y.user();Mr(qo(_r),K);var ue=K||Z.userId||i(_r,y,Z);return Promise.resolve(new Promise(function(se){O.dispatch(ne({type:te.identifyStart,userId:ue,traits:Z||{},options:de,anonymousId:ae.anonymousId},ae.id&&ae.id!==K&&{previousId:ae.id}),se,[_,D,B])}))}catch(se){return Promise.reject(se)}},track:function(S,_,D,B){try{var K=Ge(S)?S.event:S;if(!K||!Or(K))throw new Error("EventMissing");var Z=Ge(S)?S:_||{},de=Ge(D)?D:{};return Promise.resolve(new Promise(function(ae){O.dispatch({type:te.trackStart,event:K,properties:Z,options:de,userId:i(_r,y,_),anonymousId:i(Xr,y,_)},ae,[_,D,B])}))}catch(ae){return Promise.reject(ae)}},page:function(S,_,D){try{var B=Ge(S)?S:{},K=Ge(_)?_:{};return Promise.resolve(new Promise(function(Z){O.dispatch({type:te.pageStart,properties:Gm(B),options:K,userId:i(_r,y,B),anonymousId:i(Xr,y,B)},Z,[S,_,D])}))}catch(Z){return Promise.reject(Z)}},user:function(S){if(S===_r||S==="id")return i(_r,y);if(S===Xr||S==="anonId")return i(Xr,y);var _=y.getState("user");return S?Af(_,S):_},reset:function(S){return new Promise(function(_){O.dispatch({type:te.resetStart},_,S)})},ready:function(S){return p&&S({plugins:g,instance:y}),y.on(te.ready,function(_){S(_),p=!0})},on:function(S,_){if(!S||!Ke(_))return!1;if(S===te.bootstrap)throw new Error(".on disabled for "+S);var D=/Start$|Start:/;if(S==="*"){var B=function(ae){return function(ue){return function(se){return se.type.match(D)&&_({payload:se,instance:y,plugins:o}),ue(se)}}},K=function(ae){return function(ue){return function(se){return se.type.match(D)||_({payload:se,instance:y,plugins:o}),ue(se)}}};return h(B,Ft),h(K,Bt),function(){d(B,Ft),d(K,Bt)}}var Z=S.match(D)?Ft:Bt,de=function(ae){return function(ue){return function(se){return se.type===S&&_({payload:se,instance:y,plugins:o,abort:m}),ue(se)}}};return h(de,Z),function(){return d(de,Z)}},once:function(S,_){if(!S||!Ke(_))return!1;if(S===te.bootstrap)throw new Error(".once disabled for "+S);var D=y.on(S,function(B){_({payload:B.payload,instance:y,plugins:o,abort:m}),D()});return D},getState:function(S){var _=O.getState();return S?Af(_,S):Object.assign({},_)},dispatch:function(S){var _=Or(S)?{type:S}:S;if(Vt.includes(_.type))throw new Error("reserved action "+_.type);var D=ne({},_,{_:ne({originalAction:_.type},S._||{})});O.dispatch(D)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(S,_,D){O.dispatch({type:te.setItemStart,key:S,value:_,options:D})},removeItem:function(S,_){O.dispatch({type:te.removeItemStart,key:S,options:_})}},setAnonymousId:function(S,_){y.storage.setItem(kr,S,_)},events:{core:Vt,plugins:s}},k=n.middlewares.concat([function(S){return function(_){return function(D){return D.meta||(D.meta=Yf()),_(D)}}},v(Ft),xm(y,u,{all:l,plugins:s}),Nm(a),Am(y),Um(y),v(Bt)]),A={context:Vm,user:jm(a),page:Wm,track:Fm,plugins:$m(u),queue:zm},j=it,z=it;if(Le&&e.debug){var H=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;H&&(j=H({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Mh():Ge(typeof arguments[0])?Zf():Zf().apply(null,arguments)}}var ee,x=function(S){return Object.keys(S).reduce(function(_,D){return Jm.includes(D)||(_[D]=S[D]),_},{})}(e),N=n.pluginsArray.reduce(function(S,_){var D=_.name,B=_.config,K=_.loaded,Z=n.pluginEnabled[D];return S[D]={enabled:Z,initialized:!!Z&&!_.initialize,loaded:!!K({config:B}),config:B},S},{}),q={context:x,user:b,plugins:N},O=Ch(function(S){for(var _=Object.keys(S),D={},B=0;B<_.length;B++){var K=_[B];typeof S[K]===Tr&&(D[K]=S[K])}var Z,de=Object.keys(D);try{(function(ae){Object.keys(ae).forEach(function(ue){var se=ae[ue];if(typeof se(void 0,{type:"@@redux/INIT"})===Sr||typeof se(void 0,{type:Om})===Sr)throw new Error("reducer "+ue+" "+Sr)})})(D)}catch(ae){Z=ae}return function(ae,ue){if(ae===void 0&&(ae={}),Z)throw Z;for(var se=!1,Pe={},je=0;je<de.length;je++){var Fe=de[je],Ce=ae[Fe],Ve=(0,D[Fe])(Ce,ue);if(typeof Ve===Sr){var lr=km(Fe,ue);throw new Error(lr)}Pe[Fe]=Ve,se=se||Ve!==Ce}return se?Pe:ae}}(ne({},A,r)),q,z(j(Cm.apply(void 0,k))));O.dispatch=(ee=O.dispatch,function(S,_,D){var B=ne({},S,{meta:Yf(S.meta,_,Po(D))});return ee.apply(null,[B])});var X=Object.keys(o);O.dispatch({type:te.bootstrap,plugins:X,config:x,params:w,user:b,initialUser:t,persistedUser:E});var re=X.filter(function(S){return n.pluginEnabled[S]}),Q=X.filter(function(S){return!n.pluginEnabled[S]});return O.dispatch({type:te.registerPlugins,plugins:X,enabled:n.pluginEnabled}),n.pluginsArray.map(function(S,_){var D=S.bootstrap,B=S.config,K=S.name;D&&Ke(D)&&D({instance:y,config:B,payload:S}),O.dispatch({type:te.registerPluginType(K),name:K,enabled:n.pluginEnabled[K],plugin:S}),n.pluginsArray.length===_+1&&O.dispatch({type:te.initializeStart,plugins:re,disabled:Q})}),Ym(function(S){O.dispatch({type:S?te.offline:te.online})}),function(S,_,D){setInterval(function(){return jh(S,_,D)},3e3)}(O,u,y),y}var Ft="before",Bt="after",St="cookie",Ur=zh(),Fh=bn,Qm=bn;function Bh(e){return Ur?bn(e,"",-1):ht(e)}function zh(){if(Ur!==void 0)return Ur;var e="cookiecookie";try{bn(e,e),Ur=document.cookie.indexOf(e)!==-1,Bh(e)}catch{Ur=!1}return Ur}function bn(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ur===!1&&(o?Mr(e,r):$r(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 It="localStorage",eg=fs.bind(null,"localStorage");vt("localStorage","getItem",$r);vt("localStorage","setItem",Mr);vt("localStorage","removeItem",ht);var Pt="sessionStorage",rg=fs.bind(null,"sessionStorage");vt("sessionStorage","getItem",$r);vt("sessionStorage","setItem",Mr);vt("sessionStorage","removeItem",ht);function rt(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Ge(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var tg=eg(),ng=rg(),ag=zh();function Hh(e,r){if(e){var t=ds(r),n=!ms(t),a=hs(t)?rt(localStorage.getItem(e)):void 0;if(n&&!Yr(a))return a;var i=vs(t)?rt(Fh(e)):void 0;if(n&&i)return i;var o=ps(t)?rt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=$r(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function ig(e,r,t){if(e&&!Yr(r)){var n={},a=ds(t),i=JSON.stringify(r),o=!ms(a);return hs(a)&&(n[It]=zt(It,r,rt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[It]:vs(a)&&(n[St]=zt(St,r,rt(Fh(e))),Qm(e,i),o)?n[St]:ps(a)&&(n[Pt]=zt(Pt,r,rt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Pt]:(n[bt]=zt(bt,r,$r(e)),Mr(e,r),o?n[bt]:n)}}function og(e,r){if(e){var t=ds(r),n=Hh(e,Rh),a={};return!Yr(n.localStorage)&&hs(t)&&(localStorage.removeItem(e),a[It]=n.localStorage),!Yr(n.cookie)&&vs(t)&&(Bh(e),a[St]=n.cookie),!Yr(n.sessionStorage)&&ps(t)&&(sessionStorage.removeItem(e),a[Pt]=n.sessionStorage),!Yr(n.global)&&Sn(t,bt)&&(ht(e),a[bt]=n.global),a}}function ds(e){return e?Or(e)?e:e.storage:Eh}function hs(e){return tg&&Sn(e,It)}function vs(e){return ag&&Sn(e,St)}function ps(e){return ng&&Sn(e,Pt)}function ms(e){return e===Rh||e==="all"}function Sn(e,r){return e===Eh||e===r||ms(e)}function zt(e,r,t){return{location:e,current:r,previous:t}}var sg={setItem:ig,getItem:Hh,removeItem:og};function ug(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Xf(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 Qf(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Xf(Object(t),!0).forEach(function(n){ug(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xf(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function cg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:sg};return Xm(Qf(Qf({},r),e))}function lg(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(c){return n=a.push(c),n>=i&&o(),n},size:function(){return a.length},end:function(c){c&&o(),clearInterval(t)}}}const Gh="@sesamy/sesamy-js",gs="1.37.2";function fg(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(...c){const l=c[2]?.toString()||"",u=hg(l);return a!==u&&(a=u,setTimeout(()=>e(l),0)),s.apply(t,c)}})}function dg(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function hg(e){return["#","?"].forEach(r=>e=dg(e,r)),e}function vg(){fg(()=>{br.page()})}function pg(e){if(e===void 0&&(e={}),!Le)return Uo;var r=rd(),t=xo(),n=ed(),a=Ht(n,r),i=Ht(t,r),o=[],s=[],c=[],l=n,u=a,f=i,h=Object.keys(e);if(!h.length)return Uo;var d=h.map(function(m){return Number(m)}),v=Tm(function(){var m=rd(),w=function(x,N){return N.map(function(q){return q===100?x-5:x*(q/100)})}(m,d),E=xo(),b=ed(),g=Ht(b,m),p=Ht(E,m);if(u=g>u?g:u,f=p<f?p:f,!(o.length>=d.length)){var y=l===b,k="up";y?k="initial":l<=b&&(k="down");var A=w,j=d;(k==="up"||y)&&(A=w.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function(x,N,q){var O=A[q];return c.includes(N)&&b<=O&&(c=c.filter(function(X){return X!==N}),x.singleFunction=N),k==="down"&&!o.includes(N)&&b>=O&&N>i?(s.push(N),x.callbacks=x.callbacks.concat(N),x):k==="up"&&!o.includes(N)&&b<=O&&N<=g?(x.foundFunc=[N],x):(y&&b>=O&&x.foundFunc.length===0&&(x.foundFunc=[N]),!s.includes(N)&&b>=O&&(s.push(N),x.singleFunction?c.push(N):x.singleFunction=N),x)},{foundFunc:[],singleFunction:null,callbacks:[],direction:k});if(l=b,k==="down"&&z.callbacks&&z.callbacks.forEach(function(x){Ke(e[x])&&(e[x]({trigger:x,direction:k,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(x))}),z.singleFunction){var H=z.singleFunction,ee=z.direction;Ke(e[H])&&e[H]({trigger:H,direction:ee,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(H)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function xo(){return Le?document.body.scrollTop||document.documentElement.scrollTop:0}function mg(){return Le?window.innerHeight||document.documentElement.clientHeight:0}function ed(){return Math.round(xo()+mg())}function rd(){if(!Le)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Ht(e,r){return Math.round(e/r*100)}var td="EventListener";function gg(e){return function(r,t,n,a){var i=n||Uo,o=a||!1;if(!Le)return i;var s=en(t),c=en(r,!0);if(!c.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var l=[];return function u(f){f&&(l=[]);for(var h=f?"add"+td:"remove"+td,d=0;d<c.length;d++){var v=c[d];l[d]=f?o&&o.once?yg(i):i:l[d]||i;for(var m=0;m<s.length;m++)v[h]?v["on"+s[m]]=f?l[d]:null:v[h](s[m],l[d],o)}return u.bind(null,!f)}(e)}}function en(e,r){if(Or(e))return r?en(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=Im(e);return r?i.map(function(o){return Or(o)?en(o,!0):o}).flat():i}function yg(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var Eo=gg("Event");function Kh(e,r){return Le&&Ke(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Ke(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}Kh.bind(null,"onerror");Kh.bind(null,"onload");var Wh=typeof window>"u",nd="hidden";function wg(e){if(Wh)return!1;var r=bg(),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 bg(){var e=["webkit","moz","ms","o"];return Wh||nd in document?nd:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var Sg=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ig(e,r){r===void 0&&(r={});var t=function(o,s){var c=this,l=!1;return function(u){l||(o.call(c,u),l=!0,setTimeout(function(){return l=!1},s))}}(e,r.throttle||1e4),n=[];function a(){var o=wg(function(s){s||t({type:"tabVisible"})});return n=[o].concat(Sg.map(function(s){return Eo(document,s,t)})).concat(Eo(window,"load",t)).concat(Eo(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Pg(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,c=e.throttle,l=c===void 0?2e3:c,u=!1,f=!1,h=new Date,d=function(){return clearTimeout(r)};function v(w){d(),i&&!u&&i(yt(h),w),a&&u&&(u=!1,a(yt(t),w),h=new Date),r=setTimeout(function(){u=!0,n&&(t=new Date,n(yt(h),w))},s)}var m=Ig(v,{throttle:l});return{disable:function(){f=!0,u=!1,d();var w=m();return function(){return f=!1,h=new Date,v({type:"load"}),w()}},getStatus:function(){return{isIdle:u,isDisabled:f,active:u?0:yt(h,f),idle:u?yt(t,f):0}}}}function yt(e,r){return r?0:Math.round((new Date-e)/1e3)}const ad=5e3;class Eg{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),Pg({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:ad}),pg({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*ad: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())}}const id="sesamy_session_id";function Rg(){let e=sessionStorage.getItem(id);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(id,e)),e}function Vh(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),c=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${c})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return t(e)}let Ze={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"}},Jt;function _g(e,r){Ze={...Ze,...e.content?.article},Jt=r}function Tg(e,r){const{selector:t}=r;return t===Ze.article.selector?e:e.querySelector(t)}function Jh(e,r){if(e)return r.attribute?r.attribute==="textContent"?e.textContent??void 0:e.getAttribute(r.attribute)??Jh(e.parentElement,r):e.textContent??void 0}function tt(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 Zh({publisherContentId:e,key:r,defaultValue:t=""}){return(e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null)?.getAttribute(r)||tt(`sesamy:${r}`)||tt(`og:${r}`)||tt(r)||t}function Og(){const e=document.querySelectorAll(Ze.article.selector);return Array.from(e).map(ys).filter(r=>r!==null)}function ys(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Vh(r)},n=(a,i,o,s)=>{const c=Tg(r,i);if(c){const l=Jh(c,i)||Zh({publisherContentId:o,key:a});l!==void 0&&(t[a]=s?s(l):l)}};return n("id",Ze.id),n("title",Ze.title,t.id),n("excerpt",Ze.excerpt,t.id),n("image",Ze.image,t.id),n("price",Ze.price,t.id,a=>parseFloat(a)),n("currency",Ze.currency,t.id),n("url",Ze.url,t.id),n("pass",Ze.pass,t.id),n("accessLevel",Ze.accessLevel,t.id,a=>a||"entitlement"),t}async function kg(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=ys(t);if(!n?.url)throw new Error("Could not find content for element");const a=await Jt.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Jt.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=r||Vh(t.parentElement||t);return Jt.proxy.getContent(i.token,n.url,o)}function Yh(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}let Xh=!1,No,od,rn;const Qh=new Map;function Cg({clientId:e,enabled:r=!0,environment:t}){No=e,od=r,rn=`${vr("logs",t)}/events`,od&&(window.addEventListener("beforeunload",()=>{tv.forEach((n,a)=>{n.bind(a)()}),Ag()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Qh.forEach((n,a)=>{n.bind(a)()})}),vg(),Yh(()=>{const n=new Eg({element:document.body,viewCallback:()=>{br.page()},activeDurationCallback:(a,i,o)=>{br.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{br.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{br.track("scroll",{scroll:a.scrollMax})}});jg(document.body,()=>{n.flush()}),Ug(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(We.AUTHENTICATED,async n=>{const a=n;await br.identify(a.detail.sub)}),window.addEventListener(We.LOGOUT,async()=>{await br.track("logout",{}),ws.flush(),await br.reset()}))}function ev(e){return JSON.stringify(e.map(r=>({...r,clientId:No,requestId:Math.random().toString(36).slice(2,9),sessionId:Rg(),timestamp:new Date().toISOString(),version:gs,event:r.event,context:{page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:tt("sesamy:item-src"),publisherContentId:tt("sesamy:publisher-content-id")},locale:navigator.language,library:Gh,userAgent:navigator.userAgent,clientId:No}})))}const ws=lg(async e=>{if(e.length>0){const r=ev(e);Xh?navigator.sendBeacon(rn,r):(await fetch(rn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ro(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(rn,ev([r]))}else ws.push(e)}const br=cg({app:Gh,version:gs,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:r,anonymousId:t,userId:n,event:a}=e;Ro({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{const{properties:r,anonymousId:t,userId:n,event:a}=e;Ro({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{const{properties:r,anonymousId:t,userId:n}=e;Ro({anonymousId:t,userId:n,properties:r,type:"identify"})}}]});function rv(e,r){br.track(e,r)}function Ag(){return Xh=!0,ws.flush()}const tv=new Map;function jg(e,r){tv.set(e,r)}function Ug(e,r){Qh.set(e,r)}function nv(e,r,t=!1){const n={name:e,data:r},a=new CustomEvent(e,{detail:n,cancelable:t,bubbles:!0});rv(`event:${e}`,{...r,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return t&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function Lg(e,r){e.cancelable&&(e.detail.cancellationMessage=r,e.preventDefault())}let $e,av,Do=!1,Zt=!1;Et()&&window.addEventListener("pageshow",()=>{Zt=!1});const ot="sesamyAccessToken",_o="sesamyRefreshToken";async function In(){return Do?!0:new Promise((e,r)=>{const t=setTimeout(()=>{Do?e(!0):r(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(We.AUTH_INITIALIZED,()=>{clearTimeout(t),e(!0)})})}async function qg(e){if(!e)return null;const r=localStorage.getItem(_o);if(!r)return ye("No refresh token found in localstorage"),null;const t=new URLSearchParams;t.set("client_id",e.iss),t.set("refresh_token",r),t.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:t.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(_o),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(_o,i.refresh_token),localStorage.setItem(ot,i.access_token),i.access_token}catch{Ss()}}async function bs(){const e=localStorage.getItem(ot);if(!e)return null;const r=Is(e);if(!r||!r.exp||r.exp<new Date().getTime()/1e3){const t=await qg(r);if(t)return t;localStorage.removeItem(ot)}return e}let Gt=null;function xg(){try{if(Gt!==null)return Gt;const r=Object.keys(localStorage).filter(t=>t.startsWith("@@auth0spajs@@"));for(const t of r){const n=JSON.parse(localStorage.getItem(t)||"{}");if(typeof n=="object"&&"refresh_token"in n)return Gt=!0,!0}}catch(e){ye(`Error checking for existing auth0 tokens: ${e.message}`)}return Gt=!1,!1}function sd(e){try{const r=new URL(e).hostname,t=r.split(".");return t.length>1?t.slice(-2).join("."):r}catch{return null}}async function Ng(e){if(e.enabled===!1)return;av=e.organization;const r=e.domain&&!xg()?e.domain:Ph("token",e.environment),t={domain:r,clientId:e.clientId,useCookiesForTransactions:!0};t.cacheLocation="localstorage",sd(window.location.href)!==sd(`https://${r}`)&&(t.useRefreshTokens=!0),ye(`Initializing auth0 client: ${JSON.stringify(t)}`),$e=await om(t);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)ye("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{ye("Code found in URL, handling redirect");try{const c=await $e.handleRedirectCallback();ye(`Login result: ${JSON.stringify(c)}`);const l=await $e.getUser();if(!l)throw ye("No user found"),new Error("No user found");ye(`User found ${JSON.stringify(l)}`),Ir(We.AUTHENTICATED,l),ye("Rewrite url")}catch(c){alert("There was an error logging in"),console.error(c)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}Do=!0,Ir(We.AUTH_INITIALIZED,{})}async function _t(){return await In(),await bs()?!0:$e?$e.isAuthenticated():!1}async function Dg(){return await In(),await bs()?(ye("Using local user"),{sub:"local",name:"Local User"}):$e?$e.getUser():null}function iv(e){if(Zt)return ye("Login already in progress"),null;if(Zt=!0,setTimeout(()=>{Zt=!1},3e3),localStorage.removeItem(ot),!$e)throw new Error("Auth0 client not initialized");const r=e?.authorizationParams||{};return{...e,authorizationParams:{organization:av,redirect_uri:window.location.href,ui_locales:Yt(),incognito:ls(),...r}}}async function Pn(e){const r=iv(e);if(r)return $e.loginWithRedirect(r)}async function ov(e){const r=iv(e);if(!r)return;await $e.loginWithPopup(r),nv(We.AUTHENTICATED,await $e.getUser()).canceled||window.location.reload()}async function $g(e){return await ls()?ov(e):Pn(e)}async function Zr(e=!0,r=!1){await In();const t=await bs();if(t)return t;try{if(!$e)return ye("Auth client not initialized"),null;let n=await $e.getTokenSilently();const a=Is(n);return r&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await $e.getTokenSilently({cacheMode:r?"off":"on"})),n}catch(n){const a=n;if(ye(`Failed to get token silently: ${a.message}`),a.message==="Invalid refresh token"&&await Ss(),e)throw n;return null}}async function Ss(e={}){if(await In(),localStorage.removeItem(ot),Ir(We.LOGOUT,{}),!!$e)return ye(`Logout with options: ${JSON.stringify(e)}`),$e.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Is(e){const r=e.split(".");if(r.length!==3)return null;const n=r[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function $o(e){const r=Is(e);if(!r||!r.exp||r.exp<new Date().getTime()/1e3)throw new Error("Invalid token");ye("Set token"),localStorage.setItem(ot,e),Ir(We.AUTHENTICATED,r)}const Mg=(e,r)=>r.skipDedupe||r.method!=="GET",Fg=(e,r)=>r.method+"@"+e,Bg=e=>e.clone(),ud=({skip:e=Mg,key:r=Fg,resolver:t=Bg}={})=>{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((c,l)=>{n.get(s).push([c,l])});try{return a(i,o).then(c=>(n.get(s).forEach(([l])=>l(t(c))),n.delete(s),c)).catch(c=>{throw n.get(s).forEach(([,l])=>l(c)),n.delete(s),c})}catch(c){return n.delete(s),Promise.reject(c)}}},zg=(e,r)=>e*r,Hg=e=>e&&e.ok,cd=({delayTimer:e=500,delayRamp:r=zg,maxAttempts:t=10,until:n=Hg,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>c=>(l,u)=>{let f=0;if(s&&s(l,u))return c(l,u);const h=(d,v)=>Promise.resolve(n(d,v)).then(m=>m?d&&o?d:v?Promise.reject(v):d:(f++,!t||f<=t?new Promise(w=>{const E=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:u})).then((b={})=>{var g,p;w(c((g=b&&b.url)!==null&&g!==void 0?g:l,(p=b&&b.options)!==null&&p!==void 0?p:u))}):w(c(l,u))},E)}).then(h).catch(w=>{if(!i)throw w;return h(null,w)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return c(l,u).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},Gg="application/json",sv="Content-Type",Vr=Symbol(),uv=Symbol();function ld(e={}){var r;return(r=Object.entries(e).find(([t])=>t.toLowerCase()===sv.toLowerCase()))===null||r===void 0?void 0:r[1]}function fd(e){return/^application\/.*json.*/.test(e)}const Nr=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]=Nr(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 Kg(e,r=!1){st.options=r?e:Nr(st.options,e)}function Wg(e,r=!1){st.polyfills=r?e:Nr(st.polyfills,e)}function Vg(e){st.errorType=e}const Jg=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;class cv extends Error{}const Zg=e=>{const r=Object.create(null);e=e._addons.reduce((g,p)=>p.beforeRequest&&p.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:c}=e,l=new Map(i),u=Nr(a.options,n);let f=t;const h=Jg(s)((g,p)=>(f=g,a.polyfill("fetch")(g,p)))(t,u),d=new Error,v=h.catch(g=>{throw{[Vr]:g}}).then(g=>{var p;if(!g.ok){const y=new cv;if(y.cause=d,y.stack=y.stack+`
|
|
36
|
+
CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const k=a.errorType==="json"||((p=g.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?k?g.text():g[a.errorType]():Promise.resolve(g.body)).then(j=>{throw y.message=typeof j=="string"?j:g.statusText,j&&(k&&typeof j=="string"?(y.text=j,y.json=JSON.parse(j)):y[a.errorType]=j),y})}return g}),m=g=>g.catch(p=>{const y=Object.prototype.hasOwnProperty.call(p,Vr),k=y?p[Vr]:p,A=k?.status&&l.get(k.status)||l.get(k?.name)||y&&l.has(Vr)&&l.get(Vr);if(A)return A(k,e);const j=l.get(uv);if(j)return j(k,e);throw k}),w=g=>p=>m(g?v.then(y=>y&&y[g]()).then(y=>p?p(y):y):v.then(y=>p?p(y):y)),E={_wretchReq:e,_fetchReq:h,_sharedState:r,res:w(null),json:w("json"),blob:w("blob"),formData:w("formData"),arrayBuffer:w("arrayBuffer"),text:w("text"),error(g,p){return l.set(g,p),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(Vr,g)}},b=c.reduce((g,p)=>({...g,...typeof p.resolver=="function"?p.resolver(g):p.resolver}),E);return o.reduce((g,p)=>p(g,e),b)},Yg={_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:Nr(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:Nr(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:Nr(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[sv]: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(uv,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=ld(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||fd(a));return n=t?o?n.json(t,a):n.body(t):n,Zg(n._deferred.reduce((s,c)=>c(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=ld(this._options.headers);return this.content(r||fd(t)&&t||Gg).body(JSON.stringify(e))}};function mr(e="",r={}){return{...Yg,_url:e,_options:r}}mr.default=mr;mr.options=Kg;mr.errorType=Vg;mr.polyfills=Wg;mr.WretchError=cv;function rr(){return sessionStorage.removeItem(Ao),ye("Cache cleared"),Ir(We.CLEAR_CACHE,{}),"Cache cleared"}function Mo(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function lv(e,r){if(Mo(e))return{itemSrc:e};const[t,n,a]=e.split(":");return{sku:`${t}:${n}`,purchaseOption:r||a}}function dd(e){return e.endsWith("/")?e.slice(0,-1):e}function hd(e,r){if(!Mo(e)||!Mo(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&dd(t.pathname)===dd(n.pathname)}function Xg(e,r,t){const n=new URL(`${vr("checkout3",e.environment)}`);if(r.language&&n.searchParams.set("lang",r.language),r.sku)n.searchParams.set("sku",r.sku),r.purchaseOptionId&&n.searchParams.set("po-id",r.purchaseOptionId);else if(r.itemSrc){const{sku:s,purchaseOption:c,itemSrc:l}=lv(r.itemSrc,r.purchaseOptionId);l&&n.searchParams.set("url",l),s&&n.searchParams.set("sku",s),c&&n.searchParams.set("po-id",c)}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 a=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(s=>{const[c,l]=s.trim().split("=");return{key:c,value:l}}).filter(s=>a.some(c=>c===s.key)).forEach(s=>{n.searchParams.append(s.key,s.value)});const o=new URL(r.redirectUrl||window.location.href);return o.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&o.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",o.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:s,methods:c})=>c?c.map(l=>`${s}|${l}`):s).join(",")),n}const fv="sesamySignedURLs";function Ps(){const e=sessionStorage.getItem(fv);return e?JSON.parse(e):[]}function Qg(e){const r=Ps();r.push(e),ye(`Adding signed URL: ${e}`),sessionStorage.setItem(fv,JSON.stringify(r))}function ey(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Fo="sesamyAttribution";function ry(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 ty(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function tn(){return ry(Fo)||{}}function dv(e){if(e===null)localStorage.removeItem(Fo);else{ye(`Setting attribution ${JSON.stringify(e)}`);const r=tn()??{},t=ey({...r,...ty(e)});localStorage.setItem(Fo,JSON.stringify({value:t}))}}function ny(e){const r=vr("api2",e.environment),t=T=>async(F,J)=>{let pe=sessionStorage.getItem(Ao);pe||(pe=Date.now().toString(),sessionStorage.setItem(Ao,pe));const ve={...J,headers:{...J.headers,"Cache-Timestamp":pe}};return T(F,ve)},n=(T=!0)=>F=>async(J,pe)=>{let ve=null;if(ve=await Zr(T),!ve){if(T)throw new Error("No access token available");return F(J,pe)}const me={...pe,headers:{...pe.headers,...ve?{Authorization:`Bearer ${ve}`}:{}}};return F(J,me)},a=T=>(F,J)=>{if(J.headers.Authorization)return T(F,J);const pe=localStorage.getItem("__anon_id"),ve=btoa(`${e.clientId}|${pe}:`),me={...J,headers:{...J.headers,Authorization:`Basic ${ve}`}};return T(F,me)},i=mr(r).headers({"Content-Type":"application/json"}).middlewares([t,n(),ud(),cd({delayTimer:1e3,delayRamp:(T,F)=>T*F,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]),o=mr(r).headers({"Content-Type":"application/json"}).middlewares([t,n(!1),a,ud(),cd({delayTimer:1e3,delayRamp:(T,F)=>T*F,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]);async function s(T={}){const{waitForEntitlementAfter:F,includeSignedLinks:J=!0}=T,pe=F?`?wait-for-entitlement-after=${F.toISOString()}`:"",ve=await _t()?await i.get(`/entitlements${pe}`).json():[];return J&&ve.push(...Ps()),ve}async function c(T,F=[]){return(await s())?.find(ve=>{const{sku:me,purchaseOption:Be}=lv(T);let M="sku"in ve&&me===ve.sku;M&&Be&&"purchaseOptionId"in ve&&(M=Be===ve.purchaseOptionId);const ie=hd(T,ve.url),le=F.some(fe=>hd(fe,ve.url));return M||ie||le})}async function l(T){return(await i.get("/entitlements").json())?.find(J=>J.id===T)}async function u(T){return i.get(`/entitlements/${encodeURIComponent(T)}/access`).json()}async function f(T,F,J){const pe=new URL(vr("api2",e.environment));return pe.pathname="/proxy",pe.searchParams.set("url",F),J&&pe.searchParams.set("selector",J),mr(pe.toString()).headers({Authorization:`Bearer ${T}`}).get().text()}async function h(T){if(!T)throw new Error("SKU is required to get fulfillments");return await _t()?await i.get(`/fulfillments?sku=${encodeURIComponent(T)}`).json():[]}async function d(T,F){if(!T||!F)throw new Error("SKU and itemId are required to request delivery");return(await i.post({sku:T},`/fulfillments/${encodeURIComponent(F)}/request-delivery?`).res()).ok}async function v(){return i.get("/contracts").json()}async function m(T){return(await i.get("/contracts").json())?.find(J=>J.id===T)}async function w(T){const F=await i.post({},`/contracts/${encodeURIComponent(T)}/cancel`).res();return rr(),F.ok}async function E(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function b(){return i.get("/bills").json()}async function g(T){return(await i.get("/bills").json())?.find(J=>J.id===T)}async function p(){return i.get("/transactions").json()}async function y(T){return(await i.get("/transactions").json())?.find(J=>J.id===T)}async function k(T,F){const J=await i.url(`/user-metadata/${encodeURIComponent(T)}`).put(F).json();return Ir(We.USER_ATTRIBUTE_CHANGED,{}),rr(),J}async function A(T){const F=await i.url(`/user-metadata/${encodeURIComponent(T)}`).delete().res();return rr(),F.ok}async function j(T){return(await i.url(`/user-metadata/${encodeURIComponent(T)}`).get().json())[T]}async function z(){return await i.url("/user-metadata").get().json()}async function H(){return await i.url("/tags").get().json()}async function ee(T){const F=await i.url(`/tags/${encodeURIComponent(T)}`).delete().res();return rr(),F.ok}async function x(T){const F=await i.url("/tags").post(encodeURIComponent(T)).res();return Ir(We.USER_ATTRIBUTE_CHANGED,{}),rr(),F.ok}async function N(T){return(await o.url("/tallies").get().json())[T]}async function q(){return await o.url("/tallies").get().json()}async function O(T){const F=await o.url(`/tallies/${T}`).delete().res();return rr(),F.ok}async function X(T,F){return await o.url(`/tallies/${encodeURIComponent(T)}/push`).post(F).json()}async function re(T){return await i.url(`/products/${encodeURIComponent(T)}`).get().json()}async function Q(){return await Zr(!1)?await i.url("/profile").get().json():null}async function S(T){const F=await i.url("/profile").patch(T).res();return rr(),F.ok}async function _(){return await i.url("/payment-issues").get().json()}async function D(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function B(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function K(T){const F=await Zr(!1);if(!F)throw new Error("No access token available");const J=new URL(`${vr("access-sync",e.environment)}/spotify/sesamy-callback`);J.searchParams.set("access_token",F),J.searchParams.set("state",T),window.location.href=J.toString()}async function Z(T){const F=await i.url(`/products/${encodeURIComponent(T)}/auto-onboard`).post().json();return F.length&&rr(),F}async function de(T,F=3600){const{shortlink:J}=await mr(cm).post({url:T,ttl:F}).json();return J}async function ae(T){const F=await Zr(!1,!0);let J;const pe=T.language||Yt(),ve=tn();switch(T.target){case"account":J=new URL(`${vr("account",e.environment)}/${encodeURIComponent(T.language||pe)}/subscriptions/${encodeURIComponent(e.clientId)}${T.contractId?`/${encodeURIComponent(T.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${vr("account",e.environment)}/${encodeURIComponent(T.language||pe)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(T.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${vr("account",e.environment)}/${encodeURIComponent(T.language||pe)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(T.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"consume":J=new URL(`${vr("consume",e.environment)}/${encodeURIComponent(T.language||pe)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(T.sku)}`),T.episodeId?J.href+=`/${T.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"checkout":J=Xg(e,{language:pe,...T},ve);break;default:throw new Error("Invalid target")}return F&&(J.hash=`#access_token=${F}`),T.shorten?de(J.href,T.ttl):J.href}async function ue(T){const F=tn(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(ve=>{const me=F,[Be,M]=ve.trim().split("=");J.includes(Be)&&!me[Be]&&(me[Be]=M)}),(await o.url("/checkouts").post({language:Yt(),...T,attribution:{...F,...T.attribution},vendorId:e.clientId})).json()}async function se(T,F){return(await o.url(`/checkouts/${T}`).patch(F)).json()}async function Pe(T){return(await o.url(`/checkouts/${T}`).get()).json()}async function je(T){return(await o.url(`/paywalls/${T}`).get()).json()}async function Fe(){return(await o.url("/vendor").get()).json()}async function Ce(){return(await i.url("/vendors").get()).json()}async function Ve(T){return(await i.url(`/contracts/${encodeURIComponent(T.contractId)}/amendments`).post({amendmentType:T.amendmentType,discountCode:T.discountCode})).json()}async function lr(T){return await i.url(`/amendments/${encodeURIComponent(T)}/confirm`).post(),!0}async function fr(){const T=await Zr(!1),F=new URL(`${vr("account",e.environment)}/subscriptions/${e.clientId}`);T&&(F.hash=`#access_token=${T}`),window.location.href=F.toString()}return{autoOnboardProduct:Z,cancelContract:w,confirmAmendment:lr,createAmendment:Ve,createCheckout:ue,deleteTag:ee,deleteTally:O,deleteUserMetadata:A,generateLink:ae,getBill:g,getBills:b,getCheckout:Pe,getProxyContent:f,getContract:m,getContracts:v,getEntitlement:l,getEntitlementAccess:u,getEntitlements:s,getFulfillments:h,requestDelivery:d,getPaywall:je,getPaymentIssues:_,getProfile:Q,getProduct:re,getSubscriptions:E,getTally:N,getTallies:q,getTags:H,getTransaction:y,getTransactions:p,getUserMetadata:j,hasAccess:c,isSpotifyLinked:D,linkSpotify:K,listUserMetadata:z,openHostedAccountPage:fr,pushTally:X,setTag:x,setUserMetadata:k,unlinkSpotify:B,updateCheckout:se,updateProfile:S,getVendorSettings:Fe,listVendors:Ce}}const ay=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function iy(){return new Promise(e=>{const r=ay.map(t=>{const n=document.createElement("div");return n.innerHTML=" ",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 oy(){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}}const hv="sesamyFlags";async function vv(e){try{localStorage.setItem(hv,JSON.stringify(e))}catch{ye("Failed to save flags to localStorage")}}async function sy(e,r){const t=await En();t[e]=r,await vv(t)}async function uy(e){return(await En())[e]}async function cy(e){const r=await En();e in r&&(delete r[e],await vv(r))}async function En(){try{const e=localStorage.getItem(hv);return e?JSON.parse(e):{}}catch{return{}}}function ly(e){const{autoOnboardProduct:r,cancelContract:t,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:c,getBills:l,getCheckout:u,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:m,getFulfillments:w,getPaywall:E,getPaymentIssues:b,getProfile:g,getProduct:p,getProxyContent:y,getSubscriptions:k,getTags:A,getTally:j,getTallies:z,getTransaction:H,getTransactions:ee,getUserMetadata:x,getVendorSettings:N,listVendors:q,hasAccess:O,isSpotifyLinked:X,linkSpotify:re,listUserMetadata:Q,openHostedAccountPage:S,pushTally:_,requestDelivery:D,setTag:B,setUserMetadata:K,unlinkSpotify:Z,updateCheckout:de,updateProfile:ae}=ny(e),ue={analytics:{track:rv},attribution:{get:tn,set:dv},auth:{getUser:g,getTokenSilently:Zr,isAuthenticated:_t,loginWithRedirect:Pn,loginWithPopup:ov,login:$g,logout:Ss,setToken:$o},bills:{get:c,list:l},browser:{detectAdblock:iy,isInAppBrowser:oy,isIncognito:ls},checkouts:{create:n,get:u,update:de},clearCache:rr,content:{list:Og,get:ys,getLanguage:Yt,unlock:kg,getPropertyFromHTML:Zh},contracts:{cancel:t,get:f,list:h},entitlements:{access:v,get:d,hasAccess:O,list:m,signedLinks:Ps},events:{emit:nv,cancel:Lg},flags:{get:uy,set:sy,list:En,delete:cy},fulfillments:{list:w,requestDelivery:D},generateLink:s,getPaymentIssues:b,getVersion:fy,isReady:()=>exports.isInitialized,log:ye,paywalls:{get:E},products:{autoOnboard:r,get:p,linkSpotify:re},profile:{get:g,isSpotifyLinked:X,openHostedAccountPage:S,unlinkSpotify:Z,update:ae},proxy:{getContent:y},subscriptions:{list:k},tags:{delete:a,list:A,set:B},tallies:{delete:i,get:j,list:z,push:_},transactions:{get:H,list:ee},userMetadata:{delete:o,get:x,list:Q,set:K},vendors:{get:N,list:q},setToken:$o};return e.namespace&&(window[e.namespace]=ue),ue}function fy(){return gs}function dy(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=`
|
|
37
|
+
${r.selector}::before {
|
|
38
38
|
content: '';
|
|
39
39
|
position: absolute;
|
|
40
40
|
bottom: 0;
|
|
@@ -44,4 +44,4 @@ CAUSE: `+et.stack,lt.response=it,lt.status=it.status,lt.url=Ye,it.type==="opaque
|
|
|
44
44
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
45
45
|
pointer-events: none;
|
|
46
46
|
}
|
|
47
|
-
`,document.head.appendChild(
|
|
47
|
+
`,document.head.appendChild(i)}async function hy(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 Es(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 hy(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 vy(e,r){const t=r.insertionPoint||"inside",n=await Es(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 py(e,r){const t=await Es(r);e.innerHTML=t}async function my(e,r){const t=await Es(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function gy({enabled:e=!1,rules:r}){e&&Yh(async()=>{const t=await _t(),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 vy(s,a);break;case"replace":await py(s,a);break;case"remove":o.remove();break;case"wrap":await my(s,a);break;case"gradient":dy(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const vd="access_token";function yy(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(vd);if(r){$o(r);const t=new URL(window.location.href);e.delete(vd),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const pd="sesamy-refresh",md="force-refetch-entitlements";function wy(){const e=new URLSearchParams(window.location.search),r=e.get(md),t=e.get(pd);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(md),e.delete(pd),n.search=e.toString(),rr(),window.history.replaceState(null,"",n)}}function by(e){const r=e.split(".")[1],t=atob(r);return JSON.parse(t)}function Sy(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=by(r),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOptionsId:n.pid?.toString(),url:n.url?.toString(),token:r,type:"article",expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};Qg(i)}catch(n){ye(`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"),window.history.replaceState(null,"",t)}const gd="sesamy-user";async function Iy(){const r=new URLSearchParams(window.location.search).get(gd)?.toLowerCase();if(!r)return;const t=await Dg();t?.email!==r?(ye(`Current user does not match sesamy user: ${t?.email} !== ${r}`),rr(),Pn({authorizationParams:{login_hint:r}})):ye(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(gd),window.history.replaceState(null,"",n)}const yd="sesamy-purchase";function Py(){const e=new URLSearchParams(window.location.search),r=e.get(yd);if(r!==null){const t=new URL(window.location.href);e.delete(yd),t.search=e.toString(),ye(`Purchase ${r}`),Ir(We.PURCHASE,{itemSrc:r}),rr(),window.history.replaceState(null,"",t)}}const wd="sesamy-login",Ey="sesamy_login";async function Ry(){const e=new URLSearchParams(window.location.search);if(!(e.get(wd)||e.get(Ey)))return;await _t()||Pn();const n=new URL(window.location.href);n.searchParams.delete(wd),window.history.replaceState(null,"",n)}const bd="sesamy-debug";async function _y(){const r=new URLSearchParams(window.location.search).get(bd)?.toLowerCase();if(!r)return;Lp(r==="true");const t=new URL(window.location.href);t.searchParams.delete(bd),window.history.replaceState(null,"",t)}function Ty(){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 Oy(e){if(!Et())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:Ty()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),dv(t)}function ky(){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(Cf)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem(Cf,"true"),n||(ye("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Cy(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 Ay(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 jy(e){const r=tt("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 Sd(e,r){ye(`Init with config: ${JSON.stringify(e)}`);try{ky(),Cg({clientId:e.clientId,environment:e.environment,...e.analytics}),await Ng({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),_g(e,r),e.transform&&await gy(e.transform),dm(),_y(),Oy(r),yy(),wy(),Sy(),await Ry(),await Iy(),Py(),await Ay(r),await Cy(r),await jy(r),exports.isInitialized=!0,Ir(We.READY,{})}catch(t){ye(`Failed to init ${t.message}`)}}async function pv(e){ye("Initializing Sesamy");const r=e.api?.namespace||"sesamy";if(Et()&&r in window)return ye("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[r];const t=ly({clientId:e.clientId,environment:e.environment,...e.api});return Et()?(e.awaitAllServices?await Sd(e,t):Sd(e,t),t):(exports.isInitialized=!0,t)}if(Et()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent);pv(r)}catch(r){console.error("Failed to parse config",r)}}exports.init=pv;
|