PageSpy-2

一个网页调试的脚本做成的库

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/483696/1568955/PageSpy-2.js

/**
 * 初始化PageSpy
 * @time 2025-04-10
 * @version 2.2.1
 * @link https://fastly.jsdelivr.net/npm/@huolala-tech/page-spy-browser
 */
/* prettier-ignore */
class initPageSpy {
  constructor(window = globalThis || self) {

    return function(){"use strict";function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var check=function(e){return e&&e.Math==Math&&e},global$q=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$s=function(e){try{return!!e()}catch(e){return!0}},fails$r=fails$s,descriptors=!fails$r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),fails$q=fails$s,functionBindNative=!fails$q((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),NATIVE_BIND$3=functionBindNative,call$i=Function.prototype.call,functionCall=NATIVE_BIND$3?call$i.bind(call$i):function(){return call$i.apply(call$i,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor$3(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$7=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$h=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$h,call$h),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(e){return function(){return call$h.apply(e,arguments)}},uncurryThis$z=functionUncurryThis,toString$a=uncurryThis$z({}.toString),stringSlice$8=uncurryThis$z("".slice),classofRaw$2=function(e){return stringSlice$8(toString$a(e),8,-1)},uncurryThis$y=functionUncurryThis,fails$p=fails$s,classof$a=classofRaw$2,$Object$4=Object,split$3=uncurryThis$y("".split),indexedObject=fails$p((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(e){return"String"==classof$a(e)?split$3(e,""):$Object$4(e)}:$Object$4,isNullOrUndefined$5=function(e){return null==e},isNullOrUndefined$4=isNullOrUndefined$5,$TypeError$h=TypeError,requireObjectCoercible$5=function(e){if(isNullOrUndefined$4(e))throw $TypeError$h("Can't call method on "+e);return e},IndexedObject$2=indexedObject,requireObjectCoercible$4=requireObjectCoercible$5,toIndexedObject$5=function(e){return IndexedObject$2(requireObjectCoercible$4(e))},documentAll$2="object"==typeof document&&document.all,IS_HTMLDDA=void 0===documentAll$2&&void 0!==documentAll$2,documentAll_1={all:documentAll$2,IS_HTMLDDA:IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$o=$documentAll$1.IS_HTMLDDA?function(e){return"function"==typeof e||e===documentAll$1}:function(e){return"function"==typeof e},isCallable$n=isCallable$o,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$a=$documentAll.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:isCallable$n(e)||e===documentAll}:function(e){return"object"==typeof e?null!==e:isCallable$n(e)},global$p=global$q,isCallable$m=isCallable$o,aFunction=function(e){return isCallable$m(e)?e:void 0},getBuiltIn$a=function(e,t){return arguments.length<2?aFunction(global$p[e]):global$p[e]&&global$p[e][t]},uncurryThis$x=functionUncurryThis,objectIsPrototypeOf=uncurryThis$x({}.isPrototypeOf),engineUserAgent="undefined"!=typeof navigator&&String(navigator.userAgent)||"",global$o=global$q,userAgent=engineUserAgent,process$1=global$o.process,Deno$1=global$o.Deno,versions=process$1&&process$1.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&&(match=userAgent.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var engineV8Version=version$1,V8_VERSION=engineV8Version,fails$o=fails$s,global$n=global$q,$String$6=global$n.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$o((function(){var e=Symbol();return!$String$6(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41})),NATIVE_SYMBOL$3=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$3&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$9=getBuiltIn$a,isCallable$l=isCallable$o,isPrototypeOf$3=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$3=USE_SYMBOL_AS_UID$1?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$9("Symbol");return isCallable$l(t)&&isPrototypeOf$3(t.prototype,$Object$3(e))},$String$5=String,tryToString$3=function(e){try{return $String$5(e)}catch(e){return"Object"}},isCallable$k=isCallable$o,tryToString$2=tryToString$3,$TypeError$g=TypeError,aCallable$7=function(e){if(isCallable$k(e))return e;throw $TypeError$g(tryToString$2(e)+" is not a function")},aCallable$6=aCallable$7,isNullOrUndefined$3=isNullOrUndefined$5,getMethod$4=function(e,t){var r=e[t];return isNullOrUndefined$3(r)?void 0:aCallable$6(r)},call$g=functionCall,isCallable$j=isCallable$o,isObject$9=isObject$a,$TypeError$f=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$j(r=e.toString)&&!isObject$9(n=call$g(r,e)))return n;if(isCallable$j(r=e.valueOf)&&!isObject$9(n=call$g(r,e)))return n;if("string"!==t&&isCallable$j(r=e.toString)&&!isObject$9(n=call$g(r,e)))return n;throw $TypeError$f("Can't convert object to primitive value")},shared$4={exports:{}},isPure=!1,global$m=global$q,defineProperty$8=Object.defineProperty,defineGlobalProperty$3=function(e,t){try{defineProperty$8(global$m,e,{value:t,configurable:!0,writable:!0})}catch(r){global$m[e]=t}return t},global$l=global$q,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$l[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$4.exports,requireObjectCoercible$3=requireObjectCoercible$5,$Object$2=Object,toObject$8=function(e){return $Object$2(requireObjectCoercible$3(e))},uncurryThis$w=functionUncurryThis,toObject$7=toObject$8,hasOwnProperty$1=uncurryThis$w({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty$1(toObject$7(e),t)},uncurryThis$v=functionUncurryThis,id=0,postfix=Math.random(),toString$9=uncurryThis$v(1..toString),uid$2=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$9(++id+postfix,36)},global$k=global$q,shared$3=sharedExports,hasOwn$d=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL$2=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$1=global$k.Symbol,WellKnownSymbolsStore=shared$3("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$g=function(e){return hasOwn$d(WellKnownSymbolsStore,e)||(WellKnownSymbolsStore[e]=NATIVE_SYMBOL$2&&hasOwn$d(Symbol$1,e)?Symbol$1[e]:createWellKnownSymbol("Symbol."+e)),WellKnownSymbolsStore[e]},call$f=functionCall,isObject$8=isObject$a,isSymbol$2=isSymbol$3,getMethod$3=getMethod$4,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$f=wellKnownSymbol$g,$TypeError$e=TypeError,TO_PRIMITIVE=wellKnownSymbol$f("toPrimitive"),toPrimitive$1=function(e,t){if(!isObject$8(e)||isSymbol$2(e))return e;var r,n=getMethod$3(e,TO_PRIMITIVE);if(n){if(void 0===t&&(t="default"),r=call$f(n,e,t),!isObject$8(r)||isSymbol$2(r))return r;throw $TypeError$e("Can't convert object to primitive value")}return void 0===t&&(t="number"),ordinaryToPrimitive(e,t)},toPrimitive=toPrimitive$1,isSymbol$1=isSymbol$3,toPropertyKey$3=function(e){var t=toPrimitive(e,"string");return isSymbol$1(t)?t:t+""},global$j=global$q,isObject$7=isObject$a,document$1=global$j.document,EXISTS$1=isObject$7(document$1)&&isObject$7(document$1.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$1.createElement(e):{}},DESCRIPTORS$k=descriptors,fails$n=fails$s,createElement=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$k&&!fails$n((function(){return 7!=Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a})),DESCRIPTORS$j=descriptors,call$e=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$6=createPropertyDescriptor$7,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$c=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$j?$getOwnPropertyDescriptor$1:function(e,t){if(e=toIndexedObject$4(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(e){}if(hasOwn$c(e,t))return createPropertyDescriptor$6(!call$e(propertyIsEnumerableModule$1.f,e,t),e[t])};var objectDefineProperty={},DESCRIPTORS$i=descriptors,fails$m=fails$s,v8PrototypeDefineBug=DESCRIPTORS$i&&fails$m((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),isObject$6=isObject$a,$String$4=String,$TypeError$d=TypeError,anObject$g=function(e){if(isObject$6(e))return e;throw $TypeError$d($String$4(e)+" is not an object")},DESCRIPTORS$h=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$f=anObject$g,toPropertyKey$1=toPropertyKey$3,$TypeError$c=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$h?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){if(anObject$f(e),t=toPropertyKey$1(t),anObject$f(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]){var n=$getOwnPropertyDescriptor(e,t);n&&n[WRITABLE]&&(e[t]=r.value,r={configurable:CONFIGURABLE$1 in r?r[CONFIGURABLE$1]:n[CONFIGURABLE$1],enumerable:ENUMERABLE in r?r[ENUMERABLE]:n[ENUMERABLE],writable:!1})}return $defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$f(e),t=toPropertyKey$1(t),anObject$f(r),IE8_DOM_DEFINE)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$c("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var DESCRIPTORS$g=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$5=createPropertyDescriptor$7,createNonEnumerableProperty$9=DESCRIPTORS$g?function(e,t,r){return definePropertyModule$4.f(e,t,createPropertyDescriptor$5(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$f=descriptors,hasOwn$b=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$f&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$b(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$f||DESCRIPTORS$f&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$u=functionUncurryThis,isCallable$i=isCallable$o,store$1=sharedStore,functionToString=uncurryThis$u(Function.toString);isCallable$i(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)});var inspectSource$2=store$1.inspectSource,global$i=global$q,isCallable$h=isCallable$o,WeakMap$2=global$i.WeakMap,weakMapBasicDetection=isCallable$h(WeakMap$2)&&/native code/.test(String(WeakMap$2)),shared$2=sharedExports,uid=uid$2,keys$2=shared$2("keys"),sharedKey$3=function(e){return keys$2[e]||(keys$2[e]=uid(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$h=global$q,isObject$5=isObject$a,createNonEnumerableProperty$8=createNonEnumerableProperty$9,hasOwn$a=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=global$h.TypeError,WeakMap$1=global$h.WeakMap,set$1,get$1,has$6,enforce=function(e){return has$6(e)?get$1(e):set$1(e,{})},getterFor=function(e){return function(t){var r;if(!isObject$5(t)||(r=get$1(t)).type!==e)throw TypeError$4("Incompatible receiver, "+e+" required");return r}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap$1);store.get=store.get,store.has=store.has,store.set=store.set,set$1=function(e,t){if(store.has(e))throw TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,store.set(e,t),t},get$1=function(e){return store.get(e)||{}},has$6=function(e){return store.has(e)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set$1=function(e,t){if(hasOwn$a(e,STATE))throw TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$8(e,STATE,t),t},get$1=function(e){return hasOwn$a(e,STATE)?e[STATE]:{}},has$6=function(e){return hasOwn$a(e,STATE)}}var internalState={set:set$1,get:get$1,has:has$6,enforce:enforce,getterFor:getterFor},uncurryThis$t=functionUncurryThis,fails$l=fails$s,isCallable$g=isCallable$o,hasOwn$9=hasOwnProperty_1,DESCRIPTORS$e=descriptors,CONFIGURABLE_FUNCTION_NAME$2=functionName.CONFIGURABLE,inspectSource$1=inspectSource$2,InternalStateModule$5=internalState,enforceInternalState=InternalStateModule$5.enforce,getInternalState$3=InternalStateModule$5.get,$String$3=String,defineProperty$7=Object.defineProperty,stringSlice$7=uncurryThis$t("".slice),replace$9=uncurryThis$t("".replace),join$3=uncurryThis$t([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$e&&!fails$l((function(){return 8!==defineProperty$7((function(){}),"length",{value:8}).length})),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===stringSlice$7($String$3(t),0,7)&&(t="["+replace$9($String$3(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$9(e,"name")||CONFIGURABLE_FUNCTION_NAME$2&&e.name!==t)&&(DESCRIPTORS$e?defineProperty$7(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$9(r,"arity")&&e.length!==r.arity&&defineProperty$7(e,"length",{value:r.arity});try{r&&hasOwn$9(r,"constructor")&&r.constructor?DESCRIPTORS$e&&defineProperty$7(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=enforceInternalState(e);return hasOwn$9(n,"source")||(n.source=join$3(TEMPLATE,"string"==typeof t?t:"")),e};Function.prototype.toString=makeBuiltIn$2((function(){return isCallable$g(this)&&getInternalState$3(this).source||inspectSource$1(this)}),"toString");var makeBuiltInExports=makeBuiltIn$3.exports,isCallable$f=isCallable$o,definePropertyModule$3=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$8=function(e,t,r,n){n||(n={});var o=n.enumerable,a=void 0!==n.name?n.name:t;if(isCallable$f(r)&&makeBuiltIn$1(r,a,n),n.global)o?e[t]=r:defineGlobalProperty$1(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:definePropertyModule$3.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$5=Math.floor,mathTrunc=Math.trunc||function(e){var t=+e;return(t>0?floor$5:ceil)(t)},trunc=mathTrunc,toIntegerOrInfinity$7=function(e){var t=+e;return t!=t||0===t?0:trunc(t)},toIntegerOrInfinity$6=toIntegerOrInfinity$7,max$3=Math.max,min$3=Math.min,toAbsoluteIndex$4=function(e,t){var r=toIntegerOrInfinity$6(e);return r<0?max$3(r+t,0):min$3(r,t)},toIntegerOrInfinity$5=toIntegerOrInfinity$7,min$2=Math.min,toLength$5=function(e){return e>0?min$2(toIntegerOrInfinity$5(e),9007199254740991):0},toLength$4=toLength$5,lengthOfArrayLike$6=function(e){return toLength$4(e.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex$3=toAbsoluteIndex$4,lengthOfArrayLike$5=lengthOfArrayLike$6,createMethod$3=function(e){return function(t,r,n){var o,a=toIndexedObject$3(t),s=lengthOfArrayLike$5(a),i=toAbsoluteIndex$3(n,s);if(e&&r!=r){for(;s>i;)if((o=a[i++])!=o)return!0}else for(;s>i;i++)if((e||i in a)&&a[i]===r)return e||i||0;return!e&&-1}},arrayIncludes={includes:createMethod$3(!0),indexOf:createMethod$3(!1)},uncurryThis$s=functionUncurryThis,hasOwn$8=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$5=uncurryThis$s([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$2(e),o=0,a=[];for(r in n)!hasOwn$8(hiddenKeys$2,r)&&hasOwn$8(n,r)&&push$5(a,r);for(;t.length>o;)hasOwn$8(n,r=t[o++])&&(~indexOf$1(a,r)||push$5(a,r));return a},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$8=getBuiltIn$a,uncurryThis$r=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$e=anObject$g,concat$2=uncurryThis$r([].concat),ownKeys$1=getBuiltIn$8("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$e(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$2(t,r(e)):t},hasOwn$7=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$2=objectDefineProperty,copyConstructorProperties$3=function(e,t,r){for(var n=ownKeys(t),o=definePropertyModule$2.f,a=getOwnPropertyDescriptorModule.f,s=0;s<n.length;s++){var i=n[s];hasOwn$7(e,i)||r&&hasOwn$7(r,i)||o(e,i,a(t,i))}},fails$k=fails$s,isCallable$e=isCallable$o,replacement=/#|\.prototype\./,isForced$1=function(e,t){var r=data[normalize(e)];return r==POLYFILL||r!=NATIVE&&(isCallable$e(t)?fails$k(t):!!t)},normalize=isForced$1.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$1.data={},NATIVE=isForced$1.NATIVE="N",POLYFILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$g=global$q,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$7=createNonEnumerableProperty$9,defineBuiltIn$7=defineBuiltIn$8,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$2=copyConstructorProperties$3,isForced=isForced_1,_export=function(e,t){var r,n,o,a,s,i=e.target,c=e.global,l=e.stat;if(r=c?global$g:l?global$g[i]||defineGlobalProperty(i,{}):(global$g[i]||{}).prototype)for(n in t){if(a=t[n],o=e.dontCallGetSet?(s=getOwnPropertyDescriptor$2(r,n))&&s.value:r[n],!isForced(c?n:i+(l?".":"#")+n,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;copyConstructorProperties$2(a,o)}(e.sham||o&&o.sham)&&createNonEnumerableProperty$7(a,"sham",!0),defineBuiltIn$7(r,n,a,e)}},NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$3=FunctionPrototype.apply,call$d=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$1?call$d.bind(apply$3):function(){return call$d.apply(apply$3,arguments)}),uncurryThis$q=functionUncurryThis,aCallable$5=aCallable$7,functionUncurryThisAccessor=function(e,t,r){try{return uncurryThis$q(aCallable$5(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},isCallable$d=isCallable$o,$String$2=String,$TypeError$b=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$d(e))return e;throw $TypeError$b("Can't set "+$String$2(e)+" as a prototype")},uncurryThisAccessor$3=functionUncurryThisAccessor,anObject$d=anObject$g,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=uncurryThisAccessor$3(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject$d(r),aPossiblePrototype(n),t?e(r,n):r.__proto__=n,r}}():void 0),defineProperty$6=objectDefineProperty.f,proxyAccessor$1=function(e,t,r){r in e||defineProperty$6(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},isCallable$c=isCallable$o,isObject$4=isObject$a,setPrototypeOf$3=objectSetPrototypeOf,inheritIfRequired$2=function(e,t,r){var n,o;return setPrototypeOf$3&&isCallable$c(n=t.constructor)&&n!==r&&isObject$4(o=n.prototype)&&o!==r.prototype&&setPrototypeOf$3(e,o),e},wellKnownSymbol$e=wellKnownSymbol$g,TO_STRING_TAG$3=wellKnownSymbol$e("toStringTag"),test$1={};test$1[TO_STRING_TAG$3]="z";var toStringTagSupport="[object z]"===String(test$1),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$b=isCallable$o,classofRaw$1=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$g,TO_STRING_TAG$2=wellKnownSymbol$d("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw$1(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$9=TO_STRING_TAG_SUPPORT?classofRaw$1:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=$Object$1(e),TO_STRING_TAG$2))?r:CORRECT_ARGUMENTS?classofRaw$1(t):"Object"==(n=classofRaw$1(t))&&isCallable$b(t.callee)?"Arguments":n},classof$8=classof$9,$String$1=String,toString$8=function(e){if("Symbol"===classof$8(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$1(e)},toString$7=toString$8,normalizeStringArgument$2=function(e,t){return void 0===e?arguments.length<2?"":t:toString$7(e)},isObject$3=isObject$a,createNonEnumerableProperty$6=createNonEnumerableProperty$9,installErrorCause$1=function(e,t){isObject$3(t)&&"cause"in t&&createNonEnumerableProperty$6(e,"cause",t.cause)},uncurryThis$p=functionUncurryThis,$Error=Error,replace$8=uncurryThis$p("".replace),TEST=String($Error("zxcasd").stack),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(e,t){if(IS_V8_OR_CHAKRA_STACK&&"string"==typeof e&&!$Error.prepareStackTrace)for(;t--;)e=replace$8(e,V8_OR_CHAKRA_STACK_ENTRY,"");return e},fails$j=fails$s,createPropertyDescriptor$4=createPropertyDescriptor$7,errorStackInstallable=!fails$j((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",createPropertyDescriptor$4(1,7)),7!==e.stack)})),createNonEnumerableProperty$5=createNonEnumerableProperty$9,clearErrorStack$1=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(e,t,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(e,t):createNonEnumerableProperty$5(e,"stack",clearErrorStack$1(r,n)))},getBuiltIn$7=getBuiltIn$a,hasOwn$6=hasOwnProperty_1,createNonEnumerableProperty$4=createNonEnumerableProperty$9,isPrototypeOf$2=objectIsPrototypeOf,setPrototypeOf$2=objectSetPrototypeOf,copyConstructorProperties$1=copyConstructorProperties$3,proxyAccessor=proxyAccessor$1,inheritIfRequired$1=inheritIfRequired$2,normalizeStringArgument$1=normalizeStringArgument$2,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,DESCRIPTORS$d=descriptors,wrapErrorConstructorWithCause$1=function(e,t,r,n){var o="stackTraceLimit",a=n?2:1,s=e.split("."),i=s[s.length-1],c=getBuiltIn$7.apply(null,s);if(c){var l=c.prototype;if(hasOwn$6(l,"cause")&&delete l.cause,!r)return c;var d=getBuiltIn$7("Error"),u=t((function(e,t){var r=normalizeStringArgument$1(n?t:e,void 0),o=n?new c(e):new c;return void 0!==r&&createNonEnumerableProperty$4(o,"message",r),installErrorStack(o,u,o.stack,2),this&&isPrototypeOf$2(l,this)&&inheritIfRequired$1(o,this,u),arguments.length>a&&installErrorCause(o,arguments[a]),o}));u.prototype=l,"Error"!==i?setPrototypeOf$2?setPrototypeOf$2(u,d):copyConstructorProperties$1(u,d,{name:!0}):DESCRIPTORS$d&&o in c&&(proxyAccessor(u,c,o),proxyAccessor(u,c,"prepareStackTrace")),copyConstructorProperties$1(u,c);try{l.name!==i&&createNonEnumerableProperty$4(l,"name",i),l.constructor=u}catch(e){}return u}},$$p=_export,global$f=global$q,apply$2=functionApply,wrapErrorConstructorWithCause=wrapErrorConstructorWithCause$1,WEB_ASSEMBLY="WebAssembly",WebAssembly=global$f[WEB_ASSEMBLY],FORCED$2=7!==Error("e",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(e,t){var r={};r[e]=wrapErrorConstructorWithCause(e,t,FORCED$2),$$p({global:!0,constructor:!0,arity:1,forced:FORCED$2},r)},exportWebAssemblyErrorCauseWrapper=function(e,t){if(WebAssembly&&WebAssembly[e]){var r={};r[e]=wrapErrorConstructorWithCause(WEB_ASSEMBLY+"."+e,t,FORCED$2),$$p({target:WEB_ASSEMBLY,stat:!0,constructor:!0,arity:1,forced:FORCED$2},r)}};exportGlobalErrorCauseWrapper("Error",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("EvalError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("RangeError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("ReferenceError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("SyntaxError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("TypeError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportGlobalErrorCauseWrapper("URIError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportWebAssemblyErrorCauseWrapper("CompileError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportWebAssemblyErrorCauseWrapper("LinkError",(function(e){return function(t){return apply$2(e,this,arguments)}})),exportWebAssemblyErrorCauseWrapper("RuntimeError",(function(e){return function(t){return apply$2(e,this,arguments)}}));var classof$7=classofRaw$2,isArray$4=Array.isArray||function(e){return"Array"==classof$7(e)},DESCRIPTORS$c=descriptors,isArray$3=isArray$4,$TypeError$a=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$c&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(e,t){if(isArray$3(e)&&!getOwnPropertyDescriptor$1(e,"length").writable)throw $TypeError$a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},$TypeError$9=TypeError,MAX_SAFE_INTEGER=9007199254740991,doesNotExceedSafeInteger$1=function(e){if(e>MAX_SAFE_INTEGER)throw $TypeError$9("Maximum allowed index exceeded");return e},$$o=_export,toObject$6=toObject$8,lengthOfArrayLike$4=lengthOfArrayLike$6,setArrayLength=arraySetLength,doesNotExceedSafeInteger=doesNotExceedSafeInteger$1,fails$i=fails$s,INCORRECT_TO_LENGTH=fails$i((function(){return 4294967297!==[].push.call({length:4294967296},1)})),properErrorOnNonWritableLength=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},FORCED$1=INCORRECT_TO_LENGTH||!properErrorOnNonWritableLength();$$o({target:"Array",proto:!0,arity:1,forced:FORCED$1},{push:function(e){var t=toObject$6(this),r=lengthOfArrayLike$4(t),n=arguments.length;doesNotExceedSafeInteger(r+n);for(var o=0;o<n;o++)t[r]=arguments[o],r++;return setArrayLength(t,r),r}});var uncurryThis$o=functionUncurryThis,arraySlice$4=uncurryThis$o([].slice),uncurryThis$n=functionUncurryThis,isArray$2=isArray$4,isCallable$a=isCallable$o,classof$6=classofRaw$2,toString$6=toString$8,push$4=uncurryThis$n([].push),getJsonReplacerFunction=function(e){if(isCallable$a(e))return e;if(isArray$2(e)){for(var t=e.length,r=[],n=0;n<t;n++){var o=e[n];"string"==typeof o?push$4(r,o):"number"!=typeof o&&"Number"!=classof$6(o)&&"String"!=classof$6(o)||push$4(r,toString$6(o))}var a=r.length,s=!0;return function(e,t){if(s)return s=!1,t;if(isArray$2(this))return t;for(var n=0;n<a;n++)if(r[n]===e)return t}}},$$n=_export,getBuiltIn$6=getBuiltIn$a,apply$1=functionApply,call$c=functionCall,uncurryThis$m=functionUncurryThis,fails$h=fails$s,isCallable$9=isCallable$o,isSymbol=isSymbol$3,arraySlice$3=arraySlice$4,getReplacerFunction=getJsonReplacerFunction,NATIVE_SYMBOL$1=symbolConstructorDetection,$String=String,$stringify=getBuiltIn$6("JSON","stringify"),exec$4=uncurryThis$m(/./.exec),charAt$7=uncurryThis$m("".charAt),charCodeAt$2=uncurryThis$m("".charCodeAt),replace$7=uncurryThis$m("".replace),numberToString$1=uncurryThis$m(1..toString),tester=/[\uD800-\uDFFF]/g,low=/^[\uD800-\uDBFF]$/,hi=/^[\uDC00-\uDFFF]$/,WRONG_SYMBOLS_CONVERSION=!NATIVE_SYMBOL$1||fails$h((function(){var e=getBuiltIn$6("Symbol")();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))})),ILL_FORMED_UNICODE=fails$h((function(){return'"\\udf06\\ud834"'!==$stringify("\udf06\ud834")||'"\\udead"'!==$stringify("\udead")})),stringifyWithSymbolsFix=function(e,t){var r=arraySlice$3(arguments),n=getReplacerFunction(t);if(isCallable$9(n)||void 0!==e&&!isSymbol(e))return r[1]=function(e,t){if(isCallable$9(n)&&(t=call$c(n,this,$String(e),t)),!isSymbol(t))return t},apply$1($stringify,null,r)},fixIllFormed=function(e,t,r){var n=charAt$7(r,t-1),o=charAt$7(r,t+1);return exec$4(low,e)&&!exec$4(hi,o)||exec$4(hi,e)&&!exec$4(low,n)?"\\u"+numberToString$1(charCodeAt$2(e,0),16):e};$stringify&&$$n({target:"JSON",stat:!0,arity:3,forced:WRONG_SYMBOLS_CONVERSION||ILL_FORMED_UNICODE},{stringify:function(e,t,r){var n=arraySlice$3(arguments),o=apply$1(WRONG_SYMBOLS_CONVERSION?stringifyWithSymbolsFix:$stringify,null,n);return ILL_FORMED_UNICODE&&"string"==typeof o?replace$7(o,tester,fixIllFormed):o}});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$1=documentCreateElement$2,classList=documentCreateElement$1("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$b=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$c=anObject$g,toIndexedObject$1=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$b&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$c(e);for(var r,n=toIndexedObject$1(t),o=objectKeys$1(t),a=o.length,s=0;a>s;)definePropertyModule$1.f(e,r=o[s++],n[r]);return e};var getBuiltIn$5=getBuiltIn$a,html$1=getBuiltIn$5("document","documentElement"),anObject$b=anObject$g,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$1,documentCreateElement=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE$1="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE$1][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE$1]=anObject$b(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE$1]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)},wellKnownSymbol$c=wellKnownSymbol$g,create$3=objectCreate,defineProperty$5=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$c("unscopables"),ArrayPrototype$1=Array.prototype;null==ArrayPrototype$1[UNSCOPABLES]&&defineProperty$5(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$3(null)});var addToUnscopables$1=function(e){ArrayPrototype$1[UNSCOPABLES][e]=!0},iterators={},fails$g=fails$s,correctPrototypeGetter=!fails$g((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),hasOwn$5=hasOwnProperty_1,isCallable$8=isCallable$o,toObject$5=toObject$8,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object=Object,ObjectPrototype$1=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t=toObject$5(e);if(hasOwn$5(t,IE_PROTO))return t[IE_PROTO];var r=t.constructor;return isCallable$8(r)&&t instanceof r?r.prototype:t instanceof $Object?ObjectPrototype$1:null},fails$f=fails$s,isCallable$7=isCallable$o,isObject$2=isObject$a,getPrototypeOf$2=objectGetPrototypeOf,defineBuiltIn$6=defineBuiltIn$8,wellKnownSymbol$b=wellKnownSymbol$g,ITERATOR$6=wellKnownSymbol$b("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$2(IteratorPrototype$2)||fails$f((function(){var e={};return IteratorPrototype$2[ITERATOR$6].call(e)!==e}));NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={}),isCallable$7(IteratorPrototype$2[ITERATOR$6])||defineBuiltIn$6(IteratorPrototype$2,ITERATOR$6,(function(){return this}));var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$4=objectDefineProperty.f,hasOwn$4=hasOwnProperty_1,wellKnownSymbol$a=wellKnownSymbol$g,TO_STRING_TAG$1=wellKnownSymbol$a("toStringTag"),setToStringTag$6=function(e,t,r){e&&!r&&(e=e.prototype),e&&!hasOwn$4(e,TO_STRING_TAG$1)&&defineProperty$4(e,TO_STRING_TAG$1,{configurable:!0,value:t})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$7,setToStringTag$5=setToStringTag$6,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function(e,t,r,n){var o=t+" Iterator";return e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$3(+!n,r)}),setToStringTag$5(e,o,!1),Iterators$4[o]=returnThis$1,e},$$m=_export,call$b=functionCall,FunctionName$1=functionName,isCallable$6=isCallable$o,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$1=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,setToStringTag$4=setToStringTag$6,createNonEnumerableProperty$3=createNonEnumerableProperty$9,defineBuiltIn$5=defineBuiltIn$8,wellKnownSymbol$9=wellKnownSymbol$g,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$2=FunctionName$1.PROPER,CONFIGURABLE_FUNCTION_NAME$1=FunctionName$1.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$5=wellKnownSymbol$9("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function(e,t,r,n,o,a,s){createIteratorConstructor$1(r,t,n);var i,c,l,d=function(e){if(e===o&&y)return y;if(!BUGGY_SAFARI_ITERATORS&&e in f)return f[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},u=t+" Iterator",p=!1,f=e.prototype,h=f[ITERATOR$5]||f["@@iterator"]||o&&f[o],y=!BUGGY_SAFARI_ITERATORS&&h||d(o),g="Array"==t&&f.entries||h;if(g&&(i=getPrototypeOf$1(g.call(new e)))!==Object.prototype&&i.next&&(getPrototypeOf$1(i)!==IteratorPrototype&&(setPrototypeOf$1?setPrototypeOf$1(i,IteratorPrototype):isCallable$6(i[ITERATOR$5])||defineBuiltIn$5(i,ITERATOR$5,returnThis)),setToStringTag$4(i,u,!0)),PROPER_FUNCTION_NAME$2&&o==VALUES&&h&&h.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME$1?createNonEnumerableProperty$3(f,"name",VALUES):(p=!0,y=function(){return call$b(h,this)})),o)if(c={values:d(VALUES),keys:a?y:d(KEYS),entries:d(ENTRIES)},s)for(l in c)(BUGGY_SAFARI_ITERATORS||p||!(l in f))&&defineBuiltIn$5(f,l,c[l]);else $$m({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||p},c);return f[ITERATOR$5]!==y&&defineBuiltIn$5(f,ITERATOR$5,y,{name:o}),Iterators$3[t]=y,c},createIterResultObject$2=function(e,t){return{value:e,done:t}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$1,Iterators$2=iterators,InternalStateModule$4=internalState,defineProperty$3=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$1=createIterResultObject$2,DESCRIPTORS$a=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$4=InternalStateModule$4.set,getInternalState$2=InternalStateModule$4.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",(function(e,t){setInternalState$4(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=getInternalState$2(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,createIterResultObject$1(void 0,!0)):createIterResultObject$1("keys"==r?n:"values"==r?t[n]:[n,t[n]],!1)}),"values"),values=Iterators$2.Arguments=Iterators$2.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),DESCRIPTORS$a&&"values"!==values.name)try{defineProperty$3(values,"name",{value:"values"})}catch(e){}var global$e=global$q,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$2=createNonEnumerableProperty$9,wellKnownSymbol$8=wellKnownSymbol$g,ITERATOR$4=wellKnownSymbol$8("iterator"),TO_STRING_TAG=wellKnownSymbol$8("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(e,t){if(e){if(e[ITERATOR$4]!==ArrayValues)try{createNonEnumerableProperty$2(e,ITERATOR$4,ArrayValues)}catch(t){e[ITERATOR$4]=ArrayValues}if(e[TO_STRING_TAG]||createNonEnumerableProperty$2(e,TO_STRING_TAG,t),DOMIterables[t])for(var r in ArrayIteratorMethods)if(e[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty$2(e,r,ArrayIteratorMethods[r])}catch(t){e[r]=ArrayIteratorMethods[r]}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(global$e[COLLECTION_NAME]&&global$e[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var anObject$a=anObject$g,regexpFlags$1=function(){var e=anObject$a(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$e=fails$s,global$d=global$q,$RegExp$2=global$d.RegExp,UNSUPPORTED_Y$1=fails$e((function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),MISSED_STICKY=UNSUPPORTED_Y$1||fails$e((function(){return!$RegExp$2("a","y").sticky})),BROKEN_CARET=UNSUPPORTED_Y$1||fails$e((function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$1},fails$d=fails$s,global$c=global$q,$RegExp$1=global$c.RegExp,regexpUnsupportedDotAll=fails$d((function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),fails$c=fails$s,global$b=global$q,$RegExp=global$b.RegExp,regexpUnsupportedNcg=fails$c((function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),call$a=functionCall,uncurryThis$l=functionUncurryThis,toString$5=toString$8,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=sharedExports,create$1=objectCreate,getInternalState$1=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$6=uncurryThis$l("".charAt),indexOf=uncurryThis$l("".indexOf),replace$6=uncurryThis$l("".replace),stringSlice$6=uncurryThis$l("".slice),UPDATES_LAST_INDEX_WRONG=(re1=/a/,re2=/b*/g,call$a(nativeExec,re1,"a"),call$a(nativeExec,re2,"a"),0!==re1.lastIndex||0!==re2.lastIndex),re1,re2,UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;PATCH&&(patchedExec=function(e){var t,r,n,o,a,s,i,c=this,l=getInternalState$1(c),d=toString$5(e),u=l.raw;if(u)return u.lastIndex=c.lastIndex,t=call$a(patchedExec,u,d),c.lastIndex=u.lastIndex,t;var p=l.groups,f=UNSUPPORTED_Y&&c.sticky,h=call$a(regexpFlags,c),y=c.source,g=0,m=d;if(f&&(h=replace$6(h,"y",""),-1===indexOf(h,"g")&&(h+="g"),m=stringSlice$6(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==charAt$6(d,c.lastIndex-1))&&(y="(?: "+y+")",m=" "+m,g++),r=new RegExp("^(?:"+y+")",h)),NPCG_INCLUDED&&(r=new RegExp("^"+y+"$(?!\\s)",h)),UPDATES_LAST_INDEX_WRONG&&(n=c.lastIndex),o=call$a(nativeExec,f?r:c,m),f?o?(o.input=stringSlice$6(o.input,g),o[0]=stringSlice$6(o[0],g),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&o&&(c.lastIndex=c.global?o.index+o[0].length:n),NPCG_INCLUDED&&o&&o.length>1&&call$a(nativeReplace,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&p)for(o.groups=s=create$1(null),a=0;a<p.length;a++)s[(i=p[a])[0]]=o[i[1]];return o});var regexpExec$2=patchedExec,$$l=_export,exec$3=regexpExec$2;$$l({target:"RegExp",proto:!0,forced:/./.exec!==exec$3},{exec:exec$3});var classofRaw=classofRaw$2,uncurryThis$k=functionUncurryThis,functionUncurryThisClause=function(e){if("Function"===classofRaw(e))return uncurryThis$k(e)},uncurryThis$j=functionUncurryThisClause,defineBuiltIn$4=defineBuiltIn$8,regexpExec$1=regexpExec$2,fails$b=fails$s,wellKnownSymbol$7=wellKnownSymbol$g,createNonEnumerableProperty$1=createNonEnumerableProperty$9,SPECIES$2=wellKnownSymbol$7("species"),RegExpPrototype=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(e,t,r,n){var o=wellKnownSymbol$7(e),a=!fails$b((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),s=a&&!fails$b((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES$2]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t}));if(!a||!s||r){var i=uncurryThis$j(/./[o]),c=t(o,""[e],(function(e,t,r,n,o){var s=uncurryThis$j(e),c=t.exec;return c===regexpExec$1||c===RegExpPrototype.exec?a&&!o?{done:!0,value:i(t,r,n)}:{done:!0,value:s(r,t,n)}:{done:!1}}));defineBuiltIn$4(String.prototype,e,c[0]),defineBuiltIn$4(RegExpPrototype,o,c[1])}n&&createNonEnumerableProperty$1(RegExpPrototype[o],"sham",!0)},uncurryThis$i=functionUncurryThis,toIntegerOrInfinity$4=toIntegerOrInfinity$7,toString$4=toString$8,requireObjectCoercible$2=requireObjectCoercible$5,charAt$5=uncurryThis$i("".charAt),charCodeAt$1=uncurryThis$i("".charCodeAt),stringSlice$5=uncurryThis$i("".slice),createMethod$2=function(e){return function(t,r){var n,o,a=toString$4(requireObjectCoercible$2(t)),s=toIntegerOrInfinity$4(r),i=a.length;return s<0||s>=i?e?"":void 0:(n=charCodeAt$1(a,s))<55296||n>56319||s+1===i||(o=charCodeAt$1(a,s+1))<56320||o>57343?e?charAt$5(a,s):n:e?stringSlice$5(a,s,s+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$2(!1),charAt:createMethod$2(!0)},charAt$4=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,r){return t+(r?charAt$4(e,t).length:1)},uncurryThis$h=functionUncurryThis,toObject$4=toObject$8,floor$4=Math.floor,charAt$3=uncurryThis$h("".charAt),replace$5=uncurryThis$h("".replace),stringSlice$4=uncurryThis$h("".slice),SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g,getSubstitution$1=function(e,t,r,n,o,a){var s=r+e.length,i=n.length,c=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==o&&(o=toObject$4(o),c=SUBSTITUTION_SYMBOLS),replace$5(a,c,(function(a,c){var l;switch(charAt$3(c,0)){case"$":return"$";case"&":return e;case"`":return stringSlice$4(t,0,r);case"'":return stringSlice$4(t,s);case"<":l=o[stringSlice$4(c,1,-1)];break;default:var d=+c;if(0===d)return a;if(d>i){var u=floor$4(d/10);return 0===u?a:u<=i?void 0===n[u-1]?charAt$3(c,1):n[u-1]+charAt$3(c,1):a}l=n[d-1]}return void 0===l?"":l}))},call$9=functionCall,anObject$9=anObject$g,isCallable$5=isCallable$o,classof$5=classofRaw$2,regexpExec=regexpExec$2,$TypeError$8=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$5(r)){var n=call$9(r,e,t);return null!==n&&anObject$9(n),n}if("RegExp"===classof$5(e))return call$9(regexpExec,e,t);throw $TypeError$8("RegExp#exec called on incompatible receiver")},apply=functionApply,call$8=functionCall,uncurryThis$g=functionUncurryThis,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,fails$a=fails$s,anObject$8=anObject$g,isCallable$4=isCallable$o,isNullOrUndefined$2=isNullOrUndefined$5,toIntegerOrInfinity$3=toIntegerOrInfinity$7,toLength$3=toLength$5,toString$3=toString$8,requireObjectCoercible$1=requireObjectCoercible$5,advanceStringIndex=advanceStringIndex$1,getMethod$2=getMethod$4,getSubstitution=getSubstitution$1,regExpExec=regexpExecAbstract,wellKnownSymbol$6=wellKnownSymbol$g,REPLACE=wellKnownSymbol$6("replace"),max$2=Math.max,min$1=Math.min,concat$1=uncurryThis$g([].concat),push$3=uncurryThis$g([].push),stringIndexOf=uncurryThis$g("".indexOf),stringSlice$3=uncurryThis$g("".slice),maybeToString=function(e){return void 0===e?e:String(e)},REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),REPLACE_SUPPORTS_NAMED_GROUPS=!fails$a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));fixRegExpWellKnownSymbolLogic("replace",(function(e,t,r){var n=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function(e,r){var n=requireObjectCoercible$1(this),o=isNullOrUndefined$2(e)?void 0:getMethod$2(e,REPLACE);return o?call$8(o,e,n,r):call$8(t,toString$3(n),e,r)},function(e,o){var a=anObject$8(this),s=toString$3(e);if("string"==typeof o&&-1===stringIndexOf(o,n)&&-1===stringIndexOf(o,"$<")){var i=r(t,a,s,o);if(i.done)return i.value}var c=isCallable$4(o);c||(o=toString$3(o));var l=a.global;if(l){var d=a.unicode;a.lastIndex=0}for(var u=[];;){var p=regExpExec(a,s);if(null===p)break;if(push$3(u,p),!l)break;""===toString$3(p[0])&&(a.lastIndex=advanceStringIndex(s,toLength$3(a.lastIndex),d))}for(var f="",h=0,y=0;y<u.length;y++){for(var g=toString$3((p=u[y])[0]),m=max$2(min$1(toIntegerOrInfinity$3(p.index),s.length),0),$=[],S=1;S<p.length;S++)push$3($,maybeToString(p[S]));var b=p.groups;if(c){var v=concat$1([g],$,m,s);void 0!==b&&push$3(v,b);var T=toString$3(apply(o,void 0,v))}else T=getSubstitution(g,s,m,$,b,o);m>=h&&(f+=stringSlice$3(s,h,m)+T,h=m+g.length)}return f+stringSlice$3(s,h)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var toggleSelection=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||r.forEach((function(t){e.addRange(t)})),t&&t.focus()}},deselectCurrent=toggleSelection,clipboardToIE11Formatting={"text/plain":"Text","text/html":"Url",default:"Text"},defaultMessage="Copy to clipboard: #{key}, Enter";function format(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function copy(e,t){var r,n,o,a,s,i,c=!1;t||(t={}),r=t.debug||!1;try{if(o=deselectCurrent(),a=document.createRange(),s=document.getSelection(),(i=document.createElement("span")).textContent=e,i.ariaHidden="true",i.style.all="unset",i.style.position="fixed",i.style.top=0,i.style.clip="rect(0, 0, 0, 0)",i.style.whiteSpace="pre",i.style.webkitUserSelect="text",i.style.MozUserSelect="text",i.style.msUserSelect="text",i.style.userSelect="text",i.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=clipboardToIE11Formatting[t.format]||clipboardToIE11Formatting.default;window.clipboardData.setData(o,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(i),a.selectNodeContents(i),s.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(o){r&&console.error("unable to copy using execCommand: ",o),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(o){r&&console.error("unable to copy using clipboardData: ",o),r&&console.error("falling back to prompt"),n=format("message"in t?t.message:defaultMessage),window.prompt(n,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(a):s.removeAllRanges()),i&&document.body.removeChild(i),o()}return c}var copyToClipboard=copy,copy$1=getDefaultExportFromCjs(copyToClipboard),aCallable$4=aCallable$7,toObject$3=toObject$8,IndexedObject$1=indexedObject,lengthOfArrayLike$3=lengthOfArrayLike$6,$TypeError$7=TypeError,createMethod$1=function(e){return function(t,r,n,o){aCallable$4(r);var a=toObject$3(t),s=IndexedObject$1(a),i=lengthOfArrayLike$3(a),c=e?i-1:0,l=e?-1:1;if(n<2)for(;;){if(c in s){o=s[c],c+=l;break}if(c+=l,e?c<0:i<=c)throw $TypeError$7("Reduce of empty array with no initial value")}for(;e?c>=0:i>c;c+=l)c in s&&(o=r(o,s[c],c,a));return o}},arrayReduce={left:createMethod$1(!1),right:createMethod$1(!0)},fails$9=fails$s,arrayMethodIsStrict$1=function(e,t){var r=[][e];return!!r&&fails$9((function(){r.call(null,t||function(){return 1},1)}))},classof$4=classofRaw$2,engineIsNode="undefined"!=typeof process&&"process"==classof$4(process),$$k=_export,$reduce=arrayReduce.left,arrayMethodIsStrict=arrayMethodIsStrict$1,CHROME_VERSION=engineV8Version,IS_NODE$2=engineIsNode,CHROME_BUG=!IS_NODE$2&&CHROME_VERSION>79&&CHROME_VERSION<83,FORCED=CHROME_BUG||!arrayMethodIsStrict("reduce");$$k({target:"Array",proto:!0,forced:FORCED},{reduce:function(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:void 0)}});var arrayBufferBasicDetection="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,makeBuiltIn=makeBuiltInExports,defineProperty$2=objectDefineProperty,defineBuiltInAccessor$7=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty$2.f(e,t,r)},defineBuiltIn$3=defineBuiltIn$8,defineBuiltIns$2=function(e,t,r){for(var n in t)defineBuiltIn$3(e,n,t[n],r);return e},isPrototypeOf$1=objectIsPrototypeOf,$TypeError$6=TypeError,anInstance$4=function(e,t){if(isPrototypeOf$1(t,e))return e;throw $TypeError$6("Incorrect invocation")},toIntegerOrInfinity$2=toIntegerOrInfinity$7,toLength$2=toLength$5,$RangeError$1=RangeError,toIndex$2=function(e){if(void 0===e)return 0;var t=toIntegerOrInfinity$2(e),r=toLength$2(t);if(t!==r)throw $RangeError$1("Wrong length or index");return r},$Array$2=Array,abs=Math.abs,pow$1=Math.pow,floor$3=Math.floor,log=Math.log,LN2=Math.LN2,pack=function(e,t,r){var n,o,a,s=$Array$2(r),i=8*r-t-1,c=(1<<i)-1,l=c>>1,d=23===t?pow$1(2,-24)-pow$1(2,-77):0,u=e<0||0===e&&1/e<0?1:0,p=0;for((e=abs(e))!=e||e===1/0?(o=e!=e?1:0,n=c):(n=floor$3(log(e)/LN2),e*(a=pow$1(2,-n))<1&&(n--,a*=2),(e+=n+l>=1?d/a:d*pow$1(2,1-l))*a>=2&&(n++,a/=2),n+l>=c?(o=0,n=c):n+l>=1?(o=(e*a-1)*pow$1(2,t),n+=l):(o=e*pow$1(2,l-1)*pow$1(2,t),n=0));t>=8;)s[p++]=255&o,o/=256,t-=8;for(n=n<<t|o,i+=t;i>0;)s[p++]=255&n,n/=256,i-=8;return s[--p]|=128*u,s},unpack=function(e,t){var r,n=e.length,o=8*n-t-1,a=(1<<o)-1,s=a>>1,i=o-7,c=n-1,l=e[c--],d=127&l;for(l>>=7;i>0;)d=256*d+e[c--],i-=8;for(r=d&(1<<-i)-1,d>>=-i,i+=t;i>0;)r=256*r+e[c--],i-=8;if(0===d)d=1-s;else{if(d===a)return r?NaN:l?-1/0:1/0;r+=pow$1(2,t),d-=s}return(l?-1:1)*r*pow$1(2,d-t)},ieee754={pack:pack,unpack:unpack},toObject$2=toObject$8,toAbsoluteIndex$2=toAbsoluteIndex$4,lengthOfArrayLike$2=lengthOfArrayLike$6,arrayFill$1=function(e){for(var t=toObject$2(this),r=lengthOfArrayLike$2(t),n=arguments.length,o=toAbsoluteIndex$2(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,s=void 0===a?r:toAbsoluteIndex$2(a,r);s>o;)t[o++]=e;return t},toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$7,createProperty$2=function(e,t,r){var n=toPropertyKey(t);n in e?definePropertyModule.f(e,n,createPropertyDescriptor$2(0,r)):e[n]=r},toAbsoluteIndex$1=toAbsoluteIndex$4,lengthOfArrayLike$1=lengthOfArrayLike$6,createProperty$1=createProperty$2,$Array$1=Array,max$1=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$1(e),o=toAbsoluteIndex$1(t,n),a=toAbsoluteIndex$1(void 0===r?n:r,n),s=$Array$1(max$1(a-o,0)),i=0;o<a;o++,i++)createProperty$1(s,i,e[o]);return s.length=i,s},global$a=global$q,uncurryThis$f=functionUncurryThis,DESCRIPTORS$9=descriptors,NATIVE_ARRAY_BUFFER=arrayBufferBasicDetection,FunctionName=functionName,createNonEnumerableProperty=createNonEnumerableProperty$9,defineBuiltInAccessor$6=defineBuiltInAccessor$7,defineBuiltIns$1=defineBuiltIns$2,fails$8=fails$s,anInstance$3=anInstance$4,toIntegerOrInfinity$1=toIntegerOrInfinity$7,toLength$1=toLength$5,toIndex$1=toIndex$2,IEEE754=ieee754,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,getOwnPropertyNames=objectGetOwnPropertyNames.f,arrayFill=arrayFill$1,arraySlice$2=arraySliceSimple,setToStringTag$3=setToStringTag$6,InternalStateModule$3=internalState,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,ARRAY_BUFFER$1="ArrayBuffer",DATA_VIEW="DataView",PROTOTYPE="prototype",WRONG_LENGTH="Wrong length",WRONG_INDEX="Wrong index",getInternalArrayBufferState=InternalStateModule$3.getterFor(ARRAY_BUFFER$1),getInternalDataViewState=InternalStateModule$3.getterFor(DATA_VIEW),setInternalState$3=InternalStateModule$3.set,NativeArrayBuffer$1=global$a[ARRAY_BUFFER$1],$ArrayBuffer=NativeArrayBuffer$1,ArrayBufferPrototype$2=$ArrayBuffer&&$ArrayBuffer[PROTOTYPE],$DataView=global$a[DATA_VIEW],DataViewPrototype$2=$DataView&&$DataView[PROTOTYPE],ObjectPrototype=Object.prototype,Array$1=global$a.Array,RangeError$1=global$a.RangeError,fill=uncurryThis$f(arrayFill),reverse=uncurryThis$f([].reverse),packIEEE754=IEEE754.pack,unpackIEEE754=IEEE754.unpack,packInt8=function(e){return[255&e]},packInt16=function(e){return[255&e,e>>8&255]},packInt32=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},unpackInt32=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},packFloat32=function(e){return packIEEE754(e,23,4)},packFloat64=function(e){return packIEEE754(e,52,8)},addGetter=function(e,t,r){defineBuiltInAccessor$6(e[PROTOTYPE],t,{configurable:!0,get:function(){return r(this)[t]}})},get=function(e,t,r,n){var o=toIndex$1(r),a=getInternalDataViewState(e);if(o+t>a.byteLength)throw RangeError$1(WRONG_INDEX);var s=a.bytes,i=o+a.byteOffset,c=arraySlice$2(s,i,i+t);return n?c:reverse(c)},set=function(e,t,r,n,o,a){var s=toIndex$1(r),i=getInternalDataViewState(e);if(s+t>i.byteLength)throw RangeError$1(WRONG_INDEX);for(var c=i.bytes,l=s+i.byteOffset,d=n(+o),u=0;u<t;u++)c[l+u]=d[a?u:t-u-1]};if(NATIVE_ARRAY_BUFFER){var INCORRECT_ARRAY_BUFFER_NAME=PROPER_FUNCTION_NAME$1&&NativeArrayBuffer$1.name!==ARRAY_BUFFER$1;if(fails$8((function(){NativeArrayBuffer$1(1)}))&&fails$8((function(){new NativeArrayBuffer$1(-1)}))&&!fails$8((function(){return new NativeArrayBuffer$1,new NativeArrayBuffer$1(1.5),new NativeArrayBuffer$1(NaN),1!=NativeArrayBuffer$1.length||INCORRECT_ARRAY_BUFFER_NAME&&!CONFIGURABLE_FUNCTION_NAME})))INCORRECT_ARRAY_BUFFER_NAME&&CONFIGURABLE_FUNCTION_NAME&&createNonEnumerableProperty(NativeArrayBuffer$1,"name",ARRAY_BUFFER$1);else{$ArrayBuffer=function(e){return anInstance$3(this,ArrayBufferPrototype$2),new NativeArrayBuffer$1(toIndex$1(e))},$ArrayBuffer[PROTOTYPE]=ArrayBufferPrototype$2;for(var keys$1=getOwnPropertyNames(NativeArrayBuffer$1),j=0,key$1;keys$1.length>j;)(key$1=keys$1[j++])in $ArrayBuffer||createNonEnumerableProperty($ArrayBuffer,key$1,NativeArrayBuffer$1[key$1]);ArrayBufferPrototype$2.constructor=$ArrayBuffer}setPrototypeOf&&getPrototypeOf(DataViewPrototype$2)!==ObjectPrototype&&setPrototypeOf(DataViewPrototype$2,ObjectPrototype);var testView=new $DataView(new $ArrayBuffer(2)),$setInt8=uncurryThis$f(DataViewPrototype$2.setInt8);testView.setInt8(0,2147483648),testView.setInt8(1,2147483649),!testView.getInt8(0)&&testView.getInt8(1)||defineBuiltIns$1(DataViewPrototype$2,{setInt8:function(e,t){$setInt8(this,e,t<<24>>24)},setUint8:function(e,t){$setInt8(this,e,t<<24>>24)}},{unsafe:!0})}else $ArrayBuffer=function(e){anInstance$3(this,ArrayBufferPrototype$2);var t=toIndex$1(e);setInternalState$3(this,{type:ARRAY_BUFFER$1,bytes:fill(Array$1(t),0),byteLength:t}),DESCRIPTORS$9||(this.byteLength=t,this.detached=!1)},ArrayBufferPrototype$2=$ArrayBuffer[PROTOTYPE],$DataView=function(e,t,r){anInstance$3(this,DataViewPrototype$2),anInstance$3(e,ArrayBufferPrototype$2);var n=getInternalArrayBufferState(e),o=n.byteLength,a=toIntegerOrInfinity$1(t);if(a<0||a>o)throw RangeError$1("Wrong offset");if(a+(r=void 0===r?o-a:toLength$1(r))>o)throw RangeError$1(WRONG_LENGTH);setInternalState$3(this,{type:DATA_VIEW,buffer:e,byteLength:r,byteOffset:a,bytes:n.bytes}),DESCRIPTORS$9||(this.buffer=e,this.byteLength=r,this.byteOffset=a)},DataViewPrototype$2=$DataView[PROTOTYPE],DESCRIPTORS$9&&(addGetter($ArrayBuffer,"byteLength",getInternalArrayBufferState),addGetter($DataView,"buffer",getInternalDataViewState),addGetter($DataView,"byteLength",getInternalDataViewState),addGetter($DataView,"byteOffset",getInternalDataViewState)),defineBuiltIns$1(DataViewPrototype$2,{getInt8:function(e){return get(this,1,e)[0]<<24>>24},getUint8:function(e){return get(this,1,e)[0]},getInt16:function(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=get(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return unpackInt32(get(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return unpackIEEE754(get(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return unpackIEEE754(get(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){set(this,1,e,packInt8,t)},setUint8:function(e,t){set(this,1,e,packInt8,t)},setInt16:function(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){set(this,2,e,packInt16,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){set(this,4,e,packInt32,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){set(this,4,e,packFloat32,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){set(this,8,e,packFloat64,t,arguments.length>2?arguments[2]:void 0)}});setToStringTag$3($ArrayBuffer,ARRAY_BUFFER$1),setToStringTag$3($DataView,DATA_VIEW);var arrayBuffer={ArrayBuffer:$ArrayBuffer,DataView:$DataView},getBuiltIn$4=getBuiltIn$a,defineBuiltInAccessor$5=defineBuiltInAccessor$7,wellKnownSymbol$5=wellKnownSymbol$g,DESCRIPTORS$8=descriptors,SPECIES$1=wellKnownSymbol$5("species"),setSpecies$1=function(e){var t=getBuiltIn$4(e);DESCRIPTORS$8&&t&&!t[SPECIES$1]&&defineBuiltInAccessor$5(t,SPECIES$1,{configurable:!0,get:function(){return this}})},$$j=_export,global$9=global$q,arrayBufferModule=arrayBuffer,setSpecies=setSpecies$1,ARRAY_BUFFER="ArrayBuffer",ArrayBuffer$3=arrayBufferModule[ARRAY_BUFFER],NativeArrayBuffer=global$9[ARRAY_BUFFER];$$j({global:!0,constructor:!0,forced:NativeArrayBuffer!==ArrayBuffer$3},{ArrayBuffer:ArrayBuffer$3}),setSpecies(ARRAY_BUFFER);var uncurryThis$e=functionUncurryThis,fails$7=fails$s,isCallable$3=isCallable$o,classof$3=classof$9,getBuiltIn$3=getBuiltIn$a,inspectSource=inspectSource$2,noop=function(){},empty=[],construct=getBuiltIn$3("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$e(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$3(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$3(e))return!1;switch(classof$3(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource(e))}catch(e){return!0}};isConstructorLegacy.sham=!0;var isConstructor$2=!construct||fails$7((function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){e=!0}))||e}))?isConstructorLegacy:isConstructorModern,isConstructor$1=isConstructor$2,tryToString$1=tryToString$3,$TypeError$5=TypeError,aConstructor$1=function(e){if(isConstructor$1(e))return e;throw $TypeError$5(tryToString$1(e)+" is not a constructor")},anObject$7=anObject$g,aConstructor=aConstructor$1,isNullOrUndefined$1=isNullOrUndefined$5,wellKnownSymbol$4=wellKnownSymbol$g,SPECIES=wellKnownSymbol$4("species"),speciesConstructor$2=function(e,t){var r,n=anObject$7(e).constructor;return void 0===n||isNullOrUndefined$1(r=anObject$7(n)[SPECIES])?t:aConstructor(r)},$$i=_export,uncurryThis$d=functionUncurryThisClause,fails$6=fails$s,ArrayBufferModule=arrayBuffer,anObject$6=anObject$g,toAbsoluteIndex=toAbsoluteIndex$4,toLength=toLength$5,speciesConstructor$1=speciesConstructor$2,ArrayBuffer$2=ArrayBufferModule.ArrayBuffer,DataView$2=ArrayBufferModule.DataView,DataViewPrototype$1=DataView$2.prototype,nativeArrayBufferSlice=uncurryThis$d(ArrayBuffer$2.prototype.slice),getUint8=uncurryThis$d(DataViewPrototype$1.getUint8),setUint8=uncurryThis$d(DataViewPrototype$1.setUint8),INCORRECT_SLICE=fails$6((function(){return!new ArrayBuffer$2(2).slice(1,void 0).byteLength}));$$i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:INCORRECT_SLICE},{slice:function(e,t){if(nativeArrayBufferSlice&&void 0===t)return nativeArrayBufferSlice(anObject$6(this),e);for(var r=anObject$6(this).byteLength,n=toAbsoluteIndex(e,r),o=toAbsoluteIndex(void 0===t?r:t,r),a=new(speciesConstructor$1(this,ArrayBuffer$2))(toLength(o-n)),s=new DataView$2(this),i=new DataView$2(a),c=0;n<o;)setUint8(i,c++,getUint8(s,n++));return a}});var uncurryThisAccessor$2=functionUncurryThisAccessor,classof$2=classofRaw$2,$TypeError$4=TypeError,arrayBufferByteLength$2=uncurryThisAccessor$2(ArrayBuffer.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!=classof$2(e))throw $TypeError$4("ArrayBuffer expected");return e.byteLength},uncurryThis$c=functionUncurryThis,arrayBufferByteLength$1=arrayBufferByteLength$2,slice$1=uncurryThis$c(ArrayBuffer.prototype.slice),arrayBufferIsDetached=function(e){if(0!==arrayBufferByteLength$1(e))return!1;try{return slice$1(e,0,0),!1}catch(e){return!0}},DESCRIPTORS$7=descriptors,defineBuiltInAccessor$4=defineBuiltInAccessor$7,isDetached$1=arrayBufferIsDetached,ArrayBufferPrototype$1=ArrayBuffer.prototype;DESCRIPTORS$7&&!("detached"in ArrayBufferPrototype$1)&&defineBuiltInAccessor$4(ArrayBufferPrototype$1,"detached",{configurable:!0,get:function(){return isDetached$1(this)}});var engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE$1&&"object"==typeof window&&"object"==typeof document,global$8=global$q,fails$5=fails$s,V8=engineV8Version,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,IS_NODE=engineIsNode,structuredClone$1=global$8.structuredClone,structuredCloneProperTransfer=!!structuredClone$1&&!fails$5((function(){if(IS_DENO&&V8>92||IS_NODE&&V8>94||IS_BROWSER&&V8>97)return!1;var e=new ArrayBuffer(8),t=structuredClone$1(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),global$7=global$q,uncurryThis$b=functionUncurryThis,uncurryThisAccessor$1=functionUncurryThisAccessor,toIndex=toIndex$2,isDetached=arrayBufferIsDetached,arrayBufferByteLength=arrayBufferByteLength$2,PROPER_TRANSFER=structuredCloneProperTransfer,TypeError$3=global$7.TypeError,structuredClone=global$7.structuredClone,ArrayBuffer$1=global$7.ArrayBuffer,DataView$1=global$7.DataView,min=Math.min,ArrayBufferPrototype=ArrayBuffer$1.prototype,DataViewPrototype=DataView$1.prototype,slice=uncurryThis$b(ArrayBufferPrototype.slice),isResizable=uncurryThisAccessor$1(ArrayBufferPrototype,"resizable","get"),maxByteLength=uncurryThisAccessor$1(ArrayBufferPrototype,"maxByteLength","get"),getInt8=uncurryThis$b(DataViewPrototype.getInt8),setInt8=uncurryThis$b(DataViewPrototype.setInt8),arrayBufferTransfer=PROPER_TRANSFER&&function(e,t,r){var n=arrayBufferByteLength(e),o=void 0===t?n:min(toIndex(t),n),a=!isResizable||!isResizable(e);if(isDetached(e))throw TypeError$3("ArrayBuffer is detached");var s=structuredClone(e,{transfer:[e]});if(n==o&&(r||a))return s;if(!r||a)return slice(s,0,o);for(var i=new ArrayBuffer$1(o,maxByteLength&&{maxByteLength:maxByteLength(s)}),c=new DataView$1(s),l=new DataView$1(i),d=0;d<o;d++)setInt8(l,d,getInt8(c,d));return i},$$h=_export,$transfer$1=arrayBufferTransfer;$transfer$1&&$$h({target:"ArrayBuffer",proto:!0},{transfer:function(){return $transfer$1(this,arguments.length?arguments[0]:void 0,!0)}});var $$g=_export,$transfer=arrayBufferTransfer;$transfer&&$$g({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return $transfer(this,arguments.length?arguments[0]:void 0,!1)}});var charAt$2=stringMultibyte.charAt,toString$2=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$2,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$2(e),index:0})}),(function(){var e,t=getInternalState(this),r=t.string,n=t.index;return n>=r.length?createIterResultObject(void 0,!0):(e=charAt$2(r,n),t.index+=e.length,createIterResultObject(e,!1))}));var fails$4=fails$s,wellKnownSymbol$3=wellKnownSymbol$g,DESCRIPTORS$6=descriptors,IS_PURE=isPure,ITERATOR$3=wellKnownSymbol$3("iterator"),urlConstructorDetection=!fails$4((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r="";return e.pathname="c%20d",t.forEach((function(e,n){t.delete("b"),r+=n+e})),IS_PURE&&!e.toJSON||!t.size&&(IS_PURE||!DESCRIPTORS$6)||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[ITERATOR$3]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),uncurryThis$a=functionUncurryThisClause,aCallable$3=aCallable$7,NATIVE_BIND=functionBindNative,bind$3=uncurryThis$a(uncurryThis$a.bind),functionBindContext=function(e,t){return aCallable$3(e),void 0===t?e:NATIVE_BIND?bind$3(e,t):function(){return e.apply(t,arguments)}},DESCRIPTORS$5=descriptors,uncurryThis$9=functionUncurryThis,call$7=functionCall,fails$3=fails$s,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$8,IndexedObject=indexedObject,$assign=Object.assign,defineProperty$1=Object.defineProperty,concat=uncurryThis$9([].concat),objectAssign=!$assign||fails$3((function(){if(DESCRIPTORS$5&&1!==$assign({b:1},$assign(defineProperty$1({},"a",{enumerable:!0,get:function(){defineProperty$1(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=$assign({},e)[r]||objectKeys($assign({},t)).join("")!=n}))?function(e,t){for(var r=toObject$1(e),n=arguments.length,o=1,a=getOwnPropertySymbolsModule.f,s=propertyIsEnumerableModule.f;n>o;)for(var i,c=IndexedObject(arguments[o++]),l=a?concat(objectKeys(c),a(c)):objectKeys(c),d=l.length,u=0;d>u;)i=l[u++],DESCRIPTORS$5&&!call$7(s,c,i)||(r[i]=c[i]);return r}:$assign,call$6=functionCall,anObject$5=anObject$g,getMethod$1=getMethod$4,iteratorClose$3=function(e,t,r){var n,o;anObject$5(e);try{if(!(n=getMethod$1(e,"return"))){if("throw"===t)throw r;return r}n=call$6(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$5(n),r},anObject$4=anObject$g,iteratorClose$2=iteratorClose$3,callWithSafeIterationClosing$1=function(e,t,r,n){try{return n?t(anObject$4(r)[0],r[1]):t(r)}catch(t){iteratorClose$2(e,"throw",t)}},wellKnownSymbol$2=wellKnownSymbol$g,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$2("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(e){return void 0!==e&&(Iterators$1.Array===e||ArrayPrototype[ITERATOR$2]===e)},classof$1=classof$9,getMethod=getMethod$4,isNullOrUndefined=isNullOrUndefined$5,Iterators=iterators,wellKnownSymbol$1=wellKnownSymbol$g,ITERATOR$1=wellKnownSymbol$1("iterator"),getIteratorMethod$3=function(e){if(!isNullOrUndefined(e))return getMethod(e,ITERATOR$1)||getMethod(e,"@@iterator")||Iterators[classof$1(e)]},call$5=functionCall,aCallable$2=aCallable$7,anObject$3=anObject$g,tryToString=tryToString$3,getIteratorMethod$2=getIteratorMethod$3,$TypeError$3=TypeError,getIterator$2=function(e,t){var r=arguments.length<2?getIteratorMethod$2(e):t;if(aCallable$2(r))return anObject$3(call$5(r,e));throw $TypeError$3(tryToString(e)+" is not iterable")},bind$2=functionBindContext,call$4=functionCall,toObject=toObject$8,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$1,isConstructor=isConstructor$2,lengthOfArrayLike=lengthOfArrayLike$6,createProperty=createProperty$2,getIterator$1=getIterator$2,getIteratorMethod$1=getIteratorMethod$3,$Array=Array,arrayFrom$1=function(e){var t=toObject(e),r=isConstructor(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=void 0!==o;a&&(o=bind$2(o,n>2?arguments[2]:void 0));var s,i,c,l,d,u,p=getIteratorMethod$1(t),f=0;if(!p||this===$Array&&isArrayIteratorMethod(p))for(s=lengthOfArrayLike(t),i=r?new this(s):$Array(s);s>f;f++)u=a?o(t[f],f):t[f],createProperty(i,f,u);else for(d=(l=getIterator$1(t,p)).next,i=r?new this:[];!(c=call$4(d,l)).done;f++)u=a?callWithSafeIterationClosing(l,o,[c.value,f],!0):c.value,createProperty(i,f,u);return i.length=f,i},uncurryThis$8=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$8(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$8("".charCodeAt),join$2=uncurryThis$8([].join),push$2=uncurryThis$8([].push),replace$4=uncurryThis$8("".replace),split$2=uncurryThis$8("".split),toLowerCase$1=uncurryThis$8("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=charCodeAt(e,r++);if(o>=55296&&o<=56319&&r<n){var a=charCodeAt(e,r++);56320==(64512&a)?push$2(t,((1023&o)<<10)+(1023&a)+65536):(push$2(t,o),r--)}else push$2(t,o)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);e>baseMinusTMin*tMax>>1;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r,n=[],o=(e=ucs2decode(e)).length,a=initialN,s=0,i=initialBias;for(t=0;t<e.length;t++)(r=e[t])<128&&push$2(n,fromCharCode(r));var c=n.length,l=c;for(c&&push$2(n,delimiter);l<o;){var d=maxInt;for(t=0;t<e.length;t++)(r=e[t])>=a&&r<d&&(d=r);var u=l+1;if(d-a>floor$2((maxInt-s)/u))throw $RangeError(OVERFLOW_ERROR);for(s+=(d-a)*u,a=d,t=0;t<e.length;t++){if((r=e[t])<a&&++s>maxInt)throw $RangeError(OVERFLOW_ERROR);if(r==a){for(var p=s,f=base;;){var h=f<=i?tMin:f>=i+tMax?tMax:f-i;if(p<h)break;var y=p-h,g=base-h;push$2(n,fromCharCode(digitToBasic(h+y%g))),p=floor$2(y/g),f+=base}push$2(n,fromCharCode(digitToBasic(p))),i=adapt(s,u,l==c),s=0,l++}}s++,a++}return join$2(n,"")},stringPunycodeToAscii=function(e){var t,r,n=[],o=split$2(replace$4(toLowerCase$1(e),regexSeparators,"."),".");for(t=0;t<o.length;t++)r=o[t],push$2(n,exec$1(regexNonASCII,r)?"xn--"+encode(r):r);return join$2(n,".")},$TypeError$2=TypeError,validateArgumentsLength$2=function(e,t){if(e<t)throw $TypeError$2("Not enough arguments");return e},arraySlice$1=arraySliceSimple,floor$1=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$1(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$1(e,0,n),t),mergeSort(arraySlice$1(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,a=1;a<o;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,a=r.length,s=0,i=0;s<o||i<a;)e[s+i]=s<o&&i<a?n(t[s],r[i])<=0?t[s++]:r[i++]:s<o?t[s++]:r[i++];return e},arraySort$1=mergeSort,$$f=_export,global$6=global$q,call$3=functionCall,uncurryThis$7=functionUncurryThis,DESCRIPTORS$4=descriptors,USE_NATIVE_URL$1=urlConstructorDetection,defineBuiltIn$2=defineBuiltIn$8,defineBuiltInAccessor$3=defineBuiltInAccessor$7,defineBuiltIns=defineBuiltIns$2,setToStringTag$2=setToStringTag$6,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$1=internalState,anInstance$2=anInstance$4,isCallable$2=isCallable$o,hasOwn$3=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$9,anObject$2=anObject$g,isObject$1=isObject$a,$toString$1=toString$8,create=objectCreate,createPropertyDescriptor$1=createPropertyDescriptor$7,getIterator=getIterator$2,getIteratorMethod=getIteratorMethod$3,validateArgumentsLength$1=validateArgumentsLength$2,wellKnownSymbol=wellKnownSymbol$g,arraySort=arraySort$1,ITERATOR=wellKnownSymbol("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$4)return global$6[e];var t=getOwnPropertyDescriptor(global$6,e);return t&&t.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers$1=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers$1&&Headers$1.prototype,RegExp$1=global$6.RegExp,TypeError$2=global$6.TypeError,decodeURIComponent=global$6.decodeURIComponent,encodeURIComponent$1=global$6.encodeURIComponent,charAt$1=uncurryThis$7("".charAt),join$1=uncurryThis$7([].join),push$1=uncurryThis$7([].push),replace$3=uncurryThis$7("".replace),shift$1=uncurryThis$7([].shift),splice=uncurryThis$7([].splice),split$1=uncurryThis$7("".split),stringSlice$2=uncurryThis$7("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(e){try{return decodeURIComponent(e)}catch(t){return e}},deserialize=function(e){var t=replace$3(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$3(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$3(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor((function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})}),"Iterator",(function(){var e=getInternalIteratorState(this),t=e.kind,r=e.iterator.next(),n=r.value;return r.done||(r.value="keys"===t?n.key:"values"===t?n.value:[n.key,n.value]),r}),!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject$1(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(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 t,r,n,o,a,s,i,c=getIteratorMethod(e);if(c)for(r=(t=getIterator(e,c)).next;!(n=call$3(r,t)).done;){if(a=(o=getIterator(anObject$2(n.value))).next,(s=call$3(a,o)).done||(i=call$3(a,o)).done||!call$3(a,o).done)throw TypeError$2("Expected sequence with length 2");push$1(this.entries,{key:$toString$1(s.value),value:$toString$1(i.value)})}else for(var l in e)hasOwn$3(e,l)&&push$1(this.entries,{key:l,value:$toString$1(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=split$1(e,"&"),o=0;o<n.length;)(t=n[o++]).length&&(r=split$1(t,"="),push$1(this.entries,{key:deserialize(shift$1(r)),value:deserialize(join$1(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$1(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},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$1);var e=setInternalState$1(this,new URLSearchParamsState(arguments.length>0?arguments[0]:void 0));DESCRIPTORS$4||(this.length=e.entries.length)},URLSearchParamsPrototype$1=URLSearchParamsConstructor.prototype;if(defineBuiltIns(URLSearchParamsPrototype$1,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$1(r.entries,{key:$toString$1(e),value:$toString$1(t)}),DESCRIPTORS$4||this.length++,r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice(r,o,1):o++;DESCRIPTORS$4||(this.length=r.length),t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$1(n,t[o].value);return n},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,a=!1,s=$toString$1(e),i=$toString$1(t),c=0;c<o.length;c++)(r=o[c]).key===s&&(a?splice(o,c--,1):(a=!0,r.value=i));a||push$1(o,{key:s,value:i}),DESCRIPTORS$4||(this.length=o.length),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$1(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.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$2(URLSearchParamsPrototype$1,ITERATOR,URLSearchParamsPrototype$1.entries,{name:"entries"}),defineBuiltIn$2(URLSearchParamsPrototype$1,"toString",(function(){return getInternalParamsState(this).serialize()}),{enumerable:!0}),DESCRIPTORS$4&&defineBuiltInAccessor$3(URLSearchParamsPrototype$1,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0}),setToStringTag$2(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$f({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable$2(Headers$1)){var headersHas=uncurryThis$7(HeadersPrototype.has),headersSet=uncurryThis$7(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject$1(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers$1(e.headers):new Headers$1,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create(e,{body:createPropertyDescriptor$1(0,$toString$1(r)),headers:createPropertyDescriptor$1(0,t)})}return e};if(isCallable$2(nativeFetch)&&$$f({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$2(NativeRequest)){var RequestConstructor=function(e){return anInstance$2(this,RequestPrototype),new NativeRequest(e,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$f({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},$$e=_export,DESCRIPTORS$3=descriptors,USE_NATIVE_URL=urlConstructorDetection,global$5=global$q,bind=functionBindContext,uncurryThis$6=functionUncurryThis,defineBuiltIn$1=defineBuiltIn$8,defineBuiltInAccessor$2=defineBuiltInAccessor$7,anInstance$1=anInstance$4,hasOwn$2=hasOwnProperty_1,assign=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$8,setToStringTag$1=setToStringTag$6,validateArgumentsLength=validateArgumentsLength$2,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$5.URL,TypeError$1=global$5.TypeError,parseInt$1=global$5.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis$6("".charAt),exec=uncurryThis$6(/./.exec),join=uncurryThis$6([].join),numberToString=uncurryThis$6(1..toString),pop=uncurryThis$6([].pop),push=uncurryThis$6([].push),replace$2=uncurryThis$6("".replace),shift=uncurryThis$6([].shift),split=uncurryThis$6("".split),stringSlice$1=uncurryThis$6("".slice),toLowerCase=uncurryThis$6("".toLowerCase),unshift=uncurryThis$6([].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 t,r,n,o,a,s,i,c=split(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""==(o=c[n]))return e;if(a=10,o.length>1&&"0"==charAt(o,0)&&(a=exec(HEX_START,o)?16:8,o=stringSlice$1(o,8==a?1:2)),""===o)s=0;else{if(!exec(10==a?DEC:8==a?OCT:HEX,o))return e;s=parseInt$1(o,a)}push(r,s)}for(n=0;n<t;n++)if(s=r[n],n==t-1){if(s>=pow(256,5-t))return null}else if(s>255)return null;for(i=pop(r),n=0;n<r.length;n++)i+=r[n]*pow(256,3-n);return i},parseIPv6=function(e){var t,r,n,o,a,s,i,c=[0,0,0,0,0,0,0,0],l=0,d=null,u=0,p=function(){return charAt(e,u)};if(":"==p()){if(":"!=charAt(e,1))return;u+=2,d=++l}for(;p();){if(8==l)return;if(":"!=p()){for(t=r=0;r<4&&exec(HEX,p());)t=16*t+parseInt$1(p(),16),u++,r++;if("."==p()){if(0==r)return;if(u-=r,l>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;u++}if(!exec(DIGIT,p()))return;for(;exec(DIGIT,p());){if(a=parseInt$1(p(),10),null===o)o=a;else{if(0==o)return;o=10*o+a}if(o>255)return;u++}c[l]=256*c[l]+o,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==p()){if(u++,!p())return}else if(p())return;c[l++]=t}else{if(null!==d)return;u++,d=++l}}if(null!==d)for(s=l-d,l=7;0!=l&&s>0;)i=c[l],c[l--]=c[d+s-1],c[d+--s]=i;else if(8!=l)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,a=0;a<8;a++)0!==e[a]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=a),++o);return o>r&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"==typeof e){for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"}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,t){var r=codeAt(e,0);return r>32&&r<127&&!hasOwn$2(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){var r;return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(r=charAt(e,1))||!t&&"|"==r)},startsWithWindowsDriveLetter=function(e){var t;return e.length>1&&isWindowsDriveLetter(stringSlice$1(e,0,2))&&(2==e.length||"/"===(t=charAt(e,2))||"\\"===t||"?"===t||"#"===t)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},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,t,r){var n,o,a,s=$toString(e);if(t){if(o=this.parse(s))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(s,null,n))throw TypeError$1(o);(a=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=a}};URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,a,s,i=this,c=t||SCHEME_START,l=0,d="",u=!1,p=!1,f=!1;for(e=$toString(e),t||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.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,""),n=arrayFrom(e);l<=n.length;){switch(o=n[l],c){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;c=NO_SCHEME;continue}d+=toLowerCase(o),c=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))d+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;d="",c=NO_SCHEME,l=0;continue}if(t&&(i.isSpecial()!=hasOwn$2(specialSchemes,d)||"file"==d&&(i.includesCredentials()||null!==i.port)||"file"==i.scheme&&!i.host))return;if(i.scheme=d,t)return void(i.isSpecial()&&specialSchemes[i.scheme]==i.port&&(i.port=null));d="","file"==i.scheme?c=FILE:i.isSpecial()&&r&&r.scheme==i.scheme?c=SPECIAL_RELATIVE_OR_AUTHORITY:i.isSpecial()?c=SPECIAL_AUTHORITY_SLASHES:"/"==n[l+1]?(c=PATH_OR_AUTHORITY,l++):(i.cannotBeABaseURL=!0,push(i.path,""),c=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){i.scheme=r.scheme,i.path=arraySlice(r.path),i.query=r.query,i.fragment="",i.cannotBeABaseURL=!0,c=FRAGMENT;break}c="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[l+1]){c=RELATIVE;continue}c=SPECIAL_AUTHORITY_IGNORE_SLASHES,l++;break;case PATH_OR_AUTHORITY:if("/"==o){c=AUTHORITY;break}c=PATH;continue;case RELATIVE:if(i.scheme=r.scheme,o==EOF)i.username=r.username,i.password=r.password,i.host=r.host,i.port=r.port,i.path=arraySlice(r.path),i.query=r.query;else if("/"==o||"\\"==o&&i.isSpecial())c=RELATIVE_SLASH;else if("?"==o)i.username=r.username,i.password=r.password,i.host=r.host,i.port=r.port,i.path=arraySlice(r.path),i.query="",c=QUERY;else{if("#"!=o){i.username=r.username,i.password=r.password,i.host=r.host,i.port=r.port,i.path=arraySlice(r.path),i.path.length--,c=PATH;continue}i.username=r.username,i.password=r.password,i.host=r.host,i.port=r.port,i.path=arraySlice(r.path),i.query=r.query,i.fragment="",c=FRAGMENT}break;case RELATIVE_SLASH:if(!i.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){i.username=r.username,i.password=r.password,i.host=r.host,i.port=r.port,c=PATH;continue}c=AUTHORITY}else c=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(c=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(d,l+1))continue;l++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"!=o&&"\\"!=o){c=AUTHORITY;continue}break;case AUTHORITY:if("@"==o){u&&(d="%40"+d),u=!0,a=arrayFrom(d);for(var h=0;h<a.length;h++){var y=a[h];if(":"!=y||f){var g=percentEncode(y,userinfoPercentEncodeSet);f?i.password+=g:i.username+=g}else f=!0}d=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&i.isSpecial()){if(u&&""==d)return INVALID_AUTHORITY;l-=arrayFrom(d).length+1,d="",c=HOST}else d+=o;break;case HOST:case HOSTNAME:if(t&&"file"==i.scheme){c=FILE_HOST;continue}if(":"!=o||p){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&i.isSpecial()){if(i.isSpecial()&&""==d)return INVALID_HOST;if(t&&""==d&&(i.includesCredentials()||null!==i.port))return;if(s=i.parseHost(d))return s;if(d="",c=PATH_START,t)return;continue}"["==o?p=!0:"]"==o&&(p=!1),d+=o}else{if(""==d)return INVALID_HOST;if(s=i.parseHost(d))return s;if(d="",c=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&i.isSpecial()||t){if(""!=d){var m=parseInt$1(d,10);if(m>65535)return INVALID_PORT;i.port=i.isSpecial()&&m===specialSchemes[i.scheme]?null:m,d=""}if(t)return;c=PATH_START;continue}return INVALID_PORT}d+=o;break;case FILE:if(i.scheme="file","/"==o||"\\"==o)c=FILE_SLASH;else{if(!r||"file"!=r.scheme){c=PATH;continue}if(o==EOF)i.host=r.host,i.path=arraySlice(r.path),i.query=r.query;else if("?"==o)i.host=r.host,i.path=arraySlice(r.path),i.query="",c=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join(arraySlice(n,l),""))||(i.host=r.host,i.path=arraySlice(r.path),i.shortenPath()),c=PATH;continue}i.host=r.host,i.path=arraySlice(r.path),i.query=r.query,i.fragment="",c=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){c=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(n,l),""))&&(isWindowsDriveLetter(r.path[0],!0)?push(i.path,r.path[0]):i.host=r.host),c=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(d))c=PATH;else if(""==d){if(i.host="",t)return;c=PATH_START}else{if(s=i.parseHost(d))return s;if("localhost"==i.host&&(i.host=""),t)return;d="",c=PATH_START}continue}d+=o;break;case PATH_START:if(i.isSpecial()){if(c=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(c=PATH,"/"!=o))continue}else i.fragment="",c=FRAGMENT;else i.query="",c=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&i.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(d)?(i.shortenPath(),"/"==o||"\\"==o&&i.isSpecial()||push(i.path,"")):isSingleDot(d)?"/"==o||"\\"==o&&i.isSpecial()||push(i.path,""):("file"==i.scheme&&!i.path.length&&isWindowsDriveLetter(d)&&(i.host&&(i.host=""),d=charAt(d,0)+":"),push(i.path,d)),d="","file"==i.scheme&&(o==EOF||"?"==o||"#"==o))for(;i.path.length>1&&""===i.path[0];)shift(i.path);"?"==o?(i.query="",c=QUERY):"#"==o&&(i.fragment="",c=FRAGMENT)}else d+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(i.query="",c=QUERY):"#"==o?(i.fragment="",c=FRAGMENT):o!=EOF&&(i.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&i.isSpecial()?i.query+="%27":i.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(i.fragment="",c=FRAGMENT);break;case FRAGMENT:o!=EOF&&(i.fragment+=percentEncode(o,fragmentPercentEncodeSet))}l++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0)){if("]"!=charAt(e,e.length-1))return INVALID_HOST;if(!(t=parseIPv6(stringSlice$1(e,1,-1))))return INVALID_HOST;this.host=t}else if(this.isSpecial()){if(e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e))return INVALID_HOST;if(null===(t=parseIPv4(e)))return INVALID_HOST;this.host=t}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn$2(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,a=e.port,s=e.path,i=e.query,c=e.fragment,l=t+":";return null!==o?(l+="//",e.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=serializeHost(o),null!==a&&(l+=":"+a)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?s[0]:s.length?"/"+join(s,"/"):"",null!==i&&(l+="?"+i),null!==c&&(l+="#"+c),l},setHref:function(e){var t=this.parse(e);if(t)throw TypeError$1(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(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))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice$1(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){""!=(e=$toString(e))?("#"==charAt(e,0)&&(e=stringSlice$1(e,1)),this.fragment="",this.parse(e,FRAGMENT)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(e){var t=anInstance$1(this,URLPrototype),r=validateArgumentsLength(arguments.length,1)>1?arguments[1]:void 0,n=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS$3||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};if(DESCRIPTORS$3&&(defineBuiltInAccessor$2(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$2(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$2(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$2(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$2(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$2(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$2(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$2(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$2(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$2(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$2(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$2(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn$1(URLPrototype,"toJSON",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),defineBuiltIn$1(URLPrototype,"toString",(function(){return getInternalURLState(this).serialize()}),{enumerable:!0}),NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$1(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$1(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))}setToStringTag$1(URLConstructor,"URL"),$$e({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS$3},{URL:URLConstructor});var $$d=_export,call$2=functionCall;$$d({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return call$2(URL.prototype.toString,this)}});var DESCRIPTORS$2=descriptors,uncurryThis$5=functionUncurryThis,defineBuiltInAccessor$1=defineBuiltInAccessor$7,URLSearchParamsPrototype=URLSearchParams.prototype,forEach$1=uncurryThis$5(URLSearchParamsPrototype.forEach);function isBrowser(){return"object"==typeof window&&"object"==typeof document&&"[object HTMLDocument]"===Object.prototype.toString.call(document)}function getRandomId(){return Math.random().toString(36).slice(2)}function getObjectKeys(e){return Object.keys(e)}function toStringTag(e){return Object.prototype.toString.call(e)}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function isString(e){return"string"==typeof e}function isNumber(e){return"number"==typeof e}function isBigInt(e){return"[object BigInt]"===toStringTag(e)}function isArray$1(e){return e instanceof Array}function isArrayLike(e){return"function"==typeof NodeList&&"NodeList"===NodeList.name&&e instanceof NodeList||"function"==typeof HTMLCollection&&"HTMLCollection"===HTMLCollection.name&&e instanceof HTMLCollection}function isObjectLike(e){return"object"==typeof e&&null!==e}function isPlainObject(e){return!(!isObjectLike(e)||"[object Object]"!==toStringTag(e))}function isPrototype(e){return!(!isObjectLike(e)||!hasOwnProperty(e,"constructor")||"function"!=typeof e.constructor)}function isBlob(e){return e instanceof Blob}function isArrayBuffer(e){return e instanceof ArrayBuffer}function isURLSearchParams(e){return e instanceof URLSearchParams}function isFormData(e){return e instanceof FormData}function isFile(e){return e instanceof File}function isHeaders(e){return e instanceof Headers}function isDocument(e){return e instanceof Document}function isURL(e){return e instanceof URL}function isClass(e){return"function"==typeof e&&void 0!==e.prototype}DESCRIPTORS$2&&!("size"in URLSearchParamsPrototype)&&defineBuiltInAccessor$1(URLSearchParamsPrototype,"size",{get:function(){var e=0;return forEach$1(this,(function(){e++})),e},configurable:!0,enumerable:!0});const CN_IDs=["zh-CN","zh-HK","zh-TW","zh","zh-Hans-CN"];function isCN(){if(isBrowser()){const{lang:e}=document.documentElement;return e?CN_IDs.some((t=>t===e)):CN_IDs.some((e=>e===navigator.language))}return!1}function isTypedArray(e){return ArrayBuffer.isView(e)}const stringify=e=>"".concat(e),primitive=e=>({ok:!0,value:e});function makePrimitiveValue(e){return void 0===e?primitive(stringify(e)):null===e?primitive(e):isNumber(e)&&(e===-1/0||e===1/0||Number.isNaN(e))?primitive(stringify(e)):isBigInt(e)?primitive("".concat(e,"n")):"symbol"==typeof e||"function"==typeof e?primitive(stringify(e.toString())):e instanceof Error?primitive(stringify(e.stack)):e===Object.prototype?{value:null,ok:!1}:e instanceof Object||"object"==typeof e?{value:e,ok:!1}:primitive(e)}function stringifyData(e){const{ok:t,value:r}=makePrimitiveValue(e);return t?r:JSON.stringify(e,((e,t)=>makePrimitiveValue(t).value),2)}function getValueType(e){return void 0===e?"undefined":null===e?"null":isBigInt(e)?"bigint":e instanceof Object?e instanceof Error?"error":"function"==typeof e?"function":"object":typeof e}const unproxyConsole={...console},psLog=["log","info","error","warn","debug"].reduce(((e,t)=>(e[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];console[t]("[PageSpy] [".concat(t.toLocaleUpperCase(),"] "),...r)},e.unproxy[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];unproxyConsole[t]("[PageSpy] [".concat(t.toLocaleUpperCase(),"] "),...r)},e)),{unproxy:{}});function getAuthSecret(){const e=Math.floor(1e6*Math.random());return String(e).padStart(6,"0")}const formatErrorObj=e=>{if("object"!=typeof e)return null;const{name:t,message:r,stack:n}=Object(e);return!1===[t,r,n].every(Boolean)?null:{name:t,message:r,stack:n}},blob2base64Async=e=>new Promise(((t,r)=>{const n=new FileReader;n.onload=e=>{var r;t(null===(r=e.target)||void 0===r?void 0:r.result)},n.onerror=()=>{r(new Error("blob2base64Async: can not convert"))},n.readAsDataURL(e)})),CONNECT="connect",JOIN="join",LEAVE="leave",CLOSE="close",MESSAGE="message",BROADCAST="broadcast",ERROR="error",PING="ping",PONG="pong",UPDATE_ROOM_INFO="updateRoomInfo";var SERVER_MESSAGE_TYPE=Object.freeze({__proto__:null,BROADCAST:BROADCAST,CLOSE:CLOSE,CONNECT:CONNECT,ERROR:ERROR,JOIN:JOIN,LEAVE:LEAVE,MESSAGE:MESSAGE,PING:PING,PONG:PONG,UPDATE_ROOM_INFO:UPDATE_ROOM_INFO});function makeMessage(e,t){return{role:"client",type:e,data:{...(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&{id:getRandomId()},...t}}}function makeUnicastMessage(e,t,r){return{type:MESSAGE,content:{data:e,from:t,to:r}}}function makeBroadcastMessage(e){return{type:BROADCAST,content:{data:e}}}class RequestItem{constructor(e){_defineProperty(this,"id",""),_defineProperty(this,"method",""),_defineProperty(this,"url",""),_defineProperty(this,"requestType","xhr"),_defineProperty(this,"requestHeader",null),_defineProperty(this,"status",0),_defineProperty(this,"statusText",""),_defineProperty(this,"readyState",0),_defineProperty(this,"response",void 0),_defineProperty(this,"responseReason",null),_defineProperty(this,"responseType",""),_defineProperty(this,"responseHeader",null),_defineProperty(this,"startTime",0),_defineProperty(this,"endTime",0),_defineProperty(this,"costTime",0),_defineProperty(this,"postData",null),_defineProperty(this,"requestPayload",null),_defineProperty(this,"withCredentials",!1),_defineProperty(this,"lastEventId",""),this.id=e}}const MAX_SIZE=2097152,Reason={EXCEED_SIZE:"Exceed maximum limit"};var ReqReadyState;!function(e){e[e.UNSENT=0]="UNSENT",e[e.OPENED=1]="OPENED",e[e.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",e[e.LOADING=3]="LOADING",e[e.DONE=4]="DONE"}(ReqReadyState||(ReqReadyState={}));const BINARY_FILE_VARIANT="(file)";function formatEntries(e){const t=[];let r=e.next();for(;!r.done;){const[n,o]=r.value;let a;a=isFile(o)?BINARY_FILE_VARIANT:String(o),t.push([n,a]),r=e.next()}return t}function getContentType(e){return e?isFormData(e)?"multipart/form-data":isURLSearchParams(e)?"application/x-www-form-urlencoded;charset=UTF-8":isDocument(e)?"application/xml":isBlob(e)?e.type:"text/plain;charset=UTF-8":null}const CONTENT_TYPE_HEADER="Content-Type";function addContentTypeHeader(e,t){if(!t)return e;const r=getContentType(t);if(!r)return e;const n=[CONTENT_TYPE_HEADER,r];if(!e)return[n];for(let t=0;t<e.length;t++){const[r]=e[t];if(r.toUpperCase()===CONTENT_TYPE_HEADER.toUpperCase())return e}return[...e,n]}async function getFormattedBody(e){if(!e)return null;if(isURLSearchParams(e)||isFormData(e))return formatEntries(e.entries());if(isBlob(e))return"[object Blob]";if(isTypedArray(e))return"[object TypedArray]";if(isDocument(e)){return(new XMLSerializer).serializeToString(e)}return isString(e)?e:toStringTag(e)}class NetworkProxyBase{constructor(e){_defineProperty(this,"socketStore",void 0),_defineProperty(this,"reqMap",Object.create(null)),this.socketStore=e}getRequestMap(){return this.reqMap}getRequest(e){return this.reqMap[e]}removeRequest(e){delete this.reqMap[e]}createRequest(e){return e?this.reqMap[e]?(psLog.warn("The request object has been in store, disallow duplicate create"),!1):(this.reqMap[e]=new RequestItem(e),!0):(psLog.warn('The "id" is required when init request object'),!1)}setRequest(e,t){return!(!e||!t)&&(this.reqMap[e]=t,!0)}sendRequestItem(e,t){var r;if(!1!==(null===(r=NetworkProxyBase.dataProcessor)||void 0===r?void 0:r.call(NetworkProxyBase,t)))try{this.reqMap[e]||(this.reqMap[e]=t);const r=makeMessage("network",{...t},!1);this.socketStore.dispatchEvent("public-data",r),this.socketStore.broadcastMessage(r,t.readyState!==ReqReadyState.DONE),this.deferDeleteRequest(e)}catch(e){psLog.error(e.message)}}deferDeleteRequest(e){const t=this.getRequest(e);t&&t.readyState===ReqReadyState.DONE&&setTimeout((()=>{delete this.reqMap[e]}),3e3)}}_defineProperty(NetworkProxyBase,"dataProcessor",void 0);var uncurryThis$4=functionUncurryThis,SetPrototype$1=Set.prototype,setHelpers={Set:Set,add:uncurryThis$4(SetPrototype$1.add),has:uncurryThis$4(SetPrototype$1.has),remove:uncurryThis$4(SetPrototype$1.delete),proto:SetPrototype$1},has$5=setHelpers.has,aSet$7=function(e){return has$5(e),e},call$1=functionCall,iterateSimple$7=function(e,t,r){for(var n,o,a=r||e.next;!(n=call$1(a,e)).done;)if(void 0!==(o=t(n.value)))return o},uncurryThis$3=functionUncurryThis,iterateSimple$6=iterateSimple$7,SetHelpers$5=setHelpers,Set$3=SetHelpers$5.Set,SetPrototype=SetHelpers$5.proto,forEach=uncurryThis$3(SetPrototype.forEach),keys=uncurryThis$3(SetPrototype.keys),next=keys(new Set$3).next,setIterate=function(e,t,r){return r?iterateSimple$6(keys(e),t,next):forEach(e,t)},SetHelpers$4=setHelpers,iterate$1=setIterate,Set$2=SetHelpers$4.Set,add$3=SetHelpers$4.add,setClone=function(e){var t=new Set$2;return iterate$1(e,(function(e){add$3(t,e)})),t},uncurryThisAccessor=functionUncurryThisAccessor,SetHelpers$3=setHelpers,setSize=uncurryThisAccessor(SetHelpers$3.proto,"size","get")||function(e){return e.size},aCallable$1=aCallable$7,anObject$1=anObject$g,call=functionCall,toIntegerOrInfinity=toIntegerOrInfinity$7,$TypeError$1=TypeError,max=Math.max,SetRecord=function(e,t,r,n){this.set=e,this.size=t,this.has=r,this.keys=n};SetRecord.prototype={getIterator:function(){return anObject$1(call(this.keys,this.set))},includes:function(e){return call(this.has,this.set,e)}};var getSetRecord$7=function(e){anObject$1(e);var t=+e.size;if(t!=t)throw $TypeError$1("Invalid size");return new SetRecord(e,max(toIntegerOrInfinity(t),0),aCallable$1(e.has),aCallable$1(e.keys))},aSet$6=aSet$7,SetHelpers$2=setHelpers,clone$2=setClone,size$4=setSize,getSetRecord$6=getSetRecord$7,iterateSet$2=setIterate,iterateSimple$5=iterateSimple$7,has$4=SetHelpers$2.has,remove$1=SetHelpers$2.remove,setDifference=function(e){var t=aSet$6(this),r=getSetRecord$6(e),n=clone$2(t);return size$4(t)<=r.size?iterateSet$2(t,(function(e){r.includes(e)&&remove$1(n,e)})):iterateSimple$5(r.getIterator(),(function(e){has$4(t,e)&&remove$1(n,e)})),n},getBuiltIn$2=getBuiltIn$a,createEmptySetLike=function(){return{size:0,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},setMethodAcceptSetLike$7=function(e){try{return(new(getBuiltIn$2("Set")))[e](createEmptySetLike()),!0}catch(e){return!1}},$$c=_export,difference=setDifference,setMethodAcceptSetLike$6=setMethodAcceptSetLike$7;$$c({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$6("difference")},{difference:difference});var aSet$5=aSet$7,SetHelpers$1=setHelpers,size$3=setSize,getSetRecord$5=getSetRecord$7,iterateSet$1=setIterate,iterateSimple$4=iterateSimple$7,Set$1=SetHelpers$1.Set,add$2=SetHelpers$1.add,has$3=SetHelpers$1.has,setIntersection=function(e){var t=aSet$5(this),r=getSetRecord$5(e),n=new Set$1;return size$3(t)>r.size?iterateSimple$4(r.getIterator(),(function(e){has$3(t,e)&&add$2(n,e)})):iterateSet$1(t,(function(e){r.includes(e)&&add$2(n,e)})),n},$$b=_export,fails$2=fails$s,intersection=setIntersection,setMethodAcceptSetLike$5=setMethodAcceptSetLike$7,INCORRECT=!setMethodAcceptSetLike$5("intersection")||fails$2((function(){return"3,2"!=Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}));$$b({target:"Set",proto:!0,real:!0,forced:INCORRECT},{intersection:intersection});var aSet$4=aSet$7,has$2=setHelpers.has,size$2=setSize,getSetRecord$4=getSetRecord$7,iterateSet=setIterate,iterateSimple$3=iterateSimple$7,iteratorClose$1=iteratorClose$3,setIsDisjointFrom=function(e){var t=aSet$4(this),r=getSetRecord$4(e);if(size$2(t)<=r.size)return!1!==iterateSet(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==iterateSimple$3(n,(function(e){if(has$2(t,e))return iteratorClose$1(n,"normal",!1)}))},$$a=_export,isDisjointFrom=setIsDisjointFrom,setMethodAcceptSetLike$4=setMethodAcceptSetLike$7;$$a({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$4("isDisjointFrom")},{isDisjointFrom:isDisjointFrom});var aSet$3=aSet$7,size$1=setSize,iterate=setIterate,getSetRecord$3=getSetRecord$7,setIsSubsetOf=function(e){var t=aSet$3(this),r=getSetRecord$3(e);return!(size$1(t)>r.size)&&!1!==iterate(t,(function(e){if(!r.includes(e))return!1}),!0)},$$9=_export,isSubsetOf=setIsSubsetOf,setMethodAcceptSetLike$3=setMethodAcceptSetLike$7;$$9({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$3("isSubsetOf")},{isSubsetOf:isSubsetOf});var aSet$2=aSet$7,has$1=setHelpers.has,size=setSize,getSetRecord$2=getSetRecord$7,iterateSimple$2=iterateSimple$7,iteratorClose=iteratorClose$3,setIsSupersetOf=function(e){var t=aSet$2(this),r=getSetRecord$2(e);if(size(t)<r.size)return!1;var n=r.getIterator();return!1!==iterateSimple$2(n,(function(e){if(!has$1(t,e))return iteratorClose(n,"normal",!1)}))},$$8=_export,isSupersetOf=setIsSupersetOf,setMethodAcceptSetLike$2=setMethodAcceptSetLike$7;$$8({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$2("isSupersetOf")},{isSupersetOf:isSupersetOf});var aSet$1=aSet$7,SetHelpers=setHelpers,clone$1=setClone,getSetRecord$1=getSetRecord$7,iterateSimple$1=iterateSimple$7,add$1=SetHelpers.add,has=SetHelpers.has,remove=SetHelpers.remove,setSymmetricDifference=function(e){var t=aSet$1(this),r=getSetRecord$1(e).getIterator(),n=clone$1(t);return iterateSimple$1(r,(function(e){has(t,e)?remove(n,e):add$1(n,e)})),n},$$7=_export,symmetricDifference=setSymmetricDifference,setMethodAcceptSetLike$1=setMethodAcceptSetLike$7;$$7({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike$1("symmetricDifference")},{symmetricDifference:symmetricDifference});var aSet=aSet$7,add=setHelpers.add,clone=setClone,getSetRecord=getSetRecord$7,iterateSimple=iterateSimple$7,setUnion=function(e){var t=aSet(this),r=getSetRecord(e).getIterator(),n=clone(t);return iterateSimple(r,(function(e){add(n,e)})),n},$$6=_export,union=setUnion,setMethodAcceptSetLike=setMethodAcceptSetLike$7;$$6({target:"Set",proto:!0,real:!0,forced:!setMethodAcceptSetLike("union")},{union:union});class Atom{constructor(){_defineProperty(this,"store",{}),_defineProperty(this,"instanceStore",{})}getStore(){return this.store}resetStore(){this.store={}}getInstanceStore(){return this.instanceStore}resetInstanceStore(){this.instanceStore={}}transformToAtom(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{value:r,ok:n}=makePrimitiveValue(e),o=getRandomId();if(n)return{id:o,type:getValueType(e),value:r};if(t)try{return{id:o,type:"json",value:JSON.stringify(e)}}catch(e){return{id:o,type:"json",value:null}}return this.add(e)}get(e){const t=this.store[e],r=this.instanceStore[e];if(!t)return null;const n={},o=Object.getOwnPropertyDescriptors(t);Object.keys(o).forEach((e=>{const t=o[e];hasOwnProperty(t,"value")&&(t.value=this.transformToAtom(t.value)),n[e]=Atom.getAtomOverview({atomId:getRandomId(),instanceId:r,value:t})}));const a=this.addExtraProperty(e);return{...n,...a}}getOrigin(e){const t=this.store[e];return t||null}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=getRandomId();let n=r;isPrototype(e)&&(n=t),this.store[r]=e,this.instanceStore[r]=n;const o=Atom.getSemanticValue(e);return Atom.getAtomOverview({atomId:r,value:o,instanceId:n})}static getAtomOverview(e){let{instanceId:t="",atomId:r,value:n}=e;return{id:getRandomId(),type:"atom",__atomId:r,instanceId:t,value:n}}static getSemanticValue(e){if(isPlainObject(e))return"Object {...}";if(isArray$1(e))return"Array (".concat(e.length,")");return e.constructor.name}addExtraProperty(e){const t=this.store[e],r=this.instanceStore[e],n={};if((t instanceof String||t instanceof Number||t instanceof Boolean)&&(n["[[PrimitiveValue]]"]=this.transformToAtom(t.valueOf())),t instanceof Set){const e={};let r=0;for(const n of t)e[r++]=n;e.size=t.size,n["[[Entries]]"]=this.transformToAtom(e)}if(t instanceof Map){const e={};let r=0;for(const[n,o]of t.entries())e[r++]={key:n,value:o};e.size=t.size,n["[[Entries]]"]=this.transformToAtom(e)}return(isArray$1(t)||isArrayLike(t))&&(n.length=this.transformToAtom(t.length)),null!==Object.getPrototypeOf(t)?n["[[Prototype]]"]=this.add(Object.getPrototypeOf(t),r):n.___proto___=this.transformToAtom(null),n}}const atom=new Atom;class Client{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{osType:"unknown",osVersion:"unknown",browserType:"unknown",browserVersion:"unknown",framework:"unknown",isDevTools:!1,sdk:"unknown",sdkVersion:"0.0.0"},t=arguments.length>1?arguments[1]:void 0;_defineProperty(this,"info",void 0),_defineProperty(this,"rawInfo",void 0),_defineProperty(this,"plugins",[]),_defineProperty(this,"_name",""),this.info=e,this.rawInfo=t}makeClientInfoMsg(){return{sdk:this.info.sdk,isDevTools:this.info.isDevTools,ua:this.getName(),plugins:this.plugins}}getName(){if(!this._name){const{ua:e,osType:t,osVersion:r,browserType:n,browserVersion:o}=this.info;this._name=e||"".concat(t,"/").concat(r," ").concat(n,"/").concat(o)}return this._name}}var $$5=_export,DESCRIPTORS$1=descriptors,global$4=global$q,uncurryThis$2=functionUncurryThis,hasOwn$1=hasOwnProperty_1,isCallable$1=isCallable$o,isPrototypeOf=objectIsPrototypeOf,toString$1=toString$8,defineBuiltInAccessor=defineBuiltInAccessor$7,copyConstructorProperties=copyConstructorProperties$3,NativeSymbol=global$4.Symbol,SymbolPrototype=NativeSymbol&&NativeSymbol.prototype;if(DESCRIPTORS$1&&isCallable$1(NativeSymbol)&&(!("description"in SymbolPrototype)||void 0!==NativeSymbol().description)){var EmptyStringDescriptionStore={},SymbolWrapper=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:toString$1(arguments[0]),t=isPrototypeOf(SymbolPrototype,this)?new NativeSymbol(e):void 0===e?NativeSymbol():NativeSymbol(e);return""===e&&(EmptyStringDescriptionStore[t]=!0),t};copyConstructorProperties(SymbolWrapper,NativeSymbol),SymbolWrapper.prototype=SymbolPrototype,SymbolPrototype.constructor=SymbolWrapper;var NATIVE_SYMBOL="Symbol(test)"==String(NativeSymbol("test")),thisSymbolValue=uncurryThis$2(SymbolPrototype.valueOf),symbolDescriptiveString=uncurryThis$2(SymbolPrototype.toString),regexp=/^Symbol\((.*)\)[^)]+$/,replace$1=uncurryThis$2("".replace),stringSlice=uncurryThis$2("".slice);defineBuiltInAccessor(SymbolPrototype,"description",{configurable:!0,get:function(){var e=thisSymbolValue(this);if(hasOwn$1(EmptyStringDescriptionStore,e))return"";var t=symbolDescriptiveString(e),r=NATIVE_SYMBOL?stringSlice(t,7,-1):replace$1(t,regexp,"$1");return""===r?void 0:r}}),$$5({global:!0,constructor:!0,forced:!0},{Symbol:SymbolWrapper})}var $$4=_export,uncurryThis$1=functionUncurryThis,isArray=isArray$4,nativeReverse=uncurryThis$1([].reverse),test=[1,2];$$4({target:"Array",proto:!0,forced:String(test)===String(test.reverse())},{reverse:function(){return isArray(this)&&(this.length=this.length),nativeReverse(this)}});var whitespaces$2="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis=functionUncurryThis,requireObjectCoercible=requireObjectCoercible$5,toString=toString$8,whitespaces$1=whitespaces$2,replace=uncurryThis("".replace),ltrim=RegExp("^["+whitespaces$1+"]+"),rtrim=RegExp("(^|[^"+whitespaces$1+"])["+whitespaces$1+"]+$"),createMethod=function(e){return function(t){var r=toString(requireObjectCoercible(t));return 1&e&&(r=replace(r,ltrim,"")),2&e&&(r=replace(r,rtrim,"$1")),r}},stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)},PROPER_FUNCTION_NAME=functionName.PROPER,fails$1=fails$s,whitespaces=whitespaces$2,non="​…᠎",stringTrimForced=function(e){return fails$1((function(){return!!whitespaces[e]()||non[e]()!==non||PROPER_FUNCTION_NAME&&whitespaces[e].name!==e}))},$$3=_export,$trim=stringTrim.trim,forcedStringTrimMethod=stringTrimForced;$$3({target:"String",proto:!0,forced:forcedStringTrimMethod("trim")},{trim:function(){return $trim(this)}});var domExceptionConstants={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},$$2=_export,global$3=global$q,getBuiltIn$1=getBuiltIn$a,createPropertyDescriptor=createPropertyDescriptor$7,defineProperty=objectDefineProperty.f,hasOwn=hasOwnProperty_1,anInstance=anInstance$4,inheritIfRequired=inheritIfRequired$2,normalizeStringArgument=normalizeStringArgument$2,DOMExceptionConstants=domExceptionConstants,clearErrorStack=errorStackClear,DESCRIPTORS=descriptors,DOM_EXCEPTION="DOMException",Error$1=getBuiltIn$1("Error"),NativeDOMException=getBuiltIn$1(DOM_EXCEPTION),$DOMException=function(){anInstance(this,DOMExceptionPrototype);var e=arguments.length,t=normalizeStringArgument(e<1?void 0:arguments[0]),r=normalizeStringArgument(e<2?void 0:arguments[1],"Error"),n=new NativeDOMException(t,r),o=Error$1(t);return o.name=DOM_EXCEPTION,defineProperty(n,"stack",createPropertyDescriptor(1,clearErrorStack(o.stack,1))),inheritIfRequired(n,this,$DOMException),n},DOMExceptionPrototype=$DOMException.prototype=NativeDOMException.prototype,ERROR_HAS_STACK="stack"in Error$1(DOM_EXCEPTION),DOM_EXCEPTION_HAS_STACK="stack"in new NativeDOMException(1,2),descriptor=NativeDOMException&&DESCRIPTORS&&Object.getOwnPropertyDescriptor(global$3,DOM_EXCEPTION),BUGGY_DESCRIPTOR=!(!descriptor||descriptor.writable&&descriptor.configurable),FORCED_CONSTRUCTOR=ERROR_HAS_STACK&&!BUGGY_DESCRIPTOR&&!DOM_EXCEPTION_HAS_STACK;$$2({global:!0,constructor:!0,forced:FORCED_CONSTRUCTOR},{DOMException:FORCED_CONSTRUCTOR?$DOMException:NativeDOMException});var PolyfilledDOMException=getBuiltIn$1(DOM_EXCEPTION),PolyfilledDOMExceptionPrototype=PolyfilledDOMException.prototype,util,objectUtil;if(PolyfilledDOMExceptionPrototype.constructor!==PolyfilledDOMException)for(var key in defineProperty(PolyfilledDOMExceptionPrototype,"constructor",createPropertyDescriptor(1,PolyfilledDOMException)),DOMExceptionConstants)if(hasOwn(DOMExceptionConstants,key)){var constant=DOMExceptionConstants[key],constantName=constant.s;hasOwn(PolyfilledDOMException,constantName)||defineProperty(PolyfilledDOMException,constantName,createPropertyDescriptor(6,constant.c))}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" | ";return e.map((e=>"string"==typeof e?"'".concat(e,"'"):e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(util||(util={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:null===e?ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(e){var t;super(),t=this,this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.issues=[...t.issues,...e]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof ZodError))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e.message;const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:r=e.received===ZodParsedType.undefined?"Required":"Expected ".concat(e.expected,", received ").concat(e.received);break;case ZodIssueCode.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,util.jsonStringifyReplacer));break;case ZodIssueCode.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(util.joinValues(e.keys,", "));break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(util.joinValues(e.options));break;case ZodIssueCode.invalid_enum_value:r="Invalid enum value. Expected ".concat(util.joinValues(e.options),", received '").concat(e.received,"'");break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r='Invalid input: must include "'.concat(e.validation.includes,'"'),"number"==typeof e.validation.position&&(r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position))):"startsWith"in e.validation?r='Invalid input: must start with "'.concat(e.validation.startsWith,'"'):"endsWith"in e.validation?r='Invalid input: must end with "'.concat(e.validation.endsWith,'"'):util.assertNever(e.validation):r="regex"!==e.validation?"Invalid ".concat(e.validation):"Invalid";break;case ZodIssueCode.too_small:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum):"date"===e.type?"Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum))):"Invalid input";break;case ZodIssueCode.too_big:r="array"===e.type?"Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)"):"string"===e.type?"String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)"):"number"===e.type?"Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"bigint"===e.type?"BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum):"date"===e.type?"Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum))):"Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],s={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let i="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)i=e(s,{data:t,defaultError:i}).message;return{...o,path:a,message:i}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter((e=>!!e))});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return INVALID;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return ParseStatus.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status)return INVALID;if("aborted"===o.status)return INVALID;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===t.value||void 0===o.value&&!n.alwaysSet||(r[t.value]=o.value)}return{status:e.value,value:r}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}var errorUtil,_ZodEnum_cache,_ZodNativeEnum_cache;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{var a,s;const{message:i}=e;return"invalid_enum_value"===t.code?{message:null!=i?i:o.defaultError}:void 0===o.data?{message:null!==(a=null!=i?i:n)&&void 0!==a?a:o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:null!==(s=null!=i?i:r)&&void 0!==s?s:o.defaultError}},description:o}}class ZodType{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},o=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,o)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return isValid(t)?{value:t.value}:{issues:n.common.issues}}catch(e){(null===(r=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then((e=>isValid(e)?{value:e.value}:{issues:n.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(isAsync(n)?n:Promise.resolve(n));return handleResult(r,o)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const o=e(t),a=()=>n.addIssue({code:ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then((e=>!!e||(a(),!1))):!!o||(a(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp("^".concat(dateRegexSource,"$"));function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t="".concat(t,"\\.\\d{").concat(e.precision,"}"):null==e.precision&&(t="".concat(t,"(\\.\\d+)?")),t}function timeRegex(e){return new RegExp("^".concat(timeRegexSource(e),"$"))}function datetimeRegex(e){let t="".concat(dateRegexSource,"T").concat(timeRegexSource(e));const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t="".concat(t,"(").concat(r.join("|"),")"),new RegExp("^".concat(t,"$"))}function isValidIP(e,t){return!("v4"!==t&&t||!ipv4Regex.test(e))||!("v6"!==t&&t||!ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return"object"==typeof o&&null!==o&&(!(!o.typ||!o.alg)&&(!t||o.alg===t))}catch(e){return!1}}function isValidCidr(e,t){return!("v4"!==t&&t||!ipv4CidrRegex.test(e))||!("v6"!==t&&t||!ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==ZodParsedType.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:t.parsedType}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)emailRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"email",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"emoji",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)uuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"uuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)nanoidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)cuidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)cuid2Regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)ulidRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ulid",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(o){r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"url",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"regex",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){datetimeRegex(n).test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){dateRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){timeRegex(n).test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?durationRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"duration",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?isValidIP(e.data,n.version)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"ip",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?isValidJWT(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"jwt",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?isValidCidr(e.data,n.version)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"cidr",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?base64Regex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"base64",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?base64urlRegex.test(e.data)||(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{validation:"base64url",code:ZodIssueCode.invalid_string,message:n.message}),t.dirty()):util.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(r)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...errorUtil.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...errorUtil.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...errorUtil.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...errorUtil.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...errorUtil.errToObj(t)})}nonempty(e){return this.min(1,errorUtil.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return parseInt(e.toFixed(o).replace(".",""))%parseInt(t.toFixed(o).replace(".",""))/Math.pow(10,o)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==ZodParsedType.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:t.parsedType}),INVALID}let t;const r=new ParseStatus;for(const n of this._def.checks)if("int"===n.kind)util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==floatSafeRemainder(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_finite,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&util.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==ZodParsedType.bigint)return this._getInvalidInput(e);let t;const r=new ParseStatus;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):util.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:t.parsedType}),INVALID}gte(e,t){return this.setLimit("min",e,!0,errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,errorUtil.toString(t))}setLimit(e,t,r,n){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:errorUtil.toString(n)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==ZodParsedType.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:t.parsedType}),INVALID}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==ZodParsedType.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:t.parsedType}),INVALID}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:ZodIssueCode.invalid_date}),INVALID}const t=new ParseStatus;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),addIssueToContext(r,{code:ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):util.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:t.parsedType}),INVALID}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:t.parsedType}),INVALID}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:t.parsedType}),INVALID}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:t.parsedType}),INVALID}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==ZodParsedType.array)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:t.parsedType}),INVALID;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(addIssueToContext(t,{code:e?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(addIssueToContext(t,{code:ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new ParseInputLazyPath(t,e,t.path,r))))).then((e=>ParseStatus.mergeArray(r,e)));const o=[...t.data].map(((e,r)=>n.type._parseSync(new ParseInputLazyPath(t,e,t.path,r))));return ParseStatus.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:errorUtil.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==ZodParsedType.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const s=[];for(const e of o){const t=n[e],o=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(addIssueToContext(r,{code:ZodIssueCode.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of s){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o,a,s;const i=null!==(a=null===(o=(n=this._def).errorMap)||void 0===o?void 0:o.call(n,t,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(s=errorUtil.errToObj(e).message)&&void 0!==s?s:i}:{message:i}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return util.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return util.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return util.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return util.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof ZodOptional;)e=e._def.innerType;t[r]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:r}),INVALID}));{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map((e=>new ZodError(e)));return addIssueToContext(t,{code:ZodIssueCode.invalid_union,unionErrors:o}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.object)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType}),INVALID;const r=this.discriminator,n=t.data[r],o=this.optionsMap.get(n);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=getDiscriminator(r.shape[e]);if(!t.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(const o of t){if(n.has(o))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(o)));n.set(o,r)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...processCreateParams(r)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const r=util.objectKeys(t),n=util.objectKeys(e).filter((e=>-1!==r.indexOf(e))),o={...e,...t};for(const r of n){const n=mergeValues(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=mergeValues(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===ZodParsedType.date&&n===ZodParsedType.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(isAborted(e)||isAborted(n))return INVALID;const o=mergeValues(e.value,n.value);return o.valid?((isDirty(e)||isDirty(n))&&t.dirty(),{status:t.value,value:o.data}):(addIssueToContext(r,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((e=>{let[t,r]=e;return n(t,r)})):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(r.data.length<this._def.items.length)return addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&r.data.length>this._def.items.length&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new ParseInputLazyPath(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=[],o=this._def.keyType,a=this._def.valueType;for(const e in r.data)n.push({key:o._parse(new ParseInputLazyPath(r,e,r.path,e)),value:a._parse(new ParseInputLazyPath(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?ParseStatus.mergeObjectAsync(t,n):ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)}:{keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.map)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:r.parsedType}),INVALID;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(((e,t)=>{let[a,s]=e;return{key:n._parse(new ParseInputLazyPath(r,a,r.path,[t,"key"])),value:o._parse(new ParseInputLazyPath(r,s,r.path,[t,"value"]))}}));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return INVALID;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return INVALID;"dirty"!==n.status&&"dirty"!==o.status||t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==ZodParsedType.set)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:r.parsedType}),INVALID;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const s=[...r.data.values()].map(((e,t)=>o._parse(new ParseInputLazyPath(r,e,r.path,t))));return r.common.async?Promise.all(s).then((e=>a(e))):a(s)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:errorUtil.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.function)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType}),INVALID;function r(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:r}})}const o={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];const c=new ZodError([]),l=await e._def.args.parseAsync(s,o).catch((e=>{throw c.addIssue(r(s,e)),c})),d=await Reflect.apply(a,this,l),u=await e._def.returns._def.type.parseAsync(d,o).catch((e=>{throw c.addIssue(n(d,e)),c}));return u}))}{const e=this;return OK((function(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];const c=e._def.args.safeParse(s,o);if(!c.success)throw new ZodError([r(s,c.error)]);const l=Reflect.apply(a,this,c.data),d=e._def.returns.safeParse(l,o);if(!d.success)throw new ZodError([n(l,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(r)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{expected:util.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache,"f")||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values),"f"),!__classPrivateFieldGet(this,_ZodEnum_cache,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:r}),INVALID}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return ZodEnum.create(e,{...this._def,...t})}exclude(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._def;return ZodEnum.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(e){const t=util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ZodParsedType.string&&r.parsedType!==ZodParsedType.number){const e=util.objectValues(t);return addIssueToContext(r,{expected:util.joinValues(e),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(e.data)){const e=util.objectValues(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:e}),INVALID}return OK(e.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==ZodParsedType.promise&&!1===t.common.async)return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:t.parsedType}),INVALID;const r=t.parsedType===ZodParsedType.promise?t.data:Promise.resolve(t.data);return OK(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{addIssueToContext(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return INVALID;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?INVALID:"dirty"===n.status||"dirty"===t.value?DIRTY(n.value):n}));{if("aborted"===t.value)return INVALID;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?INVALID:"dirty"===n.status||"dirty"===t.value?DIRTY(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!isValid(e))return e;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>isValid(e)?Promise.resolve(n.transform(e.value,o)).then((e=>({status:t.value,value:e}))):e))}util.assertNever(n)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===ZodParsedType.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return isAsync(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==ZodParsedType.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:t.parsedType}),INVALID}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),r=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function cleanParams(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function custom(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return e?ZodAny.create().superRefine(((n,o)=>{var a,s;const i=e(n);if(i instanceof Promise)return i.then((e=>{var a,s;if(!e){const e=cleanParams(t,n),i=null===(s=null!==(a=e.fatal)&&void 0!==a?a:r)||void 0===s||s;o.addIssue({code:"custom",...e,fatal:i})}}));if(!i){const e=cleanParams(t,n),i=null===(s=null!==(a=e.fatal)&&void 0!==a?a:r)||void 0===s||s;o.addIssue({code:"custom",...e,fatal:i})}})):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=function(e){return custom((t=>t instanceof e),arguments.length>1&&void 0!==arguments[1]?arguments[1]:{message:"Input not instance of ".concat(e.name)})},stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,datetimeRegex:datetimeRegex,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError});const processorFn=()=>z.function().args(z.custom()).returns(z.boolean().optional()),baseSchema=z.object({api:z.string().refine((e=>!e.startsWith("http")),{message:"Just need host part in url"}),project:z.string().min(1,"Missing value"),title:z.string().min(1,"Missing value"),enableSSL:z.boolean(),messageCapacity:z.number(),useSecret:z.boolean(),secret:z.string().refine((e=>!e),{message:"Secret is not allowed to be set manually"}),offline:z.boolean(),serializeData:z.boolean(),disabledPlugins:z.array(z.string()),dataProcessor:z.object({console:processorFn(),network:processorFn(),storage:processorFn(),database:processorFn(),page:processorFn(),system:processorFn()}).partial().strict()}).partial().strict(),extendConfigSchema=e=>baseSchema.merge(e(z));class InvalidConfigError extends Error{constructor(e,t){const r=e.issues.map((e=>"unrecognized_keys"===e.code?"- ".concat(e.message,";"):"- ".concat(e.path.join("."),": ").concat(e.message,";"))).join("\n");super("config values validation failed.\n\n".concat(r,"\n\nCurrent config: ").concat(JSON.stringify(t,null,2))),this.name="InvalidConfigError"}}class ConfigBase{constructor(){_defineProperty(this,"value",{...this.base}),_defineProperty(this,"mergeConfig",(e=>{const t={...this.base,...this.platform,...e};try{this.schema.parse(t)}catch(e){throw new InvalidConfigError(e,t)}return this.value=t,this.value}))}get base(){return{api:"",project:"--",title:"--",enableSSL:!0,messageCapacity:1e3,useSecret:!1,secret:"",offline:!1,serializeData:!1,disabledPlugins:[],dataProcessor:{}}}get(){return this.value}set(e,t){this.value[e]=t}}const ROOM_SESSION_KEY="page-spy-room";var SocketState;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(SocketState||(SocketState={}));const HEARTBEAT_INTERVAL=5e3,INIT_RETRY_INTERVAL=2e3,RETRY_TIME_INCR=1.5,MAX_RETRY_INTERVAL=Math.pow(RETRY_TIME_INCR,4)*INIT_RETRY_INTERVAL;class SocketWrapper{constructor(){_defineProperty(this,"events",{open:[],close:[],error:[],message:[]})}emit(e,t){this.events[e].forEach((e=>{e(t)})),"close"!==e&&"error"!==e||this.clearListeners()}onOpen(e){this.events.open.push(e)}onClose(e){this.events.close.push(e)}onError(e){this.events.error.push(e)}onMessage(e){this.events.message.push(e)}clearListeners(){Object.entries(this.events).forEach((e=>{let[,t]=e;t.splice(0)}))}}class SocketStoreBase{getSocket(){return this.socketWrapper}updateRoomInfo(){if(this.getPageSpyConfig){var e;const{project:t,title:r}=this.getPageSpyConfig(),n=null===(e=this.getClient)||void 0===e?void 0:e.call(this).getName();this.send({type:UPDATE_ROOM_INFO,content:{info:{name:n,group:t,tags:{title:r,name:n,group:t}}}},!0)}}constructor(){_defineProperty(this,"socketUrl",""),_defineProperty(this,"socketConnection",null),_defineProperty(this,"debuggerConnection",null),_defineProperty(this,"pingTimer",null),_defineProperty(this,"pongTimer",null),_defineProperty(this,"retryTimer",null),_defineProperty(this,"isOffline",!1),_defineProperty(this,"messageCapacity",0),_defineProperty(this,"messages",[]),_defineProperty(this,"events",{debug:[],refresh:[],"atom-detail":[],"atom-getter":[],"debugger-online":[],"database-pagination":[],"public-data":[],"harbor-clear":[]}),_defineProperty(this,"retryInterval",INIT_RETRY_INTERVAL),_defineProperty(this,"connectable",!0),_defineProperty(this,"getPageSpyConfig",null),_defineProperty(this,"getClient",null),this.addListener("atom-detail",SocketStoreBase.handleResolveAtom),this.addListener("atom-getter",SocketStoreBase.handleAtomPropertyGetter),this.addListener("debugger-online",this.handleFlushBuffer)}async init(e){try{var t,r,n,o,a;if(!e)throw Error("WebSocket url cannot be empty");this.socketWrapper.clearListeners(),this.socketWrapper.getState()===SocketState.OPEN&&await new Promise((e=>{this.socketWrapper.onClose((()=>{this.socketWrapper.clearListeners(),e()})),this.socketWrapper.close()})),null===(t=this.socketWrapper)||void 0===t||t.onOpen((()=>{this.connectOnline()})),null===(r=this.socketWrapper)||void 0===r||r.onMessage((e=>{this.handleMessage(e)})),null===(n=this.socketWrapper)||void 0===n||n.onClose((()=>{this.connectOffline()})),null===(o=this.socketWrapper)||void 0===o||o.onError((()=>{this.connectOffline()})),this.socketUrl=e,null===(a=this.socketWrapper)||void 0===a||a.init(e)}catch(e){psLog.error(e.message)}}addListener(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}removeListener(e,t){const r=this.events[e]||[],n=r.indexOf(t);n>-1&&r.splice(n,1)}broadcastMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=makeBroadcastMessage(e);this.send(r,t)}close(){var e;this.connectable=!1,this.clearPing(),null===(e=this.socketWrapper)||void 0===e||e.close(),this.messages=[],Object.entries(this.events).forEach((e=>{let[t,r]=e;["atom-detail","atom-getter","debugger-online"].includes(t)||r.splice(0)}))}connectOnline(){this.retryInterval=INIT_RETRY_INTERVAL,this.updateRoomInfo(),this.ping()}connectOffline(){this.socketConnection=null,this.debuggerConnection=null,this.clearPing(),this.retryTimer&&clearTimeout(this.retryTimer),this.connectable&&(this.retryTimer=setTimeout((()=>{this.retryInterval<MAX_RETRY_INTERVAL&&(this.retryInterval*=RETRY_TIME_INCR),this.retryTimer=null,this.tryReconnect()}),this.retryInterval))}tryReconnect(){this.init(this.socketUrl)}ping(){this.pingTimer&&clearTimeout(this.pingTimer),this.pongTimer&&clearTimeout(this.pongTimer),this.pingTimer=setTimeout((()=>{this.send({type:"ping",content:null}),this.pingTimer=null,this.pongTimer=setTimeout((()=>{this.connectOffline(),this.pongTimer=null}),HEARTBEAT_INTERVAL)}),HEARTBEAT_INTERVAL)}clearPing(){this.pingTimer&&(clearTimeout(this.pingTimer),this.pingTimer=null),this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}handlePong(){clearTimeout(this.pongTimer),this.pongTimer=null,this.ping()}handleMessage(e){var t;SocketStoreBase.messageFilters.length&&SocketStoreBase.messageFilters.forEach((t=>{e=t(e)}));const{CONNECT:r,MESSAGE:n,ERROR:o,JOIN:a,PING:s,PONG:i,LEAVE:c,CLOSE:l,BROADCAST:d}=SERVER_MESSAGE_TYPE,u=JSON.parse(e.data),{type:p}=u;switch(p){case r:const{selfConnection:e,roomConnections:s}=u.content;this.socketConnection=e,this.debuggerConnection=s.find((e=>"Debugger"===e.userId))||null;break;case a:case c:const{connection:i}=u.content;"Debugger"===i.userId&&(p===a?(this.debuggerConnection=i,this.sendClientInfo()):this.debuggerConnection=null);break;case n:const{data:d,from:f,to:h}=u.content;h.address===(null===(t=this.socketConnection)||void 0===t?void 0:t.address)&&this.dispatchEvent(d.type,{source:d,from:f,to:h});break;case l:case o:this.connectOffline()}this.handlePong()}dispatchEvent(e,t){var r;["public-data"].includes(e)?this.events["public-data"].forEach((e=>{e(t)})):null===(r=this.events[e])||void 0===r||r.forEach((e=>{e.call(this,t,(e=>{this.unicastMessage(e,t.from)}))}))}unicastMessage(e,t){const r=makeUnicastMessage(e,this.socketConnection,t);this.send(r)}handleFlushBuffer(e){const{latestId:t}=e.source.data,r=this.messages.findIndex((e=>e.content.data.data.id===t));this.messages.slice(r+1).forEach((t=>{const r={type:MESSAGE,content:{data:t.content.data,from:this.socketConnection,to:e.from}};this.send(r,!0)}))}static handleResolveAtom(e,t){let{source:r}=e;const{type:n,data:o}=r;if("atom-detail"===n){const e=atom.get(o)||{};t(makeMessage("atom-detail-".concat(o),e,!1))}}static handleAtomPropertyGetter(e,t){let{source:r}=e;const{type:n,data:o}=r;if("atom-getter"===n){const{id:e,parentId:r,key:n,instanceId:s}=o,i=atom.getOrigin(s),c=atom.getOrigin(r);let l={};var a;if(i&&c)l=null===(a=Object.getOwnPropertyDescriptor(c,n))||void 0===a||null===(a=a.get)||void 0===a?void 0:a.call(i);else l=new Error("Getter computed failed");t(makeMessage("atom-getter-".concat(e),atom.transformToAtom(l)))}}send(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.checkIfSend(e))try{var r;const t=e;t.createdAt=Date.now(),t.requestId=getRandomId();const n=stringifyData(t);null===(r=this.socketWrapper)||void 0===r||r.send(n)}catch(e){psLog.error("Incompatible: ".concat(e.message)),this.connectOffline()}this.checkIfCache(e,t)&&(0!==this.messageCapacity&&this.messages.length>=this.messageCapacity&&this.messages.shift(),this.messages.push(e))}checkIfSend(e){return this.socketWrapper.getState()===SocketState.OPEN&&(!![UPDATE_ROOM_INFO,PING].includes(e.type)||!!this.debuggerConnection)}checkIfCache(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.isOffline&&!t&&![MESSAGE,PING].includes(e.type)}sendClientInfo(){var e;const t=null===(e=this.getClient)||void 0===e?void 0:e.call(this).makeClientInfoMsg();this.broadcastMessage({role:"client",type:"client-info",data:t},!0)}}_defineProperty(SocketStoreBase,"messageFilters",[]);const systemLang=isCN()?"zh":"en";class Translation{constructor(e){_defineProperty(this,"locales",void 0),_defineProperty(this,"currentLang",void 0);const{locales:t,defaultLang:r=systemLang}=e;if(!t||0===Object.keys(t).length)throw new Error("[PageSpy] Locales cannot be empty");if(!t[r])throw new Error('[PageSpy] Language "'.concat(r,'" not found'));this.locales=t,this.currentLang=r}t(e,t){const r=t||this.currentLang,n=this.locales[r];return n?n[e]||e:(psLog.warn("Language '".concat(r,"' not found, falling back to default")),e)}setLang(e){this.locales[e]?this.currentLang=e:psLog.error("Language '".concat(e,"' is not supported"))}getCurrentLang(){return this.currentLang}getSupportedLangs(){return Object.keys(this.locales)}}var n=["U","R","D","L"],t={capture:!0,passive:!0};function r(e,r){window.addEventListener(e,r,t)}function e(e,r){window.removeEventListener(e,r,t)}var o=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},u=function(e,t){return[e[0]-t[0],e[1]-t[1]]},i=function(e){var t=Math.atan2(e[0],-e[1]);return t=t/Math.PI*2,t=(Math.round(t)+4)%4,n[t]};function a(t,a){var s=t.length;if(0===s)throw new TypeError("The `command` must not be an empty array");var c=[],l=0,d=function(e){if(null===e)return l=0,void(c.length=0);if(c[l]=e,l=(l+1)%s,c.length==s){for(var r=0;r<s;r++)if(t[r]!==c[(l+r)%s])return;a()}};!function(t){r("touchstart",(function(n){var a=[],s=function(e){var t=e.targetTouches;if(1===t.length){var r=t[0],n=r.clientX,o=r.clientY;a.push([n,o])}};s(n),r("touchmove",s);var c=function(){if(e("touchmove",s),e("touchend",c),a.length<2)return t(null);var r=u(a[a.length-1],a[0]);if(o(r)<10)return t(null);for(var n=i(r),l=1;l<a.length;l++){var d=u(a[l],a[l-1]);if(!(o(d)<10)&&i(d)!=n)return t(null)}t(n)};r("touchend",c)}))}(d),function(e){r("keydown",(function(t){var r=["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"].indexOf(t.key);e(r>=0?n[r]:null)}))}(d)}class WebSocketWrapper extends SocketWrapper{constructor(){super(...arguments),_defineProperty(this,"socketInstance",null)}init(e){this.socketInstance=new WebSocket(e);["open","close","error","message"].forEach((e=>{this.socketInstance.addEventListener(e,(t=>{this.events[e].forEach((e=>{e(t)}))}))}))}send(e){var t;null===(t=this.socketInstance)||void 0===t||t.send(stringifyData(e))}close(){var e;null===(e=this.socketInstance)||void 0===e||e.close()}getState(){var e;return null===(e=this.socketInstance)||void 0===e?void 0:e.readyState}}class WebSocketStore extends SocketStoreBase{constructor(){super(...arguments),_defineProperty(this,"socketWrapper",new WebSocketWrapper)}onOffline(){window.dispatchEvent(new CustomEvent("sdk-inactive")),sessionStorage.removeItem(ROOM_SESSION_KEY)}}var socketStore=new WebSocketStore;class ConsolePlugin{constructor(){_defineProperty(this,"name","ConsolePlugin"),_defineProperty(this,"proxyTypes",["log","info","error","warn","debug"]),_defineProperty(this,"console",{}),_defineProperty(this,"$pageSpyConfig",null)}async onInit(e){let{config:t}=e;ConsolePlugin.hasInitd||(ConsolePlugin.hasInitd=!0,socketStore.addListener("debug",ConsolePlugin.handleDebugger),this.$pageSpyConfig=t,this.init())}init(){var e=this;this.proxyTypes.forEach((t=>{this.console[t]=window.console[t]||window.console.log||(()=>{}),window.console[t]=function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.printLog({logType:t,logs:n,url:window.location.href})}}))}reset(){this.proxyTypes.forEach((e=>{window.console[e]=this.console[e]}))}onReset(){this.reset(),ConsolePlugin.hasInitd=!1}static handleDebugger(e,t){let{source:r}=e;const{type:n,data:o}=r;if("debug"===n){t(makeMessage("console",{logType:"debug-origin",logs:[{id:getRandomId(),type:"debug-origin",value:o}]}));try{const e=new Function("return ".concat(o))();t(makeMessage("console",{logType:"debug-eval",logs:[atom.transformToAtom(e)]}))}catch(e){t(makeMessage("console",{logType:"error",logs:[{type:"error",value:e.stack}]}))}}}printLog(e){if(e.logs&&e.logs.length){var t,r;const n=null===(t=this.$pageSpyConfig)||void 0===t||null===(t=t.dataProcessor)||void 0===t?void 0:t.console;if(n){this.reset();const t=n(e);if(this.init(),!1===t)return}this.console[e.logType](...e.logs);const o=makeMessage("console",{...e,time:Date.now(),logs:e.logs.map((e=>atom.transformToAtom(e,!1)))});if(socketStore.broadcastMessage(o),null!==(r=this.$pageSpyConfig)&&void 0!==r&&r.serializeData){const t={...o,data:{...o.data,logs:e.logs.map((e=>atom.transformToAtom(e,!0)))}};socketStore.dispatchEvent("public-data",t)}else socketStore.dispatchEvent("public-data",o)}}}_defineProperty(ConsolePlugin,"hasInitd",!1);class ErrorPlugin{constructor(){_defineProperty(this,"name","ErrorPlugin"),_defineProperty(this,"$pageSpyConfig",null),_defineProperty(this,"uncaughtErrorListener",(e=>{if(e.error){const{message:t,stack:r}=e.error,n=formatErrorObj(e.error);this.sendMessage(r||t,n)}else{const t=e.message||"[PageSpy] An unknown error occurred and no stack trace available";this.sendMessage(t,null)}})),_defineProperty(this,"resourceLoadErrorListener",(e=>{if(!(e instanceof ErrorEvent)){const{target:t}=e;this.sendMessage("[PageSpy] Resource Load Error: Cannot load resource of (".concat(t.src||t.href,")"),null)}})),_defineProperty(this,"rejectionListener",(e=>{const t=formatErrorObj(e.reason);this.sendMessage(e.reason,t)}))}onInit(e){let{config:t}=e;ErrorPlugin.hasInitd||(ErrorPlugin.hasInitd=!0,this.$pageSpyConfig=t,this.onUncaughtError(),this.onResourceLoadError(),this.onUnhandledRejectionError())}onReset(){window.removeEventListener("error",this.uncaughtErrorListener),window.removeEventListener("error",this.resourceLoadErrorListener),window.removeEventListener("unhandledrejection",this.rejectionListener),ErrorPlugin.hasInitd=!1}onUncaughtError(){window.addEventListener("error",this.uncaughtErrorListener)}onResourceLoadError(){window.addEventListener("error",this.resourceLoadErrorListener,!0)}onUnhandledRejectionError(){window.addEventListener("unhandledrejection",this.rejectionListener)}sendMessage(e,t){var r,n;const o={logType:"error",logs:[e],time:Date.now(),url:window.location.href,errorDetail:t};if(!1===(null===(r=this.$pageSpyConfig)||void 0===r||null===(r=r.dataProcessor)||void 0===r||null===(n=r.console)||void 0===n?void 0:n.call(r,o)))return;o.logs=o.logs.map((e=>atom.transformToAtom(e)));const a=makeMessage("console",o);socketStore.dispatchEvent("public-data",a),socketStore.broadcastMessage(a)}}_defineProperty(ErrorPlugin,"hasInitd",!1);class WebNetworkProxyBase extends NetworkProxyBase{constructor(){super(socketStore)}}class XhrProxy extends WebNetworkProxyBase{constructor(){super(),_defineProperty(this,"xhrOpen",null),_defineProperty(this,"xhrSend",null),_defineProperty(this,"xhrSetRequestHeader",null),this.initProxyHandler()}initProxyHandler(){const e=this;if(!window.XMLHttpRequest)return;const{open:t,send:r,setRequestHeader:n}=window.XMLHttpRequest.prototype;this.xhrOpen=t,this.xhrSend=r,this.xhrSetRequestHeader=n,window.XMLHttpRequest.prototype.open=function(){const r=this;for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];const s=o[0],i=o[1],c=getRandomId();e.createRequest(c);const l=e.getRequest(c);return l&&(l.url=new URL(i,window.location.href).toString(),l.method=s.toUpperCase(),l.requestType="xhr"),this.pageSpyRequestId=c,this.pageSpyRequestMethod=s,this.pageSpyRequestUrl=i,r.addEventListener("readystatechange",(async()=>{if(l){switch(l.readyState=r.readyState,r.readyState){case r.UNSENT:case r.OPENED:l.status=r.status,l.statusText="Pending",l.startTime||(l.startTime=Date.now());break;case r.HEADERS_RECEIVED:l.status=r.status,l.statusText="Loading";const t=(r.getAllResponseHeaders()||"").trim().split(/[\r\n]+/);l.responseHeader=t.reduce(((e,t)=>{const[r,...n]=t.split(": ");return e.push([r,n.join(": ")]),e}),[]);break;case r.LOADING:l.status=r.status,l.statusText="Loading";break;case r.DONE:l.status=r.status,l.statusText="Done",l.endTime=Date.now(),l.costTime=l.endTime-(l.startTime||l.endTime);const n=await e.formatResponse(r);getObjectKeys(n).forEach((e=>{l[e]=n[e]}));break;default:l.status=r.status,l.statusText="Unknown"}e.sendRequestItem(r.pageSpyRequestId,l)}else psLog.warn("The request object is not found on XMLHttpRequest's readystatechange event")})),t.apply(r,o)},window.XMLHttpRequest.prototype.setRequestHeader=function(t,r){const o=e.getRequest(this.pageSpyRequestId);return o?(o.requestHeader||(o.requestHeader=[]),o.requestHeader.push([String(t),String(r)])):psLog.warn("The request object is not found on XMLHttpRequest's setRequestHeader event"),n.apply(this,[t,r])},window.XMLHttpRequest.prototype.send=function(t){const n=this,{pageSpyRequestId:o}=n,a=e.getRequest(o);return a?(a.responseType=n.responseType,a.withCredentials=n.withCredentials,"GET"!==a.method&&(a.requestHeader=addContentTypeHeader(a.requestHeader,t),getFormattedBody(t).then((t=>{a.requestPayload=t,e.sendRequestItem(n.pageSpyRequestId,a)})))):psLog.warn("The request object is not found on XMLHttpRequest's send event"),r.apply(n,[t])}}reset(){this.xhrOpen&&(window.XMLHttpRequest.prototype.open=this.xhrOpen),this.xhrSend&&(window.XMLHttpRequest.prototype.send=this.xhrSend),this.xhrSetRequestHeader&&(window.XMLHttpRequest.prototype.setRequestHeader=this.xhrSetRequestHeader)}async formatResponse(e){const t={response:"",responseReason:null};switch(e.responseType){case"":case"text":if(isString(e.response))try{t.response=JSON.parse(e.response)}catch(r){t.response=e.response}else void 0!==e.response&&(t.response=toStringTag(e.response));break;case"json":void 0!==e.response&&(t.response=e.response);break;case"blob":case"arraybuffer":if(e.response){let r=e.response;if(isArrayBuffer(r)){const t=e.getResponseHeader("content-type");t&&(r=new Blob([r],{type:t}))}if(isBlob(r))if(r.size<=MAX_SIZE)try{t.response=await blob2base64Async(r)}catch(e){t.response=await r.text(),psLog.error(e.message)}else t.response="[object Blob]",t.responseReason=Reason.EXCEED_SIZE}break;default:void 0!==e.response&&(t.response=Object.prototype.toString.call(e.response))}return t}}var global$2=global$q,promiseNativeConstructor=global$2.Promise,newPromiseCapability$1={},aCallable=aCallable$7,$TypeError=TypeError,PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw $TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=aCallable(t),this.reject=aCallable(r)};newPromiseCapability$1.f=function(e){return new PromiseCapability(e)};var anObject=anObject$g,isObject=isObject$a,newPromiseCapability=newPromiseCapability$1,promiseResolve$1=function(e,t){if(anObject(e),isObject(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},$$1=_export,NativePromiseConstructor=promiseNativeConstructor,fails=fails$s,getBuiltIn=getBuiltIn$a,isCallable=isCallable$o,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$1,defineBuiltIn=defineBuiltIn$8,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails((function(){NativePromisePrototype.finally.call({then:function(){}},(function(){}))}));if($$1({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function(e){var t=speciesConstructor(this,getBuiltIn("Promise")),r=isCallable(e);return this.then(r?function(r){return promiseResolve(t,e()).then((function(){return r}))}:e,r?function(r){return promiseResolve(t,e()).then((function(){throw r}))}:e)}}),isCallable(NativePromiseConstructor)){var method=getBuiltIn("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn(NativePromisePrototype,"finally",method,{unsafe:!0})}class FetchProxy extends WebNetworkProxyBase{constructor(){super(),_defineProperty(this,"fetch",null),this.initProxyHandler()}reset(){this.fetch&&(window.fetch=this.fetch)}initProxyHandler(){const e=this,t=window.fetch;t&&(this.fetch=t,window.fetch=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=t(r,n),a=getRandomId();e.createRequest(a);const s=e.getRequest(a);if(s){let t,i="GET",c=null;isString(r)||isURL(r)?(i=n.method||"GET",t=r,c=n.headers||null):(i=r.method,t=r.url,c=r.headers),s.url=new URL(t,window.location.href).toString(),s.method=i.toUpperCase(),s.requestType="fetch",s.status=0,s.statusText="Pending",s.startTime=Date.now(),s.readyState=XMLHttpRequest.UNSENT,n.credentials&&"omit"!==n.credentials&&(s.withCredentials=!0),c&&(isHeaders(c)?s.requestHeader=[...c.entries()]:isObjectLike(c)?s.requestHeader=Object.entries(c).map((e=>{let[t,r]=e;return[String(t),String(r)]})):s.requestHeader=c.map((e=>{let[t,r]=e;return[String(t),String(r)]}))),"GET"!==s.method&&(s.requestHeader=addContentTypeHeader(s.requestHeader,n.body),getFormattedBody(n.body).then((t=>{s.requestPayload=t,e.sendRequestItem(a,s)}))),e.sendRequestItem(a,s),o.then((t=>{s.endTime=Date.now(),s.costTime=s.endTime-(s.startTime||s.endTime),s.status=t.status||200,s.statusText=t.statusText||"Done",s.responseHeader=[...t.headers.entries()],s.readyState=XMLHttpRequest.HEADERS_RECEIVED,e.sendRequestItem(a,s);const r=t.headers.get("content-type");if(r){if(r.includes("application/json"))return s.responseType="json",t.clone().text();if(r.includes("text/html")||r.includes("text/plain"))return s.responseType="text",t.clone().text()}return s.responseType="blob",t.clone().blob()})).then((async e=>{switch(s.responseType){case"text":case"json":try{s.response=JSON.parse(e)}catch(t){s.response=e,s.responseType="text"}break;case"blob":const t=e;if(t.size<=MAX_SIZE)try{s.response=await blob2base64Async(t)}catch(e){s.response=await t.text(),psLog.error(e.message)}else s.response="[object Blob]",s.responseReason=Reason.EXCEED_SIZE}})).finally((()=>{s.readyState=XMLHttpRequest.DONE,e.sendRequestItem(a,s)}))}else psLog.warn("The request object is not found on window.fetch event");return o})}}class BeaconProxy extends WebNetworkProxyBase{constructor(){super(),_defineProperty(this,"sendBeacon",null),this.initProxyHandler()}reset(){this.sendBeacon&&(window.navigator.sendBeacon=this.sendBeacon)}initProxyHandler(){const e=window.navigator.sendBeacon;if(!e)return;const t=this;this.sendBeacon=e,window.navigator.sendBeacon=function(r,n){const o=e.call(window.navigator,r,n),a=getRandomId();t.createRequest(a);const s=t.getRequest(a);return s?(s.url=new URL(r,window.location.href).toString(),s.method="POST",s.status=0,s.statusText="Pending",s.requestType="ping",s.requestHeader=addContentTypeHeader(s.requestHeader,n),s.startTime=Date.now(),getFormattedBody(n).then((e=>{s.requestPayload=e,t.sendRequestItem(a,s)})),s.response="",o?(s.status=200,s.statusText="Sent",s.endTime=Date.now(),s.costTime=s.endTime-(s.startTime||s.endTime)):(s.status=500,s.statusText="Unknown"),s.readyState=XMLHttpRequest.DONE,t.sendRequestItem(a,s)):psLog.warn("The request object is not on navigator.sendBeacon event"),o}}}const OriginEventSource=window.EventSource;class SSEProxy extends WebNetworkProxyBase{constructor(){super(),this.initProxyHandler()}initProxyHandler(){if(!window.EventSource)return;const e=this;window.EventSource=class{constructor(t,r){const n=getRandomId(),o=new RequestItem(n);o.url=new URL(t,window.location.href).toString(),o.method="GET",o.requestType="eventsource",o.requestHeader=[["Accept","text/event-stream"],["Cache-Control","no-cache"]],o.readyState=ReqReadyState.UNSENT,o.withCredentials=Boolean(null==r?void 0:r.withCredentials),o.responseHeader=[["Content-Type","text/event-stream"]],o.responseType="text",o.startTime=Date.now();const a=new OriginEventSource(t,r);return a.addEventListener("open",(()=>{o.readyState=ReqReadyState.OPENED,o.endTime=Date.now(),o.costTime=o.endTime-o.startTime,e.sendRequestItem(n,o)})),a.addEventListener("message",(t=>{let{data:r,lastEventId:a}=t;o.status=200,o.statusText="Done",o.readyState=ReqReadyState.DONE,o.response=r,o.lastEventId=a,o.endTime=Date.now(),o.costTime=o.endTime-o.startTime,e.sendRequestItem(n,o)})),a.addEventListener("error",(()=>{o.status=400,o.readyState=ReqReadyState.DONE,o.endTime=Date.now(),o.costTime=o.endTime-o.startTime,e.sendRequestItem(n,o)})),a}}}reset(){window.EventSource=OriginEventSource}}class ResourceCollector extends WebNetworkProxyBase{constructor(){super(),_defineProperty(this,"observer",null),_defineProperty(this,"excluded",/(beacon|fetch|xmlhttprequest)/i),this.initResourceHandler()}initResourceHandler(){const e=performance.timeOrigin||Date.now()-performance.now();this.observer=new PerformanceObserver((t=>{t.getEntries().forEach((t=>{const{name:r,initiatorType:n,fetchStart:o,responseEnd:a,duration:s,responseStatus:i=0}=t;if(this.excluded.test(n))return;const c=getRandomId();this.createRequest(c);const l=this.getRequest(c);l.method="GET",l.url=r,l.requestType=n,l.readyState=XMLHttpRequest.DONE,l.startTime=e+o,l.endTime=e+a,l.costTime=s,l.response="",l.responseType="resource",l.status=i,this.sendRequestItem(c,l)}))})),this.observer.observe({type:"resource",buffered:!0})}reset(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null}}class NetworkPlugin{constructor(){_defineProperty(this,"name","NetworkPlugin"),_defineProperty(this,"xhrProxy",null),_defineProperty(this,"fetchProxy",null),_defineProperty(this,"beaconProxy",null),_defineProperty(this,"sseProxy",null),_defineProperty(this,"resourceCollector",null)}onInit(e){let{config:t}=e;NetworkPlugin.hasInitd||(NetworkPlugin.hasInitd=!0,NetworkProxyBase.dataProcessor=t.dataProcessor.network,this.xhrProxy=new XhrProxy,this.fetchProxy=new FetchProxy,this.beaconProxy=new BeaconProxy,this.sseProxy=new SSEProxy,this.resourceCollector=new ResourceCollector)}onReset(){var e,t,r,n,o;null===(e=this.xhrProxy)||void 0===e||e.reset(),null===(t=this.fetchProxy)||void 0===t||t.reset(),null===(r=this.beaconProxy)||void 0===r||r.reset(),null===(n=this.sseProxy)||void 0===n||n.reset(),null===(o=this.resourceCollector)||void 0===o||o.reset(),NetworkPlugin.hasInitd=!1}}_defineProperty(NetworkPlugin,"hasInitd",!1);var $=_export,global$1=global$q,setToStringTag=setToStringTag$6;$({global:!0},{Reflect:{}}),setToStringTag(global$1.Reflect,"Reflect",!0),function(scriptGlobalObject,window,document,undefined$1){function is(e,t){return typeof e===t}function testRunner(){var e,t,r,n,o,a;for(var s in tests)if(tests.hasOwnProperty(s)){if(e=[],(t=tests[s]).name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(r=0;r<t.options.aliases.length;r++)e.push(t.options.aliases[r].toLowerCase());for(n=is(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)1===(a=e[o].split(".")).length?Modernizr[a[0]]=n:(Modernizr[a[0]]&&(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean)||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=n),classes.push((n?"":"no-")+a.join("-"))}}function setClasses(e){var t=docElement.className,r=Modernizr._config.classPrefix||"";if(isSVG&&(t=t.baseVal),Modernizr._config.enableJSClass){var n=new RegExp("(^|\\s)"+r+"no-js(\\s|$)");t=t.replace(n,"$1"+r+"js$2")}Modernizr._config.enableClasses&&(e.length>0&&(t+=" "+r+e.join(" "+r)),isSVG?docElement.className.baseVal=t:docElement.className=t)}function addTest(e,t){if("object"==typeof e)for(var r in e)hasOwnProp(e,r)&&addTest(r,e[r]);else{var n=(e=e.toLowerCase()).split("."),o=Modernizr[n[0]];if(2===n.length&&(o=o[n[1]]),void 0!==o)return Modernizr;t="function"==typeof t?t():t,1===n.length?Modernizr[n[0]]=t:(!Modernizr[n[0]]||Modernizr[n[0]]instanceof Boolean||(Modernizr[n[0]]=new Boolean(Modernizr[n[0]])),Modernizr[n[0]][n[1]]=t),setClasses([(t&&!1!==t?"":"no-")+n.join("-")]),Modernizr._trigger(e,t)}return Modernizr}function contains(e,t){return!!~(""+e).indexOf(t)}function createElement(){return"function"!=typeof document.createElement?document.createElement(arguments[0]):isSVG?document.createElementNS.call(document,"http://www.w3.org/2000/svg",arguments[0]):document.createElement.apply(document,arguments)}function getBody(){var e=document.body;return e||((e=createElement(isSVG?"svg":"body")).fake=!0),e}function injectElementWithStyles(e,t,r,n){var o,a,s,i,c="modernizr",l=createElement("div"),d=getBody();if(parseInt(r,10))for(;r--;)(s=createElement("div")).id=n?n[r]:c+(r+1),l.appendChild(s);return(o=createElement("style")).type="text/css",o.id="s"+c,(d.fake?d:l).appendChild(o),d.appendChild(l),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),l.id=c,d.fake&&(d.style.background="",d.style.overflow="hidden",i=docElement.style.overflow,docElement.style.overflow="hidden",docElement.appendChild(d)),a=t(l,e),d.fake&&d.parentNode?(d.parentNode.removeChild(d),docElement.style.overflow=i,docElement.offsetHeight):l.parentNode.removeChild(l),!!a}function domToCSS(e){return e.replace(/([A-Z])/g,(function(e,t){return"-"+t.toLowerCase()})).replace(/^ms-/,"-ms-")}function computedStyle(e,t,r){var n;if("getComputedStyle"in window){n=getComputedStyle.call(window,e,t);var o=window.console;if(null!==n)r&&(n=n.getPropertyValue(r));else if(o){o[o.error?"error":"log"].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else n=!t&&e.currentStyle&&e.currentStyle[r];return n}function nativeTestProps(e,t){var r=e.length;if("CSS"in window&&"supports"in window.CSS){for(;r--;)if(window.CSS.supports(domToCSS(e[r]),t))return!0;return!1}if("CSSSupportsRule"in window){for(var n=[];r--;)n.push("("+domToCSS(e[r])+":"+t+")");return injectElementWithStyles("@supports ("+(n=n.join(" or "))+") { #modernizr { position: absolute; } }",(function(e){return"absolute"===computedStyle(e,null,"position")}))}return undefined$1}function cssToDOM(e){return e.replace(/([a-z])-([a-z])/g,(function(e,t,r){return t+r.toUpperCase()})).replace(/^-/,"")}function testProps(e,t,r,n){function o(){s&&(delete mStyle.style,delete mStyle.modElem)}if(n=!is(n,"undefined")&&n,!is(r,"undefined")){var a=nativeTestProps(e,r);if(!is(a,"undefined"))return a}for(var s,i,c,l,d,u=["modernizr","tspan","samp"];!mStyle.style&&u.length;)s=!0,mStyle.modElem=createElement(u.shift()),mStyle.style=mStyle.modElem.style;for(c=e.length,i=0;i<c;i++)if(l=e[i],d=mStyle.style[l],contains(l,"-")&&(l=cssToDOM(l)),mStyle.style[l]!==undefined$1){if(n||is(r,"undefined"))return o(),"pfx"!==t||l;try{mStyle.style[l]=r}catch(e){}if(mStyle.style[l]!==d)return o(),"pfx"!==t||l}return o(),!1}function fnBind(e,t){return function(){return e.apply(t,arguments)}}function testDOMProps(e,t,r){var n;for(var o in e)if(e[o]in t)return!1===r?e[o]:is(n=t[e[o]],"function")?fnBind(n,r||t):n;return!1}function testPropsAll(e,t,r,n,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+cssomPrefixes.join(a+" ")+a).split(" ");return is(t,"string")||is(t,"undefined")?testProps(s,t,n,o):testDOMProps(s=(e+" "+domPrefixes.join(a+" ")+a).split(" "),t,r)}function detectDeleteDatabase(e,t){var r=e.deleteDatabase(t);r.onsuccess=function(){addTest("indexeddb.deletedatabase",!0)},r.onerror=function(){addTest("indexeddb.deletedatabase",!1)}}function testAllProps(e,t,r){return testPropsAll(e,undefined$1,undefined$1,t,r)}var tests=[],ModernizrProto={_version:"3.13.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var r=this;setTimeout((function(){t(r[e])}),0)},addTest:function(e,t,r){tests.push({name:e,fn:t,options:r})},addAsyncTest:function(e){tests.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=ModernizrProto,Modernizr=new Modernizr;var classes=[],hasOwnProp;!function(){var e={}.hasOwnProperty;hasOwnProp=is(e,"undefined")||is(e.call,"undefined")?function(e,t){return t in e&&is(e.constructor.prototype[t],"undefined")}:function(t,r){return e.call(t,r)}}();var docElement=document.documentElement,isSVG="svg"===docElement.nodeName.toLowerCase();ModernizrProto._l={},ModernizrProto.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout((function(){Modernizr._trigger(e,Modernizr[e])}),0)},ModernizrProto._trigger=function(e,t){if(this._l[e]){var r=this._l[e];setTimeout((function(){var e;for(e=0;e<r.length;e++)(0,r[e])(t)}),0),delete this._l[e]}},Modernizr._q.push((function(){ModernizrProto.addTest=addTest})),Modernizr.addTest("blobconstructor",(function(){try{return!!new Blob}catch(e){return!1}}),{aliases:["blob-constructor"]}),Modernizr.addAsyncTest((function(){var e,t=["read","readText","write","writeText"];if(navigator.clipboard){addTest("clipboard",!0);for(var r=0;r<t.length;r++)e=!!navigator.clipboard[t[r]],addTest("clipboard."+t[r].toLowerCase(),e)}else addTest("clipboard",!1)})),Modernizr.addTest("cookies",(function(){try{document.cookie="cookietest=1";var e=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch(e){return!1}})),Modernizr.addTest("cors","XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest);var omPrefixes="Moz O ms Webkit",cssomPrefixes=ModernizrProto._config.usePrefixes?omPrefixes.split(" "):[];ModernizrProto._cssomPrefixes=cssomPrefixes;var modElem={elem:createElement("modernizr")};Modernizr._q.push((function(){delete modElem.elem}));var mStyle={style:modElem.elem.style};Modernizr._q.unshift((function(){delete mStyle.style}));var domPrefixes=ModernizrProto._config.usePrefixes?omPrefixes.toLowerCase().split(" "):[];ModernizrProto._domPrefixes=domPrefixes,ModernizrProto.testAllProps=testPropsAll;var atRule=function(e){var t,r=prefixes.length,n=window.CSSRule;if(void 0===n)return undefined$1;if(!e)return!1;if((t=(e=e.replace(/^@/,"")).replace(/-/g,"_").toUpperCase()+"_RULE")in n)return"@"+e;for(var o=0;o<r;o++){var a=prefixes[o];if(a.toUpperCase()+"_"+t in n)return"@-"+a.toLowerCase()+"-"+e}return!1};ModernizrProto.atRule=atRule;var prefixed=ModernizrProto.prefixed=function(e,t,r){return 0===e.indexOf("@")?atRule(e):(-1!==e.indexOf("-")&&(e=cssToDOM(e)),t?testPropsAll(e,t,r):testPropsAll(e,"pfx"))},crypto=prefixed("crypto",window);Modernizr.addTest("crypto",!!prefixed("subtle",crypto)),Modernizr.addTest("customelements","customElements"in window),Modernizr.addTest("customevent","CustomEvent"in window&&"function"==typeof window.CustomEvent),Modernizr.addTest("dataview","undefined"!=typeof DataView&&"getFloat64"in DataView.prototype),Modernizr.addAsyncTest((function(){var e=new Image;e.onerror=function(){addTest("exiforientation",!1)},e.onload=function(){addTest("exiforientation",2!==e.width)},e.src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q=="})),Modernizr.addAsyncTest((function(){var e;try{e=prefixed("indexedDB",window)}catch(e){}if(e){var t,r="modernizr-"+Math.random();try{t=e.open(r)}catch(e){return void addTest("indexeddb",!1)}t.onerror=function(n){!t.error||"InvalidStateError"!==t.error.name&&"UnknownError"!==t.error.name?(addTest("indexeddb",!0),detectDeleteDatabase(e,r)):(addTest("indexeddb",!1),n.preventDefault())},t.onsuccess=function(){addTest("indexeddb",!0),detectDeleteDatabase(e,r)}}else addTest("indexeddb",!1)})),Modernizr.addTest("proxy","Proxy"in window),Modernizr.addTest("serviceworker","serviceWorker"in navigator),Modernizr.addTest("textencoder",!(!window.TextEncoder||!window.TextEncoder.prototype.encode)),Modernizr.addTest("textdecoder",!(!window.TextDecoder||!window.TextDecoder.prototype.decode)),Modernizr.addTest("typedarrays","ArrayBuffer"in window),Modernizr.addTest("webanimations","animate"in createElement("div")),Modernizr.addTest("webgl",(function(){return"WebGLRenderingContext"in window})),ModernizrProto.testAllProps=testAllProps,Modernizr.addTest("backgroundcliptext",(function(){return testAllProps("backgroundClip","text")})),Modernizr.addTest("borderimage",testAllProps("borderImage","url() 1",!0)),Modernizr.addTest("cssgridlegacy",testAllProps("grid-columns","10px",!0)),Modernizr.addTest("cssgrid",testAllProps("grid-template-rows","none",!0));var supportsFn=window.CSS&&window.CSS.supports.bind(window.CSS)||window.supportsCSS;Modernizr.addTest("customproperties",!!supportsFn&&(supportsFn("--f:0")||supportsFn("--f",0))),Modernizr.addTest("flexgap",(function(){var e=createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(createElement("div")),e.appendChild(createElement("div")),docElement.appendChild(e);var t=1===e.scrollHeight;return e.parentNode.removeChild(e),t})),Modernizr.addTest("focuswithin",(function(){try{document.querySelector(":focus-within")}catch(e){return!1}return!0})),Modernizr.addTest("hsla",(function(){var e=createElement("a").style;return e.cssText="background-color:hsla(120,40%,100%,.5)",contains(e.backgroundColor,"rgba")||contains(e.backgroundColor,"hsla")})),Modernizr.addTest("cssmask",testAllProps("maskRepeat","repeat-x",!0));var prefixes=ModernizrProto._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];ModernizrProto._prefixes=prefixes,Modernizr.addTest("csspositionsticky",(function(){var e="position:",t=createElement("a").style;return t.cssText=e+prefixes.join("sticky;"+e).slice(0,-9),-1!==t.position.indexOf("sticky")})),Modernizr.addTest("rgba",(function(){var e=createElement("a").style;return e.cssText="background-color:rgba(150,255,150,.5)",(""+e.backgroundColor).indexOf("rgba")>-1})),Modernizr.addTest("intersectionobserver","IntersectionObserver"in window),Modernizr.addTest("mutationobserver",!!window.MutationObserver||!!window.WebKitMutationObserver),Modernizr.addTest("passiveeventlisteners",(function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),r=function(){};window.addEventListener("testPassiveEventSupport",r,t),window.removeEventListener("testPassiveEventSupport",r,t)}catch(e){}return e})),Modernizr.addTest("shadowroot","attachShadow"in createElement("div")),Modernizr.addTest("es6array",!!(Array.prototype&&Array.prototype.copyWithin&&Array.prototype.fill&&Array.prototype.find&&Array.prototype.findIndex&&Array.prototype.keys&&Array.prototype.entries&&Array.prototype.values&&Array.from&&Array.of)),Modernizr.addTest("arrow",(function(){try{eval("()=>{}")}catch(e){return!1}return!0})),Modernizr.addTest("class",(function(){try{eval("class A{}")}catch(e){return!1}return!0})),Modernizr.addTest("es6collections",!!(window.Map&&window.Set&&window.WeakMap&&window.WeakSet)),Modernizr.addTest("generators",(function(){try{new Function("function* test() {}")()}catch(e){return!1}return!0})),Modernizr.addTest("es6math",!!(Math&&Math.clz32&&Math.cbrt&&Math.imul&&Math.sign&&Math.log10&&Math.log2&&Math.log1p&&Math.expm1&&Math.cosh&&Math.sinh&&Math.tanh&&Math.acosh&&Math.asinh&&Math.atanh&&Math.hypot&&Math.trunc&&Math.fround)),Modernizr.addTest("es6number",!!(Number.isFinite&&Number.isInteger&&Number.isSafeInteger&&Number.isNaN&&Number.parseInt&&Number.parseFloat&&Number.isInteger(Number.MAX_SAFE_INTEGER)&&Number.isInteger(Number.MIN_SAFE_INTEGER)&&Number.isFinite(Number.EPSILON))),Modernizr.addTest("es6object",!!(Object.assign&&Object.is&&Object.setPrototypeOf)),Modernizr.addTest("promises",(function(){return"Promise"in window&&"resolve"in window.Promise&&"reject"in window.Promise&&"all"in window.Promise&&"race"in window.Promise&&function(){var e;return new window.Promise((function(t){e=t})),"function"==typeof e}()})),Modernizr.addTest("restparameters",(function(){try{eval("function f(...rest) {}")}catch(e){return!1}return!0})),Modernizr.addTest("spreadarray",(function(){try{eval("(function f(){})(...[1])")}catch(e){return!1}return!0})),Modernizr.addTest("stringtemplate",(function(){try{return"-1-"===eval("(function(){var a=1; return `-${a}-`;})()")}catch(e){return!1}})),Modernizr.addTest("es6string",!!(String.fromCodePoint&&String.raw&&String.prototype.codePointAt&&String.prototype.repeat&&String.prototype.startsWith&&String.prototype.endsWith&&String.prototype.includes)),Modernizr.addTest("es6symbol",!!("function"==typeof Symbol&&Symbol.for&&Symbol.hasInstance&&Symbol.isConcatSpreadable&&Symbol.iterator&&Symbol.keyFor&&Symbol.match&&Symbol.prototype&&Symbol.replace&&Symbol.search&&Symbol.species&&Symbol.split&&Symbol.toPrimitive&&Symbol.toStringTag&&Symbol.unscopables)),Modernizr.addTest("es7array",!(!Array.prototype||!Array.prototype.includes)),Modernizr.addTest("restdestructuringarray",(function(){try{eval("var [...rest]=[1]")}catch(e){return!1}return!0})),Modernizr.addTest("restdestructuringobject",(function(){try{eval("var {...rest}={a:1}")}catch(e){return!1}return!0})),Modernizr.addTest("spreadobject",(function(){try{eval("var a={...{b:1}}")}catch(e){return!1}return!0})),Modernizr.addTest("es8object",!(!Object.entries||!Object.values)),Modernizr.addTest("sandbox","sandbox"in createElement("iframe")),Modernizr.addTest("srcdoc","srcdoc"in createElement("iframe")),Modernizr.addTest("canvas",(function(){var e=createElement("canvas");return!(!e.getContext||!e.getContext("2d"))})),Modernizr.addAsyncTest((function(){if(!Modernizr.canvas)return!1;var e=new Image,t=createElement("canvas"),r=t.getContext("2d");e.onload=function(){addTest("apng",(function(){return void 0!==t.getContext&&(r.drawImage(e,0,0),0===r.getImageData(0,0,1,1).data[3])}))},e.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg=="})),Modernizr.addTest("imgcrossorigin","crossOrigin"in createElement("img")),Modernizr.addTest("lazyloading","loading"in HTMLImageElement.prototype),Modernizr.addAsyncTest((function(){var e,t,r=createElement("img"),n="sizes"in r;!n&&"srcset"in r?("data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",e="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",t=function(){addTest("sizes",2===r.width)},r.onload=t,r.onerror=t,r.setAttribute("sizes","9px"),r.srcset=e+" 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 8w",r.src=e):addTest("sizes",n)})),Modernizr.addTest("srcset","srcset"in createElement("img")),Modernizr.addAsyncTest((function(){function e(e,t,r){function n(t){var n=!(!t||"load"!==t.type)&&1===o.width;addTest(e,"webp"===e&&n?new Boolean(n):n),r&&r(t)}var o=new Image;o.onerror=n,o.onload=n,o.src=t}var t=[{uri:"data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=",name:"webp"},{uri:"data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",name:"webp.alpha"},{uri:"data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA",name:"webp.animation"},{uri:"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",name:"webp.lossless"}],r=t.shift();e(r.name,r.uri,(function(r){if(r&&"load"===r.type)for(var n=0;n<t.length;n++)e(t[n].name,t[n].uri)}))})),Modernizr.addTest("beacon","sendBeacon"in navigator),Modernizr.addTest("eventsource","EventSource"in window),Modernizr.addTest("fetch","fetch"in window),Modernizr.addTest("xhr2","XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest),Modernizr.addTest("scriptasync","async"in createElement("script")),Modernizr.addTest("scriptdefer","defer"in createElement("script")),Modernizr.addTest("localstorage",(function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}})),Modernizr.addTest("sessionstorage",(function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(e){return!1}})),Modernizr.addTest("urlsearchparams","URLSearchParams"in window);var domPrefixesAll=[""].concat(domPrefixes);ModernizrProto._domPrefixesAll=domPrefixesAll,Modernizr.addTest("peerconnection",!!prefixed("RTCPeerConnection",window)),Modernizr.addTest("datachannel",(function(){if(!Modernizr.peerconnection)return!1;for(var e=0,t=domPrefixesAll.length;e<t;e++){var r=window[domPrefixesAll[e]+"RTCPeerConnection"];if(r){var n=new r(null);return n.close(),"createDataChannel"in n}}return!1})),Modernizr.addTest("getUserMedia","mediaDevices"in navigator&&"getUserMedia"in navigator.mediaDevices),Modernizr.addTest("resizeobserver","ResizeObserver"in window),Modernizr.addTest("sharedworkers","SharedWorker"in window),Modernizr.addTest("webworkers","Worker"in window),testRunner(),delete ModernizrProto.addTest,delete ModernizrProto.addAsyncTest;for(var i=0;i<Modernizr._q.length;i++)Modernizr._q[i]();scriptGlobalObject.Modernizr=Modernizr}(window,window,document);const FEATURE_MAP={Feature:{blob:{title:"Blob",keyPath:"blob"},clipboard:{title:"Clipboard",keyPath:"clipboard"},crypto:{title:"Crypto",keyPath:"crypto"},customelements:{title:"Custom Elements",keyPath:"custom-elements"},customevent:{title:"Custom Event",keyPath:"event/customevent"},dataview:{title:"DataView",keyPath:"dataview-api"},intersectionobserver:{title:"Intersection Observer",keyPath:"dom/intersection-observer"},mutationobserver:{title:"Mutation Observer",keyPath:"dom/mutationobserver"},passiveeventlisteners:{title:"Passive Event Listeners",keyPath:"dom/passiveeventlisteners"},serviceworker:{title:"Service Worker",keyPath:"serviceworker"},shadowroot:{title:"Shadow DOM",keyPath:"dom/shadowroot"},textencoder:{title:"TextEncoder & TextDecoder",keyPath:"textencoding"},typedarrays:{title:"Typed Arrays",keyPath:"typed-arrays"},webanimations:{title:"Web Animation",keyPath:"webanimations"},webgl:{title:"WebGL",keyPath:"webgl/webgl"},urlsearchparams:{title:"URLSearchParams",keyPath:"url/urlsearchparams"},datachannel:{title:"WebRTC/datachannel",keyPath:"webrtc/datachannel"},getusermedia:{title:"WebRTC/getusermedia",keyPath:"webrtc/getusermedia"},peerconnection:{title:"WebRTC/peerconnection",keyPath:"webrtc/peerconnection"},resizeobserver:{title:"Resizeobserver",keyPath:"window/resizeobserver"},sharedworkers:{title:"Shared Worker",keyPath:"workers/sharedworkers"},webworkers:{title:"Web Worker",keyPath:"workers/webworkers"}},Network:{cors:{title:"CORS",keyPath:"cors"},beacon:{title:"Beacon",keyPath:"network/beacon"},fetch:{title:"Fetch",keyPath:"network/fetch"},xhr2:{title:"XHR2",keyPath:"network/xhr2"}},Javascript:{es6array:{title:"ES6 Array",keyPath:"es6/array"},arrow:{title:"ES6 Arrow Function",keyPath:"es6/arrow"},es6class:{title:"ES6 Class",keyPath:"es6/class"},es6collections:{title:"ES6 Collections",keyPath:"es6/collections"},generators:{title:"ES6 Generators",keyPath:"es6/generators"},es6math:{title:"ES6 Math",keyPath:"es6/math"},es6number:{title:"ES6 Number",keyPath:"es6/number"},es6object:{title:"ES6 Object",keyPath:"es6/object"},promises:{title:"ES6 Promise",keyPath:"es6/promises"},restparameters:{title:"ES6 Rest Parameters",keyPath:"es6/rest-parameters"},spreadarray:{title:"ES6 Array Spread",keyPath:"es6/spread-array"},stringtemplate:{title:"ES6 String Template",keyPath:"es6/string-template"},es6string:{title:"ES6 String",keyPath:"es6/string"},es6symbol:{title:"ES6 Symbol",keyPath:"es6/symbol"},proxy:{title:"ES6 Proxy",keyPath:"proxy"},reflect:{title:"ES6 Reflect",customTest:"\"Reflect\" in window &&\n      typeof window.Reflect === 'object' &&\n      typeof Reflect.has === 'function' &&\n      [\n        'apply',\n        'construct',\n        'defineProperty',\n        'deleteProperty',\n        'getOwnPropertyDescriptor',\n        'getPrototypeOf',\n        'has',\n        'isExtensible',\n        'ownKeys',\n        'preventExtensions',\n        'setPrototypeOf',\n      ].every((i) => Reflect.has(Reflect, i))"},es7array:{title:"ES7 Array",keyPath:"es7/array"},restdestructuringarray:{title:"ES7 Rest Destructuring",keyPath:"es7/rest-destructuring"},spreadobject:{title:"ES7 Object Spread",keyPath:"es7/spread-object"},es8object:{title:"ES8 Object",keyPath:"es8/object"},finally:{title:"ES9 Promise Finally",customTest:"<ES6 Promise> && !!Promise.prototype.finally"}},CSS:{backgroundcliptext:{title:"Background Clip Text",keyPath:"css/backgroundcliptext"},borderimage:{title:"Border Image",keyPath:"css/borderimage"},cssgrid:{title:"CSS Grid",keyPath:"css/cssgrid"},customproperties:{title:"Custom Properties",keyPath:"css/customproperties"},flexgap:{title:"Flex Gap",keyPath:"css/flexgap"},focuswithin:{title:"Focus Within",keyPath:"css/focuswithin"},hsla:{title:"HSLA",keyPath:"css/hsla"},cssmask:{title:"Mask",keyPath:"css/mask"},csspositionsticky:{title:"Position Sticky",keyPath:"css/positionsticky"},rgba:{title:"RGBA",keyPath:"css/rgba"}},Element:{sandbox:{title:"iframe/sandbox",keyPath:"iframe/sandbox"},srcdoc:{title:"iframe/srcdoc",keyPath:"iframe/srcdoc"},apng:{title:"img/apng",keyPath:"img/apng"},imgcrossorigin:{title:"img/crossorigin",keyPath:"img/crossorigin"},exiforientation:{title:"img/exif-orientation",keyPath:"img/exif-orientation"},lazyloading:{title:"img/lazyloading",keyPath:"img/lazyloading"},sizes:{title:"img/sizes",keyPath:"img/sizes"},srcset:{title:"img/srcset",keyPath:"img/srcset"},webp:{title:"img/webp",keyPath:"img/webp"},prefetch:{title:"link/prefetch",keyPath:"link/prefetch"},scriptasync:{title:"script/async",keyPath:"script/async"},scriptdefer:{title:"script/defer",keyPath:"script/defer"}},Storage:{cookies:{title:"Cookies",keyPath:"storage/cookies"},indexeddb:{title:"IndexedDB",keyPath:"storage/indexeddb"},localstorage:{title:"LocalStorage",keyPath:"storage/localstorage"},sessionstorage:{title:"SessionStorage",keyPath:"storage/sessionstorage"}}},GITHUB_BASE_URL="https://github.com/Modernizr/Modernizr/tree/master/feature-detects",asyncFeatureKey=["indexeddb","apng","avif","exiforientation","webp"];function computeAsyncFeature(e){return new Promise((t=>{Modernizr.on(e,(e=>{t(e)}))}))}async function computeResult(){const e={Feature:[],Network:[],Javascript:[],CSS:[],Element:[],Storage:[]};getObjectKeys(FEATURE_MAP).forEach((t=>{const r=FEATURE_MAP[t],n=getObjectKeys(r).map((async e=>{const t=r[e];return t.keyPath&&(t.keyPath="".concat(GITHUB_BASE_URL,"/").concat(t.keyPath,".js")),asyncFeatureKey.indexOf(e)>-1?t.supported=await computeAsyncFeature(e):t.supported=Modernizr[e],t}));e[t]=n}));for(const t in e)hasOwnProperty(e,t)&&(e[t]=await Promise.all(e[t]));return e}window.Modernizr.addTest("finally",Modernizr.promises&&!!Promise.prototype.finally),window.Modernizr.addTest("reflect","Reflect"in window&&"object"==typeof window.Reflect&&"function"==typeof Reflect.has&&["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","setPrototypeOf"].every((e=>Reflect.has(Reflect,e))));class SystemPlugin{constructor(){_defineProperty(this,"name","SystemPlugin"),_defineProperty(this,"$pageSpyConfig",null),_defineProperty(this,"_cache",null)}onInit(e){let{config:t}=e;SystemPlugin.hasInitd||(SystemPlugin.hasInitd=!0,this.$pageSpyConfig=t,this.onceInitPublicData(),socketStore.addListener("refresh",(async(e,t)=>{let{source:r}=e;const{data:n}=r;if("system"===n){const e=await this.getSystemInfo();if(null===e)return;t(e)}})),socketStore.addListener("harbor-clear",(()=>{this.onceInitPublicData()})))}async onceInitPublicData(){const e=await this.getSystemInfo();null!==e&&socketStore.dispatchEvent("public-data",e)}onReset(){SystemPlugin.hasInitd=!1}async getSystemInfo(){var e,t;if(!this._cache){const e=await computeResult();this._cache={system:{ua:navigator.userAgent},features:e}}return!1===(null===(e=this.$pageSpyConfig)||void 0===e||null===(e=e.dataProcessor)||void 0===e||null===(t=e.system)||void 0===t?void 0:t.call(e,this._cache))?null:makeMessage("system",this._cache)}}_defineProperty(SystemPlugin,"hasInitd",!1);class PagePlugin{constructor(){_defineProperty(this,"name","PagePlugin"),_defineProperty(this,"$pageSpyConfig",null)}onInit(e){let{config:t}=e;PagePlugin.hasInitd||(PagePlugin.hasInitd=!0,this.$pageSpyConfig=t,socketStore.addListener("refresh",((e,t)=>{let{source:r}=e;const{data:n}=r;if("page"===n){var o,a;const e=PagePlugin.collectHtml();if(!1===(null===(o=this.$pageSpyConfig)||void 0===o||null===(o=o.dataProcessor)||void 0===o||null===(a=o.page)||void 0===a?void 0:a.call(o,e)))return;const r=makeMessage("page",e);socketStore.dispatchEvent("public-data",r),t(r)}})))}onReset(){PagePlugin.hasInitd=!1}static collectHtml(){return{html:document.documentElement.outerHTML,location:window.location}}}_defineProperty(PagePlugin,"hasInitd",!1);class StoragePlugin{constructor(){_defineProperty(this,"name","StoragePlugin"),_defineProperty(this,"originSetItem",null),_defineProperty(this,"originRemoveItem",null),_defineProperty(this,"originClear",null),_defineProperty(this,"cookieStoreChangeListener",null),_defineProperty(this,"$pageSpyConfig",null)}onInit(e){let{config:t}=e;StoragePlugin.hasInitd||(StoragePlugin.hasInitd=!0,this.$pageSpyConfig=t,this.listenRefreshEvent(),this.onceInitPublicData(),this.initStorageProxy(),socketStore.addListener("harbor-clear",(()=>{this.onceInitPublicData()})))}onReset(){this.originClear&&(Storage.prototype.clear=this.originClear),this.originRemoveItem&&(Storage.prototype.removeItem=this.originRemoveItem),this.originSetItem&&(Storage.prototype.setItem=this.originSetItem),this.cookieStoreChangeListener&&window.cookieStore&&window.cookieStore.removeEventListener("change",this.cookieStoreChangeListener),StoragePlugin.hasInitd=!1}async sendRefresh(e){let t=null;switch(e){case"localStorage":case"sessionStorage":t=this.takeStorage(e);break;case"cookie":t=await this.takeCookie()}t&&this.sendStorageItem(t)}listenRefreshEvent(){socketStore.addListener("refresh",(async e=>{let{source:t}=e;const{data:r}=t;this.sendRefresh(r)}))}takeStorage(e){const t={type:e,action:"get",data:[]},r=window[e],n=r.length;if(!n)return t;for(let e=0;e<=n-1;e++){const n=r.key(e);if(n){const e=r.getItem(n)||"";t.data.push({name:n,value:e})}}return t}async takeCookie(){const e={type:"cookie",action:"get",data:[]};return window.cookieStore?e.data=await window.cookieStore.getAll():document.cookie&&(e.data=document.cookie.split("; ").map((e=>{const[t,r]=e.split("=");return{name:t,value:r}}))),e}initStorageProxy(){const{clear:e,removeItem:t,setItem:r}=Storage.prototype;this.originClear=e,this.originRemoveItem=t,this.originSetItem=r;const n=this;Storage.prototype.clear=function(){e.call(this);const t={type:n.getStorageType(this),action:"clear"};n.sendStorageItem(t)},Storage.prototype.removeItem=function(e){t.call(this,e);const r={type:n.getStorageType(this),action:"remove",name:String(e)};n.sendStorageItem(r)},Storage.prototype.setItem=function(e,t){r.call(this,e,t);const o={type:n.getStorageType(this),action:"set",name:String(e),value:String(t)};n.sendStorageItem(o)},window.cookieStore&&(this.cookieStoreChangeListener=e=>{const{changed:t,deleted:r}=e;t.length>0&&t.forEach((e=>{const t={type:"cookie",action:"set",...e};this.sendStorageItem(t)})),r.length>0&&r.forEach((e=>{const t={type:"cookie",action:"remove",name:e.name};this.sendStorageItem(t)}))},window.cookieStore.addEventListener("change",this.cookieStoreChangeListener))}async onceInitPublicData(){(await Promise.all([this.takeStorage("localStorage"),this.takeStorage("sessionStorage"),this.takeCookie()])).forEach((e=>{var t,r;if(!1===(null===(t=this.$pageSpyConfig)||void 0===t||null===(t=t.dataProcessor)||void 0===t||null===(r=t.storage)||void 0===r?void 0:r.call(t,e)))return;const n=makeMessage("storage",e);socketStore.dispatchEvent("public-data",n)}))}getStorageType(e){return e===localStorage?"localStorage":e===sessionStorage?"sessionStorage":e.constructor.name}sendStorageItem(e){var t,r;if(!1===(null===(t=this.$pageSpyConfig)||void 0===t||null===(t=t.dataProcessor)||void 0===t||null===(r=t.storage)||void 0===r?void 0:r.call(t,e)))return;const n=makeMessage("storage",e);socketStore.dispatchEvent("public-data",n),socketStore.broadcastMessage(n,!0)}}function promisify(e){return new Promise(((t,r)=>{e.addEventListener("success",(()=>{t(e.result)})),e.addEventListener("error",(()=>{r()}))}))}_defineProperty(StoragePlugin,"hasInitd",!1);class DatabasePlugin{constructor(){_defineProperty(this,"name","DatabasePlugin"),_defineProperty(this,"originAdd",null),_defineProperty(this,"originPut",null),_defineProperty(this,"originDelete",null),_defineProperty(this,"originClear",null),_defineProperty(this,"originDrop",null),_defineProperty(this,"$pageSpyConfig",null)}static get isSupport(){return!!(IDBFactory&&IDBObjectStore&&window.indexedDB&&window.indexedDB.databases)}onInit(e){let{config:t}=e;DatabasePlugin.isSupport&&(DatabasePlugin.hasInitd||(DatabasePlugin.hasInitd=!0,this.$pageSpyConfig=t,this.listenEvents(),this.initIndexedDBProxy()))}onReset(){this.originAdd&&(IDBObjectStore.prototype.add=this.originAdd),this.originPut&&(IDBObjectStore.prototype.put=this.originPut),this.originClear&&(IDBObjectStore.prototype.clear=this.originClear),this.originDelete&&(IDBObjectStore.prototype.delete=this.originDelete),this.originDrop&&(IDBFactory.prototype.deleteDatabase=this.originDrop),DatabasePlugin.hasInitd=!1}listenEvents(){socketStore.addListener("refresh",(async e=>{let{source:t}=e;if("indexedDB"===t.data){const e={action:"basic",result:await this.takeBasicInfo()};this.sendData(e)}})),socketStore.addListener("database-pagination",(async e=>{let{source:t}=e;const{db:r,store:n,page:o}=t.data,a=await this.getStoreDataWithPagination({db:r,store:n,page:o});this.sendData(a)}))}initIndexedDBProxy(){const{put:e,add:t,delete:r,clear:n}=IDBObjectStore.prototype;this.originAdd=t,this.originPut=e,this.originDelete=r,this.originClear=n;const o=this;[{origin:e,method:"put"},{origin:t,method:"add"},{origin:r,method:"delete"},{origin:n,method:"clear"}].forEach((e=>{let{origin:t,method:r}=e;IDBObjectStore.prototype[r]=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];const s=t.apply(this,n),i={action:"clear"===r?"clear":"update",database:this.transaction.db.name,store:this.name};return s.addEventListener("success",(()=>{o.sendData(i)})),s}}));const a=IDBFactory.prototype.deleteDatabase;this.originDrop=a,IDBFactory.prototype.deleteDatabase=function(e){const t=a.call(this,e),r={action:"drop",database:e};return t.addEventListener("success",(()=>{o.sendData(r)})),t}}async takeBasicInfo(){const e=await window.indexedDB.databases();if(!e.length)return null;const t=e.filter((e=>e.name&&e.version));if(!t.length)return null;const r=await Promise.all(t.map((e=>this.getDBData(e))));return r.filter(Boolean)}async getDBData(e){try{const t={name:e.name,version:e.version,stores:[]},r=await promisify(window.indexedDB.open(e.name,e.version));if(r.objectStoreNames.length){const e=[...r.objectStoreNames].map((e=>r.transaction(e,"readonly").objectStore(e)));t.stores=e.map((e=>{const{name:t,keyPath:r,autoIncrement:n,indexNames:o}=e;return{name:t,keyPath:r,autoIncrement:n,indexes:[...o]}}))}return t}catch(e){return psLog.error("Failed to get indexedDB data, more info: ".concat(e.message)),null}}async getStoreDataWithPagination(e){let{db:t,store:r,page:n}=e;const o={action:"get",database:null,store:null,page:{current:n,prev:null,next:null},total:0,data:[]};if(n<1)return o;const a=await promisify(window.indexedDB.open(t)),s=a.transaction(r,"readonly").objectStore(r);o.database={name:a.name,version:a.version},o.store={name:s.name,keyPath:s.keyPath,autoIncrement:s.autoIncrement,indexes:[...s.indexNames]},o.total=await promisify(s.count());const i=50*(n-1),c=50*n;o.page.prev=n>1?n-1:null,o.page.next=i+50<o.total?n+1:null;let l=0;const d=s.openCursor();return new Promise(((e,t)=>{d.addEventListener("success",(()=>{const t=d.result;t?(l>=i&&l<c&&o.data.push({key:t.key,value:t.value}),l++,t.continue()):e(o)})),d.addEventListener("error",t)}))}sendData(e){var t,r;if(!1===(null===(t=this.$pageSpyConfig)||void 0===t||null===(t=t.dataProcessor)||void 0===t||null===(r=t.database)||void 0===r?void 0:r.call(t,e)))return;const n=makeMessage("database",e);socketStore.broadcastMessage(n,!0),["update","clear","drop"].includes(e.action)&&socketStore.dispatchEvent("public-data",n)}}_defineProperty(DatabasePlugin,"hasInitd",!1);const joinQuery=e=>{const t=new URLSearchParams;return Object.entries(e).forEach((e=>{let[r,n]=e;t.append(r,String(n))})),t.toString()};class Request{constructor(e){if(this.config=e,!e.api)throw Error("The api base url cannot be empty")}get base(){return this.config.api}getScheme(){return this.config.enableSSL?["https://","wss://"]:["http://","ws://"]}createRoom(){const{project:e,title:t,useSecret:r,secret:n}=this.config,o=this.getScheme(),a=joinQuery({name:navigator.userAgent,group:e,title:t});return fetch("".concat(o[0]).concat(this.base,"/api/v1/room/create?").concat(a),{method:"POST",body:JSON.stringify({useSecret:r,secret:n})}).then((e=>e.json())).then((e=>{const{name:t,address:r}=e.data||{};return{roomUrl:this.getRoomUrl(r),address:r,name:t}})).catch((e=>{throw Error("Request create room failed: ".concat(e.message))}))}getRoomUrl(e){const t=this.getScheme(),{useSecret:r,secret:n}=this.config;return"".concat(t[1]).concat(this.base,"/api/v1/ws/room/join?").concat(joinQuery({address:e,name:"client:".concat(getRandomId()),userId:"Client",forceCreate:!0,useSecret:r,secret:n}))}}const STICKY_RADIUS="50%",FULLY_RADIUS="100%",POSITION_CACHE_ID="page-spy-position";function getPosition(e){return window.TouchEvent&&e instanceof TouchEvent?e.touches[0]:e}function moveable(e){const t=localStorage.getItem(POSITION_CACHE_ID);if(t){const[r,n]=t.split(",");+r<window.innerWidth&&+n<window.innerHeight&&(e.style.left="".concat(r,"px"),e.style.top="".concat(n,"px"))}let r,n;const o={xAxis:0,yAxis:0},a={x:0,y:0};function s(){if(!o.xAxis&&!o.yAxis)return;const{left:t,top:n}=e.getBoundingClientRect();t>0&&t<o.xAxis&&n>0&&n<o.yAxis?e.isHidden=!1:(r&&clearTimeout(r),r=setTimeout((()=>{r=null,e.disableHidden||(t<=0?e.classList.add("hidden-in-left"):t>=o.xAxis&&e.classList.add("hidden-in-right"),n<=0?e.classList.add("hidden-in-top"):n>=o.yAxis&&e.classList.add("hidden-in-bottom"),e.isHidden=!0)}),1e3))}function i(t){t.preventDefault();const{clientX:r,clientY:s}=getPosition(t),i=r-a.x,c=s-a.y;if([i,c].some((e=>Math.abs(e)>5))&&!e.isMoveEvent&&(e.isMoveEvent=!0,"mousemove"===t.type)){const t=r=>{r.stopImmediatePropagation(),e.removeEventListener("click",t,!0)};e.addEventListener("click",t,!0)}let l=n.x+i;l<=0?(l=0,e.style.setProperty("--left-radius",STICKY_RADIUS)):l>=o.xAxis?(l=o.xAxis,e.style.setProperty("--right-radius",STICKY_RADIUS)):(e.style.setProperty("--left-radius",FULLY_RADIUS),e.style.setProperty("--right-radius",FULLY_RADIUS));let d=n.y+c;d<=0?(d=0,e.style.setProperty("--top-radius",STICKY_RADIUS)):d>o.yAxis?(d=o.yAxis,e.style.setProperty("--bottom-radius",STICKY_RADIUS)):(e.style.setProperty("--top-radius",FULLY_RADIUS),e.style.setProperty("--bottom-radius",FULLY_RADIUS)),e.style.left="".concat(l,"px"),e.style.top="".concat(d,"px")}function c(){a.x=0,a.y=0;const{left:t,top:r}=e.getBoundingClientRect();localStorage.setItem(POSITION_CACHE_ID,"".concat(t,",").concat(r)),e.isMoveEvent=!1,s(),document.body.classList.remove("dragging"),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",i),document.removeEventListener("touchend",c)}function l(t){t.stopPropagation(),r&&clearTimeout(r),e.isHidden&&e.classList.remove("hidden-in-top","hidden-in-right","hidden-in-bottom","hidden-in-left"),e.isMoveEvent=!1,n=e.getBoundingClientRect(),o.xAxis=window.innerWidth-n.width,o.yAxis=window.innerHeight-n.height;const{clientX:s,clientY:l}=getPosition(t);a.x=s,a.y=l,document.body.classList.add("dragging"),document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",c,!1),document.addEventListener("touchmove",i,{capture:!1,passive:!1}),document.addEventListener("touchend",c,!1)}e.addEventListener("mousedown",l,!1),e.addEventListener("touchstart",l,!1),e.addEventListener("mouseover",(()=>{e.disableHidden=!0,e.isHidden&&e.classList.remove("hidden-in-top","hidden-in-right","hidden-in-bottom","hidden-in-left")}),!1),e.addEventListener("mouseleave",(()=>{e.disableHidden=!1,e.isMoveEvent||s()}),!1)}var img$3="data:image/svg+xml,%3csvg width='255' height='255' viewBox='0 0 255 255' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M183 24L81 126V141.5L90 150.5H105L145 110.5H160.5L169.5 119.5V133.5L72 231' stroke='url(%23paint0_linear_106_8)' stroke-width='25' stroke-linecap='round' /%3e %3cdefs%3e %3clinearGradient id='paint0_linear_106_8' x1='127.5' y1='24' x2='127.5' y2='231' gradientUnits='userSpaceOnUse'%3e %3cstop stop-color='%233D0C7C' /%3e %3cstop offset='0.519204' stop-color='%234E00B1' /%3e %3cstop offset='1' stop-color='%23EFDFFF' /%3e %3c/linearGradient%3e %3c/defs%3e%3c/svg%3e",img$2="data:image/svg+xml,%3csvg width='250' height='250' viewBox='0 0 250 250' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M62.7935 118.088L173.383 7.49889L174.046 6.83527C179.024 1.85756 187.095 1.85756 192.072 6.83527C197.028 11.7914 197.053 19.8192 192.127 24.8057L89.0585 129.147V133.294L91.8232 136.059H95.9703L138.164 93.8963L163.706 94.588L181.677 112.559V137.441L75.926 243.192C70.9635 248.155 62.9177 248.155 57.9552 243.192C52.9927 238.23 52.9928 230.184 57.9552 225.222L155.412 127.765V123.618L152.647 120.853H148.5L107.029 162.324H79.3819L62.7935 145.735V118.088Z' fill='white' /%3e%3c/svg%3e",_document$currentScri;const nodeId="__pageSpy",schema=extendConfigSchema((e=>e.object({clientOrigin:e.string().refine((e=>""===e||/^https?:\/\//i.test(e)),{message:"Invalid url"}),autoRender:e.boolean(),logo:e.string(),primaryColor:e.string(),modal:e.object({logo:e.string(),title:e.string()}).partial().strict(),gesture:e.nullable(e.array(e.union([e.literal("U"),e.literal("D"),e.literal("L"),e.literal("R")])).min(4)),lang:e.enum(["zh","en"])}).partial().strict()));class Config extends ConfigBase{constructor(){super(...arguments),_defineProperty(this,"schema",schema.superRefine(((e,t)=>{!1===e.offline&&(e.api&&e.clientOrigin||t.addIssue({code:"custom",message:'Must provide value when "offline" is false',path:[e.api?"clientOrigin":"api"]}))})))}get platform(){const e={clientOrigin:"",autoRender:!0,logo:img$3,primaryColor:"hsl(270, 100%, 55%)",modal:{logo:img$2,title:"PageSpy"},gesture:null,lang:"zh"};if(!Config.scriptLink)return e;try{const{host:t,origin:r,protocol:n}=new URL(Config.scriptLink);return{...e,api:t,clientOrigin:r,enableSSL:"http:"!==n}}catch(t){return e}}}_defineProperty(Config,"scriptLink",null===(_document$currentScri=document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src);var css_248z$2=".toast-d8zWd {\n  position: fixed;\n  left: 50%;\n  top: 10%;\n  transform: translate(-50%, 0);\n  display: flex;\n  gap: var(--gap);\n  align-items: center;\n  max-width: 50vw;\n  min-height: 2.29em;\n  padding: var(--input-padding);\n  font-size: var(--text-base);\n  line-height: 1;\n  color: white;\n  font-family: var(--font-family);\n  background-color: var(--primary-color);\n  border-radius: 0.29em;\n  box-shadow: var(--dark-shadow);\n  z-index: 99999;\n  opacity: 0;\n}\n.toast-d8zWd.show-IlurC {\n  opacity: 1;\n}\n.toast-d8zWd.show-IlurC {\n  animation: slideIn-4mB0Y 0.3s ease-in-out forwards;\n}\n@keyframes slideIn-4mB0Y {\n  0% {\n    transform: translate3d(-50%, 1.79em, 0);\n    opacity: 0;\n  }\n  80% {\n    transform: translate3d(-50%, -0.71em, 0);\n  }\n  100% {\n    transform: translate3d(-50%, 0, 0);\n    opacity: 1;\n  }\n}\n",classes$2={toast:"toast-d8zWd",show:"show-IlurC",slideIn:"slideIn-4mB0Y"};!function(){const e=document.createElement("style");e.setAttribute("data-page-spy-style","true"),e.textContent=css_248z$2,window.pageSpyStyles&&Array.isArray(window.pageSpyStyles)||(window.pageSpyStyles=[]),window.pageSpyStyles.push(e)}();const successSvg='\n<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">\n  <path fill="currentColor" fill-rule="evenodd"\n    d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-1.177-7.86l-2.765-2.767L7 12.431l3.119 3.121a1 1 0 0 0 1.414 0l5.952-5.95l-1.062-1.062z" />\n</svg>',errorSvg='<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">\n  <path fill="currentColor"\n    d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z" />\n</svg>',toastIconMap={success:successSvg,error:errorSvg};class Toast{static get root(){return document.querySelector("#".concat(nodeId))}static message(e){if(!Toast.root)return;let t=e;"string"==typeof t&&(t=document.createElement("div"),t.textContent=String(e)),t.classList.add("page-spy-toast",classes$2.toast),Toast.root.appendChild(t),setTimeout((()=>{t.classList.add(classes$2.show)}),0);const r=setTimeout((()=>{var e;null===(e=t)||void 0===e||e.remove(),Toast.timer===r&&(Toast.timer=null)}),3e3);Toast.timer=r}static show(e,t){const r=toastIconMap[e],n=(new DOMParser).parseFromString('\n      <div class="'.concat(classes$2.withIcon,'">\n        ').concat(r,"\n        <div>").concat(t,"</div>\n      </div>"),"text/html").querySelector(".".concat(classes$2.withIcon));Toast.message(n)}static destroy(){const e=document.querySelectorAll(".page-spy-toast");e.length&&([...e].forEach((e=>{e.remove()})),Toast.timer&&clearTimeout(Toast.timer)),Toast.timer=null}}_defineProperty(Toast,"timer",null);var img$1="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3e %3cg fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3e %3cpath d='M7 9.667A2.667 2.667 0 0 1 9.667 7h8.666A2.667 2.667 0 0 1 21 9.667v8.666A2.667 2.667 0 0 1 18.333 21H9.667A2.667 2.667 0 0 1 7 18.333z' /%3e %3cpath d='M4.012 16.737A2 2 0 0 1 3 15V5c0-1.1.9-2 2-2h10c.75 0 1.158.385 1.5 1' /%3e %3c/g%3e%3c/svg%3e",css_248z$1=".modal-rlFLa {\n  display: none;\n  position: fixed;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: 13000;\n  font-size: var(--text-base);\n  line-height: 1;\n}\n.modal-rlFLa.show {\n  display: block;\n}\n.modal-rlFLa.show {\n  animation: fadeIn-mXj-N 0.3s ease-in-out forwards;\n}\n@keyframes fadeIn-mXj-N {\n  0% {\n    background-color: hsla(0, 0%, 0%, 0);\n  }\n  100% {\n    background-color: hsla(0, 0%, 0%, 0.3);\n  }\n}\n.modal-rlFLa.show .content-KlWkz {\n  animation: scaleIn-JuIZH 0.3s ease-in forwards;\n}\n@keyframes scaleIn-JuIZH {\n  0% {\n    opacity: 0;\n    transform: translate3d(-50%, -50%, 0) scale(0.8);\n  }\n  70% {\n    opacity: 1;\n    transform: translate3d(-50%, -50%, 0) scale(1.1);\n  }\n  100% {\n    transform: translate3d(-50%, -50%, 0) scale(1);\n  }\n}\n.modal-rlFLa.leaving {\n  display: block;\n}\n.modal-rlFLa.leaving {\n  animation: fadeOut-daRKq 0.3s ease-in-out forwards;\n}\n@keyframes fadeOut-daRKq {\n  0% {\n    background-color: hsla(0, 0%, 0%, 0.3);\n  }\n  100% {\n    background-color: hsla(0, 0%, 0%, 0);\n  }\n}\n.modal-rlFLa.leaving .content-KlWkz {\n  animation: scaleOut-8Pf5H 0.3s ease-out forwards;\n}\n@keyframes scaleOut-8Pf5H {\n  0% {\n    opacity: 1;\n    transform: translate3d(-50%, -50%, 0) scale(1);\n  }\n  30% {\n    transform: translate3d(-50%, -50%, 0) scale(1.1);\n  }\n  60% {\n    opacity: 0;\n    transform: translate3d(-50%, -50%, 0) scale(0.9);\n  }\n  100% {\n    opacity: 0;\n    transform: translate3d(-50%, -50%, 0) scale(0.9);\n  }\n}\n.modal-rlFLa .content-KlWkz {\n  position: absolute;\n  left: 50%;\n  top: 45%;\n  transform: translate3d(-50%, -50%, 0);\n  width: 90%;\n  border-radius: 0.43em;\n  overflow: hidden;\n}\n.modal-rlFLa .content-KlWkz ::selection {\n  background-color: var(--primary-color);\n  color: white;\n}\n@media screen and (min-width: 440px) {\n  .modal-rlFLa .content-KlWkz {\n    max-width: 70%;\n  }\n}\n@media screen and (min-width: 768px) {\n  .modal-rlFLa .content-KlWkz {\n    max-width: 55%;\n  }\n}\n@media screen and (min-width: 1024px) {\n  .modal-rlFLa .content-KlWkz {\n    max-width: 40%;\n  }\n}\n@media screen and (min-width: 1440px) {\n  .modal-rlFLa .content-KlWkz {\n    max-width: 30%;\n  }\n}\n@media screen and (min-width: 1920px) {\n  .modal-rlFLa .content-KlWkz {\n    max-width: 25%;\n  }\n}\n.modal-rlFLa .header-M30Wi {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  padding: var(--block-padding);\n  color: white;\n  background-color: var(--primary-color);\n}\n.modal-rlFLa .header-M30Wi ::selection {\n  background-color: #fff;\n  color: var(--primary-color);\n}\n.modal-rlFLa .header-M30Wi .headerLeft-RfzaN {\n  display: flex;\n  align-items: center;\n  gap: var(--gap-lg);\n}\n.modal-rlFLa .header-M30Wi .headerLeft-RfzaN .logo-OM-Sp {\n  height: 2em;\n}\n.modal-rlFLa .header-M30Wi .headerLeft-RfzaN .title-J-P8k {\n  font-size: var(--text-xl);\n}\n.modal-rlFLa .header-M30Wi .headerRight-Y8nGg {\n  padding: 6px;\n  cursor: pointer;\n}\n.modal-rlFLa .header-M30Wi .headerRight-Y8nGg .close-bRwD3 {\n  width: 1.71em;\n  height: 1.71em;\n}\n.modal-rlFLa .main-SA0Hu {\n  padding: var(--block-padding);\n  background-color: white;\n}\n.modal-rlFLa .footer-op1wT {\n  display: flex;\n  justify-content: flex-end;\n  align-items: center;\n  gap: var(--gap-lg);\n  padding: var(--block-padding);\n  border-top: 1px solid var(--divider-color);\n  background-color: white;\n}\n.modal-rlFLa .footer-op1wT button {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  min-width: 4.29em;\n  padding: var(--input-padding);\n  gap: var(--gap);\n  letter-spacing: 0.4px;\n  border: var(--border);\n  border-radius: 0.29em;\n  background-color: white;\n  color: var(--text-primary);\n  cursor: pointer;\n  white-space: nowrap;\n  transition: all ease-in-out 100ms;\n  font-size: var(--text-base);\n}\n.modal-rlFLa .footer-op1wT button[data-primary] {\n  border-color: var(--primary-color);\n  background-color: var(--primary-color);\n  color: white;\n}\n.modal-rlFLa .footer-op1wT button[data-dashed] {\n  border-style: dashed;\n}\n.modal-rlFLa .footer-op1wT button:disabled {\n  border-color: var(--disabled-color);\n  background-color: var(--disabled-color);\n  color: white;\n  cursor: not-allowed;\n}\n.modal-rlFLa .footer-op1wT button:active {\n  opacity: 0.7;\n}\n.modal-rlFLa .footer-op1wT button img,\n.modal-rlFLa .footer-op1wT button svg {\n  width: 1.43em;\n  height: 1.43em;\n}\n@media screen and (max-width: 440px) {\n  .modal-rlFLa .footer-op1wT button img,\n  .modal-rlFLa .footer-op1wT button svg {\n    display: none;\n  }\n}\n",classes$1={modal:"modal-rlFLa",fadeIn:"fadeIn-mXj-N",content:"content-KlWkz",scaleIn:"scaleIn-JuIZH",fadeOut:"fadeOut-daRKq",scaleOut:"scaleOut-8Pf5H",header:"header-M30Wi",headerLeft:"headerLeft-RfzaN",logo:"logo-OM-Sp",title:"title-J-P8k",headerRight:"headerRight-Y8nGg",close:"close-bRwD3",main:"main-SA0Hu",footer:"footer-op1wT"};!function(){const e=document.createElement("style");e.setAttribute("data-page-spy-style","true"),e.textContent=css_248z$1,window.pageSpyStyles&&Array.isArray(window.pageSpyStyles)||(window.pageSpyStyles=[]),window.pageSpyStyles.push(e)}();var img="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3e %3cpath fill='white' d='m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z' /%3e%3c/svg%3e";const defaultConfig={logo:"",title:"",content:document.createElement("div"),footer:[],mounted:document.body};class modal{constructor(){if(new.target===modal)throw new Error("Cannot call `new modal()`")}static get rendered(){return modal.config.mounted.contains(modal.root)}static query(e){var t;return null===(t=modal.root)||void 0===t?void 0:t.querySelector(".".concat(e))}static build(e){modal.config={...modal.config,...e},modal.root||(modal.root=(new DOMParser).parseFromString(modal.template,"text/html").querySelector(".".concat(classes$1.modal)),modal.root.addEventListener("click",(e=>{e.stopPropagation(),modal.close()})),modal.query(classes$1.content).addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),modal.query(classes$1.headerRight).addEventListener("click",(()=>{modal.close()})),modal.query(classes$1.logo).setAttribute("src",modal.config.logo),modal.query(classes$1.title).textContent=modal.config.title)}static show(e){var t,r;if(!modal.root)return void psLog.info("modal has not been ready.");const{content:n,footer:o,mounted:a}=modal.config,s=null!==(t=null==e?void 0:e.content)&&void 0!==t?t:n,i=null!==(r=null==e?void 0:e.footer)&&void 0!==r?r:o,c=modal.query(classes$1.main),l=modal.query(classes$1.footer);c.innerHTML="",isString(s)?c.insertAdjacentHTML("afterbegin",s):c.appendChild(s),l.innerHTML="",i.forEach((e=>{isString(e)?l.insertAdjacentHTML("beforeend",e):l.insertAdjacentElement("beforeend",e)})),modal.rendered||a.appendChild(modal.root),modal.root.classList.add("show")}static close(){modal.root&&modal.rendered&&(modal.root.classList.remove("show"),modal.root.classList.add("leaving"),setTimeout((()=>{var e;null===(e=modal.root)||void 0===e||e.classList.remove("leaving")}),300))}static reset(){modal.config=defaultConfig,modal.root=null}}_defineProperty(modal,"config",defaultConfig),_defineProperty(modal,"template",'\n  <div class="'.concat(classes$1.modal,'">\n    <div class="').concat(classes$1.content,'">\n      \x3c!-- Header --\x3e\n      <div class="').concat(classes$1.header,'">\n        <div class="').concat(classes$1.headerLeft,'">\n          <img class="').concat(classes$1.logo,'" />\n          <b class="').concat(classes$1.title,'"></b>\n        </div>\n        <div class="').concat(classes$1.headerRight,'">\n          <img class="').concat(classes$1.close,'" src="').concat(img,'" />\n        </div>\n      </div>\n\n      \x3c!-- Main content --\x3e\n      <div class="').concat(classes$1.main,'"></div>\n\n      \x3c!-- Footer --\x3e\n      <div class="').concat(classes$1.footer,'"></div>\n    </div>\n  </div>\n  '));var css_248z="body.dragging {\n  -webkit-user-select: none;\n          user-select: none;\n}\nbody.dragging iframe {\n  pointer-events: none;\n}\n#__pageSpy {\n  --hue: 270;\n  --primary-color: hsl(var(--hue), 100%, 55%);\n  --text-primary: hsl(0, 0%, 10%);\n  --text-secondary: hsl(0, 0%, 30%);\n  --text-placeholder: hsl(0, 0%, 60%);\n  --divider-color: hsl(0, 0%, 90%);\n  --border-color: hsl(0, 0%, 70%);\n  --disabled-color: hsl(0, 0%, 75%);\n  --text-base: 14px;\n  --text-sm: 0.86em;\n  --text-lg: 1.14em;\n  --text-xl: 1.43em;\n  --text-2xl: 1.71em;\n  --text-3xl: 2.29em;\n  --input-padding: 0.43em 0.57em;\n  --input-padding-lg: 0.57em 0.86em;\n  --block-padding: 1em;\n  --gap: 0.29em;\n  --gap-lg: 0.57em;\n  --border: 1px solid var(--border-color);\n  --border-active: 1px solid var(--primary-color);\n  --light-shadow: 0 4px 10px 4px hsla(0, 0%, 100%, 0.1);\n  --dark-shadow: 0 4px 10px 4px hsla(0, 0%, 0%, 0.1);\n  --font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC',\n      'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', sans-serif;\n  font-size: var(--text-base);\n  font-family: var(--font-family);\n  line-height: 1;\n}\n#__pageSpy * {\n  box-sizing: border-box;\n  -webkit-tap-highlight-color: transparent;\n}\n#__pageSpy .page-spy-logo {\n  --top-radius: 100%;\n  --right-radius: 100%;\n  --bottom-radius: 100%;\n  --left-radius: 100%;\n  position: fixed;\n  right: 2.85714286em;\n  bottom: 5.71428571em;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  width: 5.71em;\n  height: 5.71em;\n  font-size: var(--text-base);\n  border-radius: 5.71em;\n  background-color: white;\n  box-shadow: var(--dark-shadow);\n  cursor: pointer;\n  z-index: 13000;\n  transition: opacity ease-in-out 0.3s, transform ease-in-out 0.3s, background-color ease-in-out 0.3s, filter ease-in-out 0.3s;\n}\n#__pageSpy .page-spy-logo.inactive {\n  background-color: hsl(0, 0%, 70%);\n  filter: grayscale(1);\n}\n#__pageSpy .page-spy-logo::after {\n  content: '';\n  display: block;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  transform: rotateZ(45deg);\n  background-color: white;\n  border-top-left-radius: var(--top-radius);\n  border-top-right-radius: var(--right-radius);\n  border-bottom-right-radius: var(--bottom-radius);\n  border-bottom-left-radius: var(--left-radius);\n  transition: border-radius linear 0.15s;\n}\n#__pageSpy .page-spy-logo .hidden-mixin {\n  opacity: 0.35;\n}\n#__pageSpy .page-spy-logo.hidden-in-top {\n  opacity: 0.35;\n  transform: translateY(-65%);\n}\n#__pageSpy .page-spy-logo.hidden-in-top img {\n  transform: translateY(30%);\n}\n#__pageSpy .page-spy-logo.hidden-in-right {\n  opacity: 0.35;\n  transform: translateX(65%);\n}\n#__pageSpy .page-spy-logo.hidden-in-right img {\n  transform: translateX(-30%);\n}\n#__pageSpy .page-spy-logo.hidden-in-bottom {\n  opacity: 0.35;\n  transform: translateY(65%);\n}\n#__pageSpy .page-spy-logo.hidden-in-bottom img {\n  transform: translateY(-30%);\n}\n#__pageSpy .page-spy-logo.hidden-in-left {\n  opacity: 0.35;\n  transform: translateX(-65%);\n}\n#__pageSpy .page-spy-logo.hidden-in-left img {\n  transform: translateX(30%);\n}\n#__pageSpy .page-spy-logo img {\n  position: relative;\n  display: block;\n  z-index: 100;\n  transition: transform ease-in-out 0.1s 0.4s;\n  width: 3.57em;\n  pointer-events: none;\n  -webkit-user-select: none;\n          user-select: none;\n}\n.connectInfo-9svvO {\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  gap: var(--gap);\n}\n.connectInfo-9svvO > p {\n  flex: 1 0 0;\n  text-align: center;\n  word-break: break-word;\n}\n.connectInfo-9svvO > p span {\n  font-size: var(--text-sm);\n  color: var(--text-placeholder);\n}\n.connectInfo-9svvO > p b {\n  display: block;\n  margin-top: 0.86em;\n  font-size: var(--text-lg);\n  color: var(--text-primary);\n}\n",classes={connectInfo:"connectInfo-9svvO"};!function(){const e=document.createElement("style");e.setAttribute("data-page-spy-style","true"),e.textContent=css_248z,window.pageSpyStyles&&Array.isArray(window.pageSpyStyles)||(window.pageSpyStyles=[]),window.pageSpyStyles.push(e)}();var version="2.2.1";const locales={zh:{copyLink:"复制在线调试链接",copied:"复制成功",copyFailed:"复制失败"},en:{copyLink:"Copy online debug link",copied:"Copied",copyFailed:"Copy failed"}},i18n=new Translation({locales:locales});class PageSpy{static get pluginsWithOrder(){return[...PageSpy.plugins.pre,...PageSpy.plugins.normal,...PageSpy.plugins.post]}static registerPlugin(e){if(!e)return;if(isClass(e))return void psLog.error("PageSpy.registerPlugin() expect to pass an instance, not a class");if(!e.name)return void psLog.error("The ".concat(e.constructor.name,' plugin should provide a "name" property'));const t=PageSpy.pluginsWithOrder.some((t=>t.name===e.name));if(t)return void psLog.info("The ".concat(e.name,' has registered. Consider the following reasons:\n      - Duplicate register one same plugin;\n      - Plugin\'s "name" conflict with others, you can print all registered plugins by "PageSpy.plugins";'));PageSpy.plugins[e.enforce||"normal"].push(e)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(_defineProperty(this,"root",null),_defineProperty(this,"version",version),_defineProperty(this,"request",null),_defineProperty(this,"address",""),_defineProperty(this,"socketStore",socketStore),_defineProperty(this,"config",new Config),_defineProperty(this,"cacheTimer",null),PageSpy.instance)return psLog.warn("Cannot initialize PageSpy multiple times"),PageSpy.instance;const t=this.config.mergeConfig(e);isArray$1(t.gesture)?a(t.gesture,(()=>{PageSpy.instance||this.init()})):this.init()}async init(){PageSpy.instance=this;const e=this.config.get();e.lang&&i18n.setLang(e.lang),this.updateConfiguration(),this.triggerPlugins("onInit",{config:e,socketStore:socketStore}),!1===e.offline&&(this.request=new Request(e),this.cacheIsInvalid()?await this.createNewConnection():this.useOldConnection(),document.addEventListener("visibilitychange",(()=>{!document.hidden&&socketStore.getSocket().getState()!==SocketState.OPEN&&socketStore.connectable&&this.useOldConnection()}))),psLog.log("Plugins inited"),e.autoRender&&this.render()}updateConfiguration(){const{messageCapacity:e,offline:t,useSecret:r}=this.config.get();if(!0===r){const e=JSON.parse(sessionStorage.getItem(ROOM_SESSION_KEY));this.config.set("secret",(null==e?void 0:e.secret)||getAuthSecret())}socketStore.connectable=!0,socketStore.getPageSpyConfig=()=>this.config.get(),socketStore.getClient=()=>PageSpy.client,socketStore.isOffline=t,socketStore.messageCapacity=e}cacheIsInvalid(){try{const e=sessionStorage.getItem(ROOM_SESSION_KEY);if(!e)return!0;const t=JSON.parse(e);if(!t.address)return!0;const r=this.config.get();return["project","title","useSecret"].some((e=>t[e]!==r[e]))}catch(e){return!0}}async createNewConnection(){if(!this.request)return void psLog.error("Cannot get the Request");const e=await this.request.createRoom();this.address=e.address,socketStore.init(e.roomUrl),sessionStorage.removeItem(ROOM_SESSION_KEY),this.refreshRoomInfo()}useOldConnection(){var e;const t=sessionStorage.getItem(ROOM_SESSION_KEY);if(!t)throw new Error("The cache info is invalid when useOldConnection");const{address:r}=JSON.parse(t);this.address=r,this.refreshRoomInfo();const n=null===(e=this.request)||void 0===e?void 0:e.getRoomUrl(this.address);n&&socketStore.init(n)}refreshRoomInfo(){this.saveSession(),this.cacheTimer=setInterval((()=>{socketStore.getSocket().getState()===SocketState.OPEN&&this.saveSession()}),15e3)}saveSession(){const{project:e,title:t,useSecret:r,secret:n}=this.config.get(),o=JSON.stringify({address:this.address,project:e,title:t,useSecret:r,secret:n});sessionStorage.setItem(ROOM_SESSION_KEY,o)}triggerPlugins(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const{disabledPlugins:o}=this.config.get();PageSpy.pluginsWithOrder.forEach((t=>{var n;isArray$1(o)&&o.length&&o.includes(t.name)||null===(n=t[e])||void 0===n||n.apply(t,[{...r[0],modal:modal,toast:Toast},r.slice(1)])}))}render(){if(document.querySelector("#".concat(nodeId)))psLog.warn("Cannot render the widget because it has been in the DOM");else if(void 0!==document)"loading"===document.readyState?window.addEventListener("DOMContentLoaded",this.render.bind(this)):this.startRender();else{let e;const t=()=>{document&&"complete"===document.readyState?(e&&clearTimeout(e),this.startRender()):e=setTimeout(t,1)};e=setTimeout(t,1)}}startRender(){var e;const t=this.config.get(),{project:r,clientOrigin:n,title:o,logo:a,useSecret:s,secret:i,primaryColor:c,modal:l,offline:d}=t,u=(new DOMParser).parseFromString('\n      \x3c!-- PageSpy Root Container --\x3e\n      <div id="'.concat(nodeId,'" style="--primary-color: hsl(270, 100%, 55%)">\n        <div class="page-spy-logo">\n          <img src="').concat(a,'" alt="Logo" />\n        </div>\n      </div>\n\n      \x3c!-- Default content for modal --\x3e\n      <div class="').concat(classes.connectInfo,'">\n        <p>\n          <span>Device ID</span>\n          <b style="font-family: \'Monaco\'" class="page-spy-device-id">\n            ').concat(this.address.slice(0,4)||"--","\n          </b>\n        </p>\n        ").concat(s&&i?'\n        <p>\n          <span>Secret</span>\n          <b class="page-spy-secret">'.concat(i,"</b>\n        </p>"):"",'\n        <p>\n          <span>Project</span>\n          <b class="page-spy-project">').concat(r,'</b>\n        </p>\n        <p>\n          <span>Title</span>\n          <b class="page-spy-title">').concat(o,'</b>\n        </p>\n      </div>\n\n      \x3c!-- Default button for modal --\x3e\n      <button class="page-spy-btn" data-primary id="page-spy-copy-link">\n        <img src="').concat(img$1,'" alt="Copy" />\n        <span>').concat(i18n.t("copyLink"),"</span>\n      </button>\n    "),"text/html"),p=e=>u.querySelector.call(u,e),f=p("#".concat(nodeId));f.style.setProperty("--primary-color",c),null===(e=window.pageSpyStyles)||void 0===e||e.forEach((e=>{f.appendChild(e.cloneNode(!0))})),this.root=f;const h=p(".page-spy-logo");moveable(h);h.addEventListener("click",(()=>{h.isMoveEvent||modal.show()}),!1),window.addEventListener("sdk-inactive",(()=>{h.classList.add("inactive")}));const y=(g=classes.connectInfo,p(".".concat(g)));var g;const m=p("#page-spy-copy-link");m.addEventListener("click",(()=>{let e="".concat(n,"/#/devtools?address=").concat(encodeURIComponent(this.address));s&&(e+="&secret=".concat(i));const t=copy$1(e)?i18n.t("copied"):i18n.t("copyFailed");modal.close(),Toast.message(t)})),d&&(m.disabled=!0,m.title="In Offline Mode"),modal.build({logo:l.logo||img$2,title:l.title||"PageSpy",content:y,footer:[m],mounted:f}),document.documentElement.insertAdjacentElement("beforeend",f),this.triggerPlugins("onMounted",{config:t,root:f,socketStore:socketStore}),this.handleDeviceDPR(),psLog.log("Render success")}handleDeviceDPR(){const e=window.devicePixelRatio||1,t=document.querySelector('[name="viewport"]');if(t){const r=(t.getAttribute("content")||"").match(/initial-scale=\d+(\.\d+)?/);(r?parseFloat(r[0].split("=")[1]):1)<1&&(this.root.style.fontSize="".concat(14*e,"px"))}}updateRoomInfo(e){if(!e)return;const{project:t,title:r}=e;if(t){this.config.set("project",String(t));const e=document.querySelector(".page-spy-project");e&&(e.textContent=String(t))}if(r){this.config.set("title",String(r));const e=document.querySelector(".page-spy-title");e&&(e.textContent=String(r))}socketStore.updateRoomInfo()}abort(){this.triggerPlugins("onReset"),PageSpy.instance=null,socketStore.close(),modal.reset();const e=document.querySelector("#".concat(nodeId));e&&document.documentElement.removeChild(e)}}_defineProperty(PageSpy,"instance",null),_defineProperty(PageSpy,"plugins",{pre:[],normal:[],post:[]}),_defineProperty(PageSpy,"client",new Client({ua:navigator.userAgent,sdk:"browser",sdkVersion:version}));const INTERNAL_PLUGINS=[new ConsolePlugin,new ErrorPlugin,new NetworkPlugin,new StoragePlugin,new DatabasePlugin,new PagePlugin,new SystemPlugin];return INTERNAL_PLUGINS.forEach((e=>{PageSpy.registerPlugin(e)})),PageSpy}();
//# sourceMappingURL=index.min.js.map


  }
}